diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-09-12 15:17:47 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-09-12 15:17:47 +0200 |
commit | 1e819a8afe9494cc760196ac91f3b617bc073de9 (patch) | |
tree | c0701f10aecefb3a60af67c310b33b3d2bedeb0a | |
parent | 262f61d869b95f63b393ae48d683b13e70322478 (diff) | |
parent | 4e86efaf0e20626d8f740fcff131bfd38453de4d (diff) | |
download | rsyslog-1e819a8afe9494cc760196ac91f3b617bc073de9.tar.gz rsyslog-1e819a8afe9494cc760196ac91f3b617bc073de9.tar.xz rsyslog-1e819a8afe9494cc760196ac91f3b617bc073de9.zip |
Merge branch 'beta'
Conflicts:
runtime/rsyslog.h
tools/syslogd.c
-rw-r--r-- | ChangeLog | 23 | ||||
-rw-r--r-- | action.c | 2 | ||||
-rw-r--r-- | runtime/datetime.c | 17 | ||||
-rw-r--r-- | runtime/datetime.h | 8 | ||||
-rw-r--r-- | runtime/rsyslog.h | 4 | ||||
-rw-r--r-- | tools/syslogd.c | 15 |
6 files changed, 57 insertions, 12 deletions
@@ -266,6 +266,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 @@ -889,6 +904,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 @@ -107,7 +107,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 f75a5663..a1d1d9fc 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -171,7 +171,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 */ @@ -221,7 +220,6 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth RS_RET_MAIL_NO_FROM = -2072, /**< sender for mail destination is missing */ RS_RET_INVALID_PRI = -2073, /**< PRI value is invalid */ RS_RET_MALICIOUS_HNAME = -2074, /**< remote peer is trying malicious things with its hostname */ - RS_RET_ACCEPT_ERR = -2074, /**< error during accept() system call */ RS_RET_INVALID_HNAME = -2075, /**< remote peer's hostname invalid or unobtainable */ RS_RET_INVALID_PORT = -2076, /**< invalid port value */ RS_RET_COULD_NOT_BIND = -2077, /**< could not bind socket, defunct */ @@ -251,6 +249,8 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth RS_RET_CERTLESS = -2102, /**< state: we run without machine cert (this may be OK) */ RS_RET_NO_ACTIONS = -2103, /**< no active actions are configured (no output will be created) */ RS_RET_CONF_FILE_NOT_FOUND = -2104, /**< config file or directory not found */ + RS_RET_QUEUE_FULL = -2105, /**< queue is full, operation could not be completed */ + RS_RET_ACCEPT_ERR = -2106, /**< error during accept() system call */ /* 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 96fbee05..0f3e7dea 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -346,7 +346,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; @@ -1415,13 +1415,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 { |