summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dirty.h1
-rw-r--r--plugins/imudp/imudp.c6
-rw-r--r--runtime/glbl.h2
-rw-r--r--tcpsrv.c2
-rw-r--r--tools/syslogd.c6
5 files changed, 9 insertions, 8 deletions
diff --git a/dirty.h b/dirty.h
index e4f79901..10347fbf 100644
--- a/dirty.h
+++ b/dirty.h
@@ -42,7 +42,6 @@ extern char **StripDomains;
extern char *LocalDomain;
extern char**LocalHosts;
extern uchar *LocalHostName;
-extern int option_DisallowWarning;
#define MSG_PARSE_HOSTNAME 1
#define MSG_DONT_PARSE_HOSTNAME 0
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c
index 3103c4f8..e0f9f1d3 100644
--- a/plugins/imudp/imudp.c
+++ b/plugins/imudp/imudp.c
@@ -39,6 +39,7 @@
#include "module-template.h"
#include "srUtils.h"
#include "errmsg.h"
+#include "glbl.h"
MODULE_TYPE_INPUT
@@ -47,6 +48,7 @@ MODULE_TYPE_INPUT
/* Module static data */
DEF_IMOD_STATIC_DATA
DEFobjCurrIf(errmsg)
+DEFobjCurrIf(glbl)
DEFobjCurrIf(net)
static int *udpLstnSocks = NULL; /* Internet datagram sockets, first element is nbr of elements
@@ -195,7 +197,7 @@ CODESTARTrunInput
MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_NO_DELAY);
} else {
dbgprintf("%s is not an allowed sender\n", (char*)fromHostFQDN);
- if(option_DisallowWarning) {
+ if(glbl.GetOption_DisallowWarning) {
errmsg.LogError(NO_ERRCODE, "UDP message from disallowed sender %s discarded",
(char*)fromHost);
}
@@ -253,6 +255,7 @@ BEGINmodExit
CODESTARTmodExit
/* release what we no longer need */
objRelease(errmsg, CORE_COMPONENT);
+ objRelease(glbl, CORE_COMPONENT);
objRelease(net, LM_NET_FILENAME);
ENDmodExit
@@ -281,6 +284,7 @@ CODESTARTmodInit
*ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
CODEmodInit_QueryRegCFSLineHdlr
CHKiRet(objUse(errmsg, CORE_COMPONENT));
+ CHKiRet(objUse(glbl, CORE_COMPONENT));
CHKiRet(objUse(net, LM_NET_FILENAME));
/* register config file handlers */
diff --git a/runtime/glbl.h b/runtime/glbl.h
index c309fec4..6c519cb7 100644
--- a/runtime/glbl.h
+++ b/runtime/glbl.h
@@ -51,6 +51,8 @@ BEGINinterface(glbl) /* name must also be changed in ENDinterface macro! */
rsRetVal (*SetDefPFFamily)(int);
int (*GetDropMalPTRMsgs)(void);
rsRetVal (*SetDropMalPTRMsgs)(int);
+ int (*GetOption_DisallowWarning)(void);
+ rsRetVal (*SetOption_DisallowWarning)(int);
ENDinterface(glbl)
#define glblCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */
diff --git a/tcpsrv.c b/tcpsrv.c
index b3eaec1f..499b0ce8 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -468,7 +468,7 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, int fd)
*/
if(!pThis->pIsPermittedHost((struct sockaddr*) &addr, (char*) fromHostFQDN, pThis->pUsr, pSess->pUsr)) {
dbgprintf("%s is not an allowed sender\n", (char *) fromHostFQDN);
- if(option_DisallowWarning) {
+ if(glbl.GetOption_DisallowWarning()) {
errno = 0;
errmsg.LogError(NO_ERRCODE, "TCP message from disallowed sender %s discarded",
(char*)fromHost);
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 5cb0cb38..2da9187c 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -397,10 +397,6 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a
}
-
-int option_DisallowWarning = 1; /* complain if message from disallowed sender is received */
-
-
/* hardcoded standard templates (used for defaults) */
static uchar template_SyslogProtocol23Format[] = "\"<%PRI%>1 %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%\n\"";
static uchar template_TraditionalFileFormat[] = "\"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n\"";
@@ -3233,7 +3229,7 @@ int realMain(int argc, char **argv)
bParseHOSTNAMEandTAG = 0;
break;
case 'w': /* disable disallowed host warnigs */
- option_DisallowWarning = 0;
+ glbl.SetOption_DisallowWarning(0);
break;
case 'x': /* disable dns for remote messages */
DisableDNS = 1;