sysusers: check if requested group name matches user name in queue
authorNick Rosbrook <enr0n@ubuntu.com>
Tue, 6 Aug 2024 00:43:15 +0000 (20:43 -0400)
committerLuca Boccassi <bluca@debian.org>
Thu, 15 Aug 2024 13:04:41 +0000 (14:04 +0100)
commitedf52384c2e99cd5af9bcd4ae4b13fd8f79596d3
tree68da406d56bccc06a7af289322774d5b2e02e610
parentb50419e83856566564d27b8a0b69459617609dac
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

(cherry picked from commit 18a8f03e5160ca3828d327d9bbd1b32f26d792a3)
src/sysusers/sysusers.c
test/test-sysusers/test-16.expected-group [new file with mode: 0644]
test/test-sysusers/test-16.expected-passwd [new file with mode: 0644]
test/test-sysusers/test-16.input [new file with mode: 0644]