summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-13 06:16:05 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-13 06:16:05 +0000
commit55f63c20f0f6e5b3914316e43a8b68272fc2b8e5 (patch)
tree3d4ea522d7f082c3ce3b55050f13b95931a0bae3
parentac053c73dc92fe102b94795983853cf299b5874c (diff)
downloadrsyslog-55f63c20f0f6e5b3914316e43a8b68272fc2b8e5.tar.gz
rsyslog-55f63c20f0f6e5b3914316e43a8b68272fc2b8e5.tar.xz
rsyslog-55f63c20f0f6e5b3914316e43a8b68272fc2b8e5.zip
dded the -x option to disable hostname dns reslution thanks to varmojfekoj
for the patch
-rw-r--r--ChangeLog4
-rw-r--r--rsyslogd.84
-rw-r--r--syslogd.c29
3 files changed, 26 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 55fe88df..df1b6d43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@ Version 1.16.0 (RGer/Peter Vrabec), 2007-07-1?
- removed SYSV preprocessor macro use, replaced with autotools equivalents
- fixed a bug that caused rsyslogd to segfault when TCP listening was
disabled and it terminated
+- added new properties "syslogfacility-text" and "syslogseverity-text"
+ thanks to varmojfekoj <varmojfekoj@gmail.com> for the patch
+- added the -x option to disable hostname dns reslution
+ thanks to varmojfekoj <varmojfekoj@gmail.com> for the patch
---------------------------------------------------------------------------
Version 1.15.1 (RGer), 2007-07-10
- fixed a bug that caused a dynaFile selector to stall when there was
diff --git a/rsyslogd.8 b/rsyslogd.8
index a000b3fb..1307ff36 100644
--- a/rsyslogd.8
+++ b/rsyslogd.8
@@ -47,6 +47,7 @@ rsyslogd \- reliable and extended syslogd
.br
.RB [ " \-v " ]
.RB [ " \-w " ]
+.RB [ " \-x " ]
.LP
.SH DESCRIPTION
.B Rsyslogd
@@ -237,6 +238,9 @@ Print version and exit.
.B "\-w"
Supress warnings issued when messages are received from non-authorized
machines (those, that are in no AllowedSender list).
+.TP
+.B "\-x"
+Disable DNS for remote messages.
.LP
.SH SIGNALS
.B Rsyslogd
diff --git a/syslogd.c b/syslogd.c
index 2b5f02a5..24e57502 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -904,6 +904,7 @@ static int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both),
static int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */
static int MarkSeq = 0; /* mark sequence number - modified in domark() only */
static int NoFork = 0; /* don't fork - don't run in daemon mode - read-only after startup */
+static int DisableDNS = 0; /* don't look up IP addresses of remote messages */
static int AcceptRemote = 0;/* receive messages that come via UDP - read-only after startup */
static char **StripDomains = NULL;/* these domains may be stripped before writing logs - r/o after s.u.*/
static char **LocalHosts = NULL;/* these hosts are logged with their hostname - read-only after startup*/
@@ -4229,7 +4230,7 @@ static char *MsgGetProp(struct msg *pMsg, struct templateEntry *pTpe,
static int usage(void)
{
fprintf(stderr, "usage: rsyslogd [-46Adhvw] [-l hostlist] [-m markinterval] [-n] [-p path]\n" \
- " [-s domainlist] [-r port] [-t port[,max-sessions]] [-f conffile]\n");
+ " [-s domainlist] [-r port] [-t port[,max-sessions]] [-f conffile] [-x]\n");
exit(1); /* "good" exit - done to terminate usage() */
}
@@ -6862,17 +6863,20 @@ static char *cvthname(struct sockaddr_storage *f)
return ("???");
}
- sigemptyset(&nmask);
- sigaddset(&nmask, SIGHUP);
- sigprocmask(SIG_BLOCK, &nmask, &omask);
+ if (!DisableDNS) {
+ sigemptyset(&nmask);
+ sigaddset(&nmask, SIGHUP);
+ sigprocmask(SIG_BLOCK, &nmask, &omask);
- error = getnameinfo((struct sockaddr *)f,
- sizeof(*f),
- hname, sizeof hname, NULL, 0,
- NI_NAMEREQD);
+ error = getnameinfo((struct sockaddr *)f,
+ sizeof(*f),
+ hname, sizeof hname, NULL, 0,
+ NI_NAMEREQD);
- sigprocmask(SIG_SETMASK, &omask, NULL);
- if (error) {
+ sigprocmask(SIG_SETMASK, &omask, NULL);
+ }
+
+ if (error || DisableDNS) {
dprintf("Host name for your address (%s) unknown\n", ip);
return (ip);
}
@@ -9687,7 +9691,7 @@ int main(int argc, char **argv)
funix[i] = -1;
}
- while ((ch = getopt(argc, argv, "46Aa:dehi:f:l:m:nop:r:s:t:u:vw")) != EOF)
+ while ((ch = getopt(argc, argv, "46Aa:dehi:f:l:m:nop:r:s:t:u:vwx")) != EOF)
switch((char)ch) {
case '4':
family = PF_INET;
@@ -9798,6 +9802,9 @@ int main(int argc, char **argv)
case 'w': /* disable disallowed host warnigs */
option_DisallowWarning = 0;
break;
+ case 'x': /* disable dns for remote messages */
+ DisableDNS = 1;
+ break;
case '?':
default:
usage();