sudo_file_open: initialize parser before calling open_sudoers().
Otherwise, the parser_conf settings in the context passed to sudo_file_open() will not be honored by open_sudoers(). Affected settings include ignore_perms, sudoers mode, uid and gid.
This commit is contained in:
@@ -72,10 +72,10 @@ sudo_file_open(struct sudoers_context *ctx, struct sudo_nss *nss)
|
|||||||
|
|
||||||
handle = malloc(sizeof(*handle));
|
handle = malloc(sizeof(*handle));
|
||||||
if (handle != NULL) {
|
if (handle != NULL) {
|
||||||
|
init_parser(ctx, NULL);
|
||||||
handle->fp = open_sudoers(ctx->parser_conf.sudoers_path, &outfile,
|
handle->fp = open_sudoers(ctx->parser_conf.sudoers_path, &outfile,
|
||||||
false, NULL);
|
false, NULL);
|
||||||
if (handle->fp != NULL) {
|
if (handle->fp != NULL) {
|
||||||
init_parser(ctx, NULL);
|
|
||||||
init_parse_tree(&handle->parse_tree, NULL, NULL, ctx, nss);
|
init_parse_tree(&handle->parse_tree, NULL, NULL, ctx, nss);
|
||||||
if (outfile != NULL) {
|
if (outfile != NULL) {
|
||||||
/* Update path to open sudoers file. */
|
/* Update path to open sudoers file. */
|
||||||
|
Reference in New Issue
Block a user