Set yacc prefix to "sudoers" to avoid conflicts other yacc parsers.

This commit is contained in:
Todd C. Miller
2012-09-14 16:19:25 -04:00
parent 0c9083b141
commit 5276ab3a5f
12 changed files with 291 additions and 247 deletions

View File

@@ -68,7 +68,7 @@ struct sudo_nss sudo_nss_file = {
/*
* Parser externs.
*/
extern FILE *yyin;
extern FILE *sudoersin;
extern char *errorfile;
extern int errorlineno;
extern bool parse_error;
@@ -100,7 +100,7 @@ sudo_file_close(struct sudo_nss *nss)
if (nss->handle != NULL) {
fclose(nss->handle);
nss->handle = NULL;
yyin = NULL;
sudoersin = NULL;
}
debug_return_int(0);
}
@@ -117,8 +117,8 @@ sudo_file_parse(struct sudo_nss *nss)
debug_return_int(-1);
init_parser(sudoers_file, false);
yyin = nss->handle;
if (yyparse() != 0 || parse_error) {
sudoersin = nss->handle;
if (sudoersparse() != 0 || parse_error) {
if (errorlineno != -1) {
log_error(0, _("parse error in %s near line %d"),
errorfile, errorlineno);