Commit graph

44114 commits

Author SHA1 Message Date
Colin Vidal
a72b8a1a60 remove global named defaults parser
Remove the global named defaults parser. Instead, a parser is created
during the execution time of named_config_parsedefaults(). This
simplifies the API (no parser to pass around) and the life-cycle of the
default configuration tree (it doesn't depends on a parser instance).
2025-10-23 13:00:02 -07:00
Colin Vidal
7706f5acec remove parser context field from cfg_obj_t
cfg_obj_t doesn't store a pointer to its a parser context anymore,
and does not depend on the parser's lifecycle. Instead, it stores a
reference to its own memory context (and in principle, each node
could have different memory context). This also slightly simplifies
the _destroy API as there is no need to pass a context through it
anymore.
2025-10-23 12:59:58 -07:00
Colin Vidal
0d8c4044ab cfg_obj_t file is now a refcounted string
In order to reduce the lifecycle dependency of a `cfg_obj_t` on its
parser, the `file` field needs its own reference count, so it isn't
deleted when the parser is.  It is now stored as a subsidiary
`cfg_obj_t` object of type string.
2025-10-23 10:57:45 -07:00
Štěpán Balážik
09ad0ded75 chg: test: Use isctest.asyncserver in the "nsupdate" test
Reimplement the custom server written in Perl in Python using the AsyncDnsServer class.

Merge branch 'stepan/nsupdate-asyncserver' into 'main'

See merge request isc-projects/bind9!10915
2025-10-23 12:25:56 +00:00
Štěpán Balážik
99b0cf2dd7 Use isctest.asyncserver in the "nsupdate" test
Reimplement the custom server written in Perl in Python using the
AsyncDnsServer class.
2025-10-23 11:44:20 +00:00
Štěpán Balážik
4042b805ff Enable ignoring TCP connections
Add a TCP connection handler, IgnoreAllConnections that allows
establishing TCP connection but not reading anything from it.

This re-uses the horrible hack from ConnectionReset handler and might
break at any point in the future.

See the comments and e407888507 for more
details.
2025-10-23 11:44:20 +00:00
Michał Kępień
c2a672bbae Merge tag 'v9.21.14' 2025-10-22 18:13:34 +02:00
Michal Nowak
dedc17d1a4 chg: ci: Fail when spatch can't process source code
Sometimes spatch fails to process the source code:

    EXN: Failure("replacement: node 80: {7[1,2,30,31,32] in isc__nm_base64_to_base64url reachable by inconsistent control-flow paths") in ./lib/isc/netmgr/http.c

Closes #5567

Merge branch '5567-spatch-detect-more-error-conditions' into 'main'

See merge request isc-projects/bind9!11115
2025-10-22 13:27:45 +02:00
Michal Nowak
9279806b9e Use DNS_SIGTYPEPAIR instead of DNS_SIGTYPE
After 74fe3db37c, there's no such thing as
DNS_SIGTYPE.
2025-10-22 12:50:55 +02:00
Michal Nowak
d91e8ed575 Use SET_IF_NOT_NULL in isc__nm_base64* 2025-10-22 12:50:55 +02:00
Michal Nowak
6db5b9ee14 Spawn coccinelle CI job when util/check-cocci.sh was touched 2025-10-22 12:50:55 +02:00
Michal Nowak
44d1a97870 Fail when spatch can't process source code
Sometimes spatch fails to process the source code:

    EXN: Failure("replacement: node 80: {7[1,2,30,31,32] in isc__nm_base64_to_base64url reachable by inconsistent control-flow paths") in ./lib/isc/netmgr/http.c
2025-10-22 12:50:55 +02:00
Colin Vidal
a27275d246 new: dev: run individual spatch form check-cocci.sh
Add util/check-cocci.sh support for a command-line argument which is a
path to a spatch file. Running `util/check-cocci.sh` runs all the spatch
in `cocci` folder. Running `util/check-cocci.sh cocci/foo.spatch` only
run the spatch `cocci/foo.spatch`.

Any command line parameters after `--` are forwarded to `spatch`
command, for instance:

`util/check-cocci.sh -- --debug`
`util/check-cocci.sh cocci/foo.spatch -- --debug`

Will (1) run all spatch files in cocci/ with --debug spatch option and
(2) run only `cocci/foo.spatch` with --debug options.

Merge branch 'colin/check-cocci-individual-check' into 'main'

See merge request isc-projects/bind9!11096
2025-10-22 09:16:52 +02:00
Colin Vidal
085bf46a09 run individual spatch form check-cocci.sh
Add util/check-cocci.sh support for a command-line argument which is a
path to a spatch file. Running `util/check-cocci.sh` runs all the spatch
in `cocci` folder. Running `util/check-cocci.sh cocci/foo.spatch` only
run the spatch `cocci/foo.spatch`.

Any command line parameters after `--` are forwarded to `spatch`
command, for instance:

`util/check-cocci.sh -- --debug`
`util/check-cocci.sh cocci/foo.spatch -- --debug`

Will (1) run all spatch files in cocci/ with --debug spatch option and
(2) run only `cocci/foo.spatch` with --debug options.
2025-10-22 08:41:26 +02:00
Mark Andrews
9e8fd9f4d7 fix: test: Fix typo in tools test's shell path
Merge branch 'pspacek/fix-test-typo' into 'main'

See merge request isc-projects/bind9!10939
2025-10-22 16:06:12 +11:00
Petr Špaček
0e770685d6 Fix typo in tools test's shell path 2025-10-22 13:50:08 +11:00
Mark Andrews
5bb4874057 fix: usr: dnssec-verify now uses exit code 1 when failing due to illegal options
Previously, dnssec-verify exited with code 0 if the options could not be parsed. This has been fixed.

Closes #5574

Merge branch '5574-dnssec-verify-uses-exit-code-0-when-failing-due-to-illegal-option' into 'main'

See merge request isc-projects/bind9!11106
2025-10-22 13:21:52 +11:00
Mark Andrews
ac3fba068e dnssec-verify now returns failure on bad arguments 2025-10-22 12:45:03 +11:00
Mark Andrews
8c2285fca6 fix: usr: Fix dnssec-keygen key collision checking for KEY rrtype keys
The :iscman:`dnssec-keygen` utility program failed to detect
possible Key ID collisions with the existing keys generated
using the non-default ``-T KEY`` option (e.g. for ``SIG(0)``).
This has been fixed.

Closes #5506

Merge branch '5506-dnssec-keygen-sig0-keys-collision-fix' into 'main'

See merge request isc-projects/bind9!11047
2025-10-22 12:44:26 +11:00
Mark Andrews
4c5d48926a Don't log spurious error "bad key type" in findmatchingkeys 2025-10-22 09:42:44 +11:00
Aram Sargsyan
49b7ce9a54 Fix dnssec-keygen key collision checking for KEY rrtype keys
When generating a new key, dnssec-keygen checks for possible
key ID collisions with existing keys. The dnssec.c:findmatchingkeys()
function, which is supposed to get the list of the existing keys,
fails to do that for the existing KEY rrtype keys (i.e. generated
using 'dnssec-keygen -T KEY') because it doesn't pass down to the
dst_key_fromnamedfile() -> dst_key_read_public() functions the type
of the keys it's interested in. Fix the issue by introducing a new
function parameter which tells in which type of keys the caller is
currently interested in.
2025-10-22 09:42:43 +11:00
Nicki Křížek
aabe258774 new: test: Add module-specific python setup to system tests
During the system test execution, allow use of module-specific setup()
function in addition to the setup.sh script which this function should
ultimately replace.

The purpose of setup() is two-fold. First, it can execute any commands
needed to create the initial conditions for the test, such as creating
key materials, manipulating files etc. Second, it should return any
test-specific template values as a dictionary. Those will be used to
render the jinja2 templates.

Merge branch 'nicki/pytest-add-python-setup-func' into 'main'

See merge request isc-projects/bind9!10983
2025-10-21 16:04:30 +02:00
Nicki Křížek
377724c26d Use common name for post-startup server functions
Unify the names of autouse module-wide fixtures that perform
after_servers_start() setup. The consistent naming doesn't just help
readability, but also makes it simpler for the vulture exception (since
it doesn't properly deal with autouse fixtures).
2025-10-21 15:07:49 +02:00
Nicki Křížek
fb4345afd4 Use bootstrap() in pytest where applicable
Replace the autouse fixtures which were only used to change the initial
server configuration into proper bootstrap() functions. This gets rid of
an extraneous reconfigure.

In the tests_validation_many_anchors.py, split the fixture into a proper
bootstrap() and a separate test for checking the expected log lines for
the ignored keys. Previously, the test was broken - it should check for
all the messages being present in the log, and some of the keys are
actually initial-key rather than static-key. This has been fixed in the
parametrized test.
2025-10-21 15:07:49 +02:00
Nicki Křížek
7474d38295 Add module-specific python setup to system tests
During the system test execution, allow use of module-specific
bootstrap() function in addition to the setup.sh script which this
function should ultimately replace.

The purpose of bootstrap() is two-fold. First, it can execute any
commands needed to create the initial conditions for the test, such as
creating key materials, manipulating files etc. Second, it should return
any test-specific template values as a dictionary. Those will be used to
render the jinja2 templates.
2025-10-21 15:07:49 +02:00
Petr Špaček
98bddb0fe0 rem: doc: Remove stub chapter about load balancing from ARM
Related: !6610

Merge branch 'pspacek/doc-remove-load-balancing' into 'main'

See merge request isc-projects/bind9!11117
2025-10-21 09:42:12 +00:00
Petr Špaček
485e04aa7e Remove stub chapter about load balancing from ARM
Clearly Support wants this in Knowledge base, so let's comply.

Related: !6610
2025-10-21 09:41:54 +00:00
Michal Nowak
3a55bc1e5f new: ci: Update Clang to version 21
Merge branch 'mnowak/llvm-21' into 'main'

See merge request isc-projects/bind9!10877
2025-10-21 11:10:03 +02:00
Michal Nowak
c56785659e Use clang-format-21 to update formatting 2025-10-21 09:34:29 +02:00
Michal Nowak
6770f3d608 Update Clang to version 21 2025-10-21 09:34:29 +02:00
Evan Hunt
fc1b343357 fix: nil: simplify dns_dumpctx API
the functions dns_dumpctx_db() and dns_dumpctx_version() are used in
only one place, to get the serial number of the version being dumped.
it's simpler to expose the serial number through its own call,
dns_dumpctx_serial(), and remove the others.

Merge branch 'each-cleanup-dumpctx' into 'main'

See merge request isc-projects/bind9!10937
2025-10-21 04:58:27 +00:00
Evan Hunt
34314915e2 simplify dns_dumpctx API
the functions dns_dumpctx_db() and dns_dumpctx_version() are used in
only one place, to get the serial number of the version being dumped.
it's simpler to expose the serial number through its own call,
dns_dumpctx_serial(), and remove the others.
2025-10-20 17:48:18 -07:00
Mark Andrews
2ffb16c436 fix: nil: Fix parse_dnskey in bin/dnssec/dnssec-ksr.c was failing to reset comments
If dns_name_fromtext failed or the subsequent dns_name_compare
failed the lexer's comments state wasn't cleaned up.

Closes #5581

Merge branch '5581-parse_dnskey-in-lib-dns-skr-c-was-failing-to-reset-comments' into 'main'

See merge request isc-projects/bind9!11109
2025-10-20 11:31:22 +11:00
Mark Andrews
a949184eb7 Fix parse_dnskey in bin/dnssec/dnssec-ksr.c was failing to reset comments
If dns_name_fromtext failed or the subsequent dns_name_compare
failed the lexer's comments state wasn't cleaned up.
2025-10-20 10:54:32 +11:00
Štěpán Balážik
9e3ab1b538 fix: ci: Delete tarball after unpacking in CI jobs
This was overlooked in Meson migration.

Merge branch 'stepan/delete-tarball-after-unpacking' into 'main'

See merge request isc-projects/bind9!11111
2025-10-19 19:46:56 +00:00
Štěpán Balážik
23d8d7788e Delete tarball after unpacking in CI jobs
This was overlooked in Meson migration.
2025-10-19 19:46:40 +00:00
Colin Vidal
54d7198a1a chg: dev: mem: checkfree assertion after debug list dump
When a memory context is destroyed, if the `checkfree` property is set,
the program assert there is no remaining allocation. If there are and
assertions are enabled, the program immediately stops.

However, if memory trace/record debug is enabled, the dump of
outstanding allocation won't be printed as it is done after the
no remaining allocation assertion check.

This moves the no remaining allocation assertion check after the dump of
outstanding allocations, so it is still possible to figure out what's
still allocated by this memory context.

Merge branch 'colin/mem-checkfree-check-after-debuglist' into 'main'

See merge request isc-projects/bind9!11110
2025-10-19 10:38:18 +02:00
Colin Vidal
c50ace654d check memory context validity before mem_destory
Add a magic number check to ensure the memory context validity before
destorying it.

This check is needed now as it was done before implicitly when
isc_mem_inuse was called, but isc_mem_inuse is now called later (to be
able to dump the outstanding allocations).
2025-10-19 09:05:09 +02:00
Colin Vidal
9f4ff7dec4 mem: checkfree assertion after debug list dump
When a memory context is destroyed, if the `checkfree` property is set,
the program assert there is no remaining allocation. If there are and
assertions are enabled, the program immediately stops.

However, if memory trace/record debug is enabled, the dump of
outstanding allocation won't be printed as it is done after the
no remaining allocation assertion check.

This moves the no remaining allocation assertion check after the dump of
outstanding allocations, so it is still possible to figure out what's
still allocated by this memory context.
2025-10-19 09:05:09 +02:00
Michał Kępień
537824f32e
Update BIND version for release 2025-10-18 11:48:52 +02:00
Michał Kępień
4c4dae53b8 new: doc: Prepare documentation for BIND 9.21.14
Merge branch 'michal/prepare-documentation-for-bind-9.21.14' into 'v9.21.14-release'

See merge request isc-private/bind9!867
2025-10-18 11:46:04 +02:00
Nicki Křížek
363416443b
Remove reuse annotations for unused m4 libtool files
The files in question are no longer included in the git tree and
distributed with the code. Remove the reuse annotations as they caused
issues with reuse 6.0.0, as multiline annotation for
SPDX-FileCopyrightText breaks the parsing.

(cherry picked from commit e77f349240)
2025-10-18 09:47:28 +02:00
Michał Kępień
3ecab35af6
Prepare release notes for BIND 9.21.14 2025-10-18 09:47:28 +02:00
Michał Kępień
a63db9857c
Prepare changelog for BIND 9.21.14 2025-10-18 09:47:28 +02:00
Michał Kępień
a78f847fc8 fix: usr: Fix the assertion failure in the selfsigned DNSKEY handling
The selfsigned_dnskey() function can now return all the return codes
that dns_dnssec_keyfromrdata() can return and this would cause an
assertion failure as we were not expecting new isc_result_t codes.

Closes isc-projects/bind9#5343

Merge branch 'ondrej/security-fix-crash-in-selfsigned-key-handling' into 'v9.21.14-release'

See merge request isc-private/bind9!865
2025-10-18 09:39:35 +02:00
Evan Hunt
0caba8e9ce fix: usr: Report when a zone reload is already in progress
If a zone reload was already in progress when `rndc reload <zone>` was
run, the message returned was "zone reload queued", which was technically
correct, but it was identical to the message returned when a reload
was not in progress. Consequently, a user could issue two reload commands
without realizing that only one reload had actually taken place. This has
been addressed by changing the message returned to "zone reload was already queued".

Closes #5140

Merge branch '5140-report-reload-in-progress' into 'main'

See merge request isc-projects/bind9!10849
2025-10-17 20:36:32 +00:00
Evan Hunt
43f53b5010 report when zone reload already in progress
if a zone reload is already in progress when 'rndc reload <zone>' is
run, currently the message returned in "zone reload queued", which
is correct, but it's identical to the message returned when a reload
was *not* in progress, so the user can't easily tell what happened.
a user could reload a zone twice and not realize that only one
reload actually took place.

this has been addressed by changing the message returned to
"zone reload was already queued".

a new result code ISC_R_LOADING has been added to signal this
condition, taking the place of ISC_R_RELOAD, which was obsolete
and has been removed.
2025-10-17 20:36:18 +00:00
Colin Vidal
82a150adca fix: test: fix random failure on synthrecord system test
One of the synthrecord system tests uses a test function to generate an expected name based on some randomly generated IPv6 (using Hypothesis). Turns out the test function generating the name didn't handle the case where the label which encodes the IPv6 could have a leading or trailing '-' character. (The plugin needs to add a leading or trailing 0 so as not to break IDN compatibility.)

Merge branch 'colin/fix-synthrecord-v6test' into 'main'

See merge request isc-projects/bind9!11073
2025-10-17 22:08:54 +02:00
Colin Vidal
2b4825dbad fix random failure on synthrecord system test
One of the synthrecord system tests uses a test function to generate an
expected name based on some randomly generated IPv6 (using Hypothesis).
Turns out the test function generating the name didn't handle the case
where the label which encodes the IPv6 could have a leading or trailing
'-' character. (The plugin needs to add a leading or trailing 0 so as
not to break IDN compatibility.)
2025-10-17 12:28:04 -07:00
Ondřej Surý
7b26176c46
Fix the assertion failure in the selfsigned DNSKEY handling
The selfsigned_dnskey() function can now return all the return codes
that dns_dnssec_keyfromrdata() can return and this would cause an
assertion failure as we were not expecting new isc_result_t codes.
2025-10-17 14:39:43 +02:00