Add a sudoers_context struct that embeds the user and runas structs.

This commit is contained in:
Todd C. Miller
2023-08-20 16:27:08 -06:00
parent 1b9fb405a3
commit 2d2529a15e
36 changed files with 920 additions and 912 deletions

View File

@@ -706,7 +706,7 @@ default_binding_matches(struct sudoers_parse_tree *parse_tree,
case DEFAULTS:
debug_return_bool(true);
case DEFAULTS_USER:
if (userlist_matches(parse_tree, user_ctx.pw, &d->binding->members) == ALLOW)
if (userlist_matches(parse_tree, ctx.user.pw, &d->binding->members) == ALLOW)
debug_return_bool(true);
break;
case DEFAULTS_RUNAS:
@@ -714,7 +714,7 @@ default_binding_matches(struct sudoers_parse_tree *parse_tree,
debug_return_bool(true);
break;
case DEFAULTS_HOST:
if (hostlist_matches(parse_tree, user_ctx.pw, &d->binding->members) == ALLOW)
if (hostlist_matches(parse_tree, ctx.user.pw, &d->binding->members) == ALLOW)
debug_return_bool(true);
break;
case DEFAULTS_CMND: