diff --git a/bin/named/config.c b/bin/named/config.c index d0f70bddbc..4900e813cf 100644 --- a/bin/named/config.c +++ b/bin/named/config.c @@ -356,7 +356,9 @@ named_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf) { isc_buffer_init(&b, defaultconf, sizeof(defaultconf) - 1); isc_buffer_add(&b, sizeof(defaultconf) - 1); return (cfg_parse_buffer(parser, &b, __FILE__, 0, &cfg_type_namedconf, - CFG_PCTX_NODEPRECATED, conf)); + CFG_PCTX_NODEPRECATED | CFG_PCTX_NOOBSOLETE | + CFG_PCTX_NOEXPERIMENTAL, + conf)); } const char * diff --git a/lib/isccfg/include/isccfg/grammar.h b/lib/isccfg/include/isccfg/grammar.h index 7cbcf7f470..17c6af3a60 100644 --- a/lib/isccfg/include/isccfg/grammar.h +++ b/lib/isccfg/include/isccfg/grammar.h @@ -258,8 +258,10 @@ struct cfg_parser { }; /* Parser context flags */ -#define CFG_PCTX_SKIP 0x1 -#define CFG_PCTX_NODEPRECATED 0x2 +#define CFG_PCTX_SKIP (1 << 0) +#define CFG_PCTX_NODEPRECATED (1 << 1) +#define CFG_PCTX_NOOBSOLETE (1 << 2) +#define CFG_PCTX_NOEXPERIMENTAL (1 << 3) /*@{*/ /*% diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 0dac6e381c..708e6937c7 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -689,7 +689,8 @@ cfg_parse_buffer(cfg_parser_t *pctx, isc_buffer_t *buffer, const char *file, REQUIRE(type != NULL); REQUIRE(buffer != NULL); REQUIRE(ret != NULL && *ret == NULL); - REQUIRE((flags & ~(CFG_PCTX_NODEPRECATED)) == 0); + REQUIRE((flags & ~(CFG_PCTX_NODEPRECATED | CFG_PCTX_NOOBSOLETE | + CFG_PCTX_NOEXPERIMENTAL)) == 0); CHECK(isc_lex_openbuffer(pctx->lexer, buffer)); @@ -2357,13 +2358,17 @@ cfg_parse_mapbody(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { cfg_parser_warning(pctx, 0, "option '%s' is deprecated", clause->name); } - if ((clause->flags & CFG_CLAUSEFLAG_OBSOLETE) != 0) { + if ((pctx->flags & CFG_PCTX_NOOBSOLETE) == 0 && + (clause->flags & CFG_CLAUSEFLAG_OBSOLETE) != 0) + { cfg_parser_warning(pctx, 0, "option '%s' is obsolete and " "should be removed ", clause->name); } - if ((clause->flags & CFG_CLAUSEFLAG_EXPERIMENTAL) != 0) { + if ((pctx->flags & CFG_PCTX_NOEXPERIMENTAL) == 0 && + (clause->flags & CFG_CLAUSEFLAG_EXPERIMENTAL) != 0) + { cfg_parser_warning(pctx, 0, "option '%s' is experimental and " "subject to change in the future",