]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3393. [bug] 'host -C' could core dump if REFUSED was received.
authorMark Andrews <marka@isc.org>
Mon, 15 Oct 2012 23:42:24 +0000 (10:42 +1100)
committerMark Andrews <marka@isc.org>
Mon, 15 Oct 2012 23:42:24 +0000 (10:42 +1100)
                        [RT #31381]

CHANGES
bin/dig/dighost.c
bin/dig/host.c

diff --git a/CHANGES b/CHANGES
index 19a14ad44305712d6e4c97c151c851b1ea08174b..3f8fc67ebcd62462b0835a291231c25bdd9d0c97 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3393.  [bug]           'host -C' could core dump if REFUSED was received.
+                       [RT #31381]
+
 3392.  [func]          Keep statistics on REFUSED responses. [RT #31412]
 
 3391.  [bug]           A DNSKEY lookup that encountered a CNAME failed.
index a76bfb35f2cf1b7e53501e14b90418e091b090ca..c07cc4c8eed1329923e9ac8c7784e22f2debb545 100644 (file)
@@ -3425,6 +3425,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
                                if (n == 0)
                                        docancel = ISC_TRUE;
                                l->trace_root = ISC_FALSE;
+                               usesearch = ISC_FALSE;
                        } else
 #ifdef DIG_SIGCHASE
                                if (!do_sigchase)
index b04b39c21f3a02a0bf7d165bcff230d0b33ea2b7..518544f899c52343739b4bb447cb0e8f71edd1c2 100644 (file)
@@ -446,10 +446,18 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
        if (msg->rcode != 0) {
                char namestr[DNS_NAME_FORMATSIZE];
                dns_name_format(query->lookup->name, namestr, sizeof(namestr));
-               printf("Host %s not found: %d(%s)\n",
-                      (msg->rcode != dns_rcode_nxdomain) ? namestr :
-                      query->lookup->textname, msg->rcode,
-                      rcode_totext(msg->rcode));
+
+               if (query->lookup->identify_previous_line)
+                       printf("Nameserver %s:\n\t%s not found: %d(%s)\n",
+                              query->servname,
+                              (msg->rcode != dns_rcode_nxdomain) ? namestr :
+                              query->lookup->textname, msg->rcode,
+                              rcode_totext(msg->rcode));
+               else
+                       printf("Host %s not found: %d(%s)\n",
+                              (msg->rcode != dns_rcode_nxdomain) ? namestr :
+                              query->lookup->textname, msg->rcode,
+                              rcode_totext(msg->rcode));
                return (ISC_R_SUCCESS);
        }