[PATCH] fix smartness og name_to_fqdn() code

simo idra at samba.org
Wed Aug 30 18:04:55 GMT 2006


I'd like to add this patch to handle broken hosts files where the
machine name is put on the 127.0.0.1 address line.

Comments?

Index: lib/util.c
===================================================================
--- lib/util.c  (revision 17933)
+++ lib/util.c  (working copy)
@@ -2843,6 +2843,13 @@
                                }
                        }
                }
+               if (full && (StrCaseCmp(full, "localhost.localdomain") == 0)) {
+                       DEBUG(1, ("WARNING: you hosts file is probably broken!\n"));
+                       DEBUGADD(1, ("    specifing the real hostname for address 127.0.0.1 is wrong!\n"));
+                       DEBUGADD(1, ("    will not return localhost.localdomain as the FQDN for this host.\n"));
+                       full = hp->h_name;
+               }
+
                if (!full) {
                        full = hp->h_name;
                }

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
http://samba.org



More information about the samba-technical mailing list