Commit cf8f4241 authored by Evan Hunt's avatar Evan Hunt

[master] normalize rndc on/off commands

4867.	[cleanup]	Normalize rndc on/off commands (validation,
			querylog, serve-stale) so they all accept the
			same synonyms for on/off (yes/no, true/false,
			enable/disable). Thanks to Tony Finch. [RT #47022]
parent bcc21e99
4867. [cleanup] Normalize rndc on/off commands (validation,
querylog, serve-stale) so they all accept the
same synonyms for on/off (yes/no, true/false,
enable/disable). Thanks to Tony Finch. [RT #47022]
4866. [port] DST library initialization verifies MD5 (when MD5 4866. [port] DST library initialization verifies MD5 (when MD5
was not disabled) and SHA-1 hash and HMAC support. was not disabled) and SHA-1 hash and HMAC support.
[RT #46764] [RT #46764]
......
...@@ -10195,14 +10195,17 @@ named_server_togglequerylog(named_server_t *server, isc_lex_t *lex) { ...@@ -10195,14 +10195,17 @@ named_server_togglequerylog(named_server_t *server, isc_lex_t *lex) {
prev = ns_server_getoption(server->sctx, NS_SERVER_LOGQUERIES); prev = ns_server_getoption(server->sctx, NS_SERVER_LOGQUERIES);
ptr = next_token(lex, NULL); ptr = next_token(lex, NULL);
if (ptr == NULL) if (ptr == NULL) {
value = !prev; value = !prev;
else if (strcasecmp(ptr, "yes") == 0 || strcasecmp(ptr, "on") == 0) } else if (!strcasecmp(ptr, "on") || !strcasecmp(ptr, "yes") ||
!strcasecmp(ptr, "enable") || !strcasecmp(ptr, "true")) {
value = ISC_TRUE; value = ISC_TRUE;
else if (strcasecmp(ptr, "no") == 0 || strcasecmp(ptr, "off") == 0) } else if (!strcasecmp(ptr, "off") || !strcasecmp(ptr, "no") ||
!strcasecmp(ptr, "disable") || !strcasecmp(ptr, "false")) {
value = ISC_FALSE; value = ISC_FALSE;
else } else {
return (ISC_R_NOTFOUND); return (DNS_R_SYNTAX);
}
if (value == prev) if (value == prev)
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
...@@ -10851,15 +10854,16 @@ named_server_validation(named_server_t *server, isc_lex_t *lex, ...@@ -10851,15 +10854,16 @@ named_server_validation(named_server_t *server, isc_lex_t *lex,
return (ISC_R_UNEXPECTEDEND); return (ISC_R_UNEXPECTEDEND);
if (!strcasecmp(ptr, "on") || !strcasecmp(ptr, "yes") || if (!strcasecmp(ptr, "on") || !strcasecmp(ptr, "yes") ||
!strcasecmp(ptr, "enable") || !strcasecmp(ptr, "true")) !strcasecmp(ptr, "enable") || !strcasecmp(ptr, "true")) {
enable = ISC_TRUE; enable = ISC_TRUE;
else if (!strcasecmp(ptr, "off") || !strcasecmp(ptr, "no") || } else if (!strcasecmp(ptr, "off") || !strcasecmp(ptr, "no") ||
!strcasecmp(ptr, "disable") || !strcasecmp(ptr, "false")) !strcasecmp(ptr, "disable") || !strcasecmp(ptr, "false")) {
enable = ISC_FALSE; enable = ISC_FALSE;
else if (!strcasecmp(ptr, "check")) } else if (!strcasecmp(ptr, "check") || !strcasecmp(ptr, "status")) {
set = ISC_FALSE; set = ISC_FALSE;
else } else {
return (DNS_R_SYNTAX); return (DNS_R_SYNTAX);
}
/* Look for the view name. */ /* Look for the view name. */
ptr = next_token(lex, text); ptr = next_token(lex, text);
...@@ -14930,13 +14934,15 @@ named_server_servestale(named_server_t *server, isc_lex_t *lex, ...@@ -14930,13 +14934,15 @@ named_server_servestale(named_server_t *server, isc_lex_t *lex,
if (ptr == NULL) if (ptr == NULL)
return (ISC_R_UNEXPECTEDEND); return (ISC_R_UNEXPECTEDEND);
if (strcasecmp(ptr, "on") == 0 || strcasecmp(ptr, "yes") == 0) { if (!strcasecmp(ptr, "on") || !strcasecmp(ptr, "yes") ||
!strcasecmp(ptr, "enable") || !strcasecmp(ptr, "true")) {
staleanswersok = dns_stale_answer_yes; staleanswersok = dns_stale_answer_yes;
} else if (strcasecmp(ptr, "off") == 0 || strcasecmp(ptr, "no") == 0) { } else if (!strcasecmp(ptr, "off") || !strcasecmp(ptr, "no") ||
!strcasecmp(ptr, "disable") || !strcasecmp(ptr, "false")) {
staleanswersok = dns_stale_answer_no; staleanswersok = dns_stale_answer_no;
} else if (strcasecmp(ptr, "reset") == 0) { } else if (strcasecmp(ptr, "reset") == 0) {
staleanswersok = dns_stale_answer_conf; staleanswersok = dns_stale_answer_conf;
} else if (strcasecmp(ptr, "status") == 0) { } else if (!strcasecmp(ptr, "check") || !strcasecmp(ptr, "status")) {
wantstatus = ISC_TRUE; wantstatus = ISC_TRUE;
} else } else
return (DNS_R_SYNTAX); return (DNS_R_SYNTAX);
......
...@@ -144,7 +144,7 @@ command is one of the following:\n\ ...@@ -144,7 +144,7 @@ command is one of the following:\n\
nta -remove domain [view]\n\ nta -remove domain [view]\n\
Remove a negative trust anchor, re-enabling validation\n\ Remove a negative trust anchor, re-enabling validation\n\
for the given domain.\n\ for the given domain.\n\
querylog newstate\n\ querylog [ on | off ]\n\
Enable / disable query logging.\n\ Enable / disable query logging.\n\
reconfig Reload configuration file and new zones only.\n\ reconfig Reload configuration file and new zones only.\n\
recursing Dump the queries that are currently recursing (named.recursing)\n\ recursing Dump the queries that are currently recursing (named.recursing)\n\
...@@ -158,7 +158,7 @@ command is one of the following:\n\ ...@@ -158,7 +158,7 @@ command is one of the following:\n\
scan Scan available network interfaces for changes.\n\ scan Scan available network interfaces for changes.\n\
secroots [view ...]\n\ secroots [view ...]\n\
Write security roots to the secroots file.\n\ Write security roots to the secroots file.\n\
serve-stale ( yes | no | reset ) [class [view]]\n\ serve-stale [ yes | no | reset | status ] [class [view]]\n\
Control whether stale answers are returned\n\ Control whether stale answers are returned\n\
showzone zone [class [view]]\n\ showzone zone [class [view]]\n\
Print a zone's configuration.\n\ Print a zone's configuration.\n\
...@@ -202,7 +202,7 @@ command is one of the following:\n\ ...@@ -202,7 +202,7 @@ command is one of the following:\n\
Delete a TKEY-negotiated TSIG key.\n\ Delete a TKEY-negotiated TSIG key.\n\
tsig-list List all currently active TSIG keys, including both statically\n\ tsig-list List all currently active TSIG keys, including both statically\n\
configured and TKEY-negotiated keys.\n\ configured and TKEY-negotiated keys.\n\
validation newstate [view]\n\ validation [ yes | no | status ] [view]\n\
Enable / disable DNSSEC validation.\n\ Enable / disable DNSSEC validation.\n\
zonestatus zone [class [view]]\n\ zonestatus zone [class [view]]\n\
Display the current status of a zone.\n\ Display the current status of a zone.\n\
......
...@@ -645,7 +645,7 @@ ...@@ -645,7 +645,7 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><userinput>querylog</userinput> <optional>on|off</optional> </term> <term><userinput>querylog</userinput> <optional> on | off </optional> </term>
<listitem> <listitem>
<para> <para>
Enable or disable query logging. (For backward Enable or disable query logging. (For backward
...@@ -751,25 +751,6 @@ ...@@ -751,25 +751,6 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><userinput>serve-stale ( on | off | reset | status) <optional><replaceable>class</replaceable> <optional><replaceable>view</replaceable></optional></optional></userinput></term>
<listitem>
<para>
Enable, disable, or reset the serving of stale answers
as configured in named.conf. Serving of stale answers
will remain disabled across <filename>named.conf</filename>
reloads if disabled via rndc until it is reset via rndc.
</para>
<para>
Status will report whether serving of stale answers is
currently enabled, disabled or not configured for a
view. If serving of stale records is configured then
the values of stale-answer-ttl and max-stale-ttl are
reported.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><userinput>secroots <optional>-</optional> <optional><replaceable>view ...</replaceable></optional></userinput></term> <term><userinput>secroots <optional>-</optional> <optional><replaceable>view ...</replaceable></optional></userinput></term>
<listitem> <listitem>
...@@ -799,6 +780,25 @@ ...@@ -799,6 +780,25 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><userinput>serve-stale ( on | off | status | reset ) <optional><replaceable>class</replaceable> <optional><replaceable>view</replaceable></optional></optional></userinput></term>
<listitem>
<para>
Enable, disable, or reset the serving of stale answers
as configured in named.conf. Serving of stale answers
will remain disabled across <filename>named.conf</filename>
reloads if disabled via rndc until it is reset via rndc.
</para>
<para>
Status will report whether serving of stale answers is
currently enabled, disabled or not configured for a
view. If serving of stale records is configured then
the values of stale-answer-ttl and max-stale-ttl are
reported.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><userinput>showzone <replaceable>zone</replaceable> <optional><replaceable>class</replaceable> <optional><replaceable>view</replaceable></optional></optional> </userinput></term> <term><userinput>showzone <replaceable>zone</replaceable> <optional><replaceable>class</replaceable> <optional><replaceable>view</replaceable></optional></optional> </userinput></term>
<listitem> <listitem>
...@@ -1049,7 +1049,7 @@ ...@@ -1049,7 +1049,7 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><userinput>validation ( on | off | check ) <optional><replaceable>view ...</replaceable></optional> </userinput></term> <term><userinput>validation ( on | off | status ) <optional><replaceable>view ...</replaceable></optional> </userinput></term>
<listitem> <listitem>
<para> <para>
Enable, disable, or check the current status of Enable, disable, or check the current status of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment