FreeBSD Bugzilla – Attachment 15303 Details for
Bug 28426
[PATCH] whois(1) - Recursive IP Searches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.62 KB, created by
mike
on 2001-06-26 22:10:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
mike
Created:
2001-06-26 22:10:00 UTC
Size:
2.62 KB
patch
obsolete
>Index: whois/whois.1 >=================================================================== >RCS file: /home/ncvs/src/usr.bin/whois/whois.1,v >retrieving revision 1.18 >diff -u -r1.18 whois.1 >--- whois/whois.1 2001/05/28 21:37:29 1.18 >+++ whois/whois.1 2001/06/22 06:32:02 >@@ -80,7 +80,7 @@ > .Pp > By default > .Nm >-construct the name of a whois server to use from the top-level domain >+constructs the name of a whois server to use from the top-level domain > .Pq Tn TLD > of the supplied (single) argument, and appending > .Qq Li .whois-servers.net . >@@ -91,12 +91,20 @@ > address is specified, the whois server will default to the American > Registry for Internet Numbers > .Pq Tn ARIN . >+If a query to >+.Tn ARIN >+references >+.Tn APNIC >+or >+.Tn RIPE , >+that server will be query also, provided that the >+.Fl Q >+option isn't specified. > .Pp >-If no required >-.Pa whois-servers.net >-subdomain found, fallback to >-.Pa whois.crsnic.net >-provided. >+If the query isn't a domain or IP address, >+.Nm >+will fallback to >+.Pa whois.crsnic.net . > .It Fl i > Use the Network Solutions Registry for Internet Numbers > .Pq Pa whois.networksolutions.com >Index: whois/whois.c >=================================================================== >RCS file: /home/ncvs/src/usr.bin/whois/whois.c,v >retrieving revision 1.19 >diff -u -r1.19 whois.c >--- whois/whois.c 2001/06/22 01:52:37 1.19 >+++ whois/whois.c 2001/06/22 06:32:03 >@@ -77,6 +77,8 @@ > #define WHOIS_INIC_FALLBACK 0x02 > #define WHOIS_QUICK 0x04 > >+const char *ip_whois[] = { RNICHOST, PNICHOST, NULL }; >+ > static void usage(void); > static void whois(char *, struct addrinfo *, int); > >@@ -208,7 +210,7 @@ > FILE *sfi, *sfo; > struct addrinfo hints, *res2; > char *buf, *nhost, *p; >- int nomatch, error, s; >+ int i, nomatch, error, s; > size_t len; > > for (; res; res = res->ai_next) { >@@ -234,13 +236,23 @@ > while (len && isspace(buf[len - 1])) > buf[--len] = '\0'; > >- if ((flags & WHOIS_RECURSE) && nhost == NULL && >- (p = strstr(buf, WHOIS_SERVER_ID)) != NULL) { >- p += sizeof(WHOIS_SERVER_ID) - 1; >- if ((len = strcspn(p, " \t\n\r")) != 0) { >- asprintf(&nhost, "%s", p); >- if (nhost == NULL) >- err(1, "asprintf()"); >+ if ((flags & WHOIS_RECURSE) && nhost == NULL) { >+ p = strstr(buf, WHOIS_SERVER_ID); >+ if (p != NULL) { >+ p += sizeof(WHOIS_SERVER_ID) - 1; >+ if ((len = strcspn(p, " \t\n\r")) != 0) { >+ asprintf(&nhost, "%s", p); >+ if (nhost == NULL) >+ err(1, "asprintf()"); >+ } >+ } else { >+ for (i = 0; ip_whois[i] != NULL; i++) { >+ if (strstr(buf, ip_whois[i]) == NULL) >+ continue; >+ nhost = strdup(ip_whois[i]); >+ if (nhost == NULL) >+ err(1, "strdup()"); >+ } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 28426
: 15303