* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ''AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-
#include "libbb.h"
#define SHADOW_BUFSIZE 256
}
/*
- * 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"
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);
/* Ask the user for a password.
- * Return 1 without asking if PW has an empty password.
+ * Return CHECKPASS_PW_HAS_EMPTY_PASSWORD without asking if PW has an empty password.
* Return -1 on EOF, error while reading input, or timeout.
* Return 1 if the user gives the correct password for entry PW,
* 0 if not.
pw_pass = get_passwd(pw, buffer);
if (!pw_pass[0]) /* empty password field? */
- return 1;
+ return CHECKPASS_PW_HAS_EMPTY_PASSWORD;
- plaintext = bb_ask(STDIN_FILENO, timeout, prompt);
+ plaintext = bb_ask_noecho(STDIN_FILENO, timeout, prompt);
if (!plaintext) {
/* EOF (such as ^D) or error (such as ^C) or timeout */
return -1;