From 342286ecdb864348eb52b2687927d9fcfff66967 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 8 Feb 2023 19:28:09 -0800 Subject: [PATCH] remove isc_bind9 variable isc_bind9 was a global bool used to indicate whether the library was being used internally by BIND or by an external caller. external use is no longer supported, but the variable was retained for use by dyndb, which needed it only when being built without libtool. building without libtool is *also* no longer supported, so the variable can go away. (cherry picked from commit 935879ed1139d8fd07d0009ab606e43c2a7cbc68) --- bin/tests/system/dyndb/driver/driver.c | 11 ----------- lib/dns/dyndb.c | 10 +++++----- lib/dns/include/dns/dyndb.h | 2 +- lib/isc/Makefile.am | 2 -- lib/isc/bind9.c | 20 -------------------- lib/isc/include/isc/bind9.h | 18 ------------------ lib/isc/include/isc/types.h | 1 - lib/isc/lib.c | 1 - lib/isc/mem.c | 1 - 9 files changed, 6 insertions(+), 60 deletions(-) delete mode 100644 lib/isc/bind9.c delete mode 100644 lib/isc/include/isc/bind9.h diff --git a/bin/tests/system/dyndb/driver/driver.c b/bin/tests/system/dyndb/driver/driver.c index f4497c9d65..7e8a249d3a 100644 --- a/bin/tests/system/dyndb/driver/driver.c +++ b/bin/tests/system/dyndb/driver/driver.c @@ -95,17 +95,6 @@ dyndb_init(isc_mem_t *mctx, const char *name, const char *parameters, REQUIRE(name != NULL); REQUIRE(dctx != NULL); - /* - * Depending on how dlopen() was called, we may not have - * access to named's global namespace, in which case we need - * to initialize libisc/libdns - */ - if (dctx->refvar != &isc_bind9) { - isc_log_setcontext(dctx->lctx); - dns_log_setcontext(dctx->lctx); - isc_hash_set_initializer(dctx->hashinit); - } - s = isc_mem_strdup(mctx, parameters); result = isc_commandline_strtoargv(mctx, s, &argc, &argv, 0); diff --git a/lib/dns/dyndb.c b/lib/dns/dyndb.c index 682e0b2eb3..6e3c7c3b76 100644 --- a/lib/dns/dyndb.c +++ b/lib/dns/dyndb.c @@ -274,8 +274,12 @@ dns_dyndb_createctx(isc_mem_t *mctx, const void *hashinit, isc_log_t *lctx, REQUIRE(dctxp != NULL && *dctxp == NULL); dctx = isc_mem_get(mctx, sizeof(*dctx)); + *dctx = (dns_dyndbctx_t){ + .timermgr = tmgr, + .hashinit = hashinit, + .lctx = lctx, + }; - memset(dctx, 0, sizeof(*dctx)); if (view != NULL) { dns_view_attach(view, &dctx->view); } @@ -285,10 +289,6 @@ dns_dyndb_createctx(isc_mem_t *mctx, const void *hashinit, isc_log_t *lctx, if (task != NULL) { isc_task_attach(task, &dctx->task); } - dctx->timermgr = tmgr; - dctx->hashinit = hashinit; - dctx->lctx = lctx; - dctx->refvar = &isc_bind9; isc_mem_attach(mctx, &dctx->mctx); dctx->magic = DNS_DYNDBCTX_MAGIC; diff --git a/lib/dns/include/dns/dyndb.h b/lib/dns/include/dns/dyndb.h index a219cb9158..3cb32c2180 100644 --- a/lib/dns/include/dns/dyndb.h +++ b/lib/dns/include/dns/dyndb.h @@ -41,7 +41,7 @@ struct dns_dyndbctx { dns_zonemgr_t *zmgr; isc_task_t *task; isc_timermgr_t *timermgr; - const bool *refvar; + const bool *refvar; /* unused, but retained for API compatibility */ }; #define DNS_DYNDBCTX_MAGIC ISC_MAGIC('D', 'd', 'b', 'c') diff --git a/lib/isc/Makefile.am b/lib/isc/Makefile.am index 74a43098f6..fc0ac5ff1e 100644 --- a/lib/isc/Makefile.am +++ b/lib/isc/Makefile.am @@ -15,7 +15,6 @@ libisc_la_HEADERS = \ include/isc/barrier.h \ include/isc/base32.h \ include/isc/base64.h \ - include/isc/bind9.h \ include/isc/buffer.h \ include/isc/cmocka.h \ include/isc/commandline.h \ @@ -120,7 +119,6 @@ libisc_la_SOURCES = \ backtrace.c \ base32.c \ base64.c \ - bind9.c \ buffer.c \ commandline.c \ condition.c \ diff --git a/lib/isc/bind9.c b/lib/isc/bind9.c deleted file mode 100644 index b04e56e352..0000000000 --- a/lib/isc/bind9.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * SPDX-License-Identifier: MPL-2.0 - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * See the COPYRIGHT file distributed with this work for additional - * information regarding copyright ownership. - */ - -/*! \file */ - -#include - -#include - -bool isc_bind9 = true; diff --git a/lib/isc/include/isc/bind9.h b/lib/isc/include/isc/bind9.h deleted file mode 100644 index 38c568e759..0000000000 --- a/lib/isc/include/isc/bind9.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (C) Internet Systems Consortium, Inc. ("ISC") - * - * SPDX-License-Identifier: MPL-2.0 - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * See the COPYRIGHT file distributed with this work for additional - * information regarding copyright ownership. - */ - -#pragma once - -#include - -extern bool isc_bind9; diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h index 185ff1c40a..346642a0c1 100644 --- a/lib/isc/include/isc/types.h +++ b/lib/isc/include/isc/types.h @@ -13,7 +13,6 @@ #pragma once -#include #include /*! \file isc/types.h diff --git a/lib/isc/lib.c b/lib/isc/lib.c index 7f6b12c4aa..343fedf108 100644 --- a/lib/isc/lib.c +++ b/lib/isc/lib.c @@ -13,7 +13,6 @@ /*! \file */ -#include #include #include #include diff --git a/lib/isc/mem.c b/lib/isc/mem.c index df75f6eab6..d9018f6dbe 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -22,7 +22,6 @@ #include #include -#include #include #include #include