summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-03-09 14:28:30 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-03-09 14:28:30 +0100
commitc802afb7e0fc5e2c87af24e12bf63e4a0ba7688c (patch)
tree107991afae384af32c95be306c86f387ea67083b
parent81c9cf86267fb0ec1156e578439d09499c97e80f (diff)
parentde7726cbf0957384cc9261ac47d6bf65906739b5 (diff)
downloadrsyslog-c802afb7e0fc5e2c87af24e12bf63e4a0ba7688c.tar.gz
rsyslog-c802afb7e0fc5e2c87af24e12bf63e4a0ba7688c.tar.xz
rsyslog-c802afb7e0fc5e2c87af24e12bf63e4a0ba7688c.zip
Merge branch 'v5-stable'
Conflicts: ChangeLog configure.ac doc/manual.html doc/property_replacer.html runtime/datetime.h
-rw-r--r--ChangeLog37
-rw-r--r--configure.ac19
-rw-r--r--doc/property_replacer.html3
-rw-r--r--runtime/datetime.h5
-rw-r--r--runtime/debug.c2
-rw-r--r--runtime/rsyslog.h9
-rw-r--r--tests/ourtail.c1
-rw-r--r--tests/rt-init.c1
-rw-r--r--tools/msggen.c1
-rw-r--r--tools/omfile.c16
-rw-r--r--tools/omusrmsg.c25
-rw-r--r--tools/regexp.c1
-rw-r--r--tools/syslogd.c2
-rw-r--r--tools/zpipe.c1
14 files changed, 86 insertions, 37 deletions
diff --git a/ChangeLog b/ChangeLog
index a1dbabb1..b4420a80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,7 +30,18 @@ Version 5.5.2 [DEVEL] (rgerhards), 2010-02-05
solution was available). Thanks to Kenneth Marshall for some advice.
- extended testbench
---------------------------------------------------------------------------
-Version 5.3.8 [BETA] (rgerhards), 2010-02-??
+Version 5.4.1 [v5-stable] (rgerhards), 2010-03-??
+- added new property replacer option "date-rfc3164-buggyday" primarily
+ to ease migration from syslog-ng. See property replacer doc for
+ details. [backport from 5.5.3 because urgently needed by some]
+---------------------------------------------------------------------------
+Version 5.4.0 [v5-stable] (rgerhards), 2010-03-08
+***************************************************************************
+* This is a new stable v5 version. It contains all fixes and enhancements *
+* made during the 5.3.x phase as well as those listed below. *
+* Note that the 5.2.x series was quite buggy and as such all users are *
+* strongly advised to upgrade to 5.4.0. *
+***************************************************************************
- bugfix: omruleset failed to work in many cases
bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=179
Thanks to Ryan B. Lynch for reporting this issue.
@@ -411,13 +422,35 @@ Version 4.7.0 [v4-devel] (rgerhards), 2009-09-??
Thanks for varmojfekoj for pointing me at this bug.
- imported changes from 4.5.6 and below
---------------------------------------------------------------------------
-Version 4.6.1 [v4-stable] (rgerhards), 2010-02-??
+Version 4.6.2 [v4-stable] (rgerhards), 2010-03-??
+- added new property replacer option "date-rfc3164-buggyday" primarily
+ to ease migration from syslog-ng. See property replacer doc for
+ details. [backport from 5.5.3 because urgently needed by some]
+---------------------------------------------------------------------------
+Version 4.6.1 [v4-stable] (rgerhards), 2010-03-04
- re-enabled old pipe output (using new module ompipe, built-in) after
some problems with pipes (and especially in regard to xconsole) were
discovered. Thanks to Michael Biebl for reporting the issues.
+- bugfix: potential problems with large file support could cause segfault
+ ... and other weird problems. This seemed to affect 32bit-platforms
+ only, but I can not totally outrule there were issues on other
+ platforms as well. The previous code could cause system data types
+ to be defined inconsistently, and that could lead to various
+ troubles. Special thanks go to the Mandriva team for identifying
+ an initial problem, help discussing it and ultimately a fix they
+ contributed.
- bugfix: fixed problem that caused compilation on FreeBSD 9.0 to fail.
bugtracker: http://bugzilla.adiscon.com/show_bug.cgi?id=181
Thanks to Christiano for reporting.
+- bugfix: potential segfault in omfile when a dynafile open failed
+ In that case, a partial cache entry was written, and some internal
+ pointers (iCurrElt) not correctly updated. In the next iteration, that
+ could lead to a segfault, especially if iCurrElt then points to the
+ then-partial record. Not very likely, but could happen in practice.
+- bugfix (theoretical): potential segfault in omfile under low memory
+ condition. This is only a theoretical bug, because it would only
+ happen when strdup() fails to allocate memory - which is highly
+ unlikely and will probably lead to all other sorts of errors.
- bugfix: comment char ('#') in literal terminated script parsing
and thus could not be used.
but tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=119
diff --git a/configure.ac b/configure.ac
index 24e96965..c59895d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,19 +156,12 @@ AC_SUBST(moddirs)
# Large file support
-AC_ARG_ENABLE(largefile,
- [AS_HELP_STRING([--enable-largefile],[Enable large file support @<:@default=yes@:>@])],
- [case "${enableval}" in
- yes) enable_largefile="yes" ;;
- no) enable_largefile="no" ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-largefile) ;;
- esac],
- [enable_largefile="yes"]
-)
-if test "$enable_largefile" = "no"; then
- AC_DEFINE(NOLARGEFILE, 1, [Defined when large file support is disabled.])
-fi
-
+# http://www.gnu.org/software/autoconf/manual/html_node/System-Services.html#index-AC_005fSYS_005fLARGEFILE-1028
+AC_SYS_LARGEFILE
+case "${enable_largefile}" in
+ no) ;;
+ *) enable_largefile="yes" ;;
+esac
# Regular expressions
AC_ARG_ENABLE(regexp,
diff --git a/doc/property_replacer.html b/doc/property_replacer.html
index 390fc0d0..4d242a34 100644
--- a/doc/property_replacer.html
+++ b/doc/property_replacer.html
@@ -344,7 +344,8 @@ date-rfc3164-buggyday option can be used in migration scenarios where otherwise
lots of scripts would need to be adjusted. It is recommended <i>not</i> to use this
option when forwarding to remote hosts - they may treat the date as invalid
(especially when parsing strictly according to RFC 3164).</td>
-<br><i>This feature was introduced in rsyslog 5.5.3.</i>
+<br><i>This feature was introduced in rsyslog 4.6.2 and v4 versions above and
+5.5.3 and all versions above.</i>
</tr>
<tr>
<td><b>date-rfc3339</b></td>
diff --git a/runtime/datetime.h b/runtime/datetime.h
index 647f3096..82bd415b 100644
--- a/runtime/datetime.h
+++ b/runtime/datetime.h
@@ -44,12 +44,15 @@ BEGINinterface(datetime) /* name must also be changed in ENDinterface macro! */
/* v3, 2009-11-12 */
time_t (*GetTime)(time_t *ttSeconds);
ENDinterface(datetime)
-#define datetimeCURR_IF_VERSION 4 /* increment whenever you change the interface structure! */
+#define datetimeCURR_IF_VERSION 5 /* 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
+ * 3 - taken by v5 branch!
+ * 4 - formatTimestamp3164 takes a third int parameter
+ * 5 - merge of versions 3 + 4 (2010-03-09)
*/
/* prototypes */
diff --git a/runtime/debug.c b/runtime/debug.c
index 6d82397f..38857122 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -1,4 +1,3 @@
-#include <sys/syscall.h>
/* debug.c
*
* This file proides debug and run time error analysis support. Some of the
@@ -553,6 +552,7 @@ if(pLog == NULL) {
return; /* if we don't know it yet, we can not clean up... */
}
#endif
+#include <sys/syscall.h>
/* we found the last lock entry. We now need to see from which FuncDB we need to
* remove it. This is recorded inside the mutex log entry.
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index a75d2bc0..4cb20163 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -57,15 +57,6 @@
* # End Config Settings # *
* ############################################################# */
-#ifndef NOLARGEFILE
-# undef _LARGEFILE_SOURCE
-# undef _LARGEFILE64_SOURCE
-# undef _FILE_OFFSET_BITS
-# define _LARGEFILE_SOURCE
-# define _LARGEFILE64_SOURCE
-# define _FILE_OFFSET_BITS 64
-#endif
-
/* portability: not all platforms have these defines, so we
* define them here if they are missing. -- rgerhards, 2008-03-04
*/
diff --git a/tests/ourtail.c b/tests/ourtail.c
index 4e8a6412..c31babb9 100644
--- a/tests/ourtail.c
+++ b/tests/ourtail.c
@@ -26,6 +26,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this distribution.
*/
+#include "config.h"
#include <stdio.h>
int main(int __attribute__((unused)) argc, char __attribute__((unused)) *argv[])
diff --git a/tests/rt-init.c b/tests/rt-init.c
index b9c4ce2e..66a9ad32 100644
--- a/tests/rt-init.c
+++ b/tests/rt-init.c
@@ -21,6 +21,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this distribution.
*/
+#include "config.h"
#include "rsyslog.h"
#include "testbench.h"
#include <stdio.h> /* must be last, else we get a zlib compile error on some platforms */
diff --git a/tools/msggen.c b/tools/msggen.c
index 06244c18..29ade3a7 100644
--- a/tools/msggen.c
+++ b/tools/msggen.c
@@ -21,6 +21,7 @@
* A copy of the GPL can be found in the file "COPYING" in this distribution.
*/
+#include "config.h"
#include <stdio.h>
#include <syslog.h>
diff --git a/tools/omfile.c b/tools/omfile.c
index 1f203852..9562e9cf 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -364,6 +364,7 @@ dynaFileFreeCacheEntries(instanceData *pData)
for(i = 0 ; i < pData->iCurrCacheSize ; ++i) {
dynaFileDelCacheEntry(pData->dynCache, i, 1);
}
+ pData->iCurrElt = -1; /* invalidate current element */
ENDfunc;
}
@@ -547,6 +548,14 @@ prepareDynFile(instanceData *pData, uchar *newFileName, unsigned iMsgOpts)
}
/* we have not found an entry */
+
+ /* invalidate iCurrElt as we may error-exit out of this function when the currrent
+ * iCurrElt has been freed or otherwise become unusable. This is a precaution, and
+ * performance-wise it may be better to do that in each of the exits. However, that
+ * is error-prone, so I prefer to do it here. -- rgerhards, 2010-03-02
+ */
+ pData->iCurrElt = -1;
+
if(iFirstFree == -1 && (pData->iCurrCacheSize < pData->iDynaFileCacheSize)) {
/* there is space left, so set it to that index */
iFirstFree = pData->iCurrCacheSize++;
@@ -578,7 +587,11 @@ prepareDynFile(instanceData *pData, uchar *newFileName, unsigned iMsgOpts)
ABORT_FINALIZE(localRet);
}
- CHKmalloc(pCache[iFirstFree]->pName = ustrdup(newFileName));
+ if((pCache[iFirstFree]->pName = ustrdup(newFileName)) == NULL) {
+ /* we need to discard the entry, otherwise things could lead to a segfault! */
+ dynaFileDelCacheEntry(pCache, iFirstFree, 1);
+ ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
+ }
pCache[iFirstFree]->pStrm = pData->pStrm;
pCache[iFirstFree]->clkTickAccessed = getClockFileAccess();
pData->iCurrElt = iFirstFree;
@@ -831,7 +844,6 @@ BEGINdoHUP
CODESTARTdoHUP
if(pData->bDynamicName) {
dynaFileFreeCacheEntries(pData);
- pData->iCurrElt = -1; /* invalidate current element */
} else {
if(pData->pStrm != NULL) {
strm.Destruct(&pData->pStrm);
diff --git a/tools/omusrmsg.c b/tools/omusrmsg.c
index a89297d7..e788a006 100644
--- a/tools/omusrmsg.c
+++ b/tools/omusrmsg.c
@@ -52,8 +52,12 @@
#include <sys/param.h>
#ifdef HAVE_UTMP_H
# include <utmp.h>
+# define STRUCTUTMP struct utmp
+# define UTNAME ut_name
#else
# include <utmpx.h>
+# define STRUCTUTMP struct utmpx
+# define UTNAME ut_user
#endif
#include <unistd.h>
#include <sys/uio.h>
@@ -128,6 +132,12 @@ ENDdbgPrintInstInfo
* need! rgerhards 2005-03-18
*/
#ifdef OS_BSD
+/* Since version 900007, FreeBSD has a POSIX compliant <utmpx.h> */
+#if defined(__FreeBSD__) && (__FreeBSD_version >= 900007)
+# define setutent(void) setutxent(void)
+# define getutent(void) getutxent(void)
+# define endutent(void) endutxent(void)
+#else
static FILE *BSD_uf = NULL;
void setutent(void)
{
@@ -138,9 +148,9 @@ void setutent(void)
}
}
-struct utmp* getutent(void)
+STRUCTUTMP* getutent(void)
{
- static struct utmp st_utmp;
+ static STRUCTUTMP st_utmp;
if(fread((char *)&st_utmp, sizeof(st_utmp), 1, BSD_uf) != 1)
return NULL;
@@ -153,6 +163,7 @@ void endutent(void)
fclose(BSD_uf);
BSD_uf = NULL;
}
+#endif /* if defined(__FreeBSD__) */
#endif /* #ifdef OS_BSD */
@@ -177,8 +188,8 @@ static rsRetVal wallmsg(uchar* pMsg, instanceData *pData)
int errnoSave;
int ttyf;
int wrRet;
- struct utmp ut;
- struct utmp *uptr;
+ STRUCTUTMP ut;
+ STRUCTUTMP *uptr;
struct stat statb;
DEFiRet;
@@ -191,13 +202,13 @@ static rsRetVal wallmsg(uchar* pMsg, instanceData *pData)
while((uptr = getutent())) {
memcpy(&ut, uptr, sizeof(ut));
/* is this slot used? */
- if(ut.ut_name[0] == '\0')
+ if(ut.UTNAME[0] == '\0')
continue;
#ifndef OS_BSD
if(ut.ut_type != USER_PROCESS)
continue;
#endif
- if(!(strncmp (ut.ut_name,"LOGIN", 6))) /* paranoia */
+ if(!(strncmp (ut.UTNAME,"LOGIN", 6))) /* paranoia */
continue;
/* should we send the message to this user? */
@@ -207,7 +218,7 @@ static rsRetVal wallmsg(uchar* pMsg, instanceData *pData)
i = MAXUNAMES;
break;
}
- if(strncmp(pData->uname[i], ut.ut_name, UNAMESZ) == 0)
+ if(strncmp(pData->uname[i], ut.UTNAME, UNAMESZ) == 0)
break;
}
if(i == MAXUNAMES) /* user not found? */
diff --git a/tools/regexp.c b/tools/regexp.c
index c8e4c681..e8bba4f4 100644
--- a/tools/regexp.c
+++ b/tools/regexp.c
@@ -26,6 +26,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this distribution.
*/
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 1ba3ef2b..912031a8 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -2068,7 +2068,7 @@ static void printVersion(void)
#else
printf("\tFEATURE_REGEXP:\t\t\t\tNo\n");
#endif
-#ifndef NOLARGEFILE
+#if defined(_LARGE_FILES) || (defined (_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS >= 64)
printf("\tFEATURE_LARGEFILE:\t\t\tYes\n");
#else
printf("\tFEATURE_LARGEFILE:\t\t\tNo\n");
diff --git a/tools/zpipe.c b/tools/zpipe.c
index bde6c5c1..d2278359 100644
--- a/tools/zpipe.c
+++ b/tools/zpipe.c
@@ -22,6 +22,7 @@
files created by rsyslog's zip output writer.
*/
+#include "config.h"
#include <stdio.h>
#include <string.h>
#include <assert.h>