Subject: bin/10713: NIS makefile does not allow "multiple IP address on hosts" mapping
To: None <gnats-bugs@gnats.netbsd.org>
From: None <itojun@itojun.org>
List: netbsd-bugs
Date: 07/29/2000 19:24:34
>Number:         10713
>Category:       bin
>Synopsis:       NIS makefile does not allow "multiple IP address on hosts" mapping
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 29 19:25:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Jun-ichiro itojun Hagino
>Release:        20000728
>Organization:
	itojun.org
>Environment:
System: NetBSD starfruit.itojun.org 1.5C NetBSD 1.5C (STARFRUIT) #79: Fri Jul 28 17:41:41 JST 2000 itojun@starfruit.itojun.org:/usr/home/itojun/NetBSD/src/sys/arch/i386/compile/STARFRUIT i386


>Description:
	NIS database maintenance code does not support /etc/hosts with
	mutiple address for a single host.  this is rather important for
	IPv4/v6 dual stack database, like:
--
127.0.0.1	localhost
::1		localhost
--
	however, it is not IPv6 problem.  this affects IPv4-only people too.

>How-To-Repeat:
	put the following entry into /etc/hosts.
--
127.0.0.1	localhost
127.0.0.2	localhost
--
	generate NIS database (cd /var/yp; make).
	look into /var/yp/mydomain/hosts.byname.db.  you will see the following
	entry:

key = "localhost"
value = "127.0.0.1 localhost"

	on call to yp_match() from lib/libc/net/getadrinfo.c or
	lib/libc/net/gethnamaddr.c, we will lookup the the above entry,
	and will not be able to get 127.0.0.2.

>Fix:
	fix usr.sbin/ypserv/ypinit/Makefile.yp so that it would generate
	the following mapping into hosts.byname.
	libc functions can take care of multi-line entry.

key = "localhost"
value = "127.0.0.1 localhost\n127.0.0.2 localhost"
>Release-Note:
>Audit-Trail:
>Unformatted: