mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
Better fix for sudoers files w/o a newline before EOF. It looks
like the issue is that yyrestart() does not reset the start condition to INITIAL which is an issue since we parse sudoers multiple times.
This commit is contained in:
15
parse.lex
15
parse.lex
@@ -339,17 +339,20 @@ PASSWD[[:blank:]]*: {
|
||||
return(COMMENT);
|
||||
} /* return comments */
|
||||
|
||||
<GOTRUNAS,GOTDEFS,GOTCMND,STARTDEFS,INDEFS><<EOF>> {
|
||||
BEGIN INITIAL;
|
||||
LEXTRACE("EOF ");
|
||||
return(ERROR);
|
||||
} /* premature EOF */
|
||||
|
||||
<*>. {
|
||||
LEXTRACE("ERROR ");
|
||||
return(ERROR);
|
||||
} /* parse error */
|
||||
|
||||
<*><<EOF>> {
|
||||
if (YY_START != INITIAL) {
|
||||
BEGIN INITIAL;
|
||||
LEXTRACE("ERROR ");
|
||||
return(ERROR);
|
||||
}
|
||||
yyterminate();
|
||||
}
|
||||
|
||||
%%
|
||||
static void
|
||||
fill(s, len)
|
||||
|
Reference in New Issue
Block a user