From e02ccd485ed83e4ea2164a35ad893f5820fd6305 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 30 Dec 2009 04:02:56 +0000 Subject: [PATCH] 2825. [bug] Changing the setting of OPTOUT in a NSEC3 chain that was in the process of being created was not properly recorded in the zone. [RT #20786] --- CHANGES | 4 ++++ bin/named/update.c | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index bc32e93b21..d7b50ed5cd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +2825. [bug] Changing the setting of OPTOUT in a NSEC3 chain that + was in the process of being created was not properly + recorded in the zone. [RT #20786] + 2823. [bug] rbtdb.c:getsigningtime() was missing locks. [RT #20781] 2819. [cleanup] Removed unnecessary DNS_POINTER_MAXHOPS define diff --git a/bin/named/update.c b/bin/named/update.c index 6d7455cd78..74a192ad07 100644 --- a/bin/named/update.c +++ b/bin/named/update.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: update.c,v 1.151.12.8 2009/11/06 08:38:21 each Exp $ */ +/* $Id: update.c,v 1.151.12.9 2009/12/30 04:02:56 marka Exp $ */ #include @@ -3157,6 +3157,24 @@ add_nsec3param_records(ns_client_t *client, dns_zone_t *zone, dns_db_t *db, &newtuple)); CHECK(do_one_tuple(&newtuple, db, ver, diff)); } + + /* + * Remove any existing CREATE request to add an + * otherwise indentical chain with a reversed + * OPTOUT state. + */ + buf[1] ^= DNS_NSEC3FLAG_OPTOUT; + CHECK(rr_exists(db, ver, name, &rdata, &flag)); + + if (flag) { + CHECK(dns_difftuple_create(diff->mctx, + DNS_DIFFOP_DEL, + name, tuple->ttl, + &rdata, + &newtuple)); + CHECK(do_one_tuple(&newtuple, db, ver, diff)); + } + /* * Remove the temporary add record. */