diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-10-25 09:22:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-25 09:22:03 +0200 |
commit | c4363051e448ca1893903ff41db7b224bc8547ed (patch) | |
tree | 30cc0497d8ce52abafa525f87d87e13c663375be /test/units | |
parent | Merge pull request #34875 from poettering/userdbctl-filter (diff) | |
parent | test: add quick test to verify the PAM stack really ran in all run0 modes of ... (diff) | |
download | systemd-c4363051e448ca1893903ff41db7b224bc8547ed.tar.xz systemd-c4363051e448ca1893903ff41db7b224bc8547ed.zip |
Merge pull request #34880 from poettering/change-user-on-pam-always
core: make sure that if PAMName= is set we always do the full user ch…
Diffstat (limited to 'test/units')
-rwxr-xr-x | test/units/TEST-74-AUX-UTILS.run.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/units/TEST-74-AUX-UTILS.run.sh b/test/units/TEST-74-AUX-UTILS.run.sh index 5b46e11409..3ef9c88d79 100755 --- a/test/units/TEST-74-AUX-UTILS.run.sh +++ b/test/units/TEST-74-AUX-UTILS.run.sh @@ -238,10 +238,13 @@ if [[ -e /usr/lib/pam.d/systemd-run0 ]] || [[ -e /etc/pam.d/systemd-run0 ]]; the run0 ls / assert_eq "$(run0 echo foo)" "foo" # Check if we set some expected environment variables - for arg in "" "--user=root" "--user=testuser"; do + for arg in "" "--user=root" "--user=0" "--user=testuser"; do assert_eq "$(run0 ${arg:+"$arg"} bash -c 'echo $SUDO_USER')" "$USER" assert_eq "$(run0 ${arg:+"$arg"} bash -c 'echo $SUDO_UID')" "$(id -u "$USER")" assert_eq "$(run0 ${arg:+"$arg"} bash -c 'echo $SUDO_GID')" "$(id -u "$USER")" + + # Validate that we actually went properly through PAM (XDG_SESSION_TYPE is set by pam_systemd) + assert_eq "$(run0 ${arg:+"$arg"} bash -c 'echo $XDG_SESSION_TYPE')" "unspecified" done # Let's chain a couple of run0 calls together, for fun readarray -t cmdline < <(printf "%.0srun0\n" {0..31}) |