From kageyama@roland.co.jp  Fri Jul  5 01:16:14 2002
Return-Path: <kageyama@roland.co.jp>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5997B37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  5 Jul 2002 01:16:14 -0700 (PDT)
Received: from mailgw1.roland.co.jp (mailgw1.roland.co.jp [133.111.200.3])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B2CBE43E09
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  5 Jul 2002 01:16:12 -0700 (PDT)
	(envelope-from kageyama@roland.co.jp)
Received: from ryulina1.roland.co.jp (scangw1.roland.co.jp [133.111.200.5])
	by mailgw1.roland.co.jp (8.9.3+Sun/3.7W) with ESMTP id RAA16601
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 5 Jul 2002 17:16:10 +0900 (JST)
Received: from mykserv.roland.co.jp (mykserv [133.111.129.139])
	by ryulina1.roland.co.jp (8.9.3/3.7W) with SMTP id RAA24303
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 5 Jul 2002 17:16:10 +0900
Received: from rdspa104.roland.co.jp ([133.111.130.134]) by mykserv.roland.co.jp (4.1/3.3W8-01121019)
	id AA08186; Fri, 5 Jul 2002 17:16:09 JST
Received: by rdspa104.roland.co.jp (4.1/3.3W8-98051510)
	id AA01663; Fri, 5 Jul 2002 17:16:09 JST
Message-Id: <020705171608.M0101655@rdspa104.roland.co.jp>
Date: Fri, 5 Jul 2002 17:16:08 +0900
From: kageyama@roland.co.jp (Morihiro Kageyama)
Reply-To: kageyama <kageyama@roland.co.jp>
To: FreeBSD-gnats-submit@freebsd.org
Subject: NIS host search not terminate
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         40215
>Category:       bin
>Synopsis:       [nis] NIS host search not terminate
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 05 01:20:01 PDT 2002
>Closed-Date:    
>Last-Modified:  Tue Jul 31 07:32:44 GMT 2007
>Originator:     kageyama
>Release:        FreeBSD 4.6-RELEASE i386
>Organization:
roland DG corp.
>Environment:
   FreeBSD r3.rdg.roland.co.jp 4.6-RELEASE FreeBSD 4.6-RELEASE #0: Thu Jun 13 20:01:28 JST 2002     kageyama@roland.co.jp:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
  %ping aa.
  yp_match: clnt_call: RPC: Timed out

>How-To-Repeat:
  /etc/host.conf : hosts
                   bind
                   nis
        
  /etc/rc.conf: nis_client_enable="YES" 
                nisdomainname="test-dom"
                nis_server_enable="YES"
                nis_yppasswdd_enable="YES"
                nis_server_flags="" or nis_server_flags="-n"

  /var/yp/Makefile.dist
		B=-b  # not comment out
   
 This is OK.
  %ping aa
   ping: cannot resolve aa: Unknown host

 Not terminate
  %ping aa.
   yp_match: clnt_call: RPC: Timed out
   yp_match: clnt_call: RPC: Timed out

>Fix:
   NIS DNS first try,  search hostname is "aa.".  it's fail.
   NIS DNS second try, serach hostname is "aa..subdomain.domain". 
                                         ^^  two dot include.

   This append is line 396 in /usr/src/usr.sbin/ypserv/yp_dnslookup.c

        if (hent == NULL) {
                if ((h_errno == TRY_AGAIN || h_errno == NO_RECOVERY)
                                        && q->domain && *q->domain) {
   domain append --->   snprintf(retrybuf, sizeof(retrybuf), "%s.%s",
                                                q->name, *q->domain);
                        if (debug)
                                yp_error("retrying with: %s", retrybuf);
                        q->id = yp_send_dns_query(retrybuf, q->type);
                        q->ttl = DEF_TTL;
                        q->domain++;
                        return;
		}

   then DNS hostname search call "res_mkquery()" is fail.
   and set h_error = NO_RECOVERY. 
   therefore ypserv is host search looping, Not answer YP error.



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->wpaul 
Responsible-Changed-By: schweikh 
Responsible-Changed-When: Fri Sep 20 10:29:01 PDT 2002 
Responsible-Changed-Why:  
Bill, can you have a look at this? It's in your code. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40215 
Responsible-Changed-From-To: wpaul->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Jul 31 07:32:01 UTC 2007 
Responsible-Changed-Why:  
Reassign from inactive committer. 

Hat:		bugmeister 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40215 
>Unformatted:
