diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-10-17 15:26:11 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-10-17 15:26:11 +0200 |
commit | 16f06168e10d0315cc5d65516043809edd9d2232 (patch) | |
tree | 7d28755836998e5ff6a6a6f7ecea1fd0d9077a22 | |
parent | 0c7604dc27119122a3022c7bf094ffb5f8d59e6d (diff) | |
parent | f84c8c4e9637748bd3a6a985bd12afa6b50e9797 (diff) | |
download | rsyslog-16f06168e10d0315cc5d65516043809edd9d2232.tar.gz rsyslog-16f06168e10d0315cc5d65516043809edd9d2232.tar.xz rsyslog-16f06168e10d0315cc5d65516043809edd9d2232.zip |
Merge branch 'v5-stable' into v5-devel
Conflicts:
ChangeLog
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | action.c | 19 | ||||
-rw-r--r-- | doc/imklog.html | 2 | ||||
-rw-r--r-- | plugins/imfile/imfile.c | 4 | ||||
-rw-r--r-- | runtime/msg.c | 52 | ||||
-rw-r--r-- | runtime/stream.c | 10 | ||||
-rw-r--r-- | tests/tcpflood.c | 5 |
7 files changed, 82 insertions, 26 deletions
@@ -92,13 +92,25 @@ 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-??-?? +- bugfix: ActionQueue could malfunction due to index error + Thanks to Vlad Grigorescu for the patch +- bugfix: $ActionExecOnlyOnce interval did not work properly + Thanks to Tomas Heinrich for the patch +- bugfix: race condition when extracting program name, APPNAME, structured + data and PROCID (RFC5424 fields) could lead to invalid characters e.g. + in dynamic file names or during forwarding (general malfunction of these + fields in templates, mostly under heavy load) - 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 - bugfix: omfile returns fatal error code for things that go really wrong previously, RS_RET_RESUME was returned, which lead to a loop inside the rule engine as omfile could not really recover. +- bugfix: imfile did invalid system call under some circumstances + when a file that was to be monitored did not exist BUT the state file + actually existed. Mostly a cosmetic issue. Root cause was incomplete + error checking in stream.c; so patch may affect other code areas. - bugfix: rsyslogd -v always said 64 atomics were not present thanks to mono_matsuko for the patch --------------------------------------------------------------------------- @@ -920,6 +932,8 @@ increase. output module interface --------------------------------------------------------------------------- Version 4.8.1 [v4-beta], 2011-09-?? +- bugfix: $ActionExecOnlyOnce interval did not work properly + Thanks to Tomas Heinrich for the patch - bugfix: potential abort if ultra-large file io buffers are used and dynafile cache exhausts address space (primarily a problem on 32 bit platforms) @@ -772,7 +772,7 @@ finalize_it: */ static rsRetVal releaseBatch(action_t *pAction, batch_t *pBatch) { - int iArr; + int jArr; int i, j; batch_obj_t *pElem; uchar ***ppMsgs; @@ -786,15 +786,15 @@ static rsRetVal releaseBatch(action_t *pAction, batch_t *pBatch) switch(pAction->eParamPassing) { case ACT_ARRAY_PASSING: ppMsgs = (uchar***) pElem->staticActParams; - for(i = 0 ; i < pAction->iNumTpls ; ++i) { - if(((uchar**)ppMsgs)[i] != NULL) { - iArr = 0; - while(ppMsgs[i][iArr] != NULL) { - d_free(ppMsgs[i][iArr++]); - ppMsgs[i][iArr++] = NULL; + for(j = 0 ; j < pAction->iNumTpls ; ++j) { + if(((uchar**)ppMsgs)[j] != NULL) { + jArr = 0; + while(ppMsgs[j][jArr] != NULL) { + d_free(ppMsgs[j][jArr++]); + ppMsgs[j][jArr++] = NULL; } - d_free(((uchar**)ppMsgs)[i]); - ((uchar**)ppMsgs)[i] = NULL; + d_free(((uchar**)ppMsgs)[j]); + ((uchar**)ppMsgs)[j] = NULL; } } break; @@ -1368,7 +1368,6 @@ actionWriteToAction(action_t *pAction) DBGPRINTF("action not yet ready again to be executed, onceInterval %d, tCurr %d, tNext %d\n", (int) pAction->iSecsExecOnceInterval, (int) getActNow(pAction), (int) (pAction->iSecsExecOnceInterval + pAction->tLastExec)); - pAction->tLastExec = getActNow(pAction); /* re-init time flags */ FINALIZE; } diff --git a/doc/imklog.html b/doc/imklog.html index 5bfab5ce..f273753f 100644 --- a/doc/imklog.html +++ b/doc/imklog.html @@ -65,6 +65,8 @@ Linux only, ignored on other platforms (but may be specified)<br style="font-wei <p>This is obviously platform specific and requires platform drivers. Currently, imklog functionality is available on Linux and BSD.</p> +<p>This module is <b>not supported on Solaris</b> and not needed there. +For Solaris kernel input, use <a href="imsolaris.html">imsolaris</a>.</p> <p><b>Sample:</b></p> <p>The following sample pulls messages from the kernel log. All parameters are left by default, which is usually a good idea. Please diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c index 9bc84220..f1639f15 100644 --- a/plugins/imfile/imfile.c +++ b/plugins/imfile/imfile.c @@ -153,10 +153,10 @@ openFile(fileInfo_t *pThis) /* check if the file exists */ if(stat((char*) pszSFNam, &stat_buf) == -1) { if(errno == ENOENT) { - /* currently no object! dbgoprint((obj_t*) pThis, "clean startup, no .si file found\n"); */ + dbgprintf("filemon %p: clean startup, no .si file found\n", pThis); ABORT_FINALIZE(RS_RET_FILE_NOT_FOUND); } else { - /* currently no object! dbgoprint((obj_t*) pThis, "error %d trying to access .si file\n", errno); */ + dbgprintf("filemon %p: error %d trying to access .si file\n", pThis, errno); ABORT_FINALIZE(RS_RET_IO_ERROR); } } diff --git a/runtime/msg.c b/runtime/msg.c index 7cc588b7..0744edd5 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -1605,9 +1605,19 @@ static inline int getPROCIDLen(msg_t *pM, sbool bLockMutex) */ char *getPROCID(msg_t *pM, sbool bLockMutex) { + uchar *pszRet; + ISOBJ_TYPE_assert(pM, msg); - preparePROCID(pM, bLockMutex); - return (pM->pCSPROCID == NULL) ? "-" : (char*) cstrGetSzStrNoNULL(pM->pCSPROCID); + if(bLockMutex == LOCK_MUTEX) + MsgUnlock(pM); + preparePROCID(pM, MUTEX_ALREADY_LOCKED); + if(pM->pCSPROCID == NULL) + pszRet = UCHAR_CONSTANT(""); + else + pszRet = rsCStrGetSzStrNoNULL(pM->pCSPROCID); + if(bLockMutex == LOCK_MUTEX) + MsgUnlock(pM); + return (char*) pszRet; } @@ -1834,7 +1844,15 @@ static int getStructuredDataLen(msg_t *pM) */ static inline char *getStructuredData(msg_t *pM) { - return (pM->pCSStrucData == NULL) ? "-" : (char*) rsCStrGetSzStrNoNULL(pM->pCSStrucData); + uchar *pszRet; + + MsgUnlock(pM); + if(pM->pCSStrucData == NULL) + pszRet = UCHAR_CONSTANT("-"); + else + pszRet = rsCStrGetSzStrNoNULL(pM->pCSStrucData); + MsgUnlock(pM); + return (char*) pszRet; } @@ -1873,8 +1891,18 @@ int getProgramNameLen(msg_t *pM, sbool bLockMutex) */ uchar *getProgramName(msg_t *pM, sbool bLockMutex) { - prepareProgramName(pM, bLockMutex); - return (pM->pCSProgName == NULL) ? UCHAR_CONSTANT("") : rsCStrGetSzStrNoNULL(pM->pCSProgName); + uchar *pszRet; + + if(bLockMutex == LOCK_MUTEX) + MsgUnlock(pM); + prepareProgramName(pM, MUTEX_ALREADY_LOCKED); + if(pM->pCSProgName == NULL) + pszRet = UCHAR_CONSTANT(""); + else + pszRet = rsCStrGetSzStrNoNULL(pM->pCSProgName); + if(bLockMutex == LOCK_MUTEX) + MsgUnlock(pM); + return pszRet; } @@ -1920,9 +1948,19 @@ static inline void prepareAPPNAME(msg_t *pM, sbool bLockMutex) */ char *getAPPNAME(msg_t *pM, sbool bLockMutex) { + uchar *pszRet; + assert(pM != NULL); - prepareAPPNAME(pM, bLockMutex); - return (pM->pCSAPPNAME == NULL) ? "" : (char*) rsCStrGetSzStrNoNULL(pM->pCSAPPNAME); + if(bLockMutex == LOCK_MUTEX) + MsgUnlock(pM); + prepareAPPNAME(pM, MUTEX_ALREADY_LOCKED); + if(pM->pCSAPPNAME == NULL) + pszRet = UCHAR_CONSTANT(""); + else + pszRet = rsCStrGetSzStrNoNULL(pM->pCSAPPNAME); + if(bLockMutex == LOCK_MUTEX) + MsgUnlock(pM); + return (char*)pszRet; } /* rgerhards, 2005-11-24 diff --git a/runtime/stream.c b/runtime/stream.c index ae716815..0238d25e 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -1276,16 +1276,18 @@ static rsRetVal strmSeek(strm_t *pThis, off64_t offs) ISOBJ_TYPE_assert(pThis, strm); - if(pThis->fd == -1) - strmOpenFile(pThis); - else - strmFlushInternal(pThis); + if(pThis->fd == -1) { + CHKiRet(strmOpenFile(pThis)); + } else { + CHKiRet(strmFlushInternal(pThis)); + } long long i; DBGOPRINT((obj_t*) pThis, "file %d seek, pos %llu\n", pThis->fd, (long long unsigned) offs); i = lseek64(pThis->fd, offs, SEEK_SET); // TODO: check error! pThis->iCurrOffs = offs; /* we are now at *this* offset */ pThis->iBufPtr = 0; /* buffer invalidated */ +finalize_it: RETiRet; } diff --git a/tests/tcpflood.c b/tests/tcpflood.c index 49b1e9e6..8485acbb 100644 --- a/tests/tcpflood.c +++ b/tests/tcpflood.c @@ -797,7 +797,7 @@ closeTLSSess(int i) # else /* NO TLS available */ static void initTLS(void) {} static void initTLSSess(int __attribute__((unused)) i) {} -static int sendTLS(int i, char *buf, int lenBuf) { return 0; } +static int sendTLS(int __attribute__((unused)) i, char __attribute__((unused)) *buf, int __attribute__((unused)) lenBuf) { return 0; } static void closeTLSSess(int __attribute__((unused)) i) {} # endif @@ -889,7 +889,8 @@ int main(int argc, char *argv[]) # if defined(ENABLE_GNUTLS) transport = TP_TLS; # else - fprintf(stderr, "compiled without TLS support!\n", optarg); + fprintf(stderr, "compiled without TLS support: " + "\"-Ttls\" not supported!\n"); exit(1); # endif } else { |