~kroq-gar78/ubuntu/precise/rsyslog/fix-846818

« back to all changes in this revision

Viewing changes to debian/patches/100-imuxsock-allow-missing-date.patch

  • Committer: Package Import Robot
  • Author(s): Scott Moser
  • Date: 2011-12-20 11:55:11 UTC
  • Revision ID: package-import@ubuntu.com-20111220115511-10utg17z80o72mhu
Tags: 5.8.6-1ubuntu4
debian/patches/100-imuxsock-allow-missing-date.patch
fix bug in imuxsock that truncated messages if they did not
contain a date field (LP: #905419).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: Rainer Gerhards <rgerhards@adiscon.com>
 
2
Date: Tue, 20 Dec 2011 15:39:39 +0000 (+0100)
 
3
Subject: bugfix: imuxsock did truncate part of received message if it did not contain a proper... 
 
4
X-Git-Url: http://git.adiscon.com/?p=rsyslog.git;a=commitdiff_plain;h=f112b51b8d6c358b87ac608112d393adb047ea0f
 
5
 
 
6
bugfix: imuxsock did truncate part of received message if it did not contain a proper date.
 
7
 
 
8
The truncation occured because we removed that part of the messages
 
9
that was expected to be the date.
 
10
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=295
 
11
 
 
12
Origin: upstream, http://git.adiscon.com/?p=rsyslog.git;a=commitdiff_plain;h=f112b51b8d6c358b87ac608112d393adb047ea0f
 
13
Bug: http://bugzilla.adiscon.com/show_bug.cgi?id=295
 
14
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/905419
 
15
---
 
16
 
 
17
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
 
18
index 2697c48..feddb20 100644
 
19
--- a/plugins/imuxsock/imuxsock.c
 
20
+++ b/plugins/imuxsock/imuxsock.c
 
21
@@ -565,8 +565,11 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred)
 
22
        parse++; lenMsg--; /* '>' */
 
23
 
 
24
        if((pLstn->flags & IGNDATE)) {
 
25
-               parse += 16; /* just skip timestamp */
 
26
-               lenMsg -= 16;
 
27
+               /* in this case, we still need to find out if we have a valid
 
28
+                * datestamp or not .. and advance the parse pointer accordingly.
 
29
+                */
 
30
+               struct syslogTime dummy;
 
31
+               datetime.ParseTIMESTAMP3164(&dummy, &parse, &lenMsg);
 
32
        } else {
 
33
                if(datetime.ParseTIMESTAMP3164(&(pMsg->tTIMESTAMP), &parse, &lenMsg) != RS_RET_OK) {
 
34
                        DBGPRINTF("we have a problem, invalid timestamp in msg!\n");