aboutsummaryrefslogtreecommitdiff
path: root/libbb/correct_password.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2017-05-29 14:20:10 +0100
committerRon Yorston <rmy@pobox.com>2017-05-29 14:34:28 +0100
commitda4f331955bed8afda670afcd58d524a04a0faa9 (patch)
treef6a3879aefdd714240f8c022375f687b512d2238 /libbb/correct_password.c
parent74163a535fd21f5fcca4c052d2e7c192d3e264fa (diff)
parent6683d1cbb44859f549f87f882545b84b9369585c (diff)
downloadbusybox-w32-da4f331955bed8afda670afcd58d524a04a0faa9.tar.gz
busybox-w32-da4f331955bed8afda670afcd58d524a04a0faa9.tar.bz2
busybox-w32-da4f331955bed8afda670afcd58d524a04a0faa9.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb/correct_password.c')
-rw-r--r--libbb/correct_password.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libbb/correct_password.c b/libbb/correct_password.c
index 513c93028..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
63} 63}
64 64
65/* 65/*
66 * Return 1 if PW has an empty password. 66 * Return CHECKPASS_PW_HAS_EMPTY_PASSWORD if PW has an empty password.
67 * Return 1 if the user gives the correct password for entry PW, 67 * Return 1 if the user gives the correct password for entry PW,
68 * 0 if not. 68 * 0 if not.
69 * NULL pw means "just fake it for login with bad username" 69 * 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)
77 77
78 pw_pass = get_passwd(pw, buffer); 78 pw_pass = get_passwd(pw, buffer);
79 if (!pw_pass[0]) { /* empty password field? */ 79 if (!pw_pass[0]) { /* empty password field? */
80 return 1; 80 return CHECKPASS_PW_HAS_EMPTY_PASSWORD;
81 } 81 }
82 82
83 encrypted = pw_encrypt(plaintext, /*salt:*/ pw_pass, 1); 83 encrypted = pw_encrypt(plaintext, /*salt:*/ pw_pass, 1);
@@ -88,7 +88,7 @@ int FAST_FUNC check_password(const struct passwd *pw, const char *plaintext)
88 88
89 89
90/* Ask the user for a password. 90/* Ask the user for a password.
91 * Return 1 without asking if PW has an empty password. 91 * Return CHECKPASS_PW_HAS_EMPTY_PASSWORD without asking if PW has an empty password.
92 * Return -1 on EOF, error while reading input, or timeout. 92 * Return -1 on EOF, error while reading input, or timeout.
93 * Return 1 if the user gives the correct password for entry PW, 93 * Return 1 if the user gives the correct password for entry PW,
94 * 0 if not. 94 * 0 if not.
@@ -105,7 +105,7 @@ int FAST_FUNC ask_and_check_password_extended(const struct passwd *pw,
105 105
106 pw_pass = get_passwd(pw, buffer); 106 pw_pass = get_passwd(pw, buffer);
107 if (!pw_pass[0]) /* empty password field? */ 107 if (!pw_pass[0]) /* empty password field? */
108 return 1; 108 return CHECKPASS_PW_HAS_EMPTY_PASSWORD;
109 109
110 plaintext = bb_ask(STDIN_FILENO, timeout, prompt); 110 plaintext = bb_ask(STDIN_FILENO, timeout, prompt);
111 if (!plaintext) { 111 if (!plaintext) {