diff options
author | Nick Rosbrook <enr0n@ubuntu.com> | 2024-08-06 02:43:15 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-08-06 13:02:58 +0200 |
commit | 18a8f03e5160ca3828d327d9bbd1b32f26d792a3 (patch) | |
tree | 6d57dacfbb1688b169634ce5d13ed67a76e44c0c /test/test-sysusers | |
parent | Merge pull request #33942 from yuwata/udevadm-info-attribute-walk-json (diff) | |
download | systemd-18a8f03e5160ca3828d327d9bbd1b32f26d792a3.tar.xz systemd-18a8f03e5160ca3828d327d9bbd1b32f26d792a3.zip |
sysusers: check if requested group name matches user name in queue
When creating a user, check if the requested group name matches a user
name in the queue. If that matched user name is also going to be a group
name, then use it for the new user too. In other words, allow the
following:
u foo -
u bar -:foo
when both foo and bar are new users.
Fixes #33547
Diffstat (limited to 'test/test-sysusers')
-rw-r--r-- | test/test-sysusers/test-16.expected-group | 1 | ||||
-rw-r--r-- | test/test-sysusers/test-16.expected-passwd | 2 | ||||
-rw-r--r-- | test/test-sysusers/test-16.input | 7 |
3 files changed, 10 insertions, 0 deletions
diff --git a/test/test-sysusers/test-16.expected-group b/test/test-sysusers/test-16.expected-group new file mode 100644 index 0000000000..54918e417a --- /dev/null +++ b/test/test-sysusers/test-16.expected-group @@ -0,0 +1 @@ +foo:x:SYSTEM_UGID_MAX: diff --git a/test/test-sysusers/test-16.expected-passwd b/test/test-sysusers/test-16.expected-passwd new file mode 100644 index 0000000000..8823813f82 --- /dev/null +++ b/test/test-sysusers/test-16.expected-passwd @@ -0,0 +1,2 @@ +foo:x:SYSTEM_UGID_MAX:SYSTEM_UGID_MAX::/:NOLOGIN +bar:x:300:SYSTEM_UGID_MAX::/:NOLOGIN diff --git a/test/test-sysusers/test-16.input b/test/test-sysusers/test-16.input new file mode 100644 index 0000000000..2d80d81c0c --- /dev/null +++ b/test/test-sysusers/test-16.input @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# Test fix for https://github.com/systemd/systemd/issues/33547. +# +#Type Name ID +u foo - +u bar 300:foo |