From: Todd C. Miller Date: Tue, 7 Jan 2003 00:02:33 +0000 (+0000) Subject: Better fix for sudoers files w/o a newline before EOF. It looks X-Git-Tag: SUDO_1_6_7~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b3c38d20cdcae510f94c95f9a0ab4a855cf9333;p=sudo 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. --- diff --git a/parse.lex b/parse.lex index 0f997d8d8..96481ce18 100644 --- a/parse.lex +++ b/parse.lex @@ -339,17 +339,20 @@ PASSWD[[:blank:]]*: { return(COMMENT); } /* return comments */ -<> { - BEGIN INITIAL; - LEXTRACE("EOF "); - return(ERROR); - } /* premature EOF */ - <*>. { LEXTRACE("ERROR "); return(ERROR); } /* parse error */ +<*><> { + if (YY_START != INITIAL) { + BEGIN INITIAL; + LEXTRACE("ERROR "); + return(ERROR); + } + yyterminate(); + } + %% static void fill(s, len)