Add struct sudoers_conf to struct sudoers_plugin_context.

There's now no need to pass this directly to init_parser() since we
already pass in a pointer to a sudoers_context struct.
This commit is contained in:
Todd C. Miller
2023-08-21 09:21:54 -06:00
parent 9e53d903ea
commit 87571dab0a
12 changed files with 82 additions and 91 deletions

View File

@@ -72,10 +72,10 @@ sudo_file_open(struct sudoers_context *ctx, struct sudo_nss *nss)
handle = malloc(sizeof(*handle));
if (handle != NULL) {
const struct sudoers_parser_config *conf = policy_sudoers_conf();
handle->fp = open_sudoers(conf->sudoers_path, &outfile, false, NULL);
handle->fp = open_sudoers(ctx->parser_conf.sudoers_path, &outfile,
false, NULL);
if (handle->fp != NULL) {
init_parser(ctx, NULL, conf);
init_parser(ctx, NULL);
init_parse_tree(&handle->parse_tree, NULL, NULL, ctx, nss);
if (outfile != NULL) {
/* Update path to open sudoers file. */