Commit 1b2b1395 authored by Evan Hunt's avatar Evan Hunt

[v9_9] 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)
(cherry picked from commit d75441a5)
parent 8d5a01a8
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]
4863. [bug] Fix various other bugs reported by Valgrind's
memcheck tool. [RT #46978]
......
......@@ -7219,14 +7219,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);
......@@ -7814,13 +7817,14 @@ ns_server_validation(ns_server_t *server, isc_lex_t *lex) {
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
} else {
return (DNS_R_SYNTAX);
}
/* Look for the view name. */
ptr = next_token(lex, NULL);
......
......@@ -123,7 +123,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\
......@@ -171,7 +171,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 ] [view]\n\
Enable / disable DNSSEC validation.\n\
\n\
Version: %s\n",
......
......@@ -397,7 +397,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
......@@ -714,7 +714,7 @@
</varlistentry>
<varlistentry>
<term><userinput>validation ( on | off | check ) <optional><replaceable>view ...</replaceable></optional> </userinput></term>
<term><userinput>validation ( on | off ) <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