From c4a6233acd4fb6ec0d62d95bd6a996f2cb5f79fc Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 May 2015 19:05:11 +0200 Subject: Hardwired path of whoami/id/getent, but we should check all scripts and force PATH in critical ones --- remote/modules/pam/data/opt/openslx/scripts/pam_script_auth | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'remote/modules/pam/data/opt/openslx/scripts/pam_script_auth') 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 -- cgit v1.2.3-55-g7522