summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-04-08 15:37:02 +0200
committerSimon Rettberg2019-04-08 15:37:02 +0200
commitb82ff6aa9972262474c0bbc34a802ea0c098a08b (patch)
tree5629d7e558725305879ebb541d9e041be4f21235
parent[hardware-stats] Add missing su(do) exclusion to session open hook (diff)
downloadmltk-b82ff6aa9972262474c0bbc34a802ea0c098a08b.tar.gz
mltk-b82ff6aa9972262474c0bbc34a802ea0c098a08b.tar.xz
mltk-b82ff6aa9972262474c0bbc34a802ea0c098a08b.zip
[pam-slx-plug] Stop execution early if not run as root
Running home directory mounts, group fiddling etc. doesn't make any sense if the script is not run in root context.
-rwxr-xr-xcore/modules/pam-slx-plug/data/opt/openslx/pam/exec_auth3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/modules/pam-slx-plug/data/opt/openslx/pam/exec_auth b/core/modules/pam-slx-plug/data/opt/openslx/pam/exec_auth
index 6bbe8bdc..cd8a2ecd 100755
--- a/core/modules/pam-slx-plug/data/opt/openslx/pam/exec_auth
+++ b/core/modules/pam-slx-plug/data/opt/openslx/pam/exec_auth
@@ -88,6 +88,9 @@ if [ "$(echo "${USER_UID}${USER_GID}${USER_GROUP}${USER_HOME}" | wc -l)" != "1"
exit 1
fi
+# If not run as root, we're done here as the directory mount stuff etc. doesn't make any sense
+[ "$SCRIPT_USER" = "root" ] || exit 0
+
# Make sure group exists locally
GROUPENT=
if [ -n "$USER_GID" ]; then