From b6249c44616cd828c2d53506109b50afd2e61839 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 9 Jan 2013 17:52:43 +0100 Subject: bugfix: some property-based filter were incorrectly parsed This usually lead to a syntax error on startup and rsyslogd not actually starting up. The problem was the regex, which did not care for double quote characters to follow in the action part - unfortunately something that can frequently happen with v6+ format. An example: :programname, isequal, "as" {action(type="omfile" ...) } Here, the part :programname, isequal, "as" {action(type="omfile" was treated as the property filter, and the rest as action part. Obviously, this did not work out. Unfortunately, such situations usually resulted in very hard to understand error messages. --- ChangeLog | 11 +++++++++++ grammar/lexer.l | 7 +++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 166ca0a7..dffba831 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,17 @@ ---------------------------------------------------------------------------- Version 7.2.6 [v7-stable] 2013-01-?? - slightly improved config parser error messages when invalid escapes happen +- bugfix: some property-based filter were incorrectly parsed + This usually lead to a syntax error on startup and rsyslogd not actually + starting up. The problem was the regex, which did not care for double + quote characters to follow in the action part - unfortunately something + that can frequently happen with v6+ format. An example: + :programname, isequal, "as" {action(type="omfile" ...) } + Here, the part + :programname, isequal, "as" {action(type="omfile" + was treated as the property filter, and the rest as action part. + Obviously, this did not work out. Unfortunately, such situations usually + resulted in very hard to understand error messages. ---------------------------------------------------------------------------- Version 7.2.5 [v7-stable] 2013-01-08 - build system cleanup (thanks to Michael Biebl for this!) diff --git a/grammar/lexer.l b/grammar/lexer.l index aec05a38..e1f5a9c3 100644 --- a/grammar/lexer.l +++ b/grammar/lexer.l @@ -189,8 +189,11 @@ int fileno(FILE *stream); "module"[ \n\t]*"(" { yylval.objType = CNFOBJ_MODULE; BEGIN INOBJ; return BEGINOBJ; } "action"[ \n\t]*"(" { BEGIN INOBJ; return BEGIN_ACTION; } -^[ \t]*:\$?[a-z\-]+[ ]*,[ ]*!?[a-z]+[ ]*,[ ]*\".*\" { - yylval.s = strdup(rmLeadingSpace(yytext)); return PROPFILT; } +^[ \t]*:\$?[a-z\-]+[ ]*,[ ]*!?[a-z]+[ ]*,[ ]*\"(\\\"|[^\"])*\" { + yylval.s = strdup(rmLeadingSpace(yytext)); + dbgprintf("lexer: propfilt is '%s'\n", yylval.s); + return PROPFILT; + } ^[ \t]*[\*a-z][\*a-z]*[0-7]*[\.,][,!=;\.\*a-z0-7]+ { yylval.s = strdup(rmLeadingSpace(yytext)); return PRIFILT; } "~" | "*" | -- cgit v1.2.3