bind9/bin/tests/system/redirect
Ondřej Surý c62f24f7ee 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
2026-04-29 21:46:27 +02:00
..
conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
ns1 Remove license headers from test zone files 2026-03-31 17:57:58 +02:00
ns2 Remove license headers from test zone files 2026-03-31 17:57:58 +02:00
ns3 Remove license headers from test zone files 2026-03-31 17:57:58 +02:00
ns4 Remove licensing header check for root.hint[s] 2026-04-28 15:37:10 +01:00
ns5 Remove license headers from test zone files 2026-03-31 17:57:58 +02:00
ns6 Remove license headers from test zone files 2026-03-31 17:57:58 +02:00
setup.sh Replace .in with .j2 templates for simple copy_setports cases 2025-12-09 14:23:14 +01:00
tests.sh Fix swapped arguments in redirect2() single-label branch 2026-04-29 21:46:27 +02:00
tests_sh_redirect.py Replace clean.sh files with extra_artifacts mark 2024-11-08 10:54:24 +01:00