pam_tally2-info: fix, do nothing when started as user "user"

xscreensaver runs as user "user", therefore pam_tally2 cannot function.
xscreensaver has its own failed login counter.

as user "user"
/sbin/pam_tally2 -u user
pam_tally2: Error opening /var/log/tallylog for update: Permission denied
/sbin/pam_tally2: Authentication error

https://askubuntu.com/questions/983183/how-lock-the-unlock-screen-after-wrong-password-attempts

https://forums.whonix.org/t/how-strong-do-linux-user-account-passwords-have-to-be-when-using-full-disk-encryption-fde-too/7698
This commit is contained in:
Patrick Schleizer 2019-09-16 12:30:23 +00:00
parent c2e444479c
commit bec680d4f3
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -1,5 +1,19 @@
#!/bin/bash
if [ ! "$(id -u)" = "0" ]; then
## as user "user"
## /sbin/pam_tally2 -u user
## pam_tally2: Error opening /var/log/tallylog for update: Permission denied
## /sbin/pam_tally2: Authentication error
##
## xscreensaver runs as user "user", therefore pam_tally2 cannot function.
## xscreensaver has its own failed login counter.
##
## https://askubuntu.com/questions/983183/how-lock-the-unlock-screen-after-wrong-password-attempts
true "$0: not started as root, exiting."
exit 0
fi
pam_tally2_output="$(pam_tally2 --user "$PAM_USER")"
if [ "$pam_tally2_output" = "" ]; then