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/data/opt/openslx/scripts/pam_script_auth | |
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/data/opt/openslx/scripts/pam_script_auth')
-rwxr-xr-x | remote/modules/pam/data/opt/openslx/scripts/pam_script_auth | 8 |
1 files changed, 4 insertions, 4 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 |