From: Evan Hunt Date: Sat, 25 Mar 2017 19:49:25 +0000 (-0700) Subject: [master] host -A X-Git-Tag: v9.12.0a1~401 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39eb1d03534f065184a75952f0561d4acbb79126;p=thirdparty%2Fbind9.git [master] host -A 4593. [func] "host -A" returns most records for a name but omits RRSIG, NSEC and NSEC3. (Thanks to Tony Finch.) [RT #43032] --- diff --git a/CHANGES b/CHANGES index 445e5e7adeb..96578e328e0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +4593. [func] "host -A" returns most records for a name but + omits RRSIG, NSEC and NSEC3. (Thanks to Tony Finch.) + [RT #43032] + 4582. [security] 'rndc ""' could trigger a assertion failure in named. (CVE-2017-3138) [RT #44924] diff --git a/bin/dig/host.c b/bin/dig/host.c index d6418dfc63a..c1bd6825831 100644 --- a/bin/dig/host.c +++ b/bin/dig/host.c @@ -48,6 +48,7 @@ static isc_boolean_t short_form = ISC_TRUE, listed_server = ISC_FALSE; static isc_boolean_t default_lookups = ISC_TRUE; static int seen_error = -1; static isc_boolean_t list_addresses = ISC_TRUE; +static isc_boolean_t list_almost_all = ISC_FALSE; static dns_rdatatype_t list_type = dns_rdatatype_a; static isc_boolean_t printed_server = ISC_FALSE; static isc_boolean_t ipv4only = ISC_FALSE, ipv6only = ISC_FALSE; @@ -140,6 +141,7 @@ show_usage(void) { "Usage: host [-aCdilrTvVw] [-c class] [-N ndots] [-t type] [-W time]\n" " [-R number] [-m flag] hostname [server]\n" " -a is equivalent to -v -t ANY\n" +" -A is like -a but omits RRSIG, NSEC, NSEC3\n" " -c specifies query class for non-IN data\n" " -C compares SOA records on authoritative nameservers\n" " -d is equivalent to -v\n" @@ -288,6 +290,11 @@ printsection(dns_message_t *msg, dns_section_t sectionid, rdataset->type == dns_rdatatype_ns || rdataset->type == dns_rdatatype_ptr)))) continue; + if (list_almost_all && + (rdataset->type == dns_rdatatype_rrsig || + rdataset->type == dns_rdatatype_nsec || + rdataset->type == dns_rdatatype_nsec3)) + continue; if (!short_form) { result = dns_rdataset_totext(rdataset, print_name, @@ -595,7 +602,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { return (result); } -static const char * optstring = "46ac:dilnm:rst:vVwCDN:R:TW:"; +static const char * optstring = "46aAc:dilnm:rst:vVwCDN:R:TW:"; /*% version */ static void @@ -632,6 +639,7 @@ pre_parse_args(int argc, char **argv) { ipv6only = ISC_TRUE; break; case 'a': break; + case 'A': break; case 'c': break; case 'd': break; case 'i': break; @@ -763,6 +771,9 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) { } default_lookups = ISC_FALSE; break; + case 'A': + list_almost_all = ISC_TRUE; + /* FALL THROUGH */ case 'a': if (!lookup->rdtypeset || lookup->rdtype != dns_rdatatype_axfr) diff --git a/bin/dig/host.docbook b/bin/dig/host.docbook index 3cc4981d54c..3ffaa5e7038 100644 --- a/bin/dig/host.docbook +++ b/bin/dig/host.docbook @@ -49,7 +49,7 @@ host - + @@ -127,6 +127,17 @@ + + -A + + + "Almost all". The option is equivalent + to except RRSIG, NSEC, and NSEC3 + records are omitted from the output. + + + + -c class diff --git a/doc/arm/notes.xml b/doc/arm/notes.xml index cdb6f465db1..64ccb12cc98 100644 --- a/doc/arm/notes.xml +++ b/doc/arm/notes.xml @@ -142,6 +142,12 @@
New Features + + + The host -A option returns most + records for a name, but omits types RRSIG, NSEC and NSEC3. + + Query logic has been substantially refactored (e.g. query_find