94 Commits

Author SHA1 Message Date
Marco d'Itri
9777e2aa77 Do not request domain results for name server queries
If there is more than one dot in the query string then it can only be
a name server, so do not restrict the results to domains only.
2017-08-22 16:52:56 +02:00
Marco d'Itri
46faeee41e Disable recursion for queries like "nameserver name.example.com"
Or else the program would return an error because no registrar
whois server is returned by the registry.
2017-08-22 16:50:32 +02:00
Marco d'Itri
85c7b302a3 Initialize the target of strcat
Was not detected until now, but immediately crashes with a recent libc.
2017-08-15 21:18:21 +02:00
Marco d'Itri
89d2aef158 Fix referrals for .com, .net, .jobs, .bz, .cc and .tv
ICANN mandated that the referral whois server field had to be renamed,
hence breaking all whois clients:
https://www.icann.org/resources/pages/rdds-labeling-policy-2017-02-01-en

Closes #56 from Github.
2017-07-27 16:55:20 +02:00
Petr Písař
3566a2c4ca Fix misspellings in IPv4 formatting string
Querying 6to4 address failed on malformed IPv4 address:

$ ./whois 2002:5ab2:d182::1

Querying for the IPv4 endpoint 90d.178d.209d.130d of a 6to4 IPv6 address.

This patch fixes it.
2017-03-13 01:23:17 +01:00
Marco d'Itri
8ed6d73095 Implement support for libidn2
Contributed by Tim Rühsen.
Closes #49 from Github.
2017-02-27 00:32:43 +01:00
Marco d'Itri
cf61394ded Unconditionally use AI_IDN
AI_IDN is not provided by libidn: it is a feature of glibc.
If not available on other platforms then it will be defined to 0 in utils.h.
2017-02-27 00:27:06 +01:00
Marco d'Itri
fb823a251a Annotate more functions with NORETURN
Contributed by Sami Kerola.
Closes #48 from Github.
2017-02-26 23:33:01 +01:00
Marco d'Itri
5e33209e13 Fix minor compiler warnings
Fix a lot of minor compiler warnings with no practical effect.
Contributed by Sami Kerola.
2017-02-26 23:12:47 +01:00
Marco d'Itri
e322f5cd4d Use "domain" instead of "=" for default verisign-grs queries
To ignore the name server names spam.
2016-10-30 14:39:09 +01:00
Marco d'Itri
cdc050a320 Query whois.iana.org for IDN TLDs too 2016-03-29 05:32:32 +02:00
Marco d'Itri
718ae61ae5 Support american fuzzy lop
When built with AFL_MODE set to true, whois will use the first line of
standard input as command line parameters and the rest as network input.
2015-12-08 08:38:50 +01:00
Marco d'Itri
ea2eb44421 Fix the --select-types and --sources long options
This bug was found by the awesome american fuzzy lop!
2015-08-30 01:18:17 +02:00
Marco d'Itri
b26a58fd25 Support hiding multiple disclaimers blocks
Correctly detecting the disclaimers of some registrars required splitting the
CRSNIC/Verisign detection strings in two parts.
This code makes the program start looking again for new blocks to hide after
the end of the first one.
2015-03-23 04:28:58 +01:00
Marco d'Itri
b522889803 Ignore empty referral strings
Some registrars return an empty field for the referral server.
2015-01-25 03:42:37 +01:00
Marco d'Itri
dc3eeb8170 Fix referrals handling for some verisign-grs.com servers
Verisign has changed for no apparent reason the label for the whois
server field of the cc, tv and jobs TLDs whois servers.
2015-01-25 03:42:37 +01:00
Marco d'Itri
e054c58eb2 Fix the code that removes trailing dots
And make it easier to understand as well.
2014-11-06 03:47:26 +01:00
Marco d'Itri
db5dc4db7a Rename domcmp() in endstrcaseeq() and rewrite it
Rewrite it to use the same code of in_domain().
2014-10-16 01:52:04 +02:00
Marco d'Itri
8ccab2cb13 Ask whois.iana.org about TLDs
Recognize as a TLD any string without dots present in tld_serv_list
and new_gtlds_list.
2014-10-16 01:52:04 +02:00
Marco d'Itri
d961608451 Convert tld_serv_list to in_domain() 2014-10-16 01:52:04 +02:00
Marco d'Itri
29b1a3a9c3 Split nic_handles_list off tld_serv_list
To be able to use in_domain() for tld_serv_list
2014-10-16 01:52:03 +02:00
Marco d'Itri
842e142f1a Convert queryformat() to in_domain() 2014-10-15 15:19:12 +02:00
Marco d'Itri
45bdfcc27c Convert convert_inaddr() to in_domain() 2014-10-15 15:19:12 +02:00
Marco d'Itri
3ad4f43735 Convert is_new_gtld() to in_domain() 2014-10-15 15:19:12 +02:00
Marco d'Itri
3aa160e6a1 Add in_domain() to check if the argument is a subdomain 2014-10-15 14:30:35 +02:00
Marco d'Itri
257abceab3 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.
2014-10-15 02:15:53 +02:00
Marco d'Itri
33f174e956 Default to whois.ripe.net when using long flags 2014-09-13 05:27:53 +02:00
Marco d'Itri
833af3d94a Implement support for the long RIPE flags 2014-09-13 05:27:53 +02:00
Marco d'Itri
1ae06d1a5a Move longopts into main() 2014-09-13 05:27:51 +02:00
Marco d'Itri
fa011e0665 Use the first referral of Afilias GRS results
Defensive programming: this is never supposed to happen, but if more
than one attribute were returned by the registry then the memory
allocated to referral_server would be leaked.
2014-09-13 05:12:17 +02:00
Marco d'Itri
c7769cbfdf make is_new_gtld() return the TLD 2014-09-13 02:42:29 +02:00
Marco d'Itri
1e1cb543c2 Support hiding disclaimers until the end of the output 2014-05-26 04:28:36 +02:00
Marco d'Itri
171705cbde Use whois.nic.$TLD for the "new" gTLDs
The "new" gTLDs are contractually required by ICANN to provide port 43
whois service on this standard domain.
2014-05-02 04:26:50 +02:00
Marco d'Itri
d2ee7af1d7 Extract the version number from the changelog 2014-02-07 06:33:08 +01:00
Petr Písař
a626373f45 Free memory in handle_query()
Make the server variable always hold a dynamically allocated string and
clean up the related const statements.

Signed-off-by: Petr Písař <ppisar@redhat.com>
2013-12-26 07:48:10 +01:00
Petr Písař
298f2080fe strtol() returns signed long int
Assiging strol() return value to unsigned int makes subsequent
comparison to < 0 pointless.

Signed-off-by: Petr Písař <ppisar@redhat.com>
2013-12-26 07:48:10 +01:00
Petr Písař
2d12f4da54 Do not hide legal disclaimer with whois -V
There was missing break in the 'V' option case.

Signed-off-by: Petr Písař <ppisar@redhat.com>
2013-12-26 07:43:15 +01:00
Marco d'Itri
4deb57d9ba Undocument the -F RIPE option
It is deprecated, does not always work correctly and nobody should ever
use it anymore.
2013-04-10 17:25:05 +02:00
Petr Písař
361164fea5 Handle --help as success
whois --help output should go to standard output, and exit code should
be zero.
2013-04-10 17:25:05 +02:00
Petr Písař
c5fb072b2b Remove -S option
RIPE-like `-S' option is not documented nor supported by RIPE.
2013-04-10 17:25:05 +02:00
Petr Písař
8ec60c27f0 Update documentation
whois(1) options listing has been updated in whois --help output as
well as in manual page.

Rerefence to RIPE WHOIS database query syntax has been updated.
2013-04-10 17:25:05 +02:00
Marco d'Itri
7d4b9714c4 Remove a unused variable 2013-03-31 08:10:29 +02:00
Marco d'Itri
9b1706c1e1 Fix parsing of 6to4 addresses
The last two bytes of the IPv4 address in 6to4 addresses were not
parsed correctly since version 5.0.19. (Fixes #699928.)
2013-03-31 08:10:02 +02:00
Marco d'Itri
a21a1d7756 Imported Debian version 5.0.19 2013-03-30 02:31:42 +01:00
Marco d'Itri
2d381497c0 Imported Debian version 5.0.17 2013-03-30 02:31:42 +01:00
Marco d'Itri
51d8f998dd Imported Debian version 5.0.15 2013-03-30 02:31:41 +01:00
Marco d'Itri
6c3ca39f25 Imported Debian version 5.0.12 2013-03-30 02:31:41 +01:00
Marco d'Itri
49aa4a0f24 Imported Debian version 5.0.6 2013-03-30 02:31:40 +01:00
Marco d'Itri
cdfdc7d88b Imported Debian version 5.0.5 2013-03-30 02:31:39 +01:00
Marco d'Itri
c4ba9f91d1 Imported Debian version 5.0.4 2013-03-30 02:31:39 +01:00