summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-09-12 15:11:38 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-09-12 15:11:38 +0200
commit63994d092c3567030b96d28dbdc3db5f0e22fba2 (patch)
tree42d94ec95dc0231b0a8a86c52fd9605e524e6b09
parent2082d963975a88c8e4dee3a43b98d939f9a2323f (diff)
parentc04f196e25d63a7f45bf2ad79b48019fed98e5c9 (diff)
downloadrsyslog-63994d092c3567030b96d28dbdc3db5f0e22fba2.tar.gz
rsyslog-63994d092c3567030b96d28dbdc3db5f0e22fba2.tar.xz
rsyslog-63994d092c3567030b96d28dbdc3db5f0e22fba2.zip
Merge branch 'v3-stable' into beta
Conflicts: runtime/datetime.h runtime/rsyslog.h
-rw-r--r--ChangeLog23
-rw-r--r--action.c2
-rw-r--r--runtime/datetime.c17
-rw-r--r--runtime/datetime.h8
-rw-r--r--runtime/rsyslog.h2
-rw-r--r--tools/syslogd.c17
6 files changed, 57 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e7283f6..432ae299 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -176,6 +176,21 @@ Version 3.18.4 (rgerhards), 2008-09-??
patch.
- doc bugfix: rsyslog.conf man page improved and minor nit fixed
thanks to Lukas Kuklinek for the patch.
+- bugfix: error code -2025 was used for two different errors. queue full
+ is now -2074 and -2025 is unique again. (did cause no real problem
+ except for troubleshooting)
+- bugfix: default discard severity was incorrectly set to 4, which lead
+ to discard-on-queue-full to be enabled by default. That could cause
+ message loss where non was expected. The default has now been changed
+ to the correct value of 8, which disables the functionality. This
+ problem applied both to the main message queue and the action queues.
+ Thanks to Raoul Bhatia for pointing out this problem.
+- bugfix: option value for legacy -a option could not be specified,
+ resulting in strange operations. Thanks to Marius Tomaschewski
+ for the patch.
+- bugfix: colon after date should be ignored, but was not. This has
+ now been corrected. Required change to the internal ParseTIMESTAMP3164()
+ interface.
---------------------------------------------------------------------------
Version 3.18.3 (rgerhards), 2008-08-18
- bugfix: imfile could cause a segfault upon rsyslogd HUP and termination
@@ -799,6 +814,14 @@ Version 3.10.0 (rgerhards), 2008-01-07
- much cleaner code due to new objects and removal of single-threading
mode
---------------------------------------------------------------------------
+Version 2.0.6 V2-STABLE (rgerhards), 2008-??-??
+- bugfix: copy&paste error lead to dangling if - this caused a very minor
+ issue with re-formatting a RFC3164 date when the message was invalidly
+ formatted and had a colon immediately after the date. This was in the
+ code for some years (even v1 had it) and I think it never had any
+ effect at all in practice. Though, it should be fixed - but definitely
+ nothing to worry about.
+---------------------------------------------------------------------------
Version 2.0.6 V2-STABLE (rgerhards), 2008-08-07
- bugfix: IPv6 addresses could not be specified in forwarding actions
New syntax @[addr]:port introduced to enable that. Root problem was IPv6
diff --git a/action.c b/action.c
index 61ff589a..5f9e35db 100644
--- a/action.c
+++ b/action.c
@@ -105,7 +105,7 @@ actionResetQueueParams(void)
iActionQHighWtrMark = 800; /* high water mark for disk-assisted queues */
iActionQLowWtrMark = 200; /* low water mark for disk-assisted queues */
iActionQDiscardMark = 9800; /* begin to discard messages */
- iActionQDiscardSeverity = 4; /* discard warning and above */
+ iActionQDiscardSeverity = 8; /* discard warning and above */
iActionQueueNumWorkers = 1; /* number of worker threads for the mm queue above */
iActionQueMaxFileSize = 1024*1024;
iActionQPersistUpdCnt = 0; /* persist queue info every n updates */
diff --git a/runtime/datetime.c b/runtime/datetime.c
index 5211b78a..6d5652ff 100644
--- a/runtime/datetime.c
+++ b/runtime/datetime.c
@@ -266,10 +266,14 @@ ParseTIMESTAMP3339(struct syslogTime *pTime, char** ppszTS)
* Returns TRUE on parse OK, FALSE on parse error.
*/
static int
-ParseTIMESTAMP3164(struct syslogTime *pTime, char* pszTS)
+ParseTIMESTAMP3164(struct syslogTime *pTime, char** ppszTS)
{
- assert(pTime != NULL);
+ char *pszTS;
+
+ assert(ppszTS != NULL);
+ pszTS = *ppszTS;
assert(pszTS != NULL);
+ assert(pTime != NULL);
getCurrTime(pTime); /* obtain the current year and UTC offsets! */
@@ -436,13 +440,20 @@ ParseTIMESTAMP3164(struct syslogTime *pTime, char* pszTS)
pTime->second = srSLMGParseInt32(&pszTS);
if(pTime->second < 0 || pTime->second > 60)
return FALSE;
- if(*pszTS++ != ':')
+
+ /* we provide support for an exter ":" after the date. While this is an
+ * invalid format, it occurs frequently enough (e.g. with Cisco devices)
+ * to permit it as a valid case. -- rgerhards, 2008-09-12
+ */
+ if(*pszTS++ == ':')
+ ++pszTS;
/* OK, we actually have a 3164 timestamp, so let's indicate this
* and fill the rest of the properties. */
pTime->timeType = 1;
pTime->secfracPrecision = 0;
pTime->secfrac = 0;
+ *ppszTS = pszTS; /* provide updated parse position back to caller */
return TRUE;
}
diff --git a/runtime/datetime.h b/runtime/datetime.h
index 8f1bcb17..755cc0ed 100644
--- a/runtime/datetime.h
+++ b/runtime/datetime.h
@@ -37,7 +37,7 @@ typedef struct datetime_s {
BEGINinterface(datetime) /* name must also be changed in ENDinterface macro! */
void (*getCurrTime)(struct syslogTime *t);
int (*ParseTIMESTAMP3339)(struct syslogTime *pTime, char** ppszTS);
- int (*ParseTIMESTAMP3164)(struct syslogTime *pTime, char* pszTS);
+ int (*ParseTIMESTAMP3164)(struct syslogTime *pTime, char** pszTS);
int (*formatTimestampToMySQL)(struct syslogTime *ts, char* pDst, size_t iLenDst);
int (*formatTimestampToPgSQL)(struct syslogTime *ts, char *pDst, size_t iLenDst);
int (*formatTimestamp3339)(struct syslogTime *ts, char* pBuf, size_t iLenBuf);
@@ -45,6 +45,12 @@ BEGINinterface(datetime) /* name must also be changed in ENDinterface macro! */
int (*formatTimestampSecFrac)(struct syslogTime *ts, char* pBuf, size_t iLenBuf);
ENDinterface(datetime)
#define datetimeCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */
+/* interface changes:
+ * 1 - initial version
+ * 2 - not compatible to 1 - bugfix required ParseTIMESTAMP3164 to accept char ** as
+ * last parameter. Did not try to remain compatible as this is not something any
+ * third-party module should call. -- rgerhards, 2008.-09-12
+ */
/* prototypes */
PROTOTYPEObj(datetime);
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index 95b2c756..8843df85 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -170,7 +170,6 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_GSS_SEND_ERROR = -2024, /**< error during GSS (via TCP) send process */
RS_RET_TCP_SOCKCREATE_ERR = -2025, /**< error during creation of TCP socket */
RS_RET_GSS_SENDINIT_ERROR = -2024, /**< error during GSS (via TCP) send initialization process */
- RS_RET_QUEUE_FULL = -2025, /**< queue is full, operation could not be completed */
RS_RET_EOF = -2026, /**< end of file reached, not necessarily an error */
RS_RET_IO_ERROR = -2027, /**< some kind of IO error happened */
RS_RET_INVALID_OID = -2028, /**< invalid object ID */
@@ -248,6 +247,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_RETRY = -2100, /**< call should be retried (e.g. EGAIN on recv) */
RS_RET_GSS_ERR = -2101, /**< generic error occured in GSSAPI subsystem */
RS_RET_CERTLESS = -2102, /**< state: we run without machine cert (this may be OK) */
+ RS_RET_QUEUE_FULL = -2103, /**< queue is full, operation could not be completed */
/* RainerScript error messages (range 1000.. 1999) */
RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */
diff --git a/tools/syslogd.c b/tools/syslogd.c
index e432a67d..439ca303 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -372,7 +372,7 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a
iMainMsgQHighWtrMark = 8000;
iMainMsgQLowWtrMark = 2000;
iMainMsgQDiscardMark = 9800;
- iMainMsgQDiscardSeverity = 4;
+ iMainMsgQDiscardSeverity = 8;
iMainMsgQueMaxFileSize = 1024 * 1024;
iMainMsgQueueNumWorkers = 1;
iMainMsgQPersistUpdCnt = 0;
@@ -1394,13 +1394,18 @@ static int parseLegacySyslogMsg(msg_t *pMsg, int flags)
*/
if(datetime.ParseTIMESTAMP3339(&(pMsg->tTIMESTAMP), &p2parse) == TRUE) {
/* we are done - parse pointer is moved by ParseTIMESTAMP3339 */;
- } else if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), p2parse) == TRUE) {
- p2parse += 16;
+ } else if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &p2parse) == TRUE) {
+ /* we are done - parse pointer is moved by ParseTIMESTAMP3164 */;
} else if(*p2parse == ' ') { /* try to see if it is slighly malformed - HP procurve seems to do that sometimes */
- if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), p2parse+1) == TRUE) {
+ ++p2parse; /* move over space */
+ if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &p2parse) == TRUE) {
/* indeed, we got it! */
- p2parse += 17;
+ /* we are done - parse pointer is moved by ParseTIMESTAMP3164 */;
} else {
+ /* parse pointer needs to be restored, as we moved it off-by-one
+ * for this try.
+ */
+ --p2parse;
flags |= ADDDATE;
}
} else {
@@ -3003,7 +3008,7 @@ int realMain(int argc, char **argv)
* only when actually neeeded.
* rgerhards, 2008-04-04
*/
- while ((ch = getopt(argc, argv, "46aAc:def:g:hi:l:m:M:nopqQr::s:t:u:vwx")) != EOF) {
+ while ((ch = getopt(argc, argv, "46a:Ac:def:g:hi:l:m:M:nopqQr::s:t:u:vwx")) != EOF) {
switch((char)ch) {
case '4':
case '6':