Index | Thread | Search

From:
Todd C. Miller <millert@openbsd.org>
Subject:
whois: remove obsolete handle support
To:
tech@openbsd.org
Date:
Tue, 05 Mar 2024 09:30:42 -0700

Download raw body.

Thread
  • Todd C. Miller:

    whois: remove obsolete handle support

Contact handles have been obsolete for some time now.  The "!handle"
InterNic syntax no longer works and core COCO handle queries seems
to only return empty records.

 - todd

Index: usr.bin/whois/whois.1
===================================================================
RCS file: /cvs/src/usr.bin/whois/whois.1,v
diff -u -p -u -r1.39 whois.1
--- usr.bin/whois/whois.1	5 Mar 2024 16:06:32 -0000	1.39
+++ usr.bin/whois/whois.1	5 Mar 2024 16:27:55 -0000
@@ -214,28 +214,6 @@ For more information as to what
 operands have special meaning, and how to guide the search, use
 the special name
 .Dq help .
-.Ss Special cases
-Queries beginning with an exclamation point
-.Ql \&!
-are assumed to be
-.Tn NSI
-contact handles.
-Unless a host or domain is specified on the command line,
-.Pq whois.networksolutions.com
-will be used as the
-.Nm
-database.
-.Pp
-Similarly, queries beginning with
-.Dq COCO-
-are assumed to be
-.Tn CORE
-contact handles.
-Unless a host or domain is specified on the command line,
-.Pq whois.corenic.net
-will be used as the
-.Nm
-database.
 .Sh EXAMPLES
 Most types of data, such as domain names and
 .Tn IP
Index: usr.bin/whois/whois.c
===================================================================
RCS file: /cvs/src/usr.bin/whois/whois.c,v
diff -u -p -u -r1.59 whois.c
--- usr.bin/whois/whois.c	5 Mar 2024 16:06:32 -0000	1.59
+++ usr.bin/whois/whois.c	5 Mar 2024 16:27:55 -0000
@@ -46,7 +46,6 @@
 
 #define	NICHOST		"whois.crsnic.net"
 #define	INICHOST	"whois.internic.net"
-#define	CNICHOST	"whois.corenic.net"
 #define	DNICHOST	"whois.nic.mil"
 #define	GNICHOST	"whois.nic.gov"
 #define	ANICHOST	"whois.arin.net"
@@ -276,10 +275,9 @@ whois(const char *query, const char *ser
 /*
  * If no country is specified determine the top level domain from the query.
  * If the TLD is a number, query ARIN, otherwise, use TLD.whois-server.net.
- * If the domain does not contain '.', check to see if it is an NSI handle
- * (starts with '!') or a CORE handle (COCO-[0-9]+ or COHO-[0-9]+) or an
- * ASN (starts with AS) or IPv6 address (contains ':'). Fall back to
- * NICHOST for the non-handle and non-IPv6 case.
+ * If the domain does not contain '.', check to see if it is an ASN (starts
+ * with AS) or IPv6 address (contains ':').
+ * Fall back to NICHOST for the non-handle and non-IPv6 case.
  */
 char *
 choose_server(const char *name, const char *country, char **tofree)
@@ -297,13 +295,7 @@ choose_server(const char *name, const ch
 	if (country != NULL)
 		qhead = country;
 	else if ((qhead = strrchr(name, '.')) == NULL) {
-		if (*name == '!')
-			return (INICHOST);
-		else if ((strncasecmp(name, "COCO-", 5) == 0 ||
-		    strncasecmp(name, "COHO-", 5) == 0) &&
-		    strtol(name + 5, &ep, 10) > 0 && *ep == '\0')
-			return (CNICHOST);
-		else if ((strncasecmp(name, "AS", 2) == 0) &&
+		if ((strncasecmp(name, "AS", 2) == 0) &&
 		    strtol(name + 2, &ep, 10) > 0 && *ep == '\0')
 			return (MNICHOST);
 		else if (strchr(name, ':') != NULL) /* IPv6 address */