diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2024-03-24 19:51:48 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2024-03-24 19:51:48 +0000 |
commit | 154b097e7f9d32c5e6434d6087ee4fadf7aaa84a (patch) | |
tree | 9baffb608b4354e785d64e5c65df8cc41d2d5906 /usr.bin | |
parent | 3ef626bf7cf00676ca974b3be1426d57a9e25a60 (diff) |
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. OK sthen@ job@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/whois/whois.1 | 26 | ||||
-rw-r--r-- | usr.bin/whois/whois.c | 18 |
2 files changed, 7 insertions, 37 deletions
diff --git a/usr.bin/whois/whois.1 b/usr.bin/whois/whois.1 index f5318951e07..479ab9d29ca 100644 --- a/usr.bin/whois/whois.1 +++ b/usr.bin/whois/whois.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: whois.1,v 1.40 2024/03/16 02:00:31 millert Exp $ +.\" $OpenBSD: whois.1,v 1.41 2024/03/24 19:51:47 millert Exp $ .\" $NetBSD: whois.1,v 1.5 1995/08/31 21:51:32 jtc Exp $ .\" .\" Copyright (c) 1985, 1990, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)whois.1 8.2 (Berkeley) 6/20/94 .\" -.Dd $Mdocdate: March 16 2024 $ +.Dd $Mdocdate: March 24 2024 $ .Dt WHOIS 1 .Os .Sh NAME @@ -224,28 +224,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 diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c index f45d0861fff..b554f0d8472 100644 --- a/usr.bin/whois/whois.c +++ b/usr.bin/whois/whois.c @@ -1,4 +1,4 @@ -/* $OpenBSD: whois.c,v 1.61 2024/03/16 06:29:36 jmc Exp $ */ +/* $OpenBSD: whois.c,v 1.62 2024/03/24 19:51:47 millert Exp $ */ /* * Copyright (c) 1980, 1993 @@ -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" @@ -297,10 +296,9 @@ whois(const char *query, const char *server, const char *port, int flags) /* * 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) @@ -318,13 +316,7 @@ choose_server(const char *name, const char *country, char **tofree) 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 */ |