29882e
From 9879850c5e5c19958949697db2da60ca7a3be7de Mon Sep 17 00:00:00 2001
29882e
From: Tomas Krizek <tkrizek@redhat.com>
29882e
Date: Tue, 14 Mar 2017 14:59:26 +0100
29882e
Subject: [PATCH] Skip isc_lib_register
29882e
29882e
---
29882e
 src/ldap_driver.c | 11 +++++++----
29882e
 1 file changed, 7 insertions(+), 4 deletions(-)
29882e
29882e
diff --git a/src/ldap_driver.c b/src/ldap_driver.c
29882e
index 4e842cb0f122c49080128a81892f9737d29a299e..9fc3b9a44fba9aec6a71a9ff66b2b96c3c4777cf 100644
29882e
--- a/src/ldap_driver.c
29882e
+++ b/src/ldap_driver.c
29882e
@@ -1143,14 +1143,17 @@ dyndb_init(isc_mem_t *mctx, const char *name, const char *parameters,
29882e
 	 * access to named's global namespace, in which case we need
29882e
 	 * to initialize libisc/libdns
29882e
 	 */
29882e
-	if (dctx->refvar != &isc_bind9) {
29882e
-		isc_lib_register();
29882e
+	if (dctx->refvar != &isc_lctx) {
29882e
+		void *old_lctx = &isc_lctx;
29882e
 		isc_log_setcontext(dctx->lctx);
29882e
 		dns_log_setcontext(dctx->lctx);
29882e
-		log_debug(5, "registering library from dynamic ldap driver, %p != %p.", dctx->refvar, &isc_bind9);
29882e
+		log_debug(5, "registering library from dynamic ldap driver, "
29882e
+			     "%p != %p.", dctx->refvar, old_lctx);
29882e
 	}
29882e
 
29882e
-	isc_hash_set_initializer(dctx->hashinit);
29882e
+	if (isc_hashctx != NULL && isc_hashctx != dctx->hctx)
29882e
+		isc_hash_ctxdetach(&isc_hashctx);
29882e
+	isc_hashctx = dctx->hctx;
29882e
 
29882e
 	log_debug(2, "registering dynamic ldap driver for %s.", name);
29882e
 
29882e
-- 
29882e
2.9.3
29882e