From 074ec9495e9f07f7ff441a60f756b0d15931a8d7 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Wed, 27 Jan 2010 09:52:15 +0100
Subject: [PATCH 1/3] backporting bugfixes from 5.2.2
- bugfix: queues in direct mode could case a segfault, especially if an
action failed for action queues. The issue was an invalid increment of
a stack-based pointer which lead to destruction of the stack frame and
thus a segfault on function return.
Thanks to Michael Biebl for alerting us on this problem.
[backport from 5.5.2]
- bugfix: wrong memory assignment for a config variable (probably
without causing any harm) [backport from 5.2.2]
---
ChangeLog | 8 ++++++++
action.c | 4 ++--
tools/syslogd.c | 2 +-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c741e0698..9c54b06f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
---------------------------------------------------------------------------
Version 5.3.7 [BETA] (rgerhards), 2010-01-??
+- bugfix: queues in direct mode could case a segfault, especially if an
+ action failed for action queues. The issue was an invalid increment of
+ a stack-based pointer which lead to destruction of the stack frame and
+ thus a segfault on function return.
+ Thanks to Michael Biebl for alerting us on this problem.
+ [backport from 5.5.2]
+- bugfix: wrong memory assignment for a config variable (probably
+ without causing any harm) [backport from 5.2.2]
- bugfix: potential segfaults during queue shutdown
(bugs require certain non-standard settings to appear)
Thanks to varmojfekoj for the patch [imported from 4.5.8]
diff --git a/action.c b/action.c
index 678587427..aaf455937 100644
--- a/action.c
+++ b/action.c
@@ -924,12 +924,12 @@ submitBatch(action_t *pAction, batch_t *pBatch, int nElem, int *pbShutdownImmedi
} else if(localRet == RS_RET_ACTION_FAILED) {
/* in this case, the whole batch can not be processed */
for(i = 0 ; i < nElem ; ++i) {
- pBatch->pElem[++pBatch->iDoneUpTo].state = BATCH_STATE_BAD;
+ pBatch->pElem[pBatch->iDoneUpTo++].state = BATCH_STATE_BAD;
}
bDone = 1;
} else {
if(nElem == 1) {
- pBatch->pElem[++pBatch->iDoneUpTo].state = BATCH_STATE_BAD;
+ pBatch->pElem[pBatch->iDoneUpTo++].state = BATCH_STATE_BAD;
bDone = 1;
} else {
/* retry with half as much. Depth is log_2 batchsize, so recursion is not too deep */
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 21df6d6cd..0f7325fcf 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -280,7 +280,7 @@ static int iMainMsgQtoWrkShutdown = 60000; /* timeout for worker thread shutdo
static int iMainMsgQWrkMinMsgs = 100; /* minimum messages per worker needed to start a new one */
static int iMainMsgQDeqSlowdown = 0; /* dequeue slowdown (simple rate limiting) */
static int64 iMainMsgQueMaxDiskSpace = 0; /* max disk space allocated 0 ==> unlimited */
-static int iMainMsgQueDeqBatchSize = 32; /* dequeue batch size */
+static int64 iMainMsgQueDeqBatchSize = 32; /* dequeue batch size */
static int bMainMsgQSaveOnShutdown = 1; /* save queue on shutdown (when DA enabled)? */
static int iMainMsgQueueDeqtWinFromHr = 0; /* hour begin of time frame when queue is to be dequeued */
static int iMainMsgQueueDeqtWinToHr = 25; /* hour begin of time frame when queue is to be dequeued */
From 4ed9a09e312c9ed5017d5caa98895eb80661e455 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Wed, 27 Jan 2010 11:17:26 +0100
Subject: [PATCH 2/3] preparing for 5.3.7
---
ChangeLog | 5 +----
configure.ac | 2 +-
doc/manual.html | 2 +-
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9c54b06f8..5111e3d0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,5 @@
---------------------------------------------------------------------------
-Version 5.3.7 [BETA] (rgerhards), 2010-01-??
+Version 5.3.7 [BETA] (rgerhards), 2010-01-27
- bugfix: queues in direct mode could case a segfault, especially if an
action failed for action queues. The issue was an invalid increment of
a stack-based pointer which lead to destruction of the stack frame and
@@ -8,9 +8,6 @@ Version 5.3.7 [BETA] (rgerhards), 2010-01-??
[backport from 5.5.2]
- bugfix: wrong memory assignment for a config variable (probably
without causing any harm) [backport from 5.2.2]
-- bugfix: potential segfaults during queue shutdown
- (bugs require certain non-standard settings to appear)
- Thanks to varmojfekoj for the patch [imported from 4.5.8]
- bugfix: rsyslog hangs when writing to a named pipe which nobody was
reading. Thanks to Michael Biebl for reporting this bug.
Bugzilla entry: http://bugzilla.adiscon.com/show_bug.cgi?id=169
diff --git a/configure.ac b/configure.ac
index 5186eb262..a67f47d2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([rsyslog],[5.3.6],[rsyslog@lists.adiscon.com])
+AC_INIT([rsyslog],[5.3.7],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
diff --git a/doc/manual.html b/doc/manual.html
index e2b171d87..166590c4c 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -19,7 +19,7 @@ rsyslog support available directly from the source!
Please visit the rsyslog sponsor's page
to honor the project sponsors or become one yourself! We are very grateful for any help towards the
project goals.
-This documentation is for version 5.3.6 (beta branch) of rsyslog.
+
This documentation is for version 5.3.7 (beta branch) of rsyslog.
Visit the rsyslog status page
to obtain current version information and project status.
If you like rsyslog, you might
From 66d129c9ca24f6f3001fad9cc854c54a360df49e Mon Sep 17 00:00:00 2001
From: Cristiano
Date: Wed, 3 Feb 2010 15:42:14 +0100
Subject: [PATCH 3/3] (slightly) enhanced support for FreeBSD by setting
_PATH_MODDIR to the correct value on FreeBSD. Signed-off-by: Rainer Gerhards
---
ChangeLog | 3 +++
tools/syslogd.c | 6 +++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 35f92a294..b82772347 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
---------------------------------------------------------------------------
Version 4.5.8 [v4-beta] (rgerhards), 2010-01-??
+- (slightly) enhanced support for FreeBSD by setting _PATH_MODDIR to
+ the correct value on FreeBSD.
+ Thanks to Cristiano for the patch.
- bugfix: -d did not enable display of debug messages
regression from introduction of "debug on demand" mode
Thanks to Michael Biebl for reporting this bug
diff --git a/tools/syslogd.c b/tools/syslogd.c
index ab8f015dc..db1e9428a 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -177,7 +177,11 @@ static rsRetVal GlobalClassExit(void);
#endif
#ifndef _PATH_MODDIR
-#define _PATH_MODDIR "/lib/rsyslog/"
+# if defined(__FreeBSD__)
+# define _PATH_MODDIR "/usr/local/lib/rsyslog/"
+# else
+# define _PATH_MODDIR "/lib/rsyslog/"
+# endif
#endif
#if defined(SYSLOGD_PIDNAME)