From 3e3b746380c610fff39e16d0a73d4a4f3564af91 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 28 Jan 2013 15:36:04 +0100 Subject: doc: add link for set statement --- doc/rsyslog_conf_basic_structure.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/rsyslog_conf_basic_structure.html b/doc/rsyslog_conf_basic_structure.html index fad1b110..412540e3 100644 --- a/doc/rsyslog_conf_basic_structure.html +++ b/doc/rsyslog_conf_basic_structure.html @@ -49,7 +49,8 @@ after the stop statement are never evaluated.

Data Manipulation Statements

-- cgit v1.2.3 From 1deef18daa1b39035e42c8b1db68286727d8f950 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 29 Jan 2013 15:21:26 +0100 Subject: doc: give quick example of ruleset() {} use --- doc/rsyslog_conf_basic_structure.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/rsyslog_conf_basic_structure.html b/doc/rsyslog_conf_basic_structure.html index 412540e3..00a700d4 100644 --- a/doc/rsyslog_conf_basic_structure.html +++ b/doc/rsyslog_conf_basic_structure.html @@ -81,6 +81,14 @@ a message comes in via that input, the "program" (ruleset) bound to it will be e (but not any other!).

There is detail documentation available for rsyslog rulesets. +

For quick reference, rulesets are defined as follows: +

+ruleset(name="rulesetname") {
+	action(type="omfile" file="/path/to/file")
+	action(type="..." ...)
+	/* and so on... */
+}
+

[manual index] [rsyslog.conf] -- cgit v1.2.3 From c6f2dea2152935d7ce7f1147979c096fbfa9cfa8 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 26 Feb 2013 09:21:21 +0100 Subject: add support for writing to the Linux Journal (omjournal) --- ChangeLog | 1 + Makefile.am | 4 + configure.ac | 17 ++++ doc/Makefile.am | 1 + doc/omfile.html | 2 +- doc/omjournal.html | 83 ++++++++++++++++++++ doc/rsyslog_conf_modules.html | 3 +- plugins/omjournal/Makefile.am | 8 ++ plugins/omjournal/omjournal.c | 177 ++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 294 insertions(+), 2 deletions(-) create mode 100644 doc/omjournal.html create mode 100644 plugins/omjournal/Makefile.am create mode 100644 plugins/omjournal/omjournal.c diff --git a/ChangeLog b/ChangeLog index 4944987c..67d02d60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ --------------------------------------------------------------------------- Version 7.3.7 [devel] 2013-02-?? +- add support for writing to the Linux Journal (omjournal) - field() function now supports a string as field delimiter - bugfix: mmjsonparse segfault if new-style config was used - bugfix: script == comparison did not work properly on JSON objects diff --git a/Makefile.am b/Makefile.am index c4499406..1c044074 100644 --- a/Makefile.am +++ b/Makefile.am @@ -177,6 +177,10 @@ if ENABLE_OMHDFS SUBDIRS += plugins/omhdfs endif +if ENABLE_OMJOURNAL +SUBDIRS += plugins/omjournal +endif + if ENABLE_ELASTICSEARCH SUBDIRS += plugins/omelasticsearch endif diff --git a/configure.ac b/configure.ac index e9fce3f7..0d5dc11e 100644 --- a/configure.ac +++ b/configure.ac @@ -1057,6 +1057,21 @@ AC_ARG_ENABLE(omstdout, ) AM_CONDITIONAL(ENABLE_OMSTDOUT, test x$enable_omstdout = xyes) +# settings for omjournal +AC_ARG_ENABLE(omjournal, + [AS_HELP_STRING([--enable-omjournal],[Compiles omjournal @<:@default=no@:>@])], + [case "${enableval}" in + yes) enable_omjournal="yes" ;; + no) enable_omjournal="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-omjournal) ;; + esac], + [enable_omjournal=no] +) +if test "x$enable_omjournal" = "xyes"; then + PKG_CHECK_MODULES([LIBSYSTEMD_JOURNAL], [libsystemd-journal >= 197]) +fi +AM_CONDITIONAL(ENABLE_OMJOURNAL, test x$enable_omjournal = xyes) + # settings for pmlastmsg AC_ARG_ENABLE(pmlastmsg, @@ -1298,6 +1313,7 @@ AC_CONFIG_FILES([Makefile \ plugins/omhdfs/Makefile \ plugins/omprog/Makefile \ plugins/omstdout/Makefile \ + plugins/omjournal/Makefile \ plugins/pmrfc3164sd/Makefile \ plugins/pmlastmsg/Makefile \ plugins/pmcisconames/Makefile \ @@ -1364,6 +1380,7 @@ echo "---{ output plugins }---" echo " Mail support enabled: $enable_mail" echo " omprog module will be compiled: $enable_omprog" echo " omstdout module will be compiled: $enable_omstdout" +echo " omjournal module will be compiled: $enable_omjournal" echo " omhdfs module will be compiled: $enable_omhdfs" echo " omelasticsearch module will be compiled: $enable_elasticsearch" echo " omruleset module will be compiled: $enable_omruleset" diff --git a/doc/Makefile.am b/doc/Makefile.am index 6501cf6c..b907c5bf 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -34,6 +34,7 @@ html_files = \ ompipe.html \ omfwd.html \ omfile.html \ + omjournal.html \ omusrmsg.html \ omstdout.html \ omudpspoof.html \ diff --git a/doc/omfile.html b/doc/omfile.html index 75ac5f49..2c5ab97a 100644 --- a/doc/omfile.html +++ b/doc/omfile.html @@ -90,7 +90,7 @@

Caveats/Known Bugs:

Sample:

The following command writes all syslog messages into a file.

- +

Note that this can be your sole rsyslog.conf if you do not use rsyslog +for anything else than receving the router syslog messages. +

If you do not receive messages, you probably need to enable inbound UDP +syslog traffic in your firewall. + + +

[rsyslog.conf overview] [manual +index] [rsyslog site]

+

This documentation is part of the +rsyslog project.
+Copyright © 2008-2013 by Rainer Gerhards and +Adiscon. Released under the GNU GPL +version 3 or higher.

+ + diff --git a/doc/rsyslog_conf_modules.html b/doc/rsyslog_conf_modules.html index cb31bd9a..4a688352 100644 --- a/doc/rsyslog_conf_modules.html +++ b/doc/rsyslog_conf_modules.html @@ -53,6 +53,7 @@ and messages be transmitted to various different targets. Caveats/Known Bugs:
@@ -295,7 +310,7 @@ $SystemLogSocketAnnotate on

This documentation is part of the rsyslog project.
-Copyright © 2008-2012 by Rainer +Copyright © 2008-2013 by Rainer Gerhards and Adiscon. Released under the GNU GPL version 3 or higher.

diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index a5360bee..773cb8db 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -233,6 +233,7 @@ static struct cnfparamdescr modpdescr[] = { { "syssock.flowcontrol", eCmdHdlrBinary, 0 }, { "syssock.usesystimestamp", eCmdHdlrBinary, 0 }, { "syssock.annotate", eCmdHdlrBinary, 0 }, + { "syssock.parsetrusted", eCmdHdlrBinary, 0 }, { "syssock.usepidfromsystem", eCmdHdlrBinary, 0 }, { "syssock.ratelimit.interval", eCmdHdlrInt, 0 }, { "syssock.ratelimit.burst", eCmdHdlrInt, 0 }, @@ -1145,6 +1146,8 @@ CODESTARTsetModCnf loadModConf->bUseSysTimeStamp = (int) pvals[i].val.d.n; } else if(!strcmp(modpblk.descr[i].name, "syssock.annotate")) { loadModConf->bAnnotateSysSock = (int) pvals[i].val.d.n; + } else if(!strcmp(modpblk.descr[i].name, "syssock.parsetrusted")) { + loadModConf->bParseTrusted = (int) pvals[i].val.d.n; } else if(!strcmp(modpblk.descr[i].name, "syssock.usepidfromsystem")) { loadModConf->bWritePidSysSock = (int) pvals[i].val.d.n; } else if(!strcmp(modpblk.descr[i].name, "syssock.ratelimit.interval")) { -- cgit v1.2.3 From 6345e959d96bd9a3cbeeaea7f99572c33bea3054 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Mar 2013 08:19:14 +0100 Subject: bugfix: imuxsock was missing SysSock.ParseTrusted module parameter To use that functionality, legacy rsyslog.conf syntax had to be used. Also, the doc was missing information on the "ParseTrusted" set of config directives. --- ChangeLog | 4 ++++ doc/imuxsock.html | 27 +++++++++++++++++++++------ plugins/imuxsock/imuxsock.c | 3 +++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb546122..c41a89c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ ---------------------------------------------------------------------------- Version 7.2.7 [v7-stable] 2013-03-?? +- bugfix: imuxsock was missing SysSock.ParseTrusted module parameter + To use that functionality, legacy rsyslog.conf syntax had to be used. + Also, the doc was missing information on the "ParseTrusted" set of + config directives. - doc bugfix: rsyslog.conf man page had invalid file format info closes: http://bugzilla.adiscon.com/show_bug.cgi?id=418 ---------------------------------------------------------------------------- diff --git a/doc/imuxsock.html b/doc/imuxsock.html index a962f814..d505604a 100644 --- a/doc/imuxsock.html +++ b/doc/imuxsock.html @@ -92,6 +92,10 @@ messages that shall be rate-limited.
  • SysSock.Annotate <on/off> turn on annotation/trusted properties for the system log socket.
  • +
  • SysSock.ParseTrusted <on/off> if Annotation is turned on, create +JSON/lumberjack properties out of the trusted properties (which can be accessed +via RainerScript JSON Variables, e.g. "$!pid") instead of adding them to the message. +properties for the system log socket.
  • Input Instance Parameters

    @@ -148,6 +152,8 @@ will only affect the next one and then automatically be reset. This functionalit that the local hostname can be overridden in cases where that is desired.
  • Annotate <on/off> turn on annotation/trusted properties for the non-system log socket in question.
  • +
  • ParseTrusted <on/off> equivalent to the SysSock.ParseTrusted module +parameter, but applies to the input that is being defined. Caveats/Known Bugs:
    @@ -160,12 +166,20 @@ change the array size in imuxsock.c.

    The following sample is the minimum setup required to accept syslog messages from applications running on the local system.

    - + +

    The following sample is similiar to the first one, but enables trusted +properties, which are put into JSON/lumberjack variables. +
    +

    + +

    The following sample is a configuration where rsyslogd pulls logs from two jails, and assigns different hostnames to each of the jails:

    -

    The following sample is used to turn off input rate limiting on the system log socket. -

    The following sample is used activate message annotation and thus trusted properties on the system log socket. - @@ -231,6 +245,7 @@ equivalent to: SysSock.IgnoreTimestamp.

  • $InputUnixListenSocketHostName <hostname> equivalent to: HostName.
  • $InputUnixListenSocketAnnotate <on/off> equivalent to: Annotate.
  • $SystemLogSocketAnnotate <on/off> equivalent to: SysSock.Annotate.
  • +
  • $SystemLogSocketParseTrusted <on/off> equivalent to: SysSock.ParseTrusted.
  • Caveats/Known Bugs:
    @@ -283,7 +298,7 @@ $SystemLogSocketAnnotate on

    This documentation is part of the rsyslog project.
    -Copyright © 2008-2012 by Rainer +Copyright © 2008-2013 by Rainer Gerhards and Adiscon. Released under the GNU GPL version 3 or higher.

    diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 871a1fa5..637cb133 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -236,6 +236,7 @@ static struct cnfparamdescr modpdescr[] = { { "syssock.flowcontrol", eCmdHdlrBinary, 0 }, { "syssock.usesystimestamp", eCmdHdlrBinary, 0 }, { "syssock.annotate", eCmdHdlrBinary, 0 }, + { "syssock.parsetrusted", eCmdHdlrBinary, 0 }, { "syssock.usepidfromsystem", eCmdHdlrBinary, 0 }, { "syssock.ratelimit.interval", eCmdHdlrInt, 0 }, { "syssock.ratelimit.burst", eCmdHdlrInt, 0 }, @@ -1204,6 +1205,8 @@ CODESTARTsetModCnf loadModConf->bUseSysTimeStamp = (int) pvals[i].val.d.n; } else if(!strcmp(modpblk.descr[i].name, "syssock.annotate")) { loadModConf->bAnnotateSysSock = (int) pvals[i].val.d.n; + } else if(!strcmp(modpblk.descr[i].name, "syssock.parsetrusted")) { + loadModConf->bParseTrusted = (int) pvals[i].val.d.n; } else if(!strcmp(modpblk.descr[i].name, "syssock.usepidfromsystem")) { loadModConf->bWritePidSysSock = (int) pvals[i].val.d.n; } else if(!strcmp(modpblk.descr[i].name, "syssock.ratelimit.interval")) { -- cgit v1.2.3 From 3f4facd593e03d8fcabba04910dfbde46035a445 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Mar 2013 08:41:36 +0100 Subject: doc: typo fix --- doc/imuxsock.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/imuxsock.html b/doc/imuxsock.html index d7a52268..68bbe4b2 100644 --- a/doc/imuxsock.html +++ b/doc/imuxsock.html @@ -101,7 +101,7 @@ properties for the system log socket.
  • SysSock.ParseTrusted <on/off> if Annotation is turned on, create JSON/lumberjack properties out of the trusted properties (which can be accessed via RainerScript JSON Variables, e.g. "$!pid") instead of adding them to the message. -properties for the system log socket.
  • +

    Input Instance Parameters

    -- cgit v1.2.3 From ebda75e574dcb077c0da3ffd8cc4cc6b96c69ed3 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Mar 2013 12:16:57 +0100 Subject: imrelp: now supports listening to IPv4/v6 only instead of always both build now requires librelp 1.0.2 closes: http://bugzilla.adiscon.com/show_bug.cgi?id=378 --- ChangeLog | 3 +++ configure.ac | 2 +- doc/imrelp.html | 2 +- plugins/imrelp/imrelp.c | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29192537..29cd533c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ --------------------------------------------------------------------------- Version 7.3.8 [devel] 2013-03-?? +- imrelp: now supports listening to IPv4/v6 only instead of always both + build now requires librelp 1.0.2 + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=378 - bugfix: imuxsock was missing SysSock.ParseTrusted module parameter To use that functionality, legacy rsyslog.conf syntax had to be used. Also, the doc was missing information on the "ParseTrusted" set of diff --git a/configure.ac b/configure.ac index c3785f48..0e398307 100644 --- a/configure.ac +++ b/configure.ac @@ -915,7 +915,7 @@ AC_ARG_ENABLE(relp, [enable_relp=no] ) if test "x$enable_relp" = "xyes"; then - PKG_CHECK_MODULES(RELP, relp >= 1.0.1) + PKG_CHECK_MODULES(RELP, relp >= 1.0.2) fi AM_CONDITIONAL(ENABLE_RELP, test x$enable_relp = xyes) diff --git a/doc/imrelp.html b/doc/imrelp.html index 856aff82..9f3e4875 100644 --- a/doc/imrelp.html +++ b/doc/imrelp.html @@ -47,7 +47,7 @@ not specific ones. This is due to a currently existing limitation in librelp.

    Sample:

    This sets up a RELP server on port 20514.

    - diff --git a/plugins/imrelp/imrelp.c b/plugins/imrelp/imrelp.c index dc67f4fe..5e0ae552 100644 --- a/plugins/imrelp/imrelp.c +++ b/plugins/imrelp/imrelp.c @@ -208,6 +208,7 @@ addListner(modConfData_t __attribute__((unused)) *modConf, instanceConf_t *inst) if(pRelpEngine == NULL) { CHKiRet(relpEngineConstruct(&pRelpEngine)); CHKiRet(relpEngineSetDbgprint(pRelpEngine, dbgprintf)); + CHKiRet(relpEngineSetFamily(pRelpEngine, glbl.GetDefPFFamily())); CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required)); CHKiRet(relpEngineSetSyslogRcv(pRelpEngine, onSyslogRcv)); if (!glbl.GetDisableDNS()) { -- cgit v1.2.3 From 0114b531b38b16db98b04b680017d6c758987fd9 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Mar 2013 14:33:23 +0100 Subject: debug system improvement & bug fix for init system status (see below) - rsyslogd startup information is now properly conveyed back to init when privileges are beging dropped Actually, we have moved termination of the parent in front of the priv drop. So it shall work now in all cases. See code comments in commit for more details. - If forking, the parent now waits for a maximum of 60 seconds for termination by the child - improved debugging support in forked (auto-backgrounding) mode The rsyslog debug log file is now continued to be written across the fork. --- ChangeLog | 10 ++++++++++ runtime/debug.c | 9 +++++++++ runtime/debug.h | 1 + tools/syslogd.c | 48 ++++++++++++++++++++++++++++-------------------- 4 files changed, 48 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index c41a89c0..b143ae81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,16 @@ Version 7.2.7 [v7-stable] 2013-03-?? config directives. - doc bugfix: rsyslog.conf man page had invalid file format info closes: http://bugzilla.adiscon.com/show_bug.cgi?id=418 +- rsyslogd startup information is now properly conveyed back to init + when privileges are beging dropped + Actually, we have moved termination of the parent in front of the + priv drop. So it shall work now in all cases. See code comments in + commit for more details. +- If forking, the parent now waits for a maximum of 60 seconds for + termination by the child +- improved debugging support in forked (auto-backgrounding) mode + The rsyslog debug log file is now continued to be written across the + fork. ---------------------------------------------------------------------------- Version 7.2.6 [v7-stable] 2013-03-05 - slightly improved config parser error messages when invalid escapes happen diff --git a/runtime/debug.c b/runtime/debug.c index 1d306dbd..26da31b4 100644 --- a/runtime/debug.c +++ b/runtime/debug.c @@ -1296,6 +1296,15 @@ dbgmalloc(size_t size) } +/* report fd used for debug log. This is needed in case of + * auto-backgrounding, where the debug log shall not be closed. + */ +int +dbgGetDbglogFd(void) +{ + return altdbg; +} + /* read in the runtime options * rgerhards, 2008-02-28 */ diff --git a/runtime/debug.h b/runtime/debug.h index 5bd26bd8..e6971f82 100644 --- a/runtime/debug.h +++ b/runtime/debug.h @@ -104,6 +104,7 @@ void dbgSetExecLocation(int iStackPtr, int line); void dbgSetThrdName(uchar *pszName); void dbgPrintAllDebugInfo(void); void *dbgmalloc(size_t size); +int dbgGetDbglogFd(void); /* macros */ #ifdef DEBUGLESS diff --git a/tools/syslogd.c b/tools/syslogd.c index 62c18e72..0d7aac6c 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -224,7 +224,7 @@ struct queuefilenames_s { int MarkInterval = 20 * 60; /* interval between marks in seconds - read-only after startup */ int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */ -static int NoFork = 0; /* don't fork - don't run in daemon mode - read-only after startup */ +static int doFork = 1; /* fork - run in daemon mode - read-only after startup */ int bHaveMainQueue = 0;/* set to 1 if the main queue - in queueing mode - is available * If the main queue is either not yet ready or not running in * queueing mode (mode DIRECT!), then this is set to 0. @@ -473,7 +473,7 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags) * permits us to process unmodified config files which otherwise contain a * supressor statement. */ - if(((Debug == DEBUG_FULL || NoFork) && ourConf->globals.bErrMsgToStderr) || iConfigVerify) { + if(((Debug == DEBUG_FULL || !doFork) && ourConf->globals.bErrMsgToStderr) || iConfigVerify) { if(LOG_PRI(pri) == LOG_ERR) fprintf(stderr, "rsyslogd: %s\n", msg); } @@ -652,7 +652,6 @@ finalize_it: rsRetVal multiSubmitMsg(multi_submit_t *pMultiSub) { - int i; qqueue_t *pQueue; ruleset_t *pRuleset; DEFiRet; @@ -1693,8 +1692,7 @@ doGlblProcessInit(void) thrdInit(); - if( !(Debug == DEBUG_FULL || NoFork) ) - { + if(doFork) { DBGPRINTF("Checking pidfile '%s'.\n", PidFile); if (!check_pid(PidFile)) { @@ -1706,16 +1704,23 @@ doGlblProcessInit(void) /* stop writing debug messages to stdout (if debugging is on) */ stddbg = -1; + dbgprintf("ready for forking\n"); if (fork()) { /* Parent process */ - sleep(300); - /* Not reached unless something major went wrong. 5 - * minutes should be a fair amount of time to wait. - * Please note that this procedure is important since - * the father must not exit before syslogd isn't - * initialized or the klogd won't be able to flush its - * logs. -Joey + dbgprintf("parent process going to sleep for 60 secs\n"); + sleep(60); + /* Not reached unless something major went wrong. 1 + * minute should be a fair amount of time to wait. + * The parent should not exit before rsyslogd is + * properly initilized (at least almost) or the init + * system may get a wrong impression of our readyness. + * Note that we exit before being completely initialized, + * but at this point it is very, very unlikely that something + * bad can happen. We do this here, because otherwise we would + * need to have much more code to handle priv drop (which we + * don't consider worth for the init system, especially as it + * is going away on the majority of distros). */ exit(1); /* "good" exit - after forking, not diasabling anything */ } @@ -1724,6 +1729,7 @@ doGlblProcessInit(void) close(0); /* we keep stdout and stderr open in case we have to emit something */ i = 3; + dbgprintf("in child, finalizing initialization\n"); /* if (sd_booted()) */ { const char *e; @@ -1757,7 +1763,8 @@ doGlblProcessInit(void) i = SD_LISTEN_FDS_START + sd_fds; } for ( ; i < num_fds; i++) - (void) close(i); + if(i != dbgGetDbglogFd()) + close(i); untty(); } else { @@ -1968,7 +1975,7 @@ int realMain(int argc, char **argv) fprintf(stderr, "rsyslogd: error -m is no longer supported - use immark instead"); break; case 'n': /* don't fork */ - NoFork = 1; + doFork = 0; break; case 'N': /* enable config verify mode */ iConfigVerify = atoi(arg); @@ -2066,17 +2073,18 @@ int realMain(int argc, char **argv) if(!iConfigVerify) CHKiRet(doGlblProcessInit()); + /* Send a signal to the parent so it can terminate. */ + if(myPid != ppid) { + dbgprintf("signaling parent to terminate\n"); + kill(ppid, SIGTERM); + } + CHKiRet(init()); if(Debug && debugging_on) { dbgprintf("Debugging enabled, SIGUSR1 to turn off debugging.\n"); } - /* Send a signal to the parent so it can terminate. */ - if(myPid != ppid) - kill(ppid, SIGTERM); - - /* END OF INTIALIZATION */ DBGPRINTF("initialization completed, transitioning to regular run mode\n"); @@ -2087,7 +2095,7 @@ int realMain(int argc, char **argv) * is still in its infancy (and not really done), we currently accept this issue. * rgerhards, 2009-06-29 */ - if(!(Debug == DEBUG_FULL || NoFork)) { + if(!doFork) { close(1); close(2); ourConf->globals.bErrMsgToStderr = 0; -- cgit v1.2.3 From b097e889a14de1341262e53c70451f67bbe077ab Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Mar 2013 16:59:40 +0100 Subject: bugfix: segfault in expression optimizer closes: http://bugzilla.adiscon.com/show_bug.cgi?id=423 --- ChangeLog | 2 ++ grammar/rainerscript.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29cd533c..ddfed3b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Version 7.3.8 [devel] 2013-03-?? - imrelp: now supports listening to IPv4/v6 only instead of always both build now requires librelp 1.0.2 closes: http://bugzilla.adiscon.com/show_bug.cgi?id=378 +- bugfix: segfault in expression optimizer + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=423 - bugfix: imuxsock was missing SysSock.ParseTrusted module parameter To use that functionality, legacy rsyslog.conf syntax had to be used. Also, the doc was missing information on the "ParseTrusted" set of diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 7ef7bf7f..8a9c9aaa 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -2635,7 +2635,7 @@ cnfexprOptimize_CMP_severity_facility(struct cnfexpr *expr) /* optimize a comparison with a variable as left-hand operand * NOTE: Currently support CMP_EQ, CMP_NE only and code NEEDS - * TO BE CHANGED for other comparisons! + * TO BE CHANGED fgr other comparisons! */ static inline struct cnfexpr* cnfexprOptimize_CMP_var(struct cnfexpr *expr) @@ -2790,10 +2790,10 @@ cnfexprOptimize(struct cnfexpr *expr) expr->l = expr->r; expr->r = exprswap; } - } else if(expr->l->nodetype == 'V') { - expr = cnfexprOptimize_CMP_var(expr); } - if(expr->r->nodetype == 'A') { + if(expr->l->nodetype == 'V') { + expr = cnfexprOptimize_CMP_var(expr); + } else if(expr->r->nodetype == 'A') { cnfexprOptimize_CMPEQ_arr((struct cnfarray *)expr->r); } break; -- cgit v1.2.3 From ff192e5b3cea37863d3a080ad993ad3233a852b6 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 18 Mar 2013 11:47:14 +0100 Subject: bugfix: mmanon did not build on some platforms (e.g. Ubuntu) --- ChangeLog | 3 ++- plugins/mmanon/mmanon.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ddfed3b8..fae64d13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,9 @@ --------------------------------------------------------------------------- -Version 7.3.8 [devel] 2013-03-?? +Version 7.3.8 [devel] 2013-03-18 - imrelp: now supports listening to IPv4/v6 only instead of always both build now requires librelp 1.0.2 closes: http://bugzilla.adiscon.com/show_bug.cgi?id=378 +- bugfix: mmanon did not build on some platforms (e.g. Ubuntu) - bugfix: segfault in expression optimizer closes: http://bugzilla.adiscon.com/show_bug.cgi?id=423 - bugfix: imuxsock was missing SysSock.ParseTrusted module parameter diff --git a/plugins/mmanon/mmanon.c b/plugins/mmanon/mmanon.c index fc0c8a03..a1c99d09 100644 --- a/plugins/mmanon/mmanon.c +++ b/plugins/mmanon/mmanon.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "conf.h" #include "syslogd-types.h" #include "srUtils.h" -- cgit v1.2.3 From cc69a17b62599dc5c5a6d1320b6f62ca7632226d Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 18 Mar 2013 11:48:16 +0100 Subject: prepare for 7.3.8 release --- configure.ac | 2 +- doc/manual.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 0e398307..7a4af19d 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],[7.3.7],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[7.3.8],[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 b8461b6d..ca54a04a 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -19,7 +19,7 @@ professional services 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 7.3.7 (devel branch) of rsyslog. +

    This documentation is for version 7.3.8 (devel branch) of rsyslog. Visit the rsyslog status page to obtain current version information and project status.

    If you like rsyslog, you might -- cgit v1.2.3 From 4dce63486fbb197522e11c5644cdf7aef5d7bbbc Mon Sep 17 00:00:00 2001 From: Milan Bartos Date: Thu, 14 Mar 2013 11:52:21 +0100 Subject: Fix trailing '-' in kernel messages. modified: plugins/imkmsg/kmsg.c --- plugins/imkmsg/kmsg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/imkmsg/kmsg.c b/plugins/imkmsg/kmsg.c index b771d68a..c531f941 100644 --- a/plugins/imkmsg/kmsg.c +++ b/plugins/imkmsg/kmsg.c @@ -89,6 +89,10 @@ submitSyslog(uchar *buf) for (; isdigit(*buf); buf++) { timestamp += (timestamp * 10) + (*buf - '0'); } + + while (*buf != ';') { + buf++; /* skip everything till the first ; */ + } buf++; /* skip ; */ /* get message */ -- cgit v1.2.3 From 07ddb712ba562480a5492e1c8733b28e3a766d1a Mon Sep 17 00:00:00 2001 From: Milan Bartos Date: Thu, 14 Mar 2013 11:52:21 +0100 Subject: Fix trailing '-' in kernel messages. modified: plugins/imkmsg/kmsg.c --- plugins/imkmsg/kmsg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/imkmsg/kmsg.c b/plugins/imkmsg/kmsg.c index b771d68a..c531f941 100644 --- a/plugins/imkmsg/kmsg.c +++ b/plugins/imkmsg/kmsg.c @@ -89,6 +89,10 @@ submitSyslog(uchar *buf) for (; isdigit(*buf); buf++) { timestamp += (timestamp * 10) + (*buf - '0'); } + + while (*buf != ';') { + buf++; /* skip everything till the first ; */ + } buf++; /* skip ; */ /* get message */ -- cgit v1.2.3 From 68fe67afc88a105575e6be256523a67c40ccff39 Mon Sep 17 00:00:00 2001 From: Milan Bartos Date: Mon, 18 Mar 2013 09:06:33 +0100 Subject: Remove unnecessary strlen() call modified: plugins/imkmsg/kmsg.c --- plugins/imkmsg/kmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/imkmsg/kmsg.c b/plugins/imkmsg/kmsg.c index c531f941..bc91f989 100644 --- a/plugins/imkmsg/kmsg.c +++ b/plugins/imkmsg/kmsg.c @@ -107,7 +107,7 @@ submitSyslog(uchar *buf) if (*buf != '\0') /* message has appended properties, skip \n */ buf++; - while (strlen((char *)buf)) { + while (*buf) { /* get name of the property */ buf++; /* skip ' ' */ offs = 0; -- cgit v1.2.3 From 3c0c1aa425c8f1bbaa61cf93724cae8e0bd72fee Mon Sep 17 00:00:00 2001 From: Milan Bartos Date: Mon, 18 Mar 2013 09:15:32 +0100 Subject: Fix message read buffer size modified: plugins/imkmsg/kmsg.c --- plugins/imkmsg/kmsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/imkmsg/kmsg.c b/plugins/imkmsg/kmsg.c index bc91f989..0117b6ba 100644 --- a/plugins/imkmsg/kmsg.c +++ b/plugins/imkmsg/kmsg.c @@ -178,14 +178,14 @@ static void readkmsg(void) { int i; - uchar pRcv[8096+1]; + uchar pRcv[8192+1]; char errmsg[2048]; for (;;) { dbgprintf("imkmsg waiting for kernel log line\n"); /* every read() from the opened device node receives one record of the printk buffer */ - i = read(fklog, pRcv, 8096); + i = read(fklog, pRcv, 8192); if (i > 0) { /* successful read of message of nonzero length */ -- cgit v1.2.3 From bc740ffc8009095dd6cec3e3629fcd2283906fcd Mon Sep 17 00:00:00 2001 From: Milan Bartos Date: Mon, 18 Mar 2013 11:12:46 +0100 Subject: Do not exit when messages get overwritten in the circular buffer modified: plugins/imkmsg/kmsg.c --- plugins/imkmsg/kmsg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/imkmsg/kmsg.c b/plugins/imkmsg/kmsg.c index 0117b6ba..f1815f25 100644 --- a/plugins/imkmsg/kmsg.c +++ b/plugins/imkmsg/kmsg.c @@ -190,6 +190,10 @@ readkmsg(void) if (i > 0) { /* successful read of message of nonzero length */ pRcv[i] = '\0'; + } else if (i == -EPIPE) { + imkmsgLogIntMsg(LOG_WARNING, + "imkmsg: some messages in circular buffer got overwritten"); + continue; } else { /* something went wrong - error or zero length message */ if (i < 0 && errno != EINTR && errno != EAGAIN) { -- cgit v1.2.3 From ff261830c65f7d094584dba1f9bce669bd6748d4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 18 Mar 2013 12:16:28 +0100 Subject: doc: mention last patches in ChangeLog --- ChangeLog | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b143ae81..9acbbf27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,5 @@ ---------------------------------------------------------------------------- Version 7.2.7 [v7-stable] 2013-03-?? -- bugfix: imuxsock was missing SysSock.ParseTrusted module parameter - To use that functionality, legacy rsyslog.conf syntax had to be used. - Also, the doc was missing information on the "ParseTrusted" set of - config directives. -- doc bugfix: rsyslog.conf man page had invalid file format info - closes: http://bugzilla.adiscon.com/show_bug.cgi?id=418 - rsyslogd startup information is now properly conveyed back to init when privileges are beging dropped Actually, we have moved termination of the parent in front of the @@ -16,6 +10,14 @@ Version 7.2.7 [v7-stable] 2013-03-?? - improved debugging support in forked (auto-backgrounding) mode The rsyslog debug log file is now continued to be written across the fork. +- bugfix: several issues in imkmsg + see bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=421#c8 +- bugfix: imuxsock was missing SysSock.ParseTrusted module parameter + To use that functionality, legacy rsyslog.conf syntax had to be used. + Also, the doc was missing information on the "ParseTrusted" set of + config directives. +- doc bugfix: rsyslog.conf man page had invalid file format info + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=418 ---------------------------------------------------------------------------- Version 7.2.6 [v7-stable] 2013-03-05 - slightly improved config parser error messages when invalid escapes happen -- cgit v1.2.3 From 0dab9aa0c4f50403436f318e92a65903a956c195 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 18 Mar 2013 13:57:42 +0100 Subject: fix merge problem --- tools/syslogd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/syslogd.c b/tools/syslogd.c index 66adde48..d4fc1c36 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -2001,16 +2001,16 @@ int realMain(int argc, char **argv) if(!iConfigVerify) CHKiRet(doGlblProcessInit()); + /* Send a signal to the parent so it can terminate. */ + if(glblGetOurPid() != ppid) + kill(ppid, SIGTERM); + CHKiRet(init()); if(Debug && debugging_on) { dbgprintf("Debugging enabled, SIGUSR1 to turn off debugging.\n"); } - /* Send a signal to the parent so it can terminate. */ - if(glblGetOurPid() != ppid) - kill(ppid, SIGTERM); - /* END OF INTIALIZATION */ DBGPRINTF("initialization completed, transitioning to regular run mode\n"); -- cgit v1.2.3 From aef0be0c1799fbb20955fc1dc014cb9c9772af88 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 19 Mar 2013 16:20:25 +0100 Subject: bugfix: solve compile problems on non-Linux platforms Thanks to Michael Biebl for alerting us on this issue. --- configure.ac | 1 + runtime/debug.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7a4af19d..68769808 100644 --- a/configure.ac +++ b/configure.ac @@ -122,6 +122,7 @@ AC_CHECK_DECL([SCM_CREDENTIALS], [AC_DEFINE(HAVE_SCM_CREDENTIALS, [1], [set defi #include ]) AC_CHECK_DECL([SO_TIMESTAMP], [AC_DEFINE(HAVE_SO_TIMESTAMP, [1], [set define])], [], [#include #include ]) +AC_CHECK_DECL([SYS_gettid], [AC_DEFINE(HAVE_SYS_gettid, [1], [set define])], [], [#include ]) AC_CHECK_MEMBER([struct sysinfo.uptime], [AC_DEFINE(HAVE_SYSINFO_UPTIME, [1], [set define])], [], [#include ]) # Check for MAXHOSTNAMELEN diff --git a/runtime/debug.c b/runtime/debug.c index 3cb22232..876f61d0 100644 --- a/runtime/debug.c +++ b/runtime/debug.c @@ -303,7 +303,7 @@ static inline void dbgFuncDBRemoveMutexLock(dbgFuncDB_t *pFuncDB, pthread_mutex_ void dbgOutputTID(char* name) { -# ifdef HAVE_SYSCALL +# if defined(HAVE_SYSCALL) && defined(HAVE_SYS_gettid) if(bOutputTidToStderr) fprintf(stderr, "thread tid %u, name '%s'\n", (unsigned)syscall(SYS_gettid), name); -- cgit v1.2.3 From 83c1920d7a6e675f1f433b047e8ed4e50e1050af Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 19 Mar 2013 16:55:25 +0100 Subject: require newer libestr due to a bug in it --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ac6fd43d..86aaa20d 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ AC_CANONICAL_HOST PKG_PROG_PKG_CONFIG # modules we require -PKG_CHECK_MODULES(LIBESTR, libestr >= 0.1.2) +PKG_CHECK_MODULES(LIBESTR, libestr >= 0.1.5) PKG_CHECK_MODULES(LIBEE, libee >= 0.4.0) PKG_CHECK_MODULES([JSON_C], [json]) -- cgit v1.2.3 From 25b53e72195272e4fbc7a4494b816a34138d5718 Mon Sep 17 00:00:00 2001 From: Philippe Muller Date: Wed, 20 Mar 2013 09:27:04 +0100 Subject: bugfix: RainerScript getenv() function caused segfault when var was not found Signed-off-by: Rainer Gerhards --- ChangeLog | 3 +++ grammar/rainerscript.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9acbbf27..b0e943c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ Version 7.2.7 [v7-stable] 2013-03-?? - improved debugging support in forked (auto-backgrounding) mode The rsyslog debug log file is now continued to be written across the fork. +- bugfix: RainerScript getenv() function caused segfault when var was + not found. + Thanks to Philippe Muller for the patch. - bugfix: several issues in imkmsg see bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=421#c8 - bugfix: imuxsock was missing SysSock.ParseTrusted module parameter diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 20b86c5c..b04e53b5 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -1071,8 +1071,12 @@ doFuncCall(struct cnffunc *func, struct var *ret, void* usrptr) estr = var2String(&r[0], &bMustFree); str = (char*) es_str2cstr(estr, NULL); envvar = getenv(str); + if(envvar == NULL) { + ret->d.estr = es_newStr(0); + } else { + ret->d.estr = es_newStrFromCStr(envvar, strlen(envvar)); + } ret->datatype = 'S'; - ret->d.estr = es_newStrFromCStr(envvar, strlen(envvar)); if(bMustFree) es_deleteStr(estr); if(r[0].datatype == 'S') es_deleteStr(r[0].d.estr); free(str); -- cgit v1.2.3 From 619c70d31f33deb8538636ac1302a2d4032a844e Mon Sep 17 00:00:00 2001 From: Philippe Muller Date: Wed, 20 Mar 2013 09:27:04 +0100 Subject: bugfix: RainerScript getenv() function caused segfault when var was not found This patch is released under ASL 2.0 as of email conversation from 2013-03-20. Signed-off-by: Rainer Gerhards --- ChangeLog | 3 +++ grammar/rainerscript.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9acbbf27..b0e943c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ Version 7.2.7 [v7-stable] 2013-03-?? - improved debugging support in forked (auto-backgrounding) mode The rsyslog debug log file is now continued to be written across the fork. +- bugfix: RainerScript getenv() function caused segfault when var was + not found. + Thanks to Philippe Muller for the patch. - bugfix: several issues in imkmsg see bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=421#c8 - bugfix: imuxsock was missing SysSock.ParseTrusted module parameter diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 20b86c5c..b04e53b5 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -1071,8 +1071,12 @@ doFuncCall(struct cnffunc *func, struct var *ret, void* usrptr) estr = var2String(&r[0], &bMustFree); str = (char*) es_str2cstr(estr, NULL); envvar = getenv(str); + if(envvar == NULL) { + ret->d.estr = es_newStr(0); + } else { + ret->d.estr = es_newStrFromCStr(envvar, strlen(envvar)); + } ret->datatype = 'S'; - ret->d.estr = es_newStrFromCStr(envvar, strlen(envvar)); if(bMustFree) es_deleteStr(estr); if(r[0].datatype == 'S') es_deleteStr(r[0].d.estr); free(str); -- cgit v1.2.3 From 8059afa9998906ba11d3509beff7af6f7efd9af1 Mon Sep 17 00:00:00 2001 From: Tomas Heinrich Date: Mon, 18 Mar 2013 16:28:47 +0100 Subject: bugfix: get rid of potential endless loop in doGetGID() --- runtime/cfsysline.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c index ad087652..bc5ffa6f 100644 --- a/runtime/cfsysline.c +++ b/runtime/cfsysline.c @@ -349,8 +349,9 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p struct group gBuf; DEFiRet; uchar szName[256]; - int bufSize = 2048; + int bufSize = 1024; char * stringBuf = NULL; + int err; assert(pp != NULL); assert(*pp != NULL); @@ -360,20 +361,21 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p ABORT_FINALIZE(RS_RET_NOT_FOUND); } - - CHKmalloc(stringBuf = malloc(bufSize)); - while(pgBuf == NULL) { - errno = 0; - getgrnam_r((char*)szName, &gBuf, stringBuf, bufSize, &pgBuf); - if((pgBuf == NULL) && (errno == ERANGE)) { - /* Increase bufsize and try again.*/ - bufSize *= 2; - CHKmalloc(stringBuf = realloc(stringBuf, bufSize)); - } - } + do { + /* Increase bufsize and try again.*/ + bufSize *= 2; + CHKmalloc(stringBuf = realloc(stringBuf, bufSize)); + err = getgrnam_r((char*)szName, &gBuf, stringBuf, bufSize, &pgBuf); + } while((pgBuf == NULL) && (err == ERANGE)); if(pgBuf == NULL) { - errmsg.LogError(0, RS_RET_NOT_FOUND, "ID for group '%s' could not be found or error", (char*)szName); + if (err != 0) { + rs_strerror_r(err, stringBuf, bufSize); + errmsg.LogError(0, RS_RET_NOT_FOUND, "Query for group '%s' resulted in an error: %s\n", + (char*)szName, stringBuf); + } else { + errmsg.LogError(0, RS_RET_NOT_FOUND, "ID for group '%s' could not be found", (char*)szName); + } iRet = RS_RET_NOT_FOUND; } else { if(pSetHdlr == NULL) { -- cgit v1.2.3 From 2e4e7e819fed64fa2897af01479a9083b081d0c2 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 Mar 2013 09:46:59 +0100 Subject: doc: mention merged bugfix in ChangeLog --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index b0e943c2..8286b0a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ Version 7.2.7 [v7-stable] 2013-03-?? - improved debugging support in forked (auto-backgrounding) mode The rsyslog debug log file is now continued to be written across the fork. +- bugfix: using group resolution could lead to endless loop + Thanks to Tomas Heinrich for the patch. + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=310 - bugfix: RainerScript getenv() function caused segfault when var was not found. Thanks to Philippe Muller for the patch. -- cgit v1.2.3 From 7784b65d8709fba647a7beeb934c18b7cb8cb6f1 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 Mar 2013 10:24:36 +0100 Subject: bugfix: build on non-linux platforms failed The previous fix for this was incomplete. --- runtime/wtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/wtp.c b/runtime/wtp.c index f8d3588b..19151e7c 100644 --- a/runtime/wtp.c +++ b/runtime/wtp.c @@ -381,9 +381,9 @@ wtpWorker(void *arg) /* the arg is actually a wti object, even though we are in if(prctl(PR_SET_NAME, thrdName, 0, 0, 0) != 0) { DBGPRINTF("prctl failed, not setting thread name for '%s'\n", wtpGetDbgHdr(pThis)); } + dbgOutputTID((char*)thrdName); # endif - dbgOutputTID((char*)thrdName); pthread_cleanup_push(wtpWrkrExecCancelCleanup, pWti); wtiWorker(pWti); pthread_cleanup_pop(0); -- cgit v1.2.3 From 5ebb7d03cf88c86390450b1dd63c9467e9a4f3c7 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 Mar 2013 10:25:26 +0100 Subject: add recent bugfix to ChangeLog --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index 07cf7844..adc12076 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ --------------------------------------------------------------------------- +Version 7.3.9 [devel] 2013-03-?? +- bugfix: build problems on non-Linux platforms +--------------------------------------------------------------------------- Version 7.3.8 [devel] 2013-03-18 - imrelp: now supports listening to IPv4/v6 only instead of always both build now requires librelp 1.0.2 -- cgit v1.2.3 From 5b76d639659fe5582b425b903fa8f5e14624a8e4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 Mar 2013 11:03:41 +0100 Subject: bugfix: $mmnormalizeuseramsg paramter was specified with wrong type Thanks to Renzhong Zhang for alerting us of the problem. closes: http://bugzilla.adiscon.com/show_bug.cgi?id=420 --- ChangeLog | 3 +++ plugins/mmnormalize/mmnormalize.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b0e943c2..2df963a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ Version 7.2.7 [v7-stable] 2013-03-?? - improved debugging support in forked (auto-backgrounding) mode The rsyslog debug log file is now continued to be written across the fork. +- bugfix: $mmnormalizeuseramsg paramter was specified with wrong type + Thank to Renzhong Zhang for alerting us of the problem. + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=420 - bugfix: RainerScript getenv() function caused segfault when var was not found. Thanks to Philippe Muller for the patch. diff --git a/plugins/mmnormalize/mmnormalize.c b/plugins/mmnormalize/mmnormalize.c index d3fba39b..c366d5fe 100644 --- a/plugins/mmnormalize/mmnormalize.c +++ b/plugins/mmnormalize/mmnormalize.c @@ -281,7 +281,7 @@ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(omsdRegCFSLineHdlr((uchar *)"mmnormalizerulebase", 0, eCmdHdlrGetWord, setRuleBase, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"mmnormalizeuserawmsg", 0, eCmdHdlrInt, + CHKiRet(omsdRegCFSLineHdlr((uchar *)"mmnormalizeuserawmsg", 0, eCmdHdlrBinary, NULL, &cs.bUseRawMsg, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); -- cgit v1.2.3 From 2b69e2aaddb587185b7c0ddb412b36549d848091 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 Mar 2013 12:47:53 +0100 Subject: omstdout: added debug message when writing to stdout fails --- plugins/omstdout/omstdout.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/omstdout/omstdout.c b/plugins/omstdout/omstdout.c index 59f9c8bb..a84a7593 100644 --- a/plugins/omstdout/omstdout.c +++ b/plugins/omstdout/omstdout.c @@ -105,6 +105,7 @@ BEGINdoAction int iBuf; char szBuf[65564]; size_t len; + int r; CODESTARTdoAction if(pData->bUseArrayInterface) { /* if we use array passing, we need to put together a string @@ -140,9 +141,15 @@ CODESTARTdoAction * actually intends to use this module in production (why???), this code * needs to be more solid. -- rgerhards, 2012-11-28 */ - if(write(1, toWrite, len)) {}; /* 1 is stdout! */ + if((r = write(1, toWrite, len)) != (int) len) { /* 1 is stdout! */ + DBGPRINTF("omstdout: error %d writing to stdout[%d]: %s\n", + r, len, toWrite); + } if(pData->bEnsureLFEnding && toWrite[len-1] != '\n') { - if(write(1, "\n", 1)) {}; /* write missing LF */ + if((r = write(1, "\n", 1)) != 1) { /* write missing LF */ + DBGPRINTF("omstdout: error %d writing \\n to stdout\n", + r); + } } ENDdoAction -- cgit v1.2.3 From cbe737ed06667b5bcb15f332061ebcde8d50bc8b Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 Mar 2013 12:49:35 +0100 Subject: bugfix: stdout/stderr were not closed on forking but were closed when running in the forground - this was just reversed of what it should be. This is a regression of a recent change. --- ChangeLog | 3 +++ tools/syslogd.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 705dcf13..c6a4eb41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ --------------------------------------------------------------------------- Version 7.3.9 [devel] 2013-03-?? - bugfix: build problems on non-Linux platforms +- bugfix: stdout/stderr were not closed on forking + but were closed when running in the forground - this was just reversed + of what it should be. This is a regression of a recent change. --------------------------------------------------------------------------- Version 7.3.8 [devel] 2013-03-18 - imrelp: now supports listening to IPv4/v6 only instead of always both diff --git a/tools/syslogd.c b/tools/syslogd.c index d4fc1c36..e291ba47 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -2021,7 +2021,7 @@ int realMain(int argc, char **argv) * is still in its infancy (and not really done), we currently accept this issue. * rgerhards, 2009-06-29 */ - if(!doFork) { + if(doFork) { close(1); close(2); ourConf->globals.bErrMsgToStderr = 0; -- cgit v1.2.3 From a8e83e494720c3657a74cacb367241f8991d6d73 Mon Sep 17 00:00:00 2001 From: Milan Bartos Date: Wed, 20 Mar 2013 13:01:37 +0100 Subject: bugfix: imuxsock rate-limiting could not be configured via legacy conf Signed-off-by: Rainer Gerhards --- ChangeLog | 6 ++++++ plugins/imuxsock/imuxsock.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index c517cb89..1f6c4bf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,12 @@ Version 7.2.7 [v7-stable] 2013-03-?? - improved debugging support in forked (auto-backgrounding) mode The rsyslog debug log file is now continued to be written across the fork. +- bugfix: imuxsock rate-limiting could not be configured via legacy conf + Rate-limiting for the system socket could not be configured via legacy + configuration directives. However, the new-style RainerScript config + options worked. + Thanks to Milan Bartos for the patch. + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=390 - bugfix: using group resolution could lead to endless loop Thanks to Tomas Heinrich for the patch. closes: http://bugzilla.adiscon.com/show_bug.cgi?id=310 diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 637cb133..1a2b696e 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -1300,6 +1300,9 @@ CODESTARTendCnfLoad loadModConf->bUseFlowCtl = cs.bUseFlowCtlSysSock; loadModConf->bAnnotateSysSock = cs.bAnnotateSysSock; loadModConf->bParseTrusted = cs.bParseTrusted; + loadModConf->ratelimitIntervalSysSock = cs.ratelimitIntervalSysSock; + loadModConf->ratelimitBurstSysSock = cs.ratelimitBurstSysSock; + loadModConf->ratelimitSeveritySysSock = cs.ratelimitSeveritySysSock; } loadModConf = NULL; /* done loading */ -- cgit v1.2.3 From 144f0858b7250ceffe4828712126146345e0e92a Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 Mar 2013 14:21:32 +0100 Subject: cleanup --- tools/pmrfc3164.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pmrfc3164.c b/tools/pmrfc3164.c index bcded428..5dfa74f0 100644 --- a/tools/pmrfc3164.c +++ b/tools/pmrfc3164.c @@ -138,7 +138,7 @@ CODESTARTparse */ if(lenMsg > 0 && pMsg->msgFlags & PARSE_HOSTNAME) { i = 0; - while(i < lenMsg && (isalnum(p2parse[i]) || p2parse[i] == '.' || p2parse[i] == '.' + while(i < lenMsg && (isalnum(p2parse[i]) || p2parse[i] == '.' || p2parse[i] == '_' || p2parse[i] == '-') && i < (CONF_HOSTNAME_MAXSIZE - 1)) { bufParseHOSTNAME[i] = p2parse[i]; ++i; -- cgit v1.2.3 From 136a9828452486da97578fc5a2e870143279dceb Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 20 Mar 2013 15:36:57 +0100 Subject: slightly improve imfile doc --- doc/imfile.html | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/doc/imfile.html b/doc/imfile.html index 0997e382..de4893ac 100644 --- a/doc/imfile.html +++ b/doc/imfile.html @@ -141,17 +141,17 @@ your distro puts rsyslog's config files). Note that only commands actually needed need to be specified. The second file uses less commands and uses defaults instead.

    - @@ -210,8 +210,7 @@ your distro puts rsyslog's config files). Note that only commands actually needed need to be specified. The second file uses less commands and uses defaults instead.

    -