Commit f27eae9c authored by Mark Andrews's avatar Mark Andrews

1996. [bug] nsupdate: if a zone has been specified it should

                        appear in the output of 'show'. [RT #15797]
parent 9a8cec49
1996. [bug] nsupdate: if a zone has been specified it should
appear in the output of 'show'. [RT #15797]
1995. [bug] 'host' was reporting multiple "is an alias" messages.
[RT #15702]
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: nsupdate.c,v 1.142 2006/01/27 02:35:14 marka Exp $ */
/* $Id: nsupdate.c,v 1.143 2006/03/02 01:57:20 marka Exp $ */
/*! \file */
......@@ -1421,6 +1421,41 @@ evaluate_update(char *cmdline) {
return (update_addordelete(cmdline, isdelete));
}
static void
setzone(dns_name_t *zonename) {
isc_result_t result;
dns_name_t *name = NULL;
dns_rdataset_t *rdataset = NULL;
result = dns_message_firstname(updatemsg, DNS_SECTION_ZONE);
if (result == ISC_R_SUCCESS) {
dns_message_currentname(updatemsg, DNS_SECTION_ZONE, &name);
dns_message_removename(updatemsg, name, DNS_SECTION_ZONE);
for (rdataset = ISC_LIST_HEAD(name->list);
rdataset != NULL;
rdataset = ISC_LIST_HEAD(name->list)) {
ISC_LIST_UNLINK(name->list, rdataset, link);
dns_rdataset_disassociate(rdataset);
dns_message_puttemprdataset(updatemsg, &rdataset);
}
dns_message_puttempname(updatemsg, &name);
}
if (zonename != NULL) {
result = dns_message_gettempname(updatemsg, &name);
check_result(result, "dns_message_gettempname");
dns_name_init(name, NULL);
dns_name_clone(zonename, name);
result = dns_message_gettemprdataset(updatemsg, &rdataset);
check_result(result, "dns_message_gettemprdataset");
dns_rdataset_makequestion(rdataset, getzoneclass(),
dns_rdatatype_soa);
ISC_LIST_INIT(name->list);
ISC_LIST_APPEND(name->list, rdataset, link);
dns_message_addname(updatemsg, name, DNS_SECTION_ZONE);
}
}
static void
show_message(dns_message_t *msg) {
isc_result_t result;
......@@ -1428,6 +1463,9 @@ show_message(dns_message_t *msg) {
int bufsz;
ddebug("show_message()");
setzone(userzone);
bufsz = INITTEXT;
do {
if (bufsz > MAXTEXT) {
......@@ -1653,22 +1691,11 @@ send_update(dns_name_t *zonename, isc_sockaddr_t *master,
{
isc_result_t result;
dns_request_t *request = NULL;
dns_name_t *name = NULL;
dns_rdataset_t *rdataset = NULL;
unsigned int options = 0;
ddebug("send_update()");
result = dns_message_gettempname(updatemsg, &name);
check_result(result, "dns_message_gettempname");
dns_name_init(name, NULL);
dns_name_clone(zonename, name);
result = dns_message_gettemprdataset(updatemsg, &rdataset);
check_result(result, "dns_message_gettemprdataset");
dns_rdataset_makequestion(rdataset, getzoneclass(), dns_rdatatype_soa);
ISC_LIST_INIT(name->list);
ISC_LIST_APPEND(name->list, rdataset, link);
dns_message_addname(updatemsg, name, DNS_SECTION_ZONE);
setzone(zonename);
if (usevc)
options |= DNS_REQUESTOPT_TCP;
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.h,v 1.119 2006/02/28 02:39:51 marka Exp $ */
/* $Id: message.h,v 1.120 2006/03/02 01:57:20 marka Exp $ */
#ifndef DNS_MESSAGE_H
#define DNS_MESSAGE_H 1
......@@ -769,6 +769,25 @@ dns_message_addname(dns_message_t *msg, dns_name_t *name,
*\li 'section' be a named section.
*/
void
dns_message_removename(dns_message_t *msg, dns_name_t *name,
dns_section_t section);
/*%<
* Remove a existing name from a given section.
*
* It is the caller's responsibility to ensure the name is part of the
* given section.
*
* Requires:
*
*\li 'msg' be valid, and be a renderable message.
*
*\li 'name' be a valid absolute name.
*
*\li 'section' be a named section.
*/
/*
* LOANOUT FUNCTIONS
*
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.c,v 1.231 2006/02/28 02:39:51 marka Exp $ */
/* $Id: message.c,v 1.232 2006/03/02 01:57:20 marka Exp $ */
/*! \file */
......@@ -2284,6 +2284,18 @@ dns_message_addname(dns_message_t *msg, dns_name_t *name,
ISC_LIST_APPEND(msg->sections[section], name, link);
}
void
dns_message_removename(dns_message_t *msg, dns_name_t *name,
dns_section_t section)
{
REQUIRE(msg != NULL);
REQUIRE(msg->from_to_wire == DNS_MESSAGE_INTENTRENDER);
REQUIRE(name != NULL);
REQUIRE(VALID_NAMED_SECTION(section));
ISC_LIST_UNLINK(msg->sections[section], name, link);
}
isc_result_t
dns_message_gettempname(dns_message_t *msg, dns_name_t **item) {
REQUIRE(DNS_MESSAGE_VALID(msg));
......
......@@ -276,6 +276,7 @@ dns_message_puttemprdata
dns_message_puttemprdatalist
dns_message_puttemprdataset
dns_message_rechecksig
dns_message_removename
dns_message_renderbegin
dns_message_renderchangebuffer
dns_message_renderend
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment