Blame SOURCES/tcp_wrappers-7.6-fixgethostbyname.patch

23cc51
--- tcp_wrappers_7.6-ipv6.4/socket.c.patch7	1999-10-27 15:23:14.000000000 +0200
23cc51
+++ tcp_wrappers_7.6-ipv6.4/socket.c	2013-01-23 11:41:48.776857327 +0100
23cc51
@@ -54,6 +54,8 @@ int af;
23cc51
 {
23cc51
     char    dot_name[MAXHOSTNAMELEN + 1];
23cc51
 
23cc51
+    struct hostent *hp;
23cc51
+
23cc51
     /*
23cc51
      * Don't append dots to unqualified names. Such names are likely to come
23cc51
      * from local hosts files or from NIS.
23cc51
@@ -62,8 +64,13 @@ int af;
23cc51
     if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) {
23cc51
 	return (tcpd_gethostbyname(name, af));
23cc51
     } else {
23cc51
-	sprintf(dot_name, "%s.", name);
23cc51
-	return (tcpd_gethostbyname(dot_name, af));
23cc51
+        sprintf(dot_name, "%s.", name);
23cc51
+        hp = tcpd_gethostbyname(dot_name, af);
23cc51
+        if (hp)
23cc51
+            return hp;
23cc51
+
23cc51
+        else
23cc51
+            return tcpd_gethostbyname(name, af);
23cc51
     }
23cc51
 }
23cc51