Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 482997498f9f95c2819169698d08f0c7 > files > 62

bind-9.3.6-25.P1.el5_11.8.src.rpm

diff -up bind-9.3.6-P1/bin/dig/dighost.c.rh625240 bind-9.3.6-P1/bin/dig/dighost.c
--- bind-9.3.6-P1/bin/dig/dighost.c.rh625240	2010-08-20 13:02:37.769618381 +0200
+++ bind-9.3.6-P1/bin/dig/dighost.c	2010-08-20 13:15:21.253750098 +0200
@@ -95,6 +95,7 @@ dig_serverlist_t server_list;
 dig_searchlistlist_t search_list;
 
 isc_boolean_t
+	check_ra = ISC_FALSE,
 	have_ipv4 = ISC_FALSE,
 	have_ipv6 = ISC_FALSE,
 	specified_source = ISC_FALSE,
@@ -2832,7 +2833,9 @@ recv_done(isc_task_t *task, isc_event_t 
 		UNLOCK_LOOKUP;
 		return;
 	}
-	if (msg->rcode == dns_rcode_servfail && !l->servfail_stops) {
+	if ((msg->rcode == dns_rcode_servfail && !l->servfail_stops) ||
+	    (check_ra && (msg->flags & DNS_MESSAGEFLAG_RA) == 0 && l->recurse))
+	{
 		dig_query_t *next = ISC_LIST_NEXT(query, link);
 		if (l->current_query == query)
 			l->current_query = NULL;
@@ -2850,9 +2853,13 @@ recv_done(isc_task_t *task, isc_event_t 
 		 */
 		if ((ISC_LIST_HEAD(l->q) != query) ||
 		    (ISC_LIST_NEXT(query, link) != NULL)) {
-			printf(";; Got SERVFAIL reply from %s, "
-			       "trying next server\n",
-			       query->servname);
+                        if (l->comments == ISC_TRUE)
+				printf(";; Got %s from %s, "
+				       "trying next server\n",
+				       msg->rcode == dns_rcode_servfail ?
+				       "SERVFAIL reply" :
+				       "recursion not available",
+				       query->servname);
 			clear_query(query);
 			check_next_lookup(l);
 			dns_message_destroy(&msg);
diff -up bind-9.3.6-P1/bin/dig/host.c.rh625240 bind-9.3.6-P1/bin/dig/host.c
--- bind-9.3.6-P1/bin/dig/host.c.rh625240	2010-08-20 13:06:18.408116014 +0200
+++ bind-9.3.6-P1/bin/dig/host.c	2010-08-20 13:06:41.732534514 +0200
@@ -734,7 +734,8 @@ parse_args(isc_boolean_t is_batchfile, i
 		set_nameserver(argv[isc_commandline_index+1]);
 		debug("server is %s", argv[isc_commandline_index+1]);
 		listed_server = ISC_TRUE;
-	}
+	} else
+		check_ra = ISC_TRUE;
 
 	lookup->pending = ISC_FALSE;
 	if (get_reverse(store, sizeof(store), hostname,
diff -up bind-9.3.6-P1/bin/dig/include/dig/dig.h.rh625240 bind-9.3.6-P1/bin/dig/include/dig/dig.h
--- bind-9.3.6-P1/bin/dig/include/dig/dig.h.rh625240	2010-08-20 13:08:19.980967780 +0200
+++ bind-9.3.6-P1/bin/dig/include/dig/dig.h	2010-08-20 13:08:45.535717230 +0200
@@ -233,7 +233,7 @@ extern dig_lookuplist_t lookup_list;
 extern dig_serverlist_t server_list;
 extern dig_searchlistlist_t search_list;
 
-extern isc_boolean_t have_ipv4, have_ipv6, specified_source,
+extern isc_boolean_t check_ra, have_ipv4, have_ipv6, specified_source,
         usesearch, qr;
 extern in_port_t port;
 extern unsigned int timeout;
diff -up bind-9.3.6-P1/bin/dig/nslookup.c.rh625240 bind-9.3.6-P1/bin/dig/nslookup.c
--- bind-9.3.6-P1/bin/dig/nslookup.c.rh625240	2010-08-20 13:07:01.126195679 +0200
+++ bind-9.3.6-P1/bin/dig/nslookup.c	2010-08-20 13:08:04.098006733 +0200
@@ -736,6 +736,7 @@ get_next_command(void) {
 		 (strcasecmp(ptr, "lserver") == 0)) {
 		isc_app_block();
 		set_nameserver(arg);
+		check_ra = ISC_FALSE;
 		isc_app_unblock();
 		show_settings(ISC_TRUE, ISC_TRUE);
 	} else if (strcasecmp(ptr, "exit") == 0) {
@@ -774,9 +775,10 @@ parse_args(int argc, char **argv) {
 				have_lookup = ISC_TRUE;
 				in_use = ISC_TRUE;
 				addlookup(argv[0]);
-			}
-			else
+			} else {
 				set_nameserver(argv[0]);
+				check_ra = ISC_FALSE;
+			}
 		}
 	}
 }
@@ -852,6 +854,8 @@ main(int argc, char **argv) {
 	ISC_LIST_INIT(server_list);
 	ISC_LIST_INIT(search_list);
 
+	check_ra = ISC_TRUE;
+
 	result = isc_app_start();
 	check_result(result, "isc_app_start");