Convert perm setting to push/pop model; still needs some work

Use the stashed runas groups instead of using getgrouplist()
Reset perms to the initial value on error
This commit is contained in:
Todd C. Miller
2010-04-20 17:00:31 -04:00
parent ab00ce995b
commit 1bb9f62143
5 changed files with 731 additions and 373 deletions

View File

@@ -136,7 +136,7 @@ verify_user(struct passwd *pw, char *prompt)
}
if (NEEDS_USER(auth))
set_perms(PERM_ROOT);
restore_perms();
}
}
@@ -158,7 +158,7 @@ verify_user(struct passwd *pw, char *prompt)
}
if (NEEDS_USER(auth))
set_perms(PERM_ROOT);
restore_perms();
}
}
@@ -180,7 +180,7 @@ verify_user(struct passwd *pw, char *prompt)
success = auth->status = (auth->verify)(pw, (char *)p, auth);
if (NEEDS_USER(auth))
set_perms(PERM_ROOT);
restore_perms();
if (auth->status != AUTH_FAILURE)
goto cleanup;
@@ -210,7 +210,7 @@ cleanup:
}
if (NEEDS_USER(auth))
set_perms(PERM_ROOT);
restore_perms();
}
}