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:
Todd C. Miller
2004-09-28 18:31:24 +00:00
parent b99ad3ee2b
commit db2a97fd0a
4 changed files with 40 additions and 15 deletions

View File

@@ -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)