2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 09:05:40 +00:00

Add flag to named-checkconf to ignore "not configured" errors

named-checkconf now takes "-n" to ignore "not configured" errors.
This allows named-checkconf to check the syntax of configurations
from other builds which have support for more options.
This commit is contained in:
Mark Andrews
2024-09-02 16:03:17 +10:00
parent 004a5329e2
commit 61faffd06f
4 changed files with 18 additions and 3 deletions

View File

@@ -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));