More scaffolding for dealing with multiple sudoers files:
o init_parser() now takes a path used to populate the sudoers global o the sudoers global is used to print the correct file in yyerror() o when switching to a new sudoers file, perserve old file name and line number
This commit is contained in:
3
parse.c
3
parse.c
@@ -96,7 +96,6 @@ extern FILE *yyin, *yyout;
|
||||
* Prototypes
|
||||
*/
|
||||
static int has_meta __P((char *));
|
||||
void init_parser __P((void));
|
||||
|
||||
/*
|
||||
* Look up the user in the sudoers file and check to see if they are
|
||||
@@ -113,7 +112,7 @@ sudoers_lookup(pwflag)
|
||||
yyout = stdout;
|
||||
|
||||
/* Allocate space for data structures in the parser. */
|
||||
init_parser();
|
||||
init_parser(_PATH_SUDOERS);
|
||||
|
||||
/* If pwcheck *could* be "all" or "any", keep more state. */
|
||||
if (pwflag > 0)
|
||||
|
Reference in New Issue
Block a user