diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-11 13:13:05 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-11 13:13:05 +0000 |
commit | 0d39d623e785e442da668ea55bcd3731065e7b8f (patch) | |
tree | c98468168e8d87ba180af9bfc319d41f74f2a606 | |
parent | 29cefd075252a59a87952eac5cdc06e085efc8b7 (diff) | |
download | rsyslog-0d39d623e785e442da668ea55bcd3731065e7b8f.tar.gz rsyslog-0d39d623e785e442da668ea55bcd3731065e7b8f.tar.xz rsyslog-0d39d623e785e442da668ea55bcd3731065e7b8f.zip |
- checked -s/-l option and found that they work as expected - closed case
- added some comments in relation to -s/-l option
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | net.c | 20 | ||||
-rw-r--r-- | syslogd.c | 4 |
3 files changed, 23 insertions, 5 deletions
@@ -6,6 +6,10 @@ Version 1.19.6 (rgerhards), 2007-09-?? - fixed a bug that in --enable-debug mode caused an assertion when the discard action was used - cleaned up compiler warnings +- applied patch by varmojfekoj to FIX a bug that could cause + segfaults if empty properties were processed using modifying + options (e.g. space-cc, drop-cc) +- fixed man bug: rsyslogd supports -l option --------------------------------------------------------------------------- Version 1.19.5 (rgerhards), 2007-09-07 - changed part of the CStr interface so that better error tracking @@ -202,14 +202,21 @@ int cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN) * part if we were instructed to do so. */ /* TODO: quick and dirty right now: we need to optimize that. We simply - * copy over the buffer and then use the old code. + * copy over the buffer and then use the old code. In the long term, that should + * be placed in its own function and probably outside of the net module (at least + * if should no longer reley on syslogd.c's global config-setting variables). + * Note that the old code always removes the local domain. We may want to + * make this in option in the long term. (rgerhards, 2007-09-11) */ strcpy((char*)pszHost, (char*)pszHostFQDN); - if ((p = (uchar*) strchr((char*)pszHost, '.'))) { + if ((p = (uchar*) strchr((char*)pszHost, '.'))) { /* find start of domain name "machine.example.com" */ if(strcmp((char*) (p + 1), LocalDomain) == 0) { *p = '\0'; /* simply terminate the string */ return 1; } else { + /* now check if we belong to any of the domain names that were specified + * in the -s command line option. If so, remove and we are done. + */ if (StripDomains) { count=0; while (StripDomains[count]) { @@ -220,7 +227,14 @@ int cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN) count++; } } - /* TODO: bug in syslogd? That all doesn't make so much sense... rger 2007-07-16 */ + /* if we reach this point, we have not found any domain we should strip. Now + * we try and see if the host itself is listed in the -l command line option + * and so should be stripped also. If so, we do it and return. Please note that + * -l list FQDNs, not just the hostname part. If it did just list the hostname, the + * door would be wide-open for all kinds of mixing up of hosts. Because of this, + * you'll see comparison against the full string (pszHost) below. The termination + * still occurs at *p, which points at the first dot after the hostname. + */ if (LocalHosts) { count=0; while (LocalHosts[count]) { @@ -542,8 +542,8 @@ 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 AcceptRemote = 0;/* receive messages that come via UDP - 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.*/ -char **LocalHosts = NULL;/* these hosts are logged with their hostname - read-only after startup*/ +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 */ int NoHops = 1; /* Can we bounce syslog messages through an intermediate host. Read-only after startup */ static int Initialized = 0; /* set when we have initialized ourselves |