summaryrefslogtreecommitdiffstats
path: root/contrib/bind9/bin/dig
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bind9/bin/dig')
-rw-r--r--contrib/bind9/bin/dig/dig.c14
-rw-r--r--contrib/bind9/bin/dig/dighost.c71
-rw-r--r--contrib/bind9/bin/dig/host.c2
-rw-r--r--contrib/bind9/bin/dig/nslookup.114
-rw-r--r--contrib/bind9/bin/dig/nslookup.docbook9
-rw-r--r--contrib/bind9/bin/dig/nslookup.html24
6 files changed, 78 insertions, 56 deletions
diff --git a/contrib/bind9/bin/dig/dig.c b/contrib/bind9/bin/dig/dig.c
index f740a1d..7de934b 100644
--- a/contrib/bind9/bin/dig/dig.c
+++ b/contrib/bind9/bin/dig/dig.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dig.c,v 1.225.26.4 2009/05/06 10:18:33 fdupont Exp $ */
+/* $Id: dig.c,v 1.225.26.7 2010-05-13 00:43:37 marka Exp $ */
/*! \file */
@@ -306,6 +306,8 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
ADD_STRING(buf, " ");
}
result = dns_rdata_totext(rdata, NULL, buf);
+ if (result == ISC_R_NOSPACE)
+ return (result);
check_result(result, "dns_rdata_totext");
if (query->lookup->identify) {
TIME_NOW(&now);
@@ -328,10 +330,8 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags,
{
dns_name_t *name;
dns_rdataset_t *rdataset;
- isc_buffer_t target;
isc_result_t result, loopresult;
dns_name_t empty_name;
- char t[4096];
dns_rdata_t rdata = DNS_RDATA_INIT;
UNUSED(flags);
@@ -347,8 +347,6 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags,
name = NULL;
dns_message_currentname(msg, DNS_SECTION_ANSWER, &name);
- isc_buffer_init(&target, t, sizeof(t));
-
for (rdataset = ISC_LIST_HEAD(name->list);
rdataset != NULL;
rdataset = ISC_LIST_NEXT(rdataset, link)) {
@@ -357,6 +355,8 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags,
dns_rdataset_current(rdataset, &rdata);
result = say_message(&rdata, query,
buf);
+ if (result == ISC_R_NOSPACE)
+ return (result);
check_result(result, "say_message");
loopresult = dns_rdataset_next(rdataset);
dns_rdata_reset(&rdata);
@@ -505,6 +505,8 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
printf(" ad");
if ((msg->flags & DNS_MESSAGEFLAG_CD) != 0)
printf(" cd");
+ if ((msg->flags & 0x0040U) != 0)
+ printf("; MBZ: 0x4");
printf("; QUERY: %u, ANSWER: %u, "
"AUTHORITY: %u, ADDITIONAL: %u\n",
diff --git a/contrib/bind9/bin/dig/dighost.c b/contrib/bind9/bin/dig/dighost.c
index d730c0e..df5a0c0 100644
--- a/contrib/bind9/bin/dig/dighost.c
+++ b/contrib/bind9/bin/dig/dighost.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dighost.c,v 1.311.70.11 2009/11/10 17:27:13 each Exp $ */
+/* $Id: dighost.c,v 1.311.70.17 2010-12-09 01:12:54 marka Exp $ */
/*! \file
* \note
@@ -246,7 +246,7 @@ isc_result_t opentmpkey(isc_mem_t *mctx, const char *file,
char **tempp, FILE **fp);
isc_result_t removetmpkey(isc_mem_t *mctx, const char *file);
void clean_trustedkey(void);
-void insert_trustedkey(dst_key_t * key);
+void insert_trustedkey(dst_key_t **key);
#if DIG_SIGCHASE_BU
isc_result_t getneededrr(dns_message_t *msg);
void sigchase_bottom_up(dns_message_t *msg);
@@ -970,7 +970,6 @@ setup_file_key(void) {
keynametext, isc_result_totext(result));
goto failure;
}
- dstkey = NULL;
failure:
if (dstkey != NULL)
dst_key_free(&dstkey);
@@ -990,12 +989,21 @@ make_searchlist_entry(char *domain) {
}
static void
+clear_searchlist(void) {
+ dig_searchlist_t *search;
+ while ((search = ISC_LIST_HEAD(search_list)) != NULL) {
+ ISC_LIST_UNLINK(search_list, search, link);
+ isc_mem_free(mctx, search);
+ }
+}
+
+static void
create_search_list(lwres_conf_t *confdata) {
int i;
dig_searchlist_t *search;
debug("create_search_list()");
- ISC_LIST_INIT(search_list);
+ clear_searchlist();
for (i = 0; i < confdata->searchnxt; i++) {
search = make_searchlist_entry(confdata->search[i]);
@@ -1038,7 +1046,7 @@ setup_system(void) {
else { /* No search list. Use the domain name if any */
if (lwconf->domainname != NULL) {
domain = make_searchlist_entry(lwconf->domainname);
- ISC_LIST_INITANDAPPEND(search_list, domain, link);
+ ISC_LIST_APPEND(search_list, domain, link);
domain = NULL;
}
}
@@ -1093,15 +1101,6 @@ setup_system(void) {
}
-static void
-clear_searchlist(void) {
- dig_searchlist_t *search;
- while ((search = ISC_LIST_HEAD(search_list)) != NULL) {
- ISC_LIST_UNLINK(search_list, search, link);
- isc_mem_free(mctx, search);
- }
-}
-
/*%
* Override the search list derived from resolv.conf by 'domain'.
*/
@@ -1201,14 +1200,15 @@ add_opt(dns_message_t *msg, isc_uint16_t udpsize, isc_uint16_t edns,
if (dnssec)
rdatalist->ttl |= DNS_MESSAGEEXTFLAG_DO;
if (nsid) {
- unsigned char data[4];
- isc_buffer_t buf;
-
- isc_buffer_init(&buf, data, sizeof(data));
- isc_buffer_putuint16(&buf, DNS_OPT_NSID);
- isc_buffer_putuint16(&buf, 0);
- rdata->data = data;
- rdata->length = sizeof(data);
+ isc_buffer_t *b = NULL;
+
+ result = isc_buffer_allocate(mctx, &b, 4);
+ check_result(result, "isc_buffer_allocate");
+ isc_buffer_putuint16(b, DNS_OPT_NSID);
+ isc_buffer_putuint16(b, 0);
+ rdata->data = isc_buffer_base(b);
+ rdata->length = isc_buffer_usedlength(b);
+ dns_message_takebuffer(msg, &b);
} else {
rdata->data = NULL;
rdata->length = 0;
@@ -2218,6 +2218,15 @@ force_timeout(dig_lookup_t *l, dig_query_t *query) {
isc_result_totext(ISC_R_NOMEMORY));
}
isc_task_send(global_task, &event);
+
+ /*
+ * The timer may have expired if, for example, get_address() takes
+ * long time and the timer was running on a different thread.
+ * We need to cancel the possible timeout event not to confuse
+ * ourselves due to the duplicate events.
+ */
+ if (l->timer != NULL)
+ isc_timer_detach(&l->timer);
}
@@ -2241,7 +2250,7 @@ send_tcp_connect(dig_query_t *query) {
query->waiting_connect = ISC_TRUE;
query->lookup->current_query = query;
result = get_address(query->servname, port, &query->sockaddr);
- if (result == ISC_R_NOTFOUND) {
+ if (result != ISC_R_SUCCESS) {
/*
* This servname doesn't have an address. Try the next server
* by triggering an immediate 'timeout' (we lie, but the effect
@@ -2323,7 +2332,7 @@ send_udp(dig_query_t *query) {
/* XXX Check the sense of this, need assertion? */
query->waiting_connect = ISC_FALSE;
result = get_address(query->servname, port, &query->sockaddr);
- if (result == ISC_R_NOTFOUND) {
+ if (result != ISC_R_SUCCESS) {
/* This servname doesn't have an address. */
force_timeout(l, query);
return;
@@ -3858,14 +3867,15 @@ sigchase_scanname(dns_rdatatype_t type, dns_rdatatype_t covers,
}
void
-insert_trustedkey(dst_key_t * key)
+insert_trustedkey(dst_key_t **keyp)
{
- if (key == NULL)
+ if (*keyp == NULL)
return;
if (tk_list.nb_tk >= MAX_TRUSTED_KEY)
return;
- tk_list.key[tk_list.nb_tk++] = key;
+ tk_list.key[tk_list.nb_tk++] = *keyp;
+ *keyp = NULL;
return;
}
@@ -4039,11 +4049,12 @@ get_trusted_key(isc_mem_t *mctx)
fclose(fp);
return (ISC_R_FAILURE);
}
- insert_trustedkey(key);
#if 0
dst_key_tofile(key, DST_TYPE_PUBLIC,"/tmp");
#endif
- key = NULL;
+ insert_trustedkey(&key);
+ if (key != NULL)
+ dst_key_free(&key);
}
return (ISC_R_SUCCESS);
}
diff --git a/contrib/bind9/bin/dig/host.c b/contrib/bind9/bin/dig/host.c
index 1a7d174..ab0be99 100644
--- a/contrib/bind9/bin/dig/host.c
+++ b/contrib/bind9/bin/dig/host.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: host.c,v 1.116.216.3.10.2 2010/10/19 23:46:25 tbox Exp $ */
+/* $Id: host.c,v 1.116.216.5 2010-10-19 23:45:58 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/dig/nslookup.1 b/contrib/bind9/bin/dig/nslookup.1
index 68b419a..a8331f9 100644
--- a/contrib/bind9/bin/dig/nslookup.1
+++ b/contrib/bind9/bin/dig/nslookup.1
@@ -1,4 +1,4 @@
-.\" Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+.\" Copyright (C) 2004-2007, 2010 Internet Systems Consortium, Inc. ("ISC")
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
@@ -12,7 +12,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: nslookup.1,v 1.14.354.1 2009/07/11 01:55:20 tbox Exp $
+.\" $Id: nslookup.1,v 1.14.354.2 2010-02-23 01:56:02 tbox Exp $
.\"
.hy 0
.ad l
@@ -54,7 +54,13 @@ when the first argument is a hyphen (\-) and the second argument is the host nam
Non\-interactive mode is used when the name or Internet address of the host to be looked up is given as the first argument. The optional second argument specifies the host name or address of a name server.
.PP
Options can also be specified on the command line if they precede the arguments and are prefixed with a hyphen. For example, to change the default query type to host information, and the initial timeout to 10 seconds, type:
-.sp .RS 4 .nf nslookup \-query=hinfo \-timeout=10 .fi .RE
+.sp
+.RS 4
+.nf
+nslookup \-query=hinfo \-timeout=10
+.fi
+.RE
+.sp
.SH "INTERACTIVE COMMANDS"
.PP
\fBhost\fR [server]
@@ -248,5 +254,5 @@ Try the next nameserver if a nameserver responds with SERVFAIL or a referral (no
.PP
Andrew Cherenson
.SH "COPYRIGHT"
-Copyright \(co 2004\-2007 Internet Systems Consortium, Inc. ("ISC")
+Copyright \(co 2004\-2007, 2010 Internet Systems Consortium, Inc. ("ISC")
.br
diff --git a/contrib/bind9/bin/dig/nslookup.docbook b/contrib/bind9/bin/dig/nslookup.docbook
index 6c94809..fb6e706 100644
--- a/contrib/bind9/bin/dig/nslookup.docbook
+++ b/contrib/bind9/bin/dig/nslookup.docbook
@@ -2,7 +2,7 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[<!ENTITY mdash "&#8212;">]>
<!--
- - Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2004-2007, 2010 Internet Systems Consortium, Inc. ("ISC")
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
@@ -17,7 +17,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: nslookup.docbook,v 1.16 2007/06/18 23:47:17 tbox Exp $ -->
+<!-- $Id: nslookup.docbook,v 1.16.334.2 2010-02-22 23:47:53 tbox Exp $ -->
<!--
- Copyright (c) 1985, 1989
- The Regents of the University of California. All rights reserved.
@@ -73,6 +73,7 @@
<year>2005</year>
<year>2006</year>
<year>2007</year>
+ <year>2010</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
@@ -129,11 +130,11 @@
arguments and are prefixed with a hyphen. For example, to
change the default query type to host information, and the initial
timeout to 10 seconds, type:
- <informalexample>
+ <!-- <informalexample> produces bad nroff. -->
<programlisting>
nslookup -query=hinfo -timeout=10
</programlisting>
- </informalexample>
+ <!-- </informalexample> -->
</para>
</refsect1>
diff --git a/contrib/bind9/bin/dig/nslookup.html b/contrib/bind9/bin/dig/nslookup.html
index 3984a16..bff3528 100644
--- a/contrib/bind9/bin/dig/nslookup.html
+++ b/contrib/bind9/bin/dig/nslookup.html
@@ -1,5 +1,5 @@
<!--
- - Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ - Copyright (C) 2004-2007, 2010 Internet Systems Consortium, Inc. ("ISC")
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
@@ -13,7 +13,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: nslookup.html,v 1.21.354.1 2009/07/11 01:55:20 tbox Exp $ -->
+<!-- $Id: nslookup.html,v 1.21.354.2 2010-02-23 01:56:02 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
@@ -31,7 +31,7 @@
<div class="cmdsynopsis"><p><code class="command">nslookup</code> [<code class="option">-option</code>] [name | -] [server]</p></div>
</div>
<div class="refsect1" lang="en">
-<a name="id2543355"></a><h2>DESCRIPTION</h2>
+<a name="id2543358"></a><h2>DESCRIPTION</h2>
<p><span><strong class="command">Nslookup</strong></span>
is a program to query Internet domain name servers. <span><strong class="command">Nslookup</strong></span>
has two modes: interactive and non-interactive. Interactive mode allows
@@ -43,7 +43,7 @@
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2543371"></a><h2>ARGUMENTS</h2>
+<a name="id2543374"></a><h2>ARGUMENTS</h2>
<p>
Interactive mode is entered in the following cases:
</p>
@@ -68,15 +68,17 @@
arguments and are prefixed with a hyphen. For example, to
change the default query type to host information, and the initial
timeout to 10 seconds, type:
- </p>
-<div class="informalexample"><pre class="programlisting">
+
+ </p>
+<pre class="programlisting">
nslookup -query=hinfo -timeout=10
-</pre></div>
+</pre>
<p>
+
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2543413"></a><h2>INTERACTIVE COMMANDS</h2>
+<a name="id2543418"></a><h2>INTERACTIVE COMMANDS</h2>
<div class="variablelist"><dl>
<dt><span class="term"><code class="constant">host</code> [<span class="optional">server</span>]</span></dt>
<dd>
@@ -286,19 +288,19 @@ nslookup -query=hinfo -timeout=10
</dl></div>
</div>
<div class="refsect1" lang="en">
-<a name="id2546279"></a><h2>FILES</h2>
+<a name="id2546284"></a><h2>FILES</h2>
<p><code class="filename">/etc/resolv.conf</code>
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2546291"></a><h2>SEE ALSO</h2>
+<a name="id2546296"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">dig</span>(1)</span>,
<span class="citerefentry"><span class="refentrytitle">host</span>(1)</span>,
<span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>.
</p>
</div>
<div class="refsect1" lang="en">
-<a name="id2546325"></a><h2>Author</h2>
+<a name="id2546330"></a><h2>Author</h2>
<p>
Andrew Cherenson
</p>
OpenPOWER on IntegriCloud