From f94ec08c17d60ee519a4f46b6dbb3519989e5b9c Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 16 Aug 2010 05:32:44 +0000 Subject: [PATCH] 2942. [contrib] zone2sqlite failed to setup the entropy sources. [RT #21610] --- CHANGES | 3 +++ contrib/sdb/sqlite/zone2sqlite.c | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 268798629c..2d7fbb2679 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2942. [contrib] zone2sqlite failed to setup the entropy sources. + [RT #21610] + 2941. [bug] sdb and sdlz (dlz's zone database) failed to support DNAME at the zone apex. [RT #21610] diff --git a/contrib/sdb/sqlite/zone2sqlite.c b/contrib/sdb/sqlite/zone2sqlite.c index 2ba63cc58a..b583d2bb03 100644 --- a/contrib/sdb/sqlite/zone2sqlite.c +++ b/contrib/sdb/sqlite/zone2sqlite.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone2sqlite.c,v 1.3 2009/09/01 00:22:26 jinmei Exp $ */ +/* $Id: zone2sqlite.c,v 1.4 2010/08/16 05:32:44 marka Exp $ */ #include #include @@ -27,7 +27,9 @@ #include #include +#include #include +#include #include #include #include @@ -157,6 +159,7 @@ main(int argc, char *argv[]) dns_rdataset_t rdataset; dns_rdata_t rdata = DNS_RDATA_INIT; isc_mem_t *mctx = NULL; + isc_entropy_t *ectx = NULL; isc_buffer_t b; isc_result_t result; @@ -173,9 +176,12 @@ main(int argc, char *argv[]) dns_result_register(); - mctx = NULL; result = isc_mem_create(0, 0, &mctx); check_result(result, "isc_mem_create"); + result = isc_entropy_create(mctx, &ectx); + check_result(result, "isc_entropy_create"); + result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); + check_result(result, "isc_hash_create"); isc_buffer_init(&b, porigin, strlen(porigin)); isc_buffer_add(&b, strlen(porigin)); @@ -293,6 +299,8 @@ main(int argc, char *argv[]) dns_dbiterator_destroy(&dbiter); dns_db_detach(&db); + isc_hash_destroy(); + isc_entropy_detach(&ectx); isc_mem_destroy(&mctx); closeandexit(0);