Commit 573b8b48 authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

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.
parent 2015bf18
......@@ -75,7 +75,6 @@ EXTERN unsigned int ns_g_debuglevel INIT(0);
/*
* Current config information
*/
EXTERN dns_c_ctx_t * ns_g_confctx INIT(NULL);
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;
ns_g_viewlist = lctx.viewlist;
oconfigctx = ns_g_confctx;
ns_g_confctx = configctx;
RWUNLOCK(&ns_g_viewlock, isc_rwlocktype_write);
/*
......@@ -539,13 +536,10 @@ load_configuration(const char *filename, ns_server_t *server) {
dns_view_detach(&view);
}
if (oconfigctx != NULL)
dns_c_ctx_delete(&oconfigctx);
/*
* 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)
ns_server_fatal(NS_LOGMODULE_SERVER, ISC_FALSE,
"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
*/
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) {
ns_server_fatal(NS_LOGMODULE_SERVER, ISC_FALSE,
"dns_tkey_init() failed: %s",
......@@ -562,6 +556,10 @@ load_configuration(const char *filename, ns_server_t *server) {
}
dns_aclconfctx_destroy(&aclconfctx);
dns_c_ctx_delete(&configctx);
}
static void
......@@ -599,11 +597,6 @@ shutdown_server(isc_task_t *task, isc_event_t *event) {
dns_view_detach(&view);
}
/*
* XXXRTH Is this the right place to do this?
*/
dns_c_ctx_delete(&ns_g_confctx);
dns_tkey_destroy();
dns_tsig_destroy();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment