2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00
Commit Graph

39939 Commits

Author SHA1 Message Date
Ondřej Surý
8339615235 Use ControlStatementsExceptControlMacros for SpaceBeforeParens
> Put a space before opening parentheses only after control statement
> keywords (for/if/while...) except this option doesn’t apply to ForEach
> and If macros. This is useful in projects where ForEach/If macros are
> treated as function calls instead of control statements.

(cherry picked from commit 42496f3f4a)
2025-08-19 08:10:58 +02:00
Ondřej Surý
a464171243 Add and apply InsertBraces statement
> Insert braces after control statements (if, else, for, do, and while)
> in C++ unless the control statements are inside macro definitions or
> the braces would enclose preprocessor directives.

(cherry picked from commit d051e1e8f8)
2025-08-19 08:09:59 +02:00
Nicki Křížek
2270946186 [9.18] fix: ci: Update DNS Shotgun parameters for an updated dataset
We've switched to an updated dataset for shotgun jobs. The change in
underlying traffic caused the more sensitive doh-get (and partially dot)
jobs to overload the resolver, making the jobs unstable and unreliable,
due to an increased number of timeouts.

Readjust the load parameters slightly to avoid exceeding ~2 % of
timeouts in the cold cache scenario to stabilize the job results.

Backport of MR !10841

Merge branch 'backport-nicki/ci-shotgun-load-new-dataset-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10857
2025-08-14 23:30:28 +02:00
Nicki Křížek
e36b43592f Update DNS Shotgun parameters for an updated dataset
We've switched to an updated dataset for shotgun jobs. The change in
underlying traffic caused the more sensitive doh-get (and partially dot)
jobs to overload the resolver, making the jobs unstable and unreliable,
due to an increased number of timeouts.

Readjust the load parameters slightly to avoid exceeding ~2 % of
timeouts in the cold cache scenario to stabilize the job results.

(cherry picked from commit 338389b3eb)
2025-08-14 21:01:00 +02:00
Michal Nowak
e96f373ebe [9.18] fix: ci: Set more lenient respdiff limits
After !9950, respdiff's maximal disagreement percentage needs to be
adjusted as target disagreements between the tested version of the
"main" branch and the reference one jumped for the respdiff,
respdiff:asan, and respdiff:tsan jobs from on average 0.07% to 0.16% and
from 0.12% to 0.17% for the respdiff-third-party job.

In !9950, we concluded setting MAX_DISAGREEMENTS_PERCENTAGE to double
the average disagreement percentage works fine in the CI.

(cherry picked from commit 9acc0c8543)

Backport of MR !10293

Merge branch 'backport-mnowak/more-lenient-respdiff-limits-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10848
2025-08-14 16:14:33 +02:00
Michal Nowak
7baccc9f72 Set more lenient respdiff limits
After !9950, respdiff's maximal disagreement percentage needs to be
adjusted as target disagreements between the tested version of the
"main" branch and the reference one jumped for the respdiff,
respdiff:asan, and respdiff:tsan jobs from on average 0.07% to 0.16% and
from 0.12% to 0.17% for the respdiff-third-party job.

In !9950, we concluded setting MAX_DISAGREEMENTS_PERCENTAGE to double
the average disagreement percentage works fine in the CI.

(cherry picked from commit 9acc0c8543)
2025-08-14 16:12:01 +02:00
Mark Andrews
aef4682e4a [9.18] fix: dev: Use DNS_RDATACOMMON_INIT to hide branch differences
Initialization of the common members of rdata type structures varies across branches. Standardize it by using the `DNS_RDATACOMMON_INIT` macro for all types, so that new types are more likely to use it, and hence backport more cleanly.

Closes #5467

Merge branch '5467-use-dns_rdatacommon_init-to-hide-branch-differences-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10833
2025-08-14 23:19:09 +10:00
Mark Andrews
3ed407ac77 Use DNS_RDATACOMMON_INIT to hide branch differences
Initialization of the common members of rdata type structures varies
across branches. Standardize it by using the DNS_RDATACOMMON_INIT
macro for all types, so that new types are more likely to use it,
and hence backport more cleanly.
2025-08-14 22:42:01 +10:00
Andoni Duarte
77e429a511 chg: doc: Set up version for BIND 9.18.40
Merge branch 'andoni/set-up-version-for-bind-9.18.40' into 'bind-9.18'

See merge request isc-projects/bind9!10852
2025-08-14 11:00:32 +00:00
Andoni Duarte Pintado
6cb786c15c Update BIND version to 9.18.40-dev 2025-08-14 12:26:14 +02:00
Štěpán Balážik
354fceac2c [9.18] fix: test: Fix the .hypothesis directory to bin/tests/system/.hypothesis
Previously the location of the .hypothesis directory would depend on the
current working directory when running pytest.

Set the HYPOTHESIS_STORAGE_DIRECTORY explicitly.

Closes #5424

Backport of MR !10825

Merge branch 'backport-5424-hypothesis-artifacts-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10829
2025-08-06 12:40:39 +00:00
Štěpán Balážik
a82ab27989 Fix the .hypothesis directory to bin/tests/system/.hypothesis
Previously the location of the .hypothesis directory would depend on the
current working directory when running pytest.

Set the HYPOTHESIS_STORAGE_DIRECTORY explicitly.

(cherry picked from commit a4e74ab8cd)
2025-08-06 14:07:44 +02:00
Mark Andrews
4eb5a0ba1c [9.18] new: usr: Support for parsing the DSYNC record has been added
Closes #5440

Backport of MR !10776

Merge branch 'backport-5440-add-dsync-record-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10821
2025-08-06 15:17:45 +10:00
Mark Andrews
480a7a6aac Add tests for DSYNC
(cherry picked from commit 53c8c5233a)
2025-08-06 13:51:43 +10:00
Mark Andrews
fbc8365395 Add support for parsing and displaying DSYNC rdata type
(cherry picked from commit c47615094e)
2025-08-06 13:51:43 +10:00
Mark Andrews
976b19e00c Add support for parsing DSYNC scheme mnemonics
Adds dns_dsyncscheme_fromtext, dns_dsyncscheme_totext and
dns_dsyncscheme_format.  Adds type dns_dsyncscheme_t.

(cherry picked from commit 6e1311c624)
2025-08-06 13:08:11 +10:00
Petr Špaček
02834baf74 [9.18] fix: test: Require explicit import of isctest.name in system tests
Since the isctest.name module uses `pytest.importorskip()` to check for
dnspython version, it can't be imported automatically on `import
isctest`, because that is used in conftest.py, causing an error during
test setup.

Note that this behavior only manifested on AlmaLinux 8, so perhaps newer
pytest versions are able to handle this edge case more gracefully.

This doesn't affect 9.20+, as this issue was introduced as an erroneous
conflict resolution during a 9.18 backport.

Merge branch 'nicki/fix-isctest-name-import-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10822
2025-08-05 12:56:36 +00:00
Nicki Křížek
78c0af6de1 Require explicit import of isctest.name in system tests
Since the isctest.name module uses `pytest.importorskip()` to check for
dnspython version, it can't be imported automatically on `import
isctest`, because that is used in conftest.py, causing an error during
test setup.

Note that this behavior only manifested on AlmaLinux 8, so perhaps newer
pytest versions are able to handle this edge case more gracefully.

This doesn't affect 9.20+, as this issue was introduced as an erroneous
conflict resolution during a 9.18 backport.
2025-08-05 11:10:24 +02:00
Ondřej Surý
c9f05d750a fix: usr: Rescan the interfaces again when reconfiguring the server
On FreeBSD, the server would not listen on the configured 'localhost'
interfaces immediately, but only after the 'interface-interval' period
has passed.  After the fix for default interface-interval was merged in
!10281, this means the server would listen on the localhost after 60
minutes.

Rescan the interfaces immediately after configuring the
interface-interval value to start listening on the 'localhost' interface
immediately.

Merge branch 'ondrej/rescan-the-interface-on-time-0' into 'bind-9.18'

See merge request isc-projects/bind9!10758
2025-08-04 11:24:44 +02:00
Ondřej Surý
e86eed54f5 Rescan the interfaces again when reconfiguring the server
On FreeBSD, the server would not listen on the configured 'localhost'
interfaces immediately, but only after the 'interface-interval' period
has passed.  After the fix for default interface-interval was merged in
!10281, this means the server would listen on the localhost after 60
minutes.

Rescan the interfaces immediately after configuring the
interface-interval value to start listening on the 'localhost' interface
immediately.
2025-08-04 11:24:23 +02:00
Mark Andrews
4d24dabc25 [9.18] fix: usr: Prevent spurious validation failures
Under rare circumstances, validation could fail if multiple clients simultaneously iterated the same set of signatures.

References #3014

Backport of MR !5578

Merge branch 'backport-3014-validator-c-check_signer-fails-to-call-dns_rdataset_clone-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10816
2025-08-02 00:29:52 +10:00
Mark Andrews
74fab1887c validator.c:check_signer now clones val->event->sigrdataset
Spurious validation failures were traced back to check_signer looping
over val->event->sigrdataset directly.  Cloning val->event->sigrdataset
prevents check_signer from interacting with callers that are also
looping over val->event->sigrdataset.

(cherry picked from commit 8aa130f253)
2025-08-01 23:55:38 +10:00
Petr Špaček
f0574ed0d1 [9.18] chg: ci: Log packages, test AlmaLinux 9
Backport of MR !10799

Merge branch 'backport-pspacek/ci-platforms-and-logging-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10807
2025-07-31 12:22:24 +00:00
Petr Špaček
1a16a131d7 Log all installed system packages and Python libraries before build
(cherry picked from commit e702e09143)
2025-07-31 12:22:08 +00:00
Petr Špaček
1bae223a63 Run MR pipelines also on AlmaLinux 9
Turns out Python version there is older than elsewhere.

(cherry picked from commit 8c71989a45)
2025-07-31 12:22:08 +00:00
Michal Nowak
a8f82ded6b [9.18] fix: ci: Revert "Capture scripts for Coverity Scan analysis"
This reverts commit b4a2674d98.

The --fs-capture-search option is no more. The ability to analyse Python
scripts in Coverity turned out to be questionable anyways.

Closes #5456

Backport of MR !10808

Merge branch 'backport-5456-coverity-scan-drop-fs-capture-search-option-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10811
2025-07-31 13:23:39 +02:00
Michal Nowak
adf35a3293 Revert "Capture scripts for Coverity Scan analysis"
This reverts commit e1a463e98d.

The --fs-capture-search option is no more. The ability to analyse Python
scripts in Coverity turned out to be questionable anyways.

(cherry picked from commit 310884c259)
2025-07-31 12:55:01 +02:00
Petr Špaček
2e3afea920 [9.18] Fix system test compatibility with old Python
Backport of MR !10797

Merge branch 'backport-pspacek/test-compatibility-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10803
2025-07-30 14:39:27 +00:00
Petr Špaček
a2daff3cb6 Fix compatibility with Python < 3.10
Dataclass kw_only argument was added only in Python 3.10 but EL9 image
has only 3.9.21.

(cherry picked from commit b0c7f8b598)
2025-07-30 14:36:46 +00:00
Petr Špaček
fd71407c49 Fix minimal dnspython version test
Wrong version number was uncovered by Ubuntu 22.04 Jammy which actually
has dnspython 2.1.0.

(cherry picked from commit 6ae224fc9c)
2025-07-30 14:36:46 +00:00
Evan Hunt
a47f46612e [9.18] new: test: add helper functions to isctest
added some helper functions in isctest to reduce code repetition
in dnssec-related tests:

- isctest.check.adflag() - checks that a response contains AD=1
- isctest.check.noadflag() - checks that a response contains AD=0

- isctest.check.rdflag() - checks that a response contains RD=1
- isctest.check.nordflag() - checks that a response contains RD=0

- isctest.check.raflag() - checks that a response contains RA=1
- isctest.check.noraflag() - checks that a response contains RA=0

- isctest.check.rr_count_eq() - checks the number of RRsset in a section

- isctest.check.same_data() - checks that two message have the
                              same rcode and data
- isctest.check.same_answer() - checks that two message have the same
                                rcode and answer

- isctest.query.create() - a wrapper for dns.message.make_query() that
                           creates a query message similar to dig +dnssec

Backport of MR !10760

Merge branch 'backport-each-isctest-helpers-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10794
2025-07-30 00:03:00 +00:00
Evan Hunt
2588b2a23c Use isctest.query.create across system tests
Rather than using the dnspython's facilities and defaults to create the
queries, use the isctest.query.create function in all the cases that
don't require special handling to have consistent defaults.

(cherry picked from commit 64143ea077)
2025-07-29 16:08:44 -07:00
Evan Hunt
ad7414de43 Add RA flag checks to isctest.check
(cherry picked from commit f2a4c5dcb0)
2025-07-29 16:04:02 -07:00
Evan Hunt
01ec550099 Refactor and move query helper to isctest.query.create
Make the query helper function more universal and reusable across our
system tests -- default to using EDNS and sending AD=1.

(cherry picked from commit 989e64b9b0)
2025-07-29 16:03:55 -07:00
Nicki Křížek
c92a6b85fe Unify RR counting in isctest.check helper
Use a common function to count the number of RRs in any section of the
DNS message. For the ADDITIONAL section, stick with the dnspython
convention of not including OPT and TSIG.

(cherry picked from commit efd60348b9)
2025-07-29 22:58:12 +00:00
Nicki Křížek
eeace11202 Refactor isctest.check.section_equal comparison
Use the same logic as dnspython uses in dns.message.Message.

(cherry picked from commit b24dd20e5a)
2025-07-29 22:58:12 +00:00
Evan Hunt
2a51b24cb7 add helper functions to isctest
added some helper functions in isctest to reduce code repetition
in dnssec-related tests:

- isctest.check.adflag() - checks that a response contains AD=1
- isctest.check.noadflag() - checks that a response contains AD=0

- isctest.check.rdflag() - checks that a response contains RD=1
- isctest.check.nordflag() - checks that a response contains RD=0

- isctest.check.answer_count_eq() - checks the answer count is correct
- isctest.check.additional_count_eq() - same for authority count
- isctest.check.authority_count_eq() - same for additional count

- isctest.check.same_data() - check that two message have the
                              same rcode and data
- isctest.check.same_answer() - check that two message have the same
                                rcode and answer

- isctest.dnssec.msg() - a wrapper for dns.message.make_query() that
                         creates a query message similar to dig +dnssec:
                         use_edns=True, want_dnssec=True,
                         and flags are set to (RD|AD) by default, but
                         options exist to disable AD or enable CD.
                         (to generate non-DNSSEC queries, use
                         message.make_query() directly.)

(cherry picked from commit b69097f139)
2025-07-29 22:58:11 +00:00
Petr Špaček
448223b391 [9.18] new: test: Robust tests for NSEC3 nonexistent QNAME proof
Related to #5292

Backport of MR !10416

Merge branch 'backport-5292-wrong-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10789
2025-07-29 12:25:20 +00:00
Michał Kępień
f79c638118 Adjust type hints for the "nsec3-answer" test
Add missing type hints in the tests_nsec3.py module.  Tweak the syntax
used for type hints for better consistency with other Python code in
bin/tests/system/.

(cherry picked from commit adb931f700)
2025-07-29 13:19:23 +02:00
Petr Špaček
d5cc05db49 Add more empty non-terminals to test zone
I don't know exactly why, I just have a feeling there might be
interesting corner cases somewhere.

(cherry picked from commit fc3d5e5918)
2025-07-29 13:19:23 +02:00
Petr Špaček
0adaa4a244 Randomize NSEC3 salt
This should prevent the case where are are unlucky enough that static
values hash 'just right' for the test to pass, but only accidentally.

(cherry picked from commit 46781845ea)
2025-07-29 13:19:23 +02:00
Petr Špaček
548d1a81f9 Test proof of nonexistance of DS in insecure referrals
Currently this test is limited only to auth because currently BIND
resolver does not send DS proof of nonexistence for RD=0 queries.

(cherry picked from commit 548632b18a)
2025-07-29 13:19:23 +02:00
Petr Špaček
cce3fe0683 Test dangling DNAME answers come with NXDOMAIN proofs
Simplistic test. Ignores the possibility of DNAME chain going through
multiple zones and/or wildcard expansions.

(cherry picked from commit 73e4201331)
2025-07-29 13:19:23 +02:00
Petr Špaček
0d3d1d0442 Test dangling CNAMEs come with NXDOMAIN proofs
Simplistic test. Ignores the possibility of CNAME chain going through
multiple zones and/or wildcard expansions.

(cherry picked from commit d0e413dd57)
2025-07-29 13:19:23 +02:00
Petr Špaček
e866ffd9c1 Move query outside of check_() functions
This allows better check() code reuse.

(cherry picked from commit cc6544b417)
2025-07-29 13:19:23 +02:00
Petr Špaček
1dfd384fd2 Separate test into a new directory
The test actually needs just two servers - auth and resolver. The rest
was not needed and made test setup only slower and harder to debug.

(cherry picked from commit ac58b58002)
2025-07-29 13:19:23 +02:00
Petr Špaček
65c488d1d3 Test simple NODATA answers with NSEC3
(cherry picked from commit a92391f60f)
2025-07-29 12:59:12 +02:00
Petr Špaček
8607e334be Detect extraneous NSEC3 RRs in responses
We expect minimal possible answers which prove what they have to
according to DNSSEC protocol.

(cherry picked from commit b854d5a3f5)
2025-07-29 12:59:12 +02:00
Petr Špaček
de4357bc93 Move proof checking into a NSEC3Checker class
(cherry picked from commit c45ad51860)
2025-07-29 12:59:12 +02:00
Petr Špaček
dc3f349e9d Add consistency checks to responses with NSEC3
Basic sanity checks - limited to responses from a single zone:
- NSEC3 type cannot be present in type bitmap:
  By definition, the type bitmap describes state of the unhashed name
  but NSEC3 RR is present at a different owner name. RFC 7129 section 5
- NSEC3 owner names cannot be duplicated:
  Unless the response crosses zone boundary, parent zone has insecure
  delegation for child, but child is signed ... don't do that.
- All parameters are consistent across all RRs present in answer:
  RFC 5155 section 7.2, last paragraph - at least when we don't cross
  zone boundary.

(cherry picked from commit cfaf5c997f)
2025-07-29 12:59:12 +02:00