summaryrefslogtreecommitdiffstats
path: root/remote/modules/pam
diff options
context:
space:
mode:
authorManuel Schneider2013-12-13 10:19:45 +0100
committerManuel Schneider2013-12-13 10:19:45 +0100
commitd3eeda7d767e38c6a99bd6b9defa1cec6e7a733a (patch)
tree7ca9f0d6628ac118e85c2e1f652c2fd1df0dcba5 /remote/modules/pam
parent[cups] duplex on RZFARBE as standard (diff)
parent[vmchooser] Fix NFS fallback once again (diff)
downloadtm-scripts-d3eeda7d767e38c6a99bd6b9defa1cec6e7a733a.tar.gz
tm-scripts-d3eeda7d767e38c6a99bd6b9defa1cec6e7a733a.tar.xz
tm-scripts-d3eeda7d767e38c6a99bd6b9defa1cec6e7a733a.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/pam')
-rwxr-xr-xremote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close4
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