bind9/lib
Ondřej Surý 36897a0872 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:38:57 +02:00
..
dns Size HMAC key generation buffers to the maximum block size 2026-04-30 06:00:07 +02:00
isc Fix INSIST copy-paste error checking RADIX_V4 instead of RADIX_V6 2026-03-30 19:01:29 +02:00
isccc Remove redundant parentheses from the return statement 2024-11-19 14:26:52 +01:00
isccfg Fix KASP key leaks on keystore lookup failure 2026-03-16 11:05:03 +01:00
ns Fix swapped arguments in redirect2() single-label branch 2026-04-30 07:38:57 +02:00
.gitignore The isc/platform.h header has been completely removed 2021-07-06 05:33:48 +00:00
Makefile.am Move irs_resconf into libdns and remove libirs 2023-02-24 09:38:59 +00:00