2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

258. [bug] Nslookup didn't properly check class and type values.

257.	[bug]		Dig/Host/Nslookup didn't properly handle connect
			timeout in some very specific situations, and gave
			an unnecessary warning.
This commit is contained in:
Michael Sawyer 2000-09-14 20:11:48 +00:00
parent b374727d51
commit 3291587f23
3 changed files with 42 additions and 14 deletions

View File

@ -1,3 +1,9 @@
258. [bug] Nslookup didn't properly check class and type values.
257. [bug] Dig/Host/Nslookup didn't properly handle connect
timeout in some very specific situations, and gave
an unnecessary warning.
456. [bug] Stub zones were not resetting the refresh and expire
counters, loadtime or clearing the DNS_ZONE_REFRESH
(refresh in progress) flag upon successful update.

View File

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.126 2000/09/13 08:02:11 marka Exp $ */
/* $Id: dighost.c,v 1.127 2000/09/14 20:11:47 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@ -669,6 +669,8 @@ setup_libs(void) {
result = isc_mutex_init(&lookup_lock);
check_result(result, "isc_mutex_init");
dns_result_register();
}
/*
@ -1679,6 +1681,20 @@ connect_done(isc_task_t *task, isc_event_t *event) {
query->waiting_connect = ISC_FALSE;
if (sevent->result == ISC_R_CANCELED) {
debug("in cancel handler");
isc_socket_detach(&query->sock);
sockcount--;
INSIST(sockcount >= 0);
debug("sockcount=%d", sockcount);
query->waiting_connect = ISC_FALSE;
isc_event_free(&event);
l = query->lookup;
clear_query(query);
check_next_lookup(l);
UNLOCK_LOOKUP;
return;
}
if (sevent->result != ISC_R_SUCCESS) {
debug("unsuccessful connection: %s",
isc_result_totext(sevent->result));

View File

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: nslookup.c,v 1.42 2000/09/13 00:27:25 mws Exp $ */
/* $Id: nslookup.c,v 1.43 2000/09/14 20:11:48 mws Exp $ */
#include <config.h>
@ -483,6 +483,16 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
isc_result_t result;
debug("printmessage()");
debug("continuing on with rcode != 0");
result = isc_buffer_allocate(mctx, &b, MXNAME);
check_result(result, "isc_buffer_allocate");
printf("Server:\t\t%s\n", query->servname);
result = isc_sockaddr_totext(&query->sockaddr, b);
check_result(result, "isc_sockaddr_totext");
printf("Address:\t%.*s\n", (int)isc_buffer_usedlength(b),
(char*)isc_buffer_base(b));
isc_buffer_free(&b);
puts("");
if (msg->rcode != 0) {
result = isc_buffer_allocate(mctx, &b, MXNAME);
@ -498,16 +508,6 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
debug("returning with rcode == 0");
return (ISC_R_SUCCESS);
}
debug("continuing on with rcode != 0");
result = isc_buffer_allocate(mctx, &b, MXNAME);
check_result(result, "isc_buffer_allocate");
printf("Server:\t\t%s\n", query->servname);
result = isc_sockaddr_totext(&query->sockaddr, b);
check_result(result, "isc_sockaddr_totext");
printf("Address:\t%.*s\n", (int)isc_buffer_usedlength(b),
(char*)isc_buffer_base(b));
isc_buffer_free(&b);
puts("");
if (!short_form){
puts("------------");
/* detailheader(query, msg);*/
@ -672,11 +672,17 @@ addlookup(char *opt) {
tr.base = deftype;
tr.length = strlen(deftype);
result = dns_rdatatype_fromtext(&rdtype, &tr);
INSIST(result == ISC_R_SUCCESS);
if (result != ISC_R_SUCCESS) {
printf ("unknown query type: %s\n",deftype);
rdclass = dns_rdatatype_a;
}
tr.base = defclass;
tr.length = strlen(defclass);
result = dns_rdataclass_fromtext(&rdclass, &tr);
INSIST(result == ISC_R_SUCCESS);
if (result != ISC_R_SUCCESS) {
printf ("unknown query class: %s\n",defclass);
rdclass = dns_rdataclass_in;
}
lookup = make_empty_lookup();
strncpy(lookup->textname, opt, MXNAME-1);
lookup->rdtype = rdtype;