]> git.ipfire.org Git - thirdparty/systemd.git/commit
nss-systemd: set USERDB_SUPPRESS_SHADOW flag when looking up user records
authorLennart Poettering <lennart@poettering.net>
Wed, 5 May 2021 13:53:07 +0000 (15:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 8 May 2021 12:25:24 +0000 (14:25 +0200)
commit09001dbdc88f447656d79822bbff9c6d7ed7e5cf
tree0f156b419ce3771e71dd2025385900200f3e1966
parent3d56acef7f73fd7a2e9f23b89340e0849283078d
nss-systemd: set USERDB_SUPPRESS_SHADOW flag when looking up user records

Setting the flags means we won#t try to read the data from /etc/shadow
when reading a user record, thus slightly making conversion quicker and
reducing the chance of generating MAC faults, because we needlessly
access a privileged resource. Previously, passing the flag didn't
matter, when converting our JSON records to NSS since the flag only had
an effect on whether to use NSS getspnam() and related calls or not. But
given that we turn off NSS anyway as backend for this conversion (since
we want to avoid NSS loops, where we turn NSS data to our JSON user
records, and then to NSS forever and ever) it was unnecessary to pass
it.

This changed in one of the previous commits however, where we added
support for reading user definitions from drop-in files, with separate
drop-in files for the shadow data.
src/nss-systemd/userdb-glue.c