diff options
| author | Ollivier Robert <roberto@FreeBSD.org> | 2003-01-31 21:57:10 +0000 |
|---|---|---|
| committer | Ollivier Robert <roberto@FreeBSD.org> | 2003-01-31 21:57:10 +0000 |
| commit | 96db12517f61ee3c5766897ae4ed36b9bcb3ac29 (patch) | |
| tree | 0ed16a03c61a7067fc7818a10c865cce7ad5f77e /usr.bin | |
| parent | bd5466d65ad982b8ffed8dac226f73e1fbbff3fe (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/whois/whois.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c index c0473aa29d9a..94e898bde749 100644 --- a/usr.bin/whois/whois.c +++ b/usr.bin/whois/whois.c @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #define BNICHOST "whois.registro.br" #define DEFAULT_PORT "whois" #define WHOIS_SERVER_ID "Whois Server: " +#define WHOIS_ORG_SERVER_ID "Registrant Street1:Whois Server:" #define WHOIS_RECURSE 0x01 #define WHOIS_QUICK 0x02 @@ -295,7 +296,20 @@ whois(const char *query, const char *hostname, int flags) } s_asprintf(&nhost, "%.*s", (int)(buf + len - host), host); - } else if (strcmp(hostname, ANICHOST) == 0) { + } + else if ((host = strnstr(buf, WHOIS_ORG_SERVER_ID, len)) + != NULL) { + host += sizeof(WHOIS_ORG_SERVER_ID) - 1; + for (p = host; p < buf + len; p++) { + if (!ishost(*p)) { + *p = '\0'; + break; + } + } + 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++) { |
