summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-09-07 15:11:20 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-09-07 15:11:20 +0200
commitd023d12bf9d3afa1957ad6bcb2c6e24dee2c22e9 (patch)
treee1890ae493a2bce4bce01bb881ad8e000dde1925
parentfb7fab511e0de2566c0de47468b443ef5bb508d3 (diff)
downloadrsyslog-d023d12bf9d3afa1957ad6bcb2c6e24dee2c22e9.tar.gz
rsyslog-d023d12bf9d3afa1957ad6bcb2c6e24dee2c22e9.tar.xz
rsyslog-d023d12bf9d3afa1957ad6bcb2c6e24dee2c22e9.zip
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
-rw-r--r--ChangeLog3
-rw-r--r--plugins/imuxsock/imuxsock.c15
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ca49eb11..cba61744 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
---------------------------------------------------------------------------
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: rsyslogd -v always said 64 atomics were not present
thanks to mono_matsuko for the patch
---------------------------------------------------------------------------
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index af034b9f..2697c48a 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -6,7 +6,7 @@
*
* File begun on 2007-12-20 by RGerhards (extracted from syslogd.c)
*
- * Copyright 2007-2010 Rainer Gerhards and Adiscon GmbH.
+ * Copyright 2007-2011 Rainer Gerhards and Adiscon GmbH.
*
* This file is part of rsyslog.
*
@@ -355,7 +355,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;
@@ -564,14 +564,19 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred)
parse++; lenMsg--; /* '>' */
- 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");
+ }
}
/* 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;
}