diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-12 11:31:45 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-12 11:31:45 +0200 |
commit | a65ddad8652218ad8990b3de14b9293ce4cb556f (patch) | |
tree | dfef69d1686a9592246b3bd4715439412ea64ff8 | |
parent | 99f342e866c6c4a257c0a504ce7e561e21458847 (diff) | |
download | rsyslog-a65ddad8652218ad8990b3de14b9293ce4cb556f.tar.gz rsyslog-a65ddad8652218ad8990b3de14b9293ce4cb556f.tar.bz2 rsyslog-a65ddad8652218ad8990b3de14b9293ce4cb556f.zip |
new ruleengine: properly handle $ruleset directive
-rw-r--r-- | grammar/grammar.y | 2 | ||||
-rw-r--r-- | grammar/lexer.l | 7 | ||||
-rwxr-xr-x | tests/diag.sh | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/grammar/grammar.y b/grammar/grammar.y index 65793fb1..f455a21f 100644 --- a/grammar/grammar.y +++ b/grammar/grammar.y @@ -66,6 +66,7 @@ extern int yyerror(char*); %token BEGIN_TPL %token STOP %token <s> LEGACY_ACTION +%token <s> LEGACY_RULESET %token <s> PRIFILT %token <s> PROPFILT %token <s> BSD_TAG_SELECTOR @@ -123,6 +124,7 @@ extern int yyerror(char*); conf: /* empty (to end recursion) */ | conf obj { cnfDoObj($2); } | conf stmt { cnfDoScript($2); } + | conf LEGACY_RULESET { cnfDoCfsysline($2); } | conf BSD_TAG_SELECTOR { cnfDoBSDTag($2); } | conf BSD_HOST_SELECTOR { cnfDoBSDHost($2); } obj: BEGINOBJ nvlst ENDOBJ { $$ = cnfobjNew($1, $2); } diff --git a/grammar/lexer.l b/grammar/lexer.l index c52e5a01..14e95e81 100644 --- a/grammar/lexer.l +++ b/grammar/lexer.l @@ -137,8 +137,8 @@ int fileno(FILE *stream); /* line number support because the "preprocessor" combines lines and so needs * to tell us the real source line. */ -"stop" { dbgprintf("STOP\n"); return STOP; } -"else" { dbgprintf("STOP\n"); return ELSE; } +"stop" { return STOP; } +"else" { return ELSE; } "preprocfilelinenumber(" { BEGIN LINENO; } <LINENO>[0-9]+ { yylineno = atoi(yytext) - 1; } <LINENO>")" { BEGIN INITIAL; } @@ -191,6 +191,9 @@ int fileno(FILE *stream); if(!strncasecmp(yytext, "$includeconfig ", 14)) { yyless(14); BEGIN INCL; + } else if(!strncasecmp(yytext, "$ruleset ", 8)) { + yylval.s = strdup(yytext); + return LEGACY_RULESET; } else { cnfDoCfsysline(strdup(yytext)); } diff --git a/tests/diag.sh b/tests/diag.sh index ed0709da..b278d2c5 100755 --- a/tests/diag.sh +++ b/tests/diag.sh @@ -10,8 +10,8 @@ #valgrind="valgrind --tool=helgrind --log-fd=1" #valgrind="valgrind --tool=exp-ptrcheck --log-fd=1" #set -o xtrace -export RSYSLOG_DEBUG="debug nologfuncflow noprintmutexaction nostdout" -export RSYSLOG_DEBUGLOG="log" +#export RSYSLOG_DEBUG="debug nologfuncflow noprintmutexaction nostdout" +#export RSYSLOG_DEBUGLOG="log" case $1 in 'init') $srcdir/killrsyslog.sh # kill rsyslogd if it runs for some reason cp $srcdir/testsuites/diag-common.conf diag-common.conf |