From: Todd C. Miller Date: Thu, 6 Nov 2008 00:14:45 +0000 (+0000) Subject: Move clearing of AUTHSTATE into aixauth_cleanup. X-Git-Tag: SUDO_1_7_0~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51fae2c9c3503f4eb11af395dd97d1d47ff3a3f2;p=sudo Move clearing of AUTHSTATE into aixauth_cleanup. --- diff --git a/auth/aix_auth.c b/auth/aix_auth.c index 38f80c380..87f82d75a 100644 --- a/auth/aix_auth.c +++ b/auth/aix_auth.c @@ -70,10 +70,19 @@ aixauth_verify(pw, prompt, auth) /* XXX - should probably print message on failure. */ if (authenticate(pw->pw_name, pass, &reenter, &message) == 0) rval = AUTH_SUCCESS; - /* Unset AUTHSTATE as it may not be correct for the runas user. */ - sudo_unsetenv("AUTHSTATE"); free(message); zero_bytes(pass, strlen(pass)); } return(rval); } + +int +aixauth_cleanup(pw, auth) + struct passwd *pw; + sudo_auth *auth; +{ + /* Unset AUTHSTATE as it may not be correct for the runas user. */ + sudo_unsetenv("AUTHSTATE"); + + return(AUTH_SUCCESS); +} diff --git a/auth/sudo_auth.h b/auth/sudo_auth.h index 0a2b231b4..2783744b2 100644 --- a/auth/sudo_auth.h +++ b/auth/sudo_auth.h @@ -99,7 +99,7 @@ int securid_verify __P((struct passwd *pw, char *pass, sudo_auth *auth)); #elif defined(HAVE_AIXAUTH) # define AUTH_STANDALONE \ AUTH_ENTRY(0, "aixauth", \ - NULL, NULL, aixauth_verify, NULL) + NULL, NULL, aixauth_verify, aixauth_cleanup) #elif defined(HAVE_FWTK) # define AUTH_STANDALONE \ AUTH_ENTRY(0, "fwtk", \