diff options
-rw-r--r-- | ChangeLog | 93 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | doc/Makefile.am | 11 | ||||
-rw-r--r-- | doc/imrelp.html | 6 | ||||
-rw-r--r-- | doc/manual.html | 6 | ||||
-rw-r--r-- | doc/rscript_abnf.html | 4 | ||||
-rw-r--r-- | doc/rsyslog_packages.html | 83 | ||||
-rw-r--r-- | doc/status.html | 18 | ||||
-rw-r--r-- | doc/troubleshoot.html | 35 | ||||
-rw-r--r-- | plugins/immark/immark.c | 2 | ||||
-rw-r--r-- | plugins/omrelp/omrelp.c | 1 | ||||
-rw-r--r-- | rsyslog.conf | 6 | ||||
-rw-r--r-- | runtime/msg.c | 47 | ||||
-rw-r--r-- | runtime/nsd_gtls.c | 5 | ||||
-rw-r--r-- | runtime/nsdsel_gtls.c | 2 | ||||
-rw-r--r-- | runtime/queue.c | 29 | ||||
-rw-r--r-- | runtime/vm.c | 3 | ||||
-rw-r--r-- | tools/omfwd.c | 9 | ||||
-rw-r--r-- | tools/rsyslogd.8 | 4 | ||||
-rw-r--r-- | tools/syslogd.c | 2 |
20 files changed, 276 insertions, 92 deletions
@@ -1,15 +1,44 @@ - added a generic test driver for RainerScripts plus some test cases to the testbench --------------------------------------------------------------------------- -Version 3.19.9 (rgerhards), 2008-07-?? +Version 3.21.0 [DEVEL] (rgerhards), 2008-??-?? +--------------------------------------------------------------------------- +Version 3.19.11 [BETA] (rgerhards), 2008-??-?? +--------------------------------------------------------------------------- +Version 3.19.10 [BETA] (rgerhards), 2008-07-15 +- start of a new beta branch based on former 3.19 devel branch +- bugfix: bad memory leak in disk-based queue modes +- bugfix: UDP syslog forwarding did not work on all platforms + the ai_socktype was incorrectly set to 1. On some platforms, this + lead to failing name resolution (e.g. FreeBSD 7). Thanks to HKS for + reporting the bug. +- bugfix: priority was incorrectly calculated on FreeBSD 7, + because the LOG_MAKEPRI() C macro has a different meaning there (it + is just a simple addition of faciltity and severity). I have changed + this to use own, consistent, code for PRI calculation. Thank to HKS + for reporting this bug. +- bugfix (cosmetical): authorization was not checked when gtls handshake + completed immediately. While this sounds scary, the situation can not + happen in practice. We use non-blocking IO only for server-based gtls + session setup. As TLS requires the exchange of multiple frames before + the handshake completes, it simply is impossible to do this in one + step. However, it is useful to have the code path correct even for + this case - otherwise, we may run into problems if the code is changed + some time later (e.g. to use blocking sockets). Thanks to varmojfekoj + for providing the patch. +- important queue bugfix from 3.18.1 imported (see below) +- cleanup of some debug messages +--------------------------------------------------------------------------- +Version 3.19.9 (rgerhards), 2008-07-07 - added tutorial for creating a TLS-secured syslog infrastructure -- rewriten omusrmsg to no longer fork() a new process for sending messages +- rewritten omusrmsg to no longer fork() a new process for sending messages this caused some problems with the threading model, e.g. zombies. Also, it was far less optimal than it is now. - bugfix: machine certificate was required for client even in TLS anon mode Reference: http://bugzilla.adiscon.com/show_bug.cgi?id=85 The fix also slightly improves performance by not storing certificates in client sessions when there is no need to do so. +- bugfix: RainerScript syntax error was not always detected --------------------------------------------------------------------------- Version 3.19.8 (rgerhards), 2008-07-01 - bugfix: gtls module did not correctly handle EGAIN (and similar) recv() @@ -132,6 +161,31 @@ Version 3.19.0 (rgerhards), 2008-05-06 - a lot of cleanup in regard to modularization - -c option no longer must be the first option - thanks to varmjofekoj for the patch +Version 3.18.1 (rgerhards), 2008-07-?? +- bugfix: potential segfault in creating message mutex in non-direct queue + mode. rsyslogd segfaults on freeeBSD 7.0 (an potentially other platforms) + if an action queue is running in any other mode than non-direct. The + same problem can potentially be triggered by some main message queue + settings. In any case, it will manifest during rsylog's startup. It is + unlikely to happen after a successful startup (the only window of + exposure may be a relatively seldom executed action running in queued + mode). This has been corrected. Thank to HKS for point out the problem. +- bugfix: priority was incorrectly calculated on FreeBSD 7, + because the LOG_MAKEPRI() C macro has a different meaning there (it + is just a simple addition of faciltity and severity). I have changed + this to use own, consistent, code for PRI calculation. [Backport from + 3.19.10] +- bugfix: mark messages were not correctly written to text log files + the markmessageinterval was not correctly propagated to all places + where it was needed. This resulted in rsyslog using the default + (20 minutes) in some code pathes, what looked to the user like mark + messages were never written. +--------------------------------------------------------------------------- +Version 3.18.0 (rgerhards), 2008-07-11 +- begun a new v3-stable based on former 3.17.4 beta plus patches to + previous v3-stable +- bugfix in RainerScript: syntax error was not always detected +--------------------------------------------------------------------------- Version 3.17.5 (rgerhards), 2008-06-27 - added doc: howto set up a reliable connection to remote server via queued mode (and plain tcp protocol) @@ -203,6 +257,10 @@ Version 3.17.0 (rgerhards), 2008-04-08 Plus a number of bugfixes that were applied to v3-stable and beta branches (not mentioned here in detail). --------------------------------------------------------------------------- +Version 3.16.3 (rgerhards), 2008-07-11 +- updated information on rsyslog packages +- bugfix: memory leak in disk-based queue modes +--------------------------------------------------------------------------- Version 3.16.2 (rgerhards), 2008-06-25 - fixed potential segfault due to invalid call to cfsysline thanks to varmojfekoj for the patch @@ -690,6 +748,37 @@ Version 2.0.4 STABLE (rgerhards), 2008-03-27 - bugfix: internally generated messages had "FROMHOST" property not set - bugfix: continue parsing if tag is oversize (discard oversize part) - thanks to mclaughlin77@gmail.com for the patch +- added $HHOUR and $QHOUR system properties - can be used for half- and + quarter-hour logfile rotation +--------------------------------------------------------------------------- +Version 2.0.3 STABLE (rgerhards), 2008-03-12 +- bugfix: setting for $EscapeCopntrolCharactersOnReceive was not + properly initialized +- bugfix: resolved potential segfault condition on HUP (extremely + unlikely to happen in practice), for details see tracker: + http://bugzilla.adiscon.com/show_bug.cgi?id=38 +- improved the man pages a bit - thanks to Michael Biebl for the patch +- bugfix: not properly initialized data could cause several segfaults if + there were errors in the config file - thanks to varmojfekoj for the patch +--------------------------------------------------------------------------- +Version 2.0.2 STABLE (rgerhards), 2008-02-12 +- fixed a bug that could cause invalid string handling via strerror_r + varmojfekoj provided the patch - many thanks! +- added x-info field to rsyslogd startup/shutdown message. Hopefully + points users to right location for further info (many don't even know + they run rsyslog ;)) +- bugfix: suspended actions were not always properly resumed + varmojfekoj provided the patch - many thanks! +- bugfix: errno could be changed during mark processing, leading to + invalid error messages when processing inputs. Thank to varmojfekoj for + pointing out this problem. +- bugfix: trailing ":" of tag was lost while parsing legacy syslog messages + without timestamp - thanks to Anders Blomdell for providing a patch! +- bugfix (doc): misspelled config directive, invalid signal info +- applied some doc fixes from Michel Biebl and cleaned up some no longer + needed files suggested by him +- cleaned up stringbuf.c to fix an annoyance reported by Anders Blomdell +- fixed bug that caused invalid treatment of tabs (HT) in rsyslog.conf --------------------------------------------------------------------------- Version 2.0.1 STABLE (rgerhards), 2008-01-24 - fixed a bug in integer conversion - but this function was never called, diff --git a/configure.ac b/configure.ac index 5e141ab5..43888d64 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],[3.19.9],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[3.21.0],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([ChangeLog]) AC_CONFIG_HEADERS([config.h]) diff --git a/doc/Makefile.am b/doc/Makefile.am index 8ff207e0..de3675de 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -45,6 +45,7 @@ html_files = \ tls_cert_ca.jpg \ tls_cert.jpg \ tls_cert_errmsgs.html \ + rsyslog_secure_tls.html \ tls_cert_server.html \ tls_cert_ca.html \ tls_cert_summary.html \ @@ -84,7 +85,17 @@ html_files = \ rsconf1_resetconfigvariables.html \ rsconf1_umask.html \ v3compatibility.html \ + im3195.html \ + netstream.html \ + ns_gtls.html \ + ns_ptcp.html \ src/tls_cert.dia \ + gssapi.html \ + licensing.html \ + ommail.html \ + omrelp.html \ + status.html \ + troubleshoot.html \ src/classes.dia EXTRA_DIST = $(html_files) diff --git a/doc/imrelp.html b/doc/imrelp.html index b6f1f2bc..bfdaad84 100644 --- a/doc/imrelp.html +++ b/doc/imrelp.html @@ -35,10 +35,10 @@ Starts a RELP server on selected port</li> <li>see description</li> </ul> <p><b>Sample:</b></p> -<p>This sets up a RELP server on port 2514.<br> +<p>This sets up a RELP server on port 20514.<br> </p> <textarea rows="15" cols="60">$ModLoad imrelp # needs to be done just once -$InputRELPServerRun 2514 +$InputRELPServerRun 20514 </textarea> <p>[<a href="rsyslog_conf.html">rsyslog.conf overview</a>] [<a href="manual.html">manual index</a>] [<a href="http://www.rsyslog.com/">rsyslog site</a>]</p> @@ -49,4 +49,4 @@ Copyright © 2008 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and <a href="http://www.adiscon.com/">Adiscon</a>. Released under the GNU GPL version 3 or higher.</font></p> -</body></html>
\ No newline at end of file +</body></html> diff --git a/doc/manual.html b/doc/manual.html index 15607c58..fe97ef84 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -16,7 +16,7 @@ relay chains while at the same time being very easy to setup for the novice user. And as we know what enterprise users really need, there is also <a href="professional_support.html">professional rsyslog support</a> available directly from the source!</p> -<p><b>This documentation is for version 3.19.9 (devel branch) of rsyslog.</b> +<p><b>This documentation is for version 3.21.0 (devel branch) of rsyslog.</b> Visit the <i> <a href="http://www.rsyslog.com/doc-status.html">rsyslog status page</a></i></b> to obtain current version information and project status. </p><p><b>If you like rsyslog, you might @@ -31,8 +31,8 @@ if you do not read the doc, but doing so will definitely improve your experience <p><span style="font-weight: bold;"></span><b>Follow the links below for the</b><br></p><ul> -<li><a href="rsyslog_conf.html">configuration file -syntax (rsyslog.conf)</a></li> +<li><a href="troubleshoot.html">troubleshooting rsyslog problems</a></li> +<li><a href="rsyslog_conf.html">configuration file syntax (rsyslog.conf)</a></li> <li> <a href="property_replacer.html">property replacer, an important core component</a></li> <li>a commented <a href="sample.conf.html">sample diff --git a/doc/rscript_abnf.html b/doc/rscript_abnf.html index 97de7284..278fb59c 100644 --- a/doc/rscript_abnf.html +++ b/doc/rscript_abnf.html @@ -34,8 +34,8 @@ table... values('&$facility&','&$severity&...?]<br> <p><font size="2">This documentation is part of the <a href="http://www.rsyslog.com/">rsyslog</a> project.<br> -Copyright © 2008 by <a href="http://www.gerhards.net/rainer">Rainer +Copyright © 2008 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and <a href="http://www.adiscon.com/">Adiscon</a>. Released under the GNU GPL version 3 or higher.</font></p> -</body></html>
\ No newline at end of file +</body></html> diff --git a/doc/rsyslog_packages.html b/doc/rsyslog_packages.html index 38c43c93..80ba96c5 100644 --- a/doc/rsyslog_packages.html +++ b/doc/rsyslog_packages.html @@ -5,43 +5,72 @@ <body> <h1>rsyslog packages</h1> <p><b>Thanks to some volunteers, rsyslog is also available in package form on -some distributions.</b> All available packages are listed below. If you would +some distributions.</b> All currently known packages are listed below. If I have forgotten +one or if you would like to maintain a package for a new distribution, please mail me at <a href="mailto:rgerhards@adiscon.com">rgerhards@adiscon.com</a>. Any help is *deeply* appreciated. While I create the core daemon, the package maintainers are really filling it with life, making it available to the average user. I am very grateful for that!</p> -<p>This list has last been updated on 2007-07-06 by +<p>This list has last been updated on 2008-07-11 by <a href="http://www.adiscon.com/en/people/rainer-gerhards.php">Rainer Gerhards</a>. New packages may appear at any time, so be sure to check this page whenever you need a new one.</p> -<p>Red Hat has recently begun to build RPMs for rsyslog. The URL changes, but a -good place to look for them is at -<a href="http://freshmeat.net/projects/rsyslog/">freshmeat's rsyslog info page</a>. -Please note that the Red Hat RPMs do currently <b>not</b> include MySQL -functionality. If you need that, you need to compile from the source tarball -(which honestly is quite easy).</p> -<h2>BSD</h2> -<p>Give <a href="http://www.freshports.org/sysutils/rsyslog/"> -http://www.freshports.org/sysutils/rsyslog/</a> a try.</p> - -<h2>CentOS 4.3</h2> -<a href="http://www.se-community.com/~james/rsyslog/"> -http://www.se-community.com/~james/rsyslog/</a></p> -<p>Maintained by<b> James Bergamin.</b></p> - -<h2>openSUSE</h2> -<a href="http://download.opensuse.org/repositories/home:/darix/"> -http://download.opensuse.org/repositories/home:/darix/</a></p> -<p>Maintained by<b> darix</b></p> - -<h2>Almost any Linux</h2> -<p><b>Bennet Todd</b> maintains packages that should work on almost any Linux. +<ul> +<li><b>BSD</b> (maintained by infofarmer) + <ul> + <li><a href="http://www.freshports.org/sysutils/rsyslog/"> http://www.freshports.org/sysutils/rsyslog/</a> + </ul> + +<li><b>CentOS 4.3</b> (maintained by James Bergamin) + <ul> + <li><a href="http://www.se-community.com/~james/rsyslog/"> +http://www.se-community.com/~james/rsyslog/</a> + </ul> + +<li><b>Debian</b> (maintained by Michael Biebl) + <ul> + <li><a href="http://packages.debian.org/sid/rsyslog">http://packages.debian.org/sid/rsyslog</a> + </ul> + +<li><b>Fedora</b> + <ul> + <li>Starting with Fedora 8, rsyslog is available as part of the core distribution. + </ul> + +<li><b>openSUSE</b> (maintained by darix) + <ul> + <li><a href="http://download.opensuse.org/repositories/home:/darix/">http://download.opensuse.org/repositories/home:/darix/</a> + </ul> + +<li><b>Red Hat Enterprise Linux</b> + <ul> + <li>Starting with RHEL 5.2, rsyslog is available as part of the core distribution. + </ul> + +<li><b>Ubuntu</b> + <ul> + <li>Starting with hardy, rsyslog is available from the universe repository. + </ul> + +<li>Almost any Linux</h2> + <ul> + <li>Bennet Todd maintains packages that should work on almost any Linux. He keeps a current i386 tree. There is also a PPC tree, but that one is not paid -much attention for (anyhow, it is known to typically work well, too).</p> -<p>Please visit <a href="http://bent.latency.net/bent/"> +much attention for (anyhow, it is known to typically work well, too). +Please visit <a href="http://bent.latency.net/bent/"> http://bent.latency.net/bent/</a>, select the relevant tree and then do a search -for rsyslog.</p> +for rsyslog. +Please note, however, that as of this writing the versions in this repository +have been aged a bit. So it may be worth trying to find some other places first. + </ul> +</ul> + +<p>Just in case you are interested, the list of distribution is sorted by alphabetic order +of the distribution name. +<p>If you do not find a suitable package for your distribution, there is no reason +to panic. It is quite simple to install rsyslog from the source tarball, so you +should consider that. </body> </html> diff --git a/doc/status.html b/doc/status.html index bdb6cbff..90932fca 100644 --- a/doc/status.html +++ b/doc/status.html @@ -2,19 +2,21 @@ <html><head><title>rsyslog status page</title></head> <body> <h2>rsyslog status page</h2> -<p>This page reflects the status as of 2008-07-01.</p> +<p>This page reflects the status as of 2008-07-15.</p> <h2>Current Releases</h2> -<p><b>development:</b> 3.19.8 [2008-07-01] - -<a href="http://www.rsyslog.com/Article247.phtml">change log</a> - -<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-116.phtml">download</a> +<!-- no devel at this time! +<p><b>development:</b> 3.19.9 [2008-07-07] - +<a href="http://www.rsyslog.com/Article250.phtml">change log</a> - +<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-117.phtml">download</a> +--> -<br><b>beta:</b> 3.17.4 [2008-06-16] - -<a href="http://www.rsyslog.com/Article242.phtml">change log</a> - +<br><b>beta:</b> 3.19.10 [2008-07-15] - +<a href="http://www.rsyslog.com/Article256.phtml">change log</a> - <a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-109.phtml">download</a></p> -<p><b>v3 stable:</b> 3.16.2 [2008-06-25] - <a href="http://www.rsyslog.com/Article244.phtml">change log</a> - -<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-114.phtml">download</a> +<p><b>v3 stable:</b> 3.18.0 [2008-07-11] - <a href="http://www.rsyslog.com/Article254.phtml">change log</a> - +<a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-120.phtml">download</a> <br><b>v2 stable:</b> 2.0.5 [2008-05-15] - <a href="http://www.rsyslog.com/Article226.phtml">change log</a> - <a href="http://www.rsyslog.com/Downloads-req-viewdownloaddetails-lid-104.phtml">download</a> diff --git a/doc/troubleshoot.html b/doc/troubleshoot.html new file mode 100644 index 00000000..f2e9206b --- /dev/null +++ b/doc/troubleshoot.html @@ -0,0 +1,35 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><title>troubleshooting rsyslog</title></head> +<body> +<h2>troubleshooting rsyslog</h2> +<p><b>Having trouble with <a href="http://www.rsyslog.com">rsyslog</a>?</b> +This page provides some tips on where to look for help and what to do +if you need to ask for assistance. This page is continously being expanded. +<p>Useful troublehshooting ressources are: +<ul> +<li>The <a href="http://www.rsyslog.com/doc">rsyslog documentation</a> - note that the online version always covers +the most recent development version. However, there is a version-specific +doc set in each tarball. If you installed rsyslog from a package, there usually +is a rsyslog-doc package, that often needs to be installed separately. +<li>The <a href="http://wiki.rsyslog.com">rsyslog wiki</a> provides user tips and experiences. +</ul> +<p><b>Asking for Help</b> +<p>If you can't find the answer yourself, you should look at these places for +community help. +<ul> +<li>The <a href="http://kb.monitorware.com/rsyslog-f40.html">rsyslog forum</a>. This is +the preferred method of obtaining support. +<li>The <a href="http://lists.adiscon.net/mailman/listinfo/rsyslog">rsyslog mailing list</a>. +This is a low-volume list which occasional gets traffic spikes. +The mailing list is probably a good place for complex questions. +</ul> +<p>[<a href="manual.html">manual index</a>] +[<a href="http://www.rsyslog.com/">rsyslog site</a>]</p> +<p><font size="2">This documentation is part of the +<a href="http://www.rsyslog.com/">rsyslog</a> project.<br> +Copyright © 2008 by <a href="http://www.gerhards.net/rainer">Rainer Gerhards</a> and +<a href="http://www.adiscon.com/">Adiscon</a>. Released under the GNU GPL +version 2 or higher.</font></p> +</body> +</html> + diff --git a/plugins/immark/immark.c b/plugins/immark/immark.c index 0baff1de..bdca4d58 100644 --- a/plugins/immark/immark.c +++ b/plugins/immark/immark.c @@ -85,6 +85,8 @@ ENDrunInput BEGINwillRun CODESTARTwillRun + /* We set the global MarkInterval to what is configured here -- rgerhards, 2008-07-15 */ + MarkInterval = iMarkMessagePeriod; if(iMarkMessagePeriod == 0) iRet = RS_RET_NO_RUN; ENDwillRun diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c index 41c72879..71d6e797 100644 --- a/plugins/omrelp/omrelp.c +++ b/plugins/omrelp/omrelp.c @@ -164,7 +164,6 @@ CODESTARTdoAction /* forward */ ret = relpCltSendSyslog(pData->pRelpClt, (uchar*) pMsg, lenMsg); -RUNLOG_VAR("%d", ret); if(ret != RELP_RET_OK) { /* error! */ dbgprintf("error forwarding via relp, suspending\n"); diff --git a/rsyslog.conf b/rsyslog.conf index 331a202b..ce7d131a 100644 --- a/rsyslog.conf +++ b/rsyslog.conf @@ -1,6 +1,5 @@ -# for help with rsyslog configuration, visit -# http://www.rsyslog.com or the wiki at -# http://wiki.rsyslog.com +# if you experience problems, check +# http://www.rsyslog.com/troubleshoot for assistance # rsyslog v3: load input modules # If you do not load inputs, nothing happens! @@ -59,4 +58,3 @@ local7.* /var/log/boot.log # UDP Syslog Server: #$ModLoad imudp.so # provides UDP syslog reception #$UDPServerRun 514 # start a UDP syslog server at standard port 514 - diff --git a/runtime/msg.c b/runtime/msg.c index cf59f762..a5881f50 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -158,14 +158,40 @@ static void MsgLockingDummy(msg_t __attribute__((unused)) *pMsg) * where a message may be accessed by multiple threads. This implementation here * is the version for multiple concurrent acces. It initializes the locking * structures. + * TODO: change to an iRet interface! -- rgerhards, 2008-07-14 */ static void MsgPrepareEnqueueLockingCase(msg_t *pThis) { + int iErr; + BEGINfunc assert(pThis != NULL); - pthread_mutexattr_settype(&pThis->mutAttr, PTHREAD_MUTEX_RECURSIVE); + iErr = pthread_mutexattr_init(&pThis->mutAttr); + if(iErr != 0) { + dbgprintf("error initializing mutex attribute in %s:%d, trying to continue\n", + __FILE__, __LINE__); + } + iErr = pthread_mutexattr_settype(&pThis->mutAttr, PTHREAD_MUTEX_RECURSIVE); + if(iErr != 0) { + dbgprintf("ERROR setting mutex attribute to recursive in %s:%d, trying to continue " + "but we will probably either abort or hang soon\n", + __FILE__, __LINE__); + /* TODO: it makes very little sense to continue here, + * but it requires an iRet interface to gracefully shut + * down. We should do that over time. -- rgerhards, 2008-07-14 + */ + } pthread_mutex_init(&pThis->mut, &pThis->mutAttr); + + /* we do no longer need the attribute. According to the + * POSIX spec, we can destroy it without affecting the + * initialized mutex (that used the attribute). + * rgerhards, 2008-07-14 + */ + pthread_mutexattr_destroy(&pThis->mutAttr); + ENDfunc } + /* ... and now the locking and unlocking implementations: */ static void MsgLockLockingCase(msg_t *pThis) { @@ -200,11 +226,12 @@ static void MsgDeleteMutexLockingCase(msg_t *pThis) */ rsRetVal MsgEnableThreadSafety(void) { + DEFiRet; funcLock = MsgLockLockingCase; funcUnlock = MsgUnlockLockingCase; funcMsgPrepareEnqueue = MsgPrepareEnqueueLockingCase; funcDeleteMutex = MsgDeleteMutexLockingCase; - return RS_RET_OK; + RETiRet; } /* end locking functions */ @@ -652,19 +679,23 @@ char *getMSG(msg_t *pM) /* Get PRI value in text form */ char *getPRI(msg_t *pM) { + int pri; + if(pM == NULL) return ""; MsgLock(pM); if(pM->pszPRI == NULL) { - /* OK, we need to construct it... - * we use a 5 byte buffer - as of - * RFC 3164, it can't be longer. Should it - * still be, snprintf will truncate... + /* OK, we need to construct it... we use a 5 byte buffer - as of + * RFC 3164, it can't be longer. Should it still be, snprintf will truncate... + * Note that we do not use the LOG_MAKEPRI macro. This macro + * is a simple add of the two values under FreeBSD 7. So we implement + * the logic in our own code. This is a change from a bug + * report. -- rgerhards, 2008-07-14 */ + pri = pM->iFacility * 8 + pM->iSeverity; if((pM->pszPRI = malloc(5)) == NULL) return ""; - pM->iLenPRI = snprintf((char*)pM->pszPRI, 5, "%d", - LOG_MAKEPRI(pM->iFacility, pM->iSeverity)); + pM->iLenPRI = snprintf((char*)pM->pszPRI, 5, "%d", pri); } MsgUnlock(pM); diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c index 3f2817f7..08623da8 100644 --- a/runtime/nsd_gtls.c +++ b/runtime/nsd_gtls.c @@ -1394,7 +1394,10 @@ AcceptConnReq(nsd_t *pNsd, nsd_t **ppNew) if(gnuRet == GNUTLS_E_AGAIN || gnuRet == GNUTLS_E_INTERRUPTED) { pNew->rtryCall = gtlsRtry_handshake; dbgprintf("GnuTLS handshake does not complete immediately - setting to retry (this is OK and normal)\n"); - } else if(gnuRet != 0) { + } else if(gnuRet == 0) { + /* we got a handshake, now check authorization */ + CHKiRet(gtlsChkPeerAuth(pNew)); + } else { ABORT_FINALIZE(RS_RET_TLS_HANDSHAKE_ERR); } diff --git a/runtime/nsdsel_gtls.c b/runtime/nsdsel_gtls.c index 81b90a62..c3a93bee 100644 --- a/runtime/nsdsel_gtls.c +++ b/runtime/nsdsel_gtls.c @@ -91,7 +91,6 @@ Add(nsdsel_t *pNsdsel, nsd_t *pNsd, nsdsel_waitOp_t waitOp) /* if we reach this point, we need no special handling */ CHKiRet(nsdsel_ptcp.Add(pThis->pTcp, pNsdGTLS->pTcp, waitOp)); -RUNLOG_VAR("%d", pThis->iBufferRcvReady); finalize_it: RETiRet; } @@ -107,7 +106,6 @@ Select(nsdsel_t *pNsdsel, int *piNumReady) nsdsel_gtls_t *pThis = (nsdsel_gtls_t*) pNsdsel; ISOBJ_TYPE_assert(pThis, nsdsel_gtls); -RUNLOG_VAR("%d", pThis->iBufferRcvReady); if(pThis->iBufferRcvReady > 0) { /* we still have data ready! */ *piNumReady = pThis->iBufferRcvReady; diff --git a/runtime/queue.c b/runtime/queue.c index 24fcee10..00f811a0 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -815,8 +815,8 @@ static rsRetVal qConstructDisk(queue_t *pThis) * for example file name generation must not be changed as that would break the * ability to read existing queue files. -- rgerhards, 2008-01-12 */ -CHKiRet(strmSetiMaxFileSize(pThis->tVars.disk.pWrite, pThis->iMaxFileSize)); -CHKiRet(strmSetiMaxFileSize(pThis->tVars.disk.pRead, pThis->iMaxFileSize)); + CHKiRet(strmSetiMaxFileSize(pThis->tVars.disk.pWrite, pThis->iMaxFileSize)); + CHKiRet(strmSetiMaxFileSize(pThis->tVars.disk.pRead, pThis->iMaxFileSize)); finalize_it: RETiRet; @@ -849,6 +849,12 @@ static rsRetVal qAddDisk(queue_t *pThis, void* pUsr) pThis->tVars.disk.sizeOnDisk += nWriteCount; + /* we have enqueued the user element to disk. So we now need to destruct + * the in-memory representation. The instance will be re-created upon + * dequeue. -- rgerhards, 2008-07-09 + */ + objDestruct(pUsr); + dbgoprint((obj_t*) pThis, "write wrote %lld octets to disk, queue disk size now %lld octets\n", nWriteCount, pThis->tVars.disk.sizeOnDisk); @@ -2080,10 +2086,6 @@ finalize_it: /* enqueue a new user data element * Enqueues the new element and awakes worker thread. - * TODO: this code still uses the "discard if queue full" approach from - * the main queue. This needs to be reconsidered or, better, done via a - * caller-selectable parameter mode. For the time being, I leave it in. - * rgerhards, 2008-01-03 */ rsRetVal queueEnqObj(queue_t *pThis, flowControl_t flowCtlType, void *pUsr) @@ -2164,21 +2166,6 @@ queueEnqObj(queue_t *pThis, flowControl_t flowCtlType, void *pUsr) } } -#if 0 // previous code, remove when done with advanced flow control - /* wait for the queue to be ready... */ - while( (pThis->iMaxQueueSize > 0 && pThis->iQueueSize >= pThis->iMaxQueueSize) - || (pThis->qType == QUEUETYPE_DISK && pThis->sizeOnDiskMax != 0 - && pThis->tVars.disk.sizeOnDisk > pThis->sizeOnDiskMax)) { - dbgoprint((obj_t*) pThis, "enqueueMsg: queue FULL - waiting to drain.\n"); - timeoutComp(&t, pThis->toEnq); - if(pthread_cond_timedwait(&pThis->notFull, pThis->mut, &t) != 0) { - dbgoprint((obj_t*) pThis, "enqueueMsg: cond timeout, dropping message!\n"); - objDestruct(pUsr); - ABORT_FINALIZE(RS_RET_QUEUE_FULL); - } - } -#endif - /* and finally enqueue the message */ CHKiRet(queueAdd(pThis, pUsr)); queueChkPersist(pThis); diff --git a/runtime/vm.c b/runtime/vm.c index bcd331ec..bc6c3dd2 100644 --- a/runtime/vm.c +++ b/runtime/vm.c @@ -198,7 +198,6 @@ CODESTARTop(CMP_CONTAINS) bRes = (rsCStrLocateInSzStr(operand2->val.pStr, rsCStrGetSzStr(operand1->val.pStr)) == -1) ? 0 : 1; /* we have a result, so let's push it */ -RUNLOG_VAR("%lld", bRes); \ PUSHRESULTop(operand1, bRes); var.Destruct(&operand2); /* no longer needed */ ENDop(CMP_CONTAINS) @@ -218,7 +217,6 @@ var.DebugPrint(operand2); \ bRes = (rsCStrCaseInsensitiveLocateInSzStr(operand2->val.pStr, rsCStrGetSzStr(operand1->val.pStr)) == -1) ? 0 : 1; /* we have a result, so let's push it */ -RUNLOG_VAR("%lld", bRes); \ PUSHRESULTop(operand1, bRes); var.Destruct(&operand2); /* no longer needed */ ENDop(CMP_CONTAINSI) @@ -237,7 +235,6 @@ CODESTARTop(CMP_STARTSWITH) rsCStrLen(operand2->val.pStr)) == 0) ? 1 : 0; /* we have a result, so let's push it */ -RUNLOG_VAR("%lld", bRes); \ PUSHRESULTop(operand1, bRes); var.Destruct(&operand2); /* no longer needed */ ENDop(CMP_STARTSWITH) diff --git a/tools/omfwd.c b/tools/omfwd.c index 715457c9..30761a87 100644 --- a/tools/omfwd.c +++ b/tools/omfwd.c @@ -334,9 +334,10 @@ finalize_it: */ static rsRetVal doTryResume(instanceData *pData) { - DEFiRet; + int iErr; struct addrinfo *res; struct addrinfo hints; + DEFiRet; if(pData->bIsConnected) FINALIZE; @@ -348,8 +349,10 @@ static rsRetVal doTryResume(instanceData *pData) /* port must be numeric, because config file syntax requires this */ hints.ai_flags = AI_NUMERICSERV; hints.ai_family = glbl.GetDefPFFamily(); - hints.ai_socktype = pData->protocol == SOCK_DGRAM; - if((getaddrinfo(pData->f_hname, getFwdPt(pData), &hints, &res)) != 0) { + hints.ai_socktype = SOCK_DGRAM; + if((iErr = (getaddrinfo(pData->f_hname, getFwdPt(pData), &hints, &res))) != 0) { + dbgprintf("could not get addrinfo for hostname '%s':'%s': %d%s\n", + pData->f_hname, getFwdPt(pData), iErr, gai_strerror(iErr)); ABORT_FINALIZE(RS_RET_SUSPENDED); } dbgprintf("%s found, resuming.\n", pData->f_hname); diff --git a/tools/rsyslogd.8 b/tools/rsyslogd.8 index 2aa911d9..a1395d73 100644 --- a/tools/rsyslogd.8 +++ b/tools/rsyslogd.8 @@ -266,7 +266,7 @@ Disabling inet domain sockets will limit risk to the local machine. If remote logging is enabled, messages can easily be spoofed and replayed. As the messages are transmitted in clear-text, an attacker might use the information obtained from the packets for malicious things. Also, an -attacker might reply recorded messages or spoof a sender's IP address, +attacker might replay recorded messages or spoof a sender's IP address, which could lead to a wrong perception of system activity. These can be prevented by using GSS-API authentication and encryption. Be sure to think about syslog network security before enabling it. @@ -310,7 +310,7 @@ following options possible (all are case insensitive): .IP LogFuncFlow Print out the logical flow of functions (entering and exiting them) .IP FileTrace -Ppecifies which files to trace LogFuncFlow. If not set (the +Specifies which files to trace LogFuncFlow. If not set (the default), a LogFuncFlow trace is provided for all files. Set to limit it to the files specified.FileTrace may be specified multiple times, one file each (e.g. export RSYSLOG_DEBUG="LogFuncFlow diff --git a/tools/syslogd.c b/tools/syslogd.c index dda605a8..3f97a70f 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -1601,7 +1601,7 @@ logmsg(msg_t *pMsg, int flags) assert(pMsg != NULL); assert(pMsg->pszUxTradMsg != NULL); msg = (char*) pMsg->pszUxTradMsg; - dbgprintf("logmsg: flags %x, from '%s', msg %s\n", flags, getRcvFrom(pMsg), msg); + dbgprintf("logmsg: flags %x, pri %s, from '%s', msg %s\n", flags, getPRI(pMsg), getRcvFrom(pMsg), msg); /* rger 2005-11-24 (happy thanksgiving!): we now need to check if we have * a traditional syslog message or one formatted according to syslog-protocol. |