diff options
author | Simon Rettberg | 2018-12-04 13:20:56 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-12-04 13:20:56 +0100 |
commit | 12abcf349af03264d1e038064976e5c34579391a (patch) | |
tree | 051ee6c04d419657436984f09b2a5cb7a7886ea1 /core/modules/pam-slx-plug/data/opt/openslx/pam/common/homedir-passwd | |
parent | [beamergui] Respawn beamergui if closed (diff) | |
download | mltk-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-passwd | 5 |
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 |