From ce315e5da3b33b107633adad0bcc0fd5fc26d198 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Thu, 20 Oct 2011 14:26:51 +0200
Subject: minor: slightly improved error reporting when dynafile open fails
---
tools/omfile.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/omfile.c b/tools/omfile.c
index 55801d40..c49a6cd2 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -590,9 +590,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);
}
--
cgit v1.2.3
From 10947b3f4a762ff6f1c2687bc1b4a2f33d7b6510 Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Fri, 21 Oct 2011 14:05:59 +0200
Subject: bugfix: missing whitespace after property-based filter was not
detected
---
ChangeLog | 1 +
parse.c | 18 ++++++++++++++----
parse.h | 2 +-
runtime/conf.c | 2 +-
runtime/rsyslog.h | 1 +
5 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 35de07e6..a6f58751 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
---------------------------------------------------------------------------
Version 5.8.6 [V5-stable] 2011-??-??
+- 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
diff --git a/parse.c b/parse.c
index e335d423..4c9c27c7 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.
@@ -252,7 +262,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;
@@ -383,7 +393,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 529142ed..8e885a1d 100644
--- a/runtime/conf.c
+++ b/runtime/conf.c
@@ -924,7 +924,7 @@ static 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/rsyslog.h b/runtime/rsyslog.h
index f14e0724..69b3c8d1 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -344,6 +344,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_ERR_WRKDIR = -2181, /**< problems with the rsyslog working directory */
RS_RET_WRN_WRKDIR = -2182, /**< correctable problems with the rsyslog working directory */
RS_RET_OUTDATED_STMT = -2184, /**< some outdated statement/functionality is being used in conf file */
+ RS_RET_MISSING_WHITESPACE = -2185, /**< whitespace is missing in some config construct */
/* RainerScript error messages (range 1000.. 1999) */
RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */
--
cgit v1.2.3
From 5d67d98c35da731eab933dbfd858a0e009aa58de Mon Sep 17 00:00:00 2001
From: Rainer Gerhards
Date: Fri, 21 Oct 2011 14:23:13 +0200
Subject: preparing for 5.8.6 release
---
ChangeLog | 2 +-
configure.ac | 2 +-
doc/manual.html | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a6f58751..67d793ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,5 @@
---------------------------------------------------------------------------
-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
diff --git a/configure.ac b/configure.ac
index 8ee24249..5a77a8a6 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],[5.8.5],[rsyslog@lists.adiscon.com])
+AC_INIT([rsyslog],[5.8.6],[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 79520992..34de4b2b 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -19,7 +19,7 @@ rsyslog support 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 5.8.5 (v5-stable branch) of rsyslog.
+
This documentation is for version 5.8.6 (v5-stable 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