summaryrefslogtreecommitdiff
path: root/sysutils/rsyslog6-devel/files/extra-patch-sane-hostname
diff options
context:
space:
mode:
authorPhilip M. Gollucci <pgollucci@FreeBSD.org>2010-05-12 21:40:42 +0000
committerPhilip M. Gollucci <pgollucci@FreeBSD.org>2010-05-12 21:40:42 +0000
commit7acc749ea6e7241f7a8d7adbe6578f41793e6a03 (patch)
tree3277e6104fe01f07345e1dad524853e8da2b8de2 /sysutils/rsyslog6-devel/files/extra-patch-sane-hostname
parent- Forced commit to note repo copies from sysutils/rsyslog5* -> sysutils/rsysl... (diff)
- Please welcome rsyslog55 which is tracking the -devel
- 2 custom optional patches o) microsecond support for MySQL o) sanely select and return FQDN for use in $fromhost templates PR: ports/146316 No objection from: cristianorolim@hotmail.com (rsyslog* maintainer) Submitted by: pgollucci@ (myself)
Diffstat (limited to 'sysutils/rsyslog6-devel/files/extra-patch-sane-hostname')
-rw-r--r--sysutils/rsyslog6-devel/files/extra-patch-sane-hostname40
1 files changed, 40 insertions, 0 deletions
diff --git a/sysutils/rsyslog6-devel/files/extra-patch-sane-hostname b/sysutils/rsyslog6-devel/files/extra-patch-sane-hostname
new file mode 100644
index 000000000000..bc7251475d81
--- /dev/null
+++ b/sysutils/rsyslog6-devel/files/extra-patch-sane-hostname
@@ -0,0 +1,40 @@
+--- ./tools/syslogd.c.orig 2010-05-04 19:02:05.548362478 -0400
++++ ./tools/syslogd.c 2010-05-04 19:02:27.452450741 -0400
+@@ -2611,37 +2611,6 @@
+ 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;
+- } else {
+- LocalDomain = (uchar*)"";
+-
+- /* It's not clearly defined whether gethostname()
+- * should return the simple hostname or the fqdn. A
+- * good piece of software should be aware of both and
+- * we want to distribute good software. Joey
+- *
+- * Good software also always checks its return values...
+- * If syslogd starts up before DNS is up & /etc/hosts
+- * doesn't have LocalHostName listed, gethostbyname will
+- * return NULL.
+- */
+- /* TODO: gethostbyname() is not thread-safe, but replacing it is
+- * not urgent as we do not run on multiple threads here. rgerhards, 2007-09-25
+- */
+- hent = gethostbyname((char*)LocalHostName);
+- if(hent) {
+- free(LocalHostName);
+- CHKmalloc(LocalHostName = (uchar*)strdup(hent->h_name));
+-
+- if((p = (uchar*)strchr((char*)LocalHostName, '.')))
+- {
+- *p++ = '\0';
+- LocalDomain = p;
+- }
+- }
+- }
+
+ /* Convert to lower case to recognize the correct domain laterly */
+ for(p = LocalDomain ; *p ; p++)