summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-09-26 12:48:57 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-09-26 12:48:57 +0200
commitf2528ec101eb660560c7ec327d440cbb17f04f14 (patch)
tree05083efcd96dedc9387579caa17c81b8b78592c6
parentceb336f0398e37ab51b4b54a14fa394d53ccdf3f (diff)
parent0c7604dc27119122a3022c7bf094ffb5f8d59e6d (diff)
downloadrsyslog-f2528ec101eb660560c7ec327d440cbb17f04f14.tar.gz
rsyslog-f2528ec101eb660560c7ec327d440cbb17f04f14.tar.xz
rsyslog-f2528ec101eb660560c7ec327d440cbb17f04f14.zip
Merge branch 'v5-devel'
Conflicts: ChangeLog configure.ac doc/manual.html runtime/conf.c tools/omfile.c tools/omusrmsg.c
-rw-r--r--ChangeLog67
-rw-r--r--plugins/imuxsock/imuxsock.c13
-rw-r--r--runtime/conf.c7
-rw-r--r--runtime/module-template.h2
-rw-r--r--runtime/msg.c1
-rw-r--r--runtime/rsyslog.h1
-rw-r--r--tools/omfile.c22
-rw-r--r--tools/omusrmsg.c6
-rw-r--r--tools/syslogd.c2
9 files changed, 102 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index e6ea72ea..3bf95fc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
---------------------------------------------------------------------------
+Version 6.3.7 [DEVEL] 2011-0?-??
+- bugfix: imuxsock did no longer ignore message-provided timestamp, if
+ so configured (the *default*). Lead to no longer sub-second timestamps.
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=281
+- bugfix: omfile returns fatal error code for things that go really wrong
+ previously, RS_RET_RESUME was returned, which lead to a loop inside the
+ rule engine as omfile could not really recover.
+- bugfix: rsyslogd -v always said 64 atomics were not present
+ thanks to mono_matsuko for the patch
+---------------------------------------------------------------------------
Version 6.3.6 [DEVEL] 2011-09-19
- added $InputRELPServerBindRuleset directive to specify rulesets for RELP
- bugfix: config parser did not support properties with dashes in them
@@ -286,6 +296,27 @@ expected that interfaces, even new ones, break during the initial
syslog plain tcp input plugin (NOT supporting TLS!)
[ported from v4]
---------------------------------------------------------------------------
+Version 5.9.4 [V5-DEVEL], 2011-0?-??
+- bugfix: imuxsock did no longer ignore message-provided timestamp, if
+ so configured (the *default*). Lead to no longer sub-second timestamps.
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=281
+- bugfix: omfile returns fatal error code for things that go really wrong
+ previously, RS_RET_RESUME was returned, which lead to a loop inside the
+ rule engine as omfile could not really recover.
+- bugfix: rsyslogd -v always said 64 atomics were not present
+ thanks to mono_matsuko for the patch
+---------------------------------------------------------------------------
+Version 5.9.3 [V5-DEVEL], 2011-09-01
+- bugfix/security: off-by-two bug in legacy syslog parser, CVE-2011-3200
+- bugfix: mark message processing did not work correctly
+- added capability to emit config error location info for warnings
+ otherwise, omusrmsg's warning about new config format was not
+ accompanied by problem location.
+- bugfix: potential misadressing in property replacer
+- bugfix: MSGID corruption in RFC5424 parser under some circumstances
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=275
+- bugfix: The NUL-Byte for the syslogtag was not copied in MsgDup (msg.c)
+---------------------------------------------------------------------------
Version 5.9.2 [V5-DEVEL] (rgerhards), 2011-07-11
- systemd support: set stdout/stderr to null - thx to Lennart for the patch
- added support for the ":omusrmsg:" syntax in configuring user messages
@@ -358,6 +389,16 @@ Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-06-08
affected directive was: $ActionExecOnlyWhenPreviousIsSuspended on
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=236
---------------------------------------------------------------------------
+Version 5.8.6 [V5-stable] (rgerhards/al), 2011-??-??
+- bugfix: imuxsock did no longer ignore message-provided timestamp, if
+ so configured (the *default*). Lead to no longer sub-second timestamps.
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=281
+- bugfix: omfile returns fatal error code for things that go really wrong
+ previously, RS_RET_RESUME was returned, which lead to a loop inside the
+ rule engine as omfile could not really recover.
+- bugfix: rsyslogd -v always said 64 atomics were not present
+ thanks to mono_matsuko for the patch
+---------------------------------------------------------------------------
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
@@ -1175,6 +1216,32 @@ increase.
- increased ompgsql performance by adapting to new transactional
output module interface
---------------------------------------------------------------------------
+Version 4.8.1 [v4-beta], 2011-09-??
+- bugfix: potential abort if ultra-large file io buffers are used and
+ dynafile cache exhausts address space (primarily a problem on 32 bit
+ platforms)
+---------------------------------------------------------------------------
+Version 4.8.0 [v4-stable] (rgerhards), 2011-09-07
+***************************************************************************
+* This is a new stable v4 version. It contains all fixes and enhancements *
+* made during the 4.7.x phase as well as those listed below. *
+* Note: major new development to v4 is concluded and will only be done *
+* for custom projects. *
+***************************************************************************
+There are no changes compared to 4.7.5, just a re-release with the new
+version number as new v4-stable. The most important new feature is Solaris
+support.
+---------------------------------------------------------------------------
+Version 4.7.5 [v4-beta], 2011-09-01
+- bugfix/security: off-by-two bug in legacy syslog parser, CVE-2011-3200
+- bugfix: potential misadressing in property replacer
+- bugfix: The NUL-Byte for the syslogtag was not copied in MsgDup (msg.c)
+---------------------------------------------------------------------------
+Version 4.7.4 [v4-beta] (rgerhards), 2011-07-11
+- added support for the ":omusrmsg:" syntax in configuring user messages
+- added support for the ":omfile:" syntax in configuring user messages
+- added $LocalHostName config directive
+- bugfix: PRI was invalid on Solaris for message from local log socket
Version 4.7.3 [v4-devel] (rgerhards), 2010-11-25
- added omuxsock, which permits to write message to local Unix sockets
this is the counterpart to imuxsock, enabling fast local forwarding
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index f5330146..cf4211e7 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -442,7 +442,7 @@ createLogSocket(lstn_t *pLstn)
pLstn->fd = socket(AF_UNIX, SOCK_DGRAM, 0);
if(pLstn->fd < 0 || bind(pLstn->fd, (struct sockaddr *) &sunx, SUN_LEN(&sunx)) < 0 ||
chmod((char*)pLstn->sockName, 0666) < 0) {
- errmsg.LogError(errno, NO_ERRCODE, "connot create '%s'", pLstn->sockName);
+ errmsg.LogError(errno, NO_ERRCODE, "cannot create '%s'", pLstn->sockName);
dbgprintf("cannot create %s (%d).\n", pLstn->sockName, errno);
close(pLstn->fd);
pLstn->fd = -1;
@@ -662,8 +662,13 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred, struct tim
parse++; lenMsg--; /* '>' */
if(ts == NULL) {
- if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &parse, &lenMsg) != RS_RET_OK) {
- DBGPRINTF("we have a problem, invalid timestamp in msg!\n");
+ if((pLstn->flags & IGNDATE)) {
+ parse += 16; /* just skip timestamp */
+ lenMsg -= 16;
+ } else {
+ if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &parse, &lenMsg) != RS_RET_OK) {
+ DBGPRINTF("we have a problem, invalid timestamp in msg!\n");
+ }
}
} else { /* if we pulled the time from the system, we need to update the message text */
if(lenMsg >= 16) {
@@ -686,7 +691,7 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred, struct tim
/* pull tag */
i = 0;
- while(lenMsg > 0 && *parse != ' ' && i < CONF_TAG_MAXSIZE) {
+ while(lenMsg > 0 && *parse != ' ' && i < CONF_TAG_MAXSIZE - 1) {
bufParseTAG[i++] = *parse++;
--lenMsg;
}
diff --git a/runtime/conf.c b/runtime/conf.c
index f47ac501..ec612ab8 100644
--- a/runtime/conf.c
+++ b/runtime/conf.c
@@ -716,6 +716,7 @@ rsRetVal cflineDoAction(rsconf_t *conf, uchar **p, action_t **ppAction)
modInfo_t *pMod;
cfgmodules_etry_t *node;
omodStringRequest_t *pOMSR;
+ int bHadWarning = 0;
action_t *pAction = NULL;
void *pModData;
DEFiRet;
@@ -735,6 +736,10 @@ rsRetVal cflineDoAction(rsconf_t *conf, uchar **p, action_t **ppAction)
pMod = node->pMod;
iRet = pMod->mod.om.parseSelectorAct(p, &pModData, &pOMSR);
dbgprintf("tried selector action for %s: %d\n", module.GetName(pMod), iRet);
+ if(iRet == RS_RET_OK_WARN) {
+ bHadWarning = 1;
+ iRet = RS_RET_OK;
+ }
if(iRet == RS_RET_OK || iRet == RS_RET_SUSPENDED) {
/* advance our config parser state: we now only accept an $End as valid,
* no more action statments.
@@ -769,6 +774,8 @@ rsRetVal cflineDoAction(rsconf_t *conf, uchar **p, action_t **ppAction)
}
*ppAction = pAction;
+ if(iRet == RS_RET_OK && bHadWarning)
+ iRet = RS_RET_OK_WARN;
RETiRet;
}
diff --git a/runtime/module-template.h b/runtime/module-template.h
index d360447a..95107cb6 100644
--- a/runtime/module-template.h
+++ b/runtime/module-template.h
@@ -285,7 +285,7 @@ static rsRetVal parseSelectorAct(uchar **pp, void **ppModData, omodStringRequest
#define CODE_STD_FINALIZERparseSelectorAct \
finalize_it:\
- if(iRet == RS_RET_OK || iRet == RS_RET_SUSPENDED) {\
+ if(iRet == RS_RET_OK || iRet == RS_RET_OK_WARN || iRet == RS_RET_SUSPENDED) {\
*ppModData = pData;\
*pp = p;\
} else {\
diff --git a/runtime/msg.c b/runtime/msg.c
index 420fa542..bd1950ad 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -1733,7 +1733,6 @@ getTAG(msg_t *pM, uchar **ppBuf, int *piLen)
*piLen = pM->iLenTAG;
}
}
-dbgprintf("getTAG: len %d, buf '%s'\n", *piLen, *ppBuf);
}
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index cc1044a1..fc8578a8 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -352,6 +352,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_WRN_WRKDIR = -2182, /**< correctable problems with the rsyslog working directory */
RS_RET_ERR_QUEUE_EMERGENCY = -2183, /**< some fatal error caused queue to switch to emergency mode */
RS_RET_OUTDATED_STMT = -2184, /**< some outdated statement/functionality is being used in conf file */
+ RS_RET_OK_WARN = -2185, /**< config part: everything was OK, but a warning message was emitted */
RS_RET_INVLD_CONF_OBJ= -2200, /**< invalid config object (e.g. $Begin conf statement) */
RS_RET_ERR_LIBEE_INIT = -2201, /**< cannot obtain libee ctx */
diff --git a/tools/omfile.c b/tools/omfile.c
index 3cc3a7f9..e68bddd4 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -427,6 +427,7 @@ prepareFile(instanceData *pData, uchar *newFileName)
int fd;
DEFiRet;
+ pData->pStrm = NULL;
if(access((char*)newFileName, F_OK) != 0) {
/* file does not exist, create it (and eventually parent directories */
if(pData->bCreateDirs) {
@@ -497,8 +498,10 @@ prepareFile(instanceData *pData, uchar *newFileName)
CHKiRet(strm.ConstructFinalize(pData->pStrm));
finalize_it:
- if(pData->pStrm == NULL) {
- DBGPRINTF("Error opening log file: %s\n", pData->f_fname);
+ if(iRet != RS_RET_OK) {
+ if(pData->pStrm != NULL) {
+ strm.Destruct(&pData->pStrm);
+ }
}
RETiRet;
}
@@ -576,7 +579,7 @@ prepareDynFile(instanceData *pData, uchar *newFileName, unsigned iMsgOpts)
pData->iCurrElt = -1;
/* similarly, we need to set the current pStrm to NULL, because otherwise, if prepareFile() fails,
* we may end up using an old stream. This bug depends on how exactly prepareFile fails,
- * but it* could be triggered in the common case of a failed open() system call.
+ * but it could be triggered in the common case of a failed open() system call.
* rgerhards, 2010-03-22
*/
pData->pStrm = NULL;
@@ -604,8 +607,8 @@ prepareDynFile(instanceData *pData, uchar *newFileName, unsigned iMsgOpts)
/* Ok, we finally can open the file */
localRet = prepareFile(pData, newFileName); /* ignore exact error, we check fd below */
- /* file is either open now or an error state set */ // RG: better check localRet?
- if(pData->pStrm == NULL) {
+ /* check if we had an error */
+ if(localRet != RS_RET_OK) {
/* do not report anything if the message is an internally-generated
* message. Otherwise, we could run into a never-ending loop. The bad
* news is that we also lose errors on startup messages, but so it is.
@@ -613,7 +616,7 @@ prepareDynFile(instanceData *pData, uchar *newFileName, unsigned iMsgOpts)
if(iMsgOpts & INTERNAL_MSG) {
DBGPRINTF("Could not open dynaFile, discarding message\n");
} else {
- errmsg.LogError(0, NO_ERRCODE, "Could not open dynamic file '%s' - discarding message", newFileName);
+ errmsg.LogError(0, NO_ERRCODE, "Could not open dynamic file '%s' [state %d] - discarding message", newFileName, localRet);
}
ABORT_FINALIZE(localRet);
}
@@ -683,10 +686,6 @@ writeFile(uchar **ppString, unsigned iMsgOpts, instanceData *pData)
CHKiRet(doWrite(pData, ppString[0], strlen(CHAR_CONVERT(ppString[0]))));
finalize_it:
- if(iRet != RS_RET_OK) {
-
- iRet = RS_RET_SUSPENDED;
- }
RETiRet;
}
@@ -719,7 +718,8 @@ ENDbeginTransaction
BEGINendTransaction
CODESTARTendTransaction
- if(pData->bFlushOnTXEnd) {
+ /* Note: pStrm may be NULL if there was an error opening the stream */
+ if(pData->bFlushOnTXEnd && pData->pStrm != NULL) {
CHKiRet(strm.Flush(pData->pStrm));
}
finalize_it:
diff --git a/tools/omusrmsg.c b/tools/omusrmsg.c
index 358b6ce7..f30af5c3 100644
--- a/tools/omusrmsg.c
+++ b/tools/omusrmsg.c
@@ -388,6 +388,7 @@ ENDnewActInst
BEGINparseSelectorAct
es_str_t *usrs;
+ int bHadWarning;
CODESTARTparseSelectorAct
CODE_STD_STRING_REQUESTparseSelectorAct(1)
if(!strncmp((char*) p, ":omusrmsg:", sizeof(":omusrmsg:") - 1)) {
@@ -395,12 +396,13 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
} else {
if(!*p || !((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z')
|| (*p >= '0' && *p <= '9') || *p == '_' || *p == '.' || *p == '*')) {
- ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED);
+ ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED);
} else {
errmsg.LogError(0, RS_RET_OUTDATED_STMT,
"action '%s' treated as ':omusrmsg:%s' - please "
"change syntax, '%s' will not be supported in the future",
p, p, p);
+ bHadWarning = 1;
}
}
@@ -424,6 +426,8 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
!= RS_RET_OK)
goto finalize_it;
}
+ if(iRet == RS_RET_OK && bHadWarning)
+ iRet = RS_RET_OK_WARN;
CODE_STD_FINALIZERparseSelectorAct
ENDparseSelectorAct
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 6d794260..d1224f2d 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -1368,7 +1368,7 @@ static void printVersion(void)
#else
printf("\t32bit Atomic operations supported:\tNo\n");
#endif
-#ifdef HAVE_ATOMIC_BUILTINS64
+#ifdef HAVE_ATOMIC_BUILTINS_64BIT
printf("\t64bit Atomic operations supported:\tYes\n");
#else
printf("\t64bit Atomic operations supported:\tNo\n");