2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-02 07:15:27 +00:00

Remove unused FLAG_USER auth flag. We have no auth methods that

require that authentication be run as the invoking user.
This commit is contained in:
Todd C. Miller
2014-02-27 15:51:40 -07:00
parent 6a7ebd280b
commit 4e3e5077e1
3 changed files with 1 additions and 34 deletions

View File

@@ -129,15 +129,8 @@ sudo_auth_init(struct passwd *pw)
/* Initialize auth methods and unconfigure the method if necessary. */
for (auth = auth_switch; auth->name; auth++) {
if (auth->init && !IS_DISABLED(auth)) {
if (NEEDS_USER(auth))
set_perms(PERM_USER);
status = (auth->init)(pw, auth);
if (NEEDS_USER(auth))
restore_perms();
/* Disable if it failed to init unless there was a fatal error. */
status = (auth->init)(pw, auth);
if (status == AUTH_FAILURE)
SET(auth->flags, FLAG_DISABLED);
else if (status == AUTH_FATAL)
@@ -161,14 +154,7 @@ sudo_auth_cleanup(struct passwd *pw)
/* Call cleanup routines. */
for (auth = auth_switch; auth->name; auth++) {
if (auth->cleanup && !IS_DISABLED(auth)) {
if (NEEDS_USER(auth))
set_perms(PERM_USER);
status = (auth->cleanup)(pw, auth);
if (NEEDS_USER(auth))
restore_perms();
if (status == AUTH_FATAL)
break; /* assume error msg already printed */
}
@@ -212,14 +198,7 @@ verify_user(struct passwd *pw, char *prompt, int validated)
/* Do any per-method setup and unconfigure the method if needed */
for (auth = auth_switch; auth->name; auth++) {
if (auth->setup && !IS_DISABLED(auth)) {
if (NEEDS_USER(auth))
set_perms(PERM_USER);
status = (auth->setup)(pw, &prompt, auth);
if (NEEDS_USER(auth))
restore_perms();
if (status == AUTH_FAILURE)
SET(auth->flags, FLAG_DISABLED);
else if (status == AUTH_FATAL)
@@ -242,14 +221,7 @@ verify_user(struct passwd *pw, char *prompt, int validated)
if (IS_DISABLED(auth))
continue;
if (NEEDS_USER(auth))
set_perms(PERM_USER);
success = auth->status = (auth->verify)(pw, p, auth);
if (NEEDS_USER(auth))
restore_perms();
if (auth->status != AUTH_FAILURE)
goto done;
}