summaryrefslogtreecommitdiffstats
path: root/core/modules/pam-slx-plug/data/opt/openslx/pam/common/homedir-passwd
diff options
context:
space:
mode:
authorSimon Rettberg2018-12-04 13:20:56 +0100
committerSimon Rettberg2018-12-04 13:20:56 +0100
commit12abcf349af03264d1e038064976e5c34579391a (patch)
tree051ee6c04d419657436984f09b2a5cb7a7886ea1 /core/modules/pam-slx-plug/data/opt/openslx/pam/common/homedir-passwd
parent[beamergui] Respawn beamergui if closed (diff)
downloadmltk-12abcf349af03264d1e038064976e5c34579391a.tar.gz
mltk-12abcf349af03264d1e038064976e5c34579391a.tar.xz
mltk-12abcf349af03264d1e038064976e5c34579391a.zip
[pam-slx-plug] Use caps from LDAP; allow running auth as user
Allow running exec_auth if the checked user is the user the script is running as. When writing user to /etc/passwd, use the spelling as supplied from the LDAP server.
Diffstat (limited to 'core/modules/pam-slx-plug/data/opt/openslx/pam/common/homedir-passwd')
-rw-r--r--core/modules/pam-slx-plug/data/opt/openslx/pam/common/homedir-passwd5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/modules/pam-slx-plug/data/opt/openslx/pam/common/homedir-passwd b/core/modules/pam-slx-plug/data/opt/openslx/pam/common/homedir-passwd
index 006f1c81..53ed1a5b 100644
--- a/core/modules/pam-slx-plug/data/opt/openslx/pam/common/homedir-passwd
+++ b/core/modules/pam-slx-plug/data/opt/openslx/pam/common/homedir-passwd
@@ -19,9 +19,10 @@ fi
readonly USER_HOME
# Add/replace passwd entry if it doesn't exist yet
-LINE_PASS="${USER_NAME}:x:${USER_UID}:${USER_GID}:${USER_NAME}:${USER_HOME}:/bin/bash"
+LINE_PASS="${USER_NAME}:x:${USER_UID}:${USER_GID}:${USER_NAME}@SLX:${USER_HOME}:/bin/bash"
readonly LINE_PASS
if ! grep -Fxq -- "${LINE_PASS}" /etc/passwd; then
- sed -i "/^${USER_NAME}:/d" /etc/passwd
+ # Make sure there's no existing line with same uid or uidNumber
+ sed -i -r "/^${USER_NAME}:/d;/^[^:]*:x:${USER_UID}:/d" /etc/passwd
echo "${LINE_PASS}" >> /etc/passwd
fi