diff --git a/CHANGES b/CHANGES index ded22c39ac..55e02e6720 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ + 386. [bug] Missing strdup() of ACL name caused random + ACL matching failures. + 385. [cleanup] Removed function dns_zone_equal(). 384. [bug] nsupdate was incorrectly limiting TTLs to 65535 instead diff --git a/bin/named/aclconf.c b/bin/named/aclconf.c index b00826a7ea..0dfe8d7fe2 100644 --- a/bin/named/aclconf.c +++ b/bin/named/aclconf.c @@ -15,10 +15,11 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: aclconf.c,v 1.20 2000/08/01 01:22:08 tale Exp $ */ +/* $Id: aclconf.c,v 1.21 2000/08/11 01:53:47 gson Exp $ */ #include +#include #include /* Required for HP/UX (and others?) */ #include @@ -75,7 +76,7 @@ convert_named_acl(char *aclname, dns_c_ctx_t *cctx, result = dns_acl_fromconfig(cacl->ipml, cctx, ctx, mctx, &dacl); if (result != ISC_R_SUCCESS) return (result); - dacl->name = aclname; + dacl->name = isc_mem_strdup(dacl->mctx, aclname); ISC_LIST_APPEND(ctx->named_acl_cache, dacl, nextincache); dns_acl_attach(dacl, target); return (ISC_R_SUCCESS); diff --git a/lib/dns/acl.c b/lib/dns/acl.c index 5215974a7f..c1b7afe6fa 100644 --- a/lib/dns/acl.c +++ b/lib/dns/acl.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: acl.c,v 1.13 2000/08/01 01:22:07 tale Exp $ */ +/* $Id: acl.c,v 1.14 2000/08/11 01:53:46 gson Exp $ */ #include @@ -242,6 +242,8 @@ destroy(dns_acl_t *dacl) { if (dacl->elements != NULL) isc_mem_put(dacl->mctx, dacl->elements, dacl->alloc * sizeof(dns_aclelement_t)); + if (dacl->name != NULL) + isc_mem_free(dacl->mctx, dacl->name); dacl->magic = 0; isc_mem_put(dacl->mctx, dacl, sizeof(*dacl)); } diff --git a/lib/dns/aclconf.c b/lib/dns/aclconf.c index b00826a7ea..0dfe8d7fe2 100644 --- a/lib/dns/aclconf.c +++ b/lib/dns/aclconf.c @@ -15,10 +15,11 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: aclconf.c,v 1.20 2000/08/01 01:22:08 tale Exp $ */ +/* $Id: aclconf.c,v 1.21 2000/08/11 01:53:47 gson Exp $ */ #include +#include #include /* Required for HP/UX (and others?) */ #include @@ -75,7 +76,7 @@ convert_named_acl(char *aclname, dns_c_ctx_t *cctx, result = dns_acl_fromconfig(cacl->ipml, cctx, ctx, mctx, &dacl); if (result != ISC_R_SUCCESS) return (result); - dacl->name = aclname; + dacl->name = isc_mem_strdup(dacl->mctx, aclname); ISC_LIST_APPEND(ctx->named_acl_cache, dacl, nextincache); dns_acl_attach(dacl, target); return (ISC_R_SUCCESS);