aboutsummaryrefslogtreecommitdiff
path: root/libbb/correct_password.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-04-13 13:04:05 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-04-13 13:04:05 +0200
commita3de0b3b86deb37c2adc993c6357c1a31b7ecb5b (patch)
tree19aa5e71448b03b2aea9aa2cad42a9a5d9066dc1 /libbb/correct_password.c
parent335681ca8e39144fa19814f7ba10d0fe760e4055 (diff)
downloadbusybox-a3de0b3b86deb37c2adc993c6357c1a31b7ecb5b.tar.gz
libbb: make check_password() also return CHECKPASS_PW_HAS_EMPTY_PASSWORD
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/correct_password.c')
-rw-r--r--libbb/correct_password.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/correct_password.c b/libbb/correct_password.c
index 3436edc30..f4635a5bc 100644
--- a/libbb/correct_password.c
+++ b/libbb/correct_password.c
@@ -63,7 +63,7 @@ static const char *get_passwd(const struct passwd *pw, char buffer[SHADOW_BUFSIZ
}
/*
- * Return 1 if PW has an empty password.
+ * Return CHECKPASS_PW_HAS_EMPTY_PASSWORD if PW has an empty password.
* Return 1 if the user gives the correct password for entry PW,
* 0 if not.
* NULL pw means "just fake it for login with bad username"
@@ -77,7 +77,7 @@ int FAST_FUNC check_password(const struct passwd *pw, const char *plaintext)
pw_pass = get_passwd(pw, buffer);
if (!pw_pass[0]) { /* empty password field? */
- return 1;
+ return CHECKPASS_PW_HAS_EMPTY_PASSWORD;
}
encrypted = pw_encrypt(plaintext, /*salt:*/ pw_pass, 1);