diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-17 09:54:10 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-17 09:54:10 +0200 |
commit | 911101ed26292c766eae0b48575e5911b96d2ea7 (patch) | |
tree | 743d3dc673fbb29b734cd1f0f25d53a649e63ecf | |
parent | e16a207726dce038835cdc12a928a95b5b915440 (diff) | |
download | rsyslog-911101ed26292c766eae0b48575e5911b96d2ea7.tar.gz rsyslog-911101ed26292c766eae0b48575e5911b96d2ea7.tar.xz rsyslog-911101ed26292c766eae0b48575e5911b96d2ea7.zip |
moved "option_DisallowWarning" variable to global data pool
-rw-r--r-- | dirty.h | 1 | ||||
-rw-r--r-- | plugins/imudp/imudp.c | 6 | ||||
-rw-r--r-- | runtime/glbl.h | 2 | ||||
-rw-r--r-- | tcpsrv.c | 2 | ||||
-rw-r--r-- | tools/syslogd.c | 6 |
5 files changed, 9 insertions, 8 deletions
@@ -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! */ @@ -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; |