summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-17 10:11:29 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-17 10:11:29 +0200
commit4824e56aed37b5edffc883cb53c91f0b61c3df62 (patch)
treeb693a073c057a425e8957d763036eec03509e00d
parent911101ed26292c766eae0b48575e5911b96d2ea7 (diff)
downloadrsyslog-4824e56aed37b5edffc883cb53c91f0b61c3df62.tar.gz
rsyslog-4824e56aed37b5edffc883cb53c91f0b61c3df62.tar.xz
rsyslog-4824e56aed37b5edffc883cb53c91f0b61c3df62.zip
moved "DisableDNS" variable to global data pool
-rw-r--r--dirty.h1
-rw-r--r--runtime/glbl.h14
-rw-r--r--runtime/net.c6
-rw-r--r--tools/syslogd.c3
4 files changed, 12 insertions, 12 deletions
diff --git a/dirty.h b/dirty.h
index 10347fbf..f8e9f959 100644
--- a/dirty.h
+++ b/dirty.h
@@ -37,7 +37,6 @@
#define ADDDATE 0x004 /* add a date to the message */
#define MARK 0x008 /* this message is a mark */
-extern int DisableDNS;
extern char **StripDomains;
extern char *LocalDomain;
extern char**LocalHosts;
diff --git a/runtime/glbl.h b/runtime/glbl.h
index 6c519cb7..3116b66b 100644
--- a/runtime/glbl.h
+++ b/runtime/glbl.h
@@ -47,12 +47,14 @@ typedef struct glbl_s {
/* interfaces */
BEGINinterface(glbl) /* name must also be changed in ENDinterface macro! */
uchar* (*GetWorkDir)(void);
- int (*GetDefPFFamily)(void);
- rsRetVal (*SetDefPFFamily)(int);
- int (*GetDropMalPTRMsgs)(void);
- rsRetVal (*SetDropMalPTRMsgs)(int);
- int (*GetOption_DisallowWarning)(void);
- rsRetVal (*SetOption_DisallowWarning)(int);
+#define SIMP_PROP(name, dataType) \
+ dataType (*Get##name)(void); \
+ rsRetVal (*Set##name)(dataType);
+ SIMP_PROP(DefPFFamily, int);
+ SIMP_PROP(DropMalPTRMsgs, int);
+ SIMP_PROP(Option_DisallowWarning, int);
+ SIMP_PROP(DisableDNS, int);
+#undef SIMP_PROP
ENDinterface(glbl)
#define glblCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */
diff --git a/runtime/net.c b/runtime/net.c
index b61e4c15..bc4404cb 100644
--- a/runtime/net.c
+++ b/runtime/net.c
@@ -235,7 +235,7 @@ static rsRetVal AddAllowedSender(struct AllowedSenders **ppRoot, struct AllowedS
iRet = AddAllowedSenderEntry(ppRoot, ppLast, iAllow, iSignificantBits);
} else {
/* we need to process a hostname ACL */
- if (DisableDNS) {
+ if(glbl.GetDisableDNS()) {
errmsg.LogError(NO_ERRCODE, "Ignoring hostname based ACLs because DNS is disabled.");
ABORT_FINALIZE(RS_RET_OK);
}
@@ -656,7 +656,7 @@ gethname(struct sockaddr_storage *f, uchar *pszHostFQDN)
ABORT_FINALIZE(RS_RET_INVALID_SOURCE);
}
- if (!DisableDNS) {
+ if(!glbl.GetDisableDNS()) {
sigemptyset(&nmask);
sigaddset(&nmask, SIGHUP);
pthread_sigmask(SIG_BLOCK, &nmask, &omask);
@@ -713,7 +713,7 @@ gethname(struct sockaddr_storage *f, uchar *pszHostFQDN)
pthread_sigmask(SIG_SETMASK, &omask, NULL);
}
- if (error || DisableDNS) {
+ if(error || glbl.GetDisableDNS()) {
dbgprintf("Host name for your address (%s) unknown\n", ip);
strcpy((char*) pszHostFQDN, ip);
ABORT_FINALIZE(RS_RET_ADDRESS_UNKNOWN);
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 2da9187c..44607aea 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -296,7 +296,6 @@ char *LocalDomain; /* our local domain name - read-only after startup */
int MarkInterval = 20 * 60; /* interval between marks in seconds - read-only after startup */
int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */
static int NoFork = 0; /* don't fork - don't run in daemon mode - read-only after startup */
-int DisableDNS = 0; /* don't look up IP addresses of remote messages */
char **StripDomains = NULL;/* these domains may be stripped before writing logs - r/o after s.u., never touched by init */
char **LocalHosts = NULL;/* these hosts are logged with their hostname - read-only after startup, never touched by init */
static int bHaveMainQueue = 0;/* set to 1 if the main queue - in queueing mode - is available
@@ -3232,7 +3231,7 @@ int realMain(int argc, char **argv)
glbl.SetOption_DisallowWarning(0);
break;
case 'x': /* disable dns for remote messages */
- DisableDNS = 1;
+ glbl.SetDisableDNS(1);
break;
case '?':
default: