summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-08-31 11:26:20 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-08-31 11:26:20 +0200
commit3aa51f2a13374f4e235a13533c552ec3504cb235 (patch)
tree9e9aaa4ccd94cd608103f5c8e173be99e59a1500
parenta8b231875ba6990422f85bd60237c5a2f3c4e7d0 (diff)
parente3c90bf008d447bc087c4215a630ed023ca6a1b6 (diff)
downloadrsyslog-3aa51f2a13374f4e235a13533c552ec3504cb235.tar.gz
rsyslog-3aa51f2a13374f4e235a13533c552ec3504cb235.tar.xz
rsyslog-3aa51f2a13374f4e235a13533c552ec3504cb235.zip
Merge branch 'beta'
Conflicts: action.c
-rw-r--r--ChangeLog3
-rw-r--r--action.c46
-rw-r--r--plugins/immark/immark.c1
3 files changed, 26 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 3944e233..0cc502b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
---------------------------------------------------------------------------
Version 6.3.5 [DEVEL] (rgerhards/al), 2011-09-01
- bugfix/security: off-by-two bug in legacy syslog parser, CVE-2011-3200
+- bugfix: mark message processing did not work correctly
- imudp&imtcp now report error if no listener at all was defined
Thanks to Marcin for suggesting this error message.
- bugfix: potential misadressing in property replacer
@@ -51,6 +52,7 @@ Version 6.3.2 [DEVEL] (rgerhards), 2011-07-06
---------------------------------------------------------------------------
Version 6.1.12 [BETA], 2011-09-01
- bugfix/security: off-by-two bug in legacy syslog parser, CVE-2011-3200
+- bugfix: mark message processing did not work correctly
- bugfix: potential misadressing in property replacer
- bugfix: memcpy overflow can occur in allowed sender checkig
if a name is resolved to IPv4-mapped-on-IPv6 address
@@ -353,6 +355,7 @@ Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-06-08
---------------------------------------------------------------------------
Version 5.8.5 [V5-stable] (rgerhards/al), 2011-09-01
- bugfix/security: off-by-two bug in legacy syslog parser, CVE-2011-3200
+- bugfix: mark message processing did not work correctly
- bugfix: potential hang condition during tag emulation
- bugfix: too-early string termination during tag emulation
- bugfix: The NUL-Byte for the syslogtag was not copied in MsgDup (msg.c)
diff --git a/action.c b/action.c
index 9abd14d5..f8c12c60 100644
--- a/action.c
+++ b/action.c
@@ -1560,7 +1560,6 @@ doSubmitToActionQNotAllMarkBatch(action_t *pAction, batch_t *pBatch)
time_t now = 0;
time_t lastAct;
int i;
- int bProcessMarkMsgs = 0;
int bModifiedFilter;
sbool FilterSave[1024];
sbool *pFilterSave;
@@ -1574,33 +1573,32 @@ doSubmitToActionQNotAllMarkBatch(action_t *pAction, batch_t *pBatch)
bModifiedFilter = 0;
for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) {
+ if(!pBatch->pElem[i].bFilterOK)
+ continue;
pFilterSave[i] = pBatch->pElem[i].bFilterOK;
- if(((msg_t*)(pBatch->pElem[i].pUsrp))->msgFlags & MARK) {
- /* check if we need to write or not */
- if(now == 0) {
- now = datetime.GetTime(NULL); /* good time call - the only one done */
- /* CAS loop, we write back a bit early, but that's OK... */
- /* we use reception time, not dequeue time - this is considered more appropriate and
- * also faster ;) -- rgerhards, 2008-09-17 */
- do {
- lastAct = pAction->f_time;
- if((now - lastAct) < MarkInterval / 2) {
- DBGPRINTF("action was recently called, ignoring mark message\n");
- bProcessMarkMsgs = 0;
- } else {
- bProcessMarkMsgs = 1;
- }
- } while(ATOMIC_CAS_time_t(&pAction->f_time, lastAct,
- ((msg_t*)(pBatch->pElem[i].pUsrp))->ttGenTime, &pAction->mutCAS) == 0);
- }
- if(bProcessMarkMsgs) {
- pBatch->pElem[i].bFilterOK = 0;
- bModifiedFilter = 1;
+ if(now == 0) {
+ now = datetime.GetTime(NULL); /* good time call - the only one done */
+ }
+ /* CAS loop, we write back a bit early, but that's OK... */
+ /* we use reception time, not dequeue time - this is considered more appropriate and
+ * also faster ;) -- rgerhards, 2008-09-17 */
+ do {
+ lastAct = pAction->f_time;
+ if(((msg_t*)(pBatch->pElem[i].pUsrp))->msgFlags & MARK) {
+ if((now - lastAct) < MarkInterval / 2) {
+ pBatch->pElem[i].bFilterOK = 0;
+ bModifiedFilter = 1;
+ DBGPRINTF("action was recently called, ignoring mark message\n");
+ break; /* do not update timestamp for non-written mark messages */
+ }
}
+ } while(ATOMIC_CAS_time_t(&pAction->f_time, lastAct,
+ ((msg_t*)(pBatch->pElem[i].pUsrp))->ttGenTime, &pAction->mutCAS) == 0);
+ if(pBatch->pElem[i].bFilterOK) {
+ DBGPRINTF("Called action(NotAllMark), processing batch[%d] via '%s'\n",
+ i, module.GetStateName(pAction->pMod));
}
}
-
- DBGPRINTF("Called action(NotAllMark), logging to %s\n", module.GetStateName(pAction->pMod));
iRet = doSubmitToActionQBatch(pAction, pBatch);
diff --git a/plugins/immark/immark.c b/plugins/immark/immark.c
index 9a768e49..64b699fa 100644
--- a/plugins/immark/immark.c
+++ b/plugins/immark/immark.c
@@ -130,6 +130,7 @@ CODESTARTrunInput
if(glbl.GetGlobalInputTermState() == 1)
break; /* terminate input! */
+ dbgprintf("immark: injecting mark message\n");
logmsgInternal(NO_ERRCODE, LOG_INFO, (uchar*)"-- MARK --", MARK);
}
ENDrunInput