]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorBrian Wellington <source@isc.org>
Wed, 23 Jan 2002 08:17:55 +0000 (08:17 +0000)
committerBrian Wellington <source@isc.org>
Wed, 23 Jan 2002 08:17:55 +0000 (08:17 +0000)
1191.   [bug]           A dynamic update removing the last non-apex name in
                        a secure zone would fail. [RT #2399]

CHANGES
bin/named/update.c

diff --git a/CHANGES b/CHANGES
index 00d233beb53b623433f6931279a4da16371a9e85..61d22bcca68b1cd369c83689819f80efb5bffea2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+1191.   [bug]           A dynamic update removing the last non-apex name in
+                       a secure zone would fail. [RT #2399]
+
 1189.  [bug]           On some systems, malloc(0) returns NULL, which
                        could cause the caller to report an out of memory
                        error. [RT #2398]
index f2c9c54501fff743aaa952a612842237fd390b44..bf4f9af7814ee51e8196c73e71a5f20675cf22ee 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: update.c,v 1.88.2.1 2002/01/23 03:02:28 marka Exp $ */
+/* $Id: update.c,v 1.88.2.2 2002/01/23 08:17:55 bwelling Exp $ */
 
 #include <config.h>
 
@@ -1417,6 +1417,7 @@ next_active(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *oldname,
 
 /*
  * Add a NXT record for "name", recording the change in "diff".
+ * The existing NXT is removed.
  */
 static isc_result_t
 add_nxt(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, dns_diff_t *diff)
@@ -1432,7 +1433,6 @@ add_nxt(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, dns_diff_t *diff)
        dns_fixedname_init(&fixedname);
        target = dns_fixedname_name(&fixedname);
 
-
        /*
         * Find the successor name, aka NXT target.
         */
@@ -1447,7 +1447,12 @@ add_nxt(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, dns_diff_t *diff)
        dns_db_detachnode(db, &node);
 
        /*
-        * Create a diff tuple, update the database, and record the change.
+        * Delete the old NXT and record the change.
+        */
+       CHECK(delete_if(true_p, db, ver, name, dns_rdatatype_nxt, 0,
+                       NULL, diff));
+       /*
+        * Add the new NXT and record the change.
         */
        CHECK(dns_difftuple_create(diff->mctx, DNS_DIFFOP_ADD, name,
                                   3600,        /* XXXRTH */
@@ -1798,9 +1803,6 @@ update_signatures(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *oldver,
                         * there is other data, and if there is other data,
                         * there are other SIGs.
                         */
-                       CHECK(delete_if(true_p, db, newver, &t->name,
-                                       dns_rdatatype_nxt, 0,
-                                       NULL, &nxt_diff));
                        CHECK(add_nxt(db, newver, &t->name, &nxt_diff));
                }
        }
@@ -2411,7 +2413,6 @@ update_action(isc_task_t *task, isc_event_t *event) {
                }
 
                if (dns_db_issecure(db)) {
-
                        result = update_signatures(mctx, db, oldver, ver,
                           &diff, dns_zone_getsigvalidityinterval(zone));
                        if (result != ISC_R_SUCCESS) {