Catalog-zones can't be used in view which are not from the IN class.
This is now enforced as the server won't load (instead of loading
without the catalog-zone). This configuration error is now also caught
by `named-checkconf`.
}
obj = NULL;
- if (view->rdclass != dns_rdataclass_in &&
- named_config_get(maps, "catalog-zones", &obj) == ISC_R_SUCCESS)
- {
- cfg_obj_log(obj, ISC_LOG_WARNING,
- "'catalog-zones' option is only supported "
- "for views with class IN");
- }
-
- obj = NULL;
- if (view->rdclass == dns_rdataclass_in &&
- named_config_get(maps, "catalog-zones", &obj) == ISC_R_SUCCESS)
- {
+ if (named_config_get(maps, "catalog-zones", &obj) == ISC_R_SUCCESS) {
CHECK(configure_catz(view, NULL, config, obj));
catz_configured = true;
}
};
-view "ch" ch {
-
- catalog-zones {
- zone "catalog-bad5.example"
- default-masters { 10.53.0.1; }
- in-memory yes;
- };
-
- # Non-IN class catalog zone
- zone "catalog-bad5.example" ch {
- type secondary;
- file "catalog-bad5.example.db";
- primaries { 10.53.0.1; };
- };
-
-};
-
key tsig_key. {
secret "LSAnCU+Z";
algorithm @DEFAULT_HMAC@;
};
-view "ch" ch {
-
- # Removed catalog-zone option, otherwise this is
- # identical to named1.conf.in
-
- # Non-IN class catalog zone
- zone "catalog-bad5.example" ch {
- type secondary;
- file "catalog-bad5.example.db";
- primaries { 10.53.0.1; };
- };
-
-};
-
key tsig_key. {
secret "LSAnCU+Z";
algorithm @DEFAULT_HMAC@;
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
-n=$((n + 1))
-echo_i "checking that catalog-bad5.example (non-IN class) has failed to load ($n)"
-ret=0
-wait_for_message ns2/named.run "'catalog-zones' option is only supported for views with class IN" \
- && wait_for_message ns2/named.run "all zones loaded" || ret=1
-grep -F "catz: dns_catz_zone_add catalog-bad5.example" ns2/named.run && ret=1
-if [ $ret -ne 0 ]; then echo_i "failed"; fi
-status=$((status + ret))
-
nextpart ns2/named.run >/dev/null
##########################################################################
--- /dev/null
+/*
+ * 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.
+ */
+
+view bar ch {
+ catalog-zones {
+ zone "foo";
+ };
+
+ zone "foo" {
+ type primary;
+ file "foo";
+ };
+};
--- /dev/null
+/*
+ * 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.
+ */
+
+view "ch" ch {
+ catalog-zones {
+ zone "catalog-bad5.example" default-masters { 10.53.0.1; }
+ in-memory yes;
+ };
+
+ # Non-IN class catalog zone
+ zone "catalog-bad5.example" ch {
+ type secondary;
+ file "catalog-bad5.example.db";
+ primaries { 10.53.0.1; };
+ };
+};
+
*/
if (opts != NULL) {
obj = NULL;
- if ((cfg_map_get(opts, "catalog-zones", &obj) ==
- ISC_R_SUCCESS) &&
- (check_catz(obj, viewname, mctx) != ISC_R_SUCCESS))
- {
- result = ISC_R_FAILURE;
+ if (cfg_map_get(opts, "catalog-zones", &obj) == ISC_R_SUCCESS) {
+ if (vclass != dns_rdataclass_in) {
+ cfg_obj_log(
+ obj, ISC_LOG_ERROR,
+ "'catalog-zones' option is only "
+ "supported for views with class IN");
+
+ if (result == ISC_R_SUCCESS) {
+ result = ISC_R_FAILURE;
+ }
+ }
+
+ if (check_catz(obj, viewname, mctx) != ISC_R_SUCCESS) {
+ result = ISC_R_FAILURE;
+ }
}
}