]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 months agoeffective config: specific view cases
Colin Vidal [Thu, 16 Oct 2025 14:33:51 +0000 (16:33 +0200)] 
effective config: specific view cases

User specified views don't override default views. In particular, the
_bind/CH view is still active. However, the order is important: if the
user defines a foo/CH view, it must be able to override _bind/CH by
matching clients first (this is how the view is documented).

The server configuration code is now simpler; it only has to build the
views based on the effective view list, and only creates the _default
view if there are no explicit views created by the user.

6 months agoeffective config: specific options/acl cases
Colin Vidal [Thu, 16 Oct 2025 14:26:06 +0000 (16:26 +0200)] 
effective config: specific options/acl cases

Implement the specific rules of ACL inheritance when buiding the
effective configuration. As those rules are directly implemented in the
configuration tree, they are removed from `apply_configuation`.

6 months agoadd cfg_effective_config() API
Colin Vidal [Thu, 16 Oct 2025 13:48:05 +0000 (15:48 +0200)] 
add cfg_effective_config() API

Add the entry point of the logic to merge the user and the default
configuration, called cfg_effective_config(). This function takes a user
configuration and a default configuration. It internally clones the user
configuration tree, then walks through the clauses recursively applying
default values if they are missing.

The newly built configuration tree, called the effective configuration
tree, is then returned.

Currently this is just the basic mechanism which is implemented (i.e.
enable to walk from clause to clause, goes into a nested clause, and so
on). The next commits will introduce the implementation of
clause-specific merge functions in order to preserve the existing
named.conf semantics.

6 months agoadd an optional merge method on cfg_clausedef_t
Colin Vidal [Thu, 16 Oct 2025 13:30:23 +0000 (15:30 +0200)] 
add an optional merge method on cfg_clausedef_t

In order to handle specific cases when merging configurations (i.e.
some specific clauses which require specific handling, not just
overriding values for instance), the cfg_clausedef_t includes an
optional merge method.

The merge function is NULL by default. If it is defined for a given
clause, and this clause is defined in both the user and default
configurations, the merge function is then called with both the user and
default clause instances. It's up the the implementation of that function
do to anything needed to keep the correct named.conf semantic.

6 months agoadd helper API calls to manipulate maps and lists
Colin Vidal [Thu, 16 Oct 2025 12:54:24 +0000 (14:54 +0200)] 
add helper API calls to manipulate maps and lists

cfg_map_addclone() is a variant of cfg_map_add which internally clones
an object and adds it to a map. It ensures that the object is an
implicit list if the map clause has the CFG_CLAUSEFLAG_MULTI set

cfg_list_addclone() clones a list (internally cloning each individual
element) and appends or preprends it to an existing target list.

Both of these will be needed to merge the default configuration
with the user configuration.

6 months agoparser firstclause/nextclause API changes
Colin Vidal [Thu, 16 Oct 2025 12:38:48 +0000 (14:38 +0200)] 
parser firstclause/nextclause API changes

In order to make upcoming configuration tree changes easier, the
cfg_map_firstclause() and _nextclause() functions have been changed
to return the clause itself rather than only the clause name.

6 months agomove default configuration to common bin/include folder
Colin Vidal [Thu, 16 Oct 2025 12:11:37 +0000 (14:11 +0200)] 
move default configuration to common bin/include folder

Two programs need to be able to provide the effective configuration:
named (through a future rndc command) and named-checkconf (though a
future command line switch). In order to calculate the effective
configuration from named-checkconf, the default configuration
needs to be accessible.

The default configuration has now been moved from bin/named/config.c
into a common include directory for binaries: bin/include/defaultconfig.h.

6 months agofix: nil: set cfgmaps correctly alessio/checkpoint-pre-effective-config
Evan Hunt [Wed, 29 Oct 2025 20:24:56 +0000 (20:24 +0000)] 
fix: nil: set cfgmaps correctly

A typo in MR !11165 caused `cfgmaps` to be set with only the top-level
configuration, not the view configuration.

Merge branch 'each-fix-cfgmaps' into 'main'

See merge request isc-projects/bind9!11173

6 months agoset cfgmaps correctly
Evan Hunt [Wed, 29 Oct 2025 19:45:31 +0000 (12:45 -0700)] 
set cfgmaps correctly

a typo in MR !11165 caused cfgmaps to be set with only the top-level
configuration, not the view configuration.

6 months agofix: dev: fix configuration bugs involving global defaults
Evan Hunt [Wed, 29 Oct 2025 18:28:45 +0000 (18:28 +0000)] 
fix: dev: fix configuration bugs involving global defaults

The configuration code for the `max-cache-size`, `dnssec-validation`, and `response-padding` options were unnecessarily complicated, and in the case of `max-cache-size`, buggy. These have been fixed. The `optionmaps` variable in `configure_view()` is no longer needed and has been removed.

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

See merge request isc-projects/bind9!11165

6 months agofix "response-padding" configuration and remove optionmaps
Evan Hunt [Wed, 29 Oct 2025 01:45:25 +0000 (18:45 -0700)] 
fix "response-padding" configuration and remove optionmaps

Add a default "response-padding" option in the global defaults,
to disable the option, and simplify the configuration code so that
looks at the global defaults if the option is not set in named.conf.

This enables us to remove the 'optionmaps' variable in configure_view(),
which was used for options that only look in named.conf.

6 months agosimplify "dnssec-validation" configuration
Evan Hunt [Wed, 29 Oct 2025 01:34:55 +0000 (18:34 -0700)] 
simplify "dnssec-validation" configuration

In the past, "dnssec-validation" was not looked up in the global
defaults unless "dnssec-enable" was true. "dnssec-enable" has been
obsolete for several years, but dnssec-validation was still being
configured in two steps.  This commit removes the vestigial bits of
the old logic.

6 months agofix a "max-cache-size" configuration bug
Evan Hunt [Wed, 29 Oct 2025 01:28:35 +0000 (18:28 -0700)] 
fix a "max-cache-size" configuration bug

"max-cache-size default;" is allowed, according to the documentation
and the parser, but when it's configured, named crashes due to an
INSIST that the only legal string value is "unlimited". this has
been fied.

the configuration has also been simplified. previously, we checked for
max-cache-size in view and options, then determined whether to look in
the global default options based on whether the view had recursion set.
the default value set there was only applicable to views with recursion.
now, the default is an explicit "default", which affects views with
and without recursion in different ways.

the cfg type for "max-cache-size" has been changed from
cfg_type_sizeorpercent to cfg_type_maxcachesize.

6 months agochg: test: Use isctest.asyncserver in the "statistics" test
Štěpán Balážik [Wed, 29 Oct 2025 17:45:14 +0000 (17:45 +0000)] 
chg: test: Use isctest.asyncserver in the "statistics" test

Reimplement the custom server using the asyncserver Python module.

Behavior change: The new server doesn't copy CD and DO flags and a client cookie to responses.

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

See merge request isc-projects/bind9!10928

6 months agoUse isctest.asyncserver in the "statistics" test
Štěpán Balážik [Tue, 2 Sep 2025 10:39:33 +0000 (12:39 +0200)] 
Use isctest.asyncserver in the "statistics" test

Reimplement the custom server using the asyncserver Python module.

Behavior change: The new server doesn't copy CD and DO flags and a
client cookie to responses.

6 months agoAdd a response handler matching on specific QNAMEs
Michał Kępień [Thu, 18 Sep 2025 08:13:13 +0000 (10:13 +0200)] 
Add a response handler matching on specific QNAMEs

Add a new ResponseHandler subclass, QnameHandler, which enables
conveniently matching specific QNAMEs (without also matching their
subdomains like DomainHandler does).

6 months agoAllow users of AsyncDnsServer to set a default RCODE
Štěpán Balážik [Tue, 2 Sep 2025 10:35:53 +0000 (12:35 +0200)] 
Allow users of AsyncDnsServer to set a default RCODE

This is mostly for cases where no zone is set up and all response stubs
come to response handler with REFUSED as RCODE.

This commit allows to override the RCODE before QueryContext is passed
to response handlers.

6 months agochg: test: Use isctest.asyncserver in the "cookie" test
Štěpán Balážik [Wed, 29 Oct 2025 16:06:26 +0000 (16:06 +0000)] 
chg: test: Use isctest.asyncserver in the "cookie" test

Replace the custom DNS servers in the "cookie" system test with new code
based on the isctest.asyncserver module. The convoluted test logic is
split into multiple response handlers which are shared between the two
servers.

Behavior change: returned SOA records have the zone name set properly.

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

See merge request isc-projects/bind9!10691

6 months agoUse isctest.asyncserver in the "cookie" test
Štěpán Balážik [Fri, 4 Jul 2025 08:45:22 +0000 (10:45 +0200)] 
Use isctest.asyncserver in the "cookie" test

Replace the custom DNS servers in the "cookie" system test with new code
based on the isctest.asyncserver module. The convoluted test logic is
split into multiple response handlers which are shared between the two
servers.

Behavior change: returned SOA records have the zone name set properly.

6 months agochg: test: Use isctest.asyncserver in the "rpzrecurse" test
Štěpán Balážik [Wed, 29 Oct 2025 14:45:35 +0000 (14:45 +0000)] 
chg: test: Use isctest.asyncserver in the "rpzrecurse" test

Replace the custom server with new implementation using the
AsyncDnsServer class.

Behavior changes:
- DNS cookie is not copied to the responses.
- CD, DO flags aren't set on responses.

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

See merge request isc-projects/bind9!10916

6 months agoUse isctest.asyncserver in the "rpzrecurse" test
Štěpán Balážik [Sat, 30 Aug 2025 15:07:23 +0000 (17:07 +0200)] 
Use isctest.asyncserver in the "rpzrecurse" test

Replace the custom server with new implementation using the
AsyncDnsServer class.

Behavior changes:
- DNS cookie is not copied to the responses.
- CD, DO flags aren't set on responses.

6 months agochg: test: Use isctest.asyncserver in the "dnssec" test
Štěpán Balážik [Wed, 29 Oct 2025 13:56:15 +0000 (13:56 +0000)] 
chg: test: Use isctest.asyncserver in the "dnssec" test

Reimplement the custom server using isctest.asyncserver. Factor most of
the logic out of the server code to two (identical) zones and only
implement the non-standard behavior.

Behavior changes:
- RRSIG Expiration and Inception is now static and covering the whole
  timeline instead of being calculated everytime.
- NXDOMAIN is returned where suitable by standard.
- Returned SOA records have properly set zone names.

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

See merge request isc-projects/bind9!10906

6 months agoUse isctest.asyncserver in the "dnssec" test
Štěpán Balážik [Wed, 27 Aug 2025 18:50:32 +0000 (20:50 +0200)] 
Use isctest.asyncserver in the "dnssec" test

Reimplement the custom server using isctest.asyncserver. Factor most of
the logic out of the server code to two (identical) zones and only
implement the non-standard behavior.

Behavior changes:
- RRSIG Expiration and Inception is now static and covering the whole
  timeline instead of being calculated everytime.
- NXDOMAIN is returned where suitable by standard.
- Returned SOA records have properly set zone names.

6 months agofix: usr: Fix shutdown INSIST in dns_dispatchmgr_getblackhole
Mark Andrews [Mon, 27 Oct 2025 22:37:00 +0000 (09:37 +1100)] 
fix: usr: Fix shutdown INSIST in dns_dispatchmgr_getblackhole

Previously, `named` could trigger an assertion in `dns_dispatchmgr_getblackhole`
while shutting down. This has been fixed.

Closes #5525

Merge branch '5525-attach-to-dispatchmgr-to-fctx' into 'main'

See merge request isc-projects/bind9!11131

6 months agoFix "shutdown system test crashed in dns_dispatchmgr_getblackhole"
Mark Andrews [Wed, 22 Oct 2025 05:53:46 +0000 (16:53 +1100)] 
Fix "shutdown system test crashed in dns_dispatchmgr_getblackhole"

While shutting down view->dispatchmgr is no longer valid.  Attach
to it and when creates a fetch context and use that pointer instead
of view->dispatchmgr.  Use dns_view_getdispatchmgr to do the attaching
as view->dispatchmgr is it managed using rcu.

6 months agonew: dev: introduce cfg_obj_clone to clone a config tree
Colin Vidal [Mon, 27 Oct 2025 21:15:39 +0000 (22:15 +0100)] 
new: dev: introduce cfg_obj_clone to clone a config tree

Introduce `cfg_obj_clone` which takes a `cfg_obj_t` node and clones it.
it allocates a new node, copies its scalar values and recursively
allocates child nodes, copying their scalar values as well and so on.

Internally, a new method `cfg_copyfunc_t` copy is added in `cfg_rep_t`,
which enables implementing a copy function specific for each
representation type a node can hold.

This is pre-require work for MR !11121 !11122 !11123

Merge branch 'colin/effective-config-clone' into 'main'

See merge request isc-projects/bind9!11124

6 months agoadd unit test for cfg_obj_clone
Colin Vidal [Tue, 30 Sep 2025 14:09:03 +0000 (16:09 +0200)] 
add unit test for cfg_obj_clone

Add a unit test for `cfg_obj_clone` to verify that the cloned tree
indeed has independent child nodes. The test also verifies that the
clone is semantically correct by comparing a text dump of the original
tree and the cloned one.

6 months agointroduce cfg_obj_clone to clone a config tree
Colin Vidal [Tue, 30 Sep 2025 10:41:32 +0000 (12:41 +0200)] 
introduce cfg_obj_clone to clone a config tree

Introduce `cfg_obj_clone` which takes a `cfg_obj_t` node and clones it.
it allocates a new node, copies its scalar values and recursively
allocates child nodes, copying their scalar values as well and so on.

Internally, a new method `cfg_copyfunc_t` copy is added in `cfg_rep_t`,
which enables implementing a copy function specific for each
representation type a node can hold.

6 months agofix: nil: Remove unnecessary NULL checks causing Coverity warnings
Mark Andrews [Mon, 27 Oct 2025 20:05:27 +0000 (07:05 +1100)] 
fix: nil: Remove unnecessary NULL checks causing Coverity warnings

In cfg_parse_buffer and cfg_parse_file 'pctx' was being checked
for being non-NULL when it was guaranteed to be non-NULL.  This
raised Coverity issues ID 637688 and ID 637689.

Closes #5599

Merge branch '5599-remove-unnecessary-null-checks' into 'main'

See merge request isc-projects/bind9!11154

6 months agoRemove unnecessary NULL checks in parser.c
Mark Andrews [Sun, 26 Oct 2025 23:35:35 +0000 (10:35 +1100)] 
Remove unnecessary NULL checks in parser.c

In cfg_parse_buffer and cfg_parse_file 'pctx' was being checked
for being non-NULL when it was guarenteed to be non-NULL.  This
raised Coverity issues ID 637688 and ID 637689.

6 months agofix: test: Fix "hooks/conf/good-viewzonelevel.conf.j2 has hard coded library extension"
Mark Andrews [Mon, 27 Oct 2025 19:15:32 +0000 (06:15 +1100)] 
fix: test:  Fix "hooks/conf/good-viewzonelevel.conf.j2 has hard coded library extension"

Use @DYLIB@ instead of hard coded extension "so".

Closes #5600

Merge branch '5600-fix-hooks-conf-good-viewzonelevel-conf-j2' into 'main'

See merge request isc-projects/bind9!11156

6 months agoFix "good-viewzonelevel.conf.j2 has hard coded library extension"
Mark Andrews [Mon, 27 Oct 2025 00:15:18 +0000 (11:15 +1100)] 
Fix "good-viewzonelevel.conf.j2 has hard coded library extension"

Use @DYLIB@ instead of hard coded extension "so".

6 months agonew: ci: Add tarball publication process to pipeline
Andoni Duarte [Mon, 27 Oct 2025 15:51:58 +0000 (15:51 +0000)] 
new: ci: Add tarball publication process to pipeline

Tarball uploading steps are to be included in the pipeline.

They are manual jobs that:

1. uploads a release tarball prepared by the "sign" job.
2. publish a previously staged release to a destination.
3. publishes a previously staged release to a well-known URL.

A template has been included since all three follow the same pattern.
Besides, rules commonly used by tag pipeline jobs.

Merge branch 'andoni/ci-release-process' into 'main'

See merge request isc-projects/bind9!11158

6 months agoDeduplicate triggering rules for tag pipeline jobs
Michał Kępień [Mon, 27 Oct 2025 04:15:09 +0000 (05:15 +0100)] 
Deduplicate triggering rules for tag pipeline jobs

Define and use more YAML anchors for triggering rules commonly used by
tag pipeline jobs.  This builds on top of the work done in commit
675d9c74251fee8ec034e87bdd43e7da97119a5d, improving readability and
reuse.

6 months agoAdd the "publish" job
Andoni Duarte Pintado [Thu, 23 Oct 2025 13:13:00 +0000 (15:13 +0200)] 
Add the "publish" job

Add a new SSH-confirmed GitLab CI job that publishes a previously staged
release to a well-known URL.  The details of what specifically this
entails are controlled by the staging environment.

6 months agoAdd the "publish-private" job
Andoni Duarte Pintado [Fri, 17 Oct 2025 07:52:45 +0000 (09:52 +0200)] 
Add the "publish-private" job

Add a new SSH-confirmed GitLab CI job that publishes a previously staged
release to a destination that is not a well-known URL.  The details of
what specifically this entails are controlled by the staging
environment.

6 months agoAdd the "staging" job
Andoni Duarte Pintado [Tue, 16 Sep 2025 15:10:44 +0000 (17:10 +0200)] 
Add the "staging" job

Add a new SSH-confirmed GitLab CI job that uploads a release tarball
prepared by the "sign" job to a staging environment specified using CI
variables.

6 months agoRework the "sign" job
Michał Kępień [Wed, 22 Oct 2025 07:45:29 +0000 (09:45 +0200)] 
Rework the "sign" job

Adapt the "sign" job to use the YAML template for SSH-confirmed jobs.
Make the signing process user-agnostic.

6 months agoAdd a template for SSH-confirmed jobs
Michał Kępień [Wed, 22 Oct 2025 07:45:29 +0000 (09:45 +0200)] 
Add a template for SSH-confirmed jobs

Add a YAML template for jobs that require an SSH connection to a
dedicated, locked-down runner for signing off on sensitive operations
(e.g. signing, publishing).

These jobs all follow a similar scheme:

 1. Runner prepares the necessary files in a well-known location (/tmp).
 2. Runner generates a shell script to be run by an authorized user.
 3. Runner sleeps while waiting for a signal that the script was run.
 4. Authorized user logs in to the runner over SSH and runs the script.
 5. Runner collects the relevant files and logs as job artifacts.

One additional complication is that each of the above steps needs to be
carried out under the assumption that GitLab Runner is running under a
different user account than the one used for logging in over SSH,
necessitating careful file permission handling.

Having a YAML template for jobs that need to follow the above scheme
significantly improves readability and reuse as each job only needs to
define (via the "variables" YAML key):

  - SSH_SCRIPT_RUNNER_PRE: the code the runner should execute before an
    authorized user logs in over SSH (typically: setting up files in a
    well-known location),

  - SSH_SCRIPT_CLIENT: contents of the shell script to be run by an
    authorized user,

  - SSH_SCRIPT_RUNNER_POST: the code the runner should execute after an
    authorized user runs the script over SSH (typically: artifact
    collection and cleanup).

6 months agoRevise release directory naming
Michał Kępień [Wed, 22 Oct 2025 07:45:29 +0000 (09:45 +0200)] 
Revise release directory naming

Include the Git tag in the name of the release directory rather than
just the version number.  Revise the script for the "release" job
accordingly.  This enables using the $CI_COMMIT_TAG variable in job
scripts without the need to resort to string manipulation to strip the
leading "v", improving readability.  The only place where string
manipulation is applied to the Git tag is now the "release" job itself,
to verify that the Git tag matches the version number embedded in the
source tarball name.

6 months agofix: test: test-syncplugin.c:plugin_register was broken
Mark Andrews [Mon, 27 Oct 2025 12:46:39 +0000 (23:46 +1100)] 
fix: test: test-syncplugin.c:plugin_register was broken

The variables example2com, example3com, and example4com where not
being initalised on all paths leading to Coverity issues ID 637690,
ID 637691 and ID 637692 being raised.  In addition the tests to free
them were wrong as they depended on the unintialised variables. This
has been fixed.

Closes #5598

Merge branch '5598-properly-determine-if-name-is-dynamic' into 'main'

See merge request isc-projects/bind9!11155

6 months agotest-syncplugin.c:plugin_register was broken
Mark Andrews [Mon, 27 Oct 2025 00:07:35 +0000 (11:07 +1100)] 
test-syncplugin.c:plugin_register was broken

The variables example2com, example3com, and example4com where not
being initalised on all paths leading to Coverity issues ID 637690,
ID 637691 and ID 637692 being raised.  In addition the tests to free
them were wrong as they depended on the unintialised variables. This
has been fixed.

6 months agochg: dev: Stop prettifying JSON statistics
Michał Kępień [Mon, 27 Oct 2025 09:57:58 +0000 (10:57 +0100)] 
chg: dev: Stop prettifying JSON statistics

Passing the JSON_C_TO_STRING_PRETTY flag to
json_object_to_json_string_ext() makes the latter produce prettified
JSON output.  This results in a huge amount of redundant whitespace
being inserted into each HTTP response (whitespace amounts to about 40%
of the entire JSON payload).

The bandwidth cost can be amortized by enabling HTTP compression on the
client side ("Accept-Encoding: deflate"), but that does not affect the
size of data at rest.

Use the JSON_C_TO_STRING_PLAIN flag instead of JSON_C_TO_STRING_PRETTY
to minimize the size of JSON responses sent via the statistics channel.
External tools should be used for prettifying JSON data.

Closes #3304

Merge branch '3304-stop-prettifying-json-statistics' into 'main'

See merge request isc-projects/bind9!10786

6 months agoStop prettifying JSON statistics
Michał Kępień [Mon, 27 Oct 2025 09:56:38 +0000 (10:56 +0100)] 
Stop prettifying JSON statistics

Passing the JSON_C_TO_STRING_PRETTY flag to
json_object_to_json_string_ext() makes the latter produce prettified
JSON output.  This results in a huge amount of redundant whitespace
being inserted into each HTTP response (whitespace amounts to about 40%
of the entire JSON payload).

The bandwidth cost can be amortized by enabling HTTP compression on the
client side ("Accept-Encoding: deflate"), but that does not affect the
size of data at rest.

Use the JSON_C_TO_STRING_PLAIN flag instead of JSON_C_TO_STRING_PRETTY
to minimize the size of JSON responses sent via the statistics channel.
External tools should be used for prettifying JSON data.

6 months agochg: test: Properly process JSON and XML in tests
Michał Kępień [Sat, 25 Oct 2025 06:00:41 +0000 (08:00 +0200)] 
chg: test: Properly process JSON and XML in tests

Processing JSON and XML using `grep` and `sed` is error-prone, overly
lax in some ways, overly strict in others, and neither accurate nor
expressive.  Use `jq` and `xmllint` with XPath expressions to make
things right in system tests.

See #3304

Merge branch '3304-properly-process-json-and-xml-in-tests' into 'main'

See merge request isc-projects/bind9!10942

6 months agoRemove unused Perl scripts
Michał Kępień [Sat, 25 Oct 2025 05:37:48 +0000 (07:37 +0200)] 
Remove unused Perl scripts

The traffic-json.pl and traffic-xml.pl scripts that were used in the
"statschannel" system test in the past became dead code when commit
1202fd912a1baa9c299f17caf4494bc21234da85 rewrote parts of that test to
Python.  Remove those scripts.

6 months agoRemove unused xmllint-html.sh script
Michał Kępień [Sat, 25 Oct 2025 05:37:48 +0000 (07:37 +0200)] 
Remove unused xmllint-html.sh script

There are no longer any HTML files in the BIND 9 source repository.
Remove the xmllint-html.sh script that was used in the past to check
those for errors.

6 months agoUse xmllint in system tests inspecting XML data
Michał Kępień [Sat, 25 Oct 2025 05:37:48 +0000 (07:37 +0200)] 
Use xmllint in system tests inspecting XML data

Inspecting XML data using sed and grep is error-prone, overly lax in
some ways, overly strict in others, and neither accurate nor expressive.
Use xmllint and XPath expressions for inspecting XML data in the
"statistics", "statschannel", and "synthfromdnssec" system tests to
address these deficiencies.

6 months agoDetect xmllint at build time
Michał Kępień [Sat, 25 Oct 2025 05:37:48 +0000 (07:37 +0200)] 
Detect xmllint at build time

Detect whether and where the xmllint utility is available at build time,
so that it can be used in system tests.  If the tool is not found,
specific checks employing it will be skipped.

6 months agoUse jq in system tests inspecting JSON data
Michał Kępień [Sat, 25 Oct 2025 05:37:48 +0000 (07:37 +0200)] 
Use jq in system tests inspecting JSON data

Inspecting JSON data using grep is error-prone, overly lax in some ways,
overly strict in others, and neither accurate nor expressive.  Use jq
for inspecting JSON data in the "statschannel" and "synthfromdnssec"
system tests to address these deficiencies.

6 months agoDetect jq at build time
Michał Kępień [Sat, 25 Oct 2025 05:37:48 +0000 (07:37 +0200)] 
Detect jq at build time

Detect whether and where the jq utility is available at build time, so
that it can be used in system tests.  If the tool is not found, specific
checks employing it will be skipped.

6 months agochg: dev: Fix assertion failure from arc4random_uniform with invalid limit
Ondřej Surý [Fri, 24 Oct 2025 20:20:51 +0000 (22:20 +0200)] 
chg: dev: Fix assertion failure from arc4random_uniform with invalid limit

When the arc4random_uniform() is called on NetBSD with upper_bound that
makes no sense statistically (0 or 1), the call crashes the calling
program.  Fix this by returning 0 when upper bound is < 2 as does Linux,
FreeBSD and NetBSD.  (Hint: System CSPRNG should never crash.)

Closes #5596

Merge branch '5596-fix-isc_random_uniform-on-NetBSD' into 'main'

See merge request isc-projects/bind9!11147

6 months agoFix assertion failure from arc4random_uniform with invalid limit
Ondřej Surý [Fri, 24 Oct 2025 08:34:33 +0000 (11:34 +0300)] 
Fix assertion failure from arc4random_uniform with invalid limit

When the arc4random_uniform() is called on NetBSD with upper_bound that
makes no sense statistically (0 or 1), the call crashes the calling
program.  Fix this by returning 0 when upper bound is < 2 as does Linux,
FreeBSD and NetBSD.  (Hint: System CSPRNG should never crash.)

6 months agorem: test: Drop the unit test for testing randomness
Ondřej Surý [Fri, 24 Oct 2025 19:17:08 +0000 (21:17 +0200)] 
rem: test: Drop the unit test for testing randomness

Since we are using system routines for randomness, there's no point
in spending time and run the statistical suite for testing PRNG.

Merge branch 'ondrej/drop-random-unit-test' into 'main'

See merge request isc-projects/bind9!11137

6 months agoDrop the unit test for testing randomness
Ondřej Surý [Wed, 22 Oct 2025 16:25:18 +0000 (18:25 +0200)] 
Drop the unit test for testing randomness

Since we are using system routines for randomness, there's no point
in spending time and run the statistical suite for testing PRNG.

6 months agochg: pkg: minimal meson version required is 1.3.0
Michal Nowak [Fri, 24 Oct 2025 16:35:00 +0000 (18:35 +0200)] 
chg: pkg: minimal meson version required is 1.3.0

The minimal required meson version is 1.3.0.

Where distribution repositories don't provide meson 1.3.0 or newer, meson from PyPI may be used instead.

Merge branch 'aydin/meson-bump-version' into 'main'

See merge request isc-projects/bind9!10997

6 months agoadd muon's static analyzer to CI
Aydın Mercan [Mon, 20 Oct 2025 10:42:48 +0000 (13:42 +0300)] 
add muon's static analyzer to CI

Muon features a basic static analyzer that is functional enough to have
caught several meson mistakes.

6 months agoDrop the NO_BUILD_TEST_PREREQ hack
Michal Nowak [Wed, 8 Oct 2025 18:37:24 +0000 (20:37 +0200)] 
Drop the NO_BUILD_TEST_PREREQ hack

With the updated meson, jammy does not need to avoid the
"meson-test-prereq" target.

6 months agoget rid of unused meson variables
Aydın Mercan [Fri, 19 Sep 2025 08:06:07 +0000 (10:06 +0200)] 
get rid of unused meson variables

Found by muon's own static analyzer.

6 months agobump the minimum meson version to 1.3.0
Aydın Mercan [Thu, 18 Sep 2025 11:07:08 +0000 (13:07 +0200)] 
bump the minimum meson version to 1.3.0

After a couple releases, it appears that the minimum version can be
increased without much trouble.

Because meson only requires python 3.7 or greater, most supported
distributions can run a newer meson without having to deal with
additional dependencies or a new python version.

6 months agofix: pkg: fix fuzzing builds
Michal Nowak [Fri, 24 Oct 2025 13:37:36 +0000 (15:37 +0200)] 
fix: pkg: fix fuzzing builds

Previously fuzzing builds were broken due to some typos in the `meson.build`.

Merge branch 'aydin/fuzz-meson-fix' into 'main'

See merge request isc-projects/bind9!11052

6 months agoDrop doh and geoip from pairwise testing exclusion list
Michal Nowak [Wed, 22 Oct 2025 17:27:06 +0000 (19:27 +0200)] 
Drop doh and geoip from pairwise testing exclusion list

doh and geoip features can be part of pairwise testing. Their exclusion
was a misunderstanding.

6 months agofix fuzzing
Aydın Mercan [Fri, 3 Oct 2025 12:37:01 +0000 (15:37 +0300)] 
fix fuzzing

The fuzzing binary builds have been fixed and now is run as a part of
the test suite for sanity checks.

The `oss-fuzz` backend has been made functional with the addition of the
`oss-fuzz-args` option. It allows the setup script to pass the
LIB_FUZZING_ENGINE environment variable to meson.

6 months agofix: dev: Make libcap mandatory on Linux again
Michal Nowak [Fri, 24 Oct 2025 09:24:45 +0000 (11:24 +0200)] 
fix: dev: Make libcap mandatory on Linux again

When refactoring the BIND 9.21 build system to meson, libcap was
unintentionally made optional on Linux.

Closes #5590

Merge branch '5590-make-libcap-mandatory-on-linux-again' into 'main'

See merge request isc-projects/bind9!11136

6 months agoMake libcap mandatory on Linux again
Michal Nowak [Wed, 22 Oct 2025 14:13:27 +0000 (16:13 +0200)] 
Make libcap mandatory on Linux again

When refactoring the BIND 9.21 build system to meson, libcap was
unintentionally made optional on Linux.

6 months agonew: ci: Automatically trigger rebase of -sub branches
Michał Kępień [Fri, 24 Oct 2025 02:47:26 +0000 (04:47 +0200)] 
new: ci: Automatically trigger rebase of -sub branches

After a merge into the public project, trigger automatic rebase in the respective private branch of the private project.

Merge branch 'pspacek/auto-rebase-sub-branches' into 'main'

See merge request isc-projects/bind9!11012

6 months agoApply special git tag rules only in the private project
Petr Špaček [Thu, 25 Sep 2025 12:24:45 +0000 (14:24 +0200)] 
Apply special git tag rules only in the private project

We do not want to re-release tags we create in the private project
anyway. Moreover pushing tags back into the public project after release
caused to Gitlab to create tag pipelines which never finished, which was
only confusing thing.

6 months agoTrigger rebase in private project after merge into the public one
Petr Špaček [Thu, 18 Sep 2025 14:15:05 +0000 (16:15 +0200)] 
Trigger rebase in private project after merge into the public one

Actual rebase and push is handled by pipeline inside the private project.

6 months agoDo not fail post-merge jobs if merge request reference is missing
Petr Špaček [Thu, 25 Sep 2025 11:21:23 +0000 (13:21 +0200)] 
Do not fail post-merge jobs if merge request reference is missing

Push without merge request reference on top happens when merging tags
back into the public project so these failures would produce log noise.

6 months agoDo not fail post-merge jobs after force-push
Petr Špaček [Thu, 25 Sep 2025 10:22:41 +0000 (12:22 +0200)] 
Do not fail post-merge jobs after force-push

Rebase happens in -sub branches regularly so these failures would
produce log noice.

6 months agoDeduplicate Git NAME and EMAIL variables
Petr Špaček [Thu, 25 Sep 2025 10:20:24 +0000 (12:20 +0200)] 
Deduplicate Git NAME and EMAIL variables

As an additional perk, I hope JOB_ID will make it easier to debug it
something goes wrong with automated commits.

6 months agochg: dev: Refactoring in lib/isccfg
Evan Hunt [Thu, 23 Oct 2025 20:43:07 +0000 (20:43 +0000)] 
chg: dev: Refactoring in lib/isccfg

`cfg_obj_t` objects no longer depend on the `cfg_parser_t` life-cycle; they can now persist until the last reference is detached. The `file` field, which was previously a pointer to memory allocated in the parser, is now a pointer to a subsidiary `cfg_obj_t` of type string. The API calls for creating and detaching these objects have been simplified accordingly.

Since `cfg_obj_t` is now long-lived, a zone can hold a reference to its own configuration data, making it possible to use `rndc showzone` even if `allow-new-zones` is disabled.

Several API calls related to the parser have been removed or hidden. The `cfg_parse_file()` and `cfg_parse_buffer()` functions now internally create and destroy their own parsers, eliminating the need for the caller to do so.

Most of these changes are intended to simplify dumping of running configuration data in a future commit.

Merge branch 'colin/hide-cfg-parser' into 'main'

See merge request isc-projects/bind9!11132

6 months agorestore the former change_directory logging
Evan Hunt [Thu, 23 Oct 2025 18:44:15 +0000 (11:44 -0700)] 
restore the former change_directory logging

change_directory() now lives in libisccfg. when it was moved,
the logging behavior changed: previously it had been logged
by named only, in the general logging category, and without the
named.conf filename and line number. it was not logged by
named-checkconf. this behavior has now been restored.

6 months agotest rndc showzone works for named.conf zones
Colin Vidal [Thu, 23 Oct 2025 08:54:32 +0000 (10:54 +0200)] 
test rndc showzone works for named.conf zones

Since the zone now has a reference to their respective configuration
tree, `rndc showzone` can be used for any zones (including those
defined in namedconf), without `allow-new-zones` being enabled.
Add a test for this.

The test is part of the addzone suite because showzone used to be
related to addzone, but this could be moved elsewhere in the future
if more specific tests are needed for showzone.

6 months agoensure parser/cfg_obj log includes the line number
Colin Vidal [Thu, 23 Oct 2025 08:12:38 +0000 (10:12 +0200)] 
ensure parser/cfg_obj log includes the line number

Since the `file` property of cfg_obj_t can now be null (instead of
"none"), cfg_obj_t would take a fallback flow where the line was not
logged. This fixes it.

Also, add the log line when parser_complain is called and `file` is null
(which might happend when parsing buffer only) to also include the line
number.

6 months agosimplify and regularize cfg_* functions
Evan Hunt [Wed, 22 Oct 2025 21:51:15 +0000 (14:51 -0700)] 
simplify and regularize cfg_* functions

- several functions that can no longer fail have been changed to
  type void, and unnecessary 'cleanup' sections were removed
- renamed cfg_create_obj() to cfg_obj_create(), and cfg_create_tuple()
  to cfg_tuple_create(), to match typical nomenclature.
- fixed a memory leak bug, in which an element could be removed
  from a list in delete_zoneconf() without being freed. this has
  been addressed by adding a cfg_list_unlink() function.
  list elements are now allocated based on the list they will
  be stored in, using the same mctx.

6 months agosimplify cfg_parser API
Evan Hunt [Wed, 22 Oct 2025 17:41:05 +0000 (10:41 -0700)] 
simplify cfg_parser API

- the cfg_parser_create() and cfg_parser_destroy() calls are no
  longer used outside parser.c, so they are now static functions
- cfg_parser_attach(), cfg_parser_reset(), and cfg_parser_setflags()
  are no longer used at all, and have been removed.
- cfg_parser_mapadd() has been renamed for clarity to cfg_map_add().

6 months agocfg_parse_ functions internally handle the parser
Colin Vidal [Wed, 22 Oct 2025 09:49:09 +0000 (11:49 +0200)] 
cfg_parse_ functions internally handle the parser

Instead of (1) allocating a parser, (2) parsing a file/buffer then (3)
freeing the parser, the parser is now internally created/destroyed from
within the `cfg_parse_*` functions. This simplifies a lot the use cases,
especially around the error cases where the parser needs to be freed in
a cleanup goto.

The only trick was the parser callback mechanism, which would previously
have been set up between steps 1 and 2.  Since it's never been used for
any purpose other than the "directory" option, the chdir call has now
been moved inside the parser and the generic callback mechanism has been
removed, replacing CFG_CLAUSEFLAG_CALLBACK with CFG_CLAUSEFLAG_CHDIR.

6 months agostore the zone configuration object in the zone
Evan Hunt [Wed, 22 Oct 2025 05:56:27 +0000 (22:56 -0700)] 
store the zone configuration object in the zone

when configuring a zone, we can now save the zone's configuration
object in the zone itself by calling dns_zone_setcfg().  this can
then be used by "rndc showzone" to print the zone's configuration,
which is simpler than searching for it using the new-zones
configuration, and allows it to work even if "allow-new-zones"
is disabled.

6 months agoupdate cfg_obj_attach/destroy
Evan Hunt [Tue, 21 Oct 2025 23:41:11 +0000 (16:41 -0700)] 
update cfg_obj_attach/destroy

now that cfg_obj_destroy() has been simplified, we can use the
ISC_REFCOUNT macros to declare cfg_obj_attach() and _detach().

6 months agoremove all shared and global parsers
Colin Vidal [Tue, 21 Oct 2025 15:16:39 +0000 (17:16 +0200)] 
remove all shared and global parsers

Remove all global cfg_parser objects as well as shared parsers between
views to dynamically add zones. Instead, parser are transirently created
whenever needed.

6 months agoremove global named defaults parser
Colin Vidal [Tue, 21 Oct 2025 14:29:34 +0000 (16:29 +0200)] 
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).

6 months agoremove parser context field from cfg_obj_t
Colin Vidal [Tue, 21 Oct 2025 13:41:55 +0000 (15:41 +0200)] 
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.

6 months agocfg_obj_t file is now a refcounted string
Colin Vidal [Tue, 21 Oct 2025 13:08:47 +0000 (15:08 +0200)] 
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.

6 months agochg: test: Use isctest.asyncserver in the "nsupdate" test
Štěpán Balážik [Thu, 23 Oct 2025 12:25:56 +0000 (12:25 +0000)] 
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

6 months agoUse isctest.asyncserver in the "nsupdate" test
Štěpán Balážik [Thu, 28 Aug 2025 16:13:36 +0000 (18:13 +0200)] 
Use isctest.asyncserver in the "nsupdate" test

Reimplement the custom server written in Perl in Python using the
AsyncDnsServer class.

6 months agoEnable ignoring TCP connections
Štěpán Balážik [Thu, 28 Aug 2025 16:10:19 +0000 (18:10 +0200)] 
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 e4078885073a6c5b59729f4313108e3e7637efdb for more
details.

6 months agoMerge tag 'v9.21.14'
Michał Kępień [Wed, 22 Oct 2025 16:13:34 +0000 (18:13 +0200)] 
Merge tag 'v9.21.14'

6 months agochg: ci: Fail when spatch can't process source code
Michal Nowak [Wed, 22 Oct 2025 11:27:45 +0000 (13:27 +0200)] 
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

6 months agoUse DNS_SIGTYPEPAIR instead of DNS_SIGTYPE
Michal Nowak [Tue, 21 Oct 2025 09:34:54 +0000 (11:34 +0200)] 
Use DNS_SIGTYPEPAIR instead of DNS_SIGTYPE

After 74fe3db37c65e997b82b81e5685b65cf19818646, there's no such thing as
DNS_SIGTYPE.

6 months agoUse SET_IF_NOT_NULL in isc__nm_base64*
Michal Nowak [Tue, 21 Oct 2025 09:00:36 +0000 (11:00 +0200)] 
Use SET_IF_NOT_NULL in isc__nm_base64*

6 months agoSpawn coccinelle CI job when util/check-cocci.sh was touched
Michal Nowak [Mon, 20 Oct 2025 15:58:37 +0000 (17:58 +0200)] 
Spawn coccinelle CI job when util/check-cocci.sh was touched

6 months agoFail when spatch can't process source code
Michal Nowak [Mon, 20 Oct 2025 15:36:36 +0000 (17:36 +0200)] 
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

6 months agonew: dev: run individual spatch form check-cocci.sh
Colin Vidal [Wed, 22 Oct 2025 07:16:52 +0000 (09:16 +0200)] 
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

6 months agorun individual spatch form check-cocci.sh
Colin Vidal [Tue, 14 Oct 2025 12:01:42 +0000 (14:01 +0200)] 
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.

6 months agofix: test: Fix typo in tools test's shell path
Mark Andrews [Wed, 22 Oct 2025 05:06:12 +0000 (16:06 +1100)] 
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

6 months agoFix typo in tools test's shell path
Petr Špaček [Wed, 3 Sep 2025 12:07:41 +0000 (14:07 +0200)] 
Fix typo in tools test's shell path

6 months agofix: usr: dnssec-verify now uses exit code 1 when failing due to illegal options
Mark Andrews [Wed, 22 Oct 2025 02:21:52 +0000 (13:21 +1100)] 
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

6 months agodnssec-verify now returns failure on bad arguments
Mark Andrews [Thu, 16 Oct 2025 05:52:57 +0000 (16:52 +1100)] 
dnssec-verify now returns failure on bad arguments

6 months agofix: usr: Fix dnssec-keygen key collision checking for KEY rrtype keys
Mark Andrews [Wed, 22 Oct 2025 01:44:26 +0000 (12:44 +1100)] 
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