900526
diff -up bind-9.7.2b1/bin/dig/dighost.c.rh570851 bind-9.7.2b1/bin/dig/dighost.c
900526
--- bind-9.7.2b1/bin/dig/dighost.c.rh570851	2010-08-10 12:55:14.219403986 +0200
900526
+++ bind-9.7.2b1/bin/dig/dighost.c	2010-08-10 12:56:40.716015777 +0200
900526
@@ -126,7 +126,8 @@ isc_boolean_t
900526
 	usesearch = ISC_FALSE,
900526
 	showsearch = ISC_FALSE,
900526
 	qr = ISC_FALSE,
900526
-	is_dst_up = ISC_FALSE;
900526
+	is_dst_up = ISC_FALSE,
900526
+	verbose = ISC_FALSE;
900526
 in_port_t port = 53;
900526
 unsigned int timeout = 0;
900526
 unsigned int extrabytes;
900526
@@ -1240,10 +1241,24 @@ setup_system(void) {
900526
 		}
900526
 	}
900526
 
900526
+	if (lwconf->resdebug) {
900526
+		verbose = ISC_TRUE;
900526
+		debug("verbose is on");
900526
+	}
900526
 	if (ndots == -1) {
900526
 		ndots = lwconf->ndots;
900526
 		debug("ndots is %d.", ndots);
900526
 	}
900526
+	if (lwconf->attempts) {
900526
+		tries = lwconf->attempts + 1;
900526
+		if (tries < 2)
900526
+			tries = 2;
900526
+		debug("tries is %d.", tries);
900526
+	}
900526
+	if (lwconf->timeout) {
900526
+		timeout = lwconf->timeout;
900526
+		debug("timeout is %d.", timeout);
900526
+	}
900526
 
900526
 	/* If user doesn't specify server use nameservers from resolv.conf. */
900526
 	if (ISC_LIST_EMPTY(server_list))
900526
diff -up bind-9.7.2b1/bin/dig/host.c.rh570851 bind-9.7.2b1/bin/dig/host.c
900526
--- bind-9.7.2b1/bin/dig/host.c.rh570851	2010-08-10 12:57:16.032758098 +0200
900526
+++ bind-9.7.2b1/bin/dig/host.c	2010-08-10 13:02:12.848559845 +0200
900526
@@ -659,6 +659,7 @@ parse_args(isc_boolean_t is_batchfile, i
900526
 
900526
 	lookup->servfail_stops = ISC_FALSE;
900526
 	lookup->comments = ISC_FALSE;
900526
+	short_form = !verbose;
900526
 
900526
 	while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
900526
 		switch (c) {
900526
@@ -869,8 +870,8 @@ main(int argc, char **argv) {
900526
 	result = isc_app_start();
900526
 	check_result(result, "isc_app_start");
900526
 	setup_libs();
900526
-	parse_args(ISC_FALSE, argc, argv);
900526
 	setup_system();
900526
+	parse_args(ISC_FALSE, argc, argv);
900526
 	result = isc_app_onrun(mctx, global_task, onrun_callback, NULL);
900526
 	check_result(result, "isc_app_onrun");
900526
 	isc_app_run();
900526
diff -up bind-9.7.2b1/bin/dig/include/dig/dig.h.rh570851 bind-9.7.2b1/bin/dig/include/dig/dig.h
900526
--- bind-9.7.2b1/bin/dig/include/dig/dig.h.rh570851	2010-08-10 13:02:32.722244088 +0200
900526
+++ bind-9.7.2b1/bin/dig/include/dig/dig.h	2010-08-10 13:02:48.465158159 +0200
900526
@@ -278,6 +278,7 @@ extern isc_boolean_t debugging, memdebug
900526
 extern char *progname;
900526
 extern int tries;
900526
 extern int fatalexit;
900526
+extern isc_boolean_t verbose;
900526
 #ifdef WITH_IDN
900526
 extern int idnoptions;
900526
 #endif
900526
diff -up bind-9.7.2b1/lib/lwres/include/lwres/lwres.h.rh570851 bind-9.7.2b1/lib/lwres/include/lwres/lwres.h
900526
--- bind-9.7.2b1/lib/lwres/include/lwres/lwres.h.rh570851	2010-08-10 13:04:40.465780506 +0200
900526
+++ bind-9.7.2b1/lib/lwres/include/lwres/lwres.h	2010-08-10 13:05:57.559867830 +0200
900526
@@ -243,6 +243,8 @@ typedef struct {
900526
 	lwres_uint8_t	resdebug;      /*%< non-zero if 'options debug' set */
900526
 	lwres_uint8_t	ndots;	       /*%< set to n in 'options ndots:n' */
900526
 	lwres_uint8_t	no_tld_query;  /*%< non-zero if 'options no_tld_query' */
900526
+	lwres_int32_t	attempts;      /*%< set to n in 'options attempts:n' */
900526
+	lwres_int32_t	timeout;       /*%< set to n in 'options timeout:n' */
900526
 } lwres_conf_t;
900526
 
900526
 #define LWRES_ADDRTYPE_V4		0x00000001U	/*%< ipv4 */
900526
diff -up bind-9.7.2b1/lib/lwres/lwconfig.c.rh570851 bind-9.7.2b1/lib/lwres/lwconfig.c
900526
--- bind-9.7.2b1/lib/lwres/lwconfig.c.rh570851	2010-08-10 13:06:08.051778429 +0200
900526
+++ bind-9.7.2b1/lib/lwres/lwconfig.c	2010-08-10 13:09:53.972555776 +0200
900526
@@ -237,6 +237,8 @@ lwres_conf_init(lwres_context_t *ctx) {
900526
 	confdata->resdebug = 0;
900526
 	confdata->ndots = 1;
900526
 	confdata->no_tld_query = 0;
900526
+	confdata->attempts = 0;
900526
+	confdata->timeout = 0;
900526
 
900526
 	for (i = 0; i < LWRES_CONFMAXNAMESERVERS; i++)
900526
 		lwres_resetaddr(&confdata->nameservers[i]);
900526
@@ -289,6 +291,8 @@ lwres_conf_clear(lwres_context_t *ctx) {
900526
 	confdata->resdebug = 0;
900526
 	confdata->ndots = 1;
900526
 	confdata->no_tld_query = 0;
900526
+	confdata->attempts = 0;
900526
+	confdata->timeout = 0;
900526
 }
900526
 
900526
 static lwres_result_t
900526
@@ -530,6 +534,8 @@ static lwres_result_t
900526
 lwres_conf_parseoption(lwres_context_t *ctx,  FILE *fp) {
900526
 	int delim;
900526
 	long ndots;
900526
+	long attempts;
900526
+	long timeout;
900526
 	char *p;
900526
 	char word[LWRES_CONFMAXLINELEN];
900526
 	lwres_conf_t *confdata;
900526
@@ -546,6 +552,8 @@ lwres_conf_parseoption(lwres_context_t *
900526
 			confdata->resdebug = 1;
900526
 		} else if (strcmp("no_tld_query", word) == 0) {
900526
 			confdata->no_tld_query = 1;
900526
+		} else if (strcmp("debug", word) == 0) {
900526
+			confdata->resdebug = 1;
900526
 		} else if (strncmp("ndots:", word, 6) == 0) {
900526
 			ndots = strtol(word + 6, &p, 10);
900526
 			if (*p != '\0') /* Bad string. */
900526
@@ -553,6 +561,18 @@ lwres_conf_parseoption(lwres_context_t *
900526
 			if (ndots < 0 || ndots > 0xff) /* Out of range. */
900526
 				return (LWRES_R_FAILURE);
900526
 			confdata->ndots = (lwres_uint8_t)ndots;
900526
+		} else if (strncmp("timeout:", word, 8) == 0) {
900526
+			timeout = strtol(word + 8, &p, 10);
900526
+			if (*p != '\0') /* Bad string. */
900526
+				return (LWRES_R_FAILURE);
900526
+			confdata->timeout = (lwres_int32_t)timeout;
900526
+		} else if (strncmp("attempts:", word, 9) == 0) {
900526
+			attempts = strtol(word + 9, &p, 10);
900526
+			if (*p != '\0') /* Bad string. */
900526
+				return (LWRES_R_FAILURE);
900526
+			if (attempts < 0) /* Out of range. */
900526
+				return (LWRES_R_FAILURE);
900526
+			confdata->attempts = (lwres_int32_t)attempts;
900526
 		}
900526
 
900526
 		if (delim == EOF || delim == '\n')
900526
@@ -716,6 +736,12 @@ lwres_conf_print(lwres_context_t *ctx, F
900526
 	if (confdata->no_tld_query)
900526
 		fprintf(fp, "options no_tld_query\n");
900526
 
900526
+	if (confdata->attempts)
900526
+		fprintf(fp, "options attempts:%d\n", confdata->attempts);
900526
+
900526
+	if (confdata->timeout)
900526
+		fprintf(fp, "options timeout:%d\n", confdata->timeout);
900526
+
900526
 	return (LWRES_R_SUCCESS);
900526
 }
900526