summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--doc/imptcp.html22
-rw-r--r--grammar/rainerscript.c6
-rw-r--r--plugins/imdiag/imdiag.c1
-rw-r--r--plugins/imptcp/imptcp.c2
-rw-r--r--plugins/mmjsonparse/mmjsonparse.c1
-rw-r--r--plugins/mmnormalize/mmnormalize.c1
-rw-r--r--plugins/mmsnmptrapd/mmsnmptrapd.c1
-rw-r--r--plugins/ommail/ommail.c1
-rw-r--r--plugins/omprog/omprog.c7
-rw-r--r--plugins/omrelp/omrelp.c1
-rw-r--r--plugins/omruleset/omruleset.c1
-rw-r--r--plugins/omstdout/omstdout.c9
-rw-r--r--plugins/omtesting/omtesting.c1
-rw-r--r--runtime/debug.c8
-rw-r--r--runtime/module-template.h2
16 files changed, 52 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 5dbc2606..b395db0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -85,6 +85,12 @@ Version 7.2.4 [v7-stable] 2012-10-??
... actually, they are microseconds. So the fractional part of the
timestamp was not properly formatted. (import from 5.10.2)
Thanks to Marius Tomaschewski for the bug report and the patch idea.
+- bugfix: supportoctetcountedframing parameter did not work in imptcp
+- bugfix: modules not (yet) supporting new conf format were not properly
+ registered. This lead to a "module not found" error message instead of
+ the to-be-expected "module does not support new style" error message.
+ That invalid error message could be quite misleading and actually stop
+ people from addressing the real problem (aka "go nuts" ;))
----------------------------------------------------------------------------
Version 7.2.3 [v7-stable] 2012-10-21
- regression fix: rsyslogd terminated when wild-card $IncludeConfig did not
diff --git a/doc/imptcp.html b/doc/imptcp.html
index 33b8b13b..b5bd0970 100644
--- a/doc/imptcp.html
+++ b/doc/imptcp.html
@@ -19,7 +19,13 @@ Encryption can be provided by using <a href="rsyslog_stunnel.html">stunnel</a>.
</p>
<p><b>Configuration Directives</b>:</p>
-<p><b>Global Directives</b>:</p>
+<p>This plugin has config directives similar named as imtcp, but they all have <b>P</b>TCP in
+their name instead of just TCP. Note that only a subset of the parameters are supported.
+<ul>
+
+<p><b>Module Parameters</b>:</p>
+<p>These paramters can be used with the "module()" statement. They apply
+globaly to all inputs defined by the module.
<ul>
<li>Threads &lt;number&gt;<br>
Number of helper worker threads to process incoming messages. These
@@ -27,9 +33,11 @@ threads are utilized to pull data off the network. On a busy system, additional
helper threads (but not more than there are CPUs/Cores) can help improving
performance. The default value is two.
</ul>
-<p><b>Action Directives</b>:</p>
+<p><b>Input Parameters</b>:</p>
+<p>These parameters can be used with the "input()" statement. They apply to the
+input they are specified with.
<ul>
-<li><b>AddTLFrameDelimiter</b> &lt;Delimiter&gt;<br>
+<li><b>AddtlFrameDelimiter</b> &lt;Delimiter&gt;<br>
This directive permits to specify an additional frame delimiter for plain tcp syslog.
The industry-standard specifies using the LF character as frame delimiter. Some vendors,
notable Juniper in their NetScreen products, use an invalid frame delimiter, in Juniper's
@@ -100,13 +108,11 @@ burst in number of messages. Default is 10,000.
<p><b>Sample:</b></p>
<p>This sets up a TCP server on port 514:<br>
</p>
-<textarea rows="15" cols="60">module(load="/folder/to/rsyslog/plugins/imptcp/.libs/imptcp") # needs to be done just once
+<textarea rows="4" cols="60">module(load="/folder/to/rsyslog/plugins/imptcp/.libs/imptcp") # needs to be done just once
input(type="imptcp" port="514")
</textarea>
<p><b>Legacy Configuration Directives</b>:</p>
-<p>This plugin has config directives similar named as imtcp, but they all have <b>P</b>TCP in
-their name instead of just TCP. Note that only a subset of the parameters are supported.
<ul>
<li>$InputPTCPServerAddtlFrameDelimiter &lt;Delimiter&gt;<br>
Equivalent to: AddTLFrameDelimiter</li>
@@ -144,7 +150,7 @@ Equivalent to: Address </li>
<p><b>Sample:</b></p>
<p>This sets up a TCP server on port 514:<br>
</p>
-<textarea rows="15" cols="60">$ModLoad imptcp #
+<textarea rows="3" cols="60">$ModLoad imptcp #
needs to be done just once
$InputPTCPServerRun 514
</textarea>
@@ -153,7 +159,7 @@ $InputPTCPServerRun 514
<p><font size="2">This documentation is part of the
<a href="http://www.rsyslog.com/">rsyslog</a>
project.<br>
-Copyright &copy; 2010 by <a href="http://www.gerhards.net/rainer">Rainer
+Copyright &copy; 2010-2012 by <a href="http://www.gerhards.net/rainer">Rainer
Gerhards</a> and
<a href="http://www.adiscon.com/">Adiscon</a>.
Released under the GNU GPL version 3 or higher.</font></p>
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index 0dc505a7..f7f09697 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -2794,7 +2794,8 @@ cnfDoInclude(char *name)
if(result == GLOB_NOSPACE || result == GLOB_ABORTED) {
char errStr[1024];
rs_strerror_r(errno, errStr, sizeof(errStr));
- getcwd(cwdBuf, sizeof(cwdBuf));
+ if(getcwd(cwdBuf, sizeof(cwdBuf)) == NULL)
+ strcpy(cwdBuf, "??getcwd() failed??");
parser_errmsg("error accessing config file or directory '%s' [cwd:%s]: %s",
finalName, cwdBuf, errStr);
return 1;
@@ -2805,7 +2806,8 @@ cnfDoInclude(char *name)
if(stat(cfgFile, &fileInfo) != 0) {
char errStr[1024];
rs_strerror_r(errno, errStr, sizeof(errStr));
- getcwd(cwdBuf, sizeof(cwdBuf));
+ if(getcwd(cwdBuf, sizeof(cwdBuf)) == NULL)
+ strcpy(cwdBuf, "??getcwd() failed??");
parser_errmsg("error accessing config file or directory '%s' "
"[cwd: %s]: %s", cfgFile, cwdBuf, errStr);
return 1;
diff --git a/plugins/imdiag/imdiag.c b/plugins/imdiag/imdiag.c
index 15948215..5fdc6ef1 100644
--- a/plugins/imdiag/imdiag.c
+++ b/plugins/imdiag/imdiag.c
@@ -58,7 +58,6 @@
MODULE_TYPE_INPUT
MODULE_TYPE_NOKEEP
-MODULE_CNFNAME("imdiag")
/* static data */
DEF_IMOD_STATIC_DATA
diff --git a/plugins/imptcp/imptcp.c b/plugins/imptcp/imptcp.c
index 0475e219..5c8bb67a 100644
--- a/plugins/imptcp/imptcp.c
+++ b/plugins/imptcp/imptcp.c
@@ -1444,7 +1444,7 @@ CODESTARTnewInpInst
inst->pszInputName = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
} else if(!strcmp(inppblk.descr[i].name, "ruleset")) {
inst->pszBindRuleset = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
- } else if(!strcmp(inppblk.descr[i].name, "supportOctetCountedFraming")) {
+ } else if(!strcmp(inppblk.descr[i].name, "supportoctetcountedframing")) {
inst->bSuppOctetFram = (int) pvals[i].val.d.n;
} else if(!strcmp(inppblk.descr[i].name, "keepalive")) {
inst->bKeepAlive = (int) pvals[i].val.d.n;
diff --git a/plugins/mmjsonparse/mmjsonparse.c b/plugins/mmjsonparse/mmjsonparse.c
index c0a36d90..053b8270 100644
--- a/plugins/mmjsonparse/mmjsonparse.c
+++ b/plugins/mmjsonparse/mmjsonparse.c
@@ -281,6 +281,7 @@ CODESTARTmodInit
*ipIFVersProvided = CURR_MOD_IF_VERSION;
/* we only support the current interface specification */
CODEmodInit_QueryRegCFSLineHdlr
+ DBGPRINTF("mmjsonparse: module compiled with rsyslog version %s.\n", VERSION);
/* check if the rsyslog core supports parameter passing code */
bMsgPassingSupported = 0;
localRet = pHostQueryEtryPt((uchar*)"OMSRgetSupportedTplOpts",
diff --git a/plugins/mmnormalize/mmnormalize.c b/plugins/mmnormalize/mmnormalize.c
index 36d8c9fb..2d42886b 100644
--- a/plugins/mmnormalize/mmnormalize.c
+++ b/plugins/mmnormalize/mmnormalize.c
@@ -369,6 +369,7 @@ INITLegCnfVars
*ipIFVersProvided = CURR_MOD_IF_VERSION;
/* we only support the current interface specification */
CODEmodInit_QueryRegCFSLineHdlr
+ DBGPRINTF("mmnormalize: module compiled with rsyslog version %s.\n", VERSION);
/* check if the rsyslog core supports parameter passing code */
bMsgPassingSupported = 0;
localRet = pHostQueryEtryPt((uchar*)"OMSRgetSupportedTplOpts",
diff --git a/plugins/mmsnmptrapd/mmsnmptrapd.c b/plugins/mmsnmptrapd/mmsnmptrapd.c
index b1ac2f64..b79a311b 100644
--- a/plugins/mmsnmptrapd/mmsnmptrapd.c
+++ b/plugins/mmsnmptrapd/mmsnmptrapd.c
@@ -362,6 +362,7 @@ ENDmodExit
BEGINqueryEtryPt
CODESTARTqueryEtryPt
CODEqueryEtryPt_STD_OMOD_QUERIES
+CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES
ENDqueryEtryPt
diff --git a/plugins/ommail/ommail.c b/plugins/ommail/ommail.c
index d70fa30a..6044d2e9 100644
--- a/plugins/ommail/ommail.c
+++ b/plugins/ommail/ommail.c
@@ -689,6 +689,7 @@ ENDmodExit
BEGINqueryEtryPt
CODESTARTqueryEtryPt
CODEqueryEtryPt_STD_OMOD_QUERIES
+CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES
ENDqueryEtryPt
diff --git a/plugins/omprog/omprog.c b/plugins/omprog/omprog.c
index 6978a9d0..e425b428 100644
--- a/plugins/omprog/omprog.c
+++ b/plugins/omprog/omprog.c
@@ -128,7 +128,12 @@ static void execBinary(instanceData *pData, int fdStdin)
assert(pData != NULL);
fclose(stdin);
- dup(fdStdin);
+ if(dup(fdStdin) == -1) {
+ DBGPRINTF("omprog: dup() failed\n");
+ /* do some more error handling here? Maybe if the module
+ * gets some more widespread use...
+ */
+ }
//fclose(stdout);
/* we close all file handles as we fork soon
diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c
index 39ffe7fb..e55836c5 100644
--- a/plugins/omrelp/omrelp.c
+++ b/plugins/omrelp/omrelp.c
@@ -341,6 +341,7 @@ ENDmodExit
BEGINqueryEtryPt
CODESTARTqueryEtryPt
CODEqueryEtryPt_STD_OMOD_QUERIES
+CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES
ENDqueryEtryPt
diff --git a/plugins/omruleset/omruleset.c b/plugins/omruleset/omruleset.c
index fd002265..11765507 100644
--- a/plugins/omruleset/omruleset.c
+++ b/plugins/omruleset/omruleset.c
@@ -199,6 +199,7 @@ ENDmodExit
BEGINqueryEtryPt
CODESTARTqueryEtryPt
CODEqueryEtryPt_STD_OMOD_QUERIES
+CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES
ENDqueryEtryPt
diff --git a/plugins/omstdout/omstdout.c b/plugins/omstdout/omstdout.c
index fb95e951..59f9c8bb 100644
--- a/plugins/omstdout/omstdout.c
+++ b/plugins/omstdout/omstdout.c
@@ -136,9 +136,13 @@ CODESTARTdoAction
toWrite = (char*) ppString[0];
}
len = strlen(toWrite);
- write(1, toWrite, len); /* 1 is stdout! */
+ /* the following if's are just to silence compiler warnings. If someone
+ * actually intends to use this module in production (why???), this code
+ * needs to be more solid. -- rgerhards, 2012-11-28
+ */
+ if(write(1, toWrite, len)) {}; /* 1 is stdout! */
if(pData->bEnsureLFEnding && toWrite[len-1] != '\n') {
- write(1, "\n", 1); /* write missing LF */
+ if(write(1, "\n", 1)) {}; /* write missing LF */
}
ENDdoAction
@@ -175,6 +179,7 @@ ENDmodExit
BEGINqueryEtryPt
CODESTARTqueryEtryPt
CODEqueryEtryPt_STD_OMOD_QUERIES
+CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES
ENDqueryEtryPt
diff --git a/plugins/omtesting/omtesting.c b/plugins/omtesting/omtesting.c
index ff290c94..c9f1e06b 100644
--- a/plugins/omtesting/omtesting.c
+++ b/plugins/omtesting/omtesting.c
@@ -313,6 +313,7 @@ ENDmodExit
BEGINqueryEtryPt
CODESTARTqueryEtryPt
CODEqueryEtryPt_STD_OMOD_QUERIES
+CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES
ENDqueryEtryPt
diff --git a/runtime/debug.c b/runtime/debug.c
index 307a8bb8..1d306dbd 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -902,8 +902,12 @@ do_dbgprint(uchar *pszObjName, char *pszMsg, size_t lenMsg)
lenCopy = lenMsg;
memcpy(pszWriteBuf + offsWriteBuf, pszMsg, lenCopy);
offsWriteBuf += lenCopy;
- if(stddbg != -1) write(stddbg, pszWriteBuf, offsWriteBuf);
- if(altdbg != -1) write(altdbg, pszWriteBuf, offsWriteBuf);
+ /* the write is included in an "if" just to silence compiler
+ * warnings. Here, we really don't care if the write fails, we
+ * have no good response to that in any case... -- rgerhards, 2012-11-28
+ */
+ if(stddbg != -1) if(write(stddbg, pszWriteBuf, offsWriteBuf)){};
+ if(altdbg != -1) if(write(altdbg, pszWriteBuf, offsWriteBuf)){};
bWasNL = (pszMsg[lenMsg - 1] == '\n') ? 1 : 0;
}
diff --git a/runtime/module-template.h b/runtime/module-template.h
index 72a139c4..fe74bac9 100644
--- a/runtime/module-template.h
+++ b/runtime/module-template.h
@@ -113,7 +113,7 @@ static rsRetVal modGetID(void **pID) \
/* macro to provide the v6 config system module name
*/
#define MODULE_CNFNAME(name) \
-static __attribute__((unused)) rsRetVal modGetCnfName(uchar **cnfName) \
+static rsRetVal modGetCnfName(uchar **cnfName) \
{ \
*cnfName = (uchar*) name; \
return RS_RET_OK;\