mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-05-02 11:06:04 -04:00
better output if trying to login with non-existing user
This commit is contained in:
parent
b2bdeb9095
commit
5031e7cc4b
1 changed files with 6 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue