diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | doc/v6compatibility.html | 3 | ||||
-rw-r--r-- | runtime/rsconf.c | 3 | ||||
-rw-r--r-- | tools/rsyslogd.8 | 6 | ||||
-rw-r--r-- | tools/syslogd.c | 8 |
5 files changed, 18 insertions, 4 deletions
@@ -30,6 +30,8 @@ Version 7.3.0 [devel] 2012-10-09 This is controlled by the new action parameter "VeryReliableZip". ---------------------------------------------------------------------------- Version 7.2.1 [v7-stable] 2012-10-?? +- added -D rsyslogd option to enable config parser debug mode +- improved syntax error messages by outputting the error token - the rsyslog core now suspeneds actions after 10 failures in a row This was former the case after 1,000 failures and could cause rsyslog to be spammed/ressources misused. See the v6 compatibility doc for more diff --git a/doc/v6compatibility.html b/doc/v6compatibility.html index edb6dedf..7ce8c001 100644 --- a/doc/v6compatibility.html +++ b/doc/v6compatibility.html @@ -181,7 +181,7 @@ As you see, here you may include spaces between user names. so it is a wise decision to change config files at least to the legacy format (with ":omusrmsg:" in front of the name). -<h2>Escape Sequences in Script-Based Filters<h2> +<h2>Escape Sequences in Script-Based Filters</h2> <p>In v5, escape sequences were very simplistic. Inside a string, "\x" meant "x" with x being any character. This has been changed so that the usual set of escapes is supported, must importantly "\n", "\t", "\xhh" (with hh being hex digits) @@ -189,7 +189,6 @@ and "\ooo" with (o being octal digits). So if one of these sequences was used previously, results are obviously different. However, that should not create any real problems, because it is hard to envision why someone should have done that (why write "\n" when you can also write "n"?). ---------------------------------------------------------------------------- <p>[<a href="manual.html">manual index</a>] [<a href="http://www.rsyslog.com/">rsyslog site</a>]</p> <p><font size="2">This documentation is part of the <a href="http://www.rsyslog.com/">rsyslog</a> project.<br> diff --git a/runtime/rsconf.c b/runtime/rsconf.c index ad588832..dcaa1ad9 100644 --- a/runtime/rsconf.c +++ b/runtime/rsconf.c @@ -67,6 +67,7 @@ #include "dirty.h" #include "template.h" +extern char* yytext; /* static data */ DEFobjStaticHelpers DEFobjCurrIf(ruleset) @@ -390,7 +391,7 @@ parser_errmsg(char *fmt, ...) int yyerror(char *s) { - parser_errmsg("%s", s); + parser_errmsg("%s on token '%s'", s, yytext); return 0; } void cnfDoObj(struct cnfobj *o) diff --git a/tools/rsyslogd.8 b/tools/rsyslogd.8 index 86db690e..9ded4b9b 100644 --- a/tools/rsyslogd.8 +++ b/tools/rsyslogd.8 @@ -10,6 +10,7 @@ rsyslogd \- reliable and extended syslogd .RB [ " \-6 " ] .RB [ " \-A " ] .RB [ " \-d " ] +.RB [ " \-D " ] .RB [ " \-f " .I config file ] @@ -124,6 +125,11 @@ This option has been obsoleted and has no function any longer. It is still accepted in order not to break existing scripts. However, future versions may not support it. .TP +.B "\-D" +Runs the Bison config parser in debug mode. This may help when hard to find +syntax errors are reported. Please note that the output generated is deeply +.TP +technical and orignally targeted towards developers. .B "\-d" Turns on debug mode. Using this the daemon will not proceed a .BR fork (2) diff --git a/tools/syslogd.c b/tools/syslogd.c index c5801555..05cbfc13 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -93,6 +93,8 @@ #include <zlib.h> #endif +extern int yydebug; /* interface to flex */ + #include <netdb.h> #include "pidfile.h" @@ -1830,7 +1832,7 @@ int realMain(int argc, char **argv) * of other options, we do this during the inital option processing. * rgerhards, 2008-04-04 */ - while((ch = getopt(argc, argv, "46a:Ac:def:g:hi:l:m:M:nN:op:qQr::s:t:T:u:vwx")) != EOF) { + while((ch = getopt(argc, argv, "46a:Ac:dDef:g:hi:l:m:M:nN:op:qQr::s:t:T:u:vwx")) != EOF) { switch((char)ch) { case '4': case '6': @@ -1863,6 +1865,10 @@ int realMain(int argc, char **argv) case 'd': /* debug - must be handled now, so that debug is active during init! */ debugging_on = 1; Debug = 1; + yydebug = 1; + break; + case 'D': /* BISON debug */ + yydebug = 1; break; case 'e': /* log every message (no repeat message supression) */ bEOptionWasGiven = 1; |