diff options
| author | Simon Rettberg | 2013-12-12 19:08:04 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2013-12-12 19:08:04 +0100 |
| commit | 20ce232c145199d32e9ee3b38367023caa2cf0bd (patch) | |
| tree | 26a5027645ac23722fc3438d9b8c8411e2382d3d /remote | |
| parent | [pam-freiburg] Fix mounting of homes from sunfs6 (diff) | |
| download | tm-scripts-20ce232c145199d32e9ee3b38367023caa2cf0bd.tar.gz tm-scripts-20ce232c145199d32e9ee3b38367023caa2cf0bd.tar.xz tm-scripts-20ce232c145199d32e9ee3b38367023caa2cf0bd.zip | |
[pam] Fix session cleanup after last logout: su/sudo would not create a new session with logind, so an active user session could have been killed
Diffstat (limited to 'remote')
| -rwxr-xr-x | remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close index 535cd0d6..198d2efe 100755 --- a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close +++ b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close @@ -13,6 +13,10 @@ slxlog "session-close" "$PAM_USER logged out on $PAM_TTY" OPENSESSION=$(loginctl show-user "$PAM_USER" | grep "Sessions=" | cut -c 10-) SESSIONCOUNT=$(echo "$OPENSESSION" | wc -w) +# When using su/sudo there is no session created, so count up by one +if [ "x$PAM_SERVICE" = "xsu" -o "x$PAM_SERVICE" = "xsudo" ]; then + SESSIONCOUNT=$(( $SESSIONCOUNT + 1 )) +fi if [ "$SESSIONCOUNT" = "1" ]; then # last sessions, close all ghost user processes |
