bind9/bin/tests
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
..
startperf Reformat shell scripts with shfmt 2023-10-26 13:05:00 +02:00
system Fix swapped arguments in redirect2() single-label branch 2026-04-30 07:08:47 +02:00
testdata/wire move all optional tests from bin/tests to bin/tests/optional 2018-03-09 14:12:47 -08:00
.gitignore Refactor TLSDNS module to work with libuv/ssl directly 2021-01-25 09:19:22 +01:00
convert_trs_to_junit.py Rename Python files to adhere to the snake-case convention 2026-02-25 12:10:20 +00:00
Makefile.am Rename Python files to adhere to the snake-case convention 2026-02-25 12:10:20 +00:00
test_client.c Remove redundant parentheses from the return statement 2024-11-19 16:06:16 +01:00
test_server.c Remove redundant parentheses from the return statement 2024-11-19 16:06:16 +01:00
wire_test.c Finalize removal of memory debug flags size and mctx 2025-02-17 16:48:43 +00:00