NetBSD Problem Report #10713

Received: (qmail 24189 invoked from network); 30 Jul 2000 02:24:32 -0000
Message-Id: <200007291436.e6TEa9A07643@starfruit.itojun.org>
Date: Sat, 29 Jul 2000 23:36:09 +0900 (JST)
From: itojun@itojun.org
Reply-To: itojun@itojun.org
To: gnats-bugs@gnats.netbsd.org
Subject: NIS makefile does not allow "multiple IP address on hosts" mapping
X-Send-Pr-Version: 3.95

>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:   Sun Jul 30 02:25:01 +0000 2000
>Closed-Date:    
>Last-Modified:  Wed Apr 16 08:27:00 +0000 2003
>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:

From: itojun@iijlab.net
To: gnats-bugs@netbsd.org
Cc:  
Subject: Re: bin/10713
Date: Wed, 16 Apr 2003 17:26:20 +0900

 	from what I've heard, database multiple address looks like this:
 	(from Mark Andrews @ isc)

 itojun


 ipnodes:
 ::1             localhost
 127.0.0.1       localhost
 1.2.3.4         FOO bar
 1.2.6.4         FOO bar
 1.2.6.5         host

 ipnodes.byname:
 YP_MULTI_localhost ::1,127.0.0.1        localhost
 YP_MULTI_foo 1.2.3.4,1.2.6.4    FOO bar
 YP_MULTI_bar 1.2.3.4,1.2.6.4    FOO bar
 host 1.2.6.5    host

 hosts.byname:
 localhost 127.0.0.1     localhost
 host 1.2.6.5    host
 YP_MULTI_foo 1.2.3.4,1.2.6.4    FOO bar
 YP_MULTI_bar 1.2.3.4,1.2.6.4    FOO bar
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.