summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--runtime/rsconf.c18
-rw-r--r--tools/omusrmsg.c1
3 files changed, 26 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 95cd80e5..29cc48c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,15 @@ Version 6.4.1 [V6-STABLE] 2012-08-??
small risk that this may break some things that relied on the previous
inconsistency.
Thanks to Miloslav Trmač for the patch
+- bugfix: omusrsmsg incorrect return state & config warning handling
+ During config file processing, Omusrmsg often incorrectly returned a
+ warning status, even when no warning was present (caused by
+ uninitialized variable). Also, the core handled warning messages
+ incorrectly, and treated them as errors. As a result, omusrmsg
+ (most often) could not properly be loaded. Note that this only
+ occurs with legacy config action syntax. This was a regression
+ caused by an incorrect merge in to the 6.3.x codebase.
+ Thanks to Stefano Mason for alerting us of this bug.
---------------------------------------------------------------------------
Version 6.4.0 [V6-STABLE] 2012-08-20
- THIS IS THE FIRST VERSION OF THE 6.4.x STABLE BRANCH
diff --git a/runtime/rsconf.c b/runtime/rsconf.c
index 16929b71..b83ba063 100644
--- a/runtime/rsconf.c
+++ b/runtime/rsconf.c
@@ -223,6 +223,7 @@ cnfDoActlst(struct cnfactlst *actlst, rule_t *pRule)
struct cnfcfsyslinelst *cflst;
action_t *pAction;
uchar *str;
+ rsRetVal localRet;
DEFiRet;
while(actlst != NULL) {
@@ -236,9 +237,22 @@ cnfDoActlst(struct cnfactlst *actlst, rule_t *pRule)
"around line %d", actlst->cnfFile, actlst->lineno);
}
} else {
- dbgprintf("legacy action line:%s\n", actlst->data.legActLine);
+ DBGPRINTF("legacy action line:%s\n", actlst->data.legActLine);
str = (uchar*) actlst->data.legActLine;
- CHKiRet(cflineDoAction(loadConf, &str, &pAction));
+ if((localRet = cflineDoAction(loadConf, &str, &pAction)) != RS_RET_OK) {
+ uchar szErrLoc[MAXFNAME + 64];
+ if(localRet != RS_RET_OK_WARN) {
+ DBGPRINTF("legacy action line NOT successfully processed\n");
+ }
+ snprintf((char*)szErrLoc, sizeof(szErrLoc) / sizeof(uchar),
+ "%s, line %d", actlst->cnfFile, actlst->lineno);
+ errmsg.LogError(0, NO_ERRCODE, "the last %s occured in %s:\"%s\"",
+ (localRet == RS_RET_OK_WARN) ? "warning" : "error",
+ (char*)szErrLoc, (char*)actlst->data.legActLine);
+ if(localRet != RS_RET_OK_WARN) {
+ ABORT_FINALIZE(localRet);
+ }
+ }
iRet = llAppend(&(pRule)->llActList, NULL, (void*) pAction);
}
for( cflst = actlst->syslines
diff --git a/tools/omusrmsg.c b/tools/omusrmsg.c
index e57d7ef9..a7df9243 100644
--- a/tools/omusrmsg.c
+++ b/tools/omusrmsg.c
@@ -385,6 +385,7 @@ BEGINparseSelectorAct
int bHadWarning;
CODESTARTparseSelectorAct
CODE_STD_STRING_REQUESTparseSelectorAct(1)
+ bHadWarning = 0;
if(!strncmp((char*) p, ":omusrmsg:", sizeof(":omusrmsg:") - 1)) {
p += sizeof(":omusrmsg:") - 1; /* eat indicator sequence (-1 because of '\0'!) */
} else {