]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not ignore named_server_dumpdb() result code
authorAram Sargsyan <aram@isc.org>
Tue, 24 Sep 2024 08:53:47 +0000 (08:53 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Wed, 25 Sep 2024 09:11:49 +0000 (09:11 +0000)
The named_server_dumpdb() function, which is called when a 'rndc dumpdb'
command is issued, returns a 'isc_result_t' result code and it has been
always ignored since its introduction in
eb8713ed947fdf22a41dad673d561896dd6fe4a2, where it was still called
ns_server_dumpdb(). The orignal reasoning is not preserved, but it could
have been also a simple copy-paste mistake, as there are commands, which
return 'void' and require manually setting 'result = ISC_R_SUCCESS;', as
it was done here. Anyway, named will now return the actual result, and
'rndc' will report an error, when the 'dumpdb' command fails.

(cherry picked from commit 8b866ba8a0bd79addbeebb74919b63b8dbc21737)

bin/named/control.c

index 6dd41064c262f037a7e295216db954b2eb1a71cc..c91b79a60f90ec6b0c35f328f6d41e9c181fa709 100644 (file)
@@ -210,8 +210,7 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
        {
                result = named_server_dnstap(named_g_server, lex, text);
        } else if (command_compare(command, NAMED_COMMAND_DUMPDB)) {
-               named_server_dumpdb(named_g_server, lex, text);
-               result = ISC_R_SUCCESS;
+               result = named_server_dumpdb(named_g_server, lex, text);
        } else if (command_compare(command, NAMED_COMMAND_DUMPSTATS)) {
                result = named_server_dumpstats(named_g_server);
        } else if (command_compare(command, NAMED_COMMAND_FETCHLIMIT)) {