[PATCH] fix smartness og name_to_fqdn() code

Andrew Bartlett abartlet at samba.org
Wed Aug 30 21:50:04 GMT 2006


On Wed, 2006-08-30 at 14:04 -0400, simo wrote:
> 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;
>                 }

I'm not entirely sure what this is doing.  Unfortunately, many sites
(anyone using Fedora and presumably RHEL) will end up with:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost       piglett

by default.

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.                  http://redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20060831/15aca206/attachment.bin


More information about the samba-technical mailing list