Skip to content

Commit

Permalink
pam-info refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
adrelanos committed Nov 16, 2022
1 parent 487f63b commit caf0099
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions usr/libexec/security-misc/pam-info
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ set -o pipefail
## Debugging.
who_ami="$(whoami)"

if [ ! "$(id -u)" = "0" ]; then
## as user "user"
## /usr/sbin/faillock -u user
## faillock: Error opening /var/log/tallylog for update: Permission denied
## /usr/sbin/faillock: Authentication error
##
## xscreensaver runs as user "user", therefore pam_faillock cannot function.
## xscreensaver has its own failed login counter.
##
## https://askubuntu.com/questions/983183/how-lock-the-unlock-screen-after-wrong-password-attempts
##
## https://www.whonix.org/pipermail/whonix-devel/2019-September/001439.html
## TODO: echo -> true
echo "$0: not started as root, exiting."
exit 0
fi

grep_result="$(grep "accessfile=/etc/security/access-security-misc.conf" /etc/pam.d/common-account 2>/dev/null)"

## Check if grep matched something.
Expand Down Expand Up @@ -62,23 +79,6 @@ fi

## https://forums.whonix.org/t/how-strong-do-linux-user-account-passwords-have-to-be-when-using-full-disk-encryption-fde-too/7698

if [ ! "$(id -u)" = "0" ]; then
## as user "user"
## /usr/sbin/faillock -u user
## faillock: Error opening /var/log/tallylog for update: Permission denied
## /usr/sbin/faillock: Authentication error
##
## xscreensaver runs as user "user", therefore pam_faillock cannot function.
## xscreensaver has its own failed login counter.
##
## https://askubuntu.com/questions/983183/how-lock-the-unlock-screen-after-wrong-password-attempts
##
## https://www.whonix.org/pipermail/whonix-devel/2019-September/001439.html
## TODO: echo -> true
echo "$0: not started as root, exiting."
exit 0
fi

## Does not work (yet) for login, pam_securetty runs before and aborts.
## Also this should only run for login since securetty covers only login.
# if [ "$PAM_USER" = "root" ]; then
Expand Down

0 comments on commit caf0099

Please sign in to comment.