Merge branch 'feature/main/default-config-print-v9_18' into 'v9_18'

Export built-in default configuration for named binary [v9_18]

See merge request isc-projects/bind9!6233
This commit is contained in:
Petr Špaček 2022-04-29 08:49:42 +00:00
commit f8737d2a1a
7 changed files with 37 additions and 4 deletions

View file

@ -1,3 +1,6 @@
5880. [func] Add new named command-line option -C to print built-in
defaults. [GL #1326]
5879. [contrib] dlz: Add FALLTHROUGH and UNREACHABLE macros. [GL #3306]
5877. [func] Introduce the concept of broken catalog zones described

View file

@ -335,6 +335,11 @@ named_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf) {
CFG_PCTX_NODEPRECATED, conf));
}
const char *
named_config_getdefault() {
return (defaultconf);
}
isc_result_t
named_config_get(cfg_obj_t const *const *maps, const char *name,
const cfg_obj_t **obj) {

View file

@ -27,6 +27,9 @@
isc_result_t
named_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf);
const char *
named_config_getdefault(void);
isc_result_t
named_config_get(cfg_obj_t const *const *maps, const char *name,
const cfg_obj_t **obj);

View file

@ -24,7 +24,7 @@
/*
* Commandline arguments for named;
*/
#define NAMED_MAIN_ARGS "46A:c:d:D:E:fFgL:M:m:n:N:p:sS:t:T:U:u:vVx:X:"
#define NAMED_MAIN_ARGS "46A:c:Cd:D:E:fFgL:M:m:n:N:p:sS:t:T:U:u:vVx:X:"
noreturn void
named_main_earlyfatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);

View file

@ -316,7 +316,7 @@ usage(void) {
" [-X lockfile] [-m "
"{usage|trace|record|size|mctx}]\n"
" [-M fill|nofill]\n"
"usage: named [-v|-V]\n");
"usage: named [-v|-V|-C]\n");
}
static void
@ -778,6 +778,11 @@ parse_command_line(int argc, char *argv[]) {
named_g_conffile = isc_commandline_argument;
named_g_conffileset = true;
break;
case 'C':
printf("# Built-in default values. "
"This is NOT the run-time configuration!\n");
printf("%s", named_config_getdefault());
exit(0);
case 'd':
named_g_debuglevel = parse_int(isc_commandline_argument,
"debug "

View file

@ -21,7 +21,7 @@ named - Internet domain name server
Synopsis
~~~~~~~~
:program:`named` [ [**-4**] | [**-6**] ] [**-c** config-file] [**-d** debug-level] [**-D** string] [**-E** engine-name] [**-f**] [**-g**] [**-L** logfile] [**-M** option] [**-m** flag] [**-n** #cpus] [**-p** port] [**-s**] [**-t** directory] [**-U** #listeners] [**-u** user] [**-v**] [**-V**] [**-X** lock-file]
:program:`named` [ [**-4**] | [**-6**] ] [**-c** config-file] [**-C**] [**-d** debug-level] [**-D** string] [**-E** engine-name] [**-f**] [**-g**] [**-L** logfile] [**-M** option] [**-m** flag] [**-n** #cpus] [**-p** port] [**-s**] [**-t** directory] [**-U** #listeners] [**-u** user] [**-v**] [**-V**] [**-X** lock-file]
Description
~~~~~~~~~~~
@ -55,6 +55,14 @@ Options
due to to a possible ``directory`` option in the configuration file,
``config-file`` should be an absolute pathname.
.. option:: -C
This option prints out the default built-in configuration and exits.
NOTE: This is for debugging purposes only and is not an
accurate representation of the actual configuration used by :iscman:`named`
at runtime.
.. option:: -d debug-level
This option sets the daemon's debug level to ``debug-level``. Debugging traces from

View file

@ -32,7 +32,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
named \- Internet domain name server
.SH SYNOPSIS
.sp
\fBnamed\fP [ [\fB\-4\fP] | [\fB\-6\fP] ] [\fB\-c\fP config\-file] [\fB\-d\fP debug\-level] [\fB\-D\fP string] [\fB\-E\fP engine\-name] [\fB\-f\fP] [\fB\-g\fP] [\fB\-L\fP logfile] [\fB\-M\fP option] [\fB\-m\fP flag] [\fB\-n\fP #cpus] [\fB\-p\fP port] [\fB\-s\fP] [\fB\-t\fP directory] [\fB\-U\fP #listeners] [\fB\-u\fP user] [\fB\-v\fP] [\fB\-V\fP] [\fB\-X\fP lock\-file]
\fBnamed\fP [ [\fB\-4\fP] | [\fB\-6\fP] ] [\fB\-c\fP config\-file] [\fB\-C\fP] [\fB\-d\fP debug\-level] [\fB\-D\fP string] [\fB\-E\fP engine\-name] [\fB\-f\fP] [\fB\-g\fP] [\fB\-L\fP logfile] [\fB\-M\fP option] [\fB\-m\fP flag] [\fB\-n\fP #cpus] [\fB\-p\fP port] [\fB\-s\fP] [\fB\-t\fP directory] [\fB\-U\fP #listeners] [\fB\-u\fP user] [\fB\-v\fP] [\fB\-V\fP] [\fB\-X\fP lock\-file]
.SH DESCRIPTION
.sp
\fBnamed\fP is a Domain Name System (DNS) server, part of the BIND 9
@ -66,6 +66,15 @@ due to to a possible \fBdirectory\fP option in the configuration file,
.UNINDENT
.INDENT 0.0
.TP
.B \-C
This option prints out the default built\-in configuration and exits.
.sp
NOTE: This is for debugging purposes only and is not an
accurate representation of the actual configuration used by \fI\%named\fP
at runtime.
.UNINDENT
.INDENT 0.0
.TP
.B \-d debug\-level
This option sets the daemon\(aqs debug level to \fBdebug\-level\fP\&. Debugging traces from
\fBnamed\fP become more verbose as the debug level increases.