]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Prevent useless logging in the "tcp" system test
authorMichał Kępień <michal@isc.org>
Wed, 28 Apr 2021 05:56:47 +0000 (07:56 +0200)
committerMichał Kępień <michal@isc.org>
Wed, 28 Apr 2021 06:36:56 +0000 (08:36 +0200)
The regression test for CVE-2020-8620 causes a lot of useless messages
to be logged.  However, globally decreasing the log level for the
affected named instance would be a step too far as debugging information
may be useful for troubleshooting other checks in the "tcp" system test.
Starting a separate named instance for a single check should be avoided
when possible and thus is also not a good solution.  As a compromise,
run "rndc trace 1" for the affected named instance before starting the
regression test for CVE-2020-8620.

(cherry picked from commit 17e5c2a50e693b7f01eddad4f8bdd4828d1050ed)

bin/tests/system/tcp/tests.sh

index 78d860980718b94ed4ec99a21ef245323689c639..4c6b22b17c7bef7f32f678197a917c5d9186895a 100644 (file)
@@ -184,9 +184,15 @@ grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
 
+####################################################
+# NOTE: The next test resets the debug level to 1. #
+####################################################
+
 n=$((n + 1))
 echo_i "checking that BIND 9 doesn't crash on long TCP messages ($n)"
 ret=0
+# Avoid logging useless information.
+rndccmd 10.53.0.1 trace 1 || ret=1
 { $PERL ../packet.pl -a "10.53.0.1" -p "${PORT}" -t tcp -r 300000 1996-alloc_dnsbuf-crash-test.pkt || ret=1 ; } | cat_i
 dig_with_opts +tcp @10.53.0.1 txt.example > dig.out.test$n || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi