1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-06 12:58:22 +03:00
Zbigniew Jędrzejewski-Szmek aa923cab34 basic/user-util: always use base 10 for user/group numbers
We would parse numbers with base prefixes as user identifiers. For example,
"0x2b3bfa0" would be interpreted as UID==45334432 and "01750" would be
interpreted as UID==1000. This parsing was used also in cases where either a
user/group name or number may be specified. This means that names like
0x2b3bfa0 would be ambiguous: they are a valid user name according to our
documented relaxed rules, but they would also be parsed as numeric uids.

This behaviour is definitely not expected by users, since tools generally only
accept decimal numbers (e.g. id, getent passwd), while other tools only accept
user names and thus will interpret such strings as user names without even
attempting to convert them to numbers (su, ssh). So let's follow suit and only
accept numbers in decimal notation. Effectively this means that we will reject
such strings as a username/uid/groupname/gid where strict mode is used, and try
to look up a user/group with such a name in relaxed mode.

Since the function changed is fairly low-level and fairly widely used, this
affects multiple tools: loginctl show-user/enable-linger/disable-linger foo',
the third argument in sysusers.d, fourth and fifth arguments in tmpfiles.d,
etc.

Fixes #15985.

(cherry picked from commit 156a5fd297b61bce31630d7a52c15614bf784843)
(cherry picked from commit 9498903de6c1f7b0c3e5f1654d0ee451a304c59d)
(cherry picked from commit 1d1f5006cbe239b29092602f59baa062f4ef95c6)
2020-09-20 12:47:27 +02:00
2019-07-08 16:55:31 +02:00
2020-02-05 18:05:43 +01:00
2019-09-21 23:07:00 +02:00
2019-11-19 10:32:49 +01:00
2019-04-12 08:30:31 +02:00
2019-04-12 08:30:31 +02:00
2018-12-10 03:07:17 +09:00
2019-04-02 17:31:00 +02:00
2019-04-12 08:30:31 +02:00
2016-10-06 11:53:58 -04:00
2019-09-03 11:27:19 +02:00
2019-08-15 17:34:56 +00:00
2020-02-05 17:44:05 +01:00

systemd - System and Service Manager

Count of open issues over time Count of open pull requests over time Semaphore CI Build Status
Coverity Scan Status
Fuzzit Status
OSS-Fuzz Status
CII Best Practices
Travis CI Build Status
Language Grade: C/C++
CentOS CI Build Status
Build Status

Details

General information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.

Stable branches with backported patches are available in the stable repo.

Description
Backports of patch from systemd git to stable distributions
Readme 226 MiB
Languages
C 89.4%
Python 5.8%
Shell 2.1%
Meson 1.3%
HTML 0.9%
Other 0.4%