2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

For AIX, keep calling authenticate() until reenter reaches 0.

This commit is contained in:
Todd C. Miller
2011-05-16 12:17:49 -04:00
parent 4ff045b266
commit 7708d5ce84

View File

@@ -54,16 +54,23 @@ aixauth_verify(struct passwd *pw, char *prompt, sudo_auth *auth)
{
char *pass;
char *message = NULL;
int reenter = 1;
int result, reenter = 0;
int rval = AUTH_FAILURE;
pass = auth_getpass(prompt, def_passwd_timeout * 60, SUDO_CONV_PROMPT_ECHO_OFF);
if (pass) {
/* XXX - should verify that S_AUTH1 is "NONE" or "SYSTEM" */
do {
pass = auth_getpass(prompt, def_passwd_timeout * 60,
SUDO_CONV_PROMPT_ECHO_OFF);
efree(message);
result = authenticate(pw->pw_name, pass, &reenter, &message);
zero_bytes(pass, strlen(pass));
prompt = message;
} while (reenter);
/* XXX - should probably print message on failure. */
if (authenticate(pw->pw_name, pass, &reenter, &message) == 0)
efree(message);
if (result == 0)
rval = AUTH_SUCCESS;
free(message);
zero_bytes(pass, strlen(pass));
}
return rval;
}