summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-02-22 11:55:12 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-02-22 11:55:12 +0100
commit70bd55d51b6107231b841bfa03d5620bf984e3f2 (patch)
tree909ec036ba15cc3fb538d42b83a724040ec7a4ce
parent36c1649fc187090bfd5af2c48bb44ce25a0fdef6 (diff)
downloadrsyslog-70bd55d51b6107231b841bfa03d5620bf984e3f2.tar.gz
rsyslog-70bd55d51b6107231b841bfa03d5620bf984e3f2.tar.xz
rsyslog-70bd55d51b6107231b841bfa03d5620bf984e3f2.zip
bugfix: imuxsock does not sanitization at all (regression)
This also causes problems when NUL characters are present inside the message (as is the case with spamd).
-rw-r--r--ChangeLog3
-rw-r--r--plugins/imuxsock/imuxsock.c9
2 files changed, 6 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 82dd5ac1..f771ad54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,10 +5,9 @@ Version 5.7.5 [V5-BETA] (rgerhards), 2011-02-??
functionality and b) one may argue that this missing functionality is
close to a bug.
- improved testbench, added tests for imuxsock
-- bugfix: imuxsock did no longer remove trailing LF
+- bugfix: imuxsock did no longer sanitize received messages
This was a regression from the imuxsock partial rewrite. Happened
because the message is no longer run through the standard parsers.
- Now imuxsock does this sanitization itself.
bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=224
- bugfix: minor race condition in action.c - considered cosmetic
This is considered cosmetic as multiple threads tried to write exactly
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index 0b5ca6be..9f1e51b7 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -46,6 +46,7 @@
#include "net.h"
#include "glbl.h"
#include "msg.h"
+#include "parser.h"
#include "prop.h"
#include "debug.h"
#include "unlimited_select.h"
@@ -81,6 +82,7 @@ DEF_IMOD_STATIC_DATA
DEFobjCurrIf(errmsg)
DEFobjCurrIf(glbl)
DEFobjCurrIf(prop)
+DEFobjCurrIf(parser)
DEFobjCurrIf(datetime)
DEFobjCurrIf(statsobj)
@@ -517,10 +519,6 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred)
* rate-limiting as well.
*/
parse = pRcv;
- if(pRcv[lenRcv-1] == '\n') {
- DBGPRINTF("imuxsock: found trailing LF, removing\n");
- lenRcv--;
- }
lenMsg = lenRcv;
parse++; lenMsg--; /* '<' */
@@ -547,6 +545,7 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred)
/* we now create our own message object and submit it to the queue */
CHKiRet(msgConstructWithTime(&pMsg, &st, tt));
MsgSetRawMsg(pMsg, (char*)pRcv, lenRcv);
+ parser.SanitizeMsg(pMsg);
MsgSetInputName(pMsg, pInputName);
MsgSetFlowControlType(pMsg, pLstn->flowCtl);
@@ -840,6 +839,7 @@ BEGINmodExit
CODESTARTmodExit
statsobj.Destruct(&modStats);
+ objRelease(parser, CORE_COMPONENT);
objRelease(glbl, CORE_COMPONENT);
objRelease(errmsg, CORE_COMPONENT);
objRelease(prop, CORE_COMPONENT);
@@ -901,6 +901,7 @@ CODEmodInit_QueryRegCFSLineHdlr
CHKiRet(objUse(prop, CORE_COMPONENT));
CHKiRet(objUse(statsobj, CORE_COMPONENT));
CHKiRet(objUse(datetime, CORE_COMPONENT));
+ CHKiRet(objUse(parser, CORE_COMPONENT));
dbgprintf("imuxsock version %s initializing\n", PACKAGE_VERSION);