From at@rominet.net  Fri Jan 31 13:37:13 2003
Return-Path: <at@rominet.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 013AE37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 31 Jan 2003 13:37:13 -0800 (PST)
Received: from roadrunner.rominet.net (ATuileries-109-1-2-242.abo.wanadoo.fr [80.13.122.242])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A44D843FAF
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 31 Jan 2003 13:37:11 -0800 (PST)
	(envelope-from at@rominet.net)
Received: by roadrunner.rominet.net (Postfix, from userid 1000)
	id D0820816F; Fri, 31 Jan 2003 22:37:09 +0100 (CET)
Message-Id: <20030131213709.D0820816F@roadrunner.rominet.net>
Date: Fri, 31 Jan 2003 22:37:09 +0100 (CET)
From: Alain Thivillon <at@rominet.net>
Reply-To: Alain Thivillon <at@rominet.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: whois client does not chase referreal of new .ORG Registry
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         47770
>Category:       bin
>Synopsis:       whois client does not chase referreal of new .ORG Registry
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 31 13:40:20 PST 2003
>Closed-Date:    Fri Jan 31 13:58:32 PST 2003
>Last-Modified:  Fri Jan 31 13:58:32 PST 2003
>Originator:     Alain Thivillon
>Release:        FreeBSD 4.7-RC i386
>Organization:
Rominet Networks Inc.
>Environment:
System: FreeBSD roadrunner.rominet.net 4.7-RC FreeBSD 4.7-RC #7: Tue Sep 24 16:32:14 CEST 2002 titi@roadrunner.rominet.net:/usr/obj/usr/src/sys/ROADRUNNER i386


	
>Description:
whois client does not track "Whois Server:" line of new .ORG registry,
and authoritative whois server is not queried.

>How-To-Repeat:
  
% whois domain.org

 outputs only registrar data

...
Registrant Street1:Whois Server:whois.gandi.net
...

>Fix:

Patch below works on 31/01/2003 with current .ORG registry
format.

--- ./usr.bin/whois/whois.c.old	Sun Nov 17 16:05:55 2002
+++ ./usr.bin/whois/whois.c	Fri Jan 31 22:28:58 2003
@@ -74,6 +74,7 @@
 #define	SNICHOST	"whois.6bone.net"
 #define	BNICHOST	"whois.registro.br"
 #define	WHOIS_SERVER_ID	"Whois Server: "
+#define	WHOIS_ORG_SERVER_ID	"Registrant Street1:Whois Server:"
 
 #define WHOIS_RECURSE		0x01
 #define WHOIS_QUICK		0x02
@@ -290,7 +291,20 @@
 				}
 				s_asprintf(&nhost, "%.*s",
 				     (int)(buf + len - host), host);
-			} else if (strcmp(hostname, ANICHOST) == 0) {
+			}
+		        else if ((host =  strnstr(buf, WHOIS_ORG_SERVER_ID, len)) 
+                           != NULL) {
+                        	host += sizeof(WHOIS_ORG_SERVER_ID) - 1;
+				for (p = host; p < buf + len; p++) {
+					if (!ishost(*p)) {
+						*p = '\0';
+						break;
+					}
+				}
+				s_asprintf(&nhost, "%.*s",
+				     (int)(buf + len - host), host);
+                        } 
+                        else if (strcmp(hostname, ANICHOST) == 0) {
 				for (c = 0; c <= len; c++)
 					buf[c] = tolower((int)buf[c]);
 				for (i = 0; ip_whois[i] != NULL; i++) {

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: roberto 
State-Changed-When: Fri Jan 31 13:57:31 PST 2003 
State-Changed-Why:  
Patch applied in revision 1.33 of whois.c, thanks ! 

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