From owner-svn-src-all@FreeBSD.ORG Thu Jan 21 10:16:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13C18106568B; Thu, 21 Jan 2010 10:16:22 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECE798FC20; Thu, 21 Jan 2010 10:16:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0LAGL3m093857; Thu, 21 Jan 2010 10:16:21 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0LAGLRk093854; Thu, 21 Jan 2010 10:16:21 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201001211016.o0LAGLRk093854@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 21 Jan 2010 10:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202740 - stable/8/usr.bin/whois X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 10:16:22 -0000 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 , "Matt D. Harris" 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); }