From Andre.Albsmeier@mchp.siemens.de  Tue Jul 22 21:32:21 1997
Received: from david.siemens.de (david.siemens.de [139.23.36.11])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA23309
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 22 Jul 1997 21:32:19 -0700 (PDT)
Received: from salomon.mchp.siemens.de (salomon.siemens.de [139.23.33.13])
	by david.siemens.de (8.8.6/8.8.5) with ESMTP id GAA28257
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Jul 1997 06:32:16 +0200 (MDT)
Received: from curry.mchp.siemens.de (daemon@curry.mchp.siemens.de [146.180.31.23])
	by salomon.mchp.siemens.de (8.8.6/8.8.5) with ESMTP id GAA06172
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Jul 1997 06:32:16 +0200 (MDT)
Received: (from daemon@localhost)
	by curry.mchp.siemens.de (8.8.6/8.8.6) id GAA19209
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Jul 1997 06:32:14 +0200 (MET DST)
Message-Id: <199707230432.GAA24951@curry.mchp.siemens.de>
Date: Wed, 23 Jul 1997 06:32:07 +0200 (CEST)
From: Andre Albsmeier <Andre.Albsmeier@mchp.siemens.de>
To: FreeBSD-gnats-submit@freebsd.org
Subject: libc changes make ypserv unimpossible to resolve hostname
X-Send-Pr-Version: 3.2

>Number:         4147
>Category:       bin
>Synopsis:       libc changes make ypserv unimpossible to resolve hostname
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 22 21:40:01 PDT 1997
>Closed-Date:    Mon Jul 28 07:17:46 PDT 1997
>Last-Modified:  Mon Jul 28 07:20:37 PDT 1997
>Originator:     Andre Albsmeier
>Release:        FreeBSD 2.2-STABLE i386
>Organization:
>Environment:

	2.2-STABLE

>Description:

Hi,

when running "ypserv -n" on 2.2-STABLE it is no longer possible for ypserv
to resolve hostnames which are not fully qualified. This is due to a change in
lib/libc/net/gethostbydns.c which now returns as h_errno NO_RECOVERY instead
of TRY_AGAIN. I have implemented an additional debugline which shows this effect
in usr.sbin/ypserv/yp_dnslookup.c.

I don't know where it should be changed; in gethostbydns.c or in yp_dnslookup.c...

Thanks

	-Andre

---------------------------------------------------------------------------------

running "ypserv -d -n" using NEW lib/libc/net/gethostbydns.c and querying
for host "pcauth" on PC-NFS client:

root@server:/usr/src/usr.sbin/ypserv>./ypserv -d -n
;; res_setoptions("debug", "env")..
;;      debug
ypserv: Procedure ypproc_domain called from 192.168.21.143:1500
ypserv: Procedure ypproc_match called from 192.168.21.143:1500
ypserv: Client is referencing map "hosts.byname".
ypserv: Looking up key [pcauth]
ypserv: Doing DNS lookup of pcauth
;; res_mkquery(0, pcauth, 1, 1)
ypserv: Queueing async DNS name lookup (399)
ypserv: Running dns queue
ypserv: Got dns reply from 192.168.16.33
ypserv: ypserv h_errno = 3
                         |
This is NO_RECOVERY------+

ypserv: Sending dns reply to 192.168.21.143 (399)
ypserv: Running dns queue
ypserv: Running dns queue


---------------------------------------------------------------------------------

running "ypserv -d -n" using OLD lib/libc/net/gethostbydns.c and querying
for host "pcauth" on PC-NFS client:

root@server:/usr/src/usr.sbin/ypserv>./ypserv -d -n
;; res_setoptions("debug", "env")..
;;      debug
ypserv: Procedure ypproc_domain called from 192.168.21.143:1500
ypserv: Procedure ypproc_match called from 192.168.21.143:1500
ypserv: Client is referencing map "hosts.byname".
ypserv: Looking up key [pcauth]
ypserv: Doing DNS lookup of pcauth
;; res_mkquery(0, pcauth, 1, 1)
ypserv: Queueing async DNS name lookup (45885)
ypserv: Running dns queue
ypserv: Got dns reply from 192.168.16.33
ypserv: ypserv h_errno = 2
                         |
This is TRY_AGAIN -------+

ypserv: Retrying with: pcauth.us.tld
;; res_mkquery(0, pcauth.us.tld, 1, 1)
ypserv: Running dns queue
ypserv: Running dns queue
ypserv: Got dns reply from 192.168.16.33
ypserv: Sending dns reply to 192.168.21.143 (45886)
ypserv: Running dns queue
ypserv: Running dns queue
ypserv: Running dns queue
ypserv: Procedure ypproc_match called from 192.168.21.143:1500
ypserv: Client is referencing map "hosts.byname".
ypserv: Looking up key [printfix.us.tld]
ypserv: Doing DNS lookup of printfix.us.tld
;; res_mkquery(0, printfix.us.tld, 1, 1)
ypserv: Queueing async DNS name lookup (45887)
ypserv: Running dns queue
ypserv: Got dns reply from 192.168.16.33
ypserv: Sending dns reply to 192.168.21.143 (45887)
g

>How-To-Repeat:

run ypserv -n and query an unqualified hostname from a PC-NFS client.

>Fix:
	

I simply have removed "h_errno == TRY_AGAIN" in usr.sbin/ypserv/yp_dnslookup.c so 
it works again.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wpaul 
State-Changed-When: Mon Jul 28 07:17:46 PDT 1997 
State-Changed-Why:  

This has now been fixed in both the RELENG_2_2 branch and in -current. 
yp_run_dnsq() has been changed so that either TRY_AGAIN or NO_RECOVERY 
will trigger the domain list traversal. I decided it was best not to 
modify the resolver library since the change in gethostanswer() came 
direct from the BIND sources; they must have had a reason for doing it 
that way, so who am I to argue. :) 

-Bill 
>Unformatted:
