From: Mark Andrews Date: Mon, 15 Oct 2012 23:42:24 +0000 (+1100) Subject: 3393. [bug] 'host -C' could core dump if REFUSED was received. X-Git-Tag: v9.10.0a1~802 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7786d6542bb800be7d8c56793985d510626806b2;p=thirdparty%2Fbind9.git 3393. [bug] 'host -C' could core dump if REFUSED was received. [RT #31381] --- diff --git a/CHANGES b/CHANGES index 19a14ad4430..3f8fc67ebcd 100644 --- 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. diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index a76bfb35f2c..c07cc4c8eed 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -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) diff --git a/bin/dig/host.c b/bin/dig/host.c index b04b39c21f3..518544f899c 100644 --- a/bin/dig/host.c +++ b/bin/dig/host.c @@ -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); }