summaryrefslogtreecommitdiff
path: root/smallapp/unbound-checkconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'smallapp/unbound-checkconf.c')
-rw-r--r--smallapp/unbound-checkconf.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/smallapp/unbound-checkconf.c b/smallapp/unbound-checkconf.c
index 7e9cb4740ae3e..e205c3e9c49c6 100644
--- a/smallapp/unbound-checkconf.c
+++ b/smallapp/unbound-checkconf.c
@@ -54,6 +54,7 @@
#include "validator/validator.h"
#include "services/localzone.h"
#include "services/view.h"
+#include "services/authzone.h"
#include "respip/respip.h"
#include "sldns/sbuffer.h"
#ifdef HAVE_GETOPT_H
@@ -108,6 +109,16 @@ print_option(struct config_file* cfg, const char* opt, int final)
free(p);
return;
}
+ if(strcmp(opt, "auto-trust-anchor-file") == 0 && final) {
+ struct config_strlist* s = cfg->auto_trust_anchor_file_list;
+ for(; s; s=s->next) {
+ char *p = fname_after_chroot(s->str, cfg, 1);
+ if(!p) fatal_exit("out of memory");
+ printf("%s\n", p);
+ free(p);
+ }
+ return;
+ }
if(!config_get_option(cfg, opt, config_print_func, stdout))
fatal_exit("cannot print option '%s'", opt);
}
@@ -573,6 +584,17 @@ check_hints(struct config_file* cfg)
hints_delete(hints);
}
+/** check auth zones */
+static void
+check_auth(struct config_file* cfg)
+{
+ struct auth_zones* az = auth_zones_create();
+ if(!az || !auth_zones_apply_cfg(az, cfg, 0)) {
+ fatal_exit("Could not setup authority zones");
+ }
+ auth_zones_delete(az);
+}
+
/** check config file */
static void
checkconf(const char* cfgfile, const char* opt, int final)
@@ -607,6 +629,7 @@ checkconf(const char* cfgfile, const char* opt, int final)
#endif
check_fwd(cfg);
check_hints(cfg);
+ check_auth(cfg);
printf("unbound-checkconf: no errors in %s\n", cfgfile);
config_delete(cfg);
}