diff options
author | Simon Rettberg | 2019-04-08 15:37:02 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-04-08 15:37:02 +0200 |
commit | b82ff6aa9972262474c0bbc34a802ea0c098a08b (patch) | |
tree | 5629d7e558725305879ebb541d9e041be4f21235 /core/modules/pam-slx-plug | |
parent | [hardware-stats] Add missing su(do) exclusion to session open hook (diff) | |
download | mltk-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.
Diffstat (limited to 'core/modules/pam-slx-plug')
-rwxr-xr-x | core/modules/pam-slx-plug/data/opt/openslx/pam/exec_auth | 3 |
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 |