summaryrefslogtreecommitdiffstats
path: root/runtime/ruleset.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-08-22 14:30:12 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-08-22 14:30:12 +0200
commitd92ad440da788fea9f17bfa4b0185f12644bf714 (patch)
treedb11db9ced73043ab0f2bf8d02bd49d0abc42191 /runtime/ruleset.c
parent9fb96ec34312b6da7b496db0b3d5eb86442fed06 (diff)
downloadrsyslog-d92ad440da788fea9f17bfa4b0185f12644bf714.tar.gz
rsyslog-d92ad440da788fea9f17bfa4b0185f12644bf714.tar.xz
rsyslog-d92ad440da788fea9f17bfa4b0185f12644bf714.zip
bugfix: multiple main queues with same queue file name were not detected
This lead to queue file corruption. While the root cause is a config error, it is a bug that this important and hard to find config error was not detected by rsyslog.
Diffstat (limited to 'runtime/ruleset.c')
-rw-r--r--runtime/ruleset.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/ruleset.c b/runtime/ruleset.c
index 8e241c8a..d608f3ad 100644
--- a/runtime/ruleset.c
+++ b/runtime/ruleset.c
@@ -500,6 +500,7 @@ debugPrintAll(void)
static rsRetVal
rulesetCreateQueue(void __attribute__((unused)) *pVal, int *pNewVal)
{
+ uchar *rsname;
DEFiRet;
if(pCurrRuleset == NULL) {
@@ -517,8 +518,9 @@ rulesetCreateQueue(void __attribute__((unused)) *pVal, int *pNewVal)
if(pNewVal == 0)
FINALIZE; /* if it is turned off, we do not need to change anything ;) */
- dbgprintf("adding a ruleset-specific \"main\" queue");
- CHKiRet(createMainQueue(&pCurrRuleset->pQueue, UCHAR_CONSTANT("ruleset")));
+ rsname = (pCurrRuleset->pszName == NULL) ? (uchar*) "[NONAME]" : pCurrRuleset->pszName;
+ DBGPRINTF("adding a ruleset-specific \"main\" queue for ruleset '%s'\n", rsname);
+ CHKiRet(createMainQueue(&pCurrRuleset->pQueue, rsname));
finalize_it:
RETiRet;