mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
Eliminated the global variable ns_g_confctx. The config
data is now kept around only for the duration of the server (re)configuration process and then immediately freed.
This commit is contained in:
@@ -75,7 +75,6 @@ EXTERN unsigned int ns_g_debuglevel INIT(0);
|
|||||||
/*
|
/*
|
||||||
* Current config information
|
* Current config information
|
||||||
*/
|
*/
|
||||||
EXTERN dns_c_ctx_t * ns_g_confctx INIT(NULL);
|
|
||||||
EXTERN const char * ns_g_conffile INIT("/etc/named.conf");
|
EXTERN const char * ns_g_conffile INIT("/etc/named.conf");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -522,9 +522,6 @@ load_configuration(const char *filename, ns_server_t *server) {
|
|||||||
oviewlist = ns_g_viewlist;
|
oviewlist = ns_g_viewlist;
|
||||||
ns_g_viewlist = lctx.viewlist;
|
ns_g_viewlist = lctx.viewlist;
|
||||||
|
|
||||||
oconfigctx = ns_g_confctx;
|
|
||||||
ns_g_confctx = configctx;
|
|
||||||
|
|
||||||
RWUNLOCK(&ns_g_viewlock, isc_rwlocktype_write);
|
RWUNLOCK(&ns_g_viewlock, isc_rwlocktype_write);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -539,13 +536,10 @@ load_configuration(const char *filename, ns_server_t *server) {
|
|||||||
dns_view_detach(&view);
|
dns_view_detach(&view);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oconfigctx != NULL)
|
|
||||||
dns_c_ctx_delete(&oconfigctx);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load the TSIG information from the configuration
|
* Load the TSIG information from the configuration
|
||||||
*/
|
*/
|
||||||
result = dns_tsig_init(ns_g_lctx, ns_g_confctx, ns_g_mctx);
|
result = dns_tsig_init(ns_g_lctx, configctx, ns_g_mctx);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
ns_server_fatal(NS_LOGMODULE_SERVER, ISC_FALSE,
|
ns_server_fatal(NS_LOGMODULE_SERVER, ISC_FALSE,
|
||||||
"dns_tsig_init() failed: %s",
|
"dns_tsig_init() failed: %s",
|
||||||
@@ -554,7 +548,7 @@ load_configuration(const char *filename, ns_server_t *server) {
|
|||||||
/*
|
/*
|
||||||
* Load the TKEY information from the configuration
|
* Load the TKEY information from the configuration
|
||||||
*/
|
*/
|
||||||
result = dns_tkey_init(ns_g_lctx, ns_g_confctx, ns_g_mctx);
|
result = dns_tkey_init(ns_g_lctx, configctx, ns_g_mctx);
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
ns_server_fatal(NS_LOGMODULE_SERVER, ISC_FALSE,
|
ns_server_fatal(NS_LOGMODULE_SERVER, ISC_FALSE,
|
||||||
"dns_tkey_init() failed: %s",
|
"dns_tkey_init() failed: %s",
|
||||||
@@ -562,6 +556,10 @@ load_configuration(const char *filename, ns_server_t *server) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dns_aclconfctx_destroy(&aclconfctx);
|
dns_aclconfctx_destroy(&aclconfctx);
|
||||||
|
|
||||||
|
dns_c_ctx_delete(&configctx);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -599,11 +597,6 @@ shutdown_server(isc_task_t *task, isc_event_t *event) {
|
|||||||
dns_view_detach(&view);
|
dns_view_detach(&view);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* XXXRTH Is this the right place to do this?
|
|
||||||
*/
|
|
||||||
dns_c_ctx_delete(&ns_g_confctx);
|
|
||||||
|
|
||||||
dns_tkey_destroy();
|
dns_tkey_destroy();
|
||||||
dns_tsig_destroy();
|
dns_tsig_destroy();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user