fix, no longer unconditionally abort pam for user accounts with locked passwords

as locked user accounts might have valid sudoers exceptions

Thanks to @mimp for the bug report!

https://forums.whonix.org/t/pam-abort-on-locked-password-and-running-privileged-command-from-web-browser/10521
This commit is contained in:
Patrick Schleizer 2020-11-05 06:42:47 -05:00
parent 211769dc65
commit dfe9b0f6c7
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -15,7 +15,7 @@ fi
if [ "$(echo "$passwd_output" | cut -d ' ' -f 2)" = "P" ]; then
true "INFO: Password not locked."
else
echo "$0: ERROR: Password for user \"$PAM_USER\" is locked." >&2
echo "$0: INFO: Password for user \"$PAM_USER\" is locked."
if [ -f /usr/share/whonix/marker ] || [ -f /usr/share/kicksecure/marker ]; then
if [ "$PAM_USER" = "root" ]; then
@ -28,7 +28,7 @@ else
## Should not unconditionally 'exit 1' here.
## Locked user accounts might have valid sudoers exceptions.
## https://forums.whonix.org/t/pam-abort-on-locked-password-and-running-privileged-command-from-web-browser/10521
exit 1
exit 0
fi
exit 0