From nobody@FreeBSD.org  Sun Nov  9 15:53:07 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 52B751065670
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  9 Nov 2008 15:53:07 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 3CF518FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  9 Nov 2008 15:53:07 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mA9Fr6pI011816
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 9 Nov 2008 15:53:07 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id mA9Fr6Tu011815;
	Sun, 9 Nov 2008 15:53:06 GMT
	(envelope-from nobody)
Message-Id: <200811091553.mA9Fr6Tu011815@www.freebsd.org>
Date: Sun, 9 Nov 2008 15:53:06 GMT
From: "Matt D. Harris" <mdh_lists@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: whois(1) does not correctly send queries regarding IPv6 addresses to the RIR whois servers
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         128725
>Category:       bin
>Synopsis:       [patch] whois(1) does not correctly send queries regarding IPv6 addresses to the RIR whois servers
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    edwin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 09 16:00:09 UTC 2008
>Closed-Date:    Thu Jan 21 10:17:18 UTC 2010
>Last-Modified:  Thu Jan 21 10:20:16 UTC 2010
>Originator:     Matt D. Harris
>Release:        RELENG_7_0
>Organization:
>Environment:
FreeBSD rapier.mydomain 7.0-RELEASE-p5 FreeBSD 7.0-RELEASE-p5 #0: Thu Nov  6 14:39:04 PST 2008     root@rapier.mydomain:/usr/src/sys/i386/compile/RAPIER  i386

>Description:
An example:

(root@rapier) [/usr/local/etc]: whois 2001:960:800::2

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.                                              

No match for "2001:960:800::2".

 >>> Last update of whois database: Sun, 09 Nov 2008 10:14:51 EST <<<
 
 
For IPv4 addresses, the correct RIR whois server is automagically queried.  For CC-TLD domain names, the same is true.  Unfortunately, IPv6 queries seem to go to a domain name whois server.  

>How-To-Repeat:
Run whois(1) on a given IPv6 address without using a command line option to specify the whois server address to utilize for query resolution.  

>Fix:
I've attached a patch which replicates the behavior which is exhibited for IPv4 - which is that ARIN is queried.  This results in ARIN saying it doesn't know about RIPE, etc records, however the same behavior exists when querying an IPv4 address.  My personal feeling is that replicating the behavior exhibited for IPv4 is superior to doing something wholly different, even if it isn't perfect.  In this case, I don't know if perfection is achievable.  

Until ARIN replicates the behavior which is exhibited for IPv4 in their whois server regarding RIPE, APNIC, and other RIR data, this is likely the best we can do.  


Patch attached with submission follows:

--- whois.c	2008-11-09 10:48:41.000000000 -0500
+++ /usr/src/usr.bin/whois/whois.c	2007-04-14 10:32:48.000000000 -0400
@@ -218,11 +218,6 @@
 {
 	char *pos, *retval;
 
-	if (strchr(domain, ':'))
-	{
-		s_asprintf(&retval, "%s", ANICHOST);
-		return (retval);
-	}
 	for (pos = strchr(domain, '\0'); pos > domain && *--pos == '.';)
 		*pos = '\0';
 	if (*domain == '\0')


>Release-Note:
>Audit-Trail:

From: mdh <mdh_lists@yahoo.com>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/128725: whois(1) does not correctly send queries regarding IPv6 addresses to the RIR whois servers
Date: Sun, 9 Nov 2008 09:05:55 -0800 (PST)

 I was a bit unclear, as I was doing a lot of things at once.  You'll also notice a minor bug in my patch (I put the filenames on the command line in the wrong order, oops!)  Sorry about that.  
 
 Just to clarify, what I mean by the ARIN whois server replicating the behavior seen when querying an IPv4 address is that it returns a pointer to the correct RIR.  In the case of IPv6, it doesn't do this right now.  I've emailed hostmaster@arin.net to ask about this, as it seems counterintuitive that their whois server behaves differently in this way.  
 
 Thanks, Matt
 
 
 
       

From: Garrett Cooper <yanefbsd@gmail.com>
To: Matt D. Harris <mdh_lists@yahoo.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/128725: whois(1) does not correctly send queries regarding IPv6 addresses to the RIR whois servers
Date: Sun, 9 Nov 2008 09:10:46 -0800

 My personal thought, is that if this is indeed an issue is that block  
 should be #ifdef 0 [..] #endf and a comment should be added noting  
 this PR.
 -Garrett

From: mdh <mdh_lists@yahoo.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: bin/128725: whois(1) does not correctly send queries regarding IPv6 addresses to the RIR whois servers
Date: Sun, 9 Nov 2008 09:14:41 -0800 (PST)

 I was a bit unclear, as I was doing a lot of things at once.  You'll also notice a minor bug in my patch (I put the filenames on the command line in the wrong order, oops!)  Sorry about the confusion. 
 
 Just to clarify, what I mean by the ARIN whois server replicating the behavior seen when querying an IPv4 address is that it returns a pointer to the correct RIR.  In the case of IPv6, it doesn't do this right now.  I've emailed hostmaster@arin.net to ask about this, as it seems counterintuitive that their whois server behaves differently in this way. 
 
 Furthermore, I somehow mucked up GNATS here - the text in the "Unformatted" section shown in the web system should be appended to the "Description" section.  I had pasted in the output from whois(1) there.  
 
 Thanks, Matt
       

From: mdh <mdh_lists@yahoo.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: bin/128725: whois(1) does not correctly send queries regarding IPv6 addresses to the RIR whois servers
Date: Tue, 11 Nov 2008 15:05:33 -0800 (PST)

 --0-1041832275-1226444733=:9033
 Content-Type: text/plain; charset=us-ascii
 
 Attached is the *correct* patch - sorry about the earlier one being incorrect.  
 - Matt
 
 
 
       
 --0-1041832275-1226444733=:9033
 Content-Type: text/plain; name="patch.txt"
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment; filename="patch.txt"
 
 LS0tIC91c3Ivc3JjL3Vzci5iaW4vd2hvaXMvd2hvaXMuYwkyMDA3LTA0LTE0
 IDEwOjMyOjQ4LjAwMDAwMDAwMCAtMDQwMAorKysgd2hvaXMuYwkyMDA4LTEx
 LTA5IDEwOjQ4OjQxLjAwMDAwMDAwMCAtMDUwMApAQCAtMjE4LDYgKzIxOCwx
 MSBAQAogewogCWNoYXIgKnBvcywgKnJldHZhbDsKIAorCWlmIChzdHJjaHIo
 ZG9tYWluLCAnOicpKQorCXsKKwkJc19hc3ByaW50ZigmcmV0dmFsLCAiJXMi
 LCBBTklDSE9TVCk7CisJCXJldHVybiAocmV0dmFsKTsKKwl9CiAJZm9yIChw
 b3MgPSBzdHJjaHIoZG9tYWluLCAnXDAnKTsgcG9zID4gZG9tYWluICYmICot
 LXBvcyA9PSAnLic7KQogCQkqcG9zID0gJ1wwJzsKIAlpZiAoKmRvbWFpbiA9
 PSAnXDAnKQo=
 
 --0-1041832275-1226444733=:9033--

Date: Tue, 11 Nov 2008 15:03:15 -0800 (PST)
From: mdh <mdh_lists@yahoo.com>
Subject: Re: bin/128725: whois(1) does not correctly send queries regarding IPv6 addresses to the RIR whois servers

ARIN has responded to my query, and has stated that ARIN management
agrees with my request, and that they will be implementing "stubs" to
send appropriate RIR information regarding non-ARIN-assigned IPv6 blocks
when such a request is made to the ARIN whois server.  This will, along
with adding the block of code I sent, cause whois of an IPv6 address with
no additional command-line options to behave in the same way as whois of
an IPv4 address with no additional command line options.  :)

- Matt

From: Bob Van Zant <bob@veznat.com>
To: <bug-followup@FreeBSD.org>,
	<mdh_lists@yahoo.com>
Cc:  
Subject: Re: bin/128725: [patch] whois(1) does not correctly send queries
 regarding IPv6 addresses to the RIR whois servers
Date: Tue, 05 May 2009 14:27:02 -0700

 I applied this patch to my local system (6.2/i386) and it appears to work
 fine for v6 addresses, v4 addresses and domain names. It would be nice to
 have this little bit of v4-v6 parity pushed into the system.
 
 -Bob
 
 

From: "Dan Mahoney, System Admin" <danm@prime.gushi.org>
To: bug-followup@FreeBSD.org, mdh_lists@yahoo.com
Cc:  
Subject: Re: bin/128725: [patch] whois(1) does not correctly send queries
 regarding IPv6 addresses to the RIR whois servers
Date: Tue, 5 Jan 2010 21:42:21 -0500 (EST)

 From a quick query of ARIN, this issue appears to be mostly fixed.  The 
 stubs are in place in the arin DB and the referral server fields are 
 populated.
 
 FreeBSD 8 still lacks the ability to have whois(1) "just work" with a v6 
 address, as it does with a v4 (although the -6 option is now gone).
 
 2001:610:240:22::c100:687 == whois.ripe.net
 
 prime# whois -a 2001:610:240:22::c100:687
 
 OrgName:    RIPE Network Coordination Centre
 OrgID:      RIPE
 Address:    P.O. Box 10096
 City:       Amsterdam
 StateProv:
 PostalCode: 1001EB
 Country:    NL
 
 ReferralServer: whois://whois.ripe.net:43
 
 NetRange:   2001:0600:0000:0000:0000:0000:0000:0000 - 
 2001:07FF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
 CIDR:       2001:0600:0000:0000:0000:0000:0000:0000/23
 NetName:    EU-ZZ-2001-0600
 NetHandle:  NET6-2001-600-1
 Parent:
 NetType:    Allocated to RIPE NCC
 Comment:
 RegDate:    1999-07-01
 Updated:    2008-11-14
 
 The problem is, using -a seems to disable the following of referral 
 servers. (As I tried with a v4 ip as well).
 
 There should PROBABLY be some mention of the special treatment of the 
 "Referral Server" field in the manpage as well, as well as perhaps an 
 option to continue following referrals even when a specific server is used 
 as a starting point.
 
 -Dan Mahoney
 
 -- 
 
 "No mowore webooting!!!"
 
 -Paul, 10-16-99, 10 PM
 
 --------Dan Mahoney--------
 Techie,  Sysadmin,  WebGeek
 Gushi on efnet/undernet IRC
 ICQ: 13735144   AIM: LarpGM
 Site:  http://www.gushi.org
 ---------------------------
 
State-Changed-From-To: open->patched 
State-Changed-By: edwin 
State-Changed-When: Thu Jan 14 10:56:54 UTC 2010 
State-Changed-Why:  
Commited to head, waiting for MFC. 


Responsible-Changed-From-To: freebsd-bugs->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Jan 14 10:56:54 UTC 2010 
Responsible-Changed-Why:  
I will take care of this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=128725 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/128725: commit references a PR
Date: Thu, 14 Jan 2010 10:57:08 +0000 (UTC)

 Author: edwin
 Date: Thu Jan 14 10:56:54 2010
 New Revision: 202281
 URL: http://svn.freebsd.org/changeset/base/202281
 
 Log:
   Make whois capable of searching for IPv6 addresses just like it can
   do for IPv4 addresses without having to explicetly specify that the
   ARIN server should be used to get the initial information
   
   PR:		bin/128725
   Submitted by:	"Matt D. Harris" <mdh_lists@yahoo.com>
   MFC after:	1 week
 
 Modified:
   head/usr.bin/whois/whois.c
 
 Modified: head/usr.bin/whois/whois.c
 ==============================================================================
 --- head/usr.bin/whois/whois.c	Thu Jan 14 10:40:54 2010	(r202280)
 +++ head/usr.bin/whois/whois.c	Thu Jan 14 10:56:54 2010	(r202281)
 @@ -215,6 +215,10 @@ choose_server(char *domain)
  {
  	char *pos, *retval;
  
 +	if (strchr(domain, ':')) {
 +		s_asprintf(&retval, "%s", ANICHOST);
 +		return (retval);
 +	}
  	for (pos = strchr(domain, '\0'); pos > domain && *--pos == '.';)
  		*pos = '\0';
  	if (*domain == '\0')
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: edwin 
State-Changed-When: Thu Jan 21 10:16:59 UTC 2010 
State-Changed-Why:  
Commited, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=128725 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/128725: commit references a PR
Date: Thu, 21 Jan 2010 10:16:44 +0000 (UTC)

 Author: edwin
 Date: Thu Jan 21 10:16:21 2010
 New Revision: 202740
 URL: http://svn.freebsd.org/changeset/base/202740
 
 Log:
   MFC of 202280, 202281
   
   - Remove -d option, whois.nic.mil doesn't exist anymore.
   
   - Make whois capable of searching for IPv6 addresses just like it can
     do for IPv4 addresses without having to explicetly specify that the
     ARIN server should be used to get the initial information.
   
   PR:		bin/142507, bin/128725
   Submitted by:	Dan Mahoney <danm@prime.gushi.org>, "Matt D. Harris" <mdh_lists@yahoo.com>
 
 Modified:
   stable/8/usr.bin/whois/whois.1
   stable/8/usr.bin/whois/whois.c
 Directory Properties:
   stable/8/usr.bin/whois/   (props changed)
 
 Modified: stable/8/usr.bin/whois/whois.1
 ==============================================================================
 --- stable/8/usr.bin/whois/whois.1	Thu Jan 21 10:12:21 2010	(r202739)
 +++ stable/8/usr.bin/whois/whois.1	Thu Jan 21 10:16:21 2010	(r202740)
 @@ -40,7 +40,7 @@
  .Nd "Internet domain name and network number directory service"
  .Sh SYNOPSIS
  .Nm
 -.Op Fl aAbdfgiIklmQrR
 +.Op Fl aAbfgiIklmQrR
  .Op Fl c Ar country-code | Fl h Ar host
  .Op Fl p Ar port
  .Ar name ...
 @@ -82,11 +82,6 @@ This is the equivalent of using the
  .Fl h
  option with an argument of
  .Qq Ar country-code Ns Li .whois-servers.net .
 -.It Fl d
 -Use the US Department of Defense
 -database.
 -It contains points of contact for subdomains of
 -.Pa .MIL .
  .It Fl f
  Use the African Network Information Centre
  .Pq Tn AfriNIC
 
 Modified: stable/8/usr.bin/whois/whois.c
 ==============================================================================
 --- stable/8/usr.bin/whois/whois.c	Thu Jan 21 10:12:21 2010	(r202739)
 +++ stable/8/usr.bin/whois/whois.c	Thu Jan 21 10:16:21 2010	(r202740)
 @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$");
  #define	ABUSEHOST	"whois.abuse.net"
  #define	NICHOST		"whois.crsnic.net"
  #define	INICHOST	"whois.networksolutions.com"
 -#define	DNICHOST	"whois.nic.mil"
  #define	GNICHOST	"whois.nic.gov"
  #define	ANICHOST	"whois.arin.net"
  #define	LNICHOST	"whois.lacnic.net"
 @@ -109,7 +108,7 @@ main(int argc, char *argv[])
  
  	country = host = qnichost = NULL;
  	flags = use_qnichost = 0;
 -	while ((ch = getopt(argc, argv, "aAbc:dfgh:iIklmp:QrR6")) != -1) {
 +	while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:QrR6")) != -1) {
  		switch (ch) {
  		case 'a':
  			host = ANICHOST;
 @@ -123,9 +122,6 @@ main(int argc, char *argv[])
  		case 'c':
  			country = optarg;
  			break;
 -		case 'd':
 -			host = DNICHOST;
 -			break;
  		case 'f':
  			host = FNICHOST;
  			break;
 @@ -219,6 +215,10 @@ choose_server(char *domain)
  {
  	char *pos, *retval;
  
 +	if (strchr(domain, ':')) {
 +		s_asprintf(&retval, "%s", ANICHOST);
 +		return (retval);
 +	}
  	for (pos = strchr(domain, '\0'); pos > domain && *--pos == '.';)
  		*pos = '\0';
  	if (*domain == '\0')
 @@ -364,7 +364,7 @@ static void
  usage(void)
  {
  	fprintf(stderr,
 -	    "usage: whois [-aAbdfgiIklmQrR6] [-c country-code | -h hostname] "
 +	    "usage: whois [-aAbfgiIklmQrR6] [-c country-code | -h hostname] "
  	    "[-p port] name ...\n");
  	exit(EX_USAGE);
  }
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/128725: commit references a PR
Date: Thu, 21 Jan 2010 10:16:59 +0000 (UTC)

 Author: edwin
 Date: Thu Jan 21 10:16:32 2010
 New Revision: 202741
 URL: http://svn.freebsd.org/changeset/base/202741
 
 Log:
   MFC of 202280, 202281
   
   - Remove -d option, whois.nic.mil doesn't exist anymore.
   
   - Make whois capable of searching for IPv6 addresses just like it can
     do for IPv4 addresses without having to explicetly specify that the
     ARIN server should be used to get the initial information.
   
   PR:             bin/142507, bin/128725
   Submitted by:   Dan Mahoney <danm@prime.gushi.org>, "Matt D. Harris" <mdh_lists@
 
 Modified:
   stable/7/usr.bin/whois/whois.1
   stable/7/usr.bin/whois/whois.c
 Directory Properties:
   stable/7/usr.bin/whois/   (props changed)
 
 Modified: stable/7/usr.bin/whois/whois.1
 ==============================================================================
 --- stable/7/usr.bin/whois/whois.1	Thu Jan 21 10:16:21 2010	(r202740)
 +++ stable/7/usr.bin/whois/whois.1	Thu Jan 21 10:16:32 2010	(r202741)
 @@ -40,7 +40,7 @@
  .Nd "Internet domain name and network number directory service"
  .Sh SYNOPSIS
  .Nm
 -.Op Fl aAbdfgiIklmQrR
 +.Op Fl aAbfgiIklmQrR
  .Op Fl c Ar country-code | Fl h Ar host
  .Op Fl p Ar port
  .Ar name ...
 @@ -82,11 +82,6 @@ This is the equivalent of using the
  .Fl h
  option with an argument of
  .Qq Ar country-code Ns Li .whois-servers.net .
 -.It Fl d
 -Use the US Department of Defense
 -database.
 -It contains points of contact for subdomains of
 -.Pa .MIL .
  .It Fl f
  Use the African Network Information Centre
  .Pq Tn AfriNIC
 
 Modified: stable/7/usr.bin/whois/whois.c
 ==============================================================================
 --- stable/7/usr.bin/whois/whois.c	Thu Jan 21 10:16:21 2010	(r202740)
 +++ stable/7/usr.bin/whois/whois.c	Thu Jan 21 10:16:32 2010	(r202741)
 @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$");
  #define	ABUSEHOST	"whois.abuse.net"
  #define	NICHOST		"whois.crsnic.net"
  #define	INICHOST	"whois.networksolutions.com"
 -#define	DNICHOST	"whois.nic.mil"
  #define	GNICHOST	"whois.nic.gov"
  #define	ANICHOST	"whois.arin.net"
  #define	LNICHOST	"whois.lacnic.net"
 @@ -109,7 +108,7 @@ main(int argc, char *argv[])
  
  	country = host = qnichost = NULL;
  	flags = use_qnichost = 0;
 -	while ((ch = getopt(argc, argv, "aAbc:dfgh:iIklmp:QrR6")) != -1) {
 +	while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:QrR6")) != -1) {
  		switch (ch) {
  		case 'a':
  			host = ANICHOST;
 @@ -123,9 +122,6 @@ main(int argc, char *argv[])
  		case 'c':
  			country = optarg;
  			break;
 -		case 'd':
 -			host = DNICHOST;
 -			break;
  		case 'f':
  			host = FNICHOST;
  			break;
 @@ -219,6 +215,10 @@ choose_server(char *domain)
  {
  	char *pos, *retval;
  
 +	if (strchr(domain, ':')) {
 +		s_asprintf(&retval, "%s", ANICHOST);
 +		return (retval);
 +	}
  	for (pos = strchr(domain, '\0'); pos > domain && *--pos == '.';)
  		*pos = '\0';
  	if (*domain == '\0')
 @@ -364,7 +364,7 @@ static void
  usage(void)
  {
  	fprintf(stderr,
 -	    "usage: whois [-aAbdfgiIklmQrR6] [-c country-code | -h hostname] "
 +	    "usage: whois [-aAbfgiIklmQrR6] [-c country-code | -h hostname] "
  	    "[-p port] name ...\n");
  	exit(EX_USAGE);
  }
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/128725: commit references a PR
Date: Thu, 21 Jan 2010 10:17:07 +0000 (UTC)

 Author: edwin
 Date: Thu Jan 21 10:16:49 2010
 New Revision: 202742
 URL: http://svn.freebsd.org/changeset/base/202742
 
 Log:
   MFC of 202280, 202281
   
   - Remove -d option, whois.nic.mil doesn't exist anymore.
   
   - Make whois capable of searching for IPv6 addresses just like it can
     do for IPv4 addresses without having to explicetly specify that the
     ARIN server should be used to get the initial information.
   
   PR:             bin/142507, bin/128725
   Submitted by:   Dan Mahoney <danm@prime.gushi.org>, "Matt D. Harris" <mdh_lists@
 
 Modified:
   stable/6/usr.bin/whois/whois.1
   stable/6/usr.bin/whois/whois.c
 Directory Properties:
   stable/6/usr.bin/whois/   (props changed)
 
 Modified: stable/6/usr.bin/whois/whois.1
 ==============================================================================
 --- stable/6/usr.bin/whois/whois.1	Thu Jan 21 10:16:32 2010	(r202741)
 +++ stable/6/usr.bin/whois/whois.1	Thu Jan 21 10:16:49 2010	(r202742)
 @@ -40,7 +40,7 @@
  .Nd "Internet domain name and network number directory service"
  .Sh SYNOPSIS
  .Nm
 -.Op Fl aAbdfgiIklmQrR
 +.Op Fl aAbfgiIklmQrR
  .Op Fl c Ar country-code | Fl h Ar host
  .Op Fl p Ar port
  .Ar name ...
 @@ -82,11 +82,6 @@ This is the equivalent of using the
  .Fl h
  option with an argument of
  .Qq Ar country-code Ns Li .whois-servers.net .
 -.It Fl d
 -Use the US Department of Defense
 -database.
 -It contains points of contact for subdomains of
 -.Pa .MIL .
  .It Fl f
  Use the African Network Information Centre
  .Pq Tn AfriNIC
 
 Modified: stable/6/usr.bin/whois/whois.c
 ==============================================================================
 --- stable/6/usr.bin/whois/whois.c	Thu Jan 21 10:16:32 2010	(r202741)
 +++ stable/6/usr.bin/whois/whois.c	Thu Jan 21 10:16:49 2010	(r202742)
 @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$");
  #define	ABUSEHOST	"whois.abuse.net"
  #define	NICHOST		"whois.crsnic.net"
  #define	INICHOST	"whois.networksolutions.com"
 -#define	DNICHOST	"whois.nic.mil"
  #define	GNICHOST	"whois.nic.gov"
  #define	ANICHOST	"whois.arin.net"
  #define	LNICHOST	"whois.lacnic.net"
 @@ -109,7 +108,7 @@ main(int argc, char *argv[])
  
  	country = host = qnichost = NULL;
  	flags = use_qnichost = 0;
 -	while ((ch = getopt(argc, argv, "aAbc:dfgh:iIklmp:QrR6")) != -1) {
 +	while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:QrR6")) != -1) {
  		switch (ch) {
  		case 'a':
  			host = ANICHOST;
 @@ -123,9 +122,6 @@ main(int argc, char *argv[])
  		case 'c':
  			country = optarg;
  			break;
 -		case 'd':
 -			host = DNICHOST;
 -			break;
  		case 'f':
  			host = FNICHOST;
  			break;
 @@ -219,6 +215,10 @@ choose_server(char *domain)
  {
  	char *pos, *retval;
  
 +	if (strchr(domain, ':')) {
 +		s_asprintf(&retval, "%s", ANICHOST);
 +		return (retval);
 +	}
  	for (pos = strchr(domain, '\0'); pos > domain && *--pos == '.';)
  		*pos = '\0';
  	if (*domain == '\0')
 @@ -362,7 +362,7 @@ static void
  usage(void)
  {
  	fprintf(stderr,
 -	    "usage: whois [-aAbdfgiIklmQrR6] [-c country-code | -h hostname] "
 +	    "usage: whois [-aAbfgiIklmQrR6] [-c country-code | -h hostname] "
  	    "[-p port] name ...\n");
  	exit(EX_USAGE);
  }
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
