diff --git a/CHANGES b/CHANGES index 4b8db33e57..8befc560d4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4384. [bug] Change 4256 accidentally disabled logging of the + rndc command. [RT #42654] + 4383. [bug] Correct spelling error in stats channel description of "EDNS client subnet option received". [RT #42633] diff --git a/bin/named/control.c b/bin/named/control.c index 75fc278334..d947ebbfca 100644 --- a/bin/named/control.c +++ b/bin/named/control.c @@ -147,7 +147,7 @@ ns_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly, isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_CONTROL, log_level, "rejecting restricted control channel " - "command '%s'", command); + "command '%s'", cmdline); result = ISC_R_FAILURE; goto cleanup; } @@ -155,7 +155,7 @@ ns_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly, isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_CONTROL, log_level, "received control channel command '%s'", - command); + cmdline); if (command_compare(command, NS_COMMAND_RELOAD)) { result = ns_server_reloadcommand(ns_g_server, lex, text); diff --git a/bin/tests/system/rndc/tests.sh b/bin/tests/system/rndc/tests.sh index 232dde7d59..3b9f7453b7 100644 --- a/bin/tests/system/rndc/tests.sh +++ b/bin/tests/system/rndc/tests.sh @@ -481,7 +481,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo "I:test rndc status shows running on ($n)" ret=0 -$RNDC -s 10.53.0.5 -p 9953 -c ../common/rndc.conf status > rndc.output.test$n /dev/null 2>&1 || ret=1 +$RNDC -s 10.53.0.5 -p 9953 -c ../common/rndc.conf status > rndc.output.test$n 2>&1 || ret=1 grep "^running on " rndc.output.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -533,6 +533,14 @@ grep "NOERROR" dig.out.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo " I:failed"; fi status=`expr $status + $ret` +n=`expr $n + 1` +echo "I:verify that the full command is logged ($n)" +ret=0 +$RNDCCMD null with extra arguments > /dev/null 2>&1 +grep "received control channel command 'null with extra arguments'" ns2/named.run > /dev/null || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + mv ns6/named.conf.save ns6/named.conf sleep 1 $RNDC -s 10.53.0.6 -p 9953 -c ../common/rndc.conf reconfig > /dev/null || ret=1