Commit graph

43262 commits

Author SHA1 Message Date
Nicki Křížek
c06dc71cd5 Make extra_artifacts check optional
There is an ongoing debate about the usefulness of the extra artifacts
check. While it might be useful to detect unexpected behaviour in some
tests, it feels extraneous in many cases. This change provides a middle
ground by making the artifact checking optional. This might be
especially useful for writing new tests, since the author gets to decide
whether the check is useful -- and can utilize it, or can skip it for
sake of brevity.
2025-06-24 16:56:53 +02:00
Petr Špaček
c7d0c7dcb0 fix: nil: Do not include benchmark data in tarball
Related: #5379

Merge branch 'pspacek/do-not-distribute-benchmark-data' into 'main'

See merge request isc-projects/bind9!10619
2025-06-24 12:39:04 +00:00
Michal Nowak
b890ff46cc Drop empty directory bin/rndc/include/
It should have been removed as part of
9088052225.
2025-06-24 12:38:37 +00:00
Michal Nowak
fcb2203431 Do not include empty directories cocci and .reuse in tarball 2025-06-24 12:38:37 +00:00
Michal Nowak
4ffab46059 Do not include cocci/ data in tarball 2025-06-24 12:38:37 +00:00
Petr Špaček
525c6ae983 Do not include benchmark data in tarball
names.csv file triples (compressed) tarball size.
meson dist respects .gitattributes so we don't need to add special magic
to meson.build.
2025-06-24 12:38:37 +00:00
Michal Nowak
414e13ce3e new: ci: Add Alpine Linux 3.22
Merge branch 'mnowak/alpine-3.22' into 'main'

See merge request isc-projects/bind9!10539
2025-06-24 14:02:54 +02:00
Michal Nowak
b20c71c2dc
Add Alpine Linux 3.22 2025-06-24 13:25:06 +02:00
Colin Vidal
b49f83a3e6 chg: dev: parse user configuration before exclusive mode
Previously, `named.conf` was parsed while the server was in exclusive (i.e., single-threaded) mode and unable to answer queries. This could cause an unnecessary delay in query processing when the file was large. We now delay entry into exclusive mode until after the configuration has been parsed, but before it is applied.

Merge branch 'colin/configparse-before-exclusive' into 'main'

See merge request isc-projects/bind9!10418
2025-06-24 10:52:11 +02:00
Colin Vidal
349cc060f4 wait for reload completed in emptyzones system test
The emptyzones system test ran two consecutive "rndc reload" commands
without waiting for the first one to complete. It used to work because
the commands were serialized, but now an rndc reconfig/reload command is
ignored if another one is already running, so the emptyzones test is
more likely to fail.

Fix this problem by waiting for the log message indicating that all the
zones are loaded before attempting the next reload.
2025-06-23 23:20:30 -07:00
Colin Vidal
209b30d563 log-based test for load/apply config
Add a new system test which checks named output when starting,
reconfiguring and reloading the server. It checks that the steps where
configuration is loaded, when named enters exclusive mode, and when the
configuration is applied are all logged, and that they occur in the
correct order. This adds a guard/warning to keep the parsing of the
named.conf outside of the exclusive mode.
2025-06-23 10:45:31 -07:00
Colin Vidal
d7416bb472 ignore reload request if in a reload process
Ignore an 'rndc reload' or 'rndc reconfig' command if received by named
while the server is currently reloading itself.
2025-06-23 10:45:14 -07:00
Colin Vidal
d7de2ba084 parse user configuration before exclusive mode
The configuration file was parsed when named was in exclusive
(i.e. single-threaded) mode and unable to answer queries. Because
the parsing is a self-contained operation, it is now done before
named enters exclusive mode.

This reduces the amount of time named can't answer queries when
reloading the configuration when the configuration file is large.
Note that exclusive mode is still used for applying the
configuration changes to the server.

Also, simplify the configuration logic by parsing the built-in
configuration only once at server start time.
2025-06-23 10:35:31 -07:00
Colin Vidal
8685ebdb99 renamed named_g_config/defaults
For better clarity, the global variables named_g_config and
named_g_defaults have been changed to named_g_defaultconfig
and named_g_defaultoptions.
2025-06-23 10:35:17 -07:00
Michal Nowak
6f17df074d fix: ci: Mark ForEachMacros as iterator names
After f10f5572ac spatch started reporting
the following warnings:

    Impossible: How can diff be null and have not Correct in compare_c? Tag1 ("diff token: ( VS (\nFile \"./lib/dns/include/dns/rdatasetiter.h\", line 109, column 32, charpos = 3103\n  around = '(',\n  whole content = #define DNS_RDATASETITER_FOREACH(rds)               \\\nFile \"/tmp/cocci-output-110376-c54da3-rdatasetiter.h\", line 109, column 32, charpos = 3103\n  around = '(',\n  whole content = #define DNS_RDATASETITER_FOREACH(rds)               \\\n")
    Impossible: How can diff be null and have not Correct in compare_c? Tag1 ("diff token: ( VS (\nFile \"./lib/dns/include/dns/dbiterator.h\", line 114, column 30, charpos = 3413\n  around = '(',\n  whole content = #define DNS_DBITERATOR_FOREACH(rds)               \\\nFile \"/tmp/cocci-output-110387-883f2f-dbiterator.h\", line 114, column 30, charpos = 3413\n  around = '(',\n  whole content = #define DNS_DBITERATOR_FOREACH(rds)               \\\n")

See https://github.com/coccinelle/coccinelle/issues/398.

Merge branch 'mnowak/coccinelle-fix-impossible-warning' into 'main'

See merge request isc-projects/bind9!10557
2025-06-23 19:05:09 +02:00
Michal Nowak
0569f4a559
Mark ForEachMacros as iterator names
After f10f5572ac spatch started reporting
the following warnings:

    Impossible: How can diff be null and have not Correct in compare_c? Tag1 ("diff token: ( VS (\nFile \"./lib/dns/include/dns/rdatasetiter.h\", line 109, column 32, charpos = 3103\n  around = '(',\n  whole content = #define DNS_RDATASETITER_FOREACH(rds)               \\\nFile \"/tmp/cocci-output-110376-c54da3-rdatasetiter.h\", line 109, column 32, charpos = 3103\n  around = '(',\n  whole content = #define DNS_RDATASETITER_FOREACH(rds)               \\\n")
    Impossible: How can diff be null and have not Correct in compare_c? Tag1 ("diff token: ( VS (\nFile \"./lib/dns/include/dns/dbiterator.h\", line 114, column 30, charpos = 3413\n  around = '(',\n  whole content = #define DNS_DBITERATOR_FOREACH(rds)               \\\nFile \"/tmp/cocci-output-110387-883f2f-dbiterator.h\", line 114, column 30, charpos = 3413\n  around = '(',\n  whole content = #define DNS_DBITERATOR_FOREACH(rds)               \\\n")

See https://github.com/coccinelle/coccinelle/issues/398.
2025-06-23 18:18:12 +02:00
Petr Špaček
8a7c95e760 fix: nil: Restore DNSSEC validation by default
Closes #5380

Merge branch '5380-reenable-dnssec-validation' into 'main'

See merge request isc-projects/bind9!10617
2025-06-23 14:02:06 +00:00
Petr Špaček
3d1733b936 Restore DNSSEC validation by default
Meson generated 'dnssec-validation yes' into the built-in config, but
this config without an explicit trust anchor does not enable validation.
Change default to 'dnssec-validation auto' to use built-in key, as in
the autotools days.
2025-06-23 12:58:59 +00:00
Aydın Mercan
181ad273e8 fix: dev: Fix RTD builds and minor documentation issues
Fix some leftover artifacts and information while transitioning BIND to Meson.
Add CI job to verify that pre-generated config grammar files are up-to-date with code.

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

See merge request isc-projects/bind9!10584
2025-06-23 14:23:53 +03:00
Aydın Mercan
3bb88f847a
Remove the configblock sphinx extension
The `configblock` extension doesn't work with RHEL 8. However, this
extension isn't needed anymore after the RTD fix and can be safely
removed.
2025-06-23 13:45:09 +03:00
Aydın Mercan
b4c1f9ee09
Switch autoconf references to meson in readme 2025-06-23 13:45:06 +03:00
Aydın Mercan
5c9b4f3163
Remove build requirements from building arm
The meson build switched to generating the file grammars and using meson
to build the manpages/ARM. This is because meson doesn't work well when
writing files outside the build directory.

However, this has been suboptimal when someone only wants to build the
documentation (like RTD). Sphinx can now be used outside meson like it
was with autoconf.

Grammars are now updated by the developer with CI checking if one is
needed or not, like clang-format.
2025-06-23 13:45:04 +03:00
Aydın Mercan
3447e1631d
Fix build instructions
There were leftover artifacts and instructions from the transition.
2025-06-23 13:44:58 +03:00
Michał Kępień
8e6ad1e465 fix: nil: Use links() for checking if -latomic is necessary
Use the links() method instead of compiles() for checking whether
-latomic needs to be added to linker invocations as compiles() does not
perform the linking step and is therefore not appropriate for carrying
out this kind of checks.

See #5379

Merge branch '5379-use-links-for-checking-if-latomic-is-necessary' into 'main'

See merge request isc-projects/bind9!10592
2025-06-23 10:28:26 +02:00
Michał Kępień
9f2dcd2853
Retain Meson >= 0.61 version requirement
The add_project_dependencies() method was only added in Meson 0.63.
Replace its only use in meson.build with a corresponding call to the
add_project_link_arguments() method to avoid bumping the minimum
required Meson version beyond the one available in stock Ubuntu 22.04
LTS repositories.
2025-06-23 10:23:17 +02:00
Michał Kępień
b06d3f6c77
Use links() for checking if -latomic is necessary
Use the links() method instead of compiles() for checking whether
-latomic needs to be added to linker invocations as compiles() does not
perform the linking step and is therefore not appropriate for carrying
out this kind of checks.
2025-06-23 10:23:17 +02:00
Michał Kępień
eed5d39fda chg: ci: move "stress" test generation script to QA repo
Move the util/generate-stress-test-configs.py script from the BIND 9
source repository to the BIND 9 QA repository.  This simplifies the
maintenance of that script by eliminating the need to backport every
change applied to it to multiple branches.

Merge branch 'michal/move-stress-test-generation-script-to-qa-repo' into 'main'

See merge request isc-projects/bind9!10585
2025-06-21 04:47:19 +00:00
Michał Kępień
4f7f420534
Move "stress" test generation script to QA repo
Move the util/generate-stress-test-configs.py script from the BIND 9
source repository to the BIND 9 QA repository.  This simplifies the
maintenance of that script by eliminating the need to backport every
change applied to it to multiple branches.
2025-06-21 06:43:36 +02:00
Michał Kępień
c5f01022b8 fix: nil: Install named-compilezone
named-compilezone is an alias for named-checkzone: the two tools are
built from the same set of source files, but they behave differently
depending on which executable gets invoked.  With Automake,
named-compilezone was installed as a hard link to named-checkzone using
a custom installation hook; try to keep things simple with Meson by
using the install_symlink() method, which makes named-compilezone a
symbolic link to named-checkzone and is the same thing that is already
used for ddns-confgen/tsig-keygen.

See #5379

Merge branch '5379-install-named-compilezone' into 'main'

See merge request isc-projects/bind9!10595
2025-06-21 04:06:45 +00:00
Michał Kępień
ebd8074988
Install named-compilezone
named-compilezone is an alias for named-checkzone: the two tools are
built from the same set of source files, but they behave differently
depending on which executable gets invoked.  With Automake,
named-compilezone was installed as a hard link to named-checkzone using
a custom installation hook; try to keep things simple with Meson by
using the install_symlink() method, which makes named-compilezone a
symbolic link to named-checkzone and is the same thing that is already
used for ddns-confgen/tsig-keygen.
2025-06-21 05:59:51 +02:00
Mark Andrews
d4b4598c2e fix: test: verify-axfr.db gets updated too fast in mirror test
Add a 1 second wait before updating verify-axfr.db so that the
modification time of the file changes.

Closes #5376

Merge branch '5376-verify-axfr-db-gets-updated-too-fast-in-mirror-test' into 'main'

See merge request isc-projects/bind9!10586
2025-06-19 16:27:13 +00:00
Mark Andrews
c19956b3cb verify-axfr.db gets updated too fast in mirror test
Add a 1 second wait before updating verify-axfr.db so that the
modification time of the file changes.
2025-06-19 15:49:29 +00:00
Nicki Křížek
65daf35b63 fix: test: Ignore softhsm2 errors when deleting token in keyfromlabel test
In some rare cases, the softhsm2 utility reports failure to delete the
token directory, despite the token being found. Subsequent attempts to
delete the token again indicate that the token was deleted.

Ignore this cleanup error, as it doesn't prevent our tests from working
properly. There is also an attempt to delete the token before the test
starts which ensures a clean state before the test is executed, in case
there's actually a leftover token.

Closes #5244

Merge branch '5244-ignore-softhsm2util-delete-token-error' into 'main'

See merge request isc-projects/bind9!10607
2025-06-19 13:49:52 +00:00
Nicki Křížek
e786a2e950 Ignore softhsm2 errors when deleting token in keyfromlabel test
In some rare cases, the softhsm2 utility reports failure to delete the
token directory, despite the token being found. Subsequent attempts to
delete the token again indicate that the token was deleted.

Ignore this cleanup error, as it doesn't prevent our tests from working
properly. There is also an attempt to delete the token before the test
starts which ensures a clean state before the test is executed, in case
there's actually a leftover token.
2025-06-19 13:49:34 +00:00
Michal Nowak
754ef7152a chg: doc: Update Sphinx to 8.2.3
Update Sphinx to its current version pulled in by "pip install
sphinx-rtd-theme" run in a fresh Debian "bookworm" container.

Merge branch 'mnowak/update-sphinx-to-8.2.3' into 'main'

See merge request isc-projects/bind9!10603
2025-06-19 13:30:37 +00:00
Michal Nowak
e6234542e2
Update Sphinx to 8.2.3
Update Sphinx to its current version pulled in by "pip install
sphinx-rtd-theme" run in a fresh Debian "bookworm" container.
2025-06-19 15:22:02 +02:00
Nicki Křížek
f58964dc9d chg: test: Improve logging from isctest.run.retry_with_timeout
Allow use of exception (and by extension, assert statements) in the
called function in order to extract essential debug information about
the type of failure that was encountered.

In case the called function fails to succeed on the last retry and
raised an exception, log it as error and set it as the assert message to
propagate it through the pytest framework.

Closes #5324

Merge branch '5324-pytest-isctest-run-logging' into 'main'

See merge request isc-projects/bind9!10580
2025-06-19 13:05:56 +00:00
Nicki Křížek
069e4ef0f7 Use time.monotonic() for time measumeremts in pytest
For duration measurements, i.e. deadlines and timeouts, it's more
suitable to use monotonic time as it's guaranteed to only go forward,
unlike time.time() which can be affected by local clock settings.
2025-06-19 14:11:28 +02:00
Nicki Křížek
481b46ffcc Move param to isctest.util 2025-06-19 14:11:28 +02:00
Nicki Křížek
620c884133 Improve logging from isctest.run.retry_with_timeout
Allow use of exception (and by extension, assert statements) in the
called function in order to extract essential debug information about
the type of failure that was encountered.

In case the called function fails to succeed on the last retry and
raised an exception, log it as error and set it as the assert message to
propagate it through the pytest framework.
2025-06-19 14:11:27 +02:00
Michal Nowak
ce090c1bd2 BIND 9.21.9
-----BEGIN SSH SIGNATURE-----
 U1NIU0lHAAAAAQAAARcAAAAHc3NoLXJzYQAAAAMBAAEAAAEBANamVSTMToLcHCXRu1f52e
 tTJWV3T1GSVrPYXwAGe6EVC7m9CTl06FZ9ZG/ymn1S1++dk4ByVZXf6dODe2Mu0RuqGmyf
 MUEMKXVdj3cEQhgRaMjBXvIZoYAsQlbHO2BEttomq8PhrpLRizDBq4Bv2aThM0XN2QqSGS
 ozwYMcPiGUoMVNcVrC4ZQ+Cptb5C4liqAcpRqrSo8l1vcNg5b1Hk6r7NFPdx542gsGMLae
 wZrnKn3LWz3ZXTGeK2cRmBxm/bydiVSCsc9XjB+tWtIGUpQsfaXqZ7Hs6t+1f1vsnu88oJ
 oi1dRBo3YNRl49UiCukXWayQrPJa8wwxURS9W28JMAAAADZ2l0AAAAAAAAAAZzaGE1MTIA
 AAEUAAAADHJzYS1zaGEyLTUxMgAAAQDG5e4dEY2PWMKlaD1U7LIRSL3Xgl4sKq2wNpD1Co
 T8YFihhgiOzMLoSasGtDwGnDZbRCyRHpk/Q5Zx/z+TpgZ8ILbAnGxEtXU3DU7RzN9I2Ah5
 glVgqahXpI+Oelwv0iC/LCFeivTPNGZ2YHer0BMhV7ZKzWfVk6FpHqGfOVy+t9NG47R9qW
 oLnxtOeosw4q3rXexXuomwPigC5jX8jpeqi7nRNuAWgXrSMfHkKLpPHO3CQd7eE+V3ZXVy
 16jxPqRk5h0R6+y8UqsUMtUNgiY3jQ40TDdkmFp67ffbyFG4YLO0xIdSrdah7/GIAYrD2q
 ZiYxFjuha6iRFbpzEhNLU/
 -----END SSH SIGNATURE-----
gpgsig -----BEGIN SSH SIGNATURE-----
 U1NIU0lHAAAAAQAAARcAAAAHc3NoLXJzYQAAAAMBAAEAAAEBANamVSTMToLcHCXRu1f52e
 tTJWV3T1GSVrPYXwAGe6EVC7m9CTl06FZ9ZG/ymn1S1++dk4ByVZXf6dODe2Mu0RuqGmyf
 MUEMKXVdj3cEQhgRaMjBXvIZoYAsQlbHO2BEttomq8PhrpLRizDBq4Bv2aThM0XN2QqSGS
 ozwYMcPiGUoMVNcVrC4ZQ+Cptb5C4liqAcpRqrSo8l1vcNg5b1Hk6r7NFPdx542gsGMLae
 wZrnKn3LWz3ZXTGeK2cRmBxm/bydiVSCsc9XjB+tWtIGUpQsfaXqZ7Hs6t+1f1vsnu88oJ
 oi1dRBo3YNRl49UiCukXWayQrPJa8wwxURS9W28JMAAAADZ2l0AAAAAAAAAAZzaGE1MTIA
 AAEUAAAADHJzYS1zaGEyLTUxMgAAAQDDixAWV/o5tDUge27FQsBWfED9HueToMVBQ/jGez
 j+jHw/Cla5HfA3keNs1xqvY4Oodw5bIsfGeja/JjfKkd0du+n4SLa5jsGhIzINBrfxZMMt
 j+caGVOE4qZKofkzRXoBPmkQz1mlW9KvHNM/IfKs4ZWOX5u09Xhd+LX1Jp3Teh+W3s+0Om
 7i2uoOS9E31rK4z9gia6FAvkdbg487W8RFcxMz3nP2BxeJS9WetOg57Oe/UTtIDBJIuzjf
 GlqqRt8YcZI4Sea+/WNrT2Xsi4ogHFnsShVWNPmmc+9axEmxLWW8Q66wV4GFUd5D1QG3eq
 lSTANlzZycVBDB4eGzwyG4
 -----END SSH SIGNATURE-----

Merge tag 'v9.21.9'

BIND 9.21.9
2025-06-19 12:26:58 +02:00
Matthijs Mekking
29c69d26d9 fix: usr: Fix purge-keys bug when using views
Previously, when a DNSSEC key was purged by one zone view, other zone views would return an error about missing key files. This has been fixed.

Closes #5315

Merge branch '5315-fix-spurious-some-key-files-are-missing' into 'main'

See merge request isc-projects/bind9!10550
2025-06-19 06:52:05 +00:00
Matthijs Mekking
d494698852 Fix spurious missing key files log messages
This happens because old key is purged by one zone view, then the other
is freaking out about it.

Keys that are unused or being purged should not be taken into account
when verifying key files are available.

The keyring is maintained per zone. So in one zone, a key in the
keyring is being purged. The corresponding key file is removed.

The key maintenance is done for the other zone view. The key in that
keyring is not yet set to purge, but its corresponding key file is
removed. This leads to "some keys are missing" log errors.

We should not check the purge variable at this point, but the
current time and purge-keys duration.

This commit fixes this erroneous logic.
2025-06-19 08:13:07 +02:00
Matthijs Mekking
752d8617f5 Test purge-keys with views
Create a test scenario where a signed zone is in multiple views and
then a key may be purged. This is a bug case where the key files are
removed by one view and then the other view starts complaining.
2025-06-19 08:13:07 +02:00
Mark Andrews
119f511a45 new: usr: "Add code paths to fully support PRIVATEDNS and PRIVATEOID keys"
Added support for PRIVATEDNS and PRIVATEOID key usage. Added PRIVATEOID
test algorithms using the assigned OIDs for RSASHA256 and RSASHA512.

Added code to support proposed DS digest types that encode the PRIVATEDNS
and PRIVATEOID identifiers at the start of the digest field of the DS record.
This code is disabled by default.

Closes #3240

Merge branch '3240-add-privatedns-and-privateoid-support' into 'main'

See merge request isc-projects/bind9!10341
2025-06-19 01:01:12 +00:00
Mark Andrews
38ef960fd0 Test extended DS digest type support
Add a zone using DS records that embed the private algorithm
identifier in the digest field.  There are 2 DS record for an
unsupported DNSSEC algorithm one of which that doesn't have a
matching DNSKEY.  This zone should validate as insecure as the
validator can establish that both DS records are for unsupported
DNSSEC algorithms.
2025-06-19 07:15:20 +10:00
Mark Andrews
8d554c0c03 Add tests using PRIVATEOID algorithms
There are 4 tests:

1) a zone using a known private OID.  Validations should succeed
and return AD=1.

2) a zone using an unknown private OID.  Validation should succeed
and return AD=0 as the DS to DNSKEY has provably unsupported
algorithm.

3) a zone using a known private OID and an extra DS record. Validation
should succeed as there is DS to DNSKEY with a known algorithm
linkage.

4) a zone using an unknown private OID and an extra DS record.
Validation should fail as only one of the DS records can be matched
to a provable unknown algorithm.  The algorithm of the second DS
is indeterminate.
2025-06-19 07:15:20 +10:00
Mark Andrews
92393f3c97 Add example PRIVATEDNS algorithm identifiers to DS 2025-06-19 07:15:20 +10:00
Mark Andrews
e687710dc7 Add PRIVATEOIDs for RSASHA256 and RSASHA512
Use the existing RSASHA256 and RSASHA512 implementation to provide
working PRIVATEOID example implementations.  We are using the OID
values normally associated with RSASHA256 (1.2.840.113549.1.1.11)
and RSASHA512 (1.2.840.113549.1.1.13).
2025-06-19 07:15:20 +10:00
Mark Andrews
10d094a289 Future: DS private algorithm support
Add support for proposed DS digest types that encode the private
algorithm identifier at the start of the DS digest as is done for
DNSKEY and RRSIG.  This allows a DS record to identify the specific
DNSSEC algorithm, rather than a set of algorithms, when the algorithm
field is set to PRIVATEDNS or PRIVATEOID.
2025-06-19 07:15:20 +10:00