summaryrefslogtreecommitdiffstats
path: root/core/modules/pam-bwidm
diff options
context:
space:
mode:
authorSimon Rettberg2022-07-18 11:55:39 +0200
committerSimon Rettberg2022-07-18 11:55:39 +0200
commit1aba33d3ccebaf726c4090d7aeab43547b20429a (patch)
tree9d2f14337526460df899facd84087cadfb6e9881 /core/modules/pam-bwidm
parent[run-virt/hardware-stats] Don't print status of service (diff)
downloadmltk-1aba33d3ccebaf726c4090d7aeab43547b20429a.tar.gz
mltk-1aba33d3ccebaf726c4090d7aeab43547b20429a.tar.xz
mltk-1aba33d3ccebaf726c4090d7aeab43547b20429a.zip
[pam-bwidm] Add marker to username
Helps us to determine that the user logged in via ECP or Browser later on.
Diffstat (limited to 'core/modules/pam-bwidm')
-rwxr-xr-xcore/modules/pam-bwidm/data/opt/openslx/scripts/pam_bwidm5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/modules/pam-bwidm/data/opt/openslx/scripts/pam_bwidm b/core/modules/pam-bwidm/data/opt/openslx/scripts/pam_bwidm
index b148918d..5215eccc 100755
--- a/core/modules/pam-bwidm/data/opt/openslx/scripts/pam_bwidm
+++ b/core/modules/pam-bwidm/data/opt/openslx/scripts/pam_bwidm
@@ -238,6 +238,7 @@ auth_user() {
write_user_data() {
# auth succeeded, create and map a local user to this bwIDM user
+ local gexp LOOPS usrname
echo "Login for '$USER_USERNAME' on '$USER_ORGANISATION' succeeded."
gexp="$( printf "%s" "${PAM_USER}" | sed 's/[][$^\.*]/\\&/g' )" # Basic regexp
if ! grep -q "^${gexp}:" /etc/passwd; then
@@ -256,7 +257,9 @@ write_user_data() {
fi
# we have a uid, gid, lets just create the local user now
- echo "${PAM_USER}:x:${USER_UID}:${USER_GID}:${PAM_USER}:/home/${PAM_USER}:/bin/bash" >> /etc/passwd
+ # mark with @ecp or @browser
+ usrname="${PAM_USER}@${mode}"
+ echo "${PAM_USER}:x:${USER_UID}:${USER_GID}:${usrname}:/home/${PAM_USER}:/bin/bash" >> /etc/passwd
fi
exit 0
}