diff --git a/doc/Changelog b/doc/Changelog index 5ad6aa6c8..6c1602533 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,8 @@ 6 February 2009: Wouter - contrib contains specfile for fedora 1.2.1 (from Paul Wouters). - iana portlist updated. + - fixup EOL in include directive (reported by Paul Wouters). + You can no longer specify newlines in the names of included files. 5 February 2009: Wouter - ldns 1.5.0 rc as tarball included. diff --git a/util/configlexer.c b/util/configlexer.c index 920c839ab..e2d5203bc 100644 --- a/util/configlexer.c +++ b/util/configlexer.c @@ -2223,11 +2223,12 @@ case 108: /* rule 108 can match eol */ YY_RULE_SETUP #line 261 "util/configlexer.lex" -{ cfg_parser->line++; yymore(); } +{ yyerror("EOL before \" in include name"); + cfg_parser->line++; BEGIN(INITIAL); } YY_BREAK case 109: YY_RULE_SETUP -#line 262 "util/configlexer.lex" +#line 263 "util/configlexer.lex" { LEXOUT(("IQE ")); yytext[yyleng - 1] = '\0'; @@ -2236,7 +2237,7 @@ YY_RULE_SETUP } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 268 "util/configlexer.lex" +#line 269 "util/configlexer.lex" { yy_set_bol(1); /* Set beginning of line, so "^" rules match. */ if (config_include_stack_ptr == 0) { @@ -2249,16 +2250,16 @@ case YY_STATE_EOF(INITIAL): YY_BREAK case 110: YY_RULE_SETUP -#line 278 "util/configlexer.lex" +#line 279 "util/configlexer.lex" { LEXOUT(("unquotedstr(%s) ", yytext)); yylval.str = strdup(yytext); return STRING; } YY_BREAK case 111: YY_RULE_SETUP -#line 281 "util/configlexer.lex" +#line 282 "util/configlexer.lex" ECHO; YY_BREAK -#line 2261 "" +#line 2262 "" case YY_END_OF_BUFFER: { @@ -3217,7 +3218,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 281 "util/configlexer.lex" +#line 282 "util/configlexer.lex" diff --git a/util/configlexer.lex b/util/configlexer.lex index 002848f69..23864637f 100644 --- a/util/configlexer.lex +++ b/util/configlexer.lex @@ -258,7 +258,8 @@ include{COLON} { LEXOUT(("v(%s) ", yytext)); BEGIN(include); } BEGIN(INITIAL); } {DQANY}* { LEXOUT(("ISTR(%s) ", yytext)); yymore(); } -{NEWLINE} { cfg_parser->line++; yymore(); } +{NEWLINE} { yyerror("EOL before \" in include name"); + cfg_parser->line++; BEGIN(INITIAL); } \" { LEXOUT(("IQE ")); yytext[yyleng - 1] = '\0';