summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-08-15 14:02:07 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-08-15 14:02:07 +0200
commitc2f30a2fc3fb1f87c157828dd08ee20fe444833d (patch)
tree6ed707814022350d1313558d28059d7aba0e0631
parent8aa2b21f7fc97e09c02f40815be6e4635ec080ba (diff)
parent9b46c03ce20c2d074bafdd68840461ed89b35ef4 (diff)
downloadrsyslog-c2f30a2fc3fb1f87c157828dd08ee20fe444833d.tar.gz
rsyslog-c2f30a2fc3fb1f87c157828dd08ee20fe444833d.tar.xz
rsyslog-c2f30a2fc3fb1f87c157828dd08ee20fe444833d.zip
Merge branch 'beta'
Conflicts: ChangeLog
-rw-r--r--ChangeLog10
-rw-r--r--doc/rsyslog_ng_comparison.html9
-rw-r--r--plugins/imfile/imfile.c18
-rw-r--r--threads.c12
4 files changed, 37 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index b26ae3a9..d06154f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -62,8 +62,9 @@ Version 3.21.0 [DEVEL] (rgerhards), 2008-07-18
- imported all changes from 3.18.1 until today (some quite important,
see below)
---------------------------------------------------------------------------
-Version 3.19.11 [BETA] (rgerhards), 2008-??-??
-- included fixes from v3-stable
+Version 3.19.11 [BETA] (rgerhards), 2008-08-25
+This is a refresh of the beta. No beta-specific fixes have been added.
+- included fixes from v3-stable (most importantly 3.18.3)
---------------------------------------------------------------------------
Version 3.19.10 [BETA] (rgerhards), 2008-07-15
- start of a new beta branch based on former 3.19 devel branch
@@ -222,7 +223,10 @@ Version 3.19.0 (rgerhards), 2008-05-06
- -c option no longer must be the first option - thanks to varmjofekoj
for the patch
---------------------------------------------------------------------------
-Version 3.18.3 (rgerhards), 2008-08-??
+Version 3.18.3 (rgerhards), 2008-08-18
+- bugfix: imfile could cause a segfault upon rsyslogd HUP and termination
+ Thanks to lperr for an excellent bug report that helped detect this
+ problem.
- enhanced ommysql to support custom port to connect to server
Port can be set via new $ActionOmmysqlServerPort config directive
Note: this was a very minor change and thus deemed appropriate to be
diff --git a/doc/rsyslog_ng_comparison.html b/doc/rsyslog_ng_comparison.html
index 1bab4d74..bc99cb8c 100644
--- a/doc/rsyslog_ng_comparison.html
+++ b/doc/rsyslog_ng_comparison.html
@@ -430,13 +430,19 @@ directories (log targets) dynamically</td>
<td valign="top">control of log output format,
including ability to present channel and priority as visible log data</td>
<td valign="top">yes</td>
-<td valign="top">not sure...</td>
+<td valign="top">yes</td>
</tr>
+<<<<<<< HEAD:doc/rsyslog_ng_comparison.html
<tr>
<td valign="top">native ability to send mail messages</td>
<td valign="top">yes (<a href="ommail.html">ommail</a>,
introduced in 3.17.0)</td>
<td valign="top">not sure...</td>
+=======
+<tr><td valign="top">native ability to send mail messages</td>
+<td valign="top">yes (<a href="ommail.html">ommail</a>, introduced in 3.17.0)</td>
+<td valign="top">no (only via piped external process)</td>
+>>>>>>> 3f2856b4b5010dfcaa720b292dc3a655e7b9f6da:doc/rsyslog_ng_comparison.html
</tr>
<tr>
<td valign="top">good timestamp format control; at a
@@ -586,5 +592,4 @@ feature sheet. I have not yet been able to fully work through it. In
the mean time, you may want to read it in parallel. It is available at
<a href="http://www.balabit.com/network-security/syslog-ng/features/detailed/">Balabit's
site</a>.</p>
-
</body></html>
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index dbdf6b94..3bc07b9c 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -187,16 +187,19 @@ static void pollFileCancelCleanup(void *pArg)
#pragma GCC diagnostic ignored "-Wempty-body"
static rsRetVal pollFile(fileInfo_t *pThis, int *pbHadFileData)
{
- DEFiRet;
cstr_t *pCStr = NULL;
+ DEFiRet;
ASSERT(pbHadFileData != NULL);
+ /* Note: we must do pthread_cleanup_push() immediately, because the POXIS macros
+ * otherwise do not work if I include the _cleanup_pop() inside an if... -- rgerhards, 2008-08-14
+ */
+ pthread_cleanup_push(pollFileCancelCleanup, &pCStr);
if(pThis->pStrm == NULL) {
CHKiRet(openFile(pThis)); /* open file */
}
- pthread_cleanup_push(pollFileCancelCleanup, &pCStr);
/* loop below will be exited when strmReadLine() returns EOF */
while(1) {
CHKiRet(strmReadLine(pThis->pStrm, &pCStr));
@@ -204,9 +207,18 @@ static rsRetVal pollFile(fileInfo_t *pThis, int *pbHadFileData)
CHKiRet(enqLine(pThis, pCStr)); /* process line */
rsCStrDestruct(&pCStr); /* discard string (must be done by us!) */
}
- pthread_cleanup_pop(0);
finalize_it:
+ /*EMPTY - just to keep the compiler happy, do NOT remove*/;
+ /* Note: the problem above is that pthread:cleanup_pop() is a macro which
+ * evaluates to something like "} while(0);". So the code would become
+ * "finalize_it: }", that is a label without a statement. The C standard does
+ * not permit this. So we add an empty statement "finalize_it: ; }" and
+ * everybody is happy. Note that without the ;, an error is reported only
+ * on some platforms/compiler versions. -- rgerhards, 2008-08-15
+ */
+ pthread_cleanup_pop(0);
+
if(pCStr != NULL) {
rsCStrDestruct(&pCStr);
}
diff --git a/threads.c b/threads.c
index f4f604fc..61ea8f29 100644
--- a/threads.c
+++ b/threads.c
@@ -46,6 +46,7 @@ static linkedList_t llThrds;
*/
static rsRetVal thrdConstruct(thrdInfo_t **ppThis)
{
+ DEFiRet;
thrdInfo_t *pThis;
assert(ppThis != NULL);
@@ -60,7 +61,7 @@ static rsRetVal thrdConstruct(thrdInfo_t **ppThis)
pthread_mutex_init (pThis->mutTermOK, NULL);
*ppThis = pThis;
- return RS_RET_OK;
+ RETiRet;
}
@@ -70,6 +71,7 @@ static rsRetVal thrdConstruct(thrdInfo_t **ppThis)
*/
static rsRetVal thrdDestruct(thrdInfo_t *pThis)
{
+ DEFiRet;
assert(pThis != NULL);
if(pThis->bIsActive == 1) {
@@ -78,7 +80,7 @@ static rsRetVal thrdDestruct(thrdInfo_t *pThis)
free(pThis->mutTermOK);
free(pThis);
- return RS_RET_OK;
+ RETiRet;
}
@@ -86,6 +88,7 @@ static rsRetVal thrdDestruct(thrdInfo_t *pThis)
*/
rsRetVal thrdTerminate(thrdInfo_t *pThis)
{
+ DEFiRet;
assert(pThis != NULL);
pthread_cancel(pThis->thrdID);
@@ -96,7 +99,7 @@ rsRetVal thrdTerminate(thrdInfo_t *pThis)
if(pThis->pAfterRun != NULL)
pThis->pAfterRun(pThis);
- return RS_RET_OK;
+ RETiRet;
}
@@ -104,8 +107,9 @@ rsRetVal thrdTerminate(thrdInfo_t *pThis)
*/
rsRetVal thrdTerminateAll(void)
{
+ DEFiRet;
llDestroy(&llThrds);
- return RS_RET_OK;
+ RETiRet;
}