From 5acda3eaeabae9045609539303a8c12c4ce401f1 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 25 Apr 2016 12:01:08 +0200 Subject: merge with latest dev version --- .../data/opt/openslx/scripts/pam_script_ses_open | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 core/modules/pam/data/opt/openslx/scripts/pam_script_ses_open (limited to 'core/modules/pam/data/opt/openslx/scripts/pam_script_ses_open') diff --git a/core/modules/pam/data/opt/openslx/scripts/pam_script_ses_open b/core/modules/pam/data/opt/openslx/scripts/pam_script_ses_open new file mode 100755 index 00000000..8ab34708 --- /dev/null +++ b/core/modules/pam/data/opt/openslx/scripts/pam_script_ses_open @@ -0,0 +1,25 @@ +#!/bin/ash + +# Needed as pam_script clears PATH +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin" + +# NSA needs to know +if [ "x$PAM_SERVICE" != "xsu" -a "x$PAM_SERVICE" != "xsudo" ]; then + . /opt/openslx/config + if [ "x$SLX_REMOTE_LOG_SESSIONS" = "xyes" -o "x$PAM_USER" = "xroot" ]; then + slxlog "session-open" "$PAM_USER logged in on $PAM_TTY" + elif [ "x$SLX_REMOTE_LOG_SESSIONS" = "xanonymous" ]; then + slxlog "session-open" "User logged in on $PAM_TTY" + fi +fi + +# source the stuff in pam_script_ses_open.d, if it exists +if [ -d "/opt/openslx/scripts/pam_script_ses_open.d" ]; then + for HOOK in $(ls "/opt/openslx/scripts/pam_script_ses_open.d"); do + # source it, in case of failure do nothing since these scripts are non-critical + . "/opt/openslx/scripts/pam_script_ses_open.d/$HOOK" || slxlog "pam-source-hooks" "Could not source '$HOOK'." + done +fi + +exit 0 + -- cgit v1.2.3-55-g7522