]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2862. [bug] nsupdate didn't default to the parent zone when
authorMark Andrews <marka@isc.org>
Tue, 9 Mar 2010 03:46:12 +0000 (03:46 +0000)
committerMark Andrews <marka@isc.org>
Tue, 9 Mar 2010 03:46:12 +0000 (03:46 +0000)
                        updating DS records. [RT #20896]

CHANGES
bin/nsupdate/nsupdate.c

diff --git a/CHANGES b/CHANGES
index a94336e433aeec5b1f7a37d73764f42eeb79ac77..e5ff99eab8c589ac4278d5f5c8915b77bd4e5cd0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2862.  [bug]           nsupdate didn't default to the parent zone when
+                       updating DS records. [RT #20896]
+
 2861.  [doc]           dnssec-settime man pages didn't correctly document the
                        inactivation time. [RT #21039]
 
index 542b62e42510819ff2aa084e7fca88276f2b73ff..3d3645d36f6d288911167f6441494ab063e3d0c6 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsupdate.c,v 1.175 2010/03/04 23:50:34 tbox Exp $ */
+/* $Id: nsupdate.c,v 1.176 2010/03/09 03:46:12 marka Exp $ */
 
 /*! \file */
 
@@ -2694,6 +2694,7 @@ start_update(void) {
                dns_name_init(name, NULL);
                dns_name_clone(userzone, name);
        } else {
+               dns_rdataset_t *rdataset;
                result = dns_message_firstname(updatemsg, section);
                if (result == ISC_R_NOMORE) {
                        section = DNS_SECTION_PREREQUISITE;
@@ -2711,6 +2712,19 @@ start_update(void) {
                dns_message_currentname(updatemsg, section, &firstname);
                dns_name_init(name, NULL);
                dns_name_clone(firstname, name);
+               /*
+                * Looks to see if the first name references a DS record
+                * and if that name is not the root remove a label as DS
+                * records live in the parent zone so we need to start our
+                * search one label up.
+                */
+               rdataset = ISC_LIST_HEAD(firstname->list);
+               if (section == DNS_SECTION_UPDATE &&
+                   !dns_name_equal(firstname, dns_rootname) &&
+                   rdataset->type == dns_rdatatype_ds) {
+                   unsigned int labels = dns_name_countlabels(name);
+                   dns_name_getlabelsequence(name, 1, labels - 1, name);
+               }
        }
 
        ISC_LIST_INIT(name->list);