summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-05-09 15:07:22 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-05-09 15:07:22 +0200
commitfd4a54698cee48da073622f7d6ac49c94ccb1808 (patch)
treeb16110018cd3a21a19561f45376403e1e8815cfb
parent88ff647aef4c6db3c444c6d080f9886350ca9584 (diff)
parent87a01476e2a63ab7b6740b6b4182281d271ef382 (diff)
downloadrsyslog-fd4a54698cee48da073622f7d6ac49c94ccb1808.tar.gz
rsyslog-fd4a54698cee48da073622f7d6ac49c94ccb1808.tar.xz
rsyslog-fd4a54698cee48da073622f7d6ac49c94ccb1808.zip
Merge branch 'v5-stable' into beta
Conflicts: tools/omfwd.c
-rw-r--r--ChangeLog30
-rw-r--r--plugins/imuxsock/imuxsock.c9
-rw-r--r--runtime/glbl.c6
-rw-r--r--runtime/stream.c11
-rw-r--r--runtime/strmsrv.c6
-rw-r--r--tcpsrv.c3
-rw-r--r--tools/omfwd.c5
-rw-r--r--tools/syslogd.c2
8 files changed, 63 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index e7ffce13..a9b4c601 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -169,8 +169,19 @@ Version 5.9.0 [V5-DEVEL] (rgerhards), 2011-03-??
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=236
---------------------------------------------------------------------------
Version 5.8.1 [V5-stable] (rgerhards), 2011-04-??
+- bugfix: rate-limiting inside imuxsock did not work 100% correct
+ reason was that a global config variable was invalidly accessed where a
+ listener variable should have been used.
+ Also performance-improved the case when rate limiting is turned off (this
+ is a very unintrusive change, thus done directly to the stable version).
- bugfix: $myhostname not available in RainerScript (and no error message)
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=233
+- bugfix: memory and file descriptor leak in stream processing
+ Leaks could occur under some circumstances if the file stream handler
+ errored out during the open call. Among others, this could cause very
+ big memory leaks if there were a problem with unreadable disk queue
+ files. In regard to the memory leak, this
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=256
- bugfix: doc for impstats had wrong config statements
also, config statements were named a bit inconsistent, resolved that
problem by introducing an alias and only documenting the consistent
@@ -179,6 +190,11 @@ Version 5.8.1 [V5-stable] (rgerhards), 2011-04-??
- bugfix: IPv6-address could not be specified in omrelp
this was due to improper parsing of ":"
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=250
+- bugfix: TCP connection invalidly aborted when messages needed to be
+ discarded (due to QUEUE_FULL or similar problem)
+- bugfix: $LocalHostName was not honored under all circumstances
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=258
+- bugfix(minor): improper template function call in syslogd.c
---------------------------------------------------------------------------
Version 5.8.0 [V5-stable] (rgerhards), 2011-04-12
@@ -965,9 +981,19 @@ Version 4.7.0 [v4-devel] (rgerhards), 2010-04-14
- imported changes from 4.5.6 and below
---------------------------------------------------------------------------
Version 4.6.6 [v4-stable] (rgerhards), 2010-11-??
+- bugfix: invalid storage type for config variables
+- bugfix: stream driver mode was not correctly set on tcp ouput on big
+ endian systems.
+ thanks varmojfekoj for the patch
- bugfix: IPv6-address could not be specified in omrelp
this was due to improper parsing of ":"
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=250
+- bugfix: memory and file descriptor leak in stream processing
+ Leaks could occur under some circumstances if the file stream handler
+ errored out during the open call. Among others, this could cause very
+ big memory leaks if there were a problem with unreadable disk queue
+ files. In regard to the memory leak, this
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=256
- bugfix: imfile potentially duplicates lines
This can happen when 0 bytes are read from the input file, and some
writer appends data to the file BEFORE we check if a rollover happens.
@@ -993,6 +1019,10 @@ Version 4.6.6 [v4-stable] (rgerhards), 2010-11-??
bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=221
- bugfix: omlibdbi did not use password from rsyslog.con
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=203
+- bugfix: TCP connection invalidly aborted when messages needed to be
+ discarded (due to QUEUE_FULL or similar problem)
+- bugfix: a slightly more informative error message when a TCP
+ connections is aborted
- some improvements thanks to clang's static code analyzer
o overall cleanup (mostly unnecessary writes and otherwise unused stuff)
o bugfix: fixed a very remote problem in msg.c which could occur when
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index e559e6a6..cbf87d7f 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -432,7 +432,8 @@ finalize_it:
/* find ratelimiter to use for this message. Currently, we use the
* pid, but may change to cgroup later (probably via a config switch).
- * Returns NULL if not found.
+ * Returns NULL if not found or rate-limiting not activated for this
+ * listener (the latter being a performance enhancement).
*/
static inline rsRetVal
findRatelimiter(lstn_t *pLstn, struct ucred *cred, rs_ratelimit_state_t **prl)
@@ -444,6 +445,10 @@ findRatelimiter(lstn_t *pLstn, struct ucred *cred, rs_ratelimit_state_t **prl)
if(cred == NULL)
FINALIZE;
+ if(pLstn->ratelimitInterval == 0) {
+ *prl = NULL;
+ FINALIZE;
+ }
rl = hashtable_search(pLstn->ht, &cred->pid);
if(rl == NULL) {
@@ -454,7 +459,7 @@ findRatelimiter(lstn_t *pLstn, struct ucred *cred, rs_ratelimit_state_t **prl)
CHKmalloc(rl = malloc(sizeof(rs_ratelimit_state_t)));
CHKmalloc(keybuf = malloc(sizeof(pid_t)));
*keybuf = cred->pid;
- initRatelimitState(rl, ratelimitInterval, pLstn->ratelimitBurst);
+ initRatelimitState(rl, pLstn->ratelimitInterval, pLstn->ratelimitBurst);
r = hashtable_insert(pLstn->ht, keybuf, rl);
if(r == 0)
ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
diff --git a/runtime/glbl.c b/runtime/glbl.c
index 0114b1ac..71901dee 100644
--- a/runtime/glbl.c
+++ b/runtime/glbl.c
@@ -188,6 +188,11 @@ GetLocalHostName(void)
{
uchar *pszRet;
+ if(LocalHostNameOverride != NULL) {
+ pszRet = LocalHostNameOverride;
+ goto done;
+ }
+
if(LocalHostName == NULL)
pszRet = (uchar*) "[localhost]";
else {
@@ -196,6 +201,7 @@ GetLocalHostName(void)
else
pszRet = LocalHostName;
}
+done:
return(pszRet);
}
diff --git a/runtime/stream.c b/runtime/stream.c
index 24dbcc09..ae716815 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -259,6 +259,7 @@ static rsRetVal strmOpenFile(strm_t *pThis)
if(pThis->fd != -1)
ABORT_FINALIZE(RS_RET_OK);
+ pThis->pszCurrFName = NULL; /* used to prevent mem leak in case of error */
if(pThis->pszFName == NULL)
ABORT_FINALIZE(RS_RET_FILE_PREFIX_MISSING);
@@ -290,6 +291,16 @@ static rsRetVal strmOpenFile(strm_t *pThis)
(pThis->tOperationsMode == STREAMMODE_READ) ? "READ" : "WRITE", pThis->fd);
finalize_it:
+ if(iRet != RS_RET_OK) {
+ if(pThis->pszCurrFName != NULL) {
+ free(pThis->pszCurrFName);
+ pThis->pszCurrFName = NULL; /* just to prevent mis-adressing down the road... */
+ }
+ if(pThis->fd != -1) {
+ close(pThis->fd);
+ pThis->fd = -1;
+ }
+ }
RETiRet;
}
diff --git a/runtime/strmsrv.c b/runtime/strmsrv.c
index e66ad717..f448cd4f 100644
--- a/runtime/strmsrv.c
+++ b/runtime/strmsrv.c
@@ -521,6 +521,7 @@ Run(strmsrv_t *pThis)
strms_sess_t *pNewSess;
nssel_t *pSel;
ssize_t iRcvd;
+ rsRetVal localRet;
ISOBJ_TYPE_assert(pThis, strmsrv);
@@ -580,11 +581,12 @@ Run(strmsrv_t *pThis)
break;
case RS_RET_OK:
/* valid data received, process it! */
- if(strms_sess.DataRcvd(pThis->pSessions[iSTRMSess], buf, iRcvd) != RS_RET_OK) {
+ localRet = strms_sess.DataRcvd(pThis->pSessions[iSTRMSess], buf, iRcvd);
+ if(localRet != RS_RET_OK) {
/* in this case, something went awfully wrong.
* We are instructed to terminate the session.
*/
- errmsg.LogError(0, NO_ERRCODE, "Tearing down STRM Session %d - see "
+ errmsg.LogError(0, localRet, "Tearing down STRM Session %d - see "
"previous messages for reason(s)\n", iSTRMSess);
pThis->pOnErrClose(pThis->pSessions[iSTRMSess]);
strms_sess.Destruct(&pThis->pSessions[iSTRMSess]);
diff --git a/tcpsrv.c b/tcpsrv.c
index 39cba5d1..2c97d522 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -539,7 +539,8 @@ doReceive(tcpsrv_t *pThis, tcps_sess_t **ppSess, nspoll_t *pPoll)
break;
case RS_RET_OK:
/* valid data received, process it! */
- if((localRet = tcps_sess.DataRcvd(*ppSess, buf, iRcvd)) != RS_RET_OK) {
+ localRet = tcps_sess.DataRcvd(*ppSess, buf, iRcvd);
+ if(localRet != RS_RET_OK && localRet != RS_RET_QUEUE_FULL) {
/* in this case, something went awfully wrong.
* We are instructed to terminate the session.
*/
diff --git a/tools/omfwd.c b/tools/omfwd.c
index be13bf75..c39d1d67 100644
--- a/tools/omfwd.c
+++ b/tools/omfwd.c
@@ -102,12 +102,11 @@ typedef struct _instanceData {
} instanceData;
/* config data */
-
typedef struct configSettings_s {
uchar *pszTplName; /* name of the default template to use */
uchar *pszStrmDrvr; /* name of the stream driver to use */
- short iStrmDrvrMode; /* mode for stream driver, driver-dependent (0 mostly means plain tcp) */
- short bResendLastOnRecon; /* should the last message be re-sent on a successful reconnect? */
+ int iStrmDrvrMode; /* mode for stream driver, driver-dependent (0 mostly means plain tcp) */
+ int bResendLastOnRecon; /* should the last message be re-sent on a successful reconnect? */
uchar *pszStrmDrvrAuthMode; /* authentication mode to use */
int iUDPRebindInterval; /* support for automatic re-binding (load balancers!). 0 - no rebind */
int iTCPRebindInterval; /* support for automatic re-binding (load balancers!). 0 - no rebind */
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 44c88624..bab37966 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -2167,7 +2167,7 @@ static rsRetVal mainThread()
pTmp = template_StdDBFmt;
tplAddLine(" StdDBFmt", &pTmp);
pTmp = template_StdPgSQLFmt;
- tplLastStaticInit(tplAddLine(" StdPgSQLFmt", &pTmp));
+ tplAddLine(" StdPgSQLFmt", &pTmp);
pTmp = template_spoofadr;
tplLastStaticInit(tplAddLine("RSYSLOG_omudpspoofDfltSourceTpl", &pTmp));