Commit d75441a5 authored by Evan Hunt's avatar Evan Hunt

[v9_10] normalize rndc on/off commands

4867.	[cleanup]	Normalize rndc on/off commands (validation and
			querylog) so they accept the same synonyms
			for on/off (yes/no, true/false, enable/disable).
			Thanks to Tony Finch. [RT #47022]

(cherry picked from commit cf8f4241)
(cherry picked from commit 4221d9cd)
parent 6f0937c0
4867. [cleanup] Normalize rndc on/off commands (validation and
querylog) so they 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
was not disabled) and SHA-1 hash and HMAC support.
[RT #46764]
......
......@@ -7961,14 +7961,17 @@ ns_server_togglequerylog(ns_server_t *server, isc_lex_t *lex) {
return (ISC_R_UNEXPECTEDEND);
ptr = next_token(lex, NULL);
if (ptr == NULL)
value = server->log_queries ? ISC_FALSE : ISC_TRUE;
else if (strcasecmp(ptr, "yes") == 0 || strcasecmp(ptr, "on") == 0)
if (ptr == NULL) {
value = !prev;
} else if (!strcasecmp(ptr, "on") || !strcasecmp(ptr, "yes") ||
!strcasecmp(ptr, "enable") || !strcasecmp(ptr, "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;
else
return (ISC_R_NOTFOUND);
} else {
return (DNS_R_SYNTAX);
}
if (server->log_queries == value)
return (ISC_R_SUCCESS);
......@@ -8571,15 +8574,16 @@ ns_server_validation(ns_server_t *server, isc_lex_t *lex, isc_buffer_t *text) {
return (ISC_R_UNEXPECTEDEND);
if (!strcasecmp(ptr, "on") || !strcasecmp(ptr, "yes") ||
!strcasecmp(ptr, "enable") || !strcasecmp(ptr, "true"))
!strcasecmp(ptr, "enable") || !strcasecmp(ptr, "true")) {
enable = ISC_TRUE;
else if (!strcasecmp(ptr, "off") || !strcasecmp(ptr, "no") ||
!strcasecmp(ptr, "disable") || !strcasecmp(ptr, "false"))
} else if (!strcasecmp(ptr, "off") || !strcasecmp(ptr, "no") ||
!strcasecmp(ptr, "disable") || !strcasecmp(ptr, "false")) {
enable = ISC_FALSE;
else if (!strcasecmp(ptr, "check"))
} else if (!strcasecmp(ptr, "check") || !strcasecmp(ptr, "status")) {
set = ISC_FALSE;
else
} else {
return (DNS_R_SYNTAX);
}
/* Look for the view name. */
ptr = next_token(lex, text);
......
......@@ -127,7 +127,7 @@ command is one of the following:\n\
notify zone [class [view]]\n\
Resend NOTIFY messages for the zone.\n\
notrace Set debugging level to 0.\n\
querylog newstate\n\
querylog [ on | off ]\n\
Enable / disable query logging.\n\
reconfig Reload configuration file and new zones only.\n\
recursing Dump the queries that are currently recursing (named.recursing)\n\
......@@ -176,7 +176,7 @@ command is one of the following:\n\
Delete a TKEY-negotiated TSIG key.\n\
tsig-list List all currently active TSIG keys, including both statically\n\
configured and TKEY-negotiated keys.\n\
validation newstate [view]\n\
validation [ yes | no | status ] [view]\n\
Enable / disable DNSSEC validation.\n\
zonestatus zone [class [view]]\n\
Display the current status of a zone.\n\
......
......@@ -422,7 +422,7 @@
</varlistentry>
<varlistentry>
<term><userinput>querylog</userinput> <optional>on|off</optional> </term>
<term><userinput>querylog</userinput> <optional> on | off </optional> </term>
<listitem>
<para>
Enable or disable query logging. (For backward
......@@ -753,7 +753,7 @@
</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>
<para>
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