From: Andreas Gustafsson Date: Tue, 17 Oct 2000 18:48:09 +0000 (+0000) Subject: pullup: X-Git-Tag: v9.0.0^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69c1d2db5f9429cca6c5cf313f2c87a9bfd260fc;p=thirdparty%2Fbind9.git pullup: 515. [bug] The ssu table was not beinge attached / detached by dns_zone_[sg]etssutable. [RT#397] --- diff --git a/CHANGES b/CHANGES index e1e48fd2c60..46c06d70298 100644 --- a/CHANGES +++ b/CHANGES @@ -18,6 +18,9 @@ DNAME, would trigger an INSIST(!search.need_cleanup) assertion. [RT #399] + 515. [bug] The ssu table was not being attached / detached + by dns_zone_[sg]etssutable. [RT#397] + 511. [bug] The message code could throw an assertion on an out of memory failure. [RT #392] diff --git a/bin/named/update.c b/bin/named/update.c index fa3289da755..fe36e252c69 100644 --- a/bin/named/update.c +++ b/bin/named/update.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: update.c,v 1.58 2000/06/22 21:49:37 tale Exp $ */ +/* $Id: update.c,v 1.58.2.1 2000/10/17 18:48:09 gson Exp $ */ #include @@ -2347,6 +2347,9 @@ update_action(isc_task_t *task, isc_event_t *event) { if (db != NULL) dns_db_detach(&db); + if (ssutable != NULL) + dns_ssutable_detach(&ssutable); + if (zone != NULL) dns_zone_detach(&zone); diff --git a/lib/dns/zone.c b/lib/dns/zone.c index a3bd6c522e4..552d4749eec 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: zone.c,v 1.152.2.13 2000/09/21 10:10:05 marka Exp $ */ +/* $Id: zone.c,v 1.152.2.14 2000/10/17 18:48:05 gson Exp $ */ #include @@ -3829,14 +3829,23 @@ dns_zone_getssutable(dns_zone_t *zone, dns_ssutable_t **table) { REQUIRE(DNS_ZONE_VALID(zone)); REQUIRE(table != NULL); REQUIRE(*table == NULL); - *table = zone->ssutable; + + LOCK(&zone->lock); + if (zone->ssutable != NULL) + dns_ssutable_attach(zone->ssutable, table); + UNLOCK(&zone->lock); } void dns_zone_setssutable(dns_zone_t *zone, dns_ssutable_t *table) { REQUIRE(DNS_ZONE_VALID(zone)); - REQUIRE(table != NULL); - zone->ssutable = table; + + LOCK(&zone->lock); + if (zone->ssutable != NULL) + dns_ssutable_detach(&zone->ssutable); + if (table != NULL) + dns_ssutable_attach(table, &zone->ssutable); + UNLOCK(&zone->lock); } void diff --git a/lib/dns/zoneconf.c b/lib/dns/zoneconf.c index b3bbcc580bf..55699cf9f5c 100644 --- a/lib/dns/zoneconf.c +++ b/lib/dns/zoneconf.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: zoneconf.c,v 1.43.2.1 2000/07/25 22:47:35 gson Exp $ */ +/* $Id: zoneconf.c,v 1.43.2.2 2000/10/17 18:48:07 gson Exp $ */ #include @@ -240,15 +240,9 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview, dns_zone_setupdateacl, dns_zone_clearupdateacl)); - dns_zone_getssutable(zone, &ssutable); - if (ssutable != NULL) - dns_ssutable_detach(&ssutable); result = dns_c_zone_getssuauth(czone, &ssutable); - if (result == ISC_R_SUCCESS) { - dns_ssutable_t *newssutable = NULL; - dns_ssutable_attach(ssutable, &newssutable); - dns_zone_setssutable(zone, newssutable); - } + if (result == ISC_R_SUCCESS) + dns_zone_setssutable(zone, ssutable); result = dns_c_zone_getsigvalidityinterval(czone, &uintval); if (result != ISC_R_SUCCESS && cview != NULL)