summaryrefslogtreecommitdiffstats
path: root/test/test-functions
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2021-08-05 15:34:37 +0200
committerFranck Bui <fbui@suse.com>2021-08-18 17:37:55 +0200
commit138f761904d8630adc2b333ae43e309577d6f65a (patch)
treea7156cd2c99a95e2e0e811dd80d27d9e0a5f285c /test/test-functions
parentRevert "test: adapt TEST-13-NSPAWN-SMOKE for SUSE" (diff)
downloadsystemd-138f761904d8630adc2b333ae43e309577d6f65a.tar.xz
systemd-138f761904d8630adc2b333ae43e309577d6f65a.zip
test: adapt install_pam() for openSUSE
On openSUSE the default pam config files are shipped in /usr/etc/pam.d. Also empty password is not allowed by default.
Diffstat (limited to '')
-rw-r--r--test/test-functions9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/test-functions b/test/test-functions
index fe3081106f..8b8c89a206 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -1587,7 +1587,7 @@ install_pam() {
paths+=(/lib*/security)
fi
- for d in /etc/pam.d /etc/security /usr/lib/pam.d; do
+ for d in /etc/pam.d /etc/security /usr/{etc,lib}/pam.d; do
[ -d "$d" ] && paths+=("$d")
done
@@ -1601,6 +1601,13 @@ install_pam() {
# set empty root password for easy debugging
sed -i 's/^root:x:/root::/' "${initdir:?}/etc/passwd"
+
+ # And make sure pam_unix will accept it by making sure that
+ # the PAM module has the nullok option.
+ for d in /etc/pam.d /usr/{etc,lib}/pam.d; do
+ [ -d "$initdir/$d" ] || continue
+ sed -i '/^auth.*pam_unix.so/s/$/ nullok/' "$initdir/$d"/*
+ done
}
install_keymaps() {