summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-10-21 15:03:53 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-10-21 15:03:53 +0200
commite7701775553a60efb050b0df497bb4df5df46d62 (patch)
tree5e8183f6bbb33e106624e8c9d9c3eab7a7006de9
parent359ddad3c5dce82ab48964c1d8b804c4155ea39c (diff)
parent12102199c4b3a042fb91e1d52eb274f06e62213e (diff)
downloadrsyslog-e7701775553a60efb050b0df497bb4df5df46d62.tar.gz
rsyslog-e7701775553a60efb050b0df497bb4df5df46d62.tar.xz
rsyslog-e7701775553a60efb050b0df497bb4df5df46d62.zip
Merge branch 'v5-devel'
Conflicts: ChangeLog
-rw-r--r--ChangeLog7
-rw-r--r--doc/property_replacer.html4
-rw-r--r--doc/rsyslog_recording_pri.html6
-rw-r--r--parse.c18
-rw-r--r--parse.h2
-rw-r--r--runtime/conf.c2
-rw-r--r--runtime/nsd_gtls.c6
-rw-r--r--runtime/rsyslog.h3
-rw-r--r--runtime/stream.c2
-rw-r--r--tests/tcpflood.c6
-rw-r--r--tools/omfile.c5
11 files changed, 42 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index fa3c8f23..cf8eb724 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -310,6 +310,8 @@ expected that interfaces, even new ones, break during the initial
[ported from v4]
---------------------------------------------------------------------------
Version 5.9.4 [V5-DEVEL], 2011-0?-??
+- removed dependency on gcrypt for recently-enough GnuTLS
+ see: http://bugzilla.adiscon.com/show_bug.cgi?id=289
- bugfix: imuxsock did no longer ignore message-provided timestamp, if
so configured (the *default*). Lead to no longer sub-second timestamps.
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=281
@@ -402,8 +404,9 @@ Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-06-08
affected directive was: $ActionExecOnlyWhenPreviousIsSuspended on
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=236
---------------------------------------------------------------------------
-Version 5.8.6 [V5-stable] (rgerhards/al), 2011-??-??
-Version 5.8.6 [V5-stable] 2011-??-??
+Version 5.8.6 [V5-stable] 2011-10-21
+- bugfix: missing whitespace after property-based filter was not detected
+- bugfix: $OMFileFlushInterval period was doubled - now using correct value
- bugfix: ActionQueue could malfunction due to index error
Thanks to Vlad Grigorescu for the patch
- bugfix: $ActionExecOnlyOnce interval did not work properly
diff --git a/doc/property_replacer.html b/doc/property_replacer.html
index 57592fd1..c4af094c 100644
--- a/doc/property_replacer.html
+++ b/doc/property_replacer.html
@@ -65,8 +65,8 @@ BSD syslogd. For example, when TAG is "named[12345]", programname is
</tr>
<tr>
<td><b>pri-text</b></td>
-<td>the PRI part of the message in a textual form (e.g.
-"syslog.info")</td>
+<td>the PRI part of the message in a textual form with the numerical PRI appended in
+brackes (e.g. "local0.err<133>")</td>
</tr>
<tr>
<td><b>iut</b></td>
diff --git a/doc/rsyslog_recording_pri.html b/doc/rsyslog_recording_pri.html
index cf11e3e5..a092980c 100644
--- a/doc/rsyslog_recording_pri.html
+++ b/doc/rsyslog_recording_pri.html
@@ -44,13 +44,13 @@ from the syslog message when output is written. Everything outside of the
percent signs is literal text, which is simply written as specified.</p>
<p>Thankfully, rsyslog provides message properties for the priority. These are
called &quot;PRI&quot;, &quot;syslogfacility&quot; and &quot;syslogpriority&quot; (case is important!). They are numerical
-values. Starting with rsyslog 1.13.4, there is also a property &quot;PRI-text&quot;, which
-contains the priority in friendly text format (e.g. &quot;syslog.info&quot;). For the rest
+values. Starting with rsyslog 1.13.4, there is also a property &quot;pri-text&quot;, which
+contains the priority in friendly text format (e.g. &quot;local0.err<133>&quot;). For the rest
of this article, I assume that you run version 1.13.4 or higher.</p>
<p>Recording the priority is now a simple matter of adding the respective field
to the template. It now looks like this:</p>
<p align="center">
-<code>$template TraditionalFormatWithPRI,&quot;%PRI-text%: %timegenerated% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n&quot;</code>
+<code>$template TraditionalFormatWithPRI,&quot;%pri-text%: %timegenerated% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n&quot;</code>
</p>
<p>Now we have the right template - but how to write it to a file? You probably
have a line like this in your syslog.conf:</p>
diff --git a/parse.c b/parse.c
index a156b317..729c8340 100644
--- a/parse.c
+++ b/parse.c
@@ -210,22 +210,32 @@ rsRetVal parsSkipAfterChar(rsParsObj *pThis, char c)
/* Skip whitespace. Often used to trim parsable entries.
* Returns with ParsePointer set to first non-whitespace
* character (or at end of string).
+ * If bRequireOne is set to true, at least one whitespace
+ * must exist, else an error is returned.
*/
-rsRetVal parsSkipWhitespace(rsParsObj *pThis)
+rsRetVal parsSkipWhitespace(rsParsObj *pThis, sbool bRequireOne)
{
register unsigned char *pC;
+ int numSkipped;
+ DEFiRet;
+
rsCHECKVALIDOBJECT(pThis, OIDrsPars);
pC = rsCStrGetBufBeg(pThis->pCStr);
+ numSkipped = 0;
while(pThis->iCurrPos < rsCStrLen(pThis->pCStr)) {
if(!isspace((int)*(pC+pThis->iCurrPos)))
break;
++pThis->iCurrPos;
+ ++numSkipped;
}
- return RS_RET_OK;
+ if(bRequireOne && numSkipped == 0)
+ iRet = RS_RET_MISSING_WHITESPACE;
+
+ RETiRet;
}
/* Parse string up to a delimiter.
@@ -253,7 +263,7 @@ rsRetVal parsDelimCStr(rsParsObj *pThis, cstr_t **ppCStr, char cDelim, int bTrim
CHKiRet(rsCStrConstruct(&pCStr));
if(bTrimLeading)
- parsSkipWhitespace(pThis);
+ parsSkipWhitespace(pThis, 0);
pC = rsCStrGetBufBeg(pThis->pCStr) + pThis->iCurrPos;
@@ -384,7 +394,7 @@ rsRetVal parsAddrWithBits(rsParsObj *pThis, struct NetAddr **pIP, int *pBits)
CHKiRet(cstrConstruct(&pCStr));
- parsSkipWhitespace(pThis);
+ parsSkipWhitespace(pThis, 0);
pC = rsCStrGetBufBeg(pThis->pCStr) + pThis->iCurrPos;
/* we parse everything until either '/', ',' or
diff --git a/parse.h b/parse.h
index 0fe2bb74..fb62d1ec 100644
--- a/parse.h
+++ b/parse.h
@@ -77,7 +77,7 @@ rsRetVal rsParsAssignString(rsParsObj *pThis, cstr_t *pCStr);
rsRetVal parsInt(rsParsObj *pThis, int* pInt);
/* Skip whitespace. Often used to trim parsable entries. */
-rsRetVal parsSkipWhitespace(rsParsObj *pThis);
+rsRetVal parsSkipWhitespace(rsParsObj *pThis, sbool bRequireOne);
/* Parse string up to a delimiter.
*
diff --git a/runtime/conf.c b/runtime/conf.c
index ec612ab8..fcb09bd5 100644
--- a/runtime/conf.c
+++ b/runtime/conf.c
@@ -601,7 +601,7 @@ rsRetVal cflineProcessPropFilter(uchar **pline, register rule_t *f)
}
/* skip to action part */
- if((iRet = parsSkipWhitespace(pPars)) != RS_RET_OK) {
+ if((iRet = parsSkipWhitespace(pPars, 1)) != RS_RET_OK) {
errmsg.LogError(0, iRet, "error %d skipping to action part - ignoring selector", iRet);
rsParsDestruct(pPars);
return(iRet);
diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c
index cc8f78d1..17ac426b 100644
--- a/runtime/nsd_gtls.c
+++ b/runtime/nsd_gtls.c
@@ -29,7 +29,9 @@
#include <string.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
-#include <gcrypt.h>
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
+# include <gcrypt.h>
+#endif
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -561,7 +563,9 @@ gtlsGlblInit(void)
DEFiRet;
/* gcry_control must be called first, so that the thread system is correctly set up */
+ #if GNUTLS_VERSION_NUMBER <= 0x020b00
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+ #endif
CHKgnutls(gnutls_global_init());
/* X509 stuff */
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index 293aabbf..1ec00a85 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -352,7 +352,8 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_WRN_WRKDIR = -2182, /**< correctable problems with the rsyslog working directory */
RS_RET_ERR_QUEUE_EMERGENCY = -2183, /**< some fatal error caused queue to switch to emergency mode */
RS_RET_OUTDATED_STMT = -2184, /**< some outdated statement/functionality is being used in conf file */
- RS_RET_OK_WARN = -2185, /**< config part: everything was OK, but a warning message was emitted */
+ RS_RET_MISSING_WHITESPACE = -2185, /**< whitespace is missing in some config construct */
+ RS_RET_OK_WARN = -2186, /**< config part: everything was OK, but a warning message was emitted */
RS_RET_INVLD_CONF_OBJ= -2200, /**< invalid config object (e.g. $Begin conf statement) */
RS_RET_ERR_LIBEE_INIT = -2201, /**< cannot obtain libee ctx */
diff --git a/runtime/stream.c b/runtime/stream.c
index 0238d25e..6b88d3f4 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -1036,7 +1036,7 @@ asyncWriterThread(void *pPtr)
continue; /* now we should have data */
}
bTimedOut = 0;
- timeoutComp(&t, pThis->iFlushInterval * 2000); /* *1000 millisconds */ // TODO: check the 2000?!?
+ timeoutComp(&t, pThis->iFlushInterval * 1000); /* *1000 millisconds */
if(pThis->bDoTimedWait) {
if(pthread_cond_timedwait(&pThis->notEmpty, &pThis->mut, &t) != 0) {
int err = errno;
diff --git a/tests/tcpflood.c b/tests/tcpflood.c
index 8485acbb..8a34f06f 100644
--- a/tests/tcpflood.c
+++ b/tests/tcpflood.c
@@ -91,8 +91,10 @@
#include <errno.h>
#ifdef ENABLE_GNUTLS
# include <gnutls/gnutls.h>
-# include <gcrypt.h>
+# if GNUTLS_VERSION_NUMBER <= 0x020b00
+# include <gcrypt.h>
GCRY_THREAD_OPTION_PTHREAD_IMPL;
+# endif
#endif
#define EXIT_FAILURE 1
@@ -707,7 +709,9 @@ initTLS(void)
int r;
/* order of gcry_control and gnutls_global_init matters! */
+ #if GNUTLS_VERSION_NUMBER <= 0x020b00
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+ #endif
gnutls_global_init();
/* set debug mode, if so required by the options */
if(tlsLogLevel > 0) {
diff --git a/tools/omfile.c b/tools/omfile.c
index cad8ae80..05b82051 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -614,9 +614,10 @@ prepareDynFile(instanceData *pData, uchar *newFileName, unsigned iMsgOpts)
* news is that we also lose errors on startup messages, but so it is.
*/
if(iMsgOpts & INTERNAL_MSG) {
- DBGPRINTF("Could not open dynaFile, discarding message\n");
+ DBGPRINTF("Could not open dynaFile '%s', state %d, discarding message\n",
+ newFileName, localRet);
} else {
- errmsg.LogError(0, NO_ERRCODE, "Could not open dynamic file '%s' [state %d] - discarding message", newFileName, localRet);
+ errmsg.LogError(0, localRet, "Could not open dynamic file '%s' [state %d] - discarding message", newFileName, localRet);
}
ABORT_FINALIZE(localRet);
}