From 406f20f0cfa1b8a95a041400d99d606809590036 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 11 Oct 2012 11:45:05 +0200 Subject: fix double-free --- tools/omfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/omfile.c b/tools/omfile.c index efdb61a1..5b0bfb46 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -961,7 +961,7 @@ CODESTARTnewActInst ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); } - tplToUse = (pData->tplName == NULL) ? ustrdup(getDfltTpl()) : pData->tplName; + tplToUse = ustrdup((pData->tplName == NULL) ? getDfltTpl() : pData->tplName); CHKiRet(OMSRsetEntry(*ppOMSR, 0, tplToUse, OMSR_NO_RQD_TPL_OPTS)); if(pData->bDynamicName) { -- cgit v1.2.3 From ee1afa2f3607ce6a1b278ce0a8d051aa040a362b Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 11 Oct 2012 11:45:22 +0200 Subject: cosmetic: simplify --- runtime/objomsr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime/objomsr.c b/runtime/objomsr.c index 9cf3781b..e63eb681 100644 --- a/runtime/objomsr.c +++ b/runtime/objomsr.c @@ -42,9 +42,7 @@ rsRetVal OMSRdestruct(omodStringRequest_t *pThis) /* free the strings */ if(pThis->ppTplName != NULL) { for(i = 0 ; i < pThis->iNumEntries ; ++i) { - if(pThis->ppTplName[i] != NULL) { - free(pThis->ppTplName[i]); - } + free(pThis->ppTplName[i]); } free(pThis->ppTplName); } -- cgit v1.2.3 From d91e8c31a1e342eb15b0839b9e721730fcad0549 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 11 Oct 2012 12:14:55 +0200 Subject: bugfix: some config processing warning messages were treated as errors --- ChangeLog | 1 + grammar/rainerscript.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b37e3357..30f41c84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ Version 7.1.10 [beta] 2012-10-11 - bugfix: m4 directory was not present in release tarball - bugfix: small memory leak with string-type templates - bugfix: small memory leak when template was specified in omfile + - bugfix: some config processing warning messages were treated as errors --------------------------------------------------------------------------- Version 7.1.9 [beta] 2012-10-09 - bugfix: comments inside objects (e.g. action()) were not properly handled diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index ad6a32e8..a98277af 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -2186,10 +2186,14 @@ cnfstmtNewAct(struct nvlst *lst) { struct cnfstmt* cnfstmt; char namebuf[256]; + rsRetVal localRet; if((cnfstmt = cnfstmtNew(S_ACT)) == NULL) goto done; - if(actionNewInst(lst, &cnfstmt->d.act) != RS_RET_OK) { - // TODO:RS_RET_WARN? + localRet = actionNewInst(lst, &cnfstmt->d.act); + if(localRet == RS_RET_OK_WARN) { + parser_errmsg("warnings occured in file '%s' around line %d", + cnfcurrfn, yylineno); + } else if(actionNewInst(lst, &cnfstmt->d.act) != RS_RET_OK) { parser_errmsg("errors occured in file '%s' around line %d", cnfcurrfn, yylineno); cnfstmt->nodetype = S_NOP; /* disable action! */ -- cgit v1.2.3 From 9fa59604e94f72225180e5fe28d18c4ec3374d61 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 11 Oct 2012 12:22:49 +0200 Subject: bugfixes in regards to action() - bugfix: small memory leak when processing action() statements - bugfix: unknown action() parameters were not reported --- ChangeLog | 2 ++ grammar/rainerscript.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 30f41c84..2d5d34f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ Version 7.1.10 [beta] 2012-10-11 - bugfix: small memory leak with string-type templates - bugfix: small memory leak when template was specified in omfile - bugfix: some config processing warning messages were treated as errors + - bugfix: small memory leak when processing action() statements + - bugfix: unknown action() parameters were not reported --------------------------------------------------------------------------- Version 7.1.9 [beta] 2012-10-09 - bugfix: comments inside objects (e.g. action()) were not properly handled diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index a98277af..be568238 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -2203,6 +2203,8 @@ cnfstmtNewAct(struct nvlst *lst) modGetName(cnfstmt->d.act->pMod)); namebuf[255] = '\0'; /* be on safe side */ cnfstmt->printable = (uchar*)strdup(namebuf); + nvlstChkUnused(lst); + nvlstDestruct(lst); done: return cnfstmt; } -- cgit v1.2.3 From 1b7e8bd1a8c33f317de66dafed4db16923ae394b Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 11 Oct 2012 12:38:17 +0200 Subject: fix regression introduced by last commit action object was created twice, resulting in memleak --- grammar/rainerscript.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index be568238..9483e116 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -2193,7 +2193,7 @@ cnfstmtNewAct(struct nvlst *lst) if(localRet == RS_RET_OK_WARN) { parser_errmsg("warnings occured in file '%s' around line %d", cnfcurrfn, yylineno); - } else if(actionNewInst(lst, &cnfstmt->d.act) != RS_RET_OK) { + } else if(localRet != RS_RET_OK) { parser_errmsg("errors occured in file '%s' around line %d", cnfcurrfn, yylineno); cnfstmt->nodetype = S_NOP; /* disable action! */ -- cgit v1.2.3 From e21184cb28927162f673af3864284e05933a0006 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 11 Oct 2012 14:42:08 +0200 Subject: preparing for 7.1.10 release --- configure.ac | 2 +- doc/manual.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 10a7f3ad..7e3543c0 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[7.1.9],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[7.1.10],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) diff --git a/doc/manual.html b/doc/manual.html index 504c65f2..6fa3c012 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -19,7 +19,7 @@ rsyslog support available directly from the source!

Please visit the rsyslog sponsor's page to honor the project sponsors or become one yourself! We are very grateful for any help towards the project goals.

-

This documentation is for version 7.1.9 (beta branch) of rsyslog. +

This documentation is for version 7.1.10 (beta branch) of rsyslog. Visit the rsyslog status page to obtain current version information and project status.

If you like rsyslog, you might -- cgit v1.2.3 From 0f879f21add90b171280bf33c5e2c7ce26bdfe0f Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 11 Oct 2012 14:59:37 +0200 Subject: make omruleset non-default in ./configure as this module's functionality has been superseeded by the "call" statement. Thanks to Michael Biebl for alerting me on the still-old default. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7e3543c0..f1ec4c0d 100644 --- a/configure.ac +++ b/configure.ac @@ -1188,7 +1188,7 @@ AM_CONDITIONAL(ENABLE_PMRFC3164SD, test x$enable_pmrfc3164sd = xyes) # settings for omruleset AC_ARG_ENABLE(omruleset, - [AS_HELP_STRING([--enable-omruleset],[Compiles ruleset forwarding module @<:@default=yes@:>@])], + [AS_HELP_STRING([--enable-omruleset],[Compiles ruleset forwarding module @<:@default=no@:>@])], [case "${enableval}" in yes) enable_omruleset="yes" ;; no) enable_omruleset="no" ;; -- cgit v1.2.3 From a208fcfc707c8c69b79e7623383a2c592d9f0741 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 11 Oct 2012 15:27:27 +0200 Subject: added deprecated note to omruleset --- ChangeLog | 3 +++ plugins/omruleset/omruleset.c | 6 ++++++ runtime/rsyslog.h | 1 + 3 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2d5d34f7..8a72ec17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ --------------------------------------------------------------------------- +Version 7.1.11 [beta] 2012-10-?? +- added deprecated note to omruleset (plus clue to use "call") + --------------------------------------------------------------------------- Version 7.1.10 [beta] 2012-10-11 - bugfix: m4 directory was not present in release tarball - bugfix: small memory leak with string-type templates diff --git a/plugins/omruleset/omruleset.c b/plugins/omruleset/omruleset.c index 67aee97e..6c770c94 100644 --- a/plugins/omruleset/omruleset.c +++ b/plugins/omruleset/omruleset.c @@ -165,6 +165,9 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1) p += sizeof(":omruleset:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ CHKiRet(createInstance(&pData)); + errmsg.LogError(0, RS_RET_DEPRECATED, "warning: omruleset is deprecated, consider " + "using the 'call' statement instead"); + /* check if a non-standard template is to be applied */ if(*(p-1) == ';') --p; @@ -237,6 +240,9 @@ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(ruleset, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); + errmsg.LogError(0, RS_RET_DEPRECATED, "warning: omruleset is deprecated, consider " + "using the 'call' statement instead"); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"actionomrulesetrulesetname", 0, eCmdHdlrGetWord, setRuleset, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h index 4404c475..07d58d68 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -392,6 +392,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth RS_RET_JNAME_NOTFOUND = -2305, /**< JSON name not found (does not exist) */ RS_RET_INVLD_SETOP = -2305, /**< invalid variable set operation, incompatible type */ RS_RET_RULESET_EXISTS = -2306,/**< ruleset already exists */ + RS_RET_DEPRECATED = -2307,/**< deprecated functionality is used */ /* RainerScript error messages (range 1000.. 1999) */ RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */ -- cgit v1.2.3 From 2ae9e456db8991e61b4aa48cf9b74f6d20689ce4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 11 Oct 2012 15:36:55 +0200 Subject: add deprecated note to discard action --- ChangeLog | 1 + doc/v7compatibility.html | 17 +++++++++++++++++ tools/omdiscard.c | 8 +++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8a72ec17..8cb054d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ --------------------------------------------------------------------------- Version 7.1.11 [beta] 2012-10-?? - added deprecated note to omruleset (plus clue to use "call") +- added deprecated note to discard action (plus clue to use "stop") --------------------------------------------------------------------------- Version 7.1.10 [beta] 2012-10-11 - bugfix: m4 directory was not present in release tarball diff --git a/doc/v7compatibility.html b/doc/v7compatibility.html index be89f666..692a4fe1 100644 --- a/doc/v7compatibility.html +++ b/doc/v7compatibility.html @@ -25,6 +25,23 @@ has been implemented. Consequently, situations where the previous behaviour were desired need now to be solved differently. We do not think that this will cause any problems to anyone, especially as in v6 this was announced as a missing feature. +

omruleset and discard (~) action are deprecated

+

Both continue to work, but have been replaced by better alternatives. +

The discard action (tilde character) has been replaced by the "stop" +RainerScript directive. It is considered more intuitive and offers slightly +better performance. +

The omruleset module has been replaced by the "call" RainerScript directive. +Call permits to execute a ruleset like a subroutine, and does so with much +higher performance than omruleset did. Note that omruleset could be run off +an async queue. This was more a side than a desired effect and is not supported +by the call statement. If that effect was needed, it can simply be simulated by +running the called rulesets actions asynchronously (what in any case is the right +way to handle this). +

Note that the deprecated modules emit warning messages when being used. +They tell that the construct is deprecated and which statement is to be used +as replacement. This does not affect operations: both modules are still +fully operational and will not be removed in the v7 timeframe. +

This documentation is part of the rsyslog project.
Copyright © 2011-2012 by Rainer Gerhards and diff --git a/tools/omdiscard.c b/tools/omdiscard.c index 182c4b63..15c6ea82 100644 --- a/tools/omdiscard.c +++ b/tools/omdiscard.c @@ -35,6 +35,7 @@ #include "syslogd-types.h" #include "omdiscard.h" #include "module-template.h" +#include "errmsg.h" MODULE_TYPE_OUTPUT MODULE_TYPE_NOKEEP @@ -42,6 +43,7 @@ MODULE_TYPE_NOKEEP /* internal structures */ DEF_OMOD_STATIC_DATA +DEFobjCurrIf(errmsg); typedef struct _instanceData { EMPTY_STRUCT @@ -92,8 +94,10 @@ CODE_STD_STRING_REQUESTparseSelectorAct(0) p = *pp; if(*p == '~') { - /* TODO: check the rest of the selector line - error reporting */ dbgprintf("discard\n"); + errmsg.LogError(0, RS_RET_DEPRECATED, "warning: ~ action " + "is deprecated, consider using the 'stop' " + "statement instead"); } else { iRet = RS_RET_CONFLINE_UNPROCESSED; } @@ -103,6 +107,7 @@ ENDparseSelectorAct BEGINmodExit CODESTARTmodExit + objRelease(errmsg, CORE_COMPONENT); ENDmodExit @@ -116,6 +121,7 @@ BEGINmodInit(Discard) CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr + CHKiRet(objUse(errmsg, CORE_COMPONENT)); ENDmodInit /* * vi:set ai: -- cgit v1.2.3