diff options
author | Simon Rettberg | 2018-01-18 13:46:35 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-01-18 13:46:35 +0100 |
commit | 01e008a9577155f6b0875b207e42f1c2bbd087f4 (patch) | |
tree | d505e3236867c6953e25b4ebd5a4f1b606c217a1 /core/modules/idleaction | |
parent | [run-virt] add --sync to slxlog calls (diff) | |
download | mltk-01e008a9577155f6b0875b207e42f1c2bbd087f4.tar.gz mltk-01e008a9577155f6b0875b207e42f1c2bbd087f4.tar.xz mltk-01e008a9577155f6b0875b207e42f1c2bbd087f4.zip |
Fix UID/USER ambiguity in several places
Diffstat (limited to 'core/modules/idleaction')
-rwxr-xr-x | core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script index e9752eb4..5ae2432c 100755 --- a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script +++ b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script @@ -48,7 +48,9 @@ if [ -n "${SLX_LOGOUT_TIMEOUT}" ] && [ "${SLX_LOGOUT_TIMEOUT}" -gt 0 ]; then # Now that we have DISPLAY and XAUTHORITY set, xprintidle should work if [ -z "$IDLE" ]; then # Try user's xauth - USRHOME=$(/usr/bin/getent passwd "$NAME" | awk -F ':' '{print $6}') + USERID=$(id -u "$NAME") + [ -z "$USERID" ] && USERID="$NAME" + USRHOME=$(/usr/bin/getent passwd "$USERID" | awk -F ':' '{print $6}') export XAUTHORITY="$USRHOME/.Xauthority" [ -f "$XAUTHORITY" ] && IDLE=$(xprintidle) fi |