sysusers: handle NSS errors gracefully
authorLuca Boccassi <bluca@debian.org>
Thu, 4 Jul 2024 09:23:04 +0000 (10:23 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 4 Jul 2024 14:43:51 +0000 (16:43 +0200)
commitfc9938d6f8e7081df5420bf88bf98f683b1391c0
treee0d466f078d77ee12d8cb145109135354bae3a0d
parent74cbe244ecdd1c8f77b1e2574b73fa26850ea950
sysusers: handle NSS errors gracefully

If the io.systemd.DynamicUser or io.systemd.Machine files exist,
but nothing is listening on them, the nss-systemd module returns
ECONNREFUSED and systemd-sysusers fails to creat the user/group.

This is problematic when ran by packaging scripts, as the package
assumes that after this has run, the user/group exist and can
be used. adduser does not fail in the same situation.

Change sysusers to print a loud warning but otherwise continue
when NSS returns an error.
src/sysusers/sysusers.c
test/units/TEST-74-AUX-UTILS.sysusers.sh [new file with mode: 0755]