diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-07-11 16:51:30 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-07-11 16:51:30 +0200 |
commit | cefa1fac08d4d67a4139146016fef206d59d5ddc (patch) | |
tree | c269d3cfbeca3cff0d9d6065c38ce0a5bd5f924b | |
parent | 05ff79aa1f928e42bf9883e946923353eb2925ac (diff) | |
download | rsyslog-cefa1fac08d4d67a4139146016fef206d59d5ddc.tar.gz rsyslog-cefa1fac08d4d67a4139146016fef206d59d5ddc.tar.bz2 rsyslog-cefa1fac08d4d67a4139146016fef206d59d5ddc.zip |
fixed lexer: facilities local0-local7 were not correctly handled
-rw-r--r-- | grammar/lexer.l | 6 | ||||
-rw-r--r-- | runtime/rsconf.c | 3 | ||||
-rwxr-xr-x | tests/diag.sh | 4 | ||||
-rwxr-xr-x | tests/imtcp_conndrop.sh | 1 | ||||
-rw-r--r-- | tests/testsuites/imtcp_conndrop.conf | 1 |
5 files changed, 9 insertions, 6 deletions
diff --git a/grammar/lexer.l b/grammar/lexer.l index 64a804fa..d56b4fc2 100644 --- a/grammar/lexer.l +++ b/grammar/lexer.l @@ -80,6 +80,8 @@ char *currfn; /* name of currently processed file */ int popfile(void); int cnfSetLexFile(char *fname); +extern int yydebug; + /* somehow, I need these prototype even though the headers are * included. I guess that's some autotools magic I don't understand... */ @@ -155,7 +157,7 @@ int fileno(FILE *stream); "action"[ \n\t]*"(" { BEGIN INOBJ; return BEGIN_ACTION; } ^[ \t]*:\$?[a-z]+[ ]*,[ ]*!?[a-z]+[ ]*,[ ]*\".*\" { yylval.s = strdup(yytext); return PROPFILT; } -^[ \t]*[,\*a-z]+\.[,!=;\.\*a-z]+ { yylval.s = strdup(yytext); return PRIFILT; } +^[ \t]*[a-z][,\*a-z]*[0-7]*\.[,!=;\.\*a-z]+ { yylval.s = strdup(yytext); return PRIFILT; } "*" | \-\/[^*][^\n]* | \/[^*][^\n]* | @@ -203,6 +205,8 @@ cnfParseBuffer(char *buf, unsigned lenBuf) { struct bufstack *bs; int r = 0; + yydebug = 1; + BEGIN INITIAL; /* maintain stack */ if((bs = malloc(sizeof(struct bufstack))) == NULL) { r = 1; diff --git a/runtime/rsconf.c b/runtime/rsconf.c index ac969286..d2cb9332 100644 --- a/runtime/rsconf.c +++ b/runtime/rsconf.c @@ -1256,9 +1256,10 @@ ourConf = loadConf; // TODO: remove, once ourConf is gone! errmsg.LogError(0, NO_ERRCODE, "EMERGENCY CONFIGURATION ACTIVATED - fix rsyslog config file!"); emergConf = "*.err " _PATH_CONSOLE "\n" - "syslog.*" _PATH_CONSOLE "\n" + "syslog.* " _PATH_CONSOLE "\n" "*.panic :omusrmsg:*" "\n" "syslog.* :omusrmsg:root" "\n"; +dbgprintf("Emer Config '%s'\n",emergConf); cnfParseBuffer(emergConf, strlen(emergConf)); r = yyparse(); if(r != 0) { diff --git a/tests/diag.sh b/tests/diag.sh index 1f7de2cf..f2bcc4b8 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 stdout" -#export RSYSLOG_DEBUGLOG="log" +export RSYSLOG_DEBUG="debug nologfuncflow noprintmutexaction stdout" +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 diff --git a/tests/imtcp_conndrop.sh b/tests/imtcp_conndrop.sh index 0bfcd99c..c5073924 100755 --- a/tests/imtcp_conndrop.sh +++ b/tests/imtcp_conndrop.sh @@ -4,7 +4,6 @@ # This file is part of the rsyslog project, released under GPLv3 echo ==================================================================================== echo TEST: \[imtcp_conndrop.sh\]: test imtcp with random connection drops -cat rsyslog.action.1.include source $srcdir/diag.sh init source $srcdir/diag.sh startup imtcp_conndrop.conf # 100 byte messages to gain more practical data use diff --git a/tests/testsuites/imtcp_conndrop.conf b/tests/testsuites/imtcp_conndrop.conf index b64f132b..de41bc43 100644 --- a/tests/testsuites/imtcp_conndrop.conf +++ b/tests/testsuites/imtcp_conndrop.conf @@ -12,5 +12,4 @@ $template dynfile,"rsyslog.out.log" # trick to use relative path names! $OMFileFlushOnTXEnd off $OMFileFlushInterval 2 $OMFileIOBufferSize 256k -$IncludeConfig rsyslog.action.1.include local0.* ?dynfile;outfmt |