summaryrefslogtreecommitdiffstats
path: root/usr.bin/whois
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2002-09-18 07:51:46 +0000
committermike <mike@FreeBSD.org>2002-09-18 07:51:46 +0000
commit705073e549c7036c4006757ad236734705c8778d (patch)
tree5690d0b5b98a7b9a210ee5c8e48d88b62283df4e /usr.bin/whois
parent79c675698990deafd9430eee2560cdec49a04b4d (diff)
downloadFreeBSD-src-705073e549c7036c4006757ad236734705c8778d.zip
FreeBSD-src-705073e549c7036c4006757ad236734705c8778d.tar.gz
ARIN has annoyingly started using caps when referencing
whois.apnic.net. To properly receive hints for recursive IP searches, we convert a buffer to lowercase before searching for magic words. PR: 42834 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> (mostly) X-MFC-After: re approval
Diffstat (limited to 'usr.bin/whois')
-rw-r--r--usr.bin/whois/whois.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index a649f31..372fc1c 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -252,7 +252,7 @@ whois(const char *query, const char *hostname, int flags)
struct addrinfo *hostres, *res;
char *buf, *host, *nhost, *p;
int i, s;
- size_t len;
+ size_t c, len;
hostres = gethostinfo(hostname, 1);
for (res = hostres; res; res = res->ai_next) {
@@ -292,6 +292,8 @@ whois(const char *query, const char *hostname, int flags)
s_asprintf(&nhost, "%.*s",
(int)(buf + len - host), host);
} else if (strcmp(hostname, ANICHOST) == 0) {
+ for (c = 0; c <= len; c++)
+ buf[c] = tolower((int)buf[c]);
for (i = 0; ip_whois[i] != NULL; i++) {
if (strnstr(buf, ip_whois[i], len) !=
NULL) {
OpenPOWER on IntegriCloud