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 | |
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
7 files changed, 11 insertions, 11 deletions
diff --git a/remote/modules/alsa/data/opt/openslx/scripts/alsa-default_card b/remote/modules/alsa/data/opt/openslx/scripts/alsa-default_card index 4edfcdd5..ebdf6043 100755 --- a/remote/modules/alsa/data/opt/openslx/scripts/alsa-default_card +++ b/remote/modules/alsa/data/opt/openslx/scripts/alsa-default_card @@ -12,7 +12,7 @@ if [ -w "/etc" ]; then elif [ -n "$HOME" ]; then FILE="${HOME}/.asoundrc" else - FILE="$(getent passwd root | awk -F ':' '{print $6}')/.asoundrc" + FILE="$(/usr/bin/getent passwd root | awk -F ':' '{print $6}')/.asoundrc" fi if [ -e "${FILE}" -a "x$1" != "x--force" ]; then diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script index ad74def0..17633caa 100755 --- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script +++ b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script @@ -28,7 +28,7 @@ if [ -n "${SLX_LOGOUT_TIMEOUT}" ] && [ "${SLX_LOGOUT_TIMEOUT}" -gt 0 ]; then # X11 if [ -n "$DISPLAY" ]; then # Seems to be x11 - USRHOME=$(getent passwd "$NAME" | awk -F ':' '{print $6}') + USRHOME=$(/usr/bin/getent passwd "$NAME" | awk -F ':' '{print $6}') export XAUTHORITY="$USRHOME/.Xauthority" # Now that we have DISPLAY and XAUTHORITY set, xprintidle should work IDLE=$(xprintidle) 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" || \ diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/run-virt/data/opt/openslx/scripts/vmchooser-run_virt index cd13ca81..21c01df6 100755 --- a/remote/modules/run-virt/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/run-virt/data/opt/openslx/scripts/vmchooser-run_virt @@ -496,7 +496,7 @@ fi >> "${LOGFILE}" 2>&1 # Start printer daemon QUEUE="STANDARD" # This has to match the queue you configured in your VM -USER="$(whoami)" +USER="$(/usr/bin/whoami)" SPOOLDIR= ### Disabled: 100megs is not enough, some jobs are HUGE, try to use temp which should be on disk ## Try using user's tmpfs home first, as it gets wiped on logout diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include index 471a207c..3d55fe78 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include @@ -428,7 +428,7 @@ conffile="${confdir}/run-vmware.conf" # diskfile diskfile="${vmpath}" # users vmware config folder -[ -z "${HOME}" ] && HOME=$(getent passwd "$(whoami)" | awk -F ':' '{print $6}') +[ -z "${HOME}" ] && HOME=$(/usr/bin/getent passwd "$(/usr/bin/whoami)" | awk -F ':' '{print $6}') vmhome="${HOME}/.vmware" # get several version infos for vmware/player diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog index 1ce43e3f..08852352 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/slxlog @@ -47,7 +47,7 @@ if [ $# -lt 2 ]; then else MSG="$2" fi -USER=$(whoami) +USER=$(/usr/bin/whoami) MSG="[$USER] $MSG" if [ $# -gt 2 ]; then |