From 257abceab316ce713f9af75e2a1ff7ad03e34254 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 02:15:53 +0200 Subject: [PATCH 01/29] Fix 1 and 2 octects in-addr.arpa queries Queries like 85.in-addr.arpa and 94.85.in-addr.arpa were directed to the wrong server. --- whois.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/whois.c b/whois.c index c3d2a1d..c4afc09 100644 --- a/whois.c +++ b/whois.c @@ -1247,7 +1247,11 @@ char *convert_inaddr(const char *s) if (domcmp(endptr + 1, ".in-addr.arpa")) return strdup("0.0.0.0"); + } else { + c = b; b = a; a = 0; } + } else { + c = a; a = 0; } new = malloc(sizeof("255.255.255.255")); From 3aa160e6a14c9f14055d1864763c6408c363e6ef Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 14:30:35 +0200 Subject: [PATCH 02/29] Add in_domain() to check if the argument is a subdomain --- whois.c | 26 ++++++++++++++++++++++++++ whois.h | 1 + 2 files changed, 27 insertions(+) diff --git a/whois.c b/whois.c index c4afc09..60d2971 100644 --- a/whois.c +++ b/whois.c @@ -1049,6 +1049,32 @@ int domcmp(const char *dom, const char *tld) return 0; } +/* check if dom is a subdomain of tld */ +int in_domain(const char *dom, const char *tld) +{ + size_t dom_len, tld_len; + const char *p = NULL; + + if ((dom_len = strlen(dom)) == 0) + return 0; + + if ((tld_len = strlen(tld)) == 0) + return 0; + + /* dom cannot be shorter than what we are looking for */ + /* -1 to ignore dom containing just a dot and tld */ + if (tld_len >= dom_len - 1) + return 0; + + p = dom + dom_len - tld_len; + + /* fail if the character before tld is not a dot */ + if (*(p - 1) != '.') + return 0; + + return strcaseeq(p, tld); +} + const char *is_new_gtld(const char *s) { int i; diff --git a/whois.h b/whois.h index 3fd49bb..a4b8a3e 100644 --- a/whois.h +++ b/whois.h @@ -29,6 +29,7 @@ unsigned long myinet_aton(const char *); unsigned long asn32_to_long(const char *); int isasciidigit(const char); int domcmp(const char *, const char *); +int in_domain(const char *, const char *); const char *is_new_gtld(const char *); int domfind(const char *, const char *[]); char *normalize_domain(const char *); From 3ad4f437351340cf1c1faada80d01f886202ca58 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 15:02:14 +0200 Subject: [PATCH 03/29] Convert is_new_gtld() to in_domain() --- make_new_gtlds.pl | 2 +- whois.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/make_new_gtlds.pl b/make_new_gtlds.pl index 964a2f7..d377f0b 100755 --- a/make_new_gtlds.pl +++ b/make_new_gtlds.pl @@ -11,6 +11,6 @@ while (<>) { die "format error: $_" if not /^((?:xn--)?[a-z0-9]+)$/; - print qq| ".$_",\n|; + print qq| "$_",\n|; } diff --git a/whois.c b/whois.c index 60d2971..3e454ca 100644 --- a/whois.c +++ b/whois.c @@ -1080,8 +1080,8 @@ const char *is_new_gtld(const char *s) int i; for (i = 0; new_gtlds[i]; i++) - if (domcmp(s, new_gtlds[i])) - return new_gtlds[i] + 1; + if (in_domain(s, new_gtlds[i])) + return new_gtlds[i]; return 0; } From 45bdfcc27c550902b21e6bbbdd20b80eb211d378 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 15:03:13 +0200 Subject: [PATCH 04/29] Convert convert_inaddr() to in_domain() --- whois.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/whois.c b/whois.c index 3e454ca..0e7f6b8 100644 --- a/whois.c +++ b/whois.c @@ -1261,17 +1261,17 @@ char *convert_inaddr(const char *s) if (errno || a < 0 || a > 255 || *endptr != '.') return strdup("0.0.0.0"); - if (domcmp(endptr + 1, ".in-addr.arpa")) { + if (in_domain(endptr + 1, "in-addr.arpa")) { b = strtol(endptr + 1, &endptr, 10); /* 1.2. */ if (errno || b < 0 || b > 255 || *endptr != '.') return strdup("0.0.0.0"); - if (domcmp(endptr + 1, ".in-addr.arpa")) { + if (in_domain(endptr + 1, "in-addr.arpa")) { c = strtol(endptr + 1, &endptr, 10); /* 1.2.3. */ if (errno || c < 0 || c > 255 || *endptr != '.') return strdup("0.0.0.0"); - if (domcmp(endptr + 1, ".in-addr.arpa")) + if (in_domain(endptr + 1, "in-addr.arpa")) return strdup("0.0.0.0"); } else { c = b; b = a; a = 0; From 842e142f1ad86bb902d609760befa0ca694bbc03 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 15:06:00 +0200 Subject: [PATCH 05/29] Convert queryformat() to in_domain() --- whois.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/whois.c b/whois.c index 0e7f6b8..8b2183f 100644 --- a/whois.c +++ b/whois.c @@ -633,9 +633,9 @@ char *queryformat(const char *server, const char *flags, const char *query) /* add useful default flags if there are no flags or multiple arguments */ if (isripe) { } else if (strchr(query, ' ') || *flags) { } - else if (streq(server, "whois.denic.de") && domcmp(query, ".de")) + else if (streq(server, "whois.denic.de") && in_domain(query, "de")) strcat(buf, "-T dn" DENIC_PARAM_ACE DENIC_PARAM_CHARSET " "); - else if (streq(server, "whois.dk-hostmaster.dk") && domcmp(query, ".dk")) + else if (streq(server, "whois.dk-hostmaster.dk") && in_domain(query, "dk")) strcat(buf, "--show-handles "); /* mangle and add the query string */ From 29b1a3a9c33c93362bbb280b2517a5ae4f433db4 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 15:07:23 +0200 Subject: [PATCH 06/29] Split nic_handles_list off tld_serv_list To be able to use in_domain() for tld_serv_list --- .gitignore | 1 + Makefile | 3 +++ data.h | 5 +++++ make_nic_handles.pl | 17 +++++++++++++++++ nic_handles_list | 22 ++++++++++++++++++++++ tld_serv_list | 35 ----------------------------------- whois.c | 6 ++++++ 7 files changed, 54 insertions(+), 35 deletions(-) create mode 100755 make_nic_handles.pl create mode 100644 nic_handles_list diff --git a/.gitignore b/.gitignore index dabbc22..f0f26c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *_del.h new_gtlds.h +nic_handles.h tld_serv.h servers_charset.h version.h diff --git a/Makefile b/Makefile index 8f1ca35..b26c0b8 100644 --- a/Makefile +++ b/Makefile @@ -87,6 +87,9 @@ ip6_del.h: ip6_del_list make_ip6_del.pl new_gtlds.h: new_gtlds_list make_new_gtlds.pl $(PERL) make_new_gtlds.pl < $< > $@ +nic_handles.h: nic_handles_list make_nic_handles.pl + $(PERL) make_nic_handles.pl < $< > $@ + tld_serv.h: tld_serv_list make_tld_serv.pl $(PERL) make_tld_serv.pl < $< > $@ diff --git a/data.h b/data.h index 797eaae..7ac4ede 100644 --- a/data.h +++ b/data.h @@ -159,6 +159,11 @@ const char *tld_serv[] = { NULL, NULL }; +const char *nic_handles_post[] = { +#include "nic_handles.h" + NULL, NULL +}; + #ifdef HAVE_ICONV struct server_charset { const char *name; diff --git a/make_nic_handles.pl b/make_nic_handles.pl new file mode 100755 index 0000000..6b031c2 --- /dev/null +++ b/make_nic_handles.pl @@ -0,0 +1,17 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +while (<>) { + chomp; + s/#.*$//; + s/^\s+//; s/\s+$//; + next if /^$/; + + die "format error: $_" if not + (my ($a, $b) = /^(-\w+)\s+([\w\d\.:-]+)$/); + + print qq| "$a",\t"$b",\n|; +} + diff --git a/nic_handles_list b/nic_handles_list new file mode 100644 index 0000000..44e019b --- /dev/null +++ b/nic_handles_list @@ -0,0 +1,22 @@ +-arin whois.arin.net +-ripe whois.ripe.net +-mnt whois.ripe.net +-lacnic whois.lacnic.net +-afrinic whois.afrinic.net +-ap whois.apnic.net +-cznic whois.nic.cz +-dk whois.dk-hostmaster.dk +-il whois.isoc.org.il +-is whois.isnic.is +-kg whois.domain.kg +-coop whois.nic.coop +-frnic whois.nic.fr +-lrms whois.afilias.info +-metu whois.nic.tr +-nicat whois.nic.at +-nicci whois.nic.ci +-irnic whois.nic.ir +-norid whois.norid.no +-tel whois.nic.tel +-adnic whois.nic.org.uy +-sixxs whois.sixxs.net diff --git a/tld_serv_list b/tld_serv_list index 51fa1c6..8f6a50f 100644 --- a/tld_serv_list +++ b/tld_serv_list @@ -385,38 +385,3 @@ .xn--xkc2dl3a5ee0h whois.inregistry.net # India, Tamil AW .xn--yfro4i67o whois.sgnic.sg # Singapore, Chinese .xn--ygbi2ammx whois.pnina.ps # Palestinian Territory - --dom whois.networksolutions.com --org whois.networksolutions.com --hst whois.networksolutions.com --arin whois.arin.net --ripe whois.ripe.net --mnt whois.ripe.net --lacnic whois.lacnic.net --afrinic whois.afrinic.net --ap whois.apnic.net --cn whois.cnnic.cn --cz whois.nic.cz --dk whois.dk-hostmaster.dk --il whois.isoc.org.il --is whois.isnic.is --kg whois.domain.kg --ti whois.telstra.net --tw whois.twnic.net.tw --coop whois.nic.coop --frnic whois.nic.fr --gandi whois.gandi.net --kenic whois.kenic.or.ke --lrms whois.afilias.info --metu whois.nic.tr --nicat whois.nic.at --nicci whois.nic.ci --nicir whois.nic.ir --norid whois.norid.no --rotld whois.rotld.ro --sgnic whois.sgnic.sg --tel whois.nic.tel --uanic whois.ua --cunic whois.cunic.ua --uynic whois.nic.org.uy --sixxs whois.sixxs.net diff --git a/whois.c b/whois.c index 8b2183f..3345535 100644 --- a/whois.c +++ b/whois.c @@ -541,6 +541,12 @@ char *guess_server(const char *s) for (i = 0; nic_handles[i]; i += 2) if (strncaseeq(s, nic_handles[i], strlen(nic_handles[i]))) return strdup(nic_handles[i + 1]); + + /* search for strings at the end of the word */ + for (i = 0; nic_handles_post[i]; i += 2) + if (domcmp(s, nic_handles_post[i])) + return strdup(nic_handles_post[i + 1]); + /* it's probably a network name */ return strdup(""); } From d96160845111810ff5fb43abf384cfa4c204f8f7 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 15:20:04 +0200 Subject: [PATCH 07/29] Convert tld_serv_list to in_domain() --- make_tld_serv.pl | 2 +- whois.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/make_tld_serv.pl b/make_tld_serv.pl index 6afa03e..c962015 100755 --- a/make_tld_serv.pl +++ b/make_tld_serv.pl @@ -10,7 +10,7 @@ while (<>) { next if /^$/; die "format error: $_" if not - (my ($a, $b) = /^([\w\d\.-]+)\s+([\w\d\.:-]+|[A-Z]+\s+.*)$/); + (my ($a, $b) = /^\.(\w[\w\d\.-]+)\s+([\w\d\.:-]+|[A-Z]+\s+.*)$/); $b =~ s/^W(?:EB)?\s+/\\x01/; $b =~ s/^VERISIGN\s+/\\x04" "/; diff --git a/whois.c b/whois.c index 3345535..7cb54bc 100644 --- a/whois.c +++ b/whois.c @@ -524,7 +524,7 @@ char *guess_server(const char *s) /* check the TLDs list */ for (i = 0; tld_serv[i]; i += 2) - if (domcmp(s, tld_serv[i])) + if (in_domain(s, tld_serv[i])) return strdup(tld_serv[i + 1]); /* use the default server name for "new" gTLDs */ From 4cc74ef22a51e1e394049c1ed4f4c4f482c48328 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 15:35:47 +0200 Subject: [PATCH 08/29] Remove obsolete entries from ripe_servers[] --- data.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/data.h b/data.h index 7ac4ede..4ec505e 100644 --- a/data.h +++ b/data.h @@ -11,17 +11,13 @@ const char *ripe_servers[] = { "whois.apnic.net", "whois.afrinic.net", "rr.arin.net", /* does not accept the old syntax */ - "whois.6bone.net", /* 3.0.0b1 */ "whois.connect.com.au", /* 3.0.0b1 */ "whois.nic.fr", - "whois.telstra.net", "whois.restena.lu", "rr.level3.net", /* 3.0.0a13 */ "whois.ripn.net", "whois.arnes.si", - "www.registry.co.ug", "whois.nic.ir", - "whois.nic.ck", "whois.ra.net", "whois.bgpmon.net", NULL From 8ccab2cb13c178bd487acd9566d9e38ee0ffbb30 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 20:38:10 +0200 Subject: [PATCH 09/29] Ask whois.iana.org about TLDs Recognize as a TLD any string without dots present in tld_serv_list and new_gtlds_list. --- whois.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/whois.c b/whois.c index 7cb54bc..125db8e 100644 --- a/whois.c +++ b/whois.c @@ -496,6 +496,15 @@ char *guess_server(const char *s) /* no dot and no hyphen means it's a NSI NIC handle or ASN (?) */ if (!strpbrk(s, ".-")) { + /* if it is a TLD or a new gTLD then ask IANA */ + for (i = 0; tld_serv[i]; i += 2) + if (strcaseeq(s, tld_serv[i])) + return strdup("whois.iana.org"); + + for (i = 0; new_gtlds[i]; i++) + if (strcaseeq(s, new_gtlds[i])) + return strdup("whois.iana.org"); + if (strncaseeq(s, "as", 2) && /* it's an AS */ (isasciidigit(s[2]) || s[2] == ' ')) return strdup(whereas(atol(s + 2))); From db5dc4db7ab40d7218d9dfdf2cad66f084cd55b1 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 20:51:04 +0200 Subject: [PATCH 10/29] Rename domcmp() in endstrcaseeq() and rewrite it Rewrite it to use the same code of in_domain(). --- whois.c | 30 ++++++++++++++++++------------ whois.h | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/whois.c b/whois.c index 125db8e..513f018 100644 --- a/whois.c +++ b/whois.c @@ -442,7 +442,7 @@ const char *match_config_file(const char *s) } regfree(&re); #else - if (domcmp(s, pattern)) { + if (endstrcaseeq(s, pattern)) { fclose(fp); return strdup(server); } @@ -553,7 +553,7 @@ char *guess_server(const char *s) /* search for strings at the end of the word */ for (i = 0; nic_handles_post[i]; i += 2) - if (domcmp(s, nic_handles_post[i])) + if (endstrcaseeq(s, nic_handles_post[i])) return strdup(nic_handles_post[i + 1]); /* it's probably a network name */ @@ -1050,18 +1050,24 @@ int japanese_locale(void) { } /* check if dom ends with tld */ -int domcmp(const char *dom, const char *tld) +int endstrcaseeq(const char *dom, const char *tld) { - const char *p, *q; + size_t dom_len, tld_len; + const char *p = NULL; - for (p = dom; *p; p++); p--; /* move to the last char */ - for (q = tld; *q; q++); q--; - while (p >= dom && q >= tld && tolower(*p) == *q) { /* compare backwards */ - if (q == tld) /* start of the second word? */ - return 1; - p--; q--; - } - return 0; + if ((dom_len = strlen(dom)) == 0) + return 0; + + if ((tld_len = strlen(tld)) == 0) + return 0; + + /* dom cannot be shorter than what we are looking for */ + if (tld_len > dom_len) + return 0; + + p = dom + dom_len - tld_len; + + return strcaseeq(p, tld); } /* check if dom is a subdomain of tld */ diff --git a/whois.h b/whois.h index a4b8a3e..205b763 100644 --- a/whois.h +++ b/whois.h @@ -28,7 +28,7 @@ int japanese_locale(void); unsigned long myinet_aton(const char *); unsigned long asn32_to_long(const char *); int isasciidigit(const char); -int domcmp(const char *, const char *); +int endstrcaseeq(const char *, const char *); int in_domain(const char *, const char *); const char *is_new_gtld(const char *); int domfind(const char *, const char *[]); From ac73668757ea69931cd6185236479a06f2464f16 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 22:07:26 +0200 Subject: [PATCH 11/29] Add the charset for whois.domain.kg --- servers_charset_list | 1 + 1 file changed, 1 insertion(+) diff --git a/servers_charset_list b/servers_charset_list index 0a4d247..a994872 100644 --- a/servers_charset_list +++ b/servers_charset_list @@ -32,6 +32,7 @@ whois.isnic.is iso-8859-1 whois.nic.it utf-8 whois.jprs.jp iso-2022-jp whois.nic.ad.jp iso-2022-jp +whois.domain.kg cp1251 whois.nic.or.kr utf-8 whois.kr utf-8 # XXX I had to guess: the server is unable to fully transcode U+49b in the From 28ea3fb0558222fe4b453beedf33a9219b574d9b Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 22:53:05 +0200 Subject: [PATCH 12/29] fix the validation regexp in make_new_gtlds.pl --- make_new_gtlds.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make_new_gtlds.pl b/make_new_gtlds.pl index d377f0b..dc7110e 100755 --- a/make_new_gtlds.pl +++ b/make_new_gtlds.pl @@ -9,7 +9,7 @@ while (<>) { s/^\s+//; s/\s+$//; next if /^$/; - die "format error: $_" if not /^((?:xn--)?[a-z0-9]+)$/; + die "format error: $_" if not /^(xn--[a-z0-9-]+|[a-z]+)$/; print qq| "$_",\n|; } From 77df07581ca6b4be62eb47d914b6c9be981b60af Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 22:14:49 +0200 Subject: [PATCH 13/29] Update the list of new gTLDs --- new_gtlds_list | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/new_gtlds_list b/new_gtlds_list index df530c0..1710872 100644 --- a/new_gtlds_list +++ b/new_gtlds_list @@ -4,12 +4,15 @@ # Any exceptions can be handled in tld_serv_list as usual, since it will # be checked first. +abogado academy accountants active actor agency airforce +allfinanz +alsace archi army associates @@ -18,6 +21,7 @@ auction audio autos axa +band bar bargains bayern @@ -35,12 +39,14 @@ bnpparibas boo boutique brussels +budapest build builders business buzz bzh cab +cal camera camp cancerresearch @@ -51,13 +57,16 @@ cards care career careers +casa cash catering center ceo cern +channel cheap christmas +chrome church citic city @@ -84,6 +93,7 @@ cool country credit creditcard +crs cruises cuisinella cymru @@ -106,6 +116,7 @@ discount dnp domains durban +dvag eat education email @@ -130,7 +141,10 @@ fishing fitness flights florist +flsmidth +fly foo +forsale foundation frl frogans @@ -145,11 +159,13 @@ gift gifts gives glass +gle global globo gmail gmo gmx +google gop graphics gratis @@ -173,6 +189,7 @@ host hosting house how +ibm immo immobilien industries @@ -234,6 +251,7 @@ net network neustar new +nexus ngo nhk ninja @@ -262,10 +280,13 @@ pink pizza place plumbing +pohl +poker praxi press prod productions +prof properties property pub @@ -287,6 +308,7 @@ restaurant reviews rich rio +rip rocks rodeo rsvp @@ -334,6 +356,7 @@ town toys trade training +tui university uno uol @@ -357,12 +380,15 @@ watch webcam website wed +wedding whoswho wien wiki williamhill wme +work works +world wtc wtf xn--1qqw23a @@ -390,16 +416,21 @@ xn--mgbab2bd xn--ngbc5azd xn--nqv7f xn--nqv7fs00ema +xn--p1acf xn--q9jyb4c xn--rhqv96g xn--ses554g xn--unup4y +xn--vermgensberater-ctb +xn--vermgensberatung-pwb xn--vhquv xn--xhq521b xn--zfr164b xyz yachts yandex +yoga yokohama youtube +zip zone From 2d00c3e346077f756b56b33c37fd3154ca4a1ec3 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Wed, 15 Oct 2014 22:16:49 +0200 Subject: [PATCH 14/29] Update TLD servers: gq mz --- tld_serv_list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tld_serv_list b/tld_serv_list index 8f6a50f..ab2719c 100644 --- a/tld_serv_list +++ b/tld_serv_list @@ -156,7 +156,7 @@ .gm WEB http://www.nic.gm/htmlpages/whois.htm .gn NONE # http://www.psg.com/dns/gn/ .gp WEB https://www.dom-enic.com/whois.html -.gq NONE # NO NIC http://www.getesa.gq/ +.gq whois.dominio.gq .gr WEB https://grweb.ics.forth.gr/Whois?lang=en .gs whois.nic.gs .gt WEB http://www.gt/who_is.html @@ -227,7 +227,7 @@ .mw WEB http://www.registrar.mw/ .mx whois.mx .my whois.mynic.my -.mz NONE # NIC? www.uem.mz +.mz whois.nic.mz .na whois.na-nic.com.na .nc whois.nc .ne NONE # NIC? http://www.intnet.ne From a4355256d8425cf307e6926f4b595cd801c42c90 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Thu, 16 Oct 2014 01:53:46 +0200 Subject: [PATCH 15/29] Update the policy version --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 9006ad9..f4b963a 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: whois Section: net Priority: standard Maintainer: Marco d'Itri -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 Build-Depends: debhelper (>= 5), gettext, libidn11-dev Vcs-Git: git://github.com/rfc1036/whois.git Vcs-Browser: https://github.com/rfc1036/whois From d9d1a444f05373c0b0c7e62b6b2149ebd6f1f5bf Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Thu, 16 Oct 2014 01:59:57 +0200 Subject: [PATCH 16/29] Add the missing Language headers in some PO files --- po/eu.po | 2 +- po/pt_BR.po | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/po/eu.po b/po/eu.po index 73a6bfe..d0362ea 100644 --- a/po/eu.po +++ b/po/eu.po @@ -11,7 +11,7 @@ msgstr "" "PO-Revision-Date: 2002-08-24 16:22+0200\n" "Last-Translator: Aitor Ibaez \n" "Language-Team: Euskara \n" -"Language: \n" +"Language: eu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index 34285d2..9a471b1 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -11,7 +11,7 @@ msgstr "" "PO-Revision-Date: 2006-04-26 21:03-0300\n" "Last-Translator: Anderson Goulart \n" "Language-Team: Portuguese/Brazil\n" -"Language: \n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" From a34f18b7a0c865a27dfbb313eea241f6ac6d2b5b Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Thu, 16 Oct 2014 01:51:01 +0200 Subject: [PATCH 17/29] Debian changelog for 5.2.1 --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5ff9a1c..389e4a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +whois (5.2.1) unstable; urgency=medium + + * Added the .aw and .zm TLD servers. + * Added the charset for whois.domain.kg. + * Updated the list of new gTLDs. + * Queries for bare TLDs will be directed to whois.iana.org. + (Closes: #763833) + + -- Marco d'Itri Thu, 16 Oct 2014 02:01:20 +0200 + whois (5.2.0) unstable; urgency=medium * Implemented support for the long RIPE flags. From e054c58eb223702ae0d4d2b7ba625c93a75637c2 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Fri, 24 Oct 2014 09:21:20 +0200 Subject: [PATCH 18/29] Fix the code that removes trailing dots And make it easier to understand as well. --- whois.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/whois.c b/whois.c index 513f018..fdb2824 100644 --- a/whois.c +++ b/whois.c @@ -1110,7 +1110,7 @@ const char *is_new_gtld(const char *s) /* * Attempt to normalize a query by removing trailing dots and whitespace, * then convert the domain to punycode. - * The function assumes that the domain is the last token of they query. + * The function assumes that the domain is the last token of the query. * Returns a malloc'ed string which needs to be freed by the caller. */ char *normalize_domain(const char *dom) @@ -1121,10 +1121,15 @@ char *normalize_domain(const char *dom) #endif ret = strdup(dom); - /* eat trailing dots and blanks */ - p = ret + strlen(ret); - for (; *p == '.' || *p == ' ' || *p == '\t' || p == ret; p--) + /* start from the last character */ + p = ret + strlen(ret) - 1; + /* and then eat trailing dots and blanks */ + while (p > ret) { + if (!(*p == '.' || *p == ' ' || *p == '\t')) + break; *p = '\0'; + p--; + } #ifdef HAVE_LIBIDN /* find the start of the last word if there are spaces in the query */ From af9e5410da1a283a9c81288fe4ca678a07a77fe9 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Sun, 26 Oct 2014 00:36:31 +0200 Subject: [PATCH 19/29] Add the .xn--d1alf and .xn--node TLD servers --- servers_charset_list | 1 + tld_serv_list | 2 ++ 2 files changed, 3 insertions(+) diff --git a/servers_charset_list b/servers_charset_list index a994872..2ad0ab7 100644 --- a/servers_charset_list +++ b/servers_charset_list @@ -41,6 +41,7 @@ whois.nic.kz rk1048 whois.nic.li utf-8 whois.domreg.lt utf-8 whois.dns.lu iso-8859-1 +whois.marnet.mk utf-8 whois.nic.mu utf-8 whois.norid.no iso-8859-1 whois.iis.nu utf-8 diff --git a/tld_serv_list b/tld_serv_list index ab2719c..64f425e 100644 --- a/tld_serv_list +++ b/tld_serv_list @@ -354,6 +354,7 @@ .xn--80ao21a whois.nic.kz # Kazakhstan .xn--90a3ac whois.rnids.rs # Serbia .xn--clchc0ea0b2g2a9gcd whois.sgnic.sg # Singapore, Tamil +.xn--d1alf whois.marnet.mk # Macedonia .xn--fiqs8s cwhois.cnnic.cn # China, Simplified Chinese .xn--fiqz9s cwhois.cnnic.cn # China, Traditional Chinese .xn--fpcrj9c3d whois.inregistry.net # India, Telugu AW @@ -374,6 +375,7 @@ .xn--mgbc0a9azcg NONE # Morocco .xn--mgberp4a5d4ar whois.nic.net.sa # Saudi Arabia .xn--mgbx4cd0ab whois.mynic.my # Malaysia AW +.xn--node whois.itdc.ge # Georgia .xn--o3cw4h whois.thnic.co.th # Thailand .xn--ogbpf8fl whois.tld.sy # Syria .xn--p1ai whois.tcinet.ru # Russian Federation From d4decb8bfc578b3cc1134723fc59f74b9d073316 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Fri, 24 Oct 2014 09:22:58 +0200 Subject: [PATCH 20/29] Update the list of new gTLDs --- new_gtlds_list | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/new_gtlds_list b/new_gtlds_list index 1710872..1b64b72 100644 --- a/new_gtlds_list +++ b/new_gtlds_list @@ -33,6 +33,7 @@ bike bio black blackfriday +bloomberg blue bmw bnpparibas @@ -103,6 +104,7 @@ dating day deals degree +delivery democrat dental dentist @@ -120,6 +122,8 @@ dvag eat education email +emerck +energy engineer engineering enterprises @@ -340,7 +344,9 @@ support surf surgery suzuki +sydney systems +taipei tatar tattoo tax From 5105bc6e60593b01fe0dda4e5140621da8f80dba Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Thu, 6 Nov 2014 04:13:54 +0100 Subject: [PATCH 21/29] Debian changelog for 5.2.2 --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 389e4a9..56ad60f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +whois (5.2.2) unstable; urgency=medium + + * Fixed the code that removes trailing dots. (Closes: #763834) + * Added the .xn--d1alf (.мкд, Macedonia) and .xn--node (.გე, Georgia) + TLD servers. + * Updated the list of new gTLDs. + + -- Marco d'Itri Thu, 06 Nov 2014 03:47:43 +0100 + whois (5.2.1) unstable; urgency=medium * Added the .aw and .zm TLD servers. From 2db20216916a10767a72e32893b8d5c5b4cd5217 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Fri, 21 Nov 2014 00:26:22 +0100 Subject: [PATCH 22/29] Update the list of new gTLDs --- new_gtlds_list | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/new_gtlds_list b/new_gtlds_list index 1b64b72..bd1d6b7 100644 --- a/new_gtlds_list +++ b/new_gtlds_list @@ -9,10 +9,14 @@ academy accountants active actor +adult agency airforce allfinanz alsace +amsterdam +android +aquarelle archi army associates @@ -58,6 +62,7 @@ cards care career careers +cartier casa cash catering @@ -77,6 +82,7 @@ click clinic clothing club +coach codes coffee college @@ -94,6 +100,7 @@ cool country credit creditcard +cricket crs cruises cuisinella @@ -109,6 +116,7 @@ democrat dental dentist desi +dev diamonds diet digital @@ -116,7 +124,9 @@ direct directory discount dnp +docs domains +doosan durban dvag eat @@ -130,21 +140,26 @@ enterprises equipment esq estate +eurovision eus events +everbank exchange expert exposed fail farm +fashion feedback finance financial +firmdale fish fishing fitness flights florist +flowers flsmidth fly foo @@ -157,8 +172,10 @@ furniture futbol gal gallery +garden gbiz gent +ggee gift gifts gives @@ -204,6 +221,8 @@ institute insure international investments +irish +iwc jetzt joburg juegos @@ -216,9 +235,13 @@ krd kred lacaixa land +latrobe lawyer +lds lease +legal lgbt +lidl life lighting limited @@ -230,6 +253,7 @@ lotto ltda luxe luxury +madrid maison management mango @@ -239,12 +263,15 @@ media meet melbourne meme +memorial menu miami mini moda moe monash +money +mormon mortgage moscow motorcycles @@ -268,11 +295,13 @@ onl ooo org organic +osaka otsuka ovh paris partners parts +party pharmacy photo photography @@ -286,6 +315,7 @@ place plumbing pohl poker +porn praxi press prod @@ -302,6 +332,7 @@ red rehab reise reisen +reit ren rentals repair @@ -319,17 +350,23 @@ rsvp ruhr ryukyu saarland +sale +samsung sarl sca scb schmidt schule +schwarz +science scot services +sew sexy shiksha shoes singles +sky social software sohu @@ -353,6 +390,7 @@ tax technology tienda tips +tires tirol today tokyo @@ -362,6 +400,7 @@ town toys trade training +trust tui university uno @@ -372,6 +411,7 @@ ventures versicherung vet viajes +video villas vision vlaanderen @@ -400,6 +440,7 @@ wtf xn--1qqw23a xn--3bst00m xn--3ds443g +xn--45q11c xn--4gbrim xn--55qw42g xn--55qx5d @@ -411,10 +452,13 @@ xn--80aswg xn--c1avg xn--cg4bki xn--czr694b +xn--czrs0t xn--czru2d xn--d1acj3b xn--fiq228c5hs xn--fiq64b +xn--flw351e +xn--hxt814e xn--i1b6b1a6a2e xn--io0a7i xn--kput3i @@ -424,6 +468,7 @@ xn--nqv7f xn--nqv7fs00ema xn--p1acf xn--q9jyb4c +xn--qcka1pmc xn--rhqv96g xn--ses554g xn--unup4y @@ -440,3 +485,4 @@ yokohama youtube zip zone +zuerich From 337d13dbbf742bae64cd89250f6b62c5bbde243c Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Sat, 20 Dec 2014 23:22:02 +0100 Subject: [PATCH 23/29] Update multiple TLD servers --- tld_serv_list | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tld_serv_list b/tld_serv_list index 64f425e..46b7c5a 100644 --- a/tld_serv_list +++ b/tld_serv_list @@ -91,7 +91,7 @@ .bi whois1.nic.bi .bj whois.nic.bj #.bl -.bm WEB http://207.228.133.14/cgi-bin/lansaweb?procfun+BMWHO+BMWHO2+WHO +.bm WEB http://www.bermudanic.bm/cgi-bin/lansaweb?procfun+BMWHO+BMWHO2+WHO .bn whois.bn # www.brunet.bn .bo whois.nic.bo #.bq @@ -107,7 +107,7 @@ .cc VERISIGN ccwhois.verisign-grs.com .cd whois.nic.cd .cf whois.dot.cf -.cg WEB http://www.nic.cg/cgi-bin/whois.pl +.cg NONE .ch whois.nic.ch .ci whois.nic.ci .ck NONE @@ -157,11 +157,11 @@ .gn NONE # http://www.psg.com/dns/gn/ .gp WEB https://www.dom-enic.com/whois.html .gq whois.dominio.gq -.gr WEB https://grweb.ics.forth.gr/Whois?lang=en +.gr WEB https://grweb.ics.forth.gr/public/whois.jsp?lang=en .gs whois.nic.gs -.gt WEB http://www.gt/who_is.html +.gt WEB http://www.gt/ .gu WEB http://gadao.gov.gu/domainsearch.htm -.gw NONE # currently no registry +.gw WEB http://nic.gw/en/whois/ .gy whois.registry.gy .hk whois.hkirc.hk .hm whois.registry.hm @@ -185,7 +185,7 @@ .jp whois.jprs.jp .ke whois.kenic.or.ke .kg whois.domain.kg -.kh NONE # http://www.mptc.gov.kh/DomainNameRegistrationForm.aspx http://www.nic.net.kh/ +.kh NONE # http://www.trc.gov.kh/index.php/en/newsCategory/view?id=42&detail_id=68 .ki whois.nic.mu .km NONE # www.domaine.km .kn WEB http://www.nic.kn/ @@ -207,7 +207,7 @@ .ly whois.nic.ly .ma whois.iam.net.ma # www.nic.ma .mc NONE # www.nic.mc -.md WEB http://www.dns.md/wh1.php # whois.nic.md is restricted +.md whois.nic.md .me whois.nic.me # afilias #.mf .mg whois.nic.mg @@ -236,7 +236,7 @@ .ni WEB http://www.nic.ni/ .nl whois.domain-registry.nl .no whois.norid.no -.np WEB http://register.mos.com.np/userSearchInc.asp +.np WEB http://register.mos.com.np/np-whois-lookup .nr WEB http://www.cenpac.net.nr/dns/whois.html .nu whois.iis.nu .nz whois.srs.net.nz @@ -255,7 +255,7 @@ .ps whois.pnina.ps .pt whois.dns.pt .pw whois.nic.pw -.py WEB http://www.nic.py/consultas.html +.py WEB http://www.nic.py/consulta-datos.php .qa whois.registry.qa .re whois.nic.re .ro whois.rotld.ro @@ -285,10 +285,10 @@ .sx whois.sx .sy whois.tld.sy .sz NONE # http://www.sispa.org.sz/ -.tc whois.meridiantld.net +.tc whois.nic.tc .td WEB http://www.nic.td/ .tf whois.nic.tf -.tg WEB http://www.nic.tg/ +.tg whois.nic.tg .th whois.thnic.co.th .tj WEB http://www.nic.tj/whois.html .tk whois.dot.tk @@ -329,7 +329,7 @@ .vc AFILIAS .ve whois.nic.ve .vg whois.adamsnames.tc -.vi WEB http://www.nic.vi/whoisform.htm +.vi WEB https://secure.nic.vi/whois-lookup/ .vn WEB http://www.vnnic.vn/en/domain .vu vunic.vu .wf whois.nic.wf @@ -340,10 +340,10 @@ .alt.za whois.alt.za .co.za whois.registry.net.za .gov.za whois.gov.za -.net.za whois.net.za -.org.za WEB http://www.org.za/ # rwhois.org.za:4321 is restricted -.web.za whois.web.za -.za NONE # http://www.zadna.org.za/annexure-d.html +.net.za net-whois.registry.net.za +.org.za org-whois.registry.net.za +.web.za web-whois.registry.net.za +.za NONE # http://www.zadna.org.za/content/page/domain-information .zm whois.nic.zm .zw NONE # http://www.zispa.co.zw/ From ec0a87cc4245e487ac29a4156f273c5b021f574a Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Fri, 26 Dec 2014 18:58:21 +0100 Subject: [PATCH 24/29] Remove some old gTLDs that leaked in new_gtlds_list The IANA web site is hard to scrape reliably... --- new_gtlds_list | 4 ---- 1 file changed, 4 deletions(-) diff --git a/new_gtlds_list b/new_gtlds_list index bd1d6b7..b9f6d91 100644 --- a/new_gtlds_list +++ b/new_gtlds_list @@ -87,7 +87,6 @@ codes coffee college cologne -com community company computer @@ -214,7 +213,6 @@ ibm immo immobilien industries -info ing ink institute @@ -278,7 +276,6 @@ motorcycles mov nagoya navy -net network neustar new @@ -293,7 +290,6 @@ okinawa ong onl ooo -org organic osaka otsuka From 219a1686eee2b5bb9459faac74c914ca1889c71c Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Fri, 26 Dec 2014 19:49:43 +0100 Subject: [PATCH 25/29] Update some IPv4 allocations Apparently JPNIC returned the last /11 to APNIC. It is not clear which networks are actually delegated to the Brazilian NIR, and since whois.lacnic.net always forwards the queries I decided to just remove the more specific entries. --- ip_del_list | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ip_del_list b/ip_del_list index db7361e..0425203 100644 --- a/ip_del_list +++ b/ip_del_list @@ -19,6 +19,7 @@ 39.0.0.0/8 apnic 41.0.0.0/8 afrinic 42.0.0.0/8 apnic +43.224.0.0/11 apnic 43.0.0.0/8 whois.nic.ad.jp 46.0.0.0/8 ripe 49.0.0.0/8 apnic @@ -149,11 +150,6 @@ 196.0.0.0/7 afrinic 198.0.0.0/7 arin -200.17.0.0/16 whois.nic.br -200.18.0.0/15 whois.nic.br -200.20.0.0/16 whois.nic.br -200.96.0.0/13 whois.nic.br -200.128.0.0/9 whois.nic.br 200.0.0.0/7 lacnic 202.11.0.0/16 whois.nic.ad.jp 202.13.0.0/16 whois.nic.ad.jp From b207df0805d431d379bba52cff499cbbca288c64 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Sun, 14 Dec 2014 23:46:13 +0100 Subject: [PATCH 26/29] mkpasswd: support OpenBSD's new hash 2b --- mkpasswd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mkpasswd.c b/mkpasswd.c index 2e3ca80..63c82f1 100644 --- a/mkpasswd.c +++ b/mkpasswd.c @@ -86,7 +86,13 @@ static const struct crypt_method methods[] = { N_("standard 56 bit DES-based crypt(3)") }, { "md5", "$1$", 8, 8, 0, "MD5" }, #if defined OpenBSD || defined FreeBSD || (defined __SVR4 && defined __sun) +# if (defined OpenBSD && OpenBSD >= 201405) + /* http://marc.info/?l=openbsd-misc&m=139320023202696 */ + { "bf", "$2b$", 22, 22, 1, "Blowfish" }, + { "bfa", "$2a$", 22, 22, 1, "Blowfish (obsolete $2a$ version)" }, +# else { "bf", "$2a$", 22, 22, 1, "Blowfish" }, +# endif #endif #if defined HAVE_LINUX_CRYPT_GENSALT { "bf", "$2a$", 22, 22, 1, "Blowfish, system-specific on 8-bit chars" }, From 4fa1cd69e45dc29249e8abc413278a7982c996c5 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Sun, 14 Dec 2014 23:47:33 +0100 Subject: [PATCH 27/29] mkpasswd: use arc4random_buf where available --- config.h | 9 +++++++++ mkpasswd.c | 15 +++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/config.h b/config.h index 4492e4b..7e324f7 100644 --- a/config.h +++ b/config.h @@ -81,6 +81,15 @@ # define RANDOM_DEVICE "/dev/urandom" #endif +/* use arc4random_buf instead if it is available */ +#if (defined __FreeBSD__ && __FreeBSD__ >= 9) || \ + (defined __NetBSD__ && __NetBSD_Version__ >= 600000000) || \ + (defined OpenBSD && OpenBSD >= 200805) || \ + (defined __APPLE__ && defined __MACH__) +# define HAVE_ARC4RANDOM_BUF +# undef RANDOM_DEVICE +#endif + #ifdef ENABLE_NLS # ifndef NLS_CAT_NAME # define NLS_CAT_NAME "whois" diff --git a/mkpasswd.c b/mkpasswd.c index 63c82f1..ffd887e 100644 --- a/mkpasswd.c +++ b/mkpasswd.c @@ -383,20 +383,27 @@ void* get_random_bytes(const unsigned int count) } #endif -#ifdef RANDOM_DEVICE +#if defined RANDOM_DEVICE || defined HAVE_ARC4RANDOM_BUF void generate_salt(char *const buf, const unsigned int len) { unsigned int i; + unsigned char *entropy; + +#if defined HAVE_ARC4RANDOM_BUF + void *entropy = NOFAIL(malloc(len)); + arc4random_buf(entropy, len); +#else + entropy = get_random_bytes(len); +#endif - unsigned char *entropy = get_random_bytes(len * sizeof(unsigned char)); for (i = 0; i < len; i++) buf[i] = valid_salts[entropy[i] % (sizeof valid_salts - 1)]; buf[i] = '\0'; free(entropy); } -#else /* RANDOM_DEVICE */ +#else /* RANDOM_DEVICE || HAVE_ARC4RANDOM_BUF */ void generate_salt(char *const buf, const unsigned int len) { @@ -424,7 +431,7 @@ void generate_salt(char *const buf, const unsigned int len) buf[i] = '\0'; } -#endif /* RANDOM_DEVICE */ +#endif /* RANDOM_DEVICE || HAVE_ARC4RANDOM_BUF */ void display_help(int error) { From 07b3e728f233bbf0bb081588c206c80b6d064fa4 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Fri, 26 Dec 2014 20:13:49 +0100 Subject: [PATCH 28/29] Delete the new_gtlds.h generated file on make clean --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b26c0b8..8d8f69b 100644 --- a/Makefile +++ b/Makefile @@ -121,7 +121,7 @@ distclean: clean clean: rm -f Makefile.depend as_del.h as32_del.h ip_del.h ip6_del.h \ - tld_serv.h servers_charset.h *.o whois mkpasswd + new_gtlds.h tld_serv.h servers_charset.h *.o whois mkpasswd rm -f po/*.mo pos: From 3605226cd40223b7ac6b95e266fd2d03879a832d Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Fri, 26 Dec 2014 19:55:27 +0100 Subject: [PATCH 29/29] Debian changelog for 5.2.3 --- debian/changelog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index 56ad60f..ca6678a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +whois (5.2.3) unstable; urgency=medium + + * Added the .gw TLD server. + * Updated the .bm, .gr, .gt, .md, .np, .py, .tc, .tg, .vi, .net.za, + .org.za and .web.za TLD servers. (Closes: #773489) + * Removed the .cg TLD server. + * Updated the list of new gTLDs. + * mkpasswd: use arc4random_buf(3) where available. + * mkpasswd: support OpenBSD's new hash 2b. + * Updated some IPv4 allocations. + * Remove the new_gtlds.h generated file from the Debian source package. + + -- Marco d'Itri Fri, 26 Dec 2014 20:12:24 +0100 + whois (5.2.2) unstable; urgency=medium * Fixed the code that removes trailing dots. (Closes: #763834)