Fix a regression in the .de and .dk whois special cases
Ensure the special cases trigger whether we come via a referral or via the -c option. Match host names case-insensitively. Use the default character set supported by .de (UTF-8) since that is more compatible with the modern world than ISO 8859-1. Persuade them to give us a useful answer whether an internationalized domain name is given in UTF-8 or in punycode.
This commit is contained in:
parent
6f4d88df9f
commit
f537d420bf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294613
@ -61,7 +61,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#define ABUSEHOST "whois.abuse.net"
|
#define ABUSEHOST "whois.abuse.net"
|
||||||
#define ANICHOST "whois.arin.net"
|
#define ANICHOST "whois.arin.net"
|
||||||
#define DENICHOST "de" QNICHOST_TAIL
|
#define DENICHOST "whois.denic.de"
|
||||||
|
#define DKNICHOST "whois.dk-hostmaster.dk"
|
||||||
#define FNICHOST "whois.afrinic.net"
|
#define FNICHOST "whois.afrinic.net"
|
||||||
#define GNICHOST "whois.nic.gov"
|
#define GNICHOST "whois.nic.gov"
|
||||||
#define IANAHOST "whois.iana.org"
|
#define IANAHOST "whois.iana.org"
|
||||||
@ -415,17 +416,24 @@ whois(const char *query, const char *hostname, int flags)
|
|||||||
err(EX_OSERR, "fdopen()");
|
err(EX_OSERR, "fdopen()");
|
||||||
|
|
||||||
if (!(flags & WHOIS_SPAM_ME) &&
|
if (!(flags & WHOIS_SPAM_ME) &&
|
||||||
strcmp(hostname, DENICHOST) == 0)
|
(strcasecmp(hostname, DENICHOST) == 0 ||
|
||||||
fprintf(fp, "-T dn,ace -C ISO-8859-1 %s\r\n", query);
|
strcasecmp(hostname, "de" QNICHOST_TAIL) == 0)) {
|
||||||
else if (!(flags & WHOIS_SPAM_ME) &&
|
const char *q;
|
||||||
strcmp(hostname, "dk" QNICHOST_TAIL) == 0)
|
int idn = 0;
|
||||||
|
for (q = query; *q != '\0'; q++)
|
||||||
|
if (!isascii(*q))
|
||||||
|
idn = 1;
|
||||||
|
fprintf(fp, "-T dn%s %s\r\n", idn ? "" : ",ace", query);
|
||||||
|
} else if (!(flags & WHOIS_SPAM_ME) &&
|
||||||
|
(strcasecmp(hostname, DKNICHOST) == 0 ||
|
||||||
|
strcasecmp(hostname, "dk" QNICHOST_TAIL) == 0))
|
||||||
fprintf(fp, "--show-handles %s\r\n", query);
|
fprintf(fp, "--show-handles %s\r\n", query);
|
||||||
else if ((flags & WHOIS_SPAM_ME) ||
|
else if ((flags & WHOIS_SPAM_ME) ||
|
||||||
strchr(query, ' ') != NULL)
|
strchr(query, ' ') != NULL)
|
||||||
fprintf(fp, "%s\r\n", query);
|
fprintf(fp, "%s\r\n", query);
|
||||||
else if (strcmp(hostname, ANICHOST) == 0)
|
else if (strcasecmp(hostname, ANICHOST) == 0)
|
||||||
fprintf(fp, "+ %s\r\n", query);
|
fprintf(fp, "+ %s\r\n", query);
|
||||||
else if (strcmp(hostres->ai_canonname, VNICHOST) == 0)
|
else if (strcasecmp(hostres->ai_canonname, VNICHOST) == 0)
|
||||||
fprintf(fp, "domain %s\r\n", query);
|
fprintf(fp, "domain %s\r\n", query);
|
||||||
else
|
else
|
||||||
fprintf(fp, "%s\r\n", query);
|
fprintf(fp, "%s\r\n", query);
|
||||||
|
Loading…
Reference in New Issue
Block a user