-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checktrust: Alert user on greeter if workstation lost trust
Install three new files into the system: - /etc/xdg/lightdm/lightdm.conf.d/50-use-wrapper.conf - /usr/libexec/lightdm-greeter-wrapper - /usr/libexec/lightdm-show-trust-warning The first file adds a configuration option to lightdm to invoke the greeter via a wrapper. The second file is the wrapper script, which forks of the third script before exec-ing into the greeter. The third script uses /usr/sbin/trustcheck to find out whether we lost trust of the other nodes. If it gets a negative verdict, it shows a dialog on top of the login screen to alert the user about the condition. If it doesn't get a verdict, it keeps asking (e.g. when the network is not plugged in). xdotool is used to raise the dialog above the (full screen) login window. This has to be done in a loop, because we don't know how long the login windows needs to appear and pop up in front of the dialog.
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#! /bin/bash | ||
(/usr/libexec/lightdm-show-trust-warning &) | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#! /usr/bin/bash | ||
|
||
while true; do | ||
reply="$(/usr/sbin/checktrust)" | ||
if [ "$reply" = "trusted" ]; then | ||
break | ||
elif [ "$reply" = "not trusted" ]; then | ||
if [ -z "$XDOPID" ]; then | ||
(while true; do xdotool search --sync --name bla windowraise; sleep 1; done) & | ||
XDOPID=$! | ||
fi | ||
xdotool search --sync --name bla windowraise & | ||
zenity --width 400 --error --title bla --text \ | ||
"<b>Loss of trust detected!</b> | ||
Looks like your machine lost the trust of our network. Maybe it was offline for too long. | ||
<i>You won't be able to log in.</i> | ||
<b>Please contact IT Helpdesk</b> | ||
helpdesk@molgen.mpg.de | ||
phone: -1708" | ||
continue | ||
fi | ||
sleep 5 | ||
done | ||
test -n "$XDOPID" && kill $XDOPID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[Seat:*] | ||
greeter-wrapper=/usr/libexec/lightdm-greeter-wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters