summaryrefslogtreecommitdiffstats
path: root/contrib/bind9/bin/named/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bind9/bin/named/server.c')
-rw-r--r--contrib/bind9/bin/named/server.c55
1 files changed, 37 insertions, 18 deletions
diff --git a/contrib/bind9/bin/named/server.c b/contrib/bind9/bin/named/server.c
index f19a0bb..46f26c4 100644
--- a/contrib/bind9/bin/named/server.c
+++ b/contrib/bind9/bin/named/server.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: server.c,v 1.599.8.12 2011-08-02 04:58:45 each Exp $ */
+/* $Id: server.c,v 1.599.8.19 2012/02/22 00:33:32 each Exp $ */
/*! \file */
@@ -2596,14 +2596,19 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
if (result == ISC_R_SUCCESS) {
/* If set to "auto", use the version from the defaults */
const cfg_obj_t *dlvobj;
+ const char *dom;
dlvobj = cfg_listelt_value(cfg_list_first(obj));
- if (!strcmp(cfg_obj_asstring(cfg_tuple_get(dlvobj, "domain")),
- "auto") &&
- cfg_obj_isvoid(cfg_tuple_get(dlvobj, "trust-anchor"))) {
- auto_dlv = ISC_TRUE;
- obj = NULL;
- result = cfg_map_get(ns_g_defaults,
- "dnssec-lookaside", &obj);
+ dom = cfg_obj_asstring(cfg_tuple_get(dlvobj, "domain"));
+ if (cfg_obj_isvoid(cfg_tuple_get(dlvobj, "trust-anchor"))) {
+ /* If "no", skip; if "auto", use global default */
+ if (!strcasecmp(dom, "no"))
+ result = ISC_R_NOTFOUND;
+ else if (!strcasecmp(dom, "auto")) {
+ auto_dlv = ISC_TRUE;
+ obj = NULL;
+ result = cfg_map_get(ns_g_defaults,
+ "dnssec-lookaside", &obj);
+ }
}
}
@@ -2704,7 +2709,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
rfc1918 = ISC_FALSE;
empty_zones_enable = ISC_FALSE;
}
- if (empty_zones_enable) {
+ if (empty_zones_enable && !lwresd_g_useresolvconf) {
const char *empty;
int empty_zone = 0;
dns_fixedname_t fixed;
@@ -2842,7 +2847,8 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
CHECK(dns_zone_create(&zone, mctx));
CHECK(dns_zone_setorigin(zone, name));
dns_zone_setview(zone, view);
- CHECK(dns_zonemgr_managezone(ns_g_server->zonemgr, zone));
+ CHECK(dns_zonemgr_managezone(ns_g_server->zonemgr,
+ zone));
dns_zone_setclass(zone, view->rdclass);
dns_zone_settype(zone, dns_zone_master);
dns_zone_setstats(zone, ns_g_server->zonestats);
@@ -3449,6 +3455,12 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
*/
CHECK(dns_view_addzone(view, zone));
+ /*
+ * Ensure that zone keys are reloaded on reconfig
+ */
+ if ((dns_zone_getkeyopts(zone) & DNS_ZONEKEY_MAINTAIN) != 0)
+ dns_zone_rekey(zone, ISC_FALSE);
+
cleanup:
if (zone != NULL)
dns_zone_detach(&zone);
@@ -3489,6 +3501,7 @@ add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx) {
dns_zone_attach(pview->managed_keys, &view->managed_keys);
dns_zone_setview(pview->managed_keys, view);
dns_view_detach(&pview);
+ dns_zone_synckeyzone(view->managed_keys);
return (ISC_R_SUCCESS);
}
@@ -4278,15 +4291,12 @@ load_configuration(const char *filename, ns_server_t *server,
ns_cache_t *nsc;
struct cfg_context *nzctx;
int num_zones = 0;
+ isc_boolean_t exclusive = ISC_FALSE;
ISC_LIST_INIT(viewlist);
ISC_LIST_INIT(builtin_viewlist);
ISC_LIST_INIT(cachelist);
- /* Ensure exclusive access to configuration data. */
- result = isc_task_beginexclusive(server->task);
- RUNTIME_CHECK(result == ISC_R_SUCCESS);
-
/* Create the ACL configuration context */
if (ns_g_aclconfctx != NULL)
cfg_aclconfctx_detach(&ns_g_aclconfctx);
@@ -4382,6 +4392,13 @@ load_configuration(const char *filename, ns_server_t *server,
CHECK(result);
}
+ /* Ensure exclusive access to configuration data. */
+ if (!exclusive) {
+ result = isc_task_beginexclusive(server->task);
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ exclusive = ISC_TRUE;
+ }
+
/*
* Set process limits, which (usually) needs to be done as root.
*/
@@ -5149,7 +5166,8 @@ load_configuration(const char *filename, ns_server_t *server,
adjust_interfaces(server, ns_g_mctx);
/* Relinquish exclusive access to configuration data. */
- isc_task_endexclusive(server->task);
+ if (exclusive)
+ isc_task_endexclusive(server->task);
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
ISC_LOG_DEBUG(1), "load_configuration: %s",
@@ -7352,13 +7370,14 @@ ns_server_add_zone(ns_server_t *server, char *args) {
CHECK(isc_stdio_open(view->new_zone_file, "a", &fp));
/* Mark view unfrozen so that zone can be added */
+ isc_task_beginexclusive(server->task);
dns_view_thaw(view);
result = configure_zone(cfg->config, parms, vconfig,
server->mctx, view, cfg->actx, ISC_FALSE);
dns_view_freeze(view);
- if (result != ISC_R_SUCCESS) {
+ isc_task_endexclusive(server->task);
+ if (result != ISC_R_SUCCESS)
goto cleanup;
- }
/* Is it there yet? */
CHECK(dns_zt_find(view->zonetable, &dnsname, 0, NULL, &zone));
OpenPOWER on IntegriCloud