mirror of
https://git.proxmox.com/git/systemd
synced 2026-08-26 19:06:01 +00:00
libnss-systemd: also let userdbd manage passwords
As of upstream commit: https://github.com/systemd/systemd/commit/f43a19ecd6e3415e in v249 userdbd can also synthesize shadow/gshadow records, so add the shadow config to nsswitch.conf on installation.
This commit is contained in:
Vendored
+4
-2
@@ -2,8 +2,8 @@
|
||||
|
||||
set -e
|
||||
|
||||
# try to insert the systemd entry to the "passwd" and "group" lines in
|
||||
# /etc/nsswitch.conf to automatically enable libnss-systemd support; do not
|
||||
# try to insert the systemd entry to the "passwd", "group", "shadow" and "gshadow"
|
||||
# lines in /etc/nsswitch.conf to automatically enable libnss-systemd support; do not
|
||||
# change the configuration if the lines already contain "systemd"
|
||||
insert_nss_entry() {
|
||||
echo "Checking NSS setup..."
|
||||
@@ -27,6 +27,8 @@ insert_nss_entry() {
|
||||
}
|
||||
s/^(passwd:\s+)(.*)/$1.insert($2)/e;
|
||||
s/^(group:\s+)(.*)/$1.insert($2)/e;
|
||||
s/^(shadow:\s+)(.*)/$1.insert($2)/e;
|
||||
s/^(gshadow:\s+)(.*)/$1.insert($2)/e;
|
||||
' /etc/nsswitch.conf
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -19,7 +19,7 @@ remove_nss_entry() {
|
||||
return
|
||||
fi
|
||||
# we must remove possible [foo=bar] options as well
|
||||
sed -i -r "/(passwd|group):/ s/[[:space:]]+$module\b([[:space:]]*\[[^]]*\])*//" $file
|
||||
sed -i -r "/(passwd|group|shadow|gshadow):/ s/[[:space:]]+$module\b([[:space:]]*\[[^]]*\])*//" $file
|
||||
}
|
||||
|
||||
if [ "$1" = remove ]; then
|
||||
|
||||
Reference in New Issue
Block a user