diff --git a/bin/check/named-checkconf.c b/bin/check/named-checkconf.c index 37a827cba6..5a987a46a0 100644 --- a/bin/check/named-checkconf.c +++ b/bin/check/named-checkconf.c @@ -594,6 +594,7 @@ main(int argc, char **argv) { bool list_zones = false; bool print = false; bool nodeprecate = false; + bool allconfigs = false; unsigned int flags = 0; unsigned int checkflags = BIND_CHECK_PLUGINS | BIND_CHECK_ALGORITHMS; @@ -602,7 +603,7 @@ main(int argc, char **argv) { /* * Process memory debugging argument first. */ -#define CMDLINE_FLAGS "acdhijlm:t:pvxz" +#define CMDLINE_FLAGS "acdhijlm:nt:pvxz" while ((c = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) { switch (c) { case 'm': @@ -656,6 +657,10 @@ main(int argc, char **argv) { case 'm': break; + case 'n': + allconfigs = true; + break; + case 't': result = isc_dir_chroot(isc_commandline_argument); if (result != ISC_R_SUCCESS) { @@ -729,6 +734,9 @@ main(int argc, char **argv) { if (nodeprecate) { cfg_parser_setflags(parser, CFG_PCTX_NODEPRECATED, true); } + if (allconfigs) { + cfg_parser_setflags(parser, CFG_PCTX_ALLCONFIGS, true); + } cfg_parser_setcallback(parser, directory_callback, NULL); CHECK(cfg_parse_file(parser, conffile, &cfg_type_namedconf, &config)); diff --git a/bin/check/named-checkconf.rst b/bin/check/named-checkconf.rst index 41dad390fa..c474169ea6 100644 --- a/bin/check/named-checkconf.rst +++ b/bin/check/named-checkconf.rst @@ -21,7 +21,7 @@ named-checkconf - named configuration file syntax checking tool Synopsis ~~~~~~~~ -:program:`named-checkconf` [**-achjlvz**] [**-p** [**-x** ]] [**-t** directory] {filename} +:program:`named-checkconf` [**-achjlnvz**] [**-p** [**-x** ]] [**-t** directory] {filename} Description ~~~~~~~~~~~ @@ -71,6 +71,10 @@ Options This option ignores warnings on deprecated options. +.. option:: -n + + Do not error on options that are disabled in this build. + .. option:: -p This option prints out the :iscman:`named.conf` and included files in canonical form if diff --git a/lib/isccfg/include/isccfg/grammar.h b/lib/isccfg/include/isccfg/grammar.h index 8734977966..e80912afd4 100644 --- a/lib/isccfg/include/isccfg/grammar.h +++ b/lib/isccfg/include/isccfg/grammar.h @@ -261,6 +261,7 @@ struct cfg_parser { #define CFG_PCTX_NODEPRECATED (1 << 1) #define CFG_PCTX_NOOBSOLETE (1 << 2) #define CFG_PCTX_NOEXPERIMENTAL (1 << 3) +#define CFG_PCTX_ALLCONFIGS (1 << 4) /*@{*/ /*% diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index e882eb9b8f..08502510d7 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -2341,7 +2341,9 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { clause->name); CHECK(ISC_R_FAILURE); } - if ((clause->flags & CFG_CLAUSEFLAG_NOTCONFIGURED) != 0) { + if ((pctx->flags & CFG_PCTX_ALLCONFIGS) == 0 && + (clause->flags & CFG_CLAUSEFLAG_NOTCONFIGURED) != 0) + { cfg_parser_error(pctx, 0, "option '%s' was not " "enabled at compile time",