diff options
| author | Simon Rettberg | 2015-05-18 19:05:11 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2015-05-18 19:05:11 +0200 |
| commit | c4a6233acd4fb6ec0d62d95bd6a996f2cb5f79fc (patch) | |
| tree | 67985b287e2b6573a97698a1d345f3833be9fbf6 /remote/modules/pam | |
| parent | Merge branch 'master' of dnbd3:openslx-ng/tm-scripts (diff) | |
| download | tm-scripts-c4a6233acd4fb6ec0d62d95bd6a996f2cb5f79fc.tar.gz tm-scripts-c4a6233acd4fb6ec0d62d95bd6a996f2cb5f79fc.tar.xz tm-scripts-c4a6233acd4fb6ec0d62d95bd6a996f2cb5f79fc.zip | |
Hardwired path of whoami/id/getent, but we should check all scripts and force PATH in critical ones
Diffstat (limited to 'remote/modules/pam')
| -rwxr-xr-x | remote/modules/pam/data/opt/openslx/scripts/pam_script_auth | 8 | ||||
| -rwxr-xr-x | remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth b/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth index 623658d0..65eefcdc 100755 --- a/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth +++ b/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth @@ -12,12 +12,12 @@ if ldapsearch -l 3 -o nettimeout=3 -x -LLL uid="${PAM_USER}" uid homeMount realA [ -n "$PCASE" ] && PAM_USER=$PCASE fi -PASSWD=$(getent passwd "$PAM_USER") +PASSWD=$(/usr/bin/getent passwd "$PAM_USER") USER_UID=$(echo "$PASSWD" | awk -F ':' '{print $3}') USER_GID=$(echo "$PASSWD" | awk -F ':' '{print $4}') USER_HOME=$(echo "$PASSWD" | awk -F ':' '{print $6}') -[ -z "$USER_UID" ] && USER_UID=$(id -u "$PAM_USER") -[ -z "$USER_GID" ] && USER_GID=$(id -g "$PAM_USER") +[ -z "$USER_UID" ] && USER_UID=$(/usr/bin/id -u "$PAM_USER") +[ -z "$USER_GID" ] && USER_GID=$(/usr/bin/id -g "$PAM_USER") [ -z "$USER_HOME" ] && USER_HOME="/home/$PAM_USER" if [ -z "$USER_UID" -o -z "$USER_GID" ]; then slxlog "pam-get-ids" "Could not determine UID or GID for user '$PAM_USER'." @@ -28,7 +28,7 @@ fi TEMP_HOME_DIR="$USER_HOME" # check if the script runs as root -[ "x$(whoami)" != "xroot" ] && exit 0 +[ "x$(/usr/bin/whoami)" != "xroot" ] && exit 0 # check if PAM_USER is root and skip if it is the case [ "x${PAM_USER}" == "xroot" ] && exit 0 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 9332e0a6..6b8cb3b2 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 @@ -16,7 +16,7 @@ fi # do not kill all root processes :) [ "x${PAM_USER}" = "xroot" ] && exit 0 # can only work if script is run as root -[ "x$(whoami)" = "xroot" ] || exit 0 +[ "x$(/usr/bin/whoami)" = "xroot" ] || exit 0 # source hooks if there are any if [ -d "/opt/openslx/scripts/pam_script_ses_close.d" ]; then @@ -60,7 +60,7 @@ if [ "$SESSIONCOUNT" -le "1" ]; then if [ -z "$OPEN2" -o "x$OPENSESSION" = "x$OPEN2" ]; then # unmount the home directory structure - USER_HOME=$(getent passwd "$PAM_USER" | awk -F ':' '{print $6}') + USER_HOME=$(/usr/bin/getent passwd "$PAM_USER" | awk -F ':' '{print $6}') PERSISTENT="$USER_HOME/PERSISTENT" if [ -d "$PERSISTENT" ]; then umount -l -f "$PERSISTENT" || \ |
