summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-12-20 12:56:41 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2008-12-20 12:56:41 +0100
commit31344728fe6f83d4f02ce0e5868c331b4e25d659 (patch)
treed5da7e697d017c6c8285cb3da832303d9aae884f /tools
parent246962be65941c7994aa18e4f9327f239c62eb9e (diff)
downloadrsyslog-31344728fe6f83d4f02ce0e5868c331b4e25d659.tar.gz
rsyslog-31344728fe6f83d4f02ce0e5868c331b4e25d659.tar.xz
rsyslog-31344728fe6f83d4f02ce0e5868c331b4e25d659.zip
bufgix: $PreserveFQDN was not properly handled for locally emitted messages
Diffstat (limited to 'tools')
-rw-r--r--tools/syslogd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 138bdfd8..2cac8fe4 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -3288,6 +3288,7 @@ int realMain(int argc, char **argv)
uchar legacyConfLine[80];
uchar *LocalHostName;
uchar *LocalDomain;
+ uchar *LocalFQDNName;
/* first, parse the command line options. We do not carry out any actual work, just
* see what we should do. This relieves us from certain anomalies and we can process
@@ -3392,7 +3393,9 @@ int realMain(int argc, char **argv)
/* get our host and domain names - we need to do this early as we may emit
* error log messages, which need the correct hostname. -- rgerhards, 2008-04-04
*/
- net.getLocalHostname(&LocalHostName);
+ net.getLocalHostname(&LocalFQDNName);
+ CHKmalloc(LocalHostName = (uchar*) strdup((char*)LocalFQDNName));
+ glbl.SetLocalFQDNName(LocalFQDNName); /* set the FQDN before we modify it */
if((p = (uchar*)strchr((char*)LocalHostName, '.'))) {
*p++ = '\0';
LocalDomain = p;