summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog49
-rw-r--r--action.c19
-rw-r--r--doc/imklog.html2
-rw-r--r--plugins/imfile/imfile.c4
-rw-r--r--runtime/msg.c52
-rw-r--r--runtime/stream.c10
-rw-r--r--tests/tcpflood.c5
7 files changed, 103 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index 78979103..fa3c8f23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@ Version 6.3.7 [DEVEL] 2011-0?-??
- bugfix: facility local<x> was not correctly interpreted in legacy filters
Was only accepted if it was the first PRI in a multi-filter PRI.
Thanks to forum user Mark for bringing this to our attention.
+- 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
@@ -70,6 +74,23 @@ Version 6.3.2 [DEVEL] (rgerhards), 2011-07-06
This leak is tied to error conditions which lead to incorrect cleanup
of some data structures.
---------------------------------------------------------------------------
+Version 6.3.1 [DEVEL] (rgerhards), 2011-06-07
+- added a first implementation of a DNS name cache
+ this still has a couple of weaknesses, like no expiration of entries,
+ suboptimal algorithms -- but it should perform much better than
+ what we had previously. Implementation will be improved based on
+ feedback during the next couple of releases
+---------------------------------------------------------------------------
+Version 6.3.0 [DEVEL] (rgerhards), 2011-06-01
+- introduced new config system
+ http://blog.gerhards.net/2011/06/new-rsyslog-config-system-materializes.html
+---------------------------------------------------------------------------
+Version 6.2.0 [v6-stable], 2011-0?-??
+- 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)
+---------------------------------------------------------------------------
Version 6.1.12 [BETA], 2011-09-01
- bugfix/security: off-by-two bug in legacy syslog parser, CVE-2011-3200
- bugfix: mark message processing did not work correctly
@@ -111,19 +132,6 @@ Version 6.1.9 [BETA] (rgerhards), 2011-06-14
this via a testbench test, not a user report. But I assume that some
users may have had unreproducable aborts that were cause by this bug.
- bugfix/improvement:$WorkDirectory now gracefully handles trailing slashes
----------------------------------------------------------------------------
-Version 6.3.1 [DEVEL] (rgerhards), 2011-06-07
-- added a first implementation of a DNS name cache
- this still has a couple of weaknesses, like no expiration of entries,
- suboptimal algorithms -- but it should perform much better than
- what we had previously. Implementation will be improved based on
- feedback during the next couple of releases
----------------------------------------------------------------------------
-Version 6.3.0 [DEVEL] (rgerhards), 2011-06-01
-- introduced new config system
- http://blog.gerhards.net/2011/06/new-rsyslog-config-system-materializes.html
----------------------------------------------------------------------------
-Version 6.1.9 [BETA] (rgerhards), 2011-06-14
- bugfix: memory leak in imtcp & subsystems under some circumstances
This leak is tied to error conditions which lead to incorrect cleanup
of some data structures. [backport from v6.3]
@@ -395,12 +403,25 @@ Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-06-08
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
---------------------------------------------------------------------------
@@ -1222,6 +1243,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)
diff --git a/action.c b/action.c
index 3a66c773..4fb0669a 100644
--- a/action.c
+++ b/action.c
@@ -819,7 +819,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;
@@ -833,15 +833,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;
@@ -1415,7 +1415,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 8dc618ab..c594fd77 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -158,10 +158,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 bd1950ad..8dbb0693 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -1597,9 +1597,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;
}
@@ -1826,7 +1836,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;
}
@@ -1865,8 +1883,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;
}
@@ -1912,9 +1940,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 {