Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package whois for openSUSE:Factory checked in at 2023-10-23 23:41:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/whois (Old) and /work/SRC/openSUSE:Factory/.whois.new.1945 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "whois" Mon Oct 23 23:41:36 2023 rev:92 rq:1119700 version:5.5.19 Changes: -------- --- /work/SRC/openSUSE:Factory/whois/whois.changes 2023-07-30 20:57:40.419184674 +0200 +++ /work/SRC/openSUSE:Factory/.whois.new.1945/whois.changes 2023-10-23 23:41:40.713083400 +0200 @@ -1,0 +2,16 @@ +Sun Oct 22 07:56:29 UTC 2023 - Andreas Stieger <andreas.stie...@gmx.de> + +- update to 5.5.19: + * Fix english support for Japanese queries to not add again the + /e argument if it had already been provided by the user + * Add the .ye and .বাà¦à¦²à¦¾ (.xn--54b7fta0cc, Bangladesh) TLD + servers + * Update the .ba, .bb, .dk, .es, .gt, .jo, .ml, .mo, .pa, .pn, + .sv, .uy, .ïºï»»ïºïºªï»§ (.xn--mgbayh7gpa, Jordan) and .æ¾³é + (.xn--mix891f, Macao) TLD servers + * Upgrade the TLD URLs to HTTPS whenever possible + * Update the charset for whois.jprs.jp + * Remove 3 new gTLDs which are no longer active + * Remove support for the obsolete as32 dot notation + +------------------------------------------------------------------- Old: ---- whois_5.5.18.tar.xz New: ---- whois_5.5.19.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ whois.spec ++++++ --- /var/tmp/diff_new_pack.D0HCYi/_old 2023-10-23 23:41:41.421109101 +0200 +++ /var/tmp/diff_new_pack.D0HCYi/_new 2023-10-23 23:41:41.421109101 +0200 @@ -17,7 +17,7 @@ Name: whois -Version: 5.5.18 +Version: 5.5.19 Release: 0 Summary: Intelligent WHOIS client License: GPL-2.0-or-later @@ -61,7 +61,7 @@ echo "`grep -A1 "Checksums-Sha1" %{SOURCE2} | grep %{name}_%{version}.tar.xz | cut -d\ -f2` %{SOURCE0}" | sha1sum -c echo "`grep -A1 "Checksums-Sha256" %{SOURCE2} | grep %{name}_%{version}.tar.xz | cut -d\ -f2` %{SOURCE0}" | sha256sum -c -%autosetup -p1 +%autosetup -p1 -n %{name} %build %make_build all mkpasswd HAVE_LIBIDN2=1 HAVE_ICONV=1 \ ++++++ whois.asc ++++++ --- /var/tmp/diff_new_pack.D0HCYi/_old 2023-10-23 23:41:41.457110409 +0200 +++ /var/tmp/diff_new_pack.D0HCYi/_new 2023-10-23 23:41:41.461110553 +0200 @@ -5,7 +5,7 @@ Source: whois Binary: whois Architecture: any -Version: 5.5.18 +Version: 5.5.19 Maintainer: Marco d'Itri <m...@linux.it> Standards-Version: 4.6.2.0 Vcs-Browser: https://github.com/rfc1036/whois @@ -14,17 +14,17 @@ Package-List: whois deb net standard arch=any Checksums-Sha1: - 11599be246127bec4bdb3eef839a9fa9ed8ef076 90216 whois_5.5.18.tar.xz + df8fcecb33989669385dbe8b26e2cd0c33ec7825 90728 whois_5.5.19.tar.xz Checksums-Sha256: - 80132ac952e882fc2b1e8e681e9a0d432949f99afa7503d257487515c85cd5b8 90216 whois_5.5.18.tar.xz + f92817716e85e2e30851eab565d69c48ddbcb61ab92634a2a5fdff8ee7b26876 90728 whois_5.5.19.tar.xz Files: - be8aaa843a0030f656b0ac3ed945e4e6 90216 whois_5.5.18.tar.xz + e719aef49e4ca3ff959fe4e18c3dd4a2 90728 whois_5.5.19.tar.xz -----BEGIN PGP SIGNATURE----- -iHUEARYIAB0WIQQnKUXNg20437dCfobLPsM64d7XgQUCZLv8nAAKCRDLPsM64d7X -gWkyAP9T7dH+4Bv5Xcs1pTGll2uT+KOjfaxGhM+qkEEG2F33eQEA59WBcV/a535Q -G9Jc+g9zEqiSvqEGZYZgV9O1p1R1qwc= -=8Irk +iHUEARYIAB0WIQQnKUXNg20437dCfobLPsM64d7XgQUCZSMYxwAKCRDLPsM64d7X +gZsfAPwNd2hJMwOSGFfo+RfD91jBdvNf3PqsLlwVr9IOA5WUnQEAwgkyD/YgbiWp +dyajTFtm+6yfE7JBEHl1mDGkOIG5RAo= +=VXtB -----END PGP SIGNATURE----- ++++++ whois_5.5.18.tar.xz -> whois_5.5.19.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/config.h new/whois/config.h --- old/whois-5.5.18/config.h 2023-07-22 17:56:56.000000000 +0200 +++ new/whois/config.h 2023-10-08 22:58:33.000000000 +0200 @@ -14,7 +14,7 @@ /* autoconf in cpp macros */ -#if defined __NetBSD__ || __OpenBSD__ +#if defined __NetBSD__ || defined __OpenBSD__ # include <sys/param.h> #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/debian/changelog new/whois/debian/changelog --- old/whois-5.5.18/debian/changelog 2023-07-22 17:56:56.000000000 +0200 +++ new/whois/debian/changelog 2023-10-08 22:58:33.000000000 +0200 @@ -1,3 +1,18 @@ +whois (5.5.19) unstable; urgency=medium + + * Fixed english support for Japanese queries to not add again the /e + argument if it had already been provided by the user. (Closes: #1050171) + * Added the .ye and .বাà¦à¦²à¦¾ (.xn--54b7fta0cc, Bangladesh) TLD servers. + * Updated the .ba, .bb, .dk, .es, .gt, .jo, .ml, .mo, .pa, .pn, .sv, + .uy, .ïºï»»ïºïºªï»§ (.xn--mgbayh7gpa, Jordan) and .æ¾³é (.xn--mix891f, Macao) + TLD servers. + * Upgraded the TLD URLs to HTTPS whenever possible. + * Updated the charset for whois.jprs.jp. + * Removed 3 new gTLDs which are no longer active. + * Removed support for the obsolete as32 dot notation. + + -- Marco d'Itri <m...@linux.it> Sun, 08 Oct 2023 22:58:33 +0200 + whois (5.5.18) unstable; urgency=medium [ Marco d'Itri ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/mkpasswd.c new/whois/mkpasswd.c --- old/whois-5.5.18/mkpasswd.c 2023-07-22 17:56:56.000000000 +0200 +++ new/whois/mkpasswd.c 2023-10-08 22:58:33.000000000 +0200 @@ -273,6 +273,7 @@ if (!salt_prefix) { /* NULL means that crypt_gensalt will choose one later */ + rounds_str[0] = '\0'; } else if (rounds_support == 2) { /* bcrypt strings always contain the rounds number */ if (rounds <= 5) @@ -325,6 +326,8 @@ * Build the actual argument to crypt(3) by concatenating the * method prefix, the rounds metadata (if any) and the salt string. */ + if (!salt_prefix) + salt_prefix = ""; salt = NOFAIL(malloc(strlen(salt_prefix) + strlen(rounds_str) + strlen(salt_arg) + 1)); *salt = '\0'; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/new_gtlds_list new/whois/new_gtlds_list --- old/whois-5.5.18/new_gtlds_list 2023-07-22 17:56:56.000000000 +0200 +++ new/whois/new_gtlds_list 2023-10-08 22:58:33.000000000 +0200 @@ -640,7 +640,6 @@ mtn mtr music -mutual nab nagoya natura @@ -666,7 +665,6 @@ nissan nissay nokia -northwesternmutual norton now nowruz @@ -927,7 +925,6 @@ tiaa tickets tienda -tiffany tips tires tirol diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/nic_handles_list new/whois/nic_handles_list --- old/whois-5.5.18/nic_handles_list 2023-07-22 17:56:56.000000000 +0200 +++ new/whois/nic_handles_list 2023-10-08 22:58:33.000000000 +0200 @@ -5,7 +5,7 @@ -afrinic whois.afrinic.net -ap whois.apnic.net -cznic whois.nic.cz --dk whois.dk-hostmaster.dk +-dk whois.punktum.dk -il whois.isoc.org.il -is whois.isnic.is -kg whois.kg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/po/pl.po new/whois/po/pl.po --- old/whois-5.5.18/po/pl.po 2022-01-03 18:29:48.000000000 +0100 +++ new/whois/po/pl.po 2023-10-08 22:58:33.000000000 +0200 @@ -1,14 +1,14 @@ # Polish translation for whois. # MichaÅ 'CeFeK' Nazarewicz <ce...@career.pl>, 1999 # PrzemysÅaw Knycz <djrz...@pld.org.pl>, 2003 -# Jakub Bogusz <qbo...@pld-linux.org>, 2003-2019 +# Jakub Bogusz <qbo...@pld-linux.org>, 2003-2023 # msgid "" msgstr "" -"Project-Id-Version: whois 5.5.1\n" +"Project-Id-Version: whois 5.5.18\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-01-03 17:52+0100\n" -"PO-Revision-Date: 2019-08-28 18:02+0200\n" +"PO-Revision-Date: 2023-10-05 21:30+0200\n" "Last-Translator: Jakub Bogusz <qbo...@pld-linux.org>\n" "Language-Team: Polish <translation-team...@lists.sourceforge.net>\n" "Language: pl\n" @@ -149,7 +149,7 @@ "-H ukrycie oÅwiadczeÅ prawnych\n" #: ../whois.c:1506 -#, fuzzy, c-format +#, c-format msgid "" " --verbose explain what is being done\n" " --no-recursion disable recursion from registry to registrar servers\n" @@ -158,6 +158,7 @@ "\n" msgstr "" " --verbose wyjaÅnianie, co siÄ dzieje\n" +" --no-recursion wyÅÄ czenie rekurencji z serwerów rejestru do rejestratorów\n" " --help wyÅwietlenie tego opisu i zakoÅczenie dziaÅania\n" " --version wyÅwietlenie informacji o wersji i zakoÅczenie " "dziaÅania\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/servers_charset_list new/whois/servers_charset_list --- old/whois-5.5.18/servers_charset_list 2023-05-03 14:27:55.000000000 +0200 +++ new/whois/servers_charset_list 2023-10-08 22:58:33.000000000 +0200 @@ -25,6 +25,7 @@ whois.denic.de utf-8 whois.enum.denic.de utf-8 whois.dk-hostmaster.dk utf-8 --charset=utf-8 +whois.punktum.dk utf-8 --charset=utf-8 whois.tld.ee utf-8 whois.eu utf-8 whois.fi iso-8859-1 @@ -36,7 +37,7 @@ whois.nic.ir utf-8 whois.isnic.is iso-8859-1 whois.nic.it utf-8 -whois.jprs.jp iso-2022-jp +whois.jprs.jp utf-8 whois.nic.ad.jp iso-2022-jp whois.kg cp1251 whois.nic.or.kr utf-8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/tld_serv_list new/whois/tld_serv_list --- old/whois-5.5.18/tld_serv_list 2023-07-22 17:56:56.000000000 +0200 +++ new/whois/tld_serv_list 2023-10-08 22:58:33.000000000 +0200 @@ -88,9 +88,9 @@ .aw whois.nic.aw .ax whois.ax # www.ax .gov.az WEB https://www.gov.az/ -.az WEB http://whois.az/ -.ba WEB http://www.nic.ba/stream/whois/ -.bb WEB http://whois.telecoms.gov.bb/search_domain.php +.az WEB https://whois.az/ +.ba WEB https://nic.ba/ +.bb WEB https://whois.telecoms.gov.bb/ .bd WEB https://bdia.btcl.com.bd/ .be whois.dns.be .bf whois.registre.bf # http://www.arcep.bf/noms-de-domaine/ @@ -126,7 +126,7 @@ .uk.co whois.uk.co .co whois.nic.co .cr whois.nic.cr -.cu WEB http://www.nic.cu/ +.cu WEB https://www.nic.cu/ .cv WEB http://www.dns.cv/ .cw NONE # https://www.uoc.cw/cw-registry .cx whois.nic.cx @@ -134,16 +134,16 @@ .cz whois.nic.cz .de whois.denic.de .dj NONE # http://www.dj/ -.dk whois.dk-hostmaster.dk +.dk whois.punktum.dk .dm whois.dmdomains.dm .do whois.nic.do .dz whois.nic.dz .ec whois.nic.ec .ee whois.tld.ee -.eg NONE # http://lookup.egregistry.eg/english.aspx +.eg NONE # https://domain.eg/ #.eh .er NONE # http://www.afridns.org/er/tld_er.txt -.es WEB https://www.nic.es/ +.es WEB https://www.dominios.es/en .et NONE # http://www.ethionet.et/ .eu whois.eu .fi whois.fi @@ -167,9 +167,9 @@ .gq whois.dominio.gq .gr WEB https://grweb.ics.forth.gr/public/whois .gs whois.nic.gs -.gt WEB http://www.gt/ +.gt WEB https://www.gt/sitio/?lang=en .gu NONE -.gw WEB http://nic.gw/en/whois/ +.gw WEB https://nic.gw/en/whois/ .gy whois.registry.gy .hk whois.hkirc.hk .hm whois.registry.hm @@ -189,7 +189,7 @@ .it whois.nic.it .je whois.je .jm NONE # http://myspot.mona.uwi.edu/mits/ -.jo WEB https://www.dns.jo/en.aspx +.jo WEB https://www.domain.jo/FirstPageen.aspx .jp whois.jprs.jp .ke whois.kenic.or.ke .kg whois.kg @@ -221,10 +221,10 @@ .mg whois.nic.mg .mh NONE # www.nic.net.mh .mk whois.marnet.mk -.ml whois.dot.ml # www.point.ml +.ml whois.nic.ml .mm whois.registry.gov.mm .mn whois.nic.mn -.mo WEB http://www.monic.mo/ # whois.monic.mo is restricted +.mo WEB https://www.monic.mo/monic/faces/whois # whois.monic.mo is restricted .mp NONE # get.mp .mq whois.mediaserv.net .mr whois.nic.mr @@ -241,26 +241,26 @@ .ne NONE # NIC? http://www.intnet.ne .nf whois.nic.nf .ng whois.nic.net.ng -.ni WEB http://www.nic.ni/ +.ni WEB https://www.nic.ni/ .nl whois.domain-registry.nl .no whois.norid.no .np WEB https://register.com.np/whois-lookup -.nr WEB http://www.cenpac.net.nr/dns/whois.html +.nr WEB https://www.cenpac.net.nr/dns/whois.html .nu whois.iis.nu .nz whois.irs.net.nz .om whois.registry.om -.pa WEB http://www.nic.pa/ +.pa WEB http://www.nic.pa/en .pe kero.yachay.pe .pf whois.registry.pf .pg NONE # http://www.unitech.ac.pg/ -.edu.ph WEB http://services.ph.net/dns/query.pl +.edu.ph WEB https://services.ph.net/dns/query.pl .gov.ph NONE # http://dns.gov.ph/ .ph WEB https://whois.dot.ph/ .pk whois.pknic.net.pk .co.pl whois.co.pl # "unofficial" SLD .pl whois.dns.pl .pm whois.nic.pm -.pn WEB http://www.pitcairn.pn/PnRegistry/ +.pn WEB http://www.pitcairn.pn/PnRegistry/whois.html .pr whois.afilias-srs.net .ps whois.pnina.ps .pt whois.dns.pt @@ -302,7 +302,7 @@ .nov.su whois.flexireg.net .spb.su whois.flexireg.net .su whois.tcinet.ru -.sv WEB http://www.svnet.org.sv/ +.sv WEB https://svnet.sv/ .sx whois.sx .sy whois.tld.sy .sz NONE # http://www.sispa.org.sz/ @@ -318,7 +318,7 @@ .tn whois.ati.tn .to whois.tonic.to .tr whois.trabis.gov.tr -.tt WEB http://www.nic.tt/cgi-bin/search.pl +.tt WEB https://www.nic.tt/cgi-bin/search.pl .tv RECURSIVE whois.nic.tv .tw whois.twnic.net.tw .tz whois.tznic.or.tz @@ -342,8 +342,12 @@ #.um .fed.us whois.nic.gov .us whois.nic.us -.com.uy WEB https://nic.com.uy/public/consulta-whois/acceder.action -.uy whois.nic.org.uy +.edu.uy WEB https://www.nic.uy/ +.gub.uy WEB https://www.dominios.gub.uy/ +.mil.uy WEB https://www.dominios.gub.uy/ +.net.uy WEB https://www.nic.uy/ +.org.uy WEB https://www.nic.uy/ +.uy WEB https://nic.com.uy/v2/consulta-whois .uz whois.cctld.uz .va NONE .vc whois2.afilias-grs.net @@ -354,7 +358,7 @@ .vu whois.dnrs.vu .wf whois.nic.wf .ws whois.website.ws -.ye NONE # NIC? http://www.y.net.ye/services/domain_name.htm +.ye whois.y.net.ye .yt whois.nic.yt .ac.za whois.ac.za .alt.za WEB https://whois.alt.za/ @@ -376,7 +380,7 @@ .xn--45br5cyl whois.registry.in # India .xn--45brj9c whois.registry.in # India, Bengali .xn--4dbrk0ce whois.isoc.org.il # Israel -.xn--54b7fta0cc NONE # Bangladesh +.xn--54b7fta0cc WEB https://bdia.btcl.com.bd/ # Bangladesh .xn--80ao21a whois.nic.kz # Kazakhstan .xn--90a3ac whois.rnids.rs # Serbia .xn--90ae whois.imena.bg # Bulgaria @@ -403,7 +407,7 @@ .xn--mgbaam7a8h whois.aeda.net.ae # United Arab Emirates .xn--mgbah1a3hjkrd whois.nic.mr # Mauritania .xn--mgbai9azgqp6j NONE # Pakistan -.xn--mgbayh7gpa WEB https://www.dns.jo/en.aspx # Jordan +.xn--mgbayh7gpa WEB https://www.domain.jo/FirstPageen.aspx # Jordan .xn--mgbbh1a71e whois.registry.in # India, Urdu .xn--mgbbh1a whois.registry.in # India .xn--mgbc0a9azcg NONE # Morocco @@ -413,7 +417,7 @@ .xn--mgbpl2fh NONE # Sudan .xn--mgbtx2b whois.cmc.iq # Iraq .xn--mgbx4cd0ab whois.mynic.my # Malaysia AW -.xn--mix891f WEB http://www.monic.mo/ # Macao +.xn--mix891f WEB https://www.monic.mo/monic/faces/whois # Macao .xn--node whois.itdc.ge # Georgia .xn--o3cw4h whois.thnic.co.th # Thailand .xn--ogbpf8fl whois.tld.sy # Syria diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/utils.h new/whois/utils.h --- old/whois-5.5.18/utils.h 2023-07-22 17:56:56.000000000 +0200 +++ new/whois/utils.h 2023-10-08 22:58:33.000000000 +0200 @@ -17,8 +17,12 @@ /* Portability macros */ #ifdef __GNUC__ # define NORETURN __attribute__((noreturn)) +# define MALLOC_FREE __attribute__((malloc(free))) +# define NONNULL __attribute__((returns_nonnull)) #else # define NORETURN +# define MALLOC_FREE +# define NONNULL #endif #ifndef AI_IDN @@ -55,7 +59,8 @@ #endif /* Prototypes */ -void *do_nofail(void *ptr, const char *file, const int line); +void *MALLOC_FREE NONNULL do_nofail(void *ptr, const char *file, const int line) +; char **merge_args(char *args, char *argv[], int *argc); void NORETURN err_quit(const char *fmt, ...); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/whois.c new/whois/whois.c --- old/whois-5.5.18/whois.c 2023-07-22 17:56:56.000000000 +0200 +++ new/whois/whois.c 2023-10-08 22:58:33.000000000 +0200 @@ -494,12 +494,52 @@ } #endif +/* + * Check if the argument is an autonomous system number in the form "ASnnnn" + * or "AS nnnn". + */ +int is_asn(const char *s, int allow_space, const char *suffix_separators) +{ + const char *p; + int max_numbers = 6; + int seen_number = 0; + + if (!strncaseeq(s, "as", 2)) + return 0; /* does not start with "as" (case insensitive) */ + + /* skip a single optional space */ + p = s + 2; + if (allow_space && *p == ' ') + p++; + + /* all numbers, but not too many */ + while (*p) { + if (*p < '0' || *p > '9') { /* not a number */ + if (!seen_number) + return 0; /* just "as" with no numbers */ + if (suffix_separators && strchr(suffix_separators, *p)) + return 1; /* has a trailing separator */ + return 0; /* has trailing garbage */ + } + + seen_number = 1; + if (max_numbers-- == 0) + return 0; /* too many numbers */ + p++; + } + + if (seen_number) + return 1; /* a real ASN */ + else + return 0; /* trailing garbage */ +} + /* Parses an user-supplied string and tries to guess the right whois server. * Returns a dynamically allocated buffer. */ char *guess_server(const char *s) { - unsigned long ip, as32; + unsigned long ip; unsigned int i; const char *colon, *tld; @@ -508,12 +548,8 @@ unsigned long v6prefix, v6net; /* RPSL hierarchical objects */ - if (strncaseeq(s, "as", 2)) { - if (isasciidigit(s[2])) - return strdup(whereas(atol(s + 2))); - else - return strdup(""); - } + if (is_asn(s, 0, ":")) + return strdup(whereas(atol(s + 2))); v6prefix = strtol(s, NULL, 16); @@ -548,19 +584,14 @@ /* no dot and no hyphen means it's a NSI NIC handle or ASN (?) */ if (!strpbrk(s, ".-")) { - if (strncaseeq(s, "as", 2) && /* it's an AS */ - (isasciidigit(s[2]) || s[2] == ' ')) - return strdup(whereas(atol(s + 2))); + if (is_asn(s, 1, NULL)) + return strdup(whereas(atol(s + 2))); /* it's an AS */ if (*s == '!') /* NSI NIC handle */ return strdup("whois.networksolutions.com"); else return strdup("\x05"); /* probably a unknown kind of nic handle */ } - /* ASN32? */ - if (strncaseeq(s, "as", 2) && s[2] && (as32 = asn32_to_long(s + 2)) != 0) - return strdup(whereas32(as32)); - /* smells like an IP? */ if ((ip = myinet_aton(s))) { for (i = 0; ip_assign[i].serv; i++) @@ -603,26 +634,19 @@ return strdup("\x05"); } -const char *whereas32(const unsigned long asn) -{ - int i; - - for (i = 0; as32_assign[i].serv; i++) - if (asn >= as32_assign[i].first && asn <= as32_assign[i].last) - return as32_assign[i].serv; - return "\x06"; -} - const char *whereas(const unsigned long asn) { int i; - if (asn > 65535) - return whereas32(asn); - - for (i = 0; as_assign[i].serv; i++) - if (asn >= as_assign[i].first && asn <= as_assign[i].last) - return as_assign[i].serv; + if (asn > 65535) { + for (i = 0; as32_assign[i].serv; i++) + if (asn >= as32_assign[i].first && asn <= as32_assign[i].last) + return as32_assign[i].serv; + } else { + for (i = 0; as_assign[i].serv; i++) + if (asn >= as_assign[i].first && asn <= as_assign[i].last) + return as_assign[i].serv; + } return "\x06"; } @@ -688,18 +712,20 @@ else if (strchr(query, ' ') || *flags) { } 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") && in_domain(query, "dk")) + else if ((streq(server, "whois.punktum.dk") || + streq(server, "whois.dk-hostmaster.dk")) + && in_domain(query, "dk")) strcat(buf, "--show-handles "); /* mangle and add the query string */ if (!isripe && streq(server, "whois.nic.ad.jp") && - strncaseeq(query, "AS", 2) && isasciidigit(query[2])) { + is_asn(query, 1, NULL)) { strcat(buf, "AS "); strcat(buf, query + 2); } else if (!isripe && streq(server, "whois.arin.net") && !strrchr(query, ' ')) { - if (strncaseeq(query, "AS", 2) && isasciidigit(query[2])) { + if (is_asn(query, 0, NULL)) { strcat(buf, "a "); strcat(buf, query + 2); } else if (myinet_aton(query) || strchr(query, ':')) { @@ -716,8 +742,12 @@ /* ask for english text */ if (!isripe && (streq(server, "whois.nic.ad.jp") || - streq(server, "whois.jprs.jp")) && japanese_locale()) - strcat(buf, "/e"); + streq(server, "whois.jprs.jp")) && japanese_locale()) { + /* but not if the user already added the /e flag */ + char *flag = buf + strlen(buf) - 2; + if (!streq(flag, "/e")) + strcat(buf, "/e"); + } return buf; } @@ -1474,20 +1504,6 @@ return (a << 24) + (b << 16) + (c << 8) + d; } -unsigned long asn32_to_long(const char *s) -{ - unsigned long a, b; - char junk; - - if (!s) - return 0; - if (sscanf(s, "%lu.%lu%c", &a, &b, &junk) != 2) - return 0; - if (a > 65535 || b > 65535) - return 0; - return (a << 16) + b; -} - int isasciidigit(const char c) { return (c >= '0' && c <= '9') ? 1 : 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/whois-5.5.18/whois.h new/whois/whois.h --- old/whois-5.5.18/whois.h 2023-07-22 17:56:56.000000000 +0200 +++ new/whois/whois.h 2023-10-08 22:58:33.000000000 +0200 @@ -9,10 +9,10 @@ #define HIDE_NOT_STARTED -1 /* prototypes */ +int is_asn(const char *, int, const char *); char *guess_server(const char *); const char *match_config_file(const char *); const char *whereas(const unsigned long); -const char *whereas32(const unsigned long); char *queryformat(const char *, const char *, const char *); int hide_line(int *hiding, const char *const line); char *do_query(const int, const char *); @@ -26,7 +26,6 @@ void NORETURN sighandler(int); int japanese_locale(void); unsigned long myinet_aton(const char *); -unsigned long asn32_to_long(const char *); int isasciidigit(const char); int endstrcaseeq(const char *, const char *); int in_domain(const char *, const char *);