Subject: install/21999: localhost.domain not correctly set in /etc/hosts file
To: None <gnats-bugs@gnats.netbsd.org>
From: None <wsimpson@greendragon.com>
List: netbsd-bugs
Date: 06/26/2003 20:31:53
>Number:         21999
>Category:       install
>Synopsis:       localhost.domain not correctly set in /etc/hosts file
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 26 20:32:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     william allen simpson
>Release:        1.6U
>Organization:
daydreamer
>Environment:
NetBSD dreamer 1.6U NetBSD 1.6U (GENERIC) #1: Wed Jun 25 10:42:39 EDT 2003  current@dreamer:/usr/obj/sys/arch/i386/compile/GENERIC i386
>Description:
In a default install, the search order for root@localhost looks for 
localhost.domain before localhost.

The default hosts file comes with a localhost line.

The sysinst adds a obviously unneccessary duplicate localhost line, 
that probably should be localhost.domain:
 
#       $NetBSD: hosts,v 1.6 2000/08/15 09:33:05 itojun Exp $
#...
::1                     localhost
127.0.0.1               localhost
#...
#
# Added by NetBSD sysinst
#
127.0.0.1       localhost
141.211.133.36  dreamer.citi.umich.edu dreamer


>How-To-Repeat:
(1) install a clean system

>Fix:
/home/current/src/distrib/utils/sysinst/net.c

write_etc_hosts(FILE *f)

        scripting_fprintf(f, "127.0.0.1 localhost\n");

should be:

        l = strlen(net_domain);
        if (l > 0) {
              scripting_fprintf(f, "127.0.0.1 localhost.%s\n", net_domain );
        }

>Release-Note:
>Audit-Trail:
>Unformatted: