summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-09-12 12:11:12 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-09-12 12:11:12 +0200
commit35f217ce69b6dbcdc16ff36ef02323ab3257d9df (patch)
treed86b94255f3bc4ea481bda1d360237fd9408927c
parent4bb35f1e94665fbc6de7348ccd619e3a34ec5f08 (diff)
downloadrsyslog-35f217ce69b6dbcdc16ff36ef02323ab3257d9df.tar.gz
rsyslog-35f217ce69b6dbcdc16ff36ef02323ab3257d9df.tar.bz2
rsyslog-35f217ce69b6dbcdc16ff36ef02323ab3257d9df.zip
forward-compatibility patch for $ruleset processing
v7 needs a different handling, it's easer in the long term if we introduce this in v6 as well. Non-intrusive change.
-rw-r--r--grammar/grammar.y2
-rw-r--r--grammar/lexer.l3
2 files changed, 5 insertions, 0 deletions
diff --git a/grammar/grammar.y b/grammar/grammar.y
index 8371f854..29ff02fe 100644
--- a/grammar/grammar.y
+++ b/grammar/grammar.y
@@ -69,6 +69,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
@@ -129,6 +130,7 @@ conf: /* empty (to end recursion) */
| conf obj { cnfDoObj($2); }
| conf rule { cnfDoRule($2); }
| conf cfsysline { cnfDoCfsysline($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 c5e7bf7d..0faacf2e 100644
--- a/grammar/lexer.l
+++ b/grammar/lexer.l
@@ -192,6 +192,9 @@ int fileno(FILE *stream);
if(!strncasecmp(yytext, "$includeconfig ", 14)) {
yyless(14);
BEGIN INCL;
+ } else if(!strncasecmp(yytext, "$ruleset ", 9)) {
+ yylval.s = strdup(yytext);
+ return LEGACY_RULESET;
} else {
yylval.s = strdup(yytext);
return CFSYSLINE;