]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] host -A
authorEvan Hunt <each@isc.org>
Sat, 25 Mar 2017 19:49:25 +0000 (12:49 -0700)
committerEvan Hunt <each@isc.org>
Sat, 25 Mar 2017 19:49:25 +0000 (12:49 -0700)
4593. [func] "host -A" returns most records for a name but
omits RRSIG, NSEC and NSEC3. (Thanks to Tony Finch.)
[RT #43032]

CHANGES
bin/dig/host.c
bin/dig/host.docbook
doc/arm/notes.xml

diff --git a/CHANGES b/CHANGES
index 445e5e7adeb72af4c6cb09047d901678eef0165b..96578e328e0e98003ffce8944d9d302d9f467975 100644 (file)
--- 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]
 
index d6418dfc63a489dd0df85186e25eaecdefae5c57..c1bd68258316320472d4e9f89385d033f4d8552e 100644 (file)
@@ -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)
index 3cc4981d54c87a0a471e46233bcc343c753046ff..3ffaa5e7038fe19c50f883a4eb5cc857106c6de2 100644 (file)
@@ -49,7 +49,7 @@
   <refsynopsisdiv>
     <cmdsynopsis sepchar=" ">
       <command>host</command>
-      <arg choice="opt" rep="norepeat"><option>-aCdlnrsTwv</option></arg>
+      <arg choice="opt" rep="norepeat"><option>-aACdlnrsTwv</option></arg>
       <arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">class</replaceable></option></arg>
       <arg choice="opt" rep="norepeat"><option>-N <replaceable class="parameter">ndots</replaceable></option></arg>
       <arg choice="opt" rep="norepeat"><option>-R <replaceable class="parameter">number</replaceable></option></arg>
        </listitem>
       </varlistentry>
 
+      <varlistentry>
+       <term>-A</term>
+       <listitem>
+         <para>
+           "Almost all". The <option>-A</option> option is equivalent
+           to <option>-a</option> except RRSIG, NSEC, and NSEC3
+           records are omitted from the output.
+         </para>
+       </listitem>
+      </varlistentry>
+
       <varlistentry>
        <term>-c <replaceable class="parameter">class</replaceable></term>
        <listitem>
index cdb6f465db11e7eae8fb6191ad8196ed1d6c3838..64ccb12cc98b42b7e16359522bcefb81f155c52e 100644 (file)
 
   <section xml:id="relnotes_features"><info><title>New Features</title></info>
     <itemizedlist>
+      <listitem>
+        <para>
+         The <command>host -A</command> option returns most
+         records for a name, but omits types RRSIG, NSEC and NSEC3.
+       </para>
+      </listitem>
       <listitem>
         <para>
          Query logic has been substantially refactored (e.g. query_find