diff -Nru whois-5.2.20/data.h whois-5.3.0/data.h --- whois-5.2.20/data.h 2017-07-27 15:44:55.000000000 +0000 +++ whois-5.3.0/data.h 2018-01-21 00:23:45.000000000 +0000 @@ -78,6 +78,7 @@ "% The WHOIS service offered by DNS Belgium", "", /* be */ "% (c) 2015 NIC Costa Rica", "", /* cr */ "% The WHOIS service offered by EURid", "% of the database", /* eu */ + "Access to .IN WHOIS information", "", /* in */ "% WHOIS LEGAL STATEMENT AND TERMS & CONDITIONS", NULL, /* sx */ "; The data in the WHOIS database of KSregistry GmbH", "", /* vg */ "NeuStar, Inc., the Registry Administrator for .US", NULL, diff -Nru whois-5.2.20/debian/changelog whois-5.3.0/debian/changelog --- whois-5.2.20/debian/changelog 2017-12-27 02:15:27.000000000 +0000 +++ whois-5.3.0/debian/changelog 2018-01-21 00:23:45.000000000 +0000 @@ -1,3 +1,11 @@ +whois (5.3.0) unstable; urgency=medium + + * Implemented querying for ip6.arpa domains. + * Updated the .pr TLD servers. + * Updated the list of new gTLDs. + + -- Marco d'Itri Sun, 21 Jan 2018 01:23:45 +0100 + whois (5.2.20) unstable; urgency=medium * Added the .mr TLD server. diff -Nru whois-5.2.20/ip6_del_list whois-5.3.0/ip6_del_list --- whois-5.2.20/ip6_del_list 2013-03-30 01:31:35.000000000 +0000 +++ whois-5.3.0/ip6_del_list 2018-01-21 00:23:45.000000000 +0000 @@ -43,5 +43,3 @@ 2A00:0000::/12 ripe 2C00:0000::/12 afrinic -3FFE:0000::/16 6bone - diff -Nru whois-5.2.20/Makefile whois-5.3.0/Makefile --- whois-5.2.20/Makefile 2017-12-27 02:09:58.000000000 +0000 +++ whois-5.3.0/Makefile 2018-01-21 00:23:45.000000000 +0000 @@ -33,6 +33,11 @@ DEFS += -DLOCALEDIR=\"$(BASEDIR)$(prefix)/share/locale\" endif +# libidn support has been autodetected since 5.2.18 +ifdef HAVE_LIBIDN +$(error Please fix your build system to stop defining HAVE_LIBIDN!) +endif + ifeq ($(shell $(PKG_CONFIG) --exists 'libidn2 >= 2.0.3' || echo NO),) whois_LDADD += $(shell $(PKG_CONFIG) --libs libidn2) DEFS += -DHAVE_LIBIDN2 $(shell $(PKG_CONFIG) --cflags libidn2) @@ -102,13 +107,8 @@ ############################################################################## afl: - $(MAKE) whois \ - CC=afl-gcc AFL_HARDEN=1 \ - HAVE_LIBIDN=1 HAVE_ICONV=1 DEFS=-DAFL_MODE=1 - -afl2: - $(MAKE) whois \ - HAVE_LIBIDN=1 HAVE_ICONV=1 DEFS=-DAFL_MODE=1 + -rm -f Makefile.depend + DEFS=-DAFL_MODE=1 AFL_HARDEN=1 $(MAKE) whois CC=afl-gcc HAVE_ICONV=1 afl-run: nice afl-fuzz -i ../afl_in -o ../afl_out -- ./whois diff -Nru whois-5.2.20/make_tld_serv.pl whois-5.3.0/make_tld_serv.pl --- whois-5.2.20/make_tld_serv.pl 2017-07-27 15:44:55.000000000 +0000 +++ whois-5.3.0/make_tld_serv.pl 2018-01-21 00:23:45.000000000 +0000 @@ -17,6 +17,7 @@ $b = "\\x03" if $b eq 'NONE'; $b = "\\x08" if $b eq 'AFILIAS'; $b = "\\x0C" if $b eq 'ARPA'; + $b = "\\x0D" if $b eq 'IP6'; print qq| "$a",\t"$b",\n|; } diff -Nru whois-5.2.20/mkpasswd.c whois-5.3.0/mkpasswd.c --- whois-5.2.20/mkpasswd.c 2017-12-27 02:09:58.000000000 +0000 +++ whois-5.3.0/mkpasswd.c 2018-01-21 00:23:45.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2008 Marco d'Itri + * Copyright (C) 2001-2018 Marco d'Itri . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -Nru whois-5.2.20/new_gtlds_list whois-5.3.0/new_gtlds_list --- whois-5.2.20/new_gtlds_list 2017-07-27 15:44:55.000000000 +0000 +++ whois-5.3.0/new_gtlds_list 2018-01-21 00:23:45.000000000 +0000 @@ -949,6 +949,7 @@ soy space spiegel +sport spot spreadbetting srl diff -Nru whois-5.2.20/tld_serv_list whois-5.3.0/tld_serv_list --- whois-5.2.20/tld_serv_list 2017-12-27 02:15:27.000000000 +0000 +++ whois-5.3.0/tld_serv_list 2018-01-21 00:23:45.000000000 +0000 @@ -44,6 +44,7 @@ .e164.arpa whois.ripe.net .in-addr.arpa ARPA +.ip6.arpa IP6 .arpa whois.iana.org .aero whois.aero @@ -252,7 +253,7 @@ .pl whois.dns.pl .pm whois.nic.pm .pn WEB http://www.pitcairn.pn/PnRegistry/ -.pr whois.nic.pr +.pr whois.afilias-srs.net .ps whois.pnina.ps .pt whois.dns.pt .pw whois.nic.pw diff -Nru whois-5.2.20/version.h whois-5.3.0/version.h --- whois-5.2.20/version.h 2017-12-27 02:15:27.000000000 +0000 +++ whois-5.3.0/version.h 2018-01-13 00:39:11.000000000 +0000 @@ -1 +1 @@ -#define VERSION "5.2.20" +#define VERSION "5.3.0" diff -Nru whois-5.2.20/whois.1 whois-5.3.0/whois.1 --- whois-5.2.20/whois.1 2017-08-22 16:37:55.000000000 +0000 +++ whois-5.3.0/whois.1 2018-01-21 00:23:45.000000000 +0000 @@ -207,8 +207,6 @@ This program closely tracks the user interface of the whois client developed at RIPE by Ambrose Magee and others on the base of the original BSD client. -I also added support for the protocol extensions developed by David -Kessens of QWest for the 6bone server. .SH "AUTHOR" .B Whois and this man page were written by Marco d'Itri <\fImd@linux.it\fP> diff -Nru whois-5.2.20/whois.c whois-5.3.0/whois.c --- whois-5.2.20/whois.c 2017-12-27 02:09:58.000000000 +0000 +++ whois-5.3.0/whois.c 2018-01-21 00:23:45.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 1999-2010 by Marco d'Itri . + * Copyright (C) 1999-2018 Marco d'Itri . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -368,6 +368,12 @@ server = guess_server(p); free(p); goto retry; + case 0x0D: + p = convert_in6arpa(query); + free(server); + server = guess_server(p); + free(p); + goto retry; default: break; } @@ -555,7 +561,7 @@ char *server = malloc(strlen("whois.nic.") + strlen(tld) + 1); strcpy(server, "whois.nic."); strcat(server, tld); - return(server); + return server; } /* no dot but hyphen */ @@ -935,7 +941,7 @@ * instead of connecting to the actual whois server. */ if (AFL_MODE) - return (dup(0)); + return dup(0); alarm(60); @@ -1001,7 +1007,7 @@ struct timeval tv; if (timeout <= 0) - return (connect(fd, addr, addrlen)); + return connect(fd, addr, addrlen); if ((savedflags = fcntl(fd, F_GETFL, 0)) < 0) return -1; @@ -1065,7 +1071,8 @@ err_quit(_("Interrupted by signal %d..."), signum); } -int japanese_locale(void) { +int japanese_locale(void) +{ char *lang; lang = getenv("LC_MESSAGE"); @@ -1212,7 +1219,8 @@ /* server and port have to be freed by the caller */ void split_server_port(const char *const input, - char **server, char **port) { + char **server, char **port) +{ char *p; if (*input == '[' && (p = strchr(input, ']'))) { /* IPv6 */ @@ -1326,6 +1334,69 @@ return new; } +char *convert_in6arpa(const char *s) +{ + char *ip, *p; + int character = 0; + int digits = 1; + + ip = malloc(40); + + p = strstr(s, ".ip6.arpa"); + if (!p || p == s) { + ip[character] = '\0'; + return ip; + } + + /* start from the first character before ".ip6.arpa" */ + p--; + + while (1) { + /* check that this is a valid digit for an IPv6 address */ + if (!((*p >= '0' && *p <= '9') || (*p >= 'a' && *p <= 'f') || + (*p >= 'A' && *p <= 'F'))) { + free(ip); + ip[character] = '\0'; + return ip; + } + + /* copy the digit to the IP address */ + ip[character++] = *p; + + /* stop if we have reached the beginning of the string */ + if (p == s) + break; + + /* stop if we have parsed a complete address */ + if (character == 39) + break; + + /* add the colon separator every four digits */ + if ((digits++ % 4) == 0) + ip[character++] = ':'; + + /* go to the precedent character and abort if it is not a dot */ + p--; + if (*p != '.') { + ip[character] = '\0'; + return ip; + } + + /* abort if the string starts with the dot */ + if (p == s) { + ip[character] = '\0'; + return ip; + } + + /* go to the precedent character and continue */ + p--; + } + + /* terminate the string */ + ip[character] = '\0'; + return ip; +} + unsigned long myinet_aton(const char *s) { unsigned long a, b, c, d; @@ -1356,7 +1427,8 @@ return (a << 16) + b; } -int isasciidigit(const char c) { +int isasciidigit(const char c) +{ return (c >= '0' && c <= '9') ? 1 : 0; } diff -Nru whois-5.2.20/whois.h whois-5.3.0/whois.h --- whois-5.2.20/whois.h 2017-07-27 15:44:55.000000000 +0000 +++ whois-5.3.0/whois.h 2018-01-21 00:23:45.000000000 +0000 @@ -38,6 +38,7 @@ char *convert_6to4(const char *); char *convert_teredo(const char *); char *convert_inaddr(const char *); +char *convert_in6arpa(const char *); int handle_query(const char *server, const char *port, const char *qstring, const char *fstring); void split_server_port(const char *const input, char **server, char **port);