diff options
author | Simon Rettberg | 2022-07-18 17:12:09 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-07-18 17:12:09 +0200 |
commit | ef2cfecbd7e13781c01dfc5f58c6892a8bf43085 (patch) | |
tree | d2ece10a1ed79a9d52b1457a50288f1169b0691d | |
parent | [run-virt] Add forced logout option to pvs toolbar (diff) | |
download | mltk-ef2cfecbd7e13781c01dfc5f58c6892a8bf43085.tar.gz mltk-ef2cfecbd7e13781c01dfc5f58c6892a8bf43085.tar.xz mltk-ef2cfecbd7e13781c01dfc5f58c6892a8bf43085.zip |
[...] Don't allow locking autologin/guest sessions either
3 files changed, 20 insertions, 7 deletions
diff --git a/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver b/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver index 441d9243..86a9995a 100755 --- a/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver +++ b/core/modules/idleaction/data/etc/X11/Xsession.d/95-xscreensaver @@ -34,6 +34,8 @@ if command -v xscreensaver; then elif ! [ "$SBY" -ge 0 ]; then # isNumeric? SBY=0 fi + # Guest session/auto login, don't lock + [ "$GUEST_SESSION" = "True" ] && NEVER_LOCK=True # If web based login, we can't authenticate again as we don't have the password - never lock if [ -z "$NEVER_LOCK" ]; then usrname="$( < "/etc/passwd" awk -v "uid=$UID" -F ':' '$3 == uid {print $5; exit}' )" diff --git a/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/guest-session b/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/guest-session index eb3205aa..3ca52dba 100755 --- a/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/guest-session +++ b/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/guest-session @@ -2,6 +2,8 @@ . /opt/openslx/config +export GUEST_SESSION=True + GUESTDIR="/opt/openslx/lightdm/autologin.d" if [ -d "$GUESTDIR" ]; then for file in $GUESTDIR/*; do diff --git a/core/modules/xscreensaver/data/opt/openslx/pvs2/lockDesktop.sh b/core/modules/xscreensaver/data/opt/openslx/pvs2/lockDesktop.sh index 8b759e3c..1443f8fd 100755 --- a/core/modules/xscreensaver/data/opt/openslx/pvs2/lockDesktop.sh +++ b/core/modules/xscreensaver/data/opt/openslx/pvs2/lockDesktop.sh @@ -1,18 +1,27 @@ #!/bin/ash -[ -z "$UID" ] && UID="$( id -u )" +# Cannot lock guest session, as the user probably doesn't know +# demo's password +if [ "$GUEST_SESSION" = "True" ]; then + xmessage "Gastsitzungen koennen nicht gesperrt werden." + exit 0 +fi +# Browser-based login sessions cannot be unlocked for technical reasons, +# so disallow locking +[ -z "$UID" ] && UID="$( id -u )" usrname="$( < "/etc/passwd" awk -v "uid=$UID" -F ':' '$3 == uid {print $5; exit}' )" # Yes, this really checks if $usrname ends in @browser, and sets NEVER_LOCK to true if so if [ "${usrname%"@browser"}" != "${usrname}" ]; then xmessage "Web-Basierte Logins koennen die Sitzung leider nicht sperren." exit 0 -else - . /opt/openslx/config - if [ -n "$SLX_EXAM" ]; then - xmessage "Im Klausurmodus nicht moeglich" - exit 0 - fi +fi + +# Don't allow locking in exam mode +. /opt/openslx/config +if [ -n "$SLX_EXAM" ]; then + xmessage "Im Klausurmodus nicht moeglich" + exit 0 fi # Any mouse-ungrab logic is embedded in our modded xscreensaver now, |