]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shared/user-record.c
sysusers: look at login.defs when setting the default range to allocate users
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 25 Sep 2020 15:16:06 +0000 (17:16 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Oct 2020 17:53:45 +0000 (19:53 +0200)
commitaa25270cb22f5f7ca2b18c288d4e15bbc6eb239e
tree9202acc83c3b26cfca9be040931c1b4ea304da19
parent044df624aaa7293f82d2da48eb553cdf0ac780d9
sysusers: look at login.defs when setting the default range to allocate users

Also, even if login.defs are not present, don't start allocating at 1, but at
SYSTEM_UID_MIN.

Fixes #9769.

The test is adjusted. Actually, it was busted before, because sysusers would
never use SYSTEM_GID_MIN, so if SYSTEM_GID_MIN was different than
SYSTEM_UID_MIN, the tests would fail. On all "normal" systems the two are
equal, so we didn't notice. Since sysusers now always uses the minimum of the
two, we only need to substitute one value.
18 files changed:
meson.build
src/shared/user-record.c
src/shared/user-record.h
src/sysusers/sysusers.c
src/test/test-user-record.c
test/test-sysusers.sh.in
test/test-sysusers/test-10.expected-group
test/test-sysusers/test-10.expected-passwd
test/test-sysusers/test-13.expected-group
test/test-sysusers/test-13.expected-passwd
test/test-sysusers/test-14.expected-passwd
test/test-sysusers/test-2.expected-group
test/test-sysusers/test-2.expected-passwd
test/test-sysusers/test-2.input
test/test-sysusers/test-6.expected-group
test/test-sysusers/test-6.expected-passwd
test/test-sysusers/test-8.expected-passwd
test/test-sysusers/test-9.expected-passwd