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

@@ -3989,8 +3989,7 @@ free_parse_tree(struct sudoers_parse_tree *parse_tree)
* the current sudoers file to path.
*/
bool
init_parser(struct sudoers_context *ctx, const char *file,
const struct sudoers_parser_config *conf)
init_parser(struct sudoers_context *ctx, const char *file)
{
bool ret = true;
debug_decl(init_parser, SUDOERS_DEBUG_PARSER);
@@ -4001,8 +4000,8 @@ init_parser(struct sudoers_context *ctx, const char *file,
init_lexer();
parse_error = false;
if (conf != NULL) {
parser_conf = *conf;
if (ctx != NULL) {
parser_conf = ctx->parser_conf;
} else {
const struct sudoers_parser_config def_conf =
SUDOERS_PARSER_CONFIG_INITIALIZER;
@@ -4036,7 +4035,7 @@ init_parser(struct sudoers_context *ctx, const char *file,
bool
reset_parser(void)
{
return init_parser(NULL, NULL, NULL);
return init_parser(NULL, NULL);
}
/*