Hello community,
here is the log from the commit of package rsyslog for openSUSE:Factory
checked in at Thu Feb 3 01:48:49 CET 2011.
--------
--- rsyslog/rsyslog.changes 2010-12-03 18:12:41.000000000 +0100
+++ /mounts/work_src_done/STABLE/rsyslog/rsyslog.changes 2011-02-02 17:48:18.000000000 +0100
@@ -1,0 +2,23 @@
+Wed Feb 2 16:47:24 UTC 2011 - mt@suse.de
+
+- update to 5.6.3 (v5-stable) with following bugfixes (digest):
+ * action processor released mememory too early, resulting in
+ potential issue in retry cases (very unlikely).
+ * batch processing flagged invalid message as "bad" under some
+ circumstances
+ * unitialized variable could cause issues under extreme
+ conditions plus some minor nits.
+ * batches which had actions in error were not properly retried
+ in all cases
+ * imfile did duplicate messages under some circumstances
+- enabled plain tcp input, unix socket output, last message
+ parser and the libdbi module as separate package.
+- disabled systemd patch for openSUSE <= 11.3
+
+-------------------------------------------------------------------
+Thu Jan 20 14:10:59 UTC 2011 - mt@suse.de
+
+- Improved systemd socket activation support to allow multiple
+ unix sockets and activation in forking mode (bnc#656197).
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
rsyslog-5.6.2.tar.bz2
New:
----
rsyslog-5.6.3.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rsyslog.spec ++++++
--- /var/tmp/diff_new_pack.iMpksA/_old 2011-02-03 01:48:20.000000000 +0100
+++ /var/tmp/diff_new_pack.iMpksA/_new 2011-02-03 01:48:20.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package rsyslog (Version 5.6.2)
+# spec file for package rsyslog
#
-# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,11 +20,10 @@
Name: rsyslog
Summary: The enhanced syslogd for Linux and Unix
-Version: 5.6.2
+Version: 5.6.3
Release: 1
-%define upstream_version 5.6.2
-# add %define build_with_relp 1 to enable relp on < 11.3, e.g.
-# via <topadd>%define build_with_relp 1</topadd> in _link file.
+%define upstream_version 5.6.3
+%define with_dbi 0%{?suse_version} >= 1140 || 0%{?build_with_relp:1}
%define with_relp 0%{?suse_version} >= 1130 || 0%{?build_with_relp:1}
%define _sbindir /sbin
%define rsyslogdocdir %{_docdir}/%{name}
@@ -42,29 +41,33 @@
BuildRequires: dos2unix openssl-devel pcre-devel pkgconfig zlib-devel
BuildRequires: krb5-devel mysql-devel net-snmp-devel postgresql-devel
BuildRequires: libgnutls-devel
-%if %{?with_relp}
+%if 0%{?with_dbi}
+BuildRequires: libdbi-devel
+%endif
+%if 0%{?with_relp}
# RELP support
BuildRequires: librelp-devel
%endif
# UDP spoof support
-%if 0%{?suse_version} > 1130
+%if 0%{?suse_version} >= 1140
BuildRequires: libnet-devel
-#
-#BuildRequires: systemd
-#
-# unresolvable: nothing provides fsck-with-dev-lock needed by systemd
-#
+# The systemd package provides
+# /usr/share/doc/packages/systemd/sd-daemon.[ch]
+# files instead of a lib ...
+BuildRequires: systemd
%else
BuildRequires: libnet
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-#Source0: http://download.rsyslog.com/rsyslog/%{name}-%{upstream_version}.tar.gz
+#Source0: http://download.rsyslog.com/rsyslog/rsyslog-.tar.gz
Source0: %{name}-%{upstream_version}.tar.bz2
Source1: rsyslog.sysconfig
Source2: rsyslog.conf.in
Source3: rsyslog.early.conf.in
Source4: rsyslog.d.remote.conf.in
+%if 0%{?suse_version} >= 1140
Patch1: rsyslog-systemd-integration.bnc656104.diff
+%endif
%description
Rsyslog is an enhanced multi-threaded syslogd supporting, among others,
@@ -138,6 +141,22 @@
This module provides the support for logging into PostgreSQL databases.
+%if 0%{?with_dbi}
+
+%package module-dbi
+License: GPLv3+
+Group: System/Daemons
+Requires: %{name} = %{version}
+Summary: Database support via DBI
+
+%description module-dbi
+Rsyslog is an enhanced multi-threaded syslog daemon. See rsyslog
+package.
+
+This package provides a module with the support for logging into DBI
+supported databases.
+%endif
+
%package module-snmp
License: GPLv3+
Group: System/Daemons
@@ -164,7 +183,7 @@
This module provides the ability for TLS encrypted TCP logging (based
on current syslog-transport-tls internet drafts).
-%if %{?with_relp}
+%if 0%{?with_relp}
%package module-relp
License: GPLv3+
@@ -194,7 +213,11 @@
%prep
%setup -q -n %{name}-%{upstream_version}
+%if 0%{?suse_version} >= 1140
%patch1 -p1
+# install the files systemd provides rather than what we provide.
+cp -a /usr/share/doc/packages/systemd/sd-daemon.[ch] runtime/
+%endif
dos2unix doc/*.html
%build
@@ -220,18 +243,24 @@
--enable-gssapi-krb5 \
--enable-mysql \
--enable-pgsql \
+%if 0%{?with_dbi}
+ --enable-libdbi \
+%endif
+%if 0%{?with_relp}
+ --enable-relp \
+%endif
--enable-snmp \
--enable-mail \
--enable-imfile \
+ --enable-imptcp \
--enable-imtemplate \
--enable-omprog \
+ --enable-omuxsock \
--enable-omtemplate \
- --enable-diagtools \
-%if %{?with_relp}
- --enable-relp \
-%endif
--enable-omudpspoof \
--enable-omstdout \
+ --enable-pmlastmsg \
+ --enable-diagtools \
--disable-static
make %{?_smp_mflags:%{_smp_mflags}} V=1
@@ -241,12 +270,15 @@
#
rm -f %{buildroot}%{rsyslog_module_dir_nodeps}/*.la
#
-# move all modules linking libraries in /usr to /usr/%_lib
+# move all modules linking libraries in /usr to /usr/lib[64]
# the user has to specify them with full path then...
install -d -m0755 %{buildroot}%{rsyslog_module_dir_withdeps}
for mod in omgssapi.so imgssapi.so lmgssutil.so ommysql.so \
ompgsql.so omsnmp.so lmnsd_gtls.so \
-%if %{?with_relp}
+%if 0%{?with_dbi}
+ omlibdbi.so \
+%endif
+%if 0%{?with_relp}
imrelp.so omrelp.so \
%endif
; do
@@ -412,6 +444,7 @@
%{rsyslog_module_dir_nodeps}/lmnet.so
%{rsyslog_module_dir_nodeps}/lmnetstrms.so
%{rsyslog_module_dir_nodeps}/lmnsd_ptcp.so
+%{rsyslog_module_dir_nodeps}/imptcp.so
%{rsyslog_module_dir_nodeps}/lmregexp.so
%{rsyslog_module_dir_nodeps}/lmstrmsrv.so
%{rsyslog_module_dir_nodeps}/lmtcpclt.so
@@ -420,9 +453,11 @@
%{rsyslog_module_dir_nodeps}/ommail.so
%{rsyslog_module_dir_nodeps}/omprog.so
%{rsyslog_module_dir_nodeps}/omruleset.so
+%{rsyslog_module_dir_nodeps}/omstdout.so
%{rsyslog_module_dir_nodeps}/omtemplate.so
%{rsyslog_module_dir_nodeps}/omtesting.so
-%{rsyslog_module_dir_nodeps}/omstdout.so
+%{rsyslog_module_dir_nodeps}/omuxsock.so
+%{rsyslog_module_dir_nodeps}/pmlastmsg.so
%dir %{rsyslog_module_dir_withdeps}
%{_mandir}/man5/rsyslog.conf.5*
%{_mandir}/man8/rsyslogd.8*
@@ -463,6 +498,13 @@
%doc %{rsyslogdocdir}/pgsql-createDB.sql
%{rsyslog_module_dir_withdeps}/ompgsql.so
+%if 0%{?with_dbi}
+
+%files module-dbi
+%defattr(-,root,root)
+%{rsyslog_module_dir_withdeps}/omlibdbi.so
+%endif
+
%files module-snmp
%defattr(-,root,root)
%{rsyslog_module_dir_withdeps}/omsnmp.so
@@ -471,7 +513,7 @@
%defattr(-,root,root)
%{rsyslog_module_dir_withdeps}/lmnsd_gtls.so
-%if %{?with_relp}
+%if 0%{?with_relp}
%files module-relp
%defattr(-,root,root)
++++++ rsyslog-5.6.2.tar.bz2 -> rsyslog-5.6.3.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/ChangeLog new/rsyslog-5.6.3/ChangeLog
--- old/rsyslog-5.6.2/ChangeLog 2010-11-30 11:26:20.000000000 +0100
+++ new/rsyslog-5.6.3/ChangeLog 2011-01-26 12:42:53.000000000 +0100
@@ -1,4 +1,19 @@
---------------------------------------------------------------------------
+Version 5.6.3 [V5-STABLE] (rgerhards), 2011-01-26
+- bugfix: action processor released mememory too early, resulting in
+ potential issue in retry cases (but very unlikely due to another
+ bug, which I also fixed -- only after the fix this problem here
+ became actually visible).
+- bugfix: batch processing flagged invalid message as "bad" under some
+ circumstances
+- bugfix: unitialized variable could cause issues under extreme conditions
+ plus some minor nits. This was found after a clang static code analyzer
+ analysis (great tool, and special thanks to Marcin for telling me about
+ it!)
+- bugfix: batches which had actions in error were not properly retried in
+ all cases
+- bugfix: imfile did duplicate messages under some circumstances
+---------------------------------------------------------------------------
Version 5.6.2 [V5-STABLE] (rgerhards), 2010-11-30
- bugfix: compile failed on systems without epoll_create1()
Thanks to David Hill for providing a fix.
@@ -578,11 +593,38 @@
in a tight loop, effectively disabling functionality and bearing the
risk of unresponsiveness of the whole system.
Bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=194
+---------------------------------------------------------------------------
+Version 4.6.6 [v4-stable] (rgerhards), 2010-11-??
+- bugfix: imfile potentially duplicates lines
+ This can happen when 0 bytes are read from the input file, and some
+ writer appends data to the file BEFORE we check if a rollover happens.
+ The check for rollover uses the inode and size as a criterion. So far,
+ we checked for equality of sizes, which is not given in this scenario,
+ but that does not indicate a rollover. From the source code comments:
+ Note that when we check the size, we MUST NOT check for equality.
+ The reason is that the file may have been written right after we
+ did try to read (so the file size has increased). That is NOT in
+ indicator of a rollover (this is an actual bug scenario we
+ experienced). So we need to check if the new size is smaller than
+ what we already have seen!
+ Also, under some circumstances an invalid truncation was detected. This
+ code has now been removed, a file change (and thus resent) is only
+ detected if the inode number changes.
- bugfix: a couple of problems that imfile had on some platforms, namely
Ubuntu (not their fault, but occured there)
- bugfix: imfile utilizes 32 bit to track offset. Most importantly,
this problem can not experienced on Fedora 64 bit OS (which has
64 bit long's!)
+- some improvements thanks to clang's static code analyzer
+ o overall cleanup (mostly unnecessary writes and otherwise unused stuff)
+ o bugfix: fixed a very remote problem in msg.c which could occur when
+ running under extremely low memory conditions
+---------------------------------------------------------------------------
+Version 4.6.5 [v4-stable] (rgerhards), 2010-11-24
+- bugfix(important): problem in TLS handling could cause rsyslog to loop
+ in a tight loop, effectively disabling functionality and bearing the
+ risk of unresponsiveness of the whole system.
+ Bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=194
---------------------------------------------------------------------------
Version 4.6.4 [v4-stable] (rgerhards), 2010-08-05
- bugfix: zero-sized (empty) messages were processed by imtcp
@@ -1210,6 +1252,9 @@
- bugfix: memory leak in ompgsql
Thanks to Ken for providing the patch
---------------------------------------------------------------------------
+Version 3.22.4 [v3-stable] (rgerhards), 2010-??-??
+- improved some code based on clang static analyzer results
+---------------------------------------------------------------------------
Version 3.22.3 [v3-stable] (rgerhards), 2010-11-24
- bugfix(important): problem in TLS handling could cause rsyslog to loop
in a tight loop, effectively disabling functionality and bearing the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/action.c new/rsyslog-5.6.3/action.c
--- old/rsyslog-5.6.2/action.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/action.c 2011-01-26 12:34:28.000000000 +0100
@@ -655,30 +655,34 @@
/* prepare the calling parameters for doAction()
* rgerhards, 2009-05-07
*/
-static rsRetVal prepareDoActionParams(action_t *pAction, msg_t *pMsg, uchar **ppMsgs, size_t *lenMsgs)
+static rsRetVal prepareDoActionParams(action_t *pAction, batch_obj_t *pElem)
{
int i;
+ msg_t *pMsg;
DEFiRet;
ASSERT(pAction != NULL);
+ ASSERT(pElem != NULL);
+ pMsg = (msg_t*) pElem->pUsrp;
/* here we must loop to process all requested strings */
for(i = 0 ; i < pAction->iNumTpls ; ++i) {
switch(pAction->eParamPassing) {
case ACT_STRING_PASSING:
- CHKiRet(tplToString(pAction->ppTpl[i], pMsg, &(ppMsgs[i]), &lenMsgs[i]));
+ CHKiRet(tplToString(pAction->ppTpl[i], pMsg, &(pElem->staticActStrings[i]),
+ &pElem->staticLenStrings[i]));
+ pElem->staticActParams[i] = pElem->staticActStrings[i];
break;
case ACT_ARRAY_PASSING:
- CHKiRet(tplToArray(pAction->ppTpl[i], pMsg, (uchar***) &(ppMsgs[i])));
+ CHKiRet(tplToArray(pAction->ppTpl[i], pMsg, (uchar***) &(pElem->staticActParams[i])));
break;
case ACT_MSG_PASSING:
- /* we abuse the uchar* ptr, it now actually is a void*, but we can not
- * change that other than by chaning the interface, what we don't like...
- */
- ppMsgs[i] = (void*) pMsg;
- lenMsgs[i] = 0; /* init for *next* action */
+ pElem->staticActParams[i] = (void*) pMsg;
+ break;
+ default:dbgprintf("software bug/error: unknown pAction->eParamPassing %d in prepareDoActionParams\n",
+ (int) pAction->eParamPassing);
+ assert(0); /* software bug if this happens! */
break;
- default:assert(0); /* software bug if this happens! */
}
}
@@ -687,26 +691,56 @@
}
-/* cleanup doAction calling parameters
- * rgerhards, 2009-05-07
+/* free a batches ressources, but not string buffers (because they will
+ * most probably be reused). String buffers are only deleted upon final
+ * destruction of the batch.
+ * This function here must be called only when the batch is actually no
+ * longer used, also not for retrying actions or such. It invalidates
+ * buffers.
+ * rgerhards, 2010-12-17
*/
-static rsRetVal cleanupDoActionParams(action_t *pAction, uchar ***ppMsgs)
+static rsRetVal releaseBatch(action_t *pAction, batch_t *pBatch)
{
int iArr;
- int i;
+ int i, j;
+ batch_obj_t *pElem;
+ uchar ***ppMsgs;
DEFiRet;
ASSERT(pAction != NULL);
- for(i = 0 ; i < pAction->iNumTpls ; ++i) {
- if(((uchar**)ppMsgs)[i] != NULL) {
- iArr = 0;
- while((((uchar***)ppMsgs)[i][iArr]) != NULL) {
- d_free(((uchar ***)ppMsgs)[i][iArr++]);
- ((uchar ***)ppMsgs)[i][iArr++] = NULL;
+ for(i = 0 ; i < batchNumMsgs(pBatch) && !*(pBatch->pbShutdownImmediate) ; ++i) {
+ pElem = &(pBatch->pElem[i]);
+ if(pElem->bFilterOK && pElem->state != BATCH_STATE_DISC) {
+ switch(pAction->eParamPassing) {
+ case ACT_ARRAY_PASSING:
+ ppMsgs = (uchar***) pElem->staticActParams;
+ for(i = 0 ; i < pAction->iNumTpls ; ++i) {
+ if(((uchar**)ppMsgs)[i] != NULL) {
+ iArr = 0;
+ while(ppMsgs[i][iArr] != NULL) {
+ d_free(ppMsgs[i][iArr++]);
+ ppMsgs[i][iArr++] = NULL;
+ }
+ d_free(((uchar**)ppMsgs)[i]);
+ ((uchar**)ppMsgs)[i] = NULL;
+ }
+ }
+ break;
+ case ACT_STRING_PASSING:
+ case ACT_MSG_PASSING:
+ /* nothing to do in that case */
+ /* TODO ... and yet we do something ;) This is considered not
+ * really needed, but I was not bold enough to remove that while
+ * fixing the stable. It should be removed in a devel version
+ * soon (I really don't see a reason why we would need it).
+ * rgerhards, 2010-12-16
+ */
+ for(j = 0 ; j < pAction->iNumTpls ; ++j) {
+ ((uchar**)pElem->staticActParams)[j] = NULL;
+ }
+ break;
}
- d_free(((uchar**)ppMsgs)[i]);
- ((uchar**)ppMsgs)[i] = NULL;
}
}
@@ -720,7 +754,6 @@
rsRetVal
actionCallDoAction(action_t *pThis, msg_t *pMsg, void *actParams)
{
- int i;
DEFiRet;
ASSERT(pThis != NULL);
@@ -729,10 +762,7 @@
DBGPRINTF("entering actionCalldoAction(), state: %s\n", getActStateName(pThis));
pThis->bHadAutoCommit = 0;
-//d_pthread_mutex_lock(&pThis->mutActExec);
-//pthread_cleanup_push(mutexCancelCleanup, &pThis->mutActExec);
iRet = pThis->pMod->mod.om.doAction(actParams, pMsg->msgFlags, pThis->pModData);
-//pthread_cleanup_pop(1); /* unlock mutex */
switch(iRet) {
case RS_RET_OK:
actionCommitted(pThis);
@@ -761,27 +791,6 @@
iRet = getReturnCode(pThis);
finalize_it:
-
- /* we need to cleanup the batches string buffers if they have been used
- * in a non-standard way. -- rgerhards, 2010-06-15
- * Note that we may do this at the batch level, this would provide a bit
- * more concurrency (TODO).
- */
- switch(pThis->eParamPassing) {
- case ACT_STRING_PASSING:
- /* nothing to do in that case */
- break;
- case ACT_ARRAY_PASSING:
- cleanupDoActionParams(pThis, actParams); /* iRet ignored! */
- break;
- case ACT_MSG_PASSING:
- /* nothing to do in that case */
- for(i = 0 ; i < pThis->iNumTpls ; ++i) {
- ((uchar**)actParams)[i] = NULL;
- }
- break;
- }
-
RETiRet;
}
@@ -944,10 +953,12 @@
int i;
int bDone;
rsRetVal localRet;
+ int wasDoneTo;
DEFiRet;
assert(pBatch != NULL);
+ wasDoneTo = pBatch->iDoneUpTo;
bDone = 0;
do {
localRet = tryDoAction(pAction, pBatch, &nElem);
@@ -971,7 +982,7 @@
; /* do nothing, this will retry the full batch */
} else if(localRet == RS_RET_ACTION_FAILED) {
/* in this case, everything not yet committed is BAD */
- for(i = pBatch->iDoneUpTo ; i < nElem ; ++i) {
+ for(i = pBatch->iDoneUpTo ; i < wasDoneTo + nElem ; ++i) {
if( pBatch->pElem[i].state != BATCH_STATE_DISC
&& pBatch->pElem[i].state != BATCH_STATE_COMM ) {
pBatch->pElem[i].state = BATCH_STATE_BAD;
@@ -981,7 +992,7 @@
bDone = 1;
} else {
if(nElem == 1) {
- batchSetElemState(pBatch, i, BATCH_STATE_BAD);
+ batchSetElemState(pBatch, pBatch->iDoneUpTo, BATCH_STATE_BAD);
bDone = 1;
} else {
/* retry with half as much. Depth is log_2 batchsize, so recursion is not too deep */
@@ -1021,8 +1032,7 @@
pElem = &(pBatch->pElem[i]);
if(pElem->bFilterOK && pElem->state != BATCH_STATE_DISC) {
pElem->state = BATCH_STATE_RDY;
- prepareDoActionParams(pAction, (msg_t*) pElem->pUsrp,
- (uchar**) &(pElem->staticActParams), pElem->staticLenParams);
+ prepareDoActionParams(pAction, pElem);
}
}
RETiRet;
@@ -1055,6 +1065,7 @@
processBatchMain(action_t *pAction, batch_t *pBatch, int *pbShutdownImmediate)
{
int *pbShutdownImmdtSave;
+ rsRetVal localRet;
DEFiRet;
assert(pBatch != NULL);
@@ -1076,6 +1087,16 @@
pthread_cleanup_pop(1); /* unlock mutex */
+ /* even if processAction failed, we need to release the batch (else we
+ * have a memory leak). So we do this first, and then check if we need to
+ * return an error code. If so, the code from processAction has priority.
+ * rgerhards, 2010-12-17
+ */
+ localRet = releaseBatch(pAction, pBatch);
+
+ if(iRet == RS_RET_OK)
+ iRet = localRet;
+
finalize_it:
pBatch->pbShutdownImmediate = pbShutdownImmdtSave;
RETiRet;
@@ -1360,7 +1381,7 @@
int i;
int bProcessMarkMsgs = 0;
int bModifiedFilter;
- sbool FilterSave[128];
+ sbool FilterSave[1024];
sbool *pFilterSave;
DEFiRet;
@@ -1405,6 +1426,7 @@
if(bModifiedFilter) {
/* in this case, we need to restore previous state */
for(i = 0 ; i < batchNumMsgs(pBatch) ; ++i) {
+ /* note: clang static code analyzer reports a false positive below */
pBatch->pElem[i].bFilterOK = pFilterSave[i];
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/configure new/rsyslog-5.6.3/configure
--- old/rsyslog-5.6.2/configure 2010-11-30 11:27:12.000000000 +0100
+++ new/rsyslog-5.6.3/configure 2011-01-26 12:43:46.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for rsyslog 5.6.2.
+# Generated by GNU Autoconf 2.65 for rsyslog 5.6.3.
#
# Report bugs to .
#
@@ -701,8 +701,8 @@
# Identity of this package.
PACKAGE_NAME='rsyslog'
PACKAGE_TARNAME='rsyslog'
-PACKAGE_VERSION='5.6.2'
-PACKAGE_STRING='rsyslog 5.6.2'
+PACKAGE_VERSION='5.6.3'
+PACKAGE_STRING='rsyslog 5.6.3'
PACKAGE_BUGREPORT='rsyslog@lists.adiscon.com'
PACKAGE_URL=''
@@ -1579,7 +1579,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures rsyslog 5.6.2 to adapt to many kinds of systems.
+\`configure' configures rsyslog 5.6.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1649,7 +1649,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of rsyslog 5.6.2:";;
+ short | recursive ) echo "Configuration of rsyslog 5.6.3:";;
esac
cat <<\_ACEOF
@@ -1807,7 +1807,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-rsyslog configure 5.6.2
+rsyslog configure 5.6.3
generated by GNU Autoconf 2.65
Copyright (C) 2009 Free Software Foundation, Inc.
@@ -2382,7 +2382,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by rsyslog $as_me 5.6.2, which was
+It was created by rsyslog $as_me 5.6.3, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
@@ -3190,7 +3190,7 @@
# Define the identity of the package.
PACKAGE='rsyslog'
- VERSION='5.6.2'
+ VERSION='5.6.3'
cat >>confdefs.h <<_ACEOF
@@ -16602,7 +16602,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by rsyslog $as_me 5.6.2, which was
+This file was extended by rsyslog $as_me 5.6.3, which was
generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16668,7 +16668,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-rsyslog config.status 5.6.2
+rsyslog config.status 5.6.3
configured by $0, generated by GNU Autoconf 2.65,
with options \\"\$ac_cs_config\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/configure.ac new/rsyslog-5.6.3/configure.ac
--- old/rsyslog-5.6.2/configure.ac 2010-11-30 11:26:46.000000000 +0100
+++ new/rsyslog-5.6.3/configure.ac 2011-01-26 12:43:00.000000000 +0100
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([rsyslog],[5.6.2],[rsyslog@lists.adiscon.com])
+AC_INIT([rsyslog],[5.6.3],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/doc/manual.html new/rsyslog-5.6.3/doc/manual.html
--- old/rsyslog-5.6.2/doc/manual.html 2010-11-30 11:26:57.000000000 +0100
+++ new/rsyslog-5.6.3/doc/manual.html 2011-01-26 12:43:31.000000000 +0100
@@ -19,7 +19,7 @@
<p><b>Please visit the <a href="http://www.rsyslog.com/sponsors">rsyslog sponsor's page</a>
to honor the project sponsors or become one yourself!</b> We are very grateful for any help towards the
project goals.</p>
-<p><b>This documentation is for version 5.6.2 (beta branch) of rsyslog.</b>
+<p><b>This documentation is for version 5.6.3 (beta branch) of rsyslog.</b>
Visit the <i><a href="http://www.rsyslog.com/status">rsyslog status page</a></i></b>
to obtain current version information and project status.
</p><p><b>If you like rsyslog, you might
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/doc/rsyslog_conf_filter.html new/rsyslog-5.6.3/doc/rsyslog_conf_filter.html
--- old/rsyslog-5.6.2/doc/rsyslog_conf_filter.html 2010-11-25 12:39:51.000000000 +0100
+++ new/rsyslog-5.6.3/doc/rsyslog_conf_filter.html 2011-01-26 12:34:28.000000000 +0100
@@ -85,12 +85,12 @@
behavior you can exclude some priorities from the pattern.</p>
<p>Rsyslogd has a syntax extension to the original BSD source,
that makes its use more intuitively. You may precede every priority
-with an equation sign ("='') to specify only this single priority and
+with an equals sign ("='') to specify only this single priority and
not any of the above. You may also (both is valid, too) precede the
priority with an exclamation mark ("!'') to ignore all that
priorities, either exact this one or this and any higher priority. If
you use both extensions than the exclamation mark must occur before the
-equation sign, just use it intuitively.</p>
+equals sign, just use it intuitively.</p>
<h3>Property-Based Filters</h3>
<p>Property-based filters are unique to rsyslogd. They allow to
filter on any property, like HOSTNAME, syslogtag and msg. A list of all
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/plugins/imklog/ksym.c new/rsyslog-5.6.3/plugins/imklog/ksym.c
--- old/rsyslog-5.6.2/plugins/imklog/ksym.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/plugins/imklog/ksym.c 2011-01-10 12:41:13.000000000 +0100
@@ -651,8 +651,7 @@
**************************************************************************/
extern char *ExpandKadds(char *line, char *el)
{
- auto char dlm,
- *kp,
+ auto char *kp,
*sl = line,
*elp = el,
*symbol;
@@ -782,7 +781,6 @@
strcpy(el, sl);
return(el);
}
- dlm = *kp;
strncpy(num,sl+1,kp-sl-1);
num[kp-sl-1] = '\0';
value = strtoul(num, (char **) 0, 16);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/plugins/omtesting/omtesting.c new/rsyslog-5.6.3/plugins/omtesting/omtesting.c
--- old/rsyslog-5.6.2/plugins/omtesting/omtesting.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/plugins/omtesting/omtesting.c 2011-01-26 12:34:28.000000000 +0100
@@ -188,8 +188,10 @@
break;
case MD_RANDFAIL:
iRet = doRandFail();
+ break;
case MD_ALWAYS_SUSPEND:
iRet = RS_RET_SUSPENDED;
+ break;
}
if(iRet == RS_RET_OK && pData->bEchoStdout) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/runtime/batch.h new/rsyslog-5.6.3/runtime/batch.h
--- old/rsyslog-5.6.2/runtime/batch.h 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/runtime/batch.h 2011-01-10 12:41:13.000000000 +0100
@@ -53,9 +53,11 @@
*/
sbool bFilterOK; /* work area for filter processing (per action, reused!) */
sbool bPrevWasSuspended;
- void *staticActParams[CONF_OMOD_NUMSTRINGS_MAXSIZE];
+ /* following are caches to save allocs if not absolutely necessary */
+ uchar *staticActStrings[CONF_OMOD_NUMSTRINGS_MAXSIZE]; /**< for strings */
/* a cache to save malloc(), if not absolutely necessary */
- size_t staticLenParams[CONF_OMOD_NUMSTRINGS_MAXSIZE];
+ void *staticActParams[CONF_OMOD_NUMSTRINGS_MAXSIZE]; /**< for anything else */
+ size_t staticLenStrings[CONF_OMOD_NUMSTRINGS_MAXSIZE];
/* and the same for the message length (if used) */
/* end action work variables */
};
@@ -152,7 +154,10 @@
int j;
for(i = 0 ; i < pBatch->maxElem ; ++i) {
for(j = 0 ; j < CONF_OMOD_NUMSTRINGS_MAXSIZE ; ++j) {
- free(pBatch->pElem[i].staticActParams[j]);
+ /* staticActParams MUST be freed immediately (if required),
+ * so we do not need to do that!
+ */
+ free(pBatch->pElem[i].staticActStrings[j]);
}
}
free(pBatch->pElem);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/runtime/cfsysline.c new/rsyslog-5.6.3/runtime/cfsysline.c
--- old/rsyslog-5.6.2/runtime/cfsysline.c 2010-11-26 09:28:56.000000000 +0100
+++ new/rsyslog-5.6.3/runtime/cfsysline.c 2011-01-26 12:34:28.000000000 +0100
@@ -953,8 +953,6 @@
*/
void dbgPrintCfSysLineHandlers(void)
{
- DEFiRet;
-
cslCmd_t *pCmd;
cslCmdHdlr_t *pCmdHdlr;
linkedListCookie_t llCookieCmd;
@@ -963,11 +961,11 @@
dbgprintf("Sytem Line Configuration Commands:\n");
llCookieCmd = NULL;
- while((iRet = llGetNextElt(&llCmdList, &llCookieCmd, (void*)&pCmd)) == RS_RET_OK) {
+ while(llGetNextElt(&llCmdList, &llCookieCmd, (void*)&pCmd) == RS_RET_OK) {
llGetKey(llCookieCmd, (void*) &pKey); /* TODO: using the cookie is NOT clean! */
dbgprintf("\tCommand '%s':\n", pKey);
llCookieCmdHdlr = NULL;
- while((iRet = llGetNextElt(&pCmd->llCmdHdlrs, &llCookieCmdHdlr, (void*)&pCmdHdlr)) == RS_RET_OK) {
+ while(llGetNextElt(&pCmd->llCmdHdlrs, &llCookieCmdHdlr, (void*)&pCmdHdlr) == RS_RET_OK) {
dbgprintf("\t\ttype : %d\n", pCmdHdlr->eType);
dbgprintf("\t\tpData: 0x%lx\n", (unsigned long) pCmdHdlr->pData);
dbgprintf("\t\tHdlr : 0x%lx\n", (unsigned long) pCmdHdlr->cslCmdHdlr);
@@ -976,7 +974,6 @@
}
}
dbgprintf("\n");
- ENDfunc
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/runtime/conf.c new/rsyslog-5.6.3/runtime/conf.c
--- old/rsyslog-5.6.2/runtime/conf.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/runtime/conf.c 2011-01-26 12:34:28.000000000 +0100
@@ -1084,7 +1084,7 @@
DEFiRet;
modInfo_t *pMod;
omodStringRequest_t *pOMSR;
- action_t *pAction;
+ action_t *pAction = NULL;
void *pModData;
ASSERT(p != NULL);
@@ -1092,6 +1092,11 @@
/* loop through all modules and see if one picks up the line */
pMod = module.GetNxtType(NULL, eMOD_OUT);
+ /* Note: clang static analyzer reports that pMod mybe == NULL. However, this is
+ * not possible, because we have the built-in output modules which are always
+ * present. Anyhow, we guard this by an assert. -- rgerhards, 2010-12-16
+ */
+ assert(pMod != NULL);
while(pMod != NULL) {
pOMSR = NULL;
iRet = pMod->mod.om.parseSelectorAct(p, &pModData, &pOMSR);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/runtime/ctok.c new/rsyslog-5.6.3/runtime/ctok.c
--- old/rsyslog-5.6.2/runtime/ctok.c 2010-11-25 12:39:51.000000000 +0100
+++ new/rsyslog-5.6.3/runtime/ctok.c 2011-01-26 12:34:28.000000000 +0100
@@ -1,4 +1,4 @@
-/* cfgtok.c - helper class to tokenize an input stream - which surprisingly
+/* ctok.c - helper class to tokenize an input stream - which surprisingly
* currently does not work with streams but with string. But that will
* probably change over time ;) This class was originally written to support
* the expression module but may evolve when (if) the expression module is
@@ -267,7 +267,7 @@
{
DEFiRet;
uchar c;
- cstr_t *pstrVal;
+ cstr_t *pstrVal = NULL;
ISOBJ_TYPE_assert(pThis, ctok);
ASSERT(pToken != NULL);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/runtime/debug.c new/rsyslog-5.6.3/runtime/debug.c
--- old/rsyslog-5.6.2/runtime/debug.c 2010-11-30 11:25:56.000000000 +0100
+++ new/rsyslog-5.6.3/runtime/debug.c 2011-01-26 12:35:44.000000000 +0100
@@ -157,9 +157,7 @@
*/
static void dbgMutexCancelCleanupHdlr(void *pmut)
{
- int ret;
- ret = pthread_mutex_unlock((pthread_mutex_t*) pmut);
- assert(ret == 0);
+ pthread_mutex_unlock((pthread_mutex_t*) pmut);
}
@@ -438,14 +436,13 @@
static inline void dbgMutexPreLockLog(pthread_mutex_t *pmut, dbgFuncDB_t *pFuncDB, int ln)
{
dbgMutLog_t *pHolder;
- dbgMutLog_t *pLog;
char pszBuf[128];
char pszHolderThrdName[64];
char *pszHolder;
pthread_mutex_lock(&mutMutLog);
pHolder = dbgMutLogFindHolder(pmut);
- pLog = dbgMutLogAddEntry(pmut, MUTOP_LOCKWAIT, pFuncDB, ln);
+ dbgMutLogAddEntry(pmut, MUTOP_LOCKWAIT, pFuncDB, ln);
if(pHolder == NULL)
pszHolder = "[NONE]";
@@ -474,7 +471,7 @@
dbgMutLogDelEntry(pLog);
/* add "lock" entry */
- pLog = dbgMutLogAddEntry(pmut, MUTOP_LOCK, pFuncDB, lockLn);
+ dbgMutLogAddEntry(pmut, MUTOP_LOCK, pFuncDB, lockLn);
dbgFuncDBAddMutexLock(pFuncDB, pmut, lockLn);
pthread_mutex_unlock(&mutMutLog);
if(bPrintMutexAction)
@@ -486,14 +483,13 @@
static inline void dbgMutexPreTryLockLog(pthread_mutex_t *pmut, dbgFuncDB_t *pFuncDB, int ln)
{
dbgMutLog_t *pHolder;
- dbgMutLog_t *pLog;
char pszBuf[128];
char pszHolderThrdName[64];
char *pszHolder;
pthread_mutex_lock(&mutMutLog);
pHolder = dbgMutLogFindHolder(pmut);
- pLog = dbgMutLogAddEntry(pmut, MUTOP_TRYLOCK, pFuncDB, ln);
+ dbgMutLogAddEntry(pmut, MUTOP_TRYLOCK, pFuncDB, ln);
if(pHolder == NULL)
pszHolder = "[NONE]";
@@ -522,7 +518,7 @@
dbgMutLogDelEntry(pLog);
/* add "lock" entry */
- pLog = dbgMutLogAddEntry(pmut, MUTOP_LOCK, pFuncDB, lockLn);
+ dbgMutLogAddEntry(pmut, MUTOP_LOCK, pFuncDB, lockLn);
dbgFuncDBAddMutexLock(pFuncDB, pmut, lockLn);
pthread_mutex_unlock(&mutMutLog);
if(bPrintMutexAction)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/runtime/msg.c new/rsyslog-5.6.3/runtime/msg.c
--- old/rsyslog-5.6.2/runtime/msg.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/runtime/msg.c 2011-01-26 12:34:28.000000000 +0100
@@ -1546,7 +1546,7 @@
CHKiRet(cstrConstruct(&pMsg->pCSPROCID));
}
/* if we reach this point, we have the object */
- iRet = rsCStrSetSzStr(pMsg->pCSPROCID, (uchar*) pszPROCID);
+ CHKiRet(rsCStrSetSzStr(pMsg->pCSPROCID, (uchar*) pszPROCID));
CHKiRet(cstrFinalize(pMsg->pCSPROCID));
finalize_it:
@@ -2976,7 +2976,6 @@
if(pTpe->data.field.options.bCSV) {
/* we need to obtain a private copy, as we need to at least add the double quotes */
int iBufLen;
- int i;
uchar *pBStart;
uchar *pDst;
uchar *pSrc;
@@ -2991,7 +2990,6 @@
RET_OUT_OF_MEMORY;
}
pSrc = pRes;
- i = 0;
*pDst++ = '"'; /* starting quote */
while(*pSrc) {
if(*pSrc == '"')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/runtime/parser.c new/rsyslog-5.6.3/runtime/parser.c
--- old/rsyslog-5.6.2/runtime/parser.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/runtime/parser.c 2011-01-26 12:34:28.000000000 +0100
@@ -429,14 +429,12 @@
int pri;
uchar *msg;
int lenMsg;
- int iPriText;
DEFiRet;
/* pull PRI */
lenMsg = pMsg->iLenRawMsg;
msg = pMsg->pszRawMsg;
pri = DEFUPRI;
- iPriText = 0;
if(pMsg->msgFlags & NO_PRI_IN_RAW) {
/* In this case, simply do so as if the pri would be right at top */
MsgSetAfterPRIOffs(pMsg, 0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/runtime/queue.c new/rsyslog-5.6.3/runtime/queue.c
--- old/rsyslog-5.6.2/runtime/queue.c 2010-11-30 11:25:56.000000000 +0100
+++ new/rsyslog-5.6.3/runtime/queue.c 2011-01-26 12:35:44.000000000 +0100
@@ -1129,7 +1129,7 @@
* done when *no* worker is running. So time for a shutdown... -- rgerhards, 2009-05-28
*/
DBGOPRINT((obj_t*) pThis, "checking to see if main queue DA worker pool needs to be cancelled\n");
- iRetLocal = wtpCancelAll(pThis->pWtpDA); /* returns immediately if all threads already have terminated */
+ wtpCancelAll(pThis->pWtpDA); /* returns immediately if all threads already have terminated */
}
RETiRet;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/runtime/stream.c new/rsyslog-5.6.3/runtime/stream.c
--- old/rsyslog-5.6.2/runtime/stream.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/runtime/stream.c 2011-01-26 12:38:02.000000000 +0100
@@ -401,6 +401,12 @@
* If we are monitoring a file, someone may have rotated it. In this case, we
* also need to close it and reopen it under the same name.
* rgerhards, 2008-02-13
+ * The previous code also did a check for file truncation, in which case the
+ * file was considered rewritten. However, this potential border case turned
+ * out to be a big trouble spot on busy systems. It caused massive message
+ * duplication (I guess stat() can return a too-low number under some
+ * circumstances). So starting as of now, we only check the inode number and
+ * a file change is detected only if the inode changes. -- rgerhards, 2011-01-10
*/
static rsRetVal
strmHandleEOFMonitor(strm_t *pThis)
@@ -410,23 +416,18 @@
struct stat statName;
ISOBJ_TYPE_assert(pThis, strm);
- /* find inodes of both current descriptor as well as file now in file
- * system. If they are different, the file has been rotated (or
- * otherwise rewritten). We also check the size, because the inode
- * does not change if the file is truncated (this, BTW, is also a case
- * where we actually loose log lines, because we can not do anything
- * against truncation...). We do NOT rely on the time of last
- * modificaton because that may not be available under all
- * circumstances. -- rgerhards, 2008-02-13
- */
if(fstat(pThis->fd, &statOpen) == -1)
ABORT_FINALIZE(RS_RET_IO_ERROR);
if(stat((char*) pThis->pszCurrFName, &statName) == -1)
ABORT_FINALIZE(RS_RET_IO_ERROR);
- if(statOpen.st_ino == statName.st_ino && pThis->iCurrOffs == statName.st_size) {
+ DBGPRINTF("stream checking for file change on '%s', inode %u/%u",
+ pThis->pszCurrFName, (unsigned) statOpen.st_ino,
+ (unsigned) statName.st_ino);
+ if(statOpen.st_ino == statName.st_ino) {
ABORT_FINALIZE(RS_RET_EOF);
} else {
/* we had a file change! */
+ DBGPRINTF("we had a file change on '%s'\n", pThis->pszCurrFName);
CHKiRet(strmCloseFile(pThis));
CHKiRet(strmOpenFile(pThis));
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/template.c new/rsyslog-5.6.3/template.c
--- old/rsyslog-5.6.2/template.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/template.c 2011-01-26 12:34:28.000000000 +0100
@@ -86,9 +86,9 @@
DEFiRet;
struct templateEntry *pTpe;
size_t iBuf;
- unsigned short bMustBeFreed;
+ unsigned short bMustBeFreed = 0;
uchar *pVal;
- size_t iLenVal;
+ size_t iLenVal = 0;
assert(pTpl != NULL);
assert(pMsg != NULL);
@@ -1046,7 +1046,6 @@
{
struct template *pTpl, *pTplDel;
struct templateEntry *pTpe, *pTpeDel;
- rsRetVal iRetLocal;
BEGINfunc
pTpl = tplRoot;
@@ -1069,7 +1068,7 @@
case FIELD:
/* check if we have a regexp and, if so, delete it */
if(pTpeDel->data.field.has_regex != 0) {
- if((iRetLocal = objUse(regexp, LM_REGEXP_FILENAME)) == RS_RET_OK) {
+ if(objUse(regexp, LM_REGEXP_FILENAME) == RS_RET_OK) {
regexp.regfree(&(pTpeDel->data.field.re));
}
}
@@ -1095,7 +1094,6 @@
{
struct template *pTpl, *pTplDel;
struct templateEntry *pTpe, *pTpeDel;
- rsRetVal iRetLocal;
BEGINfunc
@@ -1124,7 +1122,7 @@
case FIELD:
/* check if we have a regexp and, if so, delete it */
if(pTpeDel->data.field.has_regex != 0) {
- if((iRetLocal = objUse(regexp, LM_REGEXP_FILENAME)) == RS_RET_OK) {
+ if(objUse(regexp, LM_REGEXP_FILENAME) == RS_RET_OK) {
regexp.regfree(&(pTpeDel->data.field.re));
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/threads.c new/rsyslog-5.6.3/threads.c
--- old/rsyslog-5.6.2/threads.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/threads.c 2011-01-26 12:35:44.000000000 +0100
@@ -211,7 +211,6 @@
{
DEFiRet;
thrdInfo_t *pThis;
- int i;
assert(thrdMain != NULL);
@@ -220,7 +219,7 @@
pThis->pUsrThrdMain = thrdMain;
pThis->pAfterRun = afterRun;
pThis->bNeedsCancel = bNeedsCancel;
- i = pthread_create(&pThis->thrdID, NULL, thrdStarter, pThis);
+ pthread_create(&pThis->thrdID, NULL, thrdStarter, pThis);
CHKiRet(llAppend(&llThrds, NULL, pThis));
finalize_it:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/tools/omfile.c new/rsyslog-5.6.3/tools/omfile.c
--- old/rsyslog-5.6.2/tools/omfile.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/tools/omfile.c 2011-01-26 12:34:28.000000000 +0100
@@ -404,7 +404,6 @@
}
} else {
/* file does not exist, create it (and eventually parent directories */
- fd = -1;
if(pData->bCreateDirs) {
/* We first need to create parent dirs if they are missing.
* We do not report any errors here ourselfs but let the code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/tools/omfwd.c new/rsyslog-5.6.3/tools/omfwd.c
--- old/rsyslog-5.6.2/tools/omfwd.c 2010-11-26 09:29:44.000000000 +0100
+++ new/rsyslog-5.6.3/tools/omfwd.c 2011-01-26 12:34:28.000000000 +0100
@@ -515,7 +515,6 @@
BEGINparseSelectorAct
uchar *q;
int i;
- int bErr;
rsRetVal localRet;
struct addrinfo;
TCPFRAMINGMODE tcp_framing = TCP_FRAMING_OCTET_STUFFING;
@@ -638,7 +637,6 @@
}
/* now skip to template */
- bErr = 0;
while(*p && *p != ';' && *p != '#' && !isspace((int) *p))
++p; /*JUST SKIP*/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/tools/omusrmsg.c new/rsyslog-5.6.3/tools/omusrmsg.c
--- old/rsyslog-5.6.2/tools/omusrmsg.c 2010-11-26 09:28:56.000000000 +0100
+++ new/rsyslog-5.6.3/tools/omusrmsg.c 2011-01-26 12:34:28.000000000 +0100
@@ -249,7 +249,6 @@
}
}
close(ttyf);
- ttyf = -1;
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/tools/rsyslog.conf.5 new/rsyslog-5.6.3/tools/rsyslog.conf.5
--- old/rsyslog-5.6.2/tools/rsyslog.conf.5 2010-11-25 12:39:51.000000000 +0100
+++ new/rsyslog-5.6.3/tools/rsyslog.conf.5 2011-01-10 12:41:13.000000000 +0100
@@ -200,11 +200,11 @@
priorities from the pattern.
Rsyslogd has a syntax extension to the original BSD source, that makes its use
-more intuitively. You may precede every priority with an equation sign ('=') to
+more intuitively. You may precede every priority with an equals sign ('=') to
specify only this single priority and not any of the above. You may also (both
is valid, too) precede the priority with an exclamation mark ('!') to ignore
all that priorities, either exact this one or this and any higher priority. If
-you use both extensions than the exclamation mark must occur before the equation
+you use both extensions than the exclamation mark must occur before the equals
sign, just use it intuitively.
.SH ACTIONS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsyslog-5.6.2/tools/syslogd.c new/rsyslog-5.6.3/tools/syslogd.c
--- old/rsyslog-5.6.2/tools/syslogd.c 2010-11-30 11:25:56.000000000 +0100
+++ new/rsyslog-5.6.3/tools/syslogd.c 2011-01-26 12:35:44.000000000 +0100
@@ -2590,7 +2590,7 @@
}
}
- if ((argc -= optind))
+ if(argc - optind)
usage();
DBGPRINTF("rsyslogd %s startup, compatibility mode %d, module path '%s', cwd:%s\n",
++++++ rsyslog-systemd-integration.bnc656104.diff ++++++
--- /var/tmp/diff_new_pack.iMpksA/_old 2011-02-03 01:48:21.000000000 +0100
+++ /var/tmp/diff_new_pack.iMpksA/_new 2011-02-03 01:48:21.000000000 +0100
@@ -1,9 +1,10 @@
-commit c5132c84fc1a678b5d93fcc430871c141110b82c
-Merge: c4026ec f9a4091
+commit 020e414396b9ed4d005b6b0f6fb6567fe954230c
Author: Marius Tomaschewski
-Date: Fri Dec 3 18:07:40 2010 +0100
+Date: Thu Jan 20 15:08:08 2011 +0100
- Merge branch 'v5.6.1-systemd1' into v5.6.2-systemd1
+ Improved systemd socket activation support
+
+ Support for multiple unix sockets and activation in forking mode
commit f9a409137bdcd04ebf4851a23f573c436a14e5b2
Author: Rainer Gerhards
@@ -30,15 +31,15 @@
[skipped whitespace-only changes -- mt@suse.de]
diff --git a/ChangeLog b/ChangeLog
-index ca13d48..1ea95b2 100644
+index 72e2946..8b7c7b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+- acquire /dev/log socket optionally from systemd
+ thanks to Lennart Poettering for this patch
---------------------------------------------------------------------------
- Version 5.6.2 [V5-STABLE] (rgerhards), 2010-11-30
- - bugfix: compile failed on systems without epoll_create1()
+ Version 5.6.3 [V5-STABLE] (rgerhards), 2011-01-26
+ - bugfix: action processor released mememory too early, resulting in
diff --git a/plugins/imuxsock/Makefile.am b/plugins/imuxsock/Makefile.am
index a2fe0ba..28f9f9e 100644
--- a/plugins/imuxsock/Makefile.am
@@ -53,7 +54,7 @@
-imuxsock_la_LIBADD =
+imuxsock_la_LIBADD = $(RSRT_LIBS)
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
-index 046f12f..89bb50b 100644
+index 046f12f..fc6b1e7 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -47,6 +47,7 @@
@@ -64,63 +65,70 @@
MODULE_TYPE_INPUT
-@@ -190,6 +191,40 @@ static int create_unix_socket(const char *path, int bCreatePath)
+@@ -86,6 +87,7 @@ static prop_t *funixHName[MAXFUNIX] = { NULL, }; /* host-name override - if set,
+ static int funixFlowCtl[MAXFUNIX] = { eFLOWCTL_NO_DELAY, }; /* flow control settings for this socket */
+ static int funix[MAXFUNIX] = { -1, }; /* read-only after startup */
+ static int nfunix = 1; /* number of Unix sockets open / read-only after startup */
++static int sd_fds = 0; /* number of systemd activated sockers */
+
+ /* config settings */
+ static int bOmitLocalLogging = 0;
+@@ -190,6 +192,20 @@ static int create_unix_socket(const char *path, int bCreatePath)
if (path[0] == '\0')
return -1;
-+ if (strcmp(path, _PATH_LOG) == 0) {
-+ int r;
-+
-+ /* Check whether an FD was passed in from systemd. If
-+ * so, it's the /dev/log socket, so use it. */
-+
-+ r = sd_listen_fds(0);
-+ if (r < 0) {
-+ errmsg.LogError(-r, NO_ERRCODE, "Failed to acquire systemd socket");
-+ return -1;
-+ }
-+
-+ if (r > 1) {
-+ errmsg.LogError(EINVAL, NO_ERRCODE, "Wrong number of systemd sockets passed");
-+ return -1;
-+ }
-+
-+ if (r == 1) {
-+ fd = SD_LISTEN_FDS_START;
-+ r = sd_is_socket_unix(fd, SOCK_DGRAM, -1, _PATH_LOG, 0);
-+ if (r < 0) {
-+ errmsg.LogError(-r, NO_ERRCODE, "Failed to verify systemd socket type");
-+ return -1;
-+ }
-+
-+ if (!r) {
-+ errmsg.LogError(EINVAL, NO_ERRCODE, "Passed systemd socket of wrong type");
-+ return -1;
-+ }
-+
-+ return fd;
-+ }
-+ }
++ if (sd_fds > 0) {
++ for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + sd_fds; fd++) {
++ if( sd_is_socket_unix(fd, SOCK_DGRAM, -1, path, 0) == 1) {
++ /* ok, it matches -- just use as is */
++ return fd;
++ }
++ /*
++ * otherwise it either didn't matched *this* socket and
++ * we just continue to check the next one or there were
++ * an error and we will recreate it bellow.
++ */
++ }
++ }
+
unlink(path);
memset(&sunx, 0, sizeof(sunx));
-@@ -395,8 +430,13 @@ CODESTARTafterRun
+@@ -371,6 +387,11 @@ CODESTARTwillRun
+ if(pLogSockName != NULL)
+ funixn[0] = pLogSockName;
+
++ sd_fds = sd_listen_fds(0);
++ if (sd_fds < 0) {
++ errmsg.LogError(-sd_fds, NO_ERRCODE, "Failed to acquire systemd sockets");
++ }
++
+ /* initialize and return if will run or not */
+ for (i = startIndexUxLocalSockets ; i < nfunix ; i++) {
+ if ((funix[i] = create_unix_socket((char*) funixn[i], funixCreateSockPath[i])) != -1)
+@@ -395,10 +416,19 @@ CODESTARTafterRun
if (funix[i] != -1)
close(funix[i]);
- /* Clean-up files. */
- for(i = startIndexUxLocalSockets; i < nfunix; i++)
-+ /* Clean-up files. If systemd passed us a socket it is
-+ * systemd's job to clean it up.*/
-+ if (sd_listen_fds(0) > 0)
-+ i = 1;
-+ else
-+ i = startIndexUxLocalSockets;
-+ for(; i < nfunix; i++)
- if (funixn[i] && funix[i] != -1)
+- if (funixn[i] && funix[i] != -1)
++ /* Clean-up files. If systemd passed us a socket it is
++ * systemd's job to clean it up.*/
++ for(i = startIndexUxLocalSockets; i < nfunix; i++) {
++ if (funixn[i] && funix[i] != -1) {
++ if (sd_fds > 0 &&
++ funix[i] >= SD_LISTEN_FDS_START &&
++ funix[i] < SD_LISTEN_FDS_START + sd_fds)
++ continue;
++
unlink((char*) funixn[i]);
++ }
++ }
++
/* free no longer needed string */
+ free(pLogSockName);
+ free(pLogHostName);
diff --git a/runtime/Makefile.am b/runtime/Makefile.am
index b700eae..27c56a2 100644
--- a/runtime/Makefile.am
@@ -862,7 +870,7 @@
+
+#endif
diff --git a/tools/syslogd.c b/tools/syslogd.c
-index 2e4ea5d..245ebe3 100644
+index ffcaa27..37c3848 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -135,6 +135,7 @@
@@ -873,12 +881,49 @@
/* definitions for objects we access */
DEFobjCurrIf(obj)
-@@ -2431,6 +2432,8 @@ doGlblProcessInit(void)
+@@ -2428,10 +2429,44 @@ doGlblProcessInit(void)
+ */
+ exit(1); /* "good" exit - after forking, not diasabling anything */
+ }
++
num_fds = getdtablesize();
close(0);
/* we keep stdout and stderr open in case we have to emit something */
+- for (i = 3; i < num_fds; i++)
++ i = 3;
+
-+ if (sd_listen_fds(0) <= 0)
- for (i = 3; i < num_fds; i++)
++ /* if (sd_booted()) */ {
++ const char *e;
++ char buf[24] = { '\0' };
++ char *p = NULL;
++ unsigned long l;
++ int sd_fds;
++
++ /* fork & systemd socket activation:
++ * fetch listen pid and update to ours,
++ * when it is set to pid of our parent.
++ */
++ if ( (e = getenv("LISTEN_PID"))) {
++ errno = 0;
++ l = strtoul(e, &p, 10);
++ if (errno == 0 && l > 0 && (!p || !*p)) {
++ if (getppid() == (pid_t)l) {
++ snprintf(buf, sizeof(buf), "%d",
++ getpid());
++ setenv("LISTEN_PID", buf, 1);
++ }
++ }
++ }
++
++ /*
++ * close only all further fds, except
++ * of the fds provided by systemd.
++ */
++ sd_fds = sd_listen_fds(0);
++ if (sd_fds > 0)
++ i = SD_LISTEN_FDS_START + sd_fds;
++ }
++ for ( ; i < num_fds; i++)
(void) close(i);
untty();
+ }
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org