1191. [bug] A dynamic update removing the last non-apex name in

a secure zone would fail. [RT #2399]
This commit is contained in:
Andreas Gustafsson 2002-01-22 22:26:45 +00:00
parent 0b809e3e23
commit 48b0f5ff87
2 changed files with 11 additions and 7 deletions

View file

@ -1,3 +1,6 @@
1191. [bug] A dynamic update removing the last non-apex name in
a secure zone would fail. [RT #2399]
1190. [func] Add the "rndc freeze" and "rndc unfreeze" commands.
[RT #2394]

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: update.c,v 1.96 2002/01/22 22:05:49 bwelling Exp $ */
/* $Id: update.c,v 1.97 2002/01/22 22:26:45 gson Exp $ */
#include <config.h>
@ -1437,6 +1437,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)
@ -1452,7 +1453,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.
*/
@ -1467,7 +1467,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 */
@ -1819,9 +1824,6 @@ update_signatures(isc_mem_t *mctx, dns_zone_t *zone, dns_db_t *db,
* 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));
}
}
@ -2497,7 +2499,6 @@ update_action(isc_task_t *task, isc_event_t *event) {
}
if (dns_db_issecure(db)) {
result = update_signatures(mctx, zone, db, oldver, ver,
&diff, dns_zone_getsigvalidityinterval(zone));
if (result != ISC_R_SUCCESS) {