mirror of
https://github.com/rfc1036/whois.git
synced 2026-01-03 06:15:17 +00:00
Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64c3426493 | ||
|
|
8624550e4a | ||
|
|
9f37990fed | ||
|
|
a2bbd90c40 | ||
|
|
f5d4f95d76 | ||
|
|
173808dd26 | ||
|
|
5967760f56 | ||
|
|
45dde46468 | ||
|
|
71c87b5e30 | ||
|
|
e0d2550f93 | ||
|
|
24363dc033 | ||
|
|
3364fe47f2 | ||
|
|
4171b62cf9 | ||
|
|
6a5dc397fd | ||
|
|
64ace856ec | ||
|
|
39900059a5 | ||
|
|
434e384f32 | ||
|
|
87296ebc30 | ||
|
|
5ec6843896 | ||
|
|
6e74da05d1 | ||
|
|
b64054961d | ||
|
|
c16055893b | ||
|
|
be9c4cfa09 | ||
|
|
cd6f08d336 | ||
|
|
672575a1ae | ||
|
|
e17d852900 | ||
|
|
e36fc3b773 | ||
|
|
cc4b9c48e6 | ||
|
|
d3b4365bd8 | ||
|
|
aaf0baab25 | ||
|
|
9bb383ea03 | ||
|
|
f240aaf70e | ||
|
|
b0920c9748 | ||
|
|
980539ec23 | ||
|
|
d31347a39e | ||
|
|
f1d74f377f | ||
|
|
816f7adb8c | ||
|
|
f31128ed0d | ||
|
|
e30931d958 | ||
|
|
cf5fdb03e5 |
6
config.h
6
config.h
@ -26,12 +26,17 @@
|
||||
/* which versions? */
|
||||
# define HAVE_GETOPT_LONG
|
||||
# define HAVE_GETADDRINFO
|
||||
# define HAVE_READPASSPHRASE
|
||||
# define ENABLE_NLS
|
||||
# ifndef LOCALEDIR
|
||||
# define LOCALEDIR "/usr/local/share/locale"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined OpenBSD
|
||||
# define HAVE_READPASSPHRASE
|
||||
#endif
|
||||
|
||||
/* needs unistd.h */
|
||||
#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L
|
||||
# define HAVE_GETADDRINFO
|
||||
@ -41,6 +46,7 @@
|
||||
#if defined __APPLE__ && defined __MACH__
|
||||
# define HAVE_GETOPT_LONG
|
||||
# define HAVE_GETADDRINFO
|
||||
# define HAVE_READPASSPHRASE
|
||||
# define HAVE_BSDICRYPT
|
||||
#endif
|
||||
|
||||
|
||||
2
data.h
2
data.h
@ -17,7 +17,6 @@ const char *ripe_servers[] = {
|
||||
"whois.ripn.net",
|
||||
"whois.register.si",
|
||||
"whois.nic.ir",
|
||||
"whois.ra.net",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -27,7 +26,6 @@ struct server_referral_handler {
|
||||
};
|
||||
|
||||
const struct server_referral_handler server_referral_handlers[] = {
|
||||
{ "whois.6bone.net", find_referral_server_6bone },
|
||||
{ "whois.apnic.net", find_referral_server_apnic },
|
||||
{ "whois.arin.net", find_referral_server_arin },
|
||||
{ "whois.iana.org", find_referral_server_iana },
|
||||
|
||||
46
debian/changelog
vendored
46
debian/changelog
vendored
@ -1,3 +1,49 @@
|
||||
whois (5.6.5) unstable; urgency=medium
|
||||
|
||||
* Updated the .co TLD server.
|
||||
* Added some large KRNIC networks.
|
||||
* Updated the second level .uk TLD servers.
|
||||
* Removed the .pro TLD server.
|
||||
* Removed 1 new gTLD which is no longer active.
|
||||
|
||||
-- Marco d'Itri <md@linux.it> Mon, 13 Oct 2025 03:37:20 +0200
|
||||
|
||||
whois (5.6.4) unstable; urgency=medium
|
||||
|
||||
* Updated the .cm and .to TLD servers.
|
||||
|
||||
-- Marco d'Itri <md@linux.it> Sat, 02 Aug 2025 01:13:07 +0200
|
||||
|
||||
whois (5.6.3) unstable; urgency=medium
|
||||
|
||||
* Added the .sr and .мон (.xn--l1acc, Mongolia) TLD servers.
|
||||
* Use readpassphrase(3) on OpenBSD and FreeBSD.
|
||||
|
||||
-- Marco d'Itri <md@linux.it> Thu, 17 Jul 2025 05:15:53 +0200
|
||||
|
||||
whois (5.6.2) unstable; urgency=medium
|
||||
|
||||
* Updated the .post and .in (and related IDN TLDs) TLD servers.
|
||||
* Removed 1 new gTLDs which is no longer active.
|
||||
* Build-Depend on libcrypt-dev. (Closes: #1106977)
|
||||
|
||||
-- Marco d'Itri <md@linux.it> Fri, 06 Jun 2025 18:22:04 +0200
|
||||
|
||||
whois (5.6.1) unstable; urgency=medium
|
||||
|
||||
* Added the .pg TLD server.
|
||||
* Updated the .gov, .mu, .中国 (.xn--fiqs8s) and .中國 (.xn--fiqz9s)
|
||||
TLD servers.
|
||||
* Removed the .jobs TLD server.
|
||||
* Added the encodings for whois.afrinic.net and whois.apnic.net.
|
||||
* Enabled the UTF-8 encoding for whois.ripe.net.
|
||||
* Use the last ReferralServer returned by the ARIN server instead of
|
||||
the first, because we want to follow the referral for the most
|
||||
specific record returned.
|
||||
* Make sure to avoid trivial referral loops.
|
||||
|
||||
-- Marco d'Itri <md@linux.it> Sat, 17 May 2025 01:30:06 +0200
|
||||
|
||||
whois (5.6.0) unstable; urgency=medium
|
||||
|
||||
* Fixed the mangling of RADB queries with commands.
|
||||
|
||||
7
debian/control
vendored
7
debian/control
vendored
@ -6,9 +6,10 @@ Standards-Version: 4.7.2.0
|
||||
Rules-Requires-Root: no
|
||||
Build-Depends: debhelper-compat (= 13), gettext, pkgconf,
|
||||
bash-completion,
|
||||
libidn2-dev (>= 2.0.3),
|
||||
Vcs-Git: https://github.com/rfc1036/whois.git
|
||||
Vcs-Browser: https://github.com/rfc1036/whois
|
||||
libcrypt-dev,
|
||||
libidn2-dev,
|
||||
Vcs-Git: https://salsa.debian.org/md/whois.git
|
||||
Vcs-Browser: https://salsa.debian.org/md/whois
|
||||
|
||||
Package: whois
|
||||
Architecture: any
|
||||
|
||||
6
debian/salsa-ci.yml
vendored
Normal file
6
debian/salsa-ci.yml
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
include:
|
||||
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml
|
||||
|
||||
variables:
|
||||
SALSA_CI_IGNORED_BRANCHES: '^next$'
|
||||
@ -10,16 +10,20 @@
|
||||
1.0.0.0/8 apnic
|
||||
2.0.0.0/8 ripe
|
||||
5.0.0.0/8 ripe
|
||||
14.64.0.0/11 whois.nic.or.kr
|
||||
14.0.0.0/8 apnic
|
||||
24.132.0.0/14 ripe
|
||||
27.176.0.0/13 whois.nic.or.kr
|
||||
27.0.0.0/8 apnic
|
||||
31.0.0.0/8 ripe
|
||||
36.0.0.0/8 apnic
|
||||
37.0.0.0/8 ripe
|
||||
39.0.0.0/8 apnic
|
||||
41.0.0.0/8 afrinic
|
||||
42.32.0.0/12 whois.nic.or.kr
|
||||
42.0.0.0/7 apnic
|
||||
46.0.0.0/8 ripe
|
||||
49.8.0.0/14 whois.nic.or.kr
|
||||
49.0.0.0/8 apnic
|
||||
51.0.0.0/8 ripe
|
||||
# whois -r -K -h whois.apnic.net -i admin-c IM76-AP
|
||||
|
||||
@ -18,7 +18,7 @@ while (<>) {
|
||||
$b = "\\x03" if $b eq 'NONE';
|
||||
$b =~ s/^RECURSIVE\s+/\\x08" "/;
|
||||
$b = "\\x08$b" if $b eq 'whois.flexireg.net';
|
||||
$b = "\\x08$b" if $b eq 'whois.registry.in';
|
||||
$b = "\\x08$b" if $b eq 'whois.nixiregistry.in';
|
||||
$b = "\\x0C" if $b eq 'ARPA';
|
||||
$b = "\\x0D" if $b eq 'IP6';
|
||||
print qq| "$a",\t"$b",\n|;
|
||||
|
||||
@ -14,12 +14,20 @@ close($fh);
|
||||
my ($ver) = $line =~ /^whois \s+ \( ( [^\)]+ ) \) \s+ \S+/x;
|
||||
die "Version number not found in $changelog!\n" if not $ver;
|
||||
|
||||
$ver =~ s/ ( ~bpo\d+\+\d+ | \+b\d+ | ~deb\d+.* | ubuntu\d+ | build\d+ | \+dyson\d+ ) $//x;
|
||||
$ver =~ s/ (
|
||||
build\d+
|
||||
| ubuntu\d+
|
||||
| ~bpo\d+\+\d+
|
||||
| ~deb\d+.*
|
||||
| \+b\d+
|
||||
| \+dyson\d+
|
||||
| \+salsaci\+.+
|
||||
) $//x;
|
||||
|
||||
# The version number must not deviate from this format or the -V option
|
||||
# to RIPE-like servers will break. If needed, update the previous regexp.
|
||||
# This may not be true anymore in 2019.
|
||||
die "Invalid version number in $changelog!\n"
|
||||
die "Invalid version number in $changelog: '$ver'!\n"
|
||||
unless $ver =~ /^ \d+\.\d+ ( \.\d+ )? $/x;
|
||||
|
||||
# This is the version number used in the help messages.
|
||||
|
||||
13
mkpasswd.c
13
mkpasswd.c
@ -47,6 +47,9 @@
|
||||
#ifdef HAVE_GETTIMEOFDAY
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#ifdef HAVE_READPASSPHRASE
|
||||
#include <readpassphrase.h>
|
||||
#endif
|
||||
|
||||
/* Application-specific */
|
||||
#include "version.h"
|
||||
@ -387,11 +390,21 @@ int main(int argc, char *argv[])
|
||||
exit(2);
|
||||
}
|
||||
} else {
|
||||
#ifdef HAVE_READPASSPHRASE
|
||||
const size_t size = 128;
|
||||
|
||||
password = NOFAIL(malloc(size));
|
||||
if (!readpassphrase(_("Password: "), password, size, 0)) {
|
||||
perror("readpassphrase");
|
||||
exit(2);
|
||||
}
|
||||
#else
|
||||
password = getpass(_("Password: "));
|
||||
if (!password) {
|
||||
perror("getpass");
|
||||
exit(2);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@ -718,7 +718,6 @@ pohl
|
||||
poker
|
||||
politie
|
||||
porn
|
||||
pramerica
|
||||
praxi
|
||||
press
|
||||
prime
|
||||
@ -745,7 +744,6 @@ realtor
|
||||
realty
|
||||
recipes
|
||||
red
|
||||
redstone
|
||||
redumbrella
|
||||
rehab
|
||||
reise
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
# server name charset optional parameters
|
||||
# server name encoding optional parameters
|
||||
whois.afrinic.net utf-8
|
||||
whois.apnic.net iso-8859-1
|
||||
whois.cat utf-8 -C UTF-8
|
||||
whois.conac.cn utf-8
|
||||
whois.corenic.net utf-8 -C UTF-8
|
||||
@ -6,7 +8,7 @@ whois.online.rs.corenic.net utf-8 -C UTF-8
|
||||
whois.site.rs.corenic.net utf-8 -C UTF-8
|
||||
whois.lacnic.net utf-8
|
||||
whois.museum utf-8 -C UTF-8
|
||||
whois.ripe.net iso-8859-1
|
||||
whois.ripe.net utf-8 --charset UTF-8
|
||||
|
||||
whois.nic.llyw.cymru utf-8
|
||||
whois.nic.gov.scot utf-8
|
||||
@ -20,7 +22,6 @@ whois.cira.ca utf-8
|
||||
whois.nic.ch utf-8
|
||||
whois.nic.cl utf-8
|
||||
whois.cnnic.cn utf-8
|
||||
cwhois.cnnic.cn utf-8
|
||||
whois.nic.cz utf-8
|
||||
whois.denic.de utf-8
|
||||
whois.enum.denic.de utf-8
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
.gov.wales whois.nic.gov.wales
|
||||
|
||||
.edu whois.educause.edu
|
||||
.gov whois.dotgov.gov
|
||||
.gov whois.nic.gov
|
||||
.int whois.iana.org
|
||||
.mil NONE
|
||||
|
||||
@ -60,12 +60,12 @@
|
||||
.cat whois.nic.cat
|
||||
.coop whois.nic.coop
|
||||
.info RECURSIVE whois.nic.info # whois.identitydigital.services
|
||||
.jobs whois.nic.jobs
|
||||
.jobs NONE
|
||||
.mobi RECURSIVE whois.nic.mobi # whois.identitydigital.services
|
||||
.museum whois.nic.museum
|
||||
.name whois.nic.name
|
||||
.post whois.dotpostregistry.net
|
||||
.pro whois.nic.pro
|
||||
.post whois.nic.post
|
||||
.pro NONE
|
||||
.tel whois.nic.tel
|
||||
.travel whois.nic.travel
|
||||
.xxx whois.nic.xxx
|
||||
@ -120,11 +120,11 @@
|
||||
.ci whois.nic.ci
|
||||
.ck NONE
|
||||
.cl whois.nic.cl
|
||||
.cm whois.netcom.cm
|
||||
.cm whois.nic.cm
|
||||
.edu.cn whois.edu.cn
|
||||
.cn whois.cnnic.cn
|
||||
.uk.co whois.uk.co
|
||||
.co whois.nic.co
|
||||
.co whois.registry.co
|
||||
.cr whois.nic.cr
|
||||
.cu WEB https://www.nic.cu/
|
||||
.cv whois.nic.cv
|
||||
@ -181,7 +181,7 @@
|
||||
.ie whois.weare.ie
|
||||
.il whois.isoc.org.il
|
||||
.im whois.nic.im
|
||||
.in whois.registry.in
|
||||
.in whois.nixiregistry.in
|
||||
.io whois.nic.io
|
||||
.iq whois.cmc.iq # http://www.cmc.iq/en/iq.html
|
||||
.ir whois.nic.ir
|
||||
@ -230,7 +230,7 @@
|
||||
.mr whois.nic.mr
|
||||
.ms whois.nic.ms
|
||||
.mt whois.nic.org.mt
|
||||
.mu whois.nic.mu
|
||||
.mu whois.tld.mu
|
||||
.mv NONE # NIC? www.dhiraagu.com.mv
|
||||
.mw whois.nic.mw
|
||||
.mx whois.mx
|
||||
@ -252,7 +252,7 @@
|
||||
.pa WEB http://www.nic.pa/en
|
||||
.pe kero.yachay.pe
|
||||
.pf whois.registry.pf
|
||||
.pg NONE # http://www.unitech.ac.pg/
|
||||
.pg whois.nic.pg # https://www.unitech.ac.pg/icts-dns/
|
||||
.edu.ph WEB https://services.ph.net/dnshosting/dnshostingquery.pl
|
||||
.gov.ph NONE # http://dns.gov.ph/
|
||||
.ph WEB https://whois.dot.ph/
|
||||
@ -295,7 +295,7 @@
|
||||
.sm whois.nic.sm
|
||||
.sn whois.nic.sn
|
||||
.so whois.nic.so
|
||||
.sr NONE # https://isp.datasur.sr/
|
||||
.sr whois.sr # https://isp.datasur.sr/
|
||||
.ss whois.nic.ss
|
||||
.st whois.nic.st
|
||||
.msk.su whois.flexireg.net
|
||||
@ -316,7 +316,7 @@
|
||||
.tl whois.nic.tl
|
||||
.tm whois.nic.tm
|
||||
.tn whois.ati.tn
|
||||
.to whois.tonic.to
|
||||
.to whois.tonicregistry.to
|
||||
.tr whois.trabis.gov.tr
|
||||
.tt WEB https://www.nic.tt/cgi-bin/search.pl
|
||||
.tv RECURSIVE whois.nic.tv
|
||||
@ -328,16 +328,11 @@
|
||||
.ua whois.ua
|
||||
.ug whois.co.ug
|
||||
.ac.uk whois.nic.ac.uk
|
||||
.bl.uk NONE
|
||||
.british-library.uk NONE
|
||||
.gov.uk whois.gov.uk
|
||||
.icnet.uk NONE
|
||||
.jet.uk NONE
|
||||
.mil.uk NONE
|
||||
.mod.uk NONE
|
||||
.nhs.uk NONE
|
||||
.nls.uk NONE
|
||||
.parliament.uk NONE
|
||||
.police.uk NONE
|
||||
.uk whois.nic.uk
|
||||
#.um
|
||||
.fed.us whois.nic.gov
|
||||
@ -371,11 +366,11 @@
|
||||
|
||||
# AW means that I had to guess the whois server name, but I was not able
|
||||
# to find any registered subdomains to verify it.
|
||||
.xn--2scrj9c whois.registry.in # India
|
||||
.xn--2scrj9c whois.nixiregistry.in # India
|
||||
.xn--3e0b707e whois.kr # Korea, Republic of
|
||||
.xn--3hcrj9c whois.registry.in # India
|
||||
.xn--45br5cyl whois.registry.in # India
|
||||
.xn--45brj9c whois.registry.in # India, Bengali
|
||||
.xn--3hcrj9c whois.nixiregistry.in # India
|
||||
.xn--45br5cyl whois.nixiregistry.in # India
|
||||
.xn--45brj9c whois.nixiregistry.in # India, Bengali
|
||||
.xn--4dbrk0ce whois.isoc.org.il # Israel
|
||||
.xn--54b7fta0cc WEB https://bdia.btcl.com.bd/ # Bangladesh
|
||||
.xn--80ao21a whois.nic.kz # Kazakhstan
|
||||
@ -385,19 +380,19 @@
|
||||
.xn--clchc0ea0b2g2a9gcd whois.ta.sgnic.sg # Singapore, Tamil
|
||||
.xn--d1alf whois.marnet.mk # Macedonia
|
||||
.xn--e1a4c whois.eu # European Union, Cyrillic
|
||||
.xn--fiqs8s cwhois.cnnic.cn # China, Simplified Chinese
|
||||
.xn--fiqz9s cwhois.cnnic.cn # China, Traditional Chinese
|
||||
.xn--fpcrj9c3d whois.registry.in # India, Telugu
|
||||
.xn--fiqs8s whois.cnnic.cn # China, Simplified Chinese
|
||||
.xn--fiqz9s whois.cnnic.cn # China, Traditional Chinese
|
||||
.xn--fpcrj9c3d whois.nixiregistry.in # India, Telugu
|
||||
.xn--fzc2c9e2c whois.nic.lk # Sri Lanka, Sinhala
|
||||
.xn--gecrj9c whois.registry.in # India, Gujarati
|
||||
.xn--h2breg3eve whois.registry.in # India
|
||||
.xn--h2brj9c8c whois.registry.in # India
|
||||
.xn--h2brj9c whois.registry.in # India, Hindi
|
||||
.xn--gecrj9c whois.nixiregistry.in # India, Gujarati
|
||||
.xn--h2breg3eve whois.nixiregistry.in # India
|
||||
.xn--h2brj9c8c whois.nixiregistry.in # India
|
||||
.xn--h2brj9c whois.nixiregistry.in # India, Hindi
|
||||
.xn--j1amh whois.dotukr.com # Ukraine
|
||||
.xn--j6w193g whois.hkirc.hk # Hong Kong
|
||||
.xn--kprw13d whois.twnic.net.tw # Taiwan, Simplified Chinese
|
||||
.xn--kpry57d whois.twnic.net.tw # Taiwan, Traditional Chinese
|
||||
.xn--l1acc NONE # Mongolia
|
||||
.xn--l1acc whois.mn # Mongolia
|
||||
.xn--lgbbat1ad8j whois.nic.dz # Algeria
|
||||
.xn--mgb9awbf whois.registry.om # Oman
|
||||
.xn--mgba3a4f16a whois.nic.ir # Iran
|
||||
@ -405,12 +400,12 @@
|
||||
.xn--mgbah1a3hjkrd whois.nic.mr # Mauritania
|
||||
.xn--mgbai9azgqp6j NONE # Pakistan
|
||||
.xn--mgbayh7gpa WEB https://www.domain.jo/FirstPageen.aspx # Jordan
|
||||
.xn--mgbbh1a71e whois.registry.in # India, Urdu
|
||||
.xn--mgbbh1a whois.registry.in # India
|
||||
.xn--mgbbh1a71e whois.nixiregistry.in # India, Urdu
|
||||
.xn--mgbbh1a whois.nixiregistry.in # India
|
||||
.xn--mgbc0a9azcg NONE # Morocco
|
||||
.xn--mgbcpq6gpa1a NONE # Bahrain
|
||||
.xn--mgberp4a5d4ar whois.nic.net.sa # Saudi Arabia
|
||||
.xn--mgbgu82a whois.registry.in # India
|
||||
.xn--mgbgu82a whois.nixiregistry.in # India
|
||||
.xn--mgbpl2fh NONE # Sudan
|
||||
.xn--mgbtx2b whois.cmc.iq # Iraq
|
||||
.xn--mgbx4cd0ab whois.mynic.my # Malaysia AW
|
||||
@ -423,12 +418,12 @@
|
||||
.xn--q7ce6a whois.nic.la # Lao
|
||||
.xn--qxa6a whois.eu # European Union, Greek
|
||||
.xn--qxam WEB https://grweb.ics.forth.gr/public/whois?lang=en # Greece
|
||||
.xn--rvc1e0am3e whois.registry.in # India
|
||||
.xn--s9brj9c whois.registry.in # India, Punjabi
|
||||
.xn--rvc1e0am3e whois.nixiregistry.in # India
|
||||
.xn--s9brj9c whois.nixiregistry.in # India, Punjabi
|
||||
.xn--wgbh1c whois.dotmasr.eg # Egypt
|
||||
.xn--wgbl6a whois.registry.qa # Qatar
|
||||
.xn--xkc2al3hye2a whois.nic.lk # Sri Lanka, Tamil
|
||||
.xn--xkc2dl3a5ee0h whois.registry.in # India, Tamil
|
||||
.xn--xkc2dl3a5ee0h whois.nixiregistry.in # India, Tamil
|
||||
.xn--y9a3aq whois.amnic.net # Armenia
|
||||
.xn--yfro4i67o whois.zh.sgnic.sg # Singapore, Chinese
|
||||
.xn--ygbi2ammx whois.pnina.ps # Palestinian Territory
|
||||
|
||||
40
whois.c
40
whois.c
@ -41,7 +41,6 @@
|
||||
#endif
|
||||
|
||||
/* prototypes referenced in data.h */
|
||||
static void find_referral_server_6bone(char **, const char *);
|
||||
static void find_referral_server_apnic(char **, const char *);
|
||||
static void find_referral_server_arin(char **, const char *);
|
||||
static void find_referral_server_iana(char **, const char *);
|
||||
@ -797,26 +796,6 @@ int hide_line(int *hiding, const char *const line)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void find_referral_server_6bone(char **referral_server, const char *buf)
|
||||
{
|
||||
char nh[256], np[16], nq[1024];
|
||||
|
||||
if (*referral_server)
|
||||
return;
|
||||
|
||||
/* 6bone-style referral:
|
||||
* % referto: whois -h whois.arin.net -p 43 as 1
|
||||
*/
|
||||
if (!strneq(buf, "% referto:", 10))
|
||||
return;
|
||||
|
||||
if (sscanf(buf, REFERTO_FORMAT, nh, np, nq) == 3) {
|
||||
/* XXX we are ignoring the new query string */
|
||||
*referral_server = malloc(strlen(nh) + 1 + strlen(np) + 1);
|
||||
sprintf(*referral_server, "%s:%s", nh, np);
|
||||
}
|
||||
}
|
||||
|
||||
static void find_referral_server_apnic(char **referral_server, const char *buf)
|
||||
{
|
||||
/* Possible states of this FSM:
|
||||
@ -892,9 +871,6 @@ static void find_referral_server_arin(char **referral_server, const char *buf)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (*referral_server)
|
||||
return;
|
||||
|
||||
/* ARIN referrals:
|
||||
* ReferralServer: rwhois://rwhois.fuse.net:4321/
|
||||
* ReferralServer: whois://whois.ripe.net
|
||||
@ -903,6 +879,16 @@ static void find_referral_server_arin(char **referral_server, const char *buf)
|
||||
if (!strneq(buf, "ReferralServer:", 15))
|
||||
return;
|
||||
|
||||
/* When whois.arin.net returns multiple NetRange records, they will
|
||||
* appear from the less specific one to the most specific one.
|
||||
* Since the range we care about is the most specific one then we
|
||||
* need to use the last ReferralServer field found.
|
||||
*/
|
||||
if (*referral_server) {
|
||||
free(*referral_server);
|
||||
*referral_server = NULL;
|
||||
}
|
||||
|
||||
if ((p = strstr(buf, "rwhois://")))
|
||||
*referral_server = strdup(p + 9);
|
||||
else if ((p = strstr(buf, "whois://")))
|
||||
@ -1033,6 +1019,12 @@ char *query_server(const char *server, const char *port, const char *query)
|
||||
err_quit(_("Catastrophic error: disclaimer text has been changed.\n"
|
||||
"Please upgrade this program.\n"));
|
||||
|
||||
/* defensive programming: make sure to avoid trivial referral loops */
|
||||
if (referral_server && streq(server, referral_server)) {
|
||||
free(referral_server);
|
||||
referral_server = NULL;
|
||||
}
|
||||
|
||||
return referral_server;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user