mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-01-09 22:57:53 +07:00
better output if trying to login with non-existing user
This commit is contained in:
parent
b2bdeb9095
commit
5031e7cc4b
@ -1,6 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$(passwd -S "$PAM_USER" | cut -d ' ' -f 2)" = "P" ]; then
|
||||
if ! passwd_output="$(passwd -S "$PAM_USER" 2>/dev/null)" ; then
|
||||
echo "$0: ERROR: user \"$PAM_USER\" does not exist." >&2
|
||||
exit 1
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user