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

Move cached userspecs and defaults into the handle object.

This commit is contained in:
Todd C. Miller
2018-05-29 09:39:40 -06:00
parent 1ad2290a27
commit 0b31f186cd
7 changed files with 257 additions and 206 deletions

View File

@@ -193,8 +193,9 @@ sudoers_policy_init(void *info, char * const envp[])
init_parser(sudoers_file, false);
TAILQ_FOREACH_SAFE(nss, snl, entries, nss_next) {
if (nss->open(nss) == 0 && nss->parse(nss) == 0) {
struct defaults_list *defs = nss->getdefs(nss);
sources++;
if (nss->getdefs(nss) != 0 || !update_defaults(&nss->defaults,
if (defs == NULL || !update_defaults(defs,
SETDEF_GENERIC|SETDEF_HOST|SETDEF_USER|SETDEF_RUNAS, false)) {
log_warningx(SLOG_SEND_MAIL|SLOG_NO_STDERR,
N_("problem with defaults entries"));
@@ -853,7 +854,8 @@ set_cmnd(void)
user_base = user_cmnd;
TAILQ_FOREACH(nss, snl, entries) {
if (!update_defaults(&nss->defaults, SETDEF_CMND, false)) {
struct defaults_list *defs = nss->getdefs(nss);
if (!update_defaults(defs, SETDEF_CMND, false)) {
log_warningx(SLOG_SEND_MAIL|SLOG_NO_STDERR,
N_("problem with defaults entries"));
}