ubase

suckless linux base utils
git clone git://git.2f30.org/ubase.git
Log | Files | Refs | README | LICENSE

commit 60500e376a85653a1417d8597cfb74ff147960d7
parent d745889805558b4e0d03d360d66b38c54a143520
Author: sin <sin@2f30.org>
Date:   Mon Jun  9 13:03:19 +0100

Print "incorrect password" when checking empty passwords as well

Diffstat:
util/passwd.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/util/passwd.c b/util/passwd.c @@ -24,8 +24,12 @@ pw_check(struct passwd *pw, const char *pass) return -1; } - if (pw->pw_passwd[0] == '\0') - return pass[0] == '\0' ? 1 : 0; + if (pw->pw_passwd[0] == '\0') { + if (pass[0] == '\0') + return 1; + weprintf("incorrect password\n"); + return 0; + } if (pw->pw_passwd[0] == 'x' && pw->pw_passwd[1] == '\0') { errno = 0;