bind9/bin/tests/system/redirect
Ondřej Surý f7cd00f1ef Fix swapped arguments in redirect2() single-label branch
For a query whose qname is the root, the labels==1 branch in
redirect2() called dns_name_copy(redirectname, view->redirectzone)
with arguments reversed, overwriting the view-global
nxdomain-redirect target with the empty redirectname rather than
copying the configured target into the per-query lookup name.  After
the corruption, view->redirectzone names the root, so
dns_name_issubdomain() makes redirect2() short-circuit for every
subsequent query and the nxdomain-redirect feature stops working
until named is restarted.

Triggering this needs the resolver to receive an NXDOMAIN for the
root from upstream, which does not happen in normal DNS operation.

Swap the arguments to match the dns_name_copy(source, dest)
signature.  Add a system test that issues a root query through the
nxdomain-redirect resolver and verifies the redirect feature still
works for a normal NXDOMAIN-producing query afterwards.

Assisted-by: Claude:claude-opus-4-7
(cherry picked from commit c62f24f7ee)
2026-04-30 07:08:47 +02:00
..
conf Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
ns1 Reformat shell scripts with shfmt 2023-10-26 13:05:00 +02:00
ns2 Rename system test directory with common files to _common 2023-09-19 14:56:12 +02:00
ns3 Checking nxdomain-redirect against built-in RFC-1918 zone 2024-03-28 13:15:45 +01:00
ns4 Remove licensing header check for root.hint[s] 2026-04-28 15:58:18 +01:00
ns5 Reformat shell scripts with shfmt 2023-10-26 13:05:00 +02:00
ns6 explicitly set dnssec-validation in system tests 2023-06-26 15:03:06 -07:00
setup.sh Reformat shell scripts with shfmt 2023-10-26 13:05:00 +02:00
tests.sh Fix swapped arguments in redirect2() single-label branch 2026-04-30 07:08:47 +02:00
tests_sh_redirect.py Replace clean.sh files with extra_artifacts mark 2024-11-11 15:04:52 +01:00