summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-02-10 17:41:28 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-02-10 17:41:28 +0100
commit200e2b66308fb0ca861b5ba72d2b408b7f24aac3 (patch)
tree096885420457b9425fa8ccbbcdb1b005196a16a6 /plugins
parent7a0c7c61a57730ead60b7d4982247b76febb3bd9 (diff)
parentc8ebe623376bc025bf166ec333ac874c215de816 (diff)
downloadrsyslog-200e2b66308fb0ca861b5ba72d2b408b7f24aac3.tar.gz
rsyslog-200e2b66308fb0ca861b5ba72d2b408b7f24aac3.tar.xz
rsyslog-200e2b66308fb0ca861b5ba72d2b408b7f24aac3.zip
Merge branch 'beta' into master
Conflicts: ChangeLog tests/parsertest.sh
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imuxsock/imuxsock.c2
-rw-r--r--plugins/ompgsql/createDB.sql2
-rw-r--r--plugins/omruleset/omruleset.c21
3 files changed, 18 insertions, 7 deletions
diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c
index 06f9caad..8ad2b9e9 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -370,7 +370,7 @@ CODESTARTwillRun
/* we need to create the inputName property (only once during our lifetime) */
CHKiRet(prop.Construct(&pInputName));
- CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("imudp"), sizeof("imudp") - 1));
+ CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("imuxsock"), sizeof("imuxsock") - 1));
CHKiRet(prop.ConstructFinalize(pInputName));
finalize_it:
diff --git a/plugins/ompgsql/createDB.sql b/plugins/ompgsql/createDB.sql
index facdcaa0..2f72a0a6 100644
--- a/plugins/ompgsql/createDB.sql
+++ b/plugins/ompgsql/createDB.sql
@@ -1,4 +1,4 @@
-CREATE DATABASE "Syslog";
+CREATE DATABASE 'Syslog' WITH ENCODING 'SQL_ASCII';
\c Syslog;
CREATE TABLE SystemEvents
(
diff --git a/plugins/omruleset/omruleset.c b/plugins/omruleset/omruleset.c
index eebe1708..0e0fc13b 100644
--- a/plugins/omruleset/omruleset.c
+++ b/plugins/omruleset/omruleset.c
@@ -41,7 +41,6 @@
#include <unistd.h>
#include "conf.h"
#include "syslogd-types.h"
-//#include "srUtils.h"
#include "template.h"
#include "module-template.h"
#include "errmsg.h"
@@ -61,10 +60,12 @@ DEF_OMOD_STATIC_DATA
/* config variables */
ruleset_t *pRuleset = NULL; /* ruleset to enqueue message to (NULL = Default, not recommended) */
+uchar *pszRulesetName = NULL;
typedef struct _instanceData {
ruleset_t *pRuleset; /* ruleset to enqueue to */
+ uchar *pszRulesetName; /* primarily for debugging/display purposes */
} instanceData;
@@ -80,11 +81,13 @@ ENDisCompatibleWithFeature
BEGINfreeInstance
CODESTARTfreeInstance
+ free(pData->pszRulesetName);
ENDfreeInstance
BEGINdbgPrintInstInfo
CODESTARTdbgPrintInstInfo
+ dbgprintf("omruleset target %s[%p]\n", (char*) pData->pszRulesetName, pData->pRuleset);
ENDdbgPrintInstInfo
@@ -99,11 +102,13 @@ ENDtryResume
BEGINdoAction
msg_t *pMsg;
CODESTARTdoAction
- pMsg = (msg_t*) ppString[0];
- DBGPRINTF(":omruleset: forwarding message %p to ruleset %p\n", pMsg, pData->pRuleset);
+ CHKmalloc(pMsg = MsgDup((msg_t*) ppString[0]));
+ DBGPRINTF(":omruleset: forwarding message %p to ruleset %s[%p]\n", pMsg,
+ (char*) pData->pszRulesetName, pData->pRuleset);
MsgSetFlowControlType(pMsg, eFLOWCTL_NO_DELAY);
MsgSetRuleset(pMsg, pData->pRuleset);
- submitMsg(MsgAddRef(pMsg));
+ submitMsg(pMsg);
+finalize_it:
ENDdoAction
/* set the ruleset name */
@@ -118,9 +123,12 @@ setRuleset(void __attribute__((unused)) *pVal, uchar *pszName)
errmsg.LogError(0, RS_RET_RULESET_NOT_FOUND, "error: ruleset '%s' not found - ignored", pszName);
}
CHKiRet(localRet);
+ pszRulesetName = pszName; /* save for later display purposes */
finalize_it:
- free(pszName); /* no longer needed */
+ if(iRet != RS_RET_OK) { /* cleanup needed? */
+ free(pszName);
+ }
RETiRet;
}
@@ -153,13 +161,16 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
*/
CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, iTplOpts, (uchar*) "RSYSLOG_FileFormat"));
pData->pRuleset = pRuleset;
+ pData->pszRulesetName = pszRulesetName;
pRuleset = NULL; /* re-set, because there is a high risk of unwanted behavior if we leave it in! */
+ pszRulesetName = NULL; /* note: we must not free, as we handed over this pointer to the instanceDat to the instanceDataa! */
CODE_STD_FINALIZERparseSelectorAct
ENDparseSelectorAct
BEGINmodExit
CODESTARTmodExit
+ free(pszRulesetName);
objRelease(errmsg, CORE_COMPONENT);
objRelease(ruleset, CORE_COMPONENT);
ENDmodExit