diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-10-21 14:47:18 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-10-21 14:47:18 +0200 |
commit | f3d4d83ce5a921899775eb59997d9d954b2f423d (patch) | |
tree | bb4af3cf3eea8733efa7ffd29586e23b54f1ff23 | |
parent | bb293ca32a1b9750d53e9d6fdcf21a9d6d7c697d (diff) | |
parent | 5d67d98c35da731eab933dbfd858a0e009aa58de (diff) | |
download | rsyslog-f3d4d83ce5a921899775eb59997d9d954b2f423d.tar.gz rsyslog-f3d4d83ce5a921899775eb59997d9d954b2f423d.tar.xz rsyslog-f3d4d83ce5a921899775eb59997d9d954b2f423d.zip |
Merge branch 'v5-stable' into beta
Conflicts:
ChangeLog
configure.ac
doc/manual.html
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | parse.c | 18 | ||||
-rw-r--r-- | parse.h | 2 | ||||
-rw-r--r-- | runtime/conf.c | 2 | ||||
-rw-r--r-- | runtime/rsyslog.h | 1 | ||||
-rw-r--r-- | tools/omfile.c | 5 |
6 files changed, 22 insertions, 9 deletions
@@ -239,7 +239,8 @@ Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-03-?? affected directive was: $ActionExecOnlyWhenPreviousIsSuspended on closes: http://bugzilla.adiscon.com/show_bug.cgi?id=236 --------------------------------------------------------------------------- -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 @@ -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 @@ -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 1d28a884..b324e125 100644 --- a/runtime/conf.c +++ b/runtime/conf.c @@ -941,7 +941,7 @@ dbgprintf("XXX: fiop is %u\n", (unsigned) f->f_filterData.prop.operation); } /* 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 372453ce..04d14212 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -351,6 +351,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 */ 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/tools/omfile.c b/tools/omfile.c index d4e8c20b..5a8848e6 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -602,9 +602,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); } |