summaryrefslogtreecommitdiff
path: root/bin/check/named-checkconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/check/named-checkconf.c')
-rw-r--r--bin/check/named-checkconf.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/bin/check/named-checkconf.c b/bin/check/named-checkconf.c
index fd3795a57fd2..a75df96d1fea 100644
--- a/bin/check/named-checkconf.c
+++ b/bin/check/named-checkconf.c
@@ -143,18 +143,6 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
}
static isc_result_t
-config_get(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
- int i;
-
- for (i = 0;; i++) {
- if (maps[i] == NULL)
- return (ISC_R_NOTFOUND);
- if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS)
- return (ISC_R_SUCCESS);
- }
-}
-
-static isc_result_t
configure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
isc_result_t result;
dns_db_t *db = NULL;
@@ -190,6 +178,7 @@ configure_zone(const char *vclass, const char *view,
const char *zname;
const char *zfile = NULL;
const cfg_obj_t *maps[4];
+ const cfg_obj_t *mastersobj = NULL;
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *classobj = NULL;
const cfg_obj_t *typeobj = NULL;
@@ -223,6 +212,15 @@ configure_zone(const char *vclass, const char *view,
if (typeobj == NULL)
return (ISC_R_FAILURE);
+ /*
+ * Skip checks when using an alternate data source.
+ */
+ cfg_map_get(zoptions, "database", &dbobj);
+ if (dbobj != NULL &&
+ strcmp("rbt", cfg_obj_asstring(dbobj)) != 0 &&
+ strcmp("rbt64", cfg_obj_asstring(dbobj)) != 0)
+ return (ISC_R_SUCCESS);
+
cfg_map_get(zoptions, "file", &fileobj);
if (fileobj != NULL)
zfile = cfg_obj_asstring(fileobj);
@@ -238,13 +236,18 @@ configure_zone(const char *vclass, const char *view,
(strcasecmp(cfg_obj_asstring(typeobj), "redirect") != 0))
return (ISC_R_SUCCESS);
+ /*
+ * Is the redirect zone configured as a slave?
+ */
+ if (strcasecmp(cfg_obj_asstring(typeobj), "redirect") == 0) {
+ cfg_map_get(zoptions, "masters", &mastersobj);
+ if (mastersobj != NULL)
+ return (ISC_R_SUCCESS);
+ }
+
if (zfile == NULL)
return (ISC_R_FAILURE);
- cfg_map_get(zoptions, "database", &dbobj);
- if (dbobj != NULL)
- return (ISC_R_SUCCESS);
-
obj = NULL;
if (get_maps(maps, "check-dup-records", &obj)) {
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
@@ -366,8 +369,7 @@ configure_zone(const char *vclass, const char *view,
masterformat = dns_masterformat_text;
fmtobj = NULL;
- result = config_get(maps, "masterfile-format", &fmtobj);
- if (result == ISC_R_SUCCESS) {
+ if (get_maps(maps, "masterfile-format", &fmtobj)) {
const char *masterformatstr = cfg_obj_asstring(fmtobj);
if (strcasecmp(masterformatstr, "text") == 0)
masterformat = dns_masterformat_text;