Compare commits

..
Author SHA1 Message Date
Nicki Křížek 8e2e0cd2d7 WIP use user+net namespace 2024-06-24 16:31:21 +02:00
Nicki Křížek 14a3012171 WIP namespaces.py 2024-06-24 16:30:09 +02:00
Nicki Křížek 392e7199df Merge branch 'nicki/add-another-placeholder-for-4480' into 'main'
Add another placeholder for [GL #4480]

See merge request isc-projects/bind9!9100
2024-06-11 07:33:46 +00:00
Nicki Křížek 1680916d67 Add another placeholder for [GL #4480] 2024-06-11 09:30:47 +02:00
Nicki Křížek 9216d0a74c Merge branch 'nicki/add-placeholder-entries' into 'main'
Add placeholder entries to CHANGES

See merge request isc-projects/bind9!9096
2024-06-10 15:52:21 +00:00
Nicki Křížek 662e3cd14b Add placeholder entries to CHANGES
Add placeholders for the following issues:

- [GL #4473]
- [GL #4481]
- [GL #497] [GL #3405]
- [GL #3403] [GL #4548]
- [GL #4480]
- [GL #4507]
2024-06-10 16:19:03 +02:00
Nicki Křížek 07a5e7a921 Merge branch 'nicki/add-placeholder-for-4661' into 'main'
Add a CHANGES placeholder for [GL #4661]

See merge request isc-projects/bind9!9097
2024-06-10 14:16:46 +00:00
Nicki Křížek 4fe6a6bdc0 Add a CHANGES placeholder for [GL #4661] 2024-06-10 16:14:25 +02:00
Evan Hunt 05823eb1b0 Merge branch '4728-allow-transfer-none' into 'main'
change allow-transfer default to "none"

Closes #4728

See merge request isc-projects/bind9!9046
2024-06-05 21:50:47 +00:00
Evan Hunt 2b7cbd8d95 CHANGES and relnotes for [GL #4728] 2024-06-05 10:50:06 -07:00
Evan Hunt c3d3d12911 change allow-transfer default to "none"
Changed the default value for 'allow-transfer' to 'none'; zone
transfers now require explicit authorization.

Updated all system tests to specify an allow-transfer ACL when needed.

Revised the ARM to specify that the default is 'none'.
2024-06-05 10:50:06 -07:00
Ondřej Surý 74cbaf46c9 Merge branch 'ondrej/use-rcu-stack-for-qpcache-deadnodes' into 'main'
Use RCU wait-free stack for qpcache deadnodes

See merge request isc-projects/bind9!8907
2024-06-05 17:40:30 +00:00
Ondřej Surý 086b63f56d Use isc_queue to implement wait-free deadnodes queue
Replace the ISC_LIST based deadnodes implementation with isc_queue which
is wait-free and we don't have to acquire neither the tree nor node lock
to append nodes to the queue and the cleaning process can also
copy (splice) the list into a local copy without acquiring the list.

Currently, there's little benefit to this as we need to hold those
locks anyway, but in the future as we move to RCU based implementation,
this will be ready.

To align the cleaning with our event loop based model, remove the
hardcoded count for the node locks and use the number of the event loops
instead.  This way, each event loop can have its own cleaning as part of
the process.  Use uniform random numbers to spread the nodes evenly
between the buckets (instead of hashing the domain name).
2024-06-05 09:19:56 +02:00
Ondřej Surý a9b4d42346 Add isc_queue implementation on top of cds_wfcq
Add an isc_queue implementation that hides the gory details of cds_wfcq
into more neat API.  The same caveats as with cds_wfcq.

TODO: Add documentation to the API.
2024-06-05 09:19:56 +02:00
Mark Andrews 67b9510988 Merge branch '4736-isc_r_hostdown-was-not-being-handled-by-resolver-c' into 'main'
Resolve "ISC_R_HOSTDOWN was not being handled by resolver.c"

Closes #4736

See merge request isc-projects/bind9!9055
2024-06-04 07:35:36 +00:00
Mark Andrews 71cfa8dfba Add CHANGES note for [GL #4736] 2024-06-04 00:16:30 +10:00
Mark Andrews 56c3dcc5d7 Update resquery_senddone handling of ISC_R_TIMEDOUT
Treat timed out as an address specific error.
2024-06-04 00:15:48 +10:00
Mark Andrews 4e3dd85b8d Update resquery_senddone handling of ISC_R_CONNECTIONRESET
Treat connection reset as an address specific error.
2024-06-04 00:15:48 +10:00
Mark Andrews 180b1e7939 Handle ISC_R_HOSTDOWN and ISC_R_NETDOWN in resolver.c
These error codes should be treated like other unreachable error
codes.
2024-06-04 00:15:48 +10:00
Michał Kępień e7971f6ac8 Merge branch '4706-4707-add-more-label-checks-to-dangerfile.py' into 'main'
Add more label checks to dangerfile.py

Closes #4706 and #4707

See merge request isc-projects/bind9!9040
2024-06-03 11:10:55 +00:00
Michał Kępień aae51cf28d Fail for merge requests with "Affects v9.x" labels
Setting "Affects v9.x" labels on a merge request duplicates information
already present on the GitLab issue associated with that merge request.
For trivial merge requests that are not associated with any GitLab
issue, setting the "Affects v9.x" label(s) is considered unnecessary.
Trigger a failure for every merge request marked with at least one
"Affects v9.x" label.
2024-06-03 13:07:21 +02:00
Michał Kępień 80ec57f198 Warn about auto-generated merge request titles
Merge request titles auto-generated by GitLab are often a source of
confusion regarding the actual contents of a given merge request.  Warn
for merge requests containing titles that look like auto-generated ones.
2024-06-03 13:07:21 +02:00
Michał Kępień 09851e6230 Fail for branches using old-style version suffixes
Using "-v9_x" and "-v9.x" version suffixes for branch names is now
deprecated since some automation logic does not handle these.  Fail for
any merge request using such old-style version suffixes.
2024-06-03 13:07:21 +02:00
Michał Kępień 9359cb9c99 Fail for backports with "Affects v9.x" labels set
Backports are not expected to have any "Affects v9.x" labels set since
those are only meant to be set for merge requests that should have
backports created for them.
2024-06-03 13:07:21 +02:00
Mark Andrews 89d7d52010 Merge branch '3472-ipv4-only-mode-not-respected-for-zone-transfers' into 'main'
Resolve "IPv4-only mode not respected for zone transfers"

Closes #3472

See merge request isc-projects/bind9!8522
2024-06-03 09:59:44 +00:00
Mark Andrews 3834e433f7 Add CHANGES note for [GL #6288] 2024-06-03 18:35:02 +10:00
Mark Andrews 05472e63e8 Don't do DS checks over disabled address families 2024-06-03 18:34:31 +10:00
Mark Andrews d026dbe536 Don't forward UPDATE messages over disabled address families 2024-06-03 18:34:31 +10:00
Mark Andrews 5d99625515 Don't send NOTIFY over disabled address families 2024-06-03 18:34:31 +10:00
Mark Andrews 07cdf3e945 Check that no primaries is logged with -4 or -6
When in -4 mode check that "IPv6 disabled and no IPv4 primaries"
is logged and when in -6 mode check that "IPv4 disabled and no IPv6
primaries" is logged.
2024-06-03 18:34:31 +10:00
Mark Andrews 2cd4303249 Report non-effective primaries
When named is started with -4 or -6 and the primaries for a zone
do not have an IPv4 or IPv6 address respectively issue a log message.
2024-06-03 18:34:31 +10:00
Mark Andrews ecdde04e63 Zone transfers should honour -4 and -6 options
Check if the address family has been disabled when transferring
zones.
2024-06-03 18:34:31 +10:00
Mark Andrews 9be1873ef3 Add helper function isc_sockaddr_disabled 2024-06-03 18:34:31 +10:00
Matthijs Mekking 50a2c308d6 Merge branch '4708-uv-tcp-close-reset-issue' into 'main'
Deal with uv_tcp_close_reset more gracefully

Closes #4708

See merge request isc-projects/bind9!9022
2024-06-03 08:15:35 +00:00
Matthijs Mekking 113968f3a0 Add CHANGES entry for [GL #4708] 2024-06-03 10:15:18 +02:00
Matthijs Mekking c40e5c8653 Call reset_shutdown if uv_tcp_close_reset failed
If uv_tcp_close_reset() returns an error code, this means the
reset_shutdown callback has not been issued, so do it now.
2024-06-03 10:14:47 +02:00
Matthijs Mekking 5b94bb2129 Do not runtime check uv_tcp_close_reset
When we reset a TCP connection by sending a RST packet, do not bother
requiring the result is a success code.
2024-06-03 10:14:47 +02:00
Mark Andrews 91d5c9a878 Merge branch 'marka-placeholder' into 'main'
add placeholder

See merge request isc-projects/bind9!9083
2024-06-03 07:46:04 +00:00
Mark Andrews 728e53be47 add placeholder 2024-06-03 17:18:24 +10:00
Mark Andrews 52a2fb1ab3 Merge branch '2744-warning-checkhints-unable-to-get-root-ns-rrset-from-cache-not-found' into 'main'
Resolve "warning: checkhints: unable to get root NS rrset from cache: not found"

Closes #2744

See merge request isc-projects/bind9!8745
2024-05-31 06:16:24 +00:00
Mark Andrews 5be6ceebc4 Add CHANGES entry for [GL #2744] 2024-05-31 15:40:32 +10:00
Mark Andrews 87e3b9dbf3 Pass a memory context in to dns_cache_create 2024-05-31 15:40:32 +10:00
Mark Andrews 5e77edd074 Use a new memory context when flushing the cache
When the cache's memory context was in over memory state when the
cache was flushed it resulted in LRU cleaning removing newly entered
data in the new cache straight away until the old cache had been
destroyed enough to take it out of over memory state.  When flushing
the cache create a new memory context for the new db to prevent this.
2024-05-31 15:40:32 +10:00
Ondřej Surý 5f69e0a311 Merge branch '4750-set-loop-on-incoming-transfer' into 'main'
Create the new database for AXFR from the dns_zone API

Closes #4750

See merge request isc-projects/bind9!9073
2024-05-29 06:31:28 +00:00
Ondřej Surý 3310cac2b0 Create the new database for AXFR from the dns_zone API
The `axfr_makedb()` didn't set the loop on the newly created database,
effectively killing delayed cleaning on such database.  Move the
database creation into dns_zone API that knows all the gory details of
creating new database suitable for the zone.
2024-05-29 08:30:19 +02:00
Petr Špaček 37ae380e97 Merge branch 'stepan/hypothesis' into 'main'
Expand the wildcard system test with wider use of hypothesis

See merge request isc-projects/bind9!8461
2024-05-28 13:17:32 +00:00
Štěpán BalážikandPetr Špaček 9584a7bdcd Add a helper for uncompressed length of dnspython's dns.name.Name
This is useful for generating using hypothesis but also for other
cases.
2024-05-28 12:12:16 +00:00
Štěpán BalážikandPetr Špaček bb1e5cfa09 Move hypothesis strategies to isctest for later reuse
`isctest.hypothesis` seems to be a nice place to have these.
2024-05-28 12:12:16 +00:00
Štěpán BalážikandPetr Špaček f55cacbbfd Disable deadlines for hypothesis tests when running in CI
The times it takes to run tests CI vary significantly enough
that it makes hypothesis test reach their deadlines and fail randomly
marking the tests as flaky.

This commit disables the deadlines when running in CI.
2024-05-28 12:12:16 +00:00
Štěpán BalážikandPetr Špaček 9943172566 Test nested wildcard special case in the respective system test
See final remark of RFC 4592 2.2.1. for details.
2024-05-28 12:12:16 +00:00
Štěpán BalážikandPetr Špaček d0cfbd398e Expand the wildcard system test with wider use of hypothesis
The queries are now generated more generally (i. e. they have
multiple labels, etc.).
2024-05-28 12:12:16 +00:00
Štěpán BalážikandPetr Špaček 5d738cd9ed Add hypothesis strategies for generating DNS names and company
The most important being `dns_names` that generates dns.name.Name
objects based on given paramaters.

No guarantees are given when it comes the uniformity of generated
samples, however it plays nicely with the hypothesis' shrinking
algorithm.

Once we use hypothesis more widely (in at least one more test) this file
should be moved for it to be reused easily.
2024-05-28 12:12:16 +00:00
Štěpán BalážikandPetr Špaček e7d46ad8ba Extend isctest package with more utility functions
Check for more rcodes and various properties needed in the wildcard
test. Add a `name` module for various dns.name.Name operations (with
`prepend_label` function only now).

Expose `timeout` as a parameter of `query.tcp`/`query.udp`.
2024-05-28 12:12:16 +00:00
Štěpán BalážikandPetr Špaček 02d1c5fc89 Silent pylint's line-too-long warning as it's handled better by black
Black allows the lines with string literals to be longer, which is
convenient for descriptive error messages.
2024-05-28 12:12:16 +00:00
Nicki Křížek 8cdfccf140 Merge branch 'nicki/use-bind-team-gitlab-tokens' into 'main'
Use bind-team tokens for CI gitlab access

See merge request isc-projects/bind9!9067
2024-05-27 11:13:34 +00:00
Nicki Křížek d391f0c958 Use BIND_TEAM_WRITE_TOKEN for autobackport bot
This is done to unify the token usage across our repositories to
simplify token maintenance.
2024-05-27 13:03:13 +02:00
Nicki Křížek 6767172bc0 Use BIND_TEAM_API_TOKEN for danger bot
This is done to unify the token usage across our repositories to
simplify token maintenance.
2024-05-27 13:03:10 +02:00
Ondřej Surý b70ef5e5a4 Merge branch 'ondrej/cleanup-dns_db' into 'main'
Cleanup the dns_cache unit

See merge request isc-projects/bind9!9064
2024-05-25 09:48:34 +00:00
Aram SargsyanandOndřej Surý 4d3c31b928 fixup! Merge branch 'ondrej/light-cleanup-of-rdataslab' into 'main' 2024-05-25 11:47:33 +02:00
Ondřej Surý 3feabc8a22 Cleanup the dns_cache unit
Remove duplicate code and use ISC_REFCOUNT_{DECL,IMPL} macros.
2024-05-25 11:47:33 +02:00
Michal Nowak 08eef0fa0d Merge branch 'mnowak/cross-version-config-tests-drop-allow_failure-true' into 'main'
Drop "allow_failure: true" in cross-version-config-tests job

See merge request isc-projects/bind9!9044
2024-05-24 11:44:39 +00:00
Michal NowakandNicki Křížek c58dd6e78f Workaround temporary cross-version-config-tests limitation
The system test from the BIND 9.19.24 release does not include the
isctest/vars/autoconf.py file from 9.19.25-dev, and therefore the job
will fail before the 9.19.25 release is published. In the meantime,
consider using the conf.sh file.
2024-05-24 11:01:40 +02:00
Nicki Křížek e712cf613f Fix oversight in cross-version-config test
This is a followup for 5e7b3d9ef36b199e2d24d385593a8e2f7d541b65. The
change slipped by during refactoring and this line wasn't updated.
2024-05-24 11:00:09 +02:00
Michal NowakandNicki Křížek 8d99ce28e8 Revert "Allow failure of cross-version-config test"
This reverts commit b99cdfab9d.
2024-05-24 10:59:27 +02:00
Ondřej Surý 7e87e2657a Merge branch 'ondrej/light-cleanup-of-rdataslab' into 'main'
Refactor the common buffer manipulation in rdataslab.c in macros

See merge request isc-projects/bind9!9063
2024-05-24 08:29:54 +00:00
Ondřej Surý 03ed19cf71 Refactor the common buffer manipulation in rdataslab.c in macros
The rdataslab.c was full of code like this:

        length = raw[0] * 256 + raw[1];

and

        count2 = *current2++ * 256;
        count2 += *current2++;

Refactor code like this into peek_uint16() and get_uint16 macros
to prevent code repetition and possible mistakes when copy and
pasting the same code over and over.

As a side note for an entertainment of a careful reader of the commit
messages: The byte manipulation was changed from multiplication and
addition to shift with or.

The difference in the assembly looks like this:

MUL and ADD:

	movzx   eax, BYTE PTR [rdi]
        movzx   edi, BYTE PTR [rdi+1]
        sal     eax, 8
        or      edi, eax

SHIFT and OR:

        movzx   edi, WORD PTR [rdi]
        rol     di, 8
        movzx   edi, di

If the result and/or buffer is then being used after the macro call,
there's more differences in favor of the SHIFT+OR solution.
2024-05-24 09:52:45 +02:00
Michal Nowak c8289279f0 Merge branch 'mnowak/alpine-3.20' into 'main'
Add Alpine Linux 3.20

See merge request isc-projects/bind9!9059
2024-05-23 11:19:26 +00:00
Michal Nowak 6f22e79ef9 Add Alpine Linux 3.20 2024-05-23 10:58:25 +02:00
Michal Nowak 1f5143e066 Merge branch 'mnowak/short-stress-tests-should-keep-artifacts' into 'main'
Short stress tests should keep artifacts

See merge request isc-projects/bind9!9056
2024-05-22 10:55:18 +00:00
Michal Nowak aa72747c80 Short stress tests should keep artifacts 2024-05-22 10:46:28 +02:00
Aydın Mercan 4de93e86fa Merge branch 'aydin/fix-trace' into 'main'
Fix typing mistakes in trace macros

See merge request isc-projects/bind9!9050
2024-05-20 11:45:22 +00:00
Aydın MercanandEvan Hunt 03a59cbb04 reinsert accidentally removed + in db trace
It only affects development when using `DNS_DB_TRACE`.
2024-05-17 18:11:23 -07:00
Aydın MercanandEvan Hunt 49e62ee186 fix typing mistakes in trace macros
The detach function declaration in `ISC__REFCOUNT_TRACE_DECL` had an
returned an accidental implicit int. While not allowed since C99, it
became an error by default in GCC 14.

`ISC_REFCOUNT_TRACE_IMPL` and `ISC_REFCOUNT_STATIC_TRACE_IMPL` expanded
into the wrong macros, trying to declare it again with the wrong number
of parameters.
2024-05-17 18:11:23 -07:00
Evan Hunt 5972a80714 Merge branch '4730-clang-format-header-file-changes' into 'main'
Resolve "Clang format header file changes"

Closes #4730

See merge request isc-projects/bind9!9047
2024-05-17 23:18:47 +00:00
Mark AndrewsandEvan Hunt 1697011af6 Ignore reformat sources with up-to-date clang-format-18 2024-05-17 16:03:46 -07:00
Mark AndrewsandEvan Hunt b7de2c7cb9 Clang-format header file changes 2024-05-17 16:03:21 -07:00
Arаm Sаrgsyаn add3a6ee8c Merge branch 'aram/mr8937-changes-placeholder' into 'main'
Add a CHANGES placeholder for [GL !8937]

See merge request isc-projects/bind9!9049
2024-05-17 10:48:23 +00:00
Aram Sargsyan 563ed741bf Add a CHANGES placeholder for [GL !8937] 2024-05-17 10:20:48 +00:00
Mark Andrews 8246465513 Merge branch '4726-increase-formerr-coverage-in-message-parsing' into 'main'
Resolve "Increase FORMERR coverage in message parsing"

Closes #4726

See merge request isc-projects/bind9!9034
2024-05-17 05:16:48 +00:00
Mark Andrews 6e9ed4983e add test cases for several FORMERR code paths:
- duplicated question
  - duplicated answer
  - qtype as an answer
  - two question types
  - question names
  - nsec3 bad owner name
  - short record
  - short question
  - mismatching question class
  - bad record owner name
  - mismatched class in record
  - mismatched KEY class
  - OPT wrong owner name
  - invalid RRSIG "covers" type
  - UPDATE malformed delete type
  - TSIG wrong class
  - TSIG not the last record
2024-05-17 13:39:22 +10:00
Evan Hunt 6a9ac65f0c Merge branch '4683-qpzone-tsan-fix' into 'main'
replace qpzone node attributes with atomics

Closes #4683

See merge request isc-projects/bind9!9033
2024-05-17 00:33:48 +00:00
Evan Hunt 9c882f1e69 replace qpzone node attriutes with atomics
there were TSAN error reports because of conflicting uses of
node->dirty and node->nsec, which were in the same qword.

this could be resolved by separating them, but we could also
make them into atomic values and remove some node locking.
2024-05-17 00:33:35 +00:00
Matthijs Mekking bcc6039bf5 Merge branch 'matthijs-qp-set-iterator' into 'main'
Rewrite fix_iterator()

See merge request isc-projects/bind9!9038
2024-05-16 09:50:08 +00:00
Matthijs Mekking 82e9d93c0b Two more qp test cases
Add two more cases that should select different predecessors from
different twigs.
2024-05-16 09:49:41 +00:00
Matthijs Mekking f882101265 Rewrite qp fix_iterator()
The fix_iterator() function had a lot of bugs in it and while fixing
them, the number of corner cases and the complexity of the function
got out of hand. Rewrite the function with the following modifications:

The function now requires that the iterator is pointing to a leaf node.
This removes the cases we have to deal when the iterator was left on a
dead branch.

From the leaf node, pop up the iterator stack until we encounter the
branch where the offset point is before the point where the search key
differs. This will bring us to the right branch, or at the first
unmatched node, in which case we pop up to the parent branch. From
there it is easier to retrieve the predecessor.

Once we are at the right branch, all we have to do is find the right
twig (which is either the twig for the character at the position where
the search key differs, or the previous twig) and walk down from there
to the greatest leaf or, in case there is no good twig, get the
previous twig from the successor and get the greatest leaf from there.

If there is no previous twig to select in this branch, because every
leaf from this branch node is greater than the one we wanted, we need
to pop up the stack again and resume at the parent branch. This is
achieved by calling prevleaf().
2024-05-16 09:49:41 +00:00
Matthijs Mekking 8b8c16d7a4 Get anyleaf when qp lookup is on a dead end branch
Move the fix_iterator out of the loop and only call it when we found
a leaf node. This leaf node may be the wrong leaf node, but fix_iterator
should correct that.

Also, when we don't need to set the iterator, just get any leaf. We
only need to have a leaf for the qpkey_compare and the end result does
not matter if compare was against an ancestor leaf or any leaf below
that point.
2024-05-16 09:49:41 +00:00
Michal Nowak 6b89d66ce8 Merge tag 'v9.19.24' 2024-05-16 11:37:12 +02:00
Mark Andrews ed5b9b0898 Merge branch '4517-dnssec-verify-reports-errors-in-nsec3-chain' into 'main'
Resolve "dnssec-verify reports errors in NSEC3 chain"

Closes #4517

See merge request isc-projects/bind9!8631
2024-05-16 01:52:55 +00:00
Mark Andrews e4dbf4be8e Add CHANGES note for [GL #4517] 2024-05-16 10:28:27 +10:00
Mark Andrews dd13f41ae1 Don't sign non-apex DNSKEY records
DNSKEY can only be validated if it is signed by itself.  Stop
attempting to sign non apex DNSKEY RRsets.
2024-05-16 10:28:27 +10:00
Mark Andrews 315ad2df7a Remove invalid DNSKEY RRset from zone 2024-05-16 10:28:27 +10:00
Mark Andrews 122111f75e Add regression test data for [GL #4517]
An obscured DNSKEY RRset at a delegation was incorrectly added to
the NSEC/NSEC3 type bit map leading to zone verification failures.
This adds such a RRset to the test zone.
2024-05-16 10:28:27 +10:00
Mark Andrews b3efc15be4 Fail if there are non apex DNSKEYs
DNSSEC only works when DNSKEYs are self signed.  This only occurs
when the DNSKEY RRset is at the apex.  Cause dnssec-signzone to
fail if it attempts to sign an non-apex DNSKEY RRset.
2024-05-16 10:28:27 +10:00
Mark Andrews ec3c624814 Properly build the NSEC/NSEC3 type bit map
DNSKEY was incorrectly being added to the NESC/NSEC3 type bit map
when it was obscured by the delegation.  This lead to zone verification
failures.
2024-05-16 10:27:49 +10:00
Mark Andrews e84615629f Properly update 'maxtype'
'maxtype' should be checked to see if it should be updated whenever
a type is added to the type map.
2024-05-16 10:20:49 +10:00
Ondřej Surý 333d1881f9 Merge branch 'ondrej/isc_httpd-reference-counting' into 'main'
Properly attach/detach isc_httpd in case read ends earlier than send

See merge request isc-projects/bind9!9037
2024-05-15 12:32:15 +00:00
Ondřej Surý eb862ce509 Properly attach/detach isc_httpd in case read ends earlier than send
An assertion failure would be triggered when sending the TCP data ends
after the TCP reading gets closed.  Implement proper reference counting
for the isc_httpd object.
2024-05-15 12:22:10 +02:00
Michał Kępień 5fd3530741 Merge branch '4719-placeholder' into 'main'
Add placeholder for GL #4719

See merge request isc-projects/bind9!9036
2024-05-15 08:21:55 +00:00
Michał Kępień ea6032146c Add placeholder for GL #4719 2024-05-15 10:20:19 +02:00
Evan Hunt 0748847400 Merge branch '4717-qp-lookup-creates-incorrect-chain' into 'main'
Fix dns_qp_lookup() chain inconsistency after fix_iterator()

Closes #4717

See merge request isc-projects/bind9!9028
2024-05-14 20:36:11 +00:00
Matthijs MekkingandEvan Hunt 730e532cac Test check_predecessors with chain
In addition to testing check_qpchain in combination with qpiter,
test check_predecessors in combination with a qpchain.
2024-05-14 12:58:46 -07:00
Evan Hunt b6815de316 Fix QP chain on partial match
When searching for a requested name in dns_qp_lookup(), we may add
a leaf node to the QP chain, then subsequently determine that the
branch we were on was a dead end. When that happens, the chain can be
left holding a pointer to a node that is *not* an ancestor of the
requested name.

We correct for this by unwinding any chain links with an offset
value greater or equal to that of the node we found.
2024-05-14 12:58:46 -07:00
Petr ŠpačekandEvan Hunt 5d96f11693 Unit test to demonstrate issue #4717
Iterator in lookup() call must be non-NULL to trigger the issue.
Run chain tests twice, once without iterator and second time with
iterator.
2024-05-14 12:58:46 -07:00
Matthijs MekkingandEvan Hunt 91de4f6490 Refactor fix_iterator
The code below the if/else construction could only be run if the 'if'
code path was taken. Move the code into the 'if' code block so that
it is more easier to read.
2024-05-14 12:58:46 -07:00
Nicki Křížek ac569ad544 Merge branch 'nicki/add-mailmap' into 'main'
Add .mailmap to the git repo

See merge request isc-projects/bind9!9025
2024-05-14 11:28:00 +00:00
Nicki Křížek 986013a708 Add .mailmap to the git repo
Mailmap can be used to unify the display name in standard git tools.
2024-05-14 13:05:45 +02:00
Michal Nowak d9fbbd537d Merge branch 'mnowak/pytest_rewrite_include-multiplecfg' into 'main'
Rewrite include-multiplecfg system test to pytest

See merge request isc-projects/bind9!8806
2024-05-14 10:46:10 +00:00
Michal Nowak e9e8753306 Rewrite include-multiplecfg system test to pytest 2024-05-14 11:45:55 +02:00
Michal Nowak 77a42f8875 Use isctest.run.cmd() helper function in tests 2024-05-14 11:45:55 +02:00
Tom KrizekandMichal Nowak a9f3fb3db5 Add isctest.run.cmd() helper function 2024-05-14 11:45:55 +02:00
Aydın Mercan 4f34011ccc Merge branch 'aydin/author-expand' into 'main'
Expand list in chaos authors response

See merge request isc-projects/bind9!9026
2024-05-13 09:57:25 +00:00
Aydın Mercan df862f9fef Expand list in chaos authors response
The list isn't exactly maintained but it helped with some BIND history
tracking and is basically harmless so it might be worth holding onto it.
I have adapted the name to ASCII so IDN support won't be necessary.
2024-05-13 11:24:29 +03:00
Aydın Mercan aa860b3ab1 Merge branch '4668-request-to-add-a-new-statistic-recursive-client-high-water-in-rndc-status-and-stats-channel' into 'main'
Add new statistics variable for recursive client high-water

Closes #4668

See merge request isc-projects/bind9!9023
2024-05-10 10:52:51 +00:00
Aydın Mercan d6dd51bb1b Added CHANGES and release note for [GL #4668] 2024-05-10 12:08:52 +03:00
Aydın Mercan e037520b92 Keep track of the recursive clients highwater
The high-water allows administrators to better tune the recursive
clients limit without having to to poll the statistics channel in high
rates to get this number.
2024-05-10 12:08:52 +03:00
Aydın Mercan 09e4fb2ffa Return the old counter value in isc_stats_increment
Returning the value allows for better high-water tracking without
running into edge cases like the following:

0. The counter is at value X
1. Increment the value (X+1)
2. The value is decreased multiple times in another threads (X+1-Y)
3. Get the value (X+1-Y)
4. Update-if-greater misses the X+1 value which should have been the
   high-water
2024-05-10 12:08:52 +03:00
Nicki Křížek ced011f05a Merge branch 'tkrizek/pytest-conf-cleanup' into 'main'
Define environment variables in pytest instead of conf.sh

See merge request isc-projects/bind9!8800
2024-05-09 16:26:26 +00:00
Nicki Křížek faeec83b64 Ensure OPENSSL_CONF is a file if it exists
Prevent unexpected behavior in cases where the OPENSSL_CONF path would
exist, but it wouldn't point to a file.
2024-05-09 17:08:11 +02:00
Nicki Křížek ac7c657d19 Move isctest.var initialization to conftest.py
The environment variable initialization requires logging to be set up
first. Ensure the initialization is delayed until loggers have been set
up.
2024-05-09 17:08:11 +02:00
Tom KrizekandNicki Křížek 2a09f632ab Use a dedicated file for each autoconf variable
To avoid any escaping issues or messing with a language-specific format
when the variable has to be parsed, create a dedicated file for each
variable that is obtained from autoconf.
2024-05-09 17:08:10 +02:00
Tom KrizekandNicki Křížek b99cdfab9d Allow failure of cross-version-config test
The test is bound to fail until it is executed against a new release
which will include the pytest env var refactoring.
2024-05-09 17:08:10 +02:00
Tom KrizekandNicki Křížek 2d1f348483 Move env var initialization to isctest.vars
Make sure all initialization takes place in isctest.vars.__init__ and
export the initial env vars there. Remove the no longer needed env
fixture and use os.environ instead.
2024-05-09 17:08:10 +02:00
Tom KrizekandNicki Křížek 1f6f2234d8 Move dir env var handling to isctest.vars.dirs 2024-05-09 17:08:10 +02:00
Tom KrizekandNicki Křížek 41cb553bdd Move port env vars into isctest.vars.ports module
The fixture for port assignment isn't needed, replace it with the common
way of handling environment variables.
2024-05-09 17:08:10 +02:00
Tom KrizekandNicki Křížek cca26efe52 Don't export openssl-related env vars unless set
If OPENSSL_CONF is exported as an empty string, it will cause issues on
rhel9fips. Allow the environment variables to be set and exported, but
make sure to only export them if they have been set by the user.
2024-05-09 17:08:09 +02:00
Tom KrizekandNicki Křížek b100ce4c88 Parse openssl-related vars in pytest
The openssl config needs to be parsed for some tests that use SoftHSM2.
Rewrite the parsing to python and ensure the required variables are
properly set test-wide.
2024-05-09 17:08:09 +02:00
Tom KrizekandNicki Křížek e531bfc3b3 Adjust .gitlab-ci env var detection with sed
The environment variables set by autoconf were moved to autoconf.py.
2024-05-09 17:08:09 +02:00
Tom KrizekandNicki Křížek 46433ae17b Coalesce system test variables
Provide a single point of access to all the variables used by tests. Use
a custom dict-like structure to access the underlying data without
making a copy. This allows the individual modules to update the contents
at runtime, which is used for some variables.
2024-05-09 17:08:09 +02:00
Tom KrizekandNicki Křížek 308a8727e5 Format conf.sh with shfmt
No manual changes in this commit - simply running shfmt for proper shell
code formatting.
2024-05-09 17:08:09 +02:00
Tom KrizekandNicki Křížek 8c6e6758b5 Load env vars in shell-only processing of conf.sh
While this isn't required for pytest operation and execution of the
system test suite, it can be handy to allow test script development and
debugging. Especially setup scripts often source conf.sh and expect
environment variables to be loaded. If these scripts are executed
stand-alone, the environment variables need to be loaded from the python
package.
2024-05-09 17:08:09 +02:00
Tom KrizekandNicki Křížek ab27f504ca Move environment variables from conf.sh to pytest
Remove conf.sh.in and move the environment variables into isctest/vars
python package. This enabled the removal of an ugly pytest hack which
loaded and parsed these variables from the environment.
2024-05-09 17:08:08 +02:00
Tom KrizekandNicki Křížek b3caa9226d Remove terminal color support from conf.sh.common
Pytest processes all the output, so the terminal colors are no longer
interpreted. Remove the obsolete code.
2024-05-09 17:08:07 +02:00
Michal Nowak 91275eb6bc Merge branch '4635-add-rbt-ci-job' into 'main'
Add jobs for RBT zone- & cache-enabled GCC builds

Closes #4635

See merge request isc-projects/bind9!8997
2024-05-09 13:50:42 +00:00
Mark AndrewsandMichal Nowak 1482e9bbb9 Address qp/rbtdb backup file style differences
qp and rbtdb produce stylistically different backup files.  This
was causing the xferquota system test to fail.  This has been
addressed by making the test independent of the stylistic differences.
2024-05-09 15:03:45 +02:00
Michal Nowak 8f687fff35 Add jobs for RBT zone- & cache-enabled GCC builds 2024-05-09 15:03:45 +02:00
Mark Andrews 149c61b3ca Merge branch '4502-missing-reference' into 'main'
Resolve "Missing reference?"

Closes #4502

See merge request isc-projects/bind9!8996
2024-05-09 00:08:09 +00:00
Mark Andrews 53698ad58d Add CHANGES for [GL #4502] 2024-05-09 08:17:44 +10:00
Mark Andrews 88c48dde5e Stop processing catalog zone changes when shutting down
Abandon catz_addmodzone_cb  and catz_delzone_cb processing if the
loop is shutting down.
2024-05-09 08:17:44 +10:00
Mark Andrews 941ad2b3c5 catz should use weak attachment to the view 2024-05-09 08:17:44 +10:00
Mark Andrews 307e3ed9a6 catzs->view should maintain a view reference
Use dns_view_weakattach and dns_view_weakdetach to maintain a
reference to the view referenced through catzs->view.
2024-05-09 08:17:44 +10:00
Petr Špaček 9357019498 Merge branch 'pspacek/doc-rfc-ref-update' into 'main'
Update RFC references in documentation

See merge request isc-projects/bind9!9020
2024-05-08 07:07:48 +00:00
Petr Špaček ead4a110ad Update reference for Catalog Zones spec to RFC9432 2024-05-07 13:38:40 +02:00
Petr Špaček 153311da2d Update KSK root sentinel references
The mechanism was published as RFC 8509. I've briefly looked at diff
between versions -08 and the RFC and did not find significant protocol
change. Quick manual check confirms what we seem to comply with the
published protocol.
2024-05-07 13:38:40 +02:00
Petr Špaček 8e4c0329c3 Mention RFC 9276 Guidance for NSEC3 Parameter Settings
Draft was eventually published as RFC 9276 but we did not update our
docs. Also add couple mentions in relevant places in the ARM and
dnssec-signzone man page, mainly around "do not touch" places.
2024-05-07 13:38:40 +02:00
Petr Špaček c5d6769e11 Update DNSSEC Operational Practices references to Version 2
RFC 4641 was obsoleted by 6781.
2024-05-07 13:38:10 +02:00
Mark Andrews 12ae798bc7 Merge branch '4704-svcb-https-bind9-and-dig-fail-to-parse-packet-if-zero-svcpriority-and-existing-svcparams' into 'main'
Resolve "SVCB/HTTPS: Bind9 and Dig fail to parse packet if zero SvcPriority and existing SvcParams"

Closes #4704

See merge request isc-projects/bind9!9000
2024-05-07 02:07:21 +00:00
Mark Andrews e0b5c85f5a Add CHANGES note for [GL #4704] 2024-05-07 11:21:20 +10:00
Mark Andrews 799046929c Only check SVBC alias forms at higher levels
Allow SVBC (HTTPS) alias form with parameters to be accepted from
the wire and when transfered.  This is for possible future extensions.
2024-05-07 11:20:49 +10:00
Mark Andrews 836da75dc1 Merge branch '4357-treat-notfile-as-eof' into 'main'
Remove infinite loop on ISC_R_NOFILE

Closes #4357

See merge request isc-projects/bind9!9004
2024-05-07 01:03:00 +00:00
Mark Andrews 236a38a7c9 Add CHANGES note for [GL #4357] 2024-05-07 10:01:48 +10:00
Mark Andrews e697d20f00 Test including a directory in a zone file 2024-05-07 10:01:12 +10:00
Mark Andrews efd27bb82d Remove infinite loop on ISC_R_NOFILE
When parsing a zonefile named-checkzone (and others) could loop
infinitely if a directory was $INCLUDED.  Record the error and treat
as EOF when looking for multiple errors.

This was found by Eric Sesterhenn from X41.
2024-05-07 10:01:12 +10:00
Mark Andrews 1a12fac371 Merge branch '4353-fix-nibbles' into 'main'
Address infinite loop when processing $GENERATE

Closes #4353

See merge request isc-projects/bind9!9003
2024-05-06 23:58:36 +00:00
Mark Andrews f154187fd0 Add CHANGES note for [GL #4353] 2024-05-07 09:20:12 +10:00
Mark Andrews 32535de856 Test $GENERATE in nibble mode with a negative value
Negative values used to cause $GENERATE to loop forever.
2024-05-07 09:19:43 +10:00
Mark Andrews 371824f078 Address infinite loop when processing $GENERATE
In nibble mode if the value to be converted was negative the parser
would loop forever.  Process the value as an unsigned int instead
of as an int to prevent sign extension when shifting.

This was found by Eric Sesterhenn from X41.
2024-05-07 09:19:43 +10:00
Michal Nowak d08e3ad9d9 Merge branch 'mnowak/fedora-40' into 'main'
Add Fedora 40

See merge request isc-projects/bind9!8979
2024-05-06 17:40:55 +00:00
Michal Nowak b3a11f38b1 Supress the leak detection in xmlNewGlobalState 2024-05-06 19:35:36 +02:00
Michal Nowak 1a09f822ad Add Fedora 40 2024-05-06 19:35:29 +02:00
Michal Nowak 4247e36340 Merge branch 'mnowak/ubuntu-24.04-noble-numbat' into 'main'
Add Ubuntu 24.04 LTS (Noble Numbat)

See merge request isc-projects/bind9!8980
2024-05-06 16:35:59 +00:00
Michal Nowak d02ed1a0eb Add Ubuntu 24.04 LTS (Noble Numbat) 2024-05-06 17:58:22 +02:00
Michal Nowak 3daf2ee76e Merge branch 'mnowak/openbsd-7.5' into 'main'
Add OpenBSD 7.5

See merge request isc-projects/bind9!8965
2024-05-06 15:20:24 +00:00
Michal Nowak 102fccdcba Add OpenBSD 7.5 2024-05-06 17:11:05 +02:00
Michal Nowak c3a7d9cd29 Merge branch '4711-stress-test-finer-runtime-granularity' into 'main'
Add short version of "stress" tests to MR-triggered pipelines

Closes #4711

See merge request isc-projects/bind9!9002
2024-05-06 14:05:22 +00:00
Michal Nowak f33b746353 Add short "stress" test jobs 2024-05-06 15:36:49 +02:00
Michal Nowak 58a1a50e76 Rename "stress" tests to long "stress" tests 2024-05-06 15:36:49 +02:00
Michal Nowak 1d77a3b3c6 Revert "Drop parallel build from stress tests"
This reverts commit 3fd7e7c81f.

In AWS this is no longer a concern.
2024-05-06 15:36:49 +02:00
Nicki Křížek 12fed598ea Merge branch '4543-reenable-unreachable-dnssec-checks' into 'main'
Re-enable accidentally disabled dnssec checks

Closes #4543

See merge request isc-projects/bind9!8667
2024-05-06 13:15:49 +00:00
Matthijs MekkingandNicki Křížek 02f5d82333 Update hours-vs-days test
This test is outdated because it tested the 'sig-validity-interval'
option that has been replaced by dnssec-policy's 'signatures-validity',
'signatures-refresh', and 'signatures-jitter' options.

Nevertheless, it tests if the jitter is spread correctly.

Update the test to make use of 'signatures-jitter', set the value
to 1 day (meaning resign in 499 days since 'signatures-validity' is
set to 500 days).

Note that this previously changed erroneously the refresh value to
449 days (should have been 499 days, but that is not allowed by
checkconf, since it is above 90% of 'signatures-validity').
2024-05-06 14:44:10 +02:00
Matthijs MekkingandNicki Křížek a68f8c7cf0 Fix dnssec system test iterations too high
After we have changed the maximum allowed iterations to 51 for signing,
the NSEC3 chain has changed and requires one more NSEC to be returned
in the answer (plus corresponding RRSIG). So the expected number or
records in the authority section is now 8.
2024-05-06 14:44:10 +02:00
Matthijs MekkingandNicki Křížek fc5eb493c9 Offline KSK and dnssec-policy not yet supported
If the key is offline and the keymgr runs, it will treat it as a missing key,
and generate a new key (according to the policy). Fix the test by putting
back the KSK temporarily when we run 'rndc loadkeys'.
2024-05-06 14:44:10 +02:00
Matthijs MekkingandNicki Křížek ebb90ba77f Fix ZSK rollovers in dnssec system test
1. When generating keys, don't set timing metadata. Otherwise keys
   are considered to be in use and won't be selected when dnssec-policy
   starts a new key rollover.

2. Add an extra check to make sure the new ZSK (zsk2) is prepublished.
   Also add a check to make sure it has become active.

3. When using dnssec-settime, add -s to also write to key state files.
2024-05-06 14:44:10 +02:00
Tom KrizekandNicki Křížek 2e26eac31c Ensure dnssec test doesn't leak queries to root servers
The config was recently modified to ensure ns4 won't leak any queries to
root servers. However, the test wasn't executed and it turns out the way
this was handled actually broke the test case. Add our custom root hint
to both of the views to ensure the test can still pass without leaking
any queries.
2024-05-06 14:44:09 +02:00
Tom KrizekandNicki Křížek 672b07a503 Re-enable accidentally disabled dnssec checks
Remove the premature exit statement which made the rest of the checks
unreachable.
2024-05-06 14:44:08 +02:00
Matthijs Mekking 005c1386ea Merge branch '3323-different-rpz-soa-ttl' into 'main'
RPZ response's SOA record is incorrectly set to 1

Closes #3323

See merge request isc-projects/bind9!8998
2024-05-06 10:10:42 +00:00
Matthijs Mekking 2726b569b1 Add release note and CHANGES for #3323 2024-05-06 11:39:02 +02:00
Matthijs Mekking 5d7e613e81 RPZ response's SOA record is incorrectly set to 1
An RPZ response's SOA record TTL is set to 1 instead of the SOA TTL,
a boolean value is passed on to query_addsoa, which is supposed to be
a TTL value. I don't see what value is appropriate to be used for
overriding, so we will pass UINT32_MAX.
2024-05-06 11:38:36 +02:00
Matthijs Mekking 2e99c66a00 Merge branch 'matthijs-offline-ksk-add-ksk-on-sign' into 'main'
Add DNSKEY record for KSK when creating the SKR

See merge request isc-projects/bind9!8986
2024-05-06 09:30:10 +00:00
Matthijs Mekking 03e8747aaa Retrieve DNSKEY TTL from policy
The desired DNSKEY TTL is configured in the policy so set it to that
value on new RRsets. Note that the same TTL is used for CDS and CDNSKEY.
2024-05-06 10:54:41 +02:00
Matthijs Mekking d9fb2054f1 Rename create_cds to create_ksk
Now that this function also creates the DNSKEY record for the KSKs,
as well as other associated records such as CDS and CDNSKEY, rename
the function to something slightly better.
2024-05-06 10:54:41 +02:00
Matthijs Mekking 30ce8abd30 Add DNSKEY rr corresponding to the KSK to the SKR
When signing a KSR, add the DNSKEY records from the signing KSK(s) to
the DNSKEY RRset prior to signing.
2024-05-06 10:54:41 +02:00
Matthijs Mekking 6b7bd77596 Don't add KSKs to the KSR
Creating the KSR happens on the "ZSK side". The KSK is offline and while
the public key and state file may be present, draft-icann-dnssec-keymgmt-01.txt
suggest that the KSR only contains ZSKs.

This is also what knot dns does, so it would also be in the spirit of
interoperability.
2024-05-06 10:54:41 +02:00
Matthijs Mekking 3bf4ec95dd Merge branch 'matthijs-fix-dnssec-ksr-version-missing' into 'main'
Fix missing version in KSR

See merge request isc-projects/bind9!8983
2024-05-06 08:40:46 +00:00
Matthijs Mekking 0071e6c10a Fix missing version in KSR
The final line in a KSR ";; KeySigningRequest generated at ..." was
missing the version number, that has now been fixed.

Thanks Libor Peltan for reporting.
2024-05-06 09:52:01 +02:00
Michal Nowak b327da30f8 Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.25' into 'main'
Set up version and release notes for BIND 9.19.25

See merge request isc-projects/bind9!9005
2024-05-03 14:01:59 +00:00
Michal Nowak 4fae72e2de Set up release notes for BIND 9.19.25 2024-05-03 15:51:53 +02:00
Michal Nowak fd880c29f2 Update BIND version to 9.19.25-dev 2024-05-03 15:51:53 +02:00
Michal Nowak be3e3da7b2 Update BIND version for release 2024-05-03 09:11:45 +02:00
Michal Nowak b507cb7bc2 Add a CHANGES marker 2024-05-03 09:10:49 +02:00
Michal Nowak 8793a41d8f Merge branch 'mnowak/prepare-documentation-for-bind-9.19.24' into 'v9.19.24-release'
Prepare documentation for BIND 9.19.24

See merge request isc-private/bind9!684
2024-05-03 07:08:26 +00:00
Michal Nowak 0f81fbcb1f Tweak and reword release notes 2024-05-02 19:16:58 +02:00
Michal Nowak 8cdc0eafd9 Prepare release notes for BIND 9.19.24 2024-05-02 12:31:00 +02:00
Arаm Sаrgsyаn 265b08b98e Merge branch '4710-qpcache-crash-on-assert-in-decref' into 'main'
Fix a bug in expireheader() call arguments order

Closes #4710

See merge request isc-projects/bind9!9001
2024-05-02 10:25:55 +00:00
Aram Sargsyan 8052848d50 Fix a bug in expireheader() call arguments order
The expireheader() call in the expire_ttl_headers() function
is erroneous as it passes the 'nlocktypep' and 'tlocktypep'
arguments in a wrong order, which then causes an assertion
failure.

Fix the order of the arguments so it corresponds to the function's
prototype.
2024-05-02 08:38:35 +00:00
Evan Hunt f8f0f45043 Merge branch '4702-qpiter-fix' into 'main'
dns_qp_lookup() doesn't handle searches for escaped characters well

Closes #4702

See merge request isc-projects/bind9!8999
2024-05-01 08:13:58 +00:00
Evan Hunt 9bbba20fbf CHANGES for [GL #4702] 2024-05-01 00:36:51 -07:00
Evan Hunt f81bf6bafd handle QP lookups involving escaped characters better
in QP keys, characters that are not common in DNS names are
encoded as two-octet sequences. this caused a glitch in iterator
positioning when some lookups failed.

consider the case where we're searching for "\009" (represented
in a QP key as {0x03, 0x0c}) and a branch exists for "\000"
(represented as {0x03, 0x03}). we match on the 0x03, and continue
to search down. at the point where we find we have no match,
we need to pop back up to the branch before the 0x03 - which may
be multiple levels up the stack - before we position the iterator.
2024-05-01 00:36:51 -07:00
Evan Hunt a23ce2c53c add another test case for an incorrect QP iterator position
build a database tree with names containing control characters,
search for another control character, and verify the iterator is
positioned correctly.
2024-05-01 00:36:16 -07:00
Matthijs MekkingandEvan Hunt ada46eb9f5 Add a unit test case for converting \000\009
Sanity checking that this domain converts to the key I am expecting.

Also fix some of the other names that had trailing 0x02 bits.
2024-04-30 16:00:13 -07:00
Evan Hunt a0bd1e67cd add a test method to print QP keys
add a method qp_test_printkey() to print the name encoded in a QP key.
2024-04-30 15:58:17 -07:00
Evan Hunt 539518bfba Merge branch 'each-qpcache-cleanup' into 'main'
clean up and speed up qpcache

See merge request isc-projects/bind9!8987
2024-04-30 20:28:52 +00:00
Evan Hunt 4b02246130 fix more ambiguous struct names
there were some structure names used in qpcache.c and qpzone.c that
were too similar to each other and could be confusing when debugging.
they have been changed as follows:

in qcache.c:
- changed_t was unused, and has been removed
- search_t -> qpc_search_t
- qpdb_rdatasetiter_t -> qpc_rditer_t
- qpdb_dbiterator_t -> qpc_dbiter_t

in qpzone.c:
- qpdb_changed_t -> qpz_changed_t
- qpdb_changedlist_t -> qpz_changedlist_t
- qpdb_version_t -> qpz_version_t
- qpdb_versionlist_t -> qpz_versionlist_t
- qpdb_search_t -> qpz_search_t
- qpdb_load_t -> qpz_search_t
2024-04-30 12:50:01 -07:00
Evan Hunt e300dfce46 use dns_qp_getname() where possible
some calls to dns_qp_lookup() do not need partial matches, QP chains
or QP iterators. in these cases it's more efficient to use
dns_qp_getname().
2024-04-30 12:50:01 -07:00
Evan Hunt 2789e58473 get foundname from the node
when calling dns_qp_lookup() from qpcache, instead of passing
'foundname' so that a name would be constructed from the QP key,
we now just use the name field in the node data. this makes
dns_qp_lookup() run faster.

the same optimization has also been added to qpzone.

the documentation for dns_qp_lookup() has been updated to
discuss this performance consideration.
2024-04-30 12:50:01 -07:00
Evan Hunt 04d319afe4 include the nodenames when calculating memory to purge
when the cache is over memory, we purge from the LRU list until
we've freed the approximate amount of memory to be added. this
approximation could fail because the memory allocated for nodenames
wasn't being counted.

add a dns_name_size() function so we can look up the size of nodenames,
then add that to the purgesize calculation.
2024-04-30 12:50:01 -07:00
Evan Hunt a8bda6ff1e simplify qpcache iterators
in a cache database, unlike zones, NSEC3 records are stored in
the main tree. it is not necessary to maintain a separate 'nsec3'
tree, nor to have code in the dbiterator implementation to traverse
from one tree to another.

(if we ever implement synth-from-dnssec using NSEC3 records, we'll
need to revert this change. in the meantime, simpler code is better.)
2024-04-30 12:50:01 -07:00
Evan Hunt 7ff43befb7 clean up unnecessary dbiterator code related to origin
the QP database doesn't support relative names as the RBTDB did, so
there's no need for a 'new_origin' flag or to handle `DNS_R_NEWORIGIN`
result codes.
2024-04-30 12:42:32 -07:00
Evan Hunt 85ab92b6e0 more cleanups in qpcache.c
- remove unneeded struct members and misleading comments.
- remove unused parameters for static functions.
- rename 'find_callback' to 'delegating' for consistency with qpzone;
  the find callback mechanism is not used in QP databases.
2024-04-30 12:42:31 -07:00
Evan Hunt 3acab71d46 rename QPDB_HEADERNODE to HEADERNODE
this makes the macro consistent between qpcache.c and qpzone.c.

also removed a redundant definition of HEADERNODE in qpzone.c.
2024-04-30 12:42:31 -07:00
Evan Hunt 46d40b3dca fix structure names in qpcache.c and qpzone.c
- change dns_qpdata_t to qpcnode_t (QP cache node), and dns_qpdb_t to
  qpcache_t, as these types are only accessed locally.
- also change qpdata_t in qpzone.c to qpznode_t (QP zone node), for
  consistency.
- make the refcount declarations for qpcnode_t and qpznode_t static,
  using the new ISC_REFCOUNT_STATIC macros.
2024-04-30 12:42:07 -07:00
Evan Hunt 20d32512ca clean up unnecessary requirements in qpcache.c
qpcache can only support cache semantics now, so there's
no longer any need to check for that internally.
2024-04-30 12:31:48 -07:00
Evan Hunt a5d0e6c4ba add static macros for ISC_REFCOUNT_DECL/IMPL
this commit adds a mechanism to statically declare attach/detach
and ref/unref methods, for objects that are only accessed within
a single C file.
2024-04-30 12:31:48 -07:00
Ondřej Surý bc8095311a Merge branch 'ondrej/improve-newref-checks' into 'main'
Improve the reference counting in newref()

See merge request isc-projects/bind9!8914
2024-04-30 18:43:39 +00:00
Ondřej Surý c13a1d8b01 Improve the reference counting checks in newref()
In qpcache (and rbtdb), there are some functions that acquire
neither the tree lock nor the node lock when calling newref().
In theory, this could lead to a race in which a new reference
is added to a node that was about to be deleted.

We now detect this condition by passing the current tree and node
lock status to newref(). If the node was previously unreferenced
and we don't hold at least one read lock, we will assert.
2024-04-30 08:41:56 +02:00
Michal Nowak b1b9ac1cba Merge branch 'mnowak/stress-tests-freebsd-instance-autoscaler' into 'main'
Use FreeBSD autoscaler for "stress" tests

See merge request isc-projects/bind9!8968
2024-04-29 18:10:52 +00:00
Michal Nowak 65a93b77e1 Use FreeBSD autoscaler for "stress" tests
The FreeBSD autoscaler has been configured to utilize the new "instance"
GitLab Runner executor to spawn "stress" test CI jobs on AWS EC2
dynamically. A shared GitLab Runner named "freebsd-instance-autoscaler"
has been set up in GitLab CI/CD to communicate with EC2, provisioning VM
instances on demand based on a FreeBSD 13 AMI image. This image is the
same as the one previously used for FreeBSD "stress" tests before the
implementation of autoscaling (specifically, the
"freebsd13-amd64-bind9stress.aws.lab.isc.org" GitLab Runner in CI/CD).
2024-04-29 19:53:51 +02:00
Michał Kępień 29cef34a34 Merge branch 'michal/update-urls-and-paths-for-the-bind-9-qa-repository' into 'main'
Update URLs and paths for the BIND 9 QA repository

See merge request isc-projects/bind9!8990
2024-04-29 09:48:06 +00:00
Michał Kępień 25ec1d79e4 Update URLs and paths for the BIND 9 QA repository
Since the BIND 9 QA repository has been made public, adjust the relevant
URLs and paths used in .gitlab-ci.yml so that they work with the public
version of that repository.
2024-04-26 18:43:07 +02:00
Aydın Mercan 79573f1390 Merge branch '4523-dnstap-support-for-new-transport-protocols' into 'main'
Emit and read correct DoT and DoH dnstap entries

Closes #4523

See merge request isc-projects/bind9!8697
2024-04-26 15:47:46 +00:00
Aydın Mercan 042bb98846 Add CHANGES and release note for [GL #4523] 2024-04-26 16:12:29 +03:00
Aydın Mercan f30008a71c Provide an early escape hatch for ns_client_transport_type
Because some tests don't have a legtimate handle, provide a temporary
return early that should be fixed and removed before squashing. This
short circuiting is still correct until DoQ/DoH3 support is introduced.
2024-04-26 16:12:29 +03:00
Aydın Mercan b5478654a2 Add fallback to ns_client_get_type despite unreachable
GCC might fail to compile because it expects a return after UNREACHABLE.
It should ideally just work anyway since UNREACHABLE is either a
noreturn or UB (__builtin_unreachable / C23 unreachable).

Either way, it should be optimized almost always so the fallback is
free or basically free anyway when it isn't optimized out.
2024-04-26 16:12:29 +03:00
Aydın Mercan 4a3f7fe1ef Emit and read correct DoT and DoH dnstap entries
Other protocols still pretend to be TCP/UDP.
This only causes a difference when using dnstap-read on a file with DoQ
or DNSCrypt entries
2024-04-26 16:12:29 +03:00
Aydın Mercan 9d1a8a98c6 Update the dnstap protobuf definition
The new definition includes the missing protocol definitions and
specifies the protobuf version.
2024-04-26 16:08:46 +03:00
Evan Hunt 657ee2b997 Merge branch 'each-qpzone-oneheap' into 'main'
simplify qpzone database by using only one heap for resigning

See merge request isc-projects/bind9!8889
2024-04-26 01:19:42 +00:00
Ondřej SurýandEvan Hunt 6c54337f52 avoid a race in the qpzone getsigningtime() implementation
the previous commit introduced a possible race in getsigningtime()
where the rdataset header could change between being found on the
heap and being bound.

getsigningtime() now looks at the first element of the heap, gathers the
locknum, locks the respective lock, and retrieves the header from the
heap again.  If the locknum has changed, it will rinse and repeat.
Theoretically, this could spin forever, but practically, it almost never
will as the heap changes on the zone are very rare.

we simplify matters further by changing the dns_db_getsigningtime()
API call. instead of passing back a bound rdataset, we pass back the
information the caller actually needed: the resigning time, owner name
and type of the rdataset that was first on the heap.
2024-04-25 15:48:43 -07:00
Evan Hunt 7e6be9f1b5 simplify qpzone database by using only one heap for resigning
in RBTDB, the heap was used by zone databases for resigning, and
by the cache for TTL-based cache cleaning. the cache use case required
very frequent updates, so there was a separate heap for each of the
node lock buckets.

qpzone is for zones only, so it doesn't need to support the cache
use case; the heap will only be touched when the zone is updated or
incrementally signed. we can simplify the code by using only a single
heap.
2024-04-25 15:41:39 -07:00
Evan Hunt 7d289e5333 Merge branch '4659-rootkeysentinel-test-fails-for-certain-values-of-oldid' into 'main'
fix_iterator() bug causes DNSSEC NXDOMAIN responses to be broken

Closes #4659

See merge request isc-projects/bind9!8942
2024-04-25 18:10:29 +00:00
Evan Hunt 6f4ef40ccd CHANGES for [GL #4659] 2024-04-25 10:30:47 -07:00
Evan Hunt 237123e500 simplify code by removing return values where possible
fix_iterator() and related functions are quite difficult to read.
perhaps it would be a little clearer if we didn't assign values
to variables that won't subsequently be used, or unnecessarily
pop the stack and then push the same value back onto it.

also, in dns_qp_lookup() we previously called fix_iterator(),
removed the leaf from the top of the iterator stack, and then
added it back on. this would be clearer if we just push the leaf
onto the stack when we need to, but leave the stack alone when
it's already complete.
2024-04-25 10:29:07 -07:00
Evan Hunt b1b1ca8ca4 add another broken testcase 2024-04-25 10:29:07 -07:00
Evan Hunt 66dbff596b clean up fix_iterator() arguments
the value passed as 'start' was redundant; it's always the same
as the current top of the iterator stack.
2024-04-25 10:29:07 -07:00
Evan Hunt 2dff926624 yet another fix_iterator() bug
under some circumstances it was possible for the iterator to
be set to the first leaf in a set of twigs, when it should have
been set to the last.

a unit test has been added to test this scenario. if there is a
a tree containing the following values: {".", "abb.", "abc."}, and
we query for "acb.", previously the iterator would be positioned at
"abb." instead of "abc.".

the tree structure is:
    branch (offset 1, ".")
      branch (offset 3, ".ab")
        leaf (".abb")
        leaf (".abc")

we find the branch with offset 3 (indicating that its twigs differ
from each other in the third position of the label, "abB" vs "abC").
but the search key differs from the found keys at position 2
("aC" vs "aB").  we look up the bit value in position 3 of the
search key ("B"), and incorrectly follow it onto the wrong twig
("abB").

to correct for this, we need to check for the case where the search
key is greater than the found key in a position earlier than the
branch offset. if it is, then we need to pop from the current leaf
to its parent, and get the greatest leaf from there.

a further change is needed to ensure that we don't do this twice;
when we've moved to a new leaf and the point of difference between
it and the search key even earlier than before, then we're definitely
at a predecessor node and there's no need to continue the loop.
2024-04-25 10:29:07 -07:00
Michal Nowak b1184d916d Merge branch 'mnowak/fix-changes-entry-6378' into 'main'
Reformat overflowing CHANGES entry 6378

See merge request isc-projects/bind9!8981
2024-04-25 07:31:29 +00:00
Michal Nowak 84180c8ee1 Reformat overflowing CHANGES entry 6378
$ sh util/check-line-length.sh CHANGES
    CHANGES: Line Too Long
                            previously removed. An attempt to use the option now prints
2024-04-25 09:22:27 +02:00
Ondřej Surý 1359694267 Merge branch '1879-fix-documentation-on-named--U' into 'main'
Properly document that named -U <n> is no-op now

Closes #1879

See merge request isc-projects/bind9!8976
2024-04-24 20:50:09 +00:00
Ondřej Surý 9305ebdabe Add CHANGES and release note for [GL #1879] 2024-04-24 22:49:26 +02:00
Ondřej Surý d69cd51f91 Properly document that named -U <n> is no-op now
We don't create <n> UDP dispatches anymore and -U <n> option to named is
a no-op for a while.  Properly document that in the named man page.
2024-04-24 22:49:14 +02:00
Petr Špaček 0f86976672 Merge branch 'spdx-custom-test-driver' into 'main'
Use standard SPDX license for custom-test-driver

See merge request isc-projects/bind9!8971
2024-04-24 09:49:44 +00:00
Petr MenšíkandPetr Špaček 2b348a5daa Change exception SPDX to Autoconf-exception-generic
License text is in fact Autoconf generic exception, with already defined
SPDX identificator. Use that instead.

https://spdx.org/licenses/Autoconf-exception-generic.html
2024-04-24 09:46:58 +00:00
Mark Andrews ed77b61599 Merge branch '4684-unit-test-error-handling-in-dns_name_-api' into 'main'
test dns_name_fromregion

Closes #4684

See merge request isc-projects/bind9!8967
2024-04-24 02:14:05 +00:00
Mark Andrews e6984e5c07 Extract empty name in 'source' into 'name' 2024-04-24 01:38:14 +00:00
Mark Andrews 7a13fcd601 Extract non absolute name from source
The entire source region needs to be consumed for this usage.
2024-04-24 01:38:14 +00:00
Mark Andrews 7d7fc8cb2d Extract fully qualified named from source without buffer
'name.ndata' should point to the source.
2024-04-24 01:38:14 +00:00
Mark Andrews 254ba1b051 Test dns_name_fromregion
with a large source region and a large target buffer, both
larger than DNS_NAME_MAXWIRE.
2024-04-24 01:38:14 +00:00
Mark Andrews 63b93ccda2 Merge branch '4689-test-invalid-notify-source-address' into 'main'
Check behaviour using invalid notify source address

Closes #4689

See merge request isc-projects/bind9!8966
2024-04-24 01:09:35 +00:00
Mark Andrews 580c41de0d check behaviour with invalid notify-source-v6 address
This was reported as causing the server to fail to shutdown on
NetBSD.  Look for the expected informational and error messages.
2024-04-24 10:12:42 +10:00
Michal Nowak 4f7947c583 Merge branch 'mnowak/llvm-18' into 'main'
Bump the LLVM version to 18 and reformat sources

See merge request isc-projects/bind9!8827
2024-04-23 12:48:22 +00:00
Michal Nowak f454fa6dea Update sources to Clang 18 formatting 2024-04-23 13:11:52 +02:00
Michal Nowak 7107c44c7c Update Clang to version 18 2024-04-23 13:11:52 +02:00
Ondřej Surý abbc59a270 Merge branch 'ondrej/fix-adb-entries-cleaning' into 'main'
Always set ADB entry expiration to now + ADB_ENTRY_WINDOW

See merge request isc-projects/bind9!8934
2024-04-22 08:37:45 +00:00
Ondřej Surý 141e4c9805 Change the ADB_ENTRY_WINDOW to 60 seconds
The previous value of 30 minutes used to cache the ADB names and entries
was quite long.  Change the value to 60 seconds for faster recovery
after cached intermittent failure of the remote nameservers.
2024-04-22 10:36:36 +02:00
Ondřej Surý 6708da3112 Unify the expiration time handling for all ADB expiration
The algorithm from the previous commit[1] is now used to calculate all
the expiration values through the code (ncache results, cname/dname
targets).

1. ISC_MIN(cur, ISC_MAX(now + ADB_ENTRY_WINDOW, now + rdataset->ttl))
2024-04-22 10:36:36 +02:00
Ondřej Surý 53cc00ee3f Fix the expire_v4 and expire_v6 logic
Correct the logic to set the expiration period of expire_{v4,v6} as
follows:

1. If the trust is ultimate (local entry), immediately set the entry as
   expired, so the changes to the local zones have immediate effect.

3. If the expiration is already set and smaller than the new value, then
   leave the expiration value as it is.

2. Otherwise pick larger of `now + ADB_ENTRY_WINDOW` and `now + TTL` as
   the new expiration value.
2024-04-22 10:36:36 +02:00
Ondřej Surý 932665410d Always set ADB entry expiration to now + ADB_ENTRY_WINDOW
When ADB entry was created it was set to never expire.  If we never
called any of the functions that adjust the expiration, it could linger
in the ADB forever.

Set the expiration (.expires) to now + ADB_ENTRY_WINDOW when creating
the new ADB entry to ensure the ADB entry will always expire.
2024-04-22 10:36:36 +02:00
Mark Andrews 6cb6b99ae7 Merge branch '4687-validator-c-1280-insist-val-nfails-0-failed' into 'main'
Resolve "validator.c:1280: INSIST((*val->nfails) > 0) failed"

Closes #4687

See merge request isc-projects/bind9!8963
2024-04-22 04:57:45 +00:00
Mark Andrews 26375bdcf2 Break out of the switch if we have already reached the quota
This prevents consume_validation_fail being called and causing an
INSIST.
2024-04-22 12:32:36 +10:00
Michal Nowak 970ac03196 Merge branch 'mnowak/drop-respdiff-short-ci-jobs' into 'main'
Drop respdiff-short CI jobs

See merge request isc-projects/bind9!8958
2024-04-19 15:56:00 +00:00
Michal Nowak 6a045cd8ec Drop respdiff-short CI jobs
In the past, our CI infrastructure was more sensitive to the number of
CI jobs running on it. We tried to limit long-running jobs in merge
request-triggered pipelines, as there are many of them, and spawned them
only in daily scheduled ones. Moving most of the CI infrastructure to
AWS has made it way better to run jobs in parallel, and the existence of
short respdiff jobs has lost its original merit. It can also be harmful
as some problems are detected only by the longer respdiff variant when a
faulty merge request has already been merged. We should run all long
respdiff tests in merge request-triggered pipelines.

Also, move the former respdiff-long job (now just "respdiff") to AWS as
old instance memory constraints (see
f09cf69594) are no longer an issue.
2024-04-19 16:42:49 +02:00
Petr Špaček c35f00e48a Merge branch 'pspacek/auto-backports' into 'main'
Attempt automatic MR backports after every merge

See merge request isc-projects/bind9!8959
2024-04-19 13:40:51 +00:00
Petr Špaček 49f9487577 Attempt automatic MR backports after every merge 2024-04-19 13:35:19 +00:00
Matthijs Mekking b53c03d98e Merge branch '1128-offline-ksk' into 'main'
Introduce new DNSSEC tool dnssec-ksr

See merge request isc-projects/bind9!8188
2024-04-19 11:56:50 +00:00
Matthijs Mekking afda87cb08 dnssec-keygen: Change flag options into booleans
We now have ctx.kskflag, ctx.zskflag, and ctx.revflag, but zskflag is
not quite like the other two, as it doesn't have a special bit in the
DNS packet, and is used as a boolean.

This patch changes so that we use booleans for all three, and
construct the flags based on which ones are set.

patch by @aram
2024-04-19 13:52:21 +02:00
Matthijs Mekking 7007025302 Don't leak
Make tsan happy, fix memory leaks by keeping track of the buffers
to be cleaned up.
2024-04-19 13:52:21 +02:00
Matthijs Mekking d9c947c57d Add test cases for CDS/CDNSKEY
Add two more test cases to ensure that a Signed Key Response file
creates signed CDNSKEY and/or CDS RRsets according to the policy.
2024-04-19 13:52:21 +02:00
Matthijs Mekking cdf0fd2e5e Adjust system test to expect CDS and CDNSKEY
Requires storing the KSK keyfile identifier to calculate the expected
CDS and CDNSKEY.
2024-04-19 13:52:21 +02:00
Matthijs Mekking 83da52d6e4 Add option to dnssec-dsfromkey to chop up rdata
The new option 'w' allows us to print DS rdata with the base64 portions
split up in chunks. This is mainly done for testing purposes.
2024-04-19 13:52:21 +02:00
Matthijs Mekking efe4fa6fc7 Add CDS and CDNSKEY to SKR
Add signed CDS and CDNSKEY RRsets to the Signed Key Response (SKR) for the
used KSKs.

We only print one bundle header for all three RRsets.
2024-04-19 13:52:21 +02:00
Matthijs Mekking 46785dc71e sh the fmt up
Apply shfmt patch. Ideally I fixup every commit that changes testing,
but that is just too much at this point.
2024-04-19 13:52:21 +02:00
Matthijs Mekking e7525cab4f Add CHANGES and release note
Introduce the new 'dnssec-ksr' tool.
2024-04-19 13:52:21 +02:00
Matthijs Mekking 695be761b0 Test dnssec-ksr sign
Add test cases for the 'sign' command. Reuse the earlier generated KSR
files.

Also update dnssec-ksr.c to have better cleanup.
2024-04-19 10:41:04 +02:00
Matthijs Mekking 887fa0ddc9 Implement dnssec-ksr sign
Add code that can create a Signed Key Response (SKR) given a Key
Signing Request (KSR), a DNSSEC policy, a set of keys and an interval.
2024-04-19 10:41:04 +02:00
Matthijs Mekking 31521fade2 Change ksr format
Make the ksr format compatible with knot.
2024-04-19 10:41:04 +02:00
Matthijs Mekking 2bf03ab7df Refactor dnssec-ksr
Refactor some more, making the cleanup a generic function.
2024-04-19 10:41:04 +02:00
Matthijs Mekking 852ba174dd Test dnssec-ksr request
Add test cases for the 'request' command. Reuse the earlier
pregenerated ZSKs. We also need to set up some KSK files, that can
be done with 'dnssec-keygen -k <policy> -fK' now.

The 'check_keys()' function is adjusted such that the expected active
time of the successor key is set to the inactive time of the
predecessor. Some additional information is saved to make 'request'
testing easier.
2024-04-19 10:41:04 +02:00
Matthijs Mekking 1b39172ee7 Implement dnssec-ksr request
Add code that can create a Key Signing Request (KSR) given a DNSSEC
policy, a set of keys and an interval.

Multiple keys that match the bundle and kasp parameters are sorted by
keytag, mainly for testing purposes.
2024-04-19 10:41:04 +02:00
Matthijs Mekking 22a4bd5bbe Also free the dst_key after keygen
During cleanup, we also need to free the dst_key structure that is part
of the dns_dnsseckey.
2024-04-19 10:41:04 +02:00
Matthijs Mekking ed9704fcda Refactor dnssec-ksr keygen
Create some helper functions for code that is going to be reused by the
other commands (request, sign), such as setting and checking the context
parameters, and retrieving the dnssec-policy/kasp.
2024-04-19 10:41:04 +02:00
Matthijs Mekking e033e58a85 dnssec-keygen: allow -f and -k together
The 'dnssec-keygen' tool now allows the options '-k <dnssec-policy>'
and '-f <flags>' together to create keys from a DNSSEC policy that only
match the given role. Allow setting '-fZ' to only create ZSKs, while
'-fK' will only create KSKs.
2024-04-19 10:41:04 +02:00
Matthijs Mekking 7508534789 Implement dnssec-ksr keygen
Add code that can pregenerate ZSKs given a DNSSEC policy and an
interval.

Fix configuration shell scripts, fixing the ksr system test.
2024-04-19 10:41:04 +02:00
Matthijs Mekking a3915e535a Move kasp key match function to kasp header
The dnssec-ksr tool needs to check if existing key files match lines
in the keys section of a dnssec-policy, so make this function publicly
available.
2024-04-19 10:41:04 +02:00
Matthijs Mekking bc31575899 Move common create key functions to dnssectool.c
The dnssec-ksr tool needs to read a dnssec-policy from configuration
too, as well as deal with FIPS mode checks.
2024-04-19 10:41:04 +02:00
Matthijs Mekking 1cb345fa95 Add ksr system test
Add a system test for testing dnssec-ksr, initally for the keygen
command. This should be able to create or select key files given a
DNSSEC policy and a time window.
2024-04-19 10:41:04 +02:00
Matthijs Mekking 77d4afba1b Introduce new DNSSEC tool dnssec-ksr
Introduce a new DNSSEC tool, dnssec-ksr, for creating signed key
response (SKR) files, given one or more key signing requests (KSRs).

For now it is just a dummy tool, but the future purpose of this utility
is to pregenerate ZSKs and signed RRsets for DNSKEY, CDNSKEY, and CDS
for a given period that a KSK is to be offline.
2024-04-19 10:41:04 +02:00
Michal Nowak 2ca6bcc99a Merge branch 'mnowak/revert-874329b3b1a56e58e8caf61d89127441d2cc79a1' into 'main'
Revert "Temporarily allow failure of respdiff-long:tsan job"

See merge request isc-projects/bind9!8957
2024-04-19 08:37:47 +00:00
Michal Nowak 620cce8f7e Revert "Temporarily allow failure of respdiff-long:tsan job"
This reverts commit 874329b3b1.

Addressed in isc-projects/bind9#4475.
2024-04-19 10:28:51 +02:00
Ondřej Surý e4793242eb Merge branch '4416-fix-reading-multiple-rndc-messages-in-single-TCP-message' into 'main'
Rework isccc_ccmsg to support multiple messages per tcp read

Closes #4416

See merge request isc-projects/bind9!8956
2024-04-18 18:10:56 +00:00
Ondřej Surý cbbc0051a3 Add CHANGES note for [GL #4416] 2024-04-18 20:09:47 +02:00
Dominik ThalhammerandOndřej Surý 24ae1157e8 Rework isccc_ccmsg to support multiple messages per tcp read
Previously, only a single controlconf message would be processed from a
single TCP read even if the TCP read buffer contained multiple messages.
Refactor the isccc_ccmsg unit to store the extra buffer in the internal
buffer and use the already read data first before reading from the
network again.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
2024-04-18 20:08:44 +02:00
Ondřej Surý e13728413a Merge branch '4586-don-t-count-expired-future-rrsigs-in-verification-failure-quota' into 'main'
Don't count expired / future RRSIGs in verification failure quota

Closes #4586

See merge request isc-projects/bind9!8746
2024-04-18 15:07:43 +00:00
Ondřej Surý 5d4233c2c2 Add CHANGES and release notes for [GL #4586] 2024-04-18 16:05:32 +02:00
Ondřej Surý 3b9ea189b2 Don't count expired / future RRSIG against quota
These don't trigger a public key verification unless
dnssec-accept-expired is set.
2024-04-18 16:05:31 +02:00
Petr Špaček 903af2e1de Merge branch 'pspacek/update-sphinx' into 'main'
Update Sphinx version used for documentation build

See merge request isc-projects/bind9!8952
2024-04-18 14:00:33 +00:00
Petr Špaček da607d6a06 Update Sphinx version used for documentation build 2024-04-18 12:46:13 +02:00
Ondřej Surý bbb2741de8 Merge branch 'ondrej-offload-statschannel' into 'main'
Offload the isc_http response processing to worker thread

Closes #4680

See merge request isc-projects/bind9!7647
2024-04-18 08:56:06 +00:00
Ondřej Surý fbea3bb255 Add CHANGES and release note for [GL #4680] 2024-04-18 10:53:31 +02:00
Ondřej Surý c7ed858c6e Supress the leak detection in xmlGetGlobalState
The xmlGetGlobalState allocates per-thread memory that is not properly
cleaned up when the libxml2 is used from offloaded threads.  Add the
function the the LeakSanitizer suppression list.
2024-04-18 10:53:31 +02:00
Ondřej Surý 23835c4afe Use xmlMemSetup() instead of xmlGcMemSetup()
Since we don't have a specialized function for "atomic" allocations,
it's better to just use xmlMemSetup() instead of xmlGcMemSetup()
according to this:

https://mail.gnome.org/archives/xml/2007-August/msg00032.html
2024-04-18 10:53:31 +02:00
Ondřej Surý 950f828cd2 Offload the isc_http response processing to worker thread
Prepare the statistics channel data in the offloaded worker thread, so
the networking thread is not blocked by the process gathering data from
various data structures.  Only the netmgr send is then run on the
networkin thread when all the data is already there.
2024-04-18 10:53:00 +02:00
Matthijs Mekking f8a09fd91a Merge branch '4554-dnssec-policy-jitter' into 'main'
Add signatures-jitter option

Closes #4554

See merge request isc-projects/bind9!8686
2024-04-18 08:11:18 +00:00
Matthijs Mekking c3d8932f79 Add checkconf check for signatures-jitter
Having a value higher than signatures-validity does not make sense
and should be treated as a configuration error.
2024-04-18 09:50:33 +02:00
Matthijs Mekking 8b7785bc23 Add release notes and CHANGES for #4554
Mention the new signature jitter option.
2024-04-18 09:50:31 +02:00
Matthijs Mekking 67f403a423 Implement signature jitter
When calculating the RRSIG validity, jitter is now derived from the
config option rather than from the refresh value.
2024-04-18 09:50:10 +02:00
Matthijs Mekking 0438d3655b Refactor code that calculates signature validity
There are three code blocks that are (almost) similar, refactor it
to one function.
2024-04-18 09:50:10 +02:00
Matthijs Mekking 50bd729019 Update autosign test to use signatures-jitter
Now that we have an option to configure jitter, use it in system tests
that test jitter.
2024-04-18 09:50:10 +02:00
Matthijs Mekking 2a4daaedca Add signatures-jitter option
Add an option to speficy signatures jitter.
2024-04-18 09:50:10 +02:00
Petr Špaček c9ff77c067 Merge tag 'v9.19.23' 2024-04-18 09:21:47 +02:00
Mark Andrews 9360d90bf2 Merge branch '4671-calling-dns_qpkey_toname-twice-fails' into 'main'
Resolve "Calling dns_qpkey_toname twice fails."

Closes #4671

See merge request isc-projects/bind9!8948
2024-04-18 01:05:42 +00:00
Mark Andrews 36c11d9180 Check that name is properly reset by dns_qpkey_toname 2024-04-18 00:17:48 +00:00
Mark Andrews bf70d4840c dns_qpkey_toname failed to reset name correctly
This could lead to a mismatch between name->length and the rest
of the name structure.
2024-04-18 00:17:48 +00:00
Ondřej Surý fcf2919c93 Merge branch '4475-use-atomics-to-access-trust-access-in-dns_ncache' into 'main'
Use atomic operations to access the trust byte in ncache data

Closes #4475

See merge request isc-projects/bind9!8946
2024-04-17 19:18:35 +00:00
Mark AndrewsandOndřej Surý d2fd97f4da Add CHANGES note for [GL #4475] 2024-04-17 17:14:50 +02:00
Ondřej Surý eb1829b970 Use atomic operations to access the trust byte in ncache data
Protect the access to the trust byte in the ncache data with relaxed
atomic operation to mimick the current behaviour.  This will teach
TSAN that the concurrent access is fine.
2024-04-17 17:14:34 +02:00
Mark AndrewsandOndřej Surý 4ef755ffb0 Only copy the name data after we know its actual length
This prevents TSAN errors with the ncache code where the trust byte
access needs to be protected by a lock.  The old code copied the
entire region before determining where the name ended.  We now
determine where the name ends then copy just that data and in doing
so avoid reading the trust byte.
2024-04-17 17:14:34 +02:00
Artem Boldariev 90b0038ea0 Merge branch '4434-use-nm-tests-timeouts-for-the-dispatch-test' into 'main'
dispatch_test: use the NM tests timeouts

Closes #4434

See merge request isc-projects/bind9!8923
2024-04-15 14:25:13 +00:00
Artem Boldariev 7f805659c3 dispatch_test: use the NM tests timeouts
This commit makes the dispatch_test use the same timeouts that network
manager tests. We do that because the old values appear to be too
small for our heavy loaded CI machines, leading to spurious failures
on them. The network manager tests are much more stable in this
situation and they use somewhat larger timeout values.

We use a smaller connection timeouts for the tests which are expected
to timeout to not wait for too long.
2024-04-15 16:33:24 +03:00
Mark Andrews 381273f89f Merge branch '4669-error-sending-notify-to-ipv6-secondary' into 'main'
Wrong source address used for IPv6 notify messages

Closes #4669

See merge request isc-projects/bind9!8935
2024-04-12 00:16:01 +00:00
Mark Andrews 9cc6b4a68a Add CHANGES note for [GL #4669] 2024-04-11 18:05:25 +00:00
Mark Andrews 7c369ea3d9 Check that notify message was sent over IPv6 2024-04-11 18:05:25 +00:00
Mark Andrews 40fd4cd407 Wrong source address used for IPv6 notify messages
The source address field of 'newnotify' was not updated from the
default (0.0.0.0) when the destination address was an IPv6 address.
This resulted in the messages failing to be sent.  Set the source
address to :: when the destination address is an IPv6 address.
2024-04-11 18:05:25 +00:00
Petr Špaček 3c0eaff4c6 Update BIND version for release 2024-04-02 18:08:00 +02:00
Petr Špaček dc9d9a8fdf Add a CHANGES marker 2024-04-02 18:06:04 +02:00
Petr Špaček 03c9e0b753 Merge branch 'pspacek/prepare-documentation-for-bind-9.19.23' into 'v9.19.23-release'
Prepare documentation for BIND 9.19.23

See merge request isc-private/bind9!677
2024-04-02 16:04:47 +00:00
Suzanne GoldlustandPetr Špaček 4c0db2ee3c Tweak and reword release notes 2024-04-02 17:45:25 +02:00
Petr Špaček e4344b7d1a Add release note for GL #4622 and #4652 2024-04-02 17:31:42 +02:00
Petr Špaček 3989b99a0b Add release note for GL #4614 2024-04-02 17:31:42 +02:00
Petr Špaček 1076bd3c78 Add release note for GL #4552 2024-04-02 17:31:42 +02:00
Petr Špaček bf92e16c0e Prepare release notes for BIND 9.19.23 2024-04-02 17:31:42 +02:00
304 changed files with 8046 additions and 3156 deletions
+2
View File
@@ -1538,3 +1538,5 @@ ffbe6b95371c99b7fb05e6de17a8d6b7bf4f629f
4cb8b13987b930952238cc88e84272b8cf911933
# Reformat sources with up-to-date clang-format-17
79d93600116faabd89798522817ad95a69684fff
# Reformat sources with up-to-date clang-format-18
b7de2c7cb959fa35099d72c3f9b13938348c74e6
+1
View File
@@ -75,6 +75,7 @@ doc/man/dnssec-importkey.8in
doc/man/dnssec-keyfromlabel.8in
doc/man/dnssec-keygen.8in
doc/man/dnssec-keymgr.8in
doc/man/dnssec-ksr.8in
doc/man/dnssec-revoke.8in
doc/man/dnssec-settime.8in
doc/man/dnssec-signzone.8in
+279 -140
View File
@@ -15,7 +15,7 @@ variables:
TEST_PARALLEL_JOBS: 4
CONFIGURE: ./configure
CLANG_VERSION: 17
CLANG_VERSION: 18
CLANG: "clang-${CLANG_VERSION}"
SCAN_BUILD: "scan-build-${CLANG_VERSION}"
LLVM_SYMBOLIZER: "/usr/lib/llvm-${CLANG_VERSION}/bin/llvm-symbolizer"
@@ -55,6 +55,8 @@ variables:
BIND_STRESS_TEST_OS: linux
BIND_STRESS_TEST_ARCH: amd64
HYPOTHESIS_PROFILE: "ci"
default:
# Allow all running CI jobs to be automatically canceled when a new
# version of a branch is pushed.
@@ -71,6 +73,7 @@ stages:
- performance
- docs
- postcheck
- postmerge
- release
### Runner Tag Templates
@@ -80,14 +83,6 @@ stages:
- libvirt
- amd64
# Jobs with these tags do not run on AWS but on permanent OVH systems.
.linux-respdiff-amd64: &linux_respdiff_amd64
tags:
- linux
- ovh
- amd64
# Autoscaling GitLab Runner on AWS EC2 (amd64)
.linux-amd64: &linux_amd64
@@ -106,21 +101,23 @@ stages:
- runner-manager
- aarch64
# Stress-testing runners
# Autoscaling GitLab Runner on AWS EC2 (FreeBSD)
.freebsd-stress-amd64: &freebsd_stress_amd64
tags:
- amd64
- bsd-stress-test
- aws
- bsd-stress
- stress
- autoscaler
- shell
- stress-test
- amd64
### Docker Image Templates
# Alpine Linux
.alpine-3.19-amd64: &alpine_3_19_amd64_image
image: "$CI_REGISTRY_IMAGE:alpine-3.19-amd64"
.alpine-3.20-amd64: &alpine_3_20_amd64_image
image: "$CI_REGISTRY_IMAGE:alpine-3.20-amd64"
<<: *linux_amd64
# Oracle Linux
@@ -147,10 +144,6 @@ stages:
image: "$CI_REGISTRY_IMAGE:debian-bullseye-amd64"
<<: *linux_amd64
.respdiff-debian-bookworm-amd64: &respdiff_debian_bookworm_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-bookworm-amd64"
<<: *linux_respdiff_amd64
.debian-bookworm-amd64: &debian_bookworm_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-bookworm-amd64"
<<: *linux_amd64
@@ -175,16 +168,16 @@ stages:
# Fedora
.tsan-fedora-39-amd64: &tsan_fedora_39_amd64_image
image: "$CI_REGISTRY_IMAGE:tsan-fedora-39-amd64"
.tsan-fedora-40-amd64: &tsan_fedora_40_amd64_image
image: "$CI_REGISTRY_IMAGE:tsan-fedora-40-amd64"
<<: *linux_amd64
.fedora-39-amd64: &fedora_39_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-39-amd64"
.fedora-40-amd64: &fedora_40_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-40-amd64"
<<: *linux_amd64
.fedora-39-arm64: &fedora_39_arm64_image
image: "$CI_REGISTRY_IMAGE:fedora-39-arm64"
.fedora-40-arm64: &fedora_40_arm64_image
image: "$CI_REGISTRY_IMAGE:fedora-40-arm64"
<<: *linux_arm64
# Ubuntu
@@ -197,6 +190,10 @@ stages:
image: "$CI_REGISTRY_IMAGE:ubuntu-jammy-amd64"
<<: *linux_amd64
.ubuntu-noble-amd64: &ubuntu_noble_amd64_image
image: "$CI_REGISTRY_IMAGE:ubuntu-noble-amd64"
<<: *linux_amd64
# Base image
# This is a meta image that is used as a base for non-specific jobs
@@ -214,7 +211,7 @@ stages:
<<: *libvirt_amd64
.openbsd-amd64: &openbsd_amd64_image
image: "openbsd-7.4-x86_64"
image: "openbsd-7.5-x86_64"
<<: *libvirt_amd64
### Job Templates
@@ -276,11 +273,11 @@ stages:
# change directory to the workspace before including this
.find_python: &find_python
- PYTHON="$(source bin/tests/system/conf.sh; echo $PYTHON)"
- PYTHON="$(cat bin/tests/system/isctest/vars/.ac_vars/PYTHON)"
- test -x "$PYTHON"
.find_pytest: &find_pytest
- PYTEST="$(source bin/tests/system/conf.sh; echo $PYTEST)"
- PYTEST="$(cat bin/tests/system/isctest/vars/.ac_vars/PYTEST)"
- test -x "$PYTEST"
.parse_tsan: &parse_tsan
@@ -482,14 +479,14 @@ stages:
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- *setup_interfaces
- git clone --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.isc.org/isc-private/bind-qa.git
- cd bind-qa/bind9/respdiff
- git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git
- cd bind9-qa/respdiff
needs: []
artifacts:
paths:
- bind-qa/bind9/respdiff
- bind9-qa/respdiff
exclude:
- bind-qa/bind9/respdiff/rspworkdir/data.mdb # Exclude a 10 GB file.
- bind9-qa/respdiff/rspworkdir/data.mdb # Exclude a 10 GB file.
untracked: true
when: always
@@ -624,8 +621,6 @@ danger:
only:
refs:
- merge_requests
variables:
- $DANGER_GITLAB_API_TOKEN
checkbashisms:
<<: *precheck_job
@@ -693,6 +688,7 @@ cross-version-config-tests:
# Disable option checking to prevent problems with new default options in
# the &configure anchor.
EXTRA_CONFIGURE: "--disable-option-checking"
PYTEST: "/usr/bin/pytest-3"
script:
- *configure
- *setup_interfaces
@@ -702,12 +698,16 @@ cross-version-config-tests:
- autoreconf -fi
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1}
- *find_pytest
- cd bin/tests/system
# Run the setup phase of all system tests in the most recently tagged BIND 9
# release using the binaries built for the current BIND 9 version. This
# intends to detect obvious backward compatibility issues with the latter.
- sed -i -E "s|(export TOP_BUILDDIR)=.*|\1=${CI_PROJECT_DIR}|" conf.sh
- >
if [ -f isctest/vars/autoconf.py ]; then
echo "${CI_PROJECT_DIR}" > isctest/vars/.ac_vars/TOP_BUILDDIR
else
sed -i -E "s|(export TOP_BUILDDIR)=.*|\1=${CI_PROJECT_DIR}|" conf.sh;
fi
- >
"$PYTEST" --setup-only --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "${TEST_PARALLEL_JOBS:-1}"
needs:
@@ -725,28 +725,28 @@ cross-version-config-tests:
expire_in: "1 day"
when: always
# Jobs for regular GCC builds on Alpine Linux 3.19 (amd64)
# Jobs for regular GCC builds on Alpine Linux 3.20 (amd64)
gcc:alpine3.19:amd64:
gcc:alpine3.20:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "${WITHOUT_READLINE}"
<<: *alpine_3_19_amd64_image
<<: *alpine_3_20_amd64_image
<<: *build_job
system:gcc:alpine3.19:amd64:
<<: *alpine_3_19_amd64_image
system:gcc:alpine3.20:amd64:
<<: *alpine_3_20_amd64_image
<<: *system_test_job
needs:
- job: gcc:alpine3.19:amd64
- job: gcc:alpine3.20:amd64
artifacts: true
unit:gcc:alpine3.19:amd64:
<<: *alpine_3_19_amd64_image
unit:gcc:alpine3.20:amd64:
<<: *alpine_3_20_amd64_image
<<: *unit_test_job
needs:
- job: gcc:alpine3.19:amd64
- job: gcc:alpine3.20:amd64
artifacts: true
# Jobs for regular GCC builds on Oracle Linux 8 (amd64)
@@ -894,6 +894,30 @@ unit:gcc:bookworm:amd64:
- job: gcc:bookworm:amd64
artifacts: true
# Jobs for RBT zone- & cache-enabled GCC builds on Debian 12 "bookworm" (amd64)
gcc:bookworm:rbt:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2 --with-zonedb=rbt --with-cachedb=rbt"
<<: *debian_bookworm_amd64_image
<<: *build_job
system:gcc:bookworm:rbt:amd64:
<<: *debian_bookworm_amd64_image
<<: *system_test_job
needs:
- job: unit:gcc:bookworm:rbt:amd64
artifacts: true
unit:gcc:bookworm:rbt:amd64:
<<: *debian_bookworm_amd64_image
<<: *unit_test_job
needs:
- job: gcc:bookworm:rbt:amd64
artifacts: true
# Build job for cross-compiled GCC builds on 64-bit Debian 12 "bookworm"
# (amd64) with 32-bit BIND 9.
@@ -1145,7 +1169,31 @@ unit:gcc:jammy:amd64:
- job: gcc:jammy:amd64
artifacts: true
# Jobs for ASAN builds on Fedora 39 (amd64)
# Jobs for regular GCC builds on Ubuntu 24.04 Noble Numbat (amd64)
gcc:noble:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *ubuntu_noble_amd64_image
<<: *build_job
system:gcc:noble:amd64:
<<: *ubuntu_noble_amd64_image
<<: *system_test_job
needs:
- job: gcc:noble:amd64
artifacts: true
unit:gcc:noble:amd64:
<<: *ubuntu_noble_amd64_image
<<: *unit_test_job
needs:
- job: gcc:noble:amd64
artifacts: true
# Jobs for ASAN builds on Fedora 40 (amd64)
gcc:asan:
variables:
@@ -1153,20 +1201,20 @@ gcc:asan:
CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined"
LDFLAGS: "-fsanitize=address,undefined"
EXTRA_CONFIGURE: "--with-libidn2 --without-jemalloc"
<<: *fedora_39_amd64_image
<<: *fedora_40_amd64_image
<<: *build_job
system:gcc:asan:
variables:
LSAN_OPTIONS: "suppressions=$CI_PROJECT_DIR/suppr-lsan.txt"
<<: *fedora_39_amd64_image
<<: *fedora_40_amd64_image
<<: *system_test_job
needs:
- job: gcc:asan
artifacts: true
unit:gcc:asan:
<<: *fedora_39_amd64_image
<<: *fedora_40_amd64_image
<<: *unit_test_job
needs:
- job: gcc:asan
@@ -1195,7 +1243,7 @@ unit:clang:asan:
- job: clang:asan
artifacts: true
# Jobs for TSAN builds on Fedora 39 (amd64)
# Jobs for TSAN builds on Fedora 40 (amd64)
gcc:tsan:
variables:
@@ -1203,13 +1251,13 @@ gcc:tsan:
CFLAGS: "${CFLAGS_COMMON} -fsanitize=thread"
LDFLAGS: "-fsanitize=thread"
EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock --without-jemalloc"
<<: *tsan_fedora_39_amd64_image
<<: *tsan_fedora_40_amd64_image
<<: *build_job
system:gcc:tsan:
variables:
TSAN_OPTIONS: "${TSAN_OPTIONS_FEDORA}"
<<: *tsan_fedora_39_amd64_image
<<: *tsan_fedora_40_amd64_image
<<: *system_test_tsan_job
needs:
- job: gcc:tsan
@@ -1218,7 +1266,7 @@ system:gcc:tsan:
unit:gcc:tsan:
variables:
TSAN_OPTIONS: "${TSAN_OPTIONS_FEDORA}"
<<: *tsan_fedora_39_amd64_image
<<: *tsan_fedora_40_amd64_image
<<: *unit_test_tsan_job
needs:
- job: gcc:tsan
@@ -1534,51 +1582,10 @@ coverity:
# Respdiff tests
respdiff-short:
respdiff:
<<: *respdiff_job
<<: *default_triggering_rules
<<: *debian_bookworm_amd64_image
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og -DISC_TRACK_PTHREADS_OBJECTS"
MAX_DISAGREEMENTS_PERCENTAGE: "0.5"
script:
- bash respdiff.sh -m /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 -s named -q "${PWD}/10k_a.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named"
respdiff-short:asan:
<<: *respdiff_job
<<: *default_triggering_rules
<<: *debian_bookworm_amd64_image
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og -fsanitize=address,undefined"
LDFLAGS: "-fsanitize=address,undefined"
EXTRA_CONFIGURE: "--disable-dnsrps --without-jemalloc"
MAX_DISAGREEMENTS_PERCENTAGE: "0.5"
script:
- bash respdiff.sh -s named -q "${PWD}/10k_a.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named"
respdiff-short:tsan:
<<: *respdiff_job
<<: *default_triggering_rules
<<: *tsan_debian_bookworm_amd64_image
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og -fsanitize=thread"
LDFLAGS: "-fsanitize=thread"
EXTRA_CONFIGURE: "--disable-dnsrps --enable-pthread-rwlock --without-jemalloc"
MAX_DISAGREEMENTS_PERCENTAGE: "0.5"
TSAN_OPTIONS: "${TSAN_OPTIONS_DEBIAN}"
script:
- bash respdiff.sh -s named -q "${PWD}/10k_a.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named"
after_script:
- *find_python
- *parse_tsan
respdiff-long:
<<: *respdiff_job
<<: *api_pipelines_schedules_tags_triggers_web_triggering_rules
<<: *respdiff_debian_bookworm_amd64_image
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og -DISC_TRACK_PTHREADS_OBJECTS"
@@ -1586,9 +1593,9 @@ respdiff-long:
script:
- bash respdiff.sh -m /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named"
respdiff-long:asan:
respdiff:asan:
<<: *respdiff_job
<<: *api_pipelines_schedules_tags_triggers_web_triggering_rules
<<: *default_triggering_rules
<<: *debian_bookworm_amd64_image
variables:
CC: gcc
@@ -1599,9 +1606,9 @@ respdiff-long:asan:
script:
- bash respdiff.sh -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named"
respdiff-long:tsan:
respdiff:tsan:
<<: *respdiff_job
<<: *api_pipelines_schedules_tags_triggers_web_triggering_rules
<<: *default_triggering_rules
<<: *tsan_debian_bookworm_amd64_image
variables:
CC: gcc
@@ -1615,11 +1622,10 @@ respdiff-long:tsan:
after_script:
- *find_python
- *parse_tsan
allow_failure: true # affected by GL #4475
respdiff-long-third-party:
respdiff-third-party:
<<: *respdiff_job
<<: *api_pipelines_schedules_tags_triggers_web_triggering_rules
<<: *default_triggering_rules
<<: *debian_bookworm_amd64_image
variables:
CC: gcc
@@ -1655,157 +1661,269 @@ shotgun:dot:
when: delayed
start_in: 5 minutes
# Parallel build in the "make" step is avoided since multiple jobs can be
# executed concurrently on the same runner. This may present problems when one
# job runs a performance-sensitive task of replying to queries while another
# takes all cores to build BIND.
.stress: &stress_job
.stress-test: &stress_test
stage: performance
script:
- *configure
- *setup_interfaces
- make -k all V=1
- make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
- make DESTDIR="${INSTALL_PATH}" install
- git clone --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.isc.org/isc-private/bind-qa.git
- cd bind-qa/bind9/stress
- git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git
- cd bind9-qa/stress
- LD_LIBRARY_PATH="${INSTALL_PATH}/usr/local/lib" BIND_INSTALL_PATH="${INSTALL_PATH}/usr/local" WORKSPACE="${CI_PROJECT_DIR}" bash stress.sh
needs:
- job: autoreconf
artifacts: true
.stress-test-short: &stress_test_short_job
<<: *stress_test
artifacts:
untracked: true
when: always
only:
- merge_requests
stress:short:authoritative:fedora:40:amd64:
<<: *fedora_40_amd64_image
<<: *linux_amd64
<<: *stress_test_short_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: authoritative
RATE: 10000
RUN_TIME: 15
stress:short:recursive:fedora:40:amd64:
<<: *fedora_40_amd64_image
<<: *linux_amd64
<<: *stress_test_short_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: recursive
RATE: 10000
RUN_TIME: 15
stress:short:rpz:fedora:40:amd64:
<<: *fedora_40_amd64_image
<<: *linux_amd64
<<: *stress_test_short_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: rpz
RATE: 1500
RUN_TIME: 15
stress:short:authoritative:fedora:40:arm64:
<<: *fedora_40_arm64_image
<<: *linux_arm64
<<: *stress_test_short_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: authoritative
RATE: 10000
RUN_TIME: 15
stress:short:recursive:fedora:40:arm64:
<<: *fedora_40_arm64_image
<<: *linux_arm64
<<: *stress_test_short_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: recursive
RATE: 10000
RUN_TIME: 15
stress:short:rpz:fedora:40:arm64:
<<: *fedora_40_arm64_image
<<: *linux_arm64
<<: *stress_test_short_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: rpz
RATE: 1500
RUN_TIME: 15
stress:short:authoritative:freebsd13:amd64:
<<: *freebsd_stress_amd64
<<: *stress_test_short_job
variables:
CC: clang
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/local/bin/flame
MODE: authoritative
RATE: 10000
RUN_TIME: 15
stress:short:recursive:freebsd13:amd64:
<<: *freebsd_stress_amd64
<<: *stress_test_short_job
variables:
CC: clang
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/local/bin/flame
MODE: recursive
RATE: 10000
RUN_TIME: 15
stress:short:rpz:freebsd13:amd64:
<<: *freebsd_stress_amd64
<<: *stress_test_short_job
variables:
CC: clang
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/local/bin/flame
MODE: rpz
RATE: 1500
RUN_TIME: 15
.stress-test-long: &stress_test_long_job
<<: *stress_test
artifacts:
untracked: true
expire_in: "1 week"
when: always
timeout: 2h
stress:authoritative:fedora:39:amd64:
<<: *fedora_39_amd64_image
stress:authoritative:fedora:40:amd64:
<<: *fedora_40_amd64_image
<<: *linux_amd64
<<: *stress_job
<<: *stress_test_long_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: authoritative
RATE: 10000
RUN_TIME: 1
RUN_TIME: 60
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:recursive:fedora:39:amd64:
<<: *fedora_39_amd64_image
stress:recursive:fedora:40:amd64:
<<: *fedora_40_amd64_image
<<: *linux_amd64
<<: *stress_job
<<: *stress_test_long_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: recursive
RATE: 10000
RUN_TIME: 1
RUN_TIME: 60
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:rpz:fedora:39:amd64:
<<: *fedora_39_amd64_image
stress:rpz:fedora:40:amd64:
<<: *fedora_40_amd64_image
<<: *linux_amd64
<<: *stress_job
<<: *stress_test_long_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: rpz
RATE: 1500
RUN_TIME: 1
RUN_TIME: 60
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /rpz/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:authoritative:fedora:39:arm64:
<<: *fedora_39_arm64_image
stress:authoritative:fedora:40:arm64:
<<: *fedora_40_arm64_image
<<: *linux_arm64
<<: *stress_job
<<: *stress_test_long_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: authoritative
RATE: 10000
RUN_TIME: 1
RUN_TIME: 60
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /arm64/i)
stress:recursive:fedora:39:arm64:
<<: *fedora_39_arm64_image
stress:recursive:fedora:40:arm64:
<<: *fedora_40_arm64_image
<<: *linux_arm64
<<: *stress_job
<<: *stress_test_long_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: recursive
RATE: 10000
RUN_TIME: 1
RUN_TIME: 60
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /arm64/i)
stress:rpz:fedora:39:arm64:
<<: *fedora_39_arm64_image
stress:rpz:fedora:40:arm64:
<<: *fedora_40_arm64_image
<<: *linux_arm64
<<: *stress_job
<<: *stress_test_long_job
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/bin/flame
MODE: rpz
RATE: 1500
RUN_TIME: 1
RUN_TIME: 60
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /rpz/i && $BIND_STRESS_TEST_ARCH =~ /arm64/i)
stress:authoritative:freebsd13:amd64:
<<: *freebsd_stress_amd64
<<: *stress_job
<<: *stress_test_long_job
variables:
CC: clang
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/local/bin/flame
MODE: authoritative
RATE: 10000
RUN_TIME: 1
RUN_TIME: 60
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /freebsd/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:recursive:freebsd13:amd64:
<<: *freebsd_stress_amd64
<<: *stress_job
<<: *stress_test_long_job
variables:
CC: clang
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/local/bin/flame
MODE: recursive
RATE: 10000
RUN_TIME: 1
RUN_TIME: 60
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /freebsd/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:rpz:freebsd13:amd64:
<<: *freebsd_stress_amd64
<<: *stress_job
<<: *stress_test_long_job
variables:
CC: clang
CFLAGS: "${CFLAGS_COMMON} -Og"
FLAME: /usr/local/bin/flame
MODE: rpz
RATE: 1500
RUN_TIME: 1
RUN_TIME: 60
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /freebsd/i && $BIND_STRESS_TEST_MODE =~ /rpz/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
@@ -1878,3 +1996,24 @@ pairwise:
only:
variables:
- $PAIRWISE_TESTING
backports:
<<: *base_image
stage: postmerge
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_REF_NAME =~ /^bind-9.[0-9]+$/ || $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH)'
variables:
# automated commits will inherit identification from the user who pressed Merge button
GIT_COMMITTER_NAME: $GITLAB_USER_NAME
GIT_COMMITTER_EMAIL: $GITLAB_USER_EMAIL
# avoid leftover branches from previous jobs
GIT_STRATEGY: clone
# assumed max depth of a MR for backport
GIT_DEPTH: 200
script:
# CI job token is not sufficient for push operations
- git remote get-url origin | sed -e "s/gitlab-ci-token:$CI_JOB_TOKEN/oauth2:$BIND_TEAM_WRITE_TOKEN/" | xargs git remote set-url --push origin
# force-pushing is disabled so we have to have merge request on top
- MERGE_REQUEST_ID="$(git log -1 --format='%b' | sed --silent -e 's/^See merge request [^!]\+!//p')"
- git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git
- bind9-qa/releng/backport_mr.py $CI_PROJECT_ID "$MERGE_REQUEST_ID"
+26
View File
@@ -0,0 +1,26 @@
Alan Clegg <aclegg@isc.org>
Aram Sargsyan <aram@isc.org>
Artem Boldariev <artem@isc.org> <artem@boldariev.com>
Curtis Blackburn <ckb@isc.org> <ckb@freebsd11.local>
Curtis Blackburn <ckb@isc.org> <ckb@isc.org>
Diego Fronza <diego@isc.org>
Evan Hunt <each@isc.org> Evan Hunt <fanf@isc.org>
Håvard Eidnes <he@uninett.no>
Jeremy C. Reed <jreed@isc.org> <jreed@docs.lab.isc.org>
Jeremy C. Reed <jreed@isc.org> <jreed@ISC.org>
Joey Salazar <joey@isc.org>
John H. DuBois III <johnd>
Mark Andrews <marka@isc.org>
Mark Andrews <marka@isc.org> <marka@daemon.lab.isc.org>
Mark Andrews <marka@isc.org> <marka@newdocs.lab.isc.org>
Matthijs Mekking <matthijs@isc.org> <github@pletterpet.nl>
Nicki Křížek <nicki@isc.org> <tkrizek@isc.org>
Ondřej Surý <ondrej@isc.org>
Ondřej Surý <ondrej@isc.org> <ondrej@openbsd-6-9.home.sury.org>
Ondřej Surý <ondrej@isc.org> <ondrej@sury.org>
Petr Menšík <pemensik@redhat.com>
Petr Menšík <pemensik@redhat.com> <pmensik@redhat.com>
Robert Edmonds <edmonds>
Tatuya JINMEI 神明達哉 <jinmei@isc.org>
Witold Kręcicki <wpk@isc.org>
Witold Kręcicki <wpk@isc.org> <wpk@culm.net>
+1
View File
@@ -5,6 +5,7 @@ disable=
C0115, # missing-class-docstring
C0116, # missing-function-docstring
C0209, # consider-using-f-string
C0301, # line-too-long, handled better by black
C0415, # import-outside-toplevel
R0801, # duplicate-code
R0903, # too-few-public-methods
+20 -2
View File
@@ -24,6 +24,7 @@ Files: **/*.after*
**/testdata/*
.github/*
.gitlab/*
.mailmap
AUTHORS
CHANGES
COPYRIGHT
@@ -38,15 +39,31 @@ Files: **/*.after*
bin/tests/system/doth/CA/index.txt
bin/tests/system/doth/CA/index.txt.attr
bin/tests/system/doth/CA/serial
bin/tests/system/notify/ns4/named.port.in
bin/tests/system/formerr/badnsec3owner
bin/tests/system/formerr/badrecordname
bin/tests/system/formerr/dupans
bin/tests/system/formerr/dupquestion
bin/tests/system/formerr/keyclass
bin/tests/system/formerr/malformeddeltype
bin/tests/system/formerr/malformedrrsig
bin/tests/system/formerr/nametoolong
bin/tests/system/formerr/noquestions
bin/tests/system/formerr/twoquestions
bin/tests/system/formerr/optwrongname
bin/tests/system/formerr/qtypeasanswer
bin/tests/system/formerr/questionclass
bin/tests/system/formerr/shortquestion
bin/tests/system/formerr/shortrecord
bin/tests/system/formerr/tsignotlast
bin/tests/system/formerr/tsigwrongclass
bin/tests/system/formerr/twoquestionnames
bin/tests/system/formerr/twoquestiontypes
bin/tests/system/formerr/wrongclass
bin/tests/system/forward/CA/CA.cfg
bin/tests/system/forward/CA/README
bin/tests/system/forward/CA/index.txt
bin/tests/system/forward/CA/index.txt.attr
bin/tests/system/forward/CA/serial
bin/tests/system/isctest/vars/.ac_vars/*
bin/tests/system/journal/ns1/managed-keys.bind.in
bin/tests/system/journal/ns1/managed-keys.bind.jnl.in
bin/tests/system/journal/ns2/managed-keys.bind.in
@@ -57,6 +74,7 @@ Files: **/*.after*
bin/tests/system/masterfile/knowngood.include
bin/tests/system/masterfile/knowngood.ttl1
bin/tests/system/masterfile/knowngood.ttl2
bin/tests/system/notify/ns4/named.port.in
bin/tests/system/nsupdate/CA/CA.cfg
bin/tests/system/nsupdate/CA/README
bin/tests/system/nsupdate/CA/index.txt
+109
View File
@@ -1,3 +1,112 @@
6404. [placeholder]
6403. [placeholder]
6402. [placeholder]
6401. [placeholder]
6400. [placeholder]
6399. [placeholder]
6398. [placeholder]
6397. [placeholder]
6396. [func] Outgoing zone transfers are no longer enabled by
default. To enable them, an "allow-transfer" ACL
must be specified. [GL #4728]
6395. [bug] Handle ISC_R_HOSTDOWN and ISC_R_NETDOWN in resolver.c.
[GL #4736]
6394. [bug] Named's -4 and -6 options now apply to zone primaries,
also-notify and parental-agents. Report when a zone
has these options configured but does not have an IPv4
or IPv6 address listed respectively. [GL #3472]
6393. [func] Deal with uv_tcp_close_reset() error return codes
more gracefully. [GL #4708]
6392. [bug] Use a completely new memory context when flushing the
cache. [GL #2744]
6391. [placeholder]
6390. [placeholder]
6389. [bug] dnssec-verify and dnssec-signzone could fail if there
was an obscured DNSKEY RRset at a delegatation.
[GL #4517]
6388. [placeholder]
6387. [func] Added a new statistics variable "recursive high-water"
that reports the maximum number of simultaneous
recursive clients BIND has handled while running.
[GL #4668]
6386. [bug] When shutting down catzs->view could point to freed
memory. Obtain a reference to the view to prevent this.
[GL #4502]
6385. [func] Relax SVCB alias mode checks to allow parameters.
[GL #4704]
6384. [bug] Remove infinite loop when including a directory in a
zone file. [GL #4357]
6383. [bug] Address an infinite loop in $GENERATE when a negative
value was converted in nibble mode. [GL #4353]
6382. [bug] Fix RPZ response's SOA record TTL, which was incorrectly
set to 1 if 'add-soa' is used. [GL #3323]
--- 9.19.24 released ---
6381. [bug] dns_qp_lookup() could position the iterator at the
wrong predecessor when searching for names with
uncommon characters, which are encoded as two-octet
sequences in QP trie keys. [GL #4702]
6380. [func] Queries and responses now emit distinct dnstap entries
for DoT and DoH. [GL #4523]
6379. [bug] A QP iterator bug could result in DNSSEC validation
failing because the wrong NSEC was returned. [GL #4659]
6378. [func] The option to specify the number of UDP dispatches was
previously removed. An attempt to use the option now
prints a warning. [GL #1879]
6377. [func] Introduce 'dnssec-ksr', a DNSSEC tool to create
Key Signing Requests (KSRs) and Signed Key Responses
(SKRs). [GL #1128]
6376. [func] Allow 'dnssec-keygen' options '-f' and '-k' to be used
together to create a subset of keys from the DNSSEC
policy. [GL !8188]
6375. [func] Allow multiple RNDC message to be processed from
a single TCP read. [GL #4416]
6374. [func] Don't count expired / future RRSIGs in verification
failure quota. [GL #4586]
6373. [func] Offload the isc_http response processing to worker
thread. [GL #4680]
6372. [func] Implement signature jitter for dnssec-policy. [GL #4554]
6371. [bug] Access to the trust bytes in the ncache data needed to
be made thread safe. [GL #4475]
6370. [bug] Wrong source address used for IPv6 notify messages.
[GL #4669]
--- 9.19.23 released ---
6369. [func] The 'fixed' value for the 'rrset-order' option has
been marked and documented as deprecated. [GL #4446]
+1 -1
View File
@@ -2151,7 +2151,7 @@ run_server(void *arg) {
CHECK(dns_view_create(mctx, dispatchmgr, dns_rdataclass_in, "_default",
&view));
CHECK(dns_cache_create(loopmgr, dns_rdataclass_in, "", &cache));
CHECK(dns_cache_create(loopmgr, dns_rdataclass_in, "", mctx, &cache));
dns_view_setcache(view, cache, false);
dns_cache_detach(&cache);
dns_view_setdstport(view, destport);
+1
View File
@@ -2,6 +2,7 @@ dnssec-cds
dnssec-dsfromkey
dnssec-keyfromlabel
dnssec-keygen
dnssec-ksr
dnssec-makekeyset
dnssec-revoke
dnssec-settime
+3 -4
View File
@@ -2,6 +2,7 @@ include $(top_srcdir)/Makefile.top
AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBISCCFG_CFLAGS) \
$(LIBDNS_CFLAGS)
AM_CPPFLAGS += \
@@ -12,6 +13,7 @@ noinst_LTLIBRARIES = libdnssectool.la
LDADD += \
libdnssectool.la \
$(LIBISC_LIBS) \
$(LIBISCCFG_LIBS) \
$(LIBDNS_LIBS) \
$(OPENSSL_LIBS)
@@ -21,6 +23,7 @@ bin_PROGRAMS = \
dnssec-importkey \
dnssec-keyfromlabel \
dnssec-keygen \
dnssec-ksr \
dnssec-revoke \
dnssec-settime \
dnssec-signzone \
@@ -32,20 +35,16 @@ libdnssectool_la_SOURCES = \
dnssec_keygen_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBISCCFG_CFLAGS) \
$(OPENSSL_CFLAGS)
dnssec_keygen_LDADD = \
$(LDADD) \
$(LIBISCCFG_LIBS) \
$(OPENSSL_LIBS)
dnssec_signzone_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBISCCFG_CFLAGS) \
$(OPENSSL_CFLAGS)
dnssec_signzone_LDADD = \
$(LDADD) \
$(LIBISCCFG_LIBS) \
$(OPENSSL_LIBS)
+8 -3
View File
@@ -54,6 +54,7 @@ static dns_name_t *name = NULL;
static isc_mem_t *mctx = NULL;
static uint32_t ttl;
static bool emitttl = false;
static unsigned int split_width = 0;
static isc_result_t
initname(char *setname) {
@@ -279,8 +280,8 @@ emit(dns_dsdigest_t dt, bool showall, bool cds, dns_rdata_t *rdata) {
fatal("can't print name");
}
result = dns_rdata_tofmttext(&ds, (dns_name_t *)NULL, 0, 0, 0, "",
&textb);
result = dns_rdata_tofmttext(&ds, (dns_name_t *)NULL, 0, 0, split_width,
"", &textb);
if (result != ISC_R_SUCCESS) {
fatal("can't print rdata");
@@ -347,6 +348,7 @@ usage(void) {
" -f zonefile: read keys from a zone file\n"
" -h: print help information\n"
" -K directory: where to find key or keyset files\n"
" -w split base64 rdata text into chunks\n"
" -s: read keys from keyset-<dnsname> file\n"
" -T: TTL of output records (omitted by default)\n"
" -v level: verbosity\n"
@@ -380,7 +382,7 @@ main(int argc, char **argv) {
isc_commandline_errprint = false;
#define OPTIONS "12Aa:Cc:d:Ff:K:l:sT:v:hV"
#define OPTIONS "12Aa:Cc:d:Ff:K:l:sT:v:whV"
while ((ch = isc_commandline_parse(argc, argv, OPTIONS)) != -1) {
switch (ch) {
case '1':
@@ -432,6 +434,9 @@ main(int argc, char **argv) {
fatal("-v must be followed by a number");
}
break;
case 'w':
split_width = UINT_MAX;
break;
case 'F':
/* Reserved for FIPS mode */
FALLTHROUGH;
+28 -112
View File
@@ -56,10 +56,6 @@
#include <dst/dst.h>
#include <isccfg/cfg.h>
#include <isccfg/grammar.h>
#include <isccfg/kaspconf.h>
#include <isccfg/namedconf.h>
#if OPENSSL_VERSION_NUMBER >= 0x30000000L && OPENSSL_API_LEVEL >= 30000
#include <openssl/err.h>
#include <openssl/provider.h>
@@ -67,9 +63,6 @@
#include "dnssectool.h"
#define MAX_RSA 4096 /* should be long enough... */
#define MAX_DH 4096 /* should be long enough... */
const char *program = "dnssec-keygen";
/*
@@ -103,8 +96,9 @@ struct keygen_ctx {
int options;
int dbits;
dns_ttl_t ttl;
uint16_t kskflag;
uint16_t revflag;
bool wantzsk;
bool wantksk;
bool wantrev;
dns_secalg_t alg;
/* timing data */
int prepub;
@@ -184,7 +178,7 @@ usage(void) {
fprintf(stderr, " -d <digest bits> (0 => max, default)\n");
fprintf(stderr, " -E <engine>:\n");
fprintf(stderr, " name of an OpenSSL engine to use\n");
fprintf(stderr, " -f <keyflag>: KSK | REVOKE\n");
fprintf(stderr, " -f <keyflag>: ZSK | KSK | REVOKE\n");
fprintf(stderr, " -F: FIPS mode\n");
fprintf(stderr, " -L <ttl>: default key TTL\n");
fprintf(stderr, " -p <protocol>: (default: 3 [dnssec])\n");
@@ -254,90 +248,6 @@ progress(int p) {
(void)fflush(stderr);
}
static void
kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
const char *keydir, const char *engine, dns_kasp_t **kaspp) {
isc_result_t result = ISC_R_NOTFOUND;
const cfg_listelt_t *element;
const cfg_obj_t *kasps = NULL;
dns_kasp_t *kasp = NULL, *kasp_next;
dns_kasplist_t kasplist;
const cfg_obj_t *keystores = NULL;
dns_keystore_t *ks = NULL, *ks_next;
dns_keystorelist_t kslist;
ISC_LIST_INIT(kasplist);
ISC_LIST_INIT(kslist);
(void)cfg_map_get(config, "key-store", &keystores);
for (element = cfg_list_first(keystores); element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *kconfig = cfg_listelt_value(element);
ks = NULL;
result = cfg_keystore_fromconfig(kconfig, mctx, lctx, engine,
&kslist, NULL);
if (result != ISC_R_SUCCESS) {
fatal("failed to configure key-store '%s': %s",
cfg_obj_asstring(cfg_tuple_get(kconfig, "name")),
isc_result_totext(result));
}
}
/* Default key-directory key store. */
ks = NULL;
(void)cfg_keystore_fromconfig(NULL, mctx, lctx, engine, &kslist, &ks);
INSIST(ks != NULL);
if (keydir != NULL) {
/* '-K keydir' takes priority */
dns_keystore_setdirectory(ks, keydir);
}
dns_keystore_detach(&ks);
(void)cfg_map_get(config, "dnssec-policy", &kasps);
for (element = cfg_list_first(kasps); element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *kconfig = cfg_listelt_value(element);
kasp = NULL;
if (strcmp(cfg_obj_asstring(cfg_tuple_get(kconfig, "name")),
name) != 0)
{
continue;
}
result = cfg_kasp_fromconfig(kconfig, NULL, true, mctx, lctx,
&kslist, &kasplist, &kasp);
if (result != ISC_R_SUCCESS) {
fatal("failed to configure dnssec-policy '%s': %s",
cfg_obj_asstring(cfg_tuple_get(kconfig, "name")),
isc_result_totext(result));
}
INSIST(kasp != NULL);
dns_kasp_freeze(kasp);
break;
}
*kaspp = kasp;
/*
* Cleanup kasp list.
*/
for (kasp = ISC_LIST_HEAD(kasplist); kasp != NULL; kasp = kasp_next) {
kasp_next = ISC_LIST_NEXT(kasp, link);
ISC_LIST_UNLINK(kasplist, kasp, link);
dns_kasp_detach(&kasp);
}
/*
* Cleanup keystore list.
*/
for (ks = ISC_LIST_HEAD(kslist); ks != NULL; ks = ks_next) {
ks_next = ISC_LIST_NEXT(ks, link);
ISC_LIST_UNLINK(kslist, ks, link);
dns_keystore_detach(&ks);
}
}
static void
keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
char filename[255];
@@ -645,8 +555,12 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
if ((ctx->options & DST_TYPE_KEY) != 0) { /* KEY */
flags |= ctx->signatory;
} else if ((flags & DNS_KEYOWNER_ZONE) != 0) { /* DNSKEY */
flags |= ctx->kskflag;
flags |= ctx->revflag;
if (ctx->ksk || ctx->wantksk) {
flags |= DNS_KEYFLAG_KSK;
}
if (ctx->wantrev) {
flags |= DNS_KEYFLAG_REVOKE;
}
}
if (ctx->protocol == -1) {
@@ -769,7 +683,7 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
}
if (ctx->setrev) {
if (ctx->kskflag == 0) {
if (!ctx->wantksk) {
fprintf(stderr,
"%s: warning: Key is "
"not flagged as a KSK, but -R "
@@ -1013,9 +927,11 @@ main(int argc, char **argv) {
case 'f':
c = (unsigned char)(isc_commandline_argument[0]);
if (toupper(c) == 'K') {
ctx.kskflag = DNS_KEYFLAG_KSK;
ctx.wantksk = true;
} else if (toupper(c) == 'Z') {
ctx.wantzsk = true;
} else if (toupper(c) == 'R') {
ctx.revflag = DNS_KEYFLAG_REVOKE;
ctx.wantrev = true;
} else {
fatal("unknown flag '%s'",
isc_commandline_argument);
@@ -1289,8 +1205,8 @@ main(int argc, char **argv) {
if (ctx.size != -1) {
fatal("-k and -b cannot be used together");
}
if (ctx.kskflag || ctx.revflag) {
fatal("-k and -f cannot be used together");
if (ctx.wantrev) {
fatal("-k and -fR cannot be used together");
}
if (ctx.options & DST_TYPE_KEY) {
fatal("-k and -T KEY cannot be used together");
@@ -1305,7 +1221,6 @@ main(int argc, char **argv) {
ctx.use_nsec3 = false;
ctx.alg = DST_ALG_ECDSA256;
ctx.size = 0;
ctx.kskflag = DNS_KEYFLAG_KSK;
ctx.ttl = 3600;
ctx.setttl = true;
ctx.ksk = true;
@@ -1330,8 +1245,8 @@ main(int argc, char **argv) {
ctx.policy, ctx.configfile);
}
kasp_from_conf(config, mctx, ctx.policy, ctx.directory,
engine, &kasp);
kasp_from_conf(config, mctx, lctx, ctx.policy,
ctx.directory, engine, &kasp);
if (kasp == NULL) {
fatal("failed to load dnssec-policy '%s'",
ctx.policy);
@@ -1345,15 +1260,13 @@ main(int argc, char **argv) {
ctx.ttl = dns_kasp_dnskeyttl(kasp);
ctx.setttl = true;
kaspkey = ISC_LIST_HEAD(dns_kasp_keys(kasp));
while (kaspkey != NULL) {
for (kaspkey = ISC_LIST_HEAD(dns_kasp_keys(kasp));
kaspkey != NULL;
kaspkey = ISC_LIST_NEXT(kaspkey, link))
{
ctx.use_nsec3 = false;
ctx.alg = dns_kasp_key_algorithm(kaspkey);
ctx.size = dns_kasp_key_size(kaspkey);
ctx.kskflag = dns_kasp_key_ksk(kaspkey)
? DNS_KEYFLAG_KSK
: 0;
ctx.ksk = dns_kasp_key_ksk(kaspkey);
ctx.zsk = dns_kasp_key_zsk(kaspkey);
ctx.lifetime = dns_kasp_key_lifetime(kaspkey);
@@ -1361,9 +1274,12 @@ main(int argc, char **argv) {
if (ctx.keystore != NULL) {
check_keystore_options(&ctx);
}
if ((ctx.ksk && !ctx.wantksk && ctx.wantzsk) ||
(ctx.zsk && !ctx.wantzsk && ctx.wantksk))
{
continue;
}
keygen(&ctx, mctx, argc, argv);
kaspkey = ISC_LIST_NEXT(kaspkey, link);
}
dns_kasp_detach(&kasp);
+7 -1
View File
@@ -105,7 +105,13 @@ Options
.. option:: -f flag
This option sets the specified flag in the flag field of the KEY/DNSKEY record.
The only recognized flags are KSK (Key-Signing Key) and REVOKE.
The only recognized flags are ZSK (Zone-Signing Key), KSK (Key-Signing Key)
and REVOKE.
Note that ZSK is not a physical flag in the DNSKEY record, it is merely used
to explicitly tell that you want to create a ZSK. Setting :option:`-f` in
conjunction with :option:`-k` will result in generating keys that only
match the given role set with this option.
.. option:: -F
File diff suppressed because it is too large Load Diff
+162
View File
@@ -0,0 +1,162 @@
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
.. iscman:: dnssec-ksr
.. program:: dnssec-ksr
.. _man_dnssec-ksr:
dnssec-ksr - Create signed key response (SKR) files for offline KSK setups
--------------------------------------------------------------------------
Synopsis
~~~~~~~~
:program:`dnssec-ksr` [**-E** engine] [**-e** date/offset] [**-F**] [**-h**] [**-i** date/offset] [**-K** directory] [**-k** policy] [**-l** file] [**-V**] [**-v** level] {command} {zone}
Description
~~~~~~~~~~~
The :program:`dnssec-ksr` can be used to issue several commands that are needed
to generate presigned RRsets for a zone where the private key file of the Key
Signing Key (KSK) is typically offline. This requires Zone Signing Keys
(ZSKs) to be pregenerated, and the DNSKEY, CDNSKEY, and CDS RRsets to be
already signed in advance.
The latter is done by creating Key Signing Requests (KSRs) that can be imported
to the environment where the KSK is available. Once there, this program can
create Signed Key Responses (SKRs) that can be loaded by an authoritative DNS
server.
Options
~~~~~~~
.. option:: -E engine
This option specifies the cryptographic hardware to use, when applicable.
When BIND 9 is built with OpenSSL, this needs to be set to the OpenSSL
engine identifier that drives the cryptographic accelerator or
hardware service module (usually ``pkcs11``).
.. option:: -e date/offset
This option sets the end date for which keys or SKRs need to be generated
(depending on the command).
.. option:: -F
This options turns on FIPS (US Federal Information Processing Standards)
mode if the underlying crytographic library supports running in FIPS
mode.
.. option:: -h
This option prints a short summary of the options and arguments to
:program:`dnssec-ksr`.
.. option:: -i date/offset
This option sets the start date for which keys or SKRs need to be generated
(depending on the command).
.. option:: -K directory
This option sets the directory in which the key files are to be read or
written (depending on the command).
.. option:: -k policy
This option sets the specific ``dnssec-policy`` for which keys need to
be generated, or signed.
.. option:: -l file
This option provides a configuration file that contains a ``dnssec-policy``
statement (matching the policy set with :option:`-k`).
.. option:: -V
This option prints version information.
.. option:: -v level
This option sets the debugging level. Level 1 is intended to be usefully
verbose for general users; higher levels are intended for developers.
``command``
The KSR command to be executed. See below for the available commands.
``zone``
The name of the zone for which the KSR command is being executed.
Commands
~~~~~~~~
.. option:: keygen
Pregenerate a number of zone signing keys (ZSKs), given a DNSSEC policy and
an interval. The number of generated keys depends on the interval and the
ZSK lifetime.
.. option:: request
Create a Key Signing Request (KSR), given a DNSSEC policy and an interval.
This will generate a file with a number of key bundles, where each bundle
contains the currently published ZSKs (according to the timing metadata).
.. option:: sign
Sign a Key Signing Request (KSR), given a DNSSEC policy and an interval,
creating a Signed Key Response (SKR). This will add the corresponding DNSKEY,
CDS, and CDNSKEY records for the KSK that is being used for signing.
Exit Status
~~~~~~~~~~~
The :program:`dnssec-ksr` command exits 0 on success, or non-zero if an error
occurred.
Examples
~~~~~~~~
When you need to generate keys for the zone "example.com" for the next year,
given a ``dnssec-policy`` named "mypolicy":
::
dnssec-ksr -i now -e +1y -k mypolicy -l named.conf keygen example.com
Creating a KSR for the same zone and period can be done with:
::
dnssec-ksr -i now -e +1y -k mypolicy -l named.conf request example.com > ksr.txt
Typically you would now transfer the KSR to the system that has access to the KSK.
Signing the KSR created above can be done with:
::
dnssec-ksr -i now -e +1y -k kskpolicy -l named.conf -f ksr.txt sign example.com
Make sure that the DNSSEC parameters in ``kskpolicy`` match those in ``mypolicy``.
See Also
~~~~~~~~
:iscman:`dnssec-keygen(8) <dnssec-keygen>`,
:iscman:`dnssec-signzone(8) <dnssec-signzone>`,
BIND 9 Administrator Reference Manual.
+7 -3
View File
@@ -1167,7 +1167,7 @@ has_dname(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node) {
* Signs all records at a name.
*/
static void
signname(dns_dbnode_t *node, dns_name_t *name) {
signname(dns_dbnode_t *node, bool apex, dns_name_t *name) {
isc_result_t result;
dns_rdataset_t rdataset;
dns_rdatasetiter_t *rdsiter;
@@ -1218,6 +1218,10 @@ signname(dns_dbnode_t *node, dns_name_t *name) {
dns_name_format(name, namebuf, sizeof(namebuf));
fatal("'%s': found DS RRset without NS RRset\n",
namebuf);
} else if (rdataset.type == dns_rdatatype_dnskey && !apex) {
char namebuf[DNS_NAME_FORMATSIZE];
dns_name_format(name, namebuf, sizeof(namebuf));
fatal("'%s': Non-apex DNSKEY RRset\n", namebuf);
}
signset(&del, &add, node, name, &rdataset);
@@ -1537,7 +1541,7 @@ signapex(void) {
check_result(result, "dns_dbiterator_seek()");
result = dns_dbiterator_current(gdbiter, &node, name);
check_dns_dbiterator_current(result);
signname(node, name);
signname(node, true, name);
dumpnode(name, node);
dns_db_detachnode(gdb, &node);
result = dns_dbiterator_first(gdbiter);
@@ -1666,7 +1670,7 @@ assignwork(void *arg) {
UNLOCK(&namelock);
signname(node, dns_fixedname_name(&fname));
signname(node, false, dns_fixedname_name(&fname));
/*%
* Write a node to the output file, and restart the worker task.
+6 -3
View File
@@ -273,7 +273,7 @@ Options
with cached copies of the old DNSKEY RRset. The :option:`-Q` option forces
:program:`dnssec-signzone` to remove signatures from keys that are no longer
active. This enables ZSK rollover using the procedure described in
:rfc:`4641#4.2.1.1` ("Pre-Publish Key Rollover").
:rfc:`6781#4.1.1.1` ("Pre-Publish Key Rollover").
.. option:: -q
@@ -290,7 +290,7 @@ Options
This option is similar to :option:`-Q`, except it forces
:program:`dnssec-signzone` to remove signatures from keys that are no longer
published. This enables ZSK rollover using the procedure described in
:rfc:`4641#4.2.1.2` ("Double Signature Zone Signing Key
:rfc:`6781#4.1.1.2` ("Double Signature Zone Signing Key
Rollover").
.. option:: -S
@@ -374,6 +374,7 @@ Options
.. note::
``-3 -`` is the recommended configuration. Adding salt provides no practical benefits.
See :rfc:`9276`.
.. option:: -H iterations
@@ -382,6 +383,7 @@ Options
.. warning::
Values greater than 0 cause interoperability issues and also increase the risk of CPU-exhausting DoS attacks.
See :rfc:`9276`.
.. option:: -A
@@ -390,6 +392,7 @@ Options
.. warning::
Do not use this option unless all its implications are fully understood. This option is intended only for extremely large zones (comparable to ``com.``) with sparse secure delegations.
See :rfc:`9276`.
.. option:: -AA
@@ -443,4 +446,4 @@ See Also
~~~~~~~~
:iscman:`dnssec-keygen(8) <dnssec-keygen>`, BIND 9 Administrator Reference Manual, :rfc:`4033`,
:rfc:`4641`.
:rfc:`6781`.
+85
View File
@@ -602,3 +602,88 @@ loadjournal(isc_mem_t *mctx, dns_db_t *db, const char *file) {
cleanup:
dns_journal_destroy(&jnl);
}
void
kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, isc_log_t *lctx,
const char *name, const char *keydir, const char *engine,
dns_kasp_t **kaspp) {
isc_result_t result = ISC_R_NOTFOUND;
const cfg_listelt_t *element;
const cfg_obj_t *kasps = NULL;
dns_kasp_t *kasp = NULL, *kasp_next;
dns_kasplist_t kasplist;
const cfg_obj_t *keystores = NULL;
dns_keystore_t *ks = NULL, *ks_next;
dns_keystorelist_t kslist;
ISC_LIST_INIT(kasplist);
ISC_LIST_INIT(kslist);
(void)cfg_map_get(config, "key-store", &keystores);
for (element = cfg_list_first(keystores); element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *kconfig = cfg_listelt_value(element);
ks = NULL;
result = cfg_keystore_fromconfig(kconfig, mctx, lctx, engine,
&kslist, NULL);
if (result != ISC_R_SUCCESS) {
fatal("failed to configure key-store '%s': %s",
cfg_obj_asstring(cfg_tuple_get(kconfig, "name")),
isc_result_totext(result));
}
}
/* Default key-directory key store. */
ks = NULL;
(void)cfg_keystore_fromconfig(NULL, mctx, lctx, engine, &kslist, &ks);
INSIST(ks != NULL);
if (keydir != NULL) {
/* '-K keydir' takes priority */
dns_keystore_setdirectory(ks, keydir);
}
dns_keystore_detach(&ks);
(void)cfg_map_get(config, "dnssec-policy", &kasps);
for (element = cfg_list_first(kasps); element != NULL;
element = cfg_list_next(element))
{
cfg_obj_t *kconfig = cfg_listelt_value(element);
kasp = NULL;
if (strcmp(cfg_obj_asstring(cfg_tuple_get(kconfig, "name")),
name) != 0)
{
continue;
}
result = cfg_kasp_fromconfig(kconfig, NULL, true, mctx, lctx,
&kslist, &kasplist, &kasp);
if (result != ISC_R_SUCCESS) {
fatal("failed to configure dnssec-policy '%s': %s",
cfg_obj_asstring(cfg_tuple_get(kconfig, "name")),
isc_result_totext(result));
}
INSIST(kasp != NULL);
dns_kasp_freeze(kasp);
break;
}
*kaspp = kasp;
/*
* Cleanup kasp list.
*/
for (kasp = ISC_LIST_HEAD(kasplist); kasp != NULL; kasp = kasp_next) {
kasp_next = ISC_LIST_NEXT(kasp, link);
ISC_LIST_UNLINK(kasplist, kasp, link);
dns_kasp_detach(&kasp);
}
/*
* Cleanup keystore list.
*/
for (ks = ISC_LIST_HEAD(kslist); ks != NULL; ks = ks_next) {
ks_next = ISC_LIST_NEXT(ks, link);
ISC_LIST_UNLINK(kslist, ks, link);
dns_keystore_detach(&ks);
}
}
+13
View File
@@ -20,10 +20,18 @@
#include <isc/log.h>
#include <isc/stdtime.h>
#include <dns/kasp.h>
#include <dns/rdatastruct.h>
#include <dst/dst.h>
#include <isccfg/cfg.h>
#include <isccfg/kaspconf.h>
#include <isccfg/namedconf.h>
#define MAX_RSA 4096 /* should be long enough... */
#define MAX_DH 4096 /* should be long enough... */
/*! verbosity: set by -v and -q option in each program, defined in dnssectool.c
*/
extern int verbose;
@@ -108,3 +116,8 @@ isoptarg(const char *arg, char **argv, void (*usage)(void));
void
loadjournal(isc_mem_t *mctx, dns_db_t *db, const char *journal);
void
kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, isc_log_t *lctx,
const char *name, const char *keydir, const char *engine,
dns_kasp_t **kaspp);
+11 -7
View File
@@ -529,13 +529,17 @@ authors_lookup(bdbnode_t *node) {
isc_result_t result;
const char **p = NULL;
static const char *authors[] = {
"Mark Andrews", "Curtis Blackburn", "James Brister",
"Ben Cottrell", "John H. DuBois III", "Francis Dupont",
"Michael Graff", "Andreas Gustafsson", "Bob Halley",
"Evan Hunt", "JINMEI Tatuya", "Witold Krecicki",
"David Lawrence", "Scott Mann", "Danny Mayer",
"Damien Neil", "Matt Nelson", "Jeremy C. Reed",
"Michael Sawyer", "Brian Wellington", NULL
"Mark Andrews", "Curtis Blackburn",
"James Brister", "Ben Cottrell",
"John H. DuBois III", "Francis Dupont",
"Michael Graff", "Andreas Gustafsson",
"Bob Halley", "Evan Hunt",
"JINMEI Tatuya", "Witold Krecicki",
"David Lawrence", "Scott Mann",
"Danny Mayer", "Aydin Mercan",
"Damien Neil", "Matt Nelson",
"Jeremy C. Reed", "Michael Sawyer",
"Brian Wellington", NULL
};
/*
+2 -1
View File
@@ -207,7 +207,7 @@ options {\n\
/* zone */\n\
allow-query {any;};\n\
allow-query-on {any;};\n\
allow-transfer {any;};\n\
allow-transfer {none;};\n\
# also-notify <none>\n\
check-integrity yes;\n\
check-mx-cname warn;\n\
@@ -298,6 +298,7 @@ dnssec-policy \"default\" {\n\
publish-safety " DNS_KASP_PUBLISH_SAFETY "; \n\
retire-safety " DNS_KASP_RETIRE_SAFETY "; \n\
purge-keys " DNS_KASP_PURGE_KEYS "; \n\
signatures-jitter " DNS_KASP_SIG_JITTER "; \n\
signatures-refresh " DNS_KASP_SIG_REFRESH "; \n\
signatures-validity " DNS_KASP_SIG_VALIDITY "; \n\
signatures-validity-dnskey " DNS_KASP_SIG_VALIDITY_DNSKEY "; \n\
+1
View File
@@ -949,6 +949,7 @@ parse_command_line(int argc, char *argv[]) {
break;
case 'U':
/* Obsolete. No longer in use. Ignore. */
named_main_earlywarning("option '-U' has been removed");
break;
case 'u':
named_g_username = isc_commandline_argument;
+2 -9
View File
@@ -21,7 +21,7 @@ named - Internet domain name server
Synopsis
~~~~~~~~
:program:`named` [ [**-4**] | [**-6**] ] [**-c** config-file] [**-C**] [**-d** debug-level] [**-D** string] [**-E** engine-name] [**-f**] [**-g**] [**-L** logfile] [**-M** option] [**-m** flag] [**-n** #cpus] [**-p** port] [**-s**] [**-t** directory] [**-U** #listeners] [**-u** user] [**-v**] [**-V**] ]
:program:`named` [ [**-4**] | [**-6**] ] [**-c** config-file] [**-C**] [**-d** debug-level] [**-D** string] [**-E** engine-name] [**-f**] [**-g**] [**-L** logfile] [**-M** option] [**-m** flag] [**-n** #cpus] [**-p** port] [**-s**] [**-t** directory] [**-u** user] [**-v**] [**-V**] ]
Description
~~~~~~~~~~~
@@ -163,14 +163,7 @@ Options
.. option:: -U #listeners
This option tells :program:`named` the number of ``#listeners`` worker threads to listen on, for incoming UDP packets on
each address. If not specified, :program:`named` calculates a default
value based on the number of detected CPUs: 1 for 1 CPU, and the
number of detected CPUs minus one for machines with more than 1 CPU.
This cannot be increased to a value higher than the number of CPUs.
If :option:`-n` has been set to a higher value than the number of detected
CPUs, then :option:`-U` may be increased as high as that value, but no
higher.
This option has been removed. Attempts to use it now result in a warning.
.. option:: -u user
+36 -22
View File
@@ -152,11 +152,11 @@
#endif /* HAVE_LMDB */
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t)-1)
#define SIZE_MAX ((size_t) - 1)
#endif /* ifndef SIZE_MAX */
#ifndef SIZE_AS_PERCENT
#define SIZE_AS_PERCENT ((size_t)-2)
#define SIZE_AS_PERCENT ((size_t) - 2)
#endif /* ifndef SIZE_AS_PERCENT */
/* RFC7828 defines timeout as 16-bit value specified in units of 100
@@ -2656,6 +2656,10 @@ catz_addmodzone_cb(void *arg) {
ns_cfgctx_t *cfg = NULL;
dns_zone_t *zone = NULL;
if (isc_loop_shuttingdown(isc_loop_get(named_g_loopmgr, isc_tid()))) {
goto cleanup;
}
cfg = (ns_cfgctx_t *)cz->view->new_zone_config;
if (cfg == NULL) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
@@ -2852,7 +2856,7 @@ cleanup:
}
dns_catz_entry_detach(cz->origin, &cz->entry);
dns_catz_zone_detach(&cz->origin);
dns_view_detach(&cz->view);
dns_view_weakdetach(&cz->view);
isc_mem_putanddetach(&cz->mctx, cz, sizeof(*cz));
}
@@ -2865,6 +2869,10 @@ catz_delzone_cb(void *arg) {
char cname[DNS_NAME_FORMATSIZE];
const char *file = NULL;
if (isc_loop_shuttingdown(isc_loop_get(named_g_loopmgr, isc_tid()))) {
goto cleanup;
}
isc_loopmgr_pause(named_g_loopmgr);
dns_name_format(dns_catz_entry_getname(cz->entry), cname,
@@ -2877,7 +2885,7 @@ catz_delzone_cb(void *arg) {
"catz: catz_delzone_cb: "
"zone '%s' not found",
cname);
goto cleanup;
goto resume;
}
if (!dns_zone_getadded(zone)) {
@@ -2886,7 +2894,7 @@ catz_delzone_cb(void *arg) {
"catz: catz_delzone_cb: "
"zone '%s' is not a dynamically added zone",
cname);
goto cleanup;
goto resume;
}
if (dns_zone_get_parentcatz(zone) != cz->origin) {
@@ -2895,7 +2903,7 @@ catz_delzone_cb(void *arg) {
"catz: catz_delzone_cb: zone "
"'%s' exists in multiple catalog zones",
cname);
goto cleanup;
goto resume;
}
/* Stop answering for this zone */
@@ -2904,7 +2912,9 @@ catz_delzone_cb(void *arg) {
dns_zone_unload(zone);
}
CHECK(dns_view_delzone(cz->view, zone));
if (dns_view_delzone(cz->view, zone) != ISC_R_SUCCESS) {
goto resume;
}
file = dns_zone_getfile(zone);
if (file != NULL) {
isc_file_remove(file);
@@ -2919,14 +2929,15 @@ catz_delzone_cb(void *arg) {
"catz: catz_delzone_cb: "
"zone '%s' deleted",
cname);
cleanup:
resume:
isc_loopmgr_resume(named_g_loopmgr);
cleanup:
if (zone != NULL) {
dns_zone_detach(&zone);
}
dns_catz_entry_detach(cz->origin, &cz->entry);
dns_catz_zone_detach(&cz->origin);
dns_view_detach(&cz->view);
dns_view_weakdetach(&cz->view);
isc_mem_putanddetach(&cz->mctx, cz, sizeof(*cz));
}
@@ -2958,7 +2969,7 @@ catz_run(dns_catz_entry_t *entry, dns_catz_zone_t *origin, dns_view_t *view,
dns_catz_entry_attach(entry, &cz->entry);
dns_catz_zone_attach(origin, &cz->origin);
dns_view_attach(view, &cz->view);
dns_view_weakattach(view, &cz->view);
isc_async_run(named_g_mainloop, action, cz);
@@ -4660,7 +4671,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* is simply a named cache that is not shared.
*/
CHECK(dns_cache_create(named_g_loopmgr, view->rdclass,
cachename, &cache));
cachename, mctx, &cache));
}
nsc = isc_mem_get(mctx, sizeof(*nsc));
nsc->cache = NULL;
@@ -12173,6 +12184,12 @@ named_server_status(named_server_t *server, isc_buffer_t **text) {
isc_quota_getmax(&server->sctx->recursionquota));
CHECK(putstr(text, line));
snprintf(line, sizeof(line), "recursive high-water: %u\n",
(unsigned int)ns_stats_get_counter(
server->sctx->nsstats,
ns_statscounter_recurshighwater));
CHECK(putstr(text, line));
snprintf(line, sizeof(line), "tcp clients: %u/%u\n",
isc_quota_getused(&server->sctx->tcpquota),
isc_quota_getmax(&server->sctx->tcpquota));
@@ -15081,29 +15098,26 @@ named_server_zonestatus(named_server_t *server, isc_lex_t *lex,
{
dns_name_t *name;
dns_fixedname_t fixed;
dns_rdataset_t next;
isc_stdtime_t resign;
dns_typepair_t typepair;
dns_rdataset_init(&next);
name = dns_fixedname_initname(&fixed);
result = dns_db_getsigningtime(db, &next, name);
result = dns_db_getsigningtime(db, &resign, name, &typepair);
if (result == ISC_R_SUCCESS) {
char namebuf[DNS_NAME_FORMATSIZE];
char typebuf[DNS_RDATATYPE_FORMATSIZE];
resign -= dns_zone_getsigresigninginterval(zone);
dns_name_format(name, namebuf, sizeof(namebuf));
dns_rdatatype_format(next.covers, typebuf,
sizeof(typebuf));
dns_rdatatype_format(DNS_TYPEPAIR_COVERS(typepair),
typebuf, sizeof(typebuf));
snprintf(resignbuf, sizeof(resignbuf), "%s/%s", namebuf,
typebuf);
isc_time_set(
&resigntime,
next.resign -
dns_zone_getsigresigninginterval(zone),
0);
isc_time_set(&resigntime, resign, 0);
isc_time_formathttptimestamp(&resigntime, rtbuf,
sizeof(rtbuf));
dns_rdataset_disassociate(&next);
}
}
+2
View File
@@ -327,6 +327,8 @@ init_desc(void) {
SET_NSSTATDESC(updatebadprereq,
"updates rejected due to prerequisite failure",
"UpdateBadPrereq");
SET_NSSTATDESC(recurshighwater, "Recursive clients high-water",
"RecursHighwater");
SET_NSSTATDESC(recursclients, "recursing clients", "RecursClients");
SET_NSSTATDESC(dns64, "queries answered by DNS64", "DNS64");
SET_NSSTATDESC(ratedropped, "responses dropped for rate limits",
+2 -4
View File
@@ -305,8 +305,7 @@ rndc_recvdone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
fatal("recv failed: %s", isc_result_totext(result));
}
source.rstart = isc_buffer_base(ccmsg->buffer);
source.rend = isc_buffer_used(ccmsg->buffer);
isccc_ccmsg_toregion(ccmsg, &source);
DO("parse message",
isccc_cc_fromwire(&source, &response, algorithm, &secret));
@@ -381,8 +380,7 @@ rndc_recvnonce(isc_nmhandle_t *handle ISC_ATTR_UNUSED, isc_result_t result,
fatal("recv failed: %s", isc_result_totext(result));
}
source.rstart = isc_buffer_base(ccmsg->buffer);
source.rend = isc_buffer_used(ccmsg->buffer);
isccc_ccmsg_toregion(ccmsg, &source);
DO("parse message",
isccc_cc_fromwire(&source, &response, algorithm, &secret));
-1
View File
@@ -3,7 +3,6 @@ nxtify
sdig
*_test
gsstest
conf.sh
dlopen
keycreate
keydelete
+2
View File
@@ -19,6 +19,8 @@ named.run
/start.sh
/stop.sh
/ifconfig.sh
/isctest/vars/.ac_vars/*
!/isctest/vars/.ac_vars/*.in
# Ignore file names with underscore in their name except python or shell files.
# This is done to ignore the temporary directories and symlinks created by the
+1
View File
@@ -128,6 +128,7 @@ TESTS = \
kasp \
keepalive \
keyfromlabel \
ksr \
legacy \
limits \
logfileconfig \
@@ -25,6 +25,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
allow-transfer { any; };
allow-query { any; };
allow-new-zones yes;
recursion no;
@@ -23,6 +23,7 @@ options {
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
allow-query { any; };
allow-transfer { any; };
recursion no;
allow-new-zones yes;
dnssec-validation no;
@@ -23,6 +23,7 @@ options {
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
allow-query { any; };
allow-transfer { any; };
recursion no;
allow-new-zones yes;
dnssec-validation no;
+2
View File
@@ -25,6 +25,8 @@ options {
};
view main in {
allow-transfer { any; };
zone example.net {
type primary;
file "example.net.db";
@@ -21,6 +21,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
notify yes;
dnssec-validation yes;
@@ -21,6 +21,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
notify yes;
dnssec-validation yes;
@@ -24,6 +24,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
notify yes;
dnssec-validation yes;
@@ -87,6 +88,7 @@ dnssec-policy "jitter" {
signatures-validity P10D;
signatures-validity-dnskey P10D;
signatures-refresh P2D;
signatures-jitter P8D;
};
# Jitter, NSEC3
+4 -4
View File
@@ -91,10 +91,10 @@ checkjitter() {
_count=0
# Check if we have at least 4 days
# This number has been tuned for `signatures-validity 10d; signatures-refresh 2d`, as
# 1 signature expiration dates should be spread out across at most 8 (10-2) days
# 2. we remove first and last day to remove frequency outlier, we are left with 6 (8-2) days
# 3. we subtract two more days to allow test pass on day boundaries, etc. leaving us with 4 (6-2)
# This number has been tuned for `signatures-validity 10d; signatures-jitter 8d`, as
# 1. signature expiration dates should be spread out across at most 8 days
# 2. we remove first and last day to remove frequency outlier, we are left with 6 days
# 3. we subtract two more days to allow test pass on day boundaries, etc. leaving us with 4 days
for _num in $_expiretimes; do
_count=$((_count + 1))
done
@@ -19,6 +19,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
dnssec-validation no;
notify yes;
+1
View File
@@ -19,6 +19,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
notify yes;
ixfr-from-differences yes;
+1
View File
@@ -19,6 +19,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
notify yes;
ixfr-from-differences yes;
+1
View File
@@ -25,6 +25,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { fd92:7065:b8e:ffff::2; };
allow-transfer { any; };
notify no;
notify-delay 0;
recursion no;
+1
View File
@@ -25,6 +25,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { fd92:7065:b8e:ffff::2; };
allow-transfer { any; };
notify no;
notify-delay 0;
recursion no;
+1
View File
@@ -27,6 +27,7 @@ options {
provide-ixfr no;
listen-on { 10.53.0.3; };
listen-on-v6 { fd92:7065:b8e:ffff::3; };
allow-transfer { any; };
notify no;
notify-delay 0;
recursion no;
+1
View File
@@ -26,6 +26,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.4; };
listen-on-v6 { fd92:7065:b8e:ffff::4; };
allow-transfer { any; };
notify no;
notify-delay 0;
recursion no;
@@ -0,0 +1,27 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*
* The dnssec-policy jitter is more than signatures-validity,
* which is not allowed.
*/
dnssec-policy high-jitter {
signatures-jitter P8DT1S;
signatures-validity P8D;
};
zone "example.net" {
type primary;
file "example.db";
dnssec-policy high-jitter;
};
@@ -34,6 +34,7 @@ dnssec-policy "test" {
parent-propagation-delay PT1H;
publish-safety PT3600S;
retire-safety PT3600S;
signatures-jitter PT12H;
signatures-refresh P3D;
signatures-validity P2W;
signatures-validity-dnskey P14D;
+1
View File
@@ -34,6 +34,7 @@ dnssec-policy "test" {
publish-safety PT3600S;
purge-keys P90D;
retire-safety PT3600S;
signatures-jitter PT12H;
signatures-refresh P3D;
signatures-validity P2W;
signatures-validity-dnskey P14D;
+3 -3
View File
@@ -14,10 +14,10 @@
from typing import NamedTuple, Tuple
import os
import subprocess
import sys
import time
import isctest
import pytest
pytest.importorskip("dns", minversion="2.0.0")
@@ -87,7 +87,7 @@ def verify_zone(zone, transfer):
# dnssec-verify command with default arguments.
verify_cmd = [verify, "-z", "-o", zone, filename]
verifier = subprocess.run(verify_cmd, capture_output=True, check=True)
verifier = isctest.run.cmd(verify_cmd)
if verifier.returncode != 0:
print(f"error: dnssec-verify {zone} failed")
@@ -234,7 +234,7 @@ def rekey(zone):
"loadkeys",
zone,
]
controller = subprocess.run(rndc_cmd, capture_output=True, check=True)
controller = isctest.run.cmd(rndc_cmd)
if controller.returncode != 0:
print(f"error: rndc loadkeys {zone} failed")
@@ -19,6 +19,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.4; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion yes;
dnssec-validation yes;
check-names primary ignore;
@@ -19,6 +19,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.5; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion yes;
dnssec-validation yes;
check-names master ignore;
@@ -0,0 +1,13 @@
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
;
; SPDX-License-Identifier: MPL-2.0
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, you can obtain one at https://mozilla.org/MPL/2.0/.
;
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
$INCLUDE .
$INCLUDE ..
@@ -18,3 +18,4 @@ $GENERATE 0-7 host$ A 1.2.3.${1,0,d}
$GENERATE 8-9 host$ A 1.2.3.${1,0}
$GENERATE 10-11 host$ A 1.2.3.${1}
$GENERATE 1024-1026 ${0,3,n} AAAA 2001:db8::${0,4,x}
$GENERATE 1024-1026 ${-2000,0,n} AAAA 2001:db8::${0,4,x}
@@ -11,146 +11,92 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# When sourcing the script outside the pytest environment (e.g. during helper
# script development), the env variables have to be loaded.
if [ -z "$TOP_SRCDIR" ]; then
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd | sed -E 's|(.*bin/tests/system).*|\1|')
eval "$(PYTHONPATH="$SCRIPT_DIR:$PYTHONPATH" /usr/bin/env python3 -m isctest)"
fi
testsock6() {
if test -n "$PERL" && $PERL -e "use IO::Socket::IP;" 2> /dev/null
then
$PERL "$TOP_SRCDIR/bin/tests/system/testsock6.pl" "$@"
else
false
fi
if test -n "$PERL" && $PERL -e "use IO::Socket::IP;" 2>/dev/null; then
$PERL "$TOP_SRCDIR/bin/tests/system/testsock6.pl" "$@"
else
false
fi
}
export LANG=C
echofail() {
echo "$*"
}
echowarn() {
echo "$*"
}
echopass() {
echo "$*"
}
echoinfo() {
echo "$*"
}
echostart() {
echo "$*"
}
echoend() {
echo "$*"
}
echo_i() {
echo "$@" | while IFS= read -r __LINE; do
echoinfo "I:$__LINE"
done
}
#
# Set up color-coded test output
#
if [ ${SYSTEMTEST_FORCE_COLOR:-0} -eq 1 ] || test -t 1 && type tput > /dev/null 2>&1 && tput setaf 7 > /dev/null 2>&1 ; then
export COLOR_END=$(tput setaf 4) # blue
export COLOR_FAIL=$(tput setaf 1) # red
export COLOR_INFO=$(tput bold) # bold
export COLOR_NONE=$(tput sgr0)
export COLOR_PASS=$(tput setaf 2) # green
export COLOR_START=$(tput setaf 4) # blue
export COLOR_WARN=$(tput setaf 3) # yellow
else
# set to empty strings so printf succeeds
export COLOR_END=''
export COLOR_FAIL=''
export COLOR_INFO=''
export COLOR_NONE=''
export COLOR_PASS=''
export COLOR_START=''
export COLOR_WARN=''
fi
echo_ic() {
echo "$@" | while IFS= read -r __LINE; do
echoinfo "I: $__LINE"
done
}
export SYSTESTDIR="$(basename $PWD)"
if type printf > /dev/null 2>&1
then
echofail () {
printf "${COLOR_FAIL}%s${COLOR_NONE}\n" "$*"
}
echowarn () {
printf "${COLOR_WARN}%s${COLOR_NONE}\n" "$*"
}
echopass () {
printf "${COLOR_PASS}%s${COLOR_NONE}\n" "$*"
}
echoinfo () {
printf "${COLOR_INFO}%s${COLOR_NONE}\n" "$*"
}
echostart () {
printf "${COLOR_START}%s${COLOR_NONE}\n" "$*"
}
echoend () {
printf "${COLOR_END}%s${COLOR_NONE}\n" "$*"
}
echo_i() {
printf '%s\n' "$*" | while IFS= read -r __LINE ; do
echoinfo "I:$__LINE"
done
}
echo_ic() {
printf '%s\n' "$*" | while IFS= read -r __LINE ; do
echoinfo "I: $__LINE"
done
}
echo_d() {
printf '%s\n' "$*" | while IFS= read -r __LINE ; do
echoinfo "D:$__LINE"
done
}
else
echofail () {
echo "$*"
}
echowarn () {
echo "$*"
}
echopass () {
echo "$*"
}
echoinfo () {
echo "$*"
}
echostart () {
echo "$*"
}
echoend () {
echo "$*"
}
echo_i() {
echo "$@" | while IFS= read -r __LINE ; do
echoinfo "I:$__LINE"
done
}
echo_ic() {
echo "$@" | while IFS= read -r __LINE ; do
echoinfo "I: $__LINE"
done
}
echo_d() {
echo "$@" | while IFS= read -r __LINE ; do
echoinfo "D:$__LINE"
done
}
fi
echo_d() {
echo "$@" | while IFS= read -r __LINE; do
echoinfo "D:$__LINE"
done
}
cat_i() {
while IFS= read -r __LINE ; do
echoinfo "I:$__LINE"
done
while IFS= read -r __LINE; do
echoinfo "I:$__LINE"
done
}
cat_d() {
while IFS= read -r __LINE ; do
echoinfo "D:$__LINE"
done
while IFS= read -r __LINE; do
echoinfo "D:$__LINE"
done
}
digcomp() {
{ output=$($PERL $TOP_SRCDIR/bin/tests/system/digcomp.pl "$@"); result=$?; } || true
[ -n "$output" ] && { echo "digcomp failed:"; echo "$output"; } | cat_i
return $result
{
output=$($PERL $TOP_SRCDIR/bin/tests/system/digcomp.pl "$@")
result=$?
} || true
[ -n "$output" ] && {
echo "digcomp failed:"
echo "$output"
} | cat_i
return $result
}
start_server() {
$PERL "$TOP_SRCDIR/bin/tests/system/start.pl" "$SYSTESTDIR" "$@"
$PERL "$TOP_SRCDIR/bin/tests/system/start.pl" "$SYSTESTDIR" "$@"
}
stop_server() {
$PERL "$TOP_SRCDIR/bin/tests/system/stop.pl" "$SYSTESTDIR" "$@"
$PERL "$TOP_SRCDIR/bin/tests/system/stop.pl" "$SYSTESTDIR" "$@"
}
send() {
$PERL "$TOP_SRCDIR/bin/tests/system/send.pl" "$@"
$PERL "$TOP_SRCDIR/bin/tests/system/send.pl" "$@"
}
#
@@ -199,94 +145,94 @@ export DEFAULT_HMAC=hmac-sha256
# the error using the description of the tested variable provided in $3
# and return 1.
assert_int_equal() {
found="$1"
expected="$2"
description="$3"
found="$1"
expected="$2"
description="$3"
if [ "${expected}" -ne "${found}" ]; then
echo_i "incorrect ${description}: got ${found}, expected ${expected}"
return 1
fi
if [ "${expected}" -ne "${found}" ]; then
echo_i "incorrect ${description}: got ${found}, expected ${expected}"
return 1
fi
return 0
return 0
}
# keyfile_to_keys_section: helper function for keyfile_to_*_keys() which
# converts keyfile data into a key-style trust anchor configuration
# section using the supplied parameters
keyfile_to_keys() {
section_name=$1
key_prefix=$2
shift
shift
echo "$section_name {"
for keyname in $*; do
awk '!/^; /{
section_name=$1
key_prefix=$2
shift
shift
echo "$section_name {"
for keyname in $*; do
awk '!/^; /{
printf "\t\""$1"\" "
printf "'"$key_prefix "'"
printf $4 " " $5 " " $6 " \""
for (i=7; i<=NF; i++) printf $i
printf "\";\n"
}' $keyname.key
done
echo "};"
done
echo "};"
}
# keyfile_to_dskeys_section: helper function for keyfile_to_*_dskeys()
# converts keyfile data into a DS-style trust anchor configuration
# section using the supplied parameters
keyfile_to_dskeys() {
section_name=$1
key_prefix=$2
shift
shift
echo "$section_name {"
for keyname in $*; do
$DSFROMKEY $keyname.key | \
awk '!/^; /{
section_name=$1
key_prefix=$2
shift
shift
echo "$section_name {"
for keyname in $*; do
$DSFROMKEY $keyname.key \
| awk '!/^; /{
printf "\t\""$1"\" "
printf "'"$key_prefix "'"
printf $4 " " $5 " " $6 " \""
for (i=7; i<=NF; i++) printf $i
printf "\";\n"
}'
done
echo "};"
done
echo "};"
}
# keyfile_to_trusted_keys: convert key data contained in the keyfile(s)
# provided to a "trust-keys" section suitable for including in a
# resolver's configuration file
keyfile_to_trusted_keys() {
keyfile_to_keys "trusted-keys" "" $*
keyfile_to_keys "trusted-keys" "" $*
}
# keyfile_to_static_keys: convert key data contained in the keyfile(s)
# provided to a *static-key* "trust-anchors" section suitable for including in
# a resolver's configuration file
keyfile_to_static_keys() {
keyfile_to_keys "trust-anchors" "static-key" $*
keyfile_to_keys "trust-anchors" "static-key" $*
}
# keyfile_to_initial_keys: convert key data contained in the keyfile(s)
# provided to an *initial-key* "trust-anchors" section suitable for including
# in a resolver's configuration file
keyfile_to_initial_keys() {
keyfile_to_keys "trust-anchors" "initial-key" $*
keyfile_to_keys "trust-anchors" "initial-key" $*
}
# keyfile_to_static_ds_keys: convert key data contained in the keyfile(s)
# provided to a *static-ds* "trust-anchors" section suitable for including in a
# resolver's configuration file
keyfile_to_static_ds() {
keyfile_to_dskeys "trust-anchors" "static-ds" $*
keyfile_to_dskeys "trust-anchors" "static-ds" $*
}
# keyfile_to_initial_ds_keys: convert key data contained in the keyfile(s)
# provided to an *initial-ds* "trust-anchors" section suitable for including
# in a resolver's configuration file
keyfile_to_initial_ds() {
keyfile_to_dskeys "trust-anchors" "initial-ds" $*
keyfile_to_dskeys "trust-anchors" "initial-ds" $*
}
# keyfile_to_key_id: convert a key file name to a key ID
@@ -295,7 +241,7 @@ keyfile_to_initial_ds() {
# print the key ID with leading zeros stripped ("6160" for the
# aforementioned example).
keyfile_to_key_id() {
echo "$1" | sed "s/.*+0\{0,4\}//"
echo "$1" | sed "s/.*+0\{0,4\}//"
}
# private_type_record: write a private type record recording the state of the
@@ -305,13 +251,13 @@ keyfile_to_key_id() {
# private type record with default type value of 65534, indicating that the
# signing process for this key is completed.
private_type_record() {
_zone=$1
_algorithm=$2
_keyfile=$3
_zone=$1
_algorithm=$2
_keyfile=$3
_id=$(keyfile_to_key_id "$_keyfile")
_id=$(keyfile_to_key_id "$_keyfile")
printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
}
# nextpart*() - functions for reading files incrementally
@@ -362,51 +308,51 @@ private_type_record() {
# nextpartreset: reset the marker used by nextpart() and nextpartpeek()
# so that it points to the start of the given file
nextpartreset() {
echo "0" > $1.prev
echo "0" >$1.prev
}
# nextpartread: read everything that's been appended to a file since the
# last time nextpart() was called and print it to stdout, print the
# total number of lines read from that file so far to file descriptor 3
nextpartread() {
[ -f $1.prev ] || nextpartreset $1
prev=$(cat $1.prev)
awk "NR > $prev "'{ print }
[ -f $1.prev ] || nextpartreset $1
prev=$(cat $1.prev)
awk "NR > $prev "'{ print }
END { print NR > "/dev/stderr" }' $1 2>&3
}
# nextpart: read everything that's been appended to a file since the
# last time nextpart() was called
nextpart() {
nextpartread $1 3> $1.prev.tmp
mv $1.prev.tmp $1.prev
nextpartread $1 3>$1.prev.tmp
mv $1.prev.tmp $1.prev
}
# nextpartpeek: read everything that's been appended to a file since the
# last time nextpart() was called
nextpartpeek() {
nextpartread $1 3> /dev/null
nextpartread $1 3>/dev/null
}
# _search_log: look for message $1 in file $2 with nextpart().
_search_log() (
msg="$1"
file="$2"
nextpart "$file" | grep -F -e "$msg" > /dev/null
msg="$1"
file="$2"
nextpart "$file" | grep -F -e "$msg" >/dev/null
)
# _search_log_re: same as _search_log but the message is an grep -E regex
_search_log_re() (
msg="$1"
file="$2"
nextpart "$file" | grep -E -e "$msg" > /dev/null
msg="$1"
file="$2"
nextpart "$file" | grep -E -e "$msg" >/dev/null
)
# _search_log_peek: look for message $1 in file $2 with nextpartpeek().
_search_log_peek() (
msg="$1"
file="$2"
nextpartpeek "$file" | grep -F -e "$msg" > /dev/null
msg="$1"
file="$2"
nextpartpeek "$file" | grep -F -e "$msg" >/dev/null
)
# wait_for_log: wait until message $2 in file $3 appears. Bail out after
@@ -415,108 +361,108 @@ _search_log_peek() (
# set correctly. Tests using wait_for_log() are responsible for cleaning up
# the created <file>.prev files.
wait_for_log() (
timeout="$1"
msg="$2"
file="$3"
retry_quiet "$timeout" _search_log "$msg" "$file" && return 0
echo_i "exceeded time limit waiting for literal '$msg' in $file"
return 1
timeout="$1"
msg="$2"
file="$3"
retry_quiet "$timeout" _search_log "$msg" "$file" && return 0
echo_i "exceeded time limit waiting for literal '$msg' in $file"
return 1
)
# wait_for_log_re: same as wait_for_log, but the message is an grep -E regex
wait_for_log_re() (
timeout="$1"
msg="$2"
file="$3"
retry_quiet "$timeout" _search_log_re "$msg" "$file" && return 0
echo_i "exceeded time limit waiting for regex '$msg' in $file"
return 1
timeout="$1"
msg="$2"
file="$3"
retry_quiet "$timeout" _search_log_re "$msg" "$file" && return 0
echo_i "exceeded time limit waiting for regex '$msg' in $file"
return 1
)
# wait_for_log_peek: similar to wait_for_log() but peeking, so the file offset
# does not change.
wait_for_log_peek() (
timeout="$1"
msg="$2"
file="$3"
retry_quiet "$timeout" _search_log_peek "$msg" "$file" && return 0
echo_i "exceeded time limit waiting for literal '$msg' in $file"
return 1
timeout="$1"
msg="$2"
file="$3"
retry_quiet "$timeout" _search_log_peek "$msg" "$file" && return 0
echo_i "exceeded time limit waiting for literal '$msg' in $file"
return 1
)
# _retry: keep running a command until it succeeds, up to $1 times, with
# one-second intervals, optionally printing a message upon every attempt
_retry() {
__retries="${1}"
shift
__retries="${1}"
shift
while :; do
if "$@"; then
return 0
fi
__retries=$((__retries-1))
if [ "${__retries}" -gt 0 ]; then
if [ "${__retry_quiet}" -ne 1 ]; then
echo_i "retrying"
fi
sleep 1
else
return 1
fi
done
while :; do
if "$@"; then
return 0
fi
__retries=$((__retries - 1))
if [ "${__retries}" -gt 0 ]; then
if [ "${__retry_quiet}" -ne 1 ]; then
echo_i "retrying"
fi
sleep 1
else
return 1
fi
done
}
# retry: call _retry() in verbose mode
retry() {
__retry_quiet=0
_retry "$@"
__retry_quiet=0
_retry "$@"
}
# retry_quiet: call _retry() in silent mode
retry_quiet() {
__retry_quiet=1
_retry "$@"
__retry_quiet=1
_retry "$@"
}
# _repeat: keep running command up to $1 times, unless it fails
_repeat() (
__retries="${1}"
shift
while :; do
if ! "$@"; then
return 1
fi
__retries=$((__retries-1))
if [ "${__retries}" -le 0 ]; then
break
fi
done
return 0
__retries="${1}"
shift
while :; do
if ! "$@"; then
return 1
fi
__retries=$((__retries - 1))
if [ "${__retries}" -le 0 ]; then
break
fi
done
return 0
)
_times() {
awk "BEGIN{ for(i = 1; i <= $1; i++) print i}";
awk "BEGIN{ for(i = 1; i <= $1; i++) print i}"
}
rndc_reload() {
$RNDC -c ../_common/rndc.conf -s $2 -p ${CONTROLPORT} reload $3 2>&1 | sed 's/^/'"I:$1"' /'
# reloading single zone is synchronous, if we're reloading whole server
# we need to wait for reload to finish
if [ -z "$3" ]; then
for _ in $(_times 10); do
$RNDC -c ../_common/rndc.conf -s $2 -p ${CONTROLPORT} status | grep "reload/reconfig in progress" > /dev/null || break
sleep 1
done
fi
$RNDC -c ../_common/rndc.conf -s $2 -p ${CONTROLPORT} reload $3 2>&1 | sed 's/^/'"I:$1"' /'
# reloading single zone is synchronous, if we're reloading whole server
# we need to wait for reload to finish
if [ -z "$3" ]; then
for _ in $(_times 10); do
$RNDC -c ../_common/rndc.conf -s $2 -p ${CONTROLPORT} status | grep "reload/reconfig in progress" >/dev/null || break
sleep 1
done
fi
}
rndc_reconfig() {
seconds=${3:-10}
$RNDC -c ../_common/rndc.conf -s "$2" -p "${CONTROLPORT}" reconfig 2>&1 | sed 's/^/'"I:$1"' /'
for _ in $(_times "$seconds"); do
"$RNDC" -c ../_common/rndc.conf -s "$2" -p "${CONTROLPORT}" status | grep "reload/reconfig in progress" > /dev/null || break
sleep 1
done
seconds=${3:-10}
$RNDC -c ../_common/rndc.conf -s "$2" -p "${CONTROLPORT}" reconfig 2>&1 | sed 's/^/'"I:$1"' /'
for _ in $(_times "$seconds"); do
"$RNDC" -c ../_common/rndc.conf -s "$2" -p "${CONTROLPORT}" status | grep "reload/reconfig in progress" >/dev/null || break
sleep 1
done
}
# rndc_dumpdb: call "rndc dumpdb [...]" and wait until it completes
@@ -535,39 +481,38 @@ rndc_reconfig() {
# code other than 0 or if the "; Dump complete" string does not appear in the
# dump within 10 seconds.
rndc_dumpdb() {
__ret=0
__dump_complete=0
__server="${1}"
__ip="10.53.0.$(echo "${__server}" | tr -c -d "0-9")"
__ret=0
__dump_complete=0
__server="${1}"
__ip="10.53.0.$(echo "${__server}" | tr -c -d "0-9")"
shift
${RNDC} -c ../_common/rndc.conf -p "${CONTROLPORT}" -s "${__ip}" dumpdb "$@" > "rndc.out.test${n}" 2>&1 || __ret=1
shift
${RNDC} -c ../_common/rndc.conf -p "${CONTROLPORT}" -s "${__ip}" dumpdb "$@" >"rndc.out.test${n}" 2>&1 || __ret=1
for _ in 0 1 2 3 4 5 6 7 8 9
do
if grep '^; Dump complete$' "${__server}/named_dump.db" > /dev/null; then
mv "${__server}/named_dump.db" "${__server}/named_dump.db.test${n}"
__dump_complete=1
break
fi
sleep 1
done
for _ in 0 1 2 3 4 5 6 7 8 9; do
if grep '^; Dump complete$' "${__server}/named_dump.db" >/dev/null; then
mv "${__server}/named_dump.db" "${__server}/named_dump.db.test${n}"
__dump_complete=1
break
fi
sleep 1
done
if [ ${__dump_complete} -eq 0 ]; then
echo_i "timed out waiting for 'rndc dumpdb' to finish"
__ret=1
fi
if [ ${__dump_complete} -eq 0 ]; then
echo_i "timed out waiting for 'rndc dumpdb' to finish"
__ret=1
fi
return ${__ret}
return ${__ret}
}
# get_dig_xfer_stats: extract transfer statistics from dig output stored
# in $1, converting them to a format used by some system tests.
get_dig_xfer_stats() {
LOGFILE="$1"
sed -n "s/^;; XFR size: .*messages \([0-9][0-9]*\).*/messages=\1/p" "${LOGFILE}"
sed -n "s/^;; XFR size: \([0-9][0-9]*\) records.*/records=\1/p" "${LOGFILE}"
sed -n "s/^;; XFR size: .*bytes \([0-9][0-9]*\).*/bytes=\1/p" "${LOGFILE}"
LOGFILE="$1"
sed -n "s/^;; XFR size: .*messages \([0-9][0-9]*\).*/messages=\1/p" "${LOGFILE}"
sed -n "s/^;; XFR size: \([0-9][0-9]*\) records.*/records=\1/p" "${LOGFILE}"
sed -n "s/^;; XFR size: .*bytes \([0-9][0-9]*\).*/bytes=\1/p" "${LOGFILE}"
}
# get_named_xfer_stats: from named log file $1, extract transfer
@@ -575,16 +520,16 @@ get_dig_xfer_stats() {
# message which has to contain the string provided in $4), converting
# them to a format used by some system tests.
get_named_xfer_stats() {
LOGFILE="$1"
PEER="$(echo $2 | sed 's/\./\\./g')"
ZONE="$(echo $3 | sed 's/\./\\./g')"
MESSAGE="$4"
grep " ${PEER}#.*${MESSAGE}:" "${LOGFILE}" | \
sed -n "s/.* '${ZONE}\/.* \([0-9][0-9]*\) messages.*/messages=\1/p" | tail -1
grep " ${PEER}#.*${MESSAGE}:" "${LOGFILE}" | \
sed -n "s/.* '${ZONE}\/.* \([0-9][0-9]*\) records.*/records=\1/p" | tail -1
grep " ${PEER}#.*${MESSAGE}:" "${LOGFILE}" | \
sed -n "s/.* '${ZONE}\/.* \([0-9][0-9]*\) bytes.*/bytes=\1/p" | tail -1
LOGFILE="$1"
PEER="$(echo $2 | sed 's/\./\\./g')"
ZONE="$(echo $3 | sed 's/\./\\./g')"
MESSAGE="$4"
grep " ${PEER}#.*${MESSAGE}:" "${LOGFILE}" \
| sed -n "s/.* '${ZONE}\/.* \([0-9][0-9]*\) messages.*/messages=\1/p" | tail -1
grep " ${PEER}#.*${MESSAGE}:" "${LOGFILE}" \
| sed -n "s/.* '${ZONE}\/.* \([0-9][0-9]*\) records.*/records=\1/p" | tail -1
grep " ${PEER}#.*${MESSAGE}:" "${LOGFILE}" \
| sed -n "s/.* '${ZONE}\/.* \([0-9][0-9]*\) bytes.*/bytes=\1/p" | tail -1
}
# copy_setports - Copy Configuration File and Replace Ports
@@ -598,57 +543,33 @@ get_named_xfer_stats() {
# copy_setports infile outfile
#
copy_setports() {
dir=$(echo "$TMPDIR" | sed 's/\//\\\//g')
dir=$(echo "$TMPDIR" | sed 's/\//\\\//g')
sed -e "s/@TMPDIR@/${dir}/g" \
-e "s/@PORT@/${PORT}/g" \
-e "s/@TLSPORT@/${TLSPORT}/g" \
-e "s/@HTTPPORT@/${HTTPPORT}/g" \
-e "s/@HTTPSPORT@/${HTTPSPORT}/g" \
-e "s/@EXTRAPORT1@/${EXTRAPORT1}/g" \
-e "s/@EXTRAPORT2@/${EXTRAPORT2}/g" \
-e "s/@EXTRAPORT3@/${EXTRAPORT3}/g" \
-e "s/@EXTRAPORT4@/${EXTRAPORT4}/g" \
-e "s/@EXTRAPORT5@/${EXTRAPORT5}/g" \
-e "s/@EXTRAPORT6@/${EXTRAPORT6}/g" \
-e "s/@EXTRAPORT7@/${EXTRAPORT7}/g" \
-e "s/@EXTRAPORT8@/${EXTRAPORT8}/g" \
-e "s/@CONTROLPORT@/${CONTROLPORT}/g" \
-e "s/@DEFAULT_ALGORITHM@/${DEFAULT_ALGORITHM}/g" \
-e "s/@DEFAULT_ALGORITHM_NUMBER@/${DEFAULT_ALGORITHM_NUMBER}/g" \
-e "s/@DEFAULT_BITS@/${DEFAULT_BITS}/g" \
-e "s/@ALTERNATIVE_ALGORITHM@/${ALTERNATIVE_ALGORITHM}/g" \
-e "s/@ALTERNATIVE_ALGORITHM_NUMBER@/${ALTERNATIVE_ALGORITHM_NUMBER}/g" \
-e "s/@ALTERNATIVE_BITS@/${ALTERNATIVE_BITS}/g" \
-e "s/@DEFAULT_HMAC@/${DEFAULT_HMAC}/g" \
-e "s/@DISABLED_ALGORITHM@/${DISABLED_ALGORITHM}/g" \
-e "s/@DISABLED_ALGORITHM_NUMBER@/${DISABLED_ALGORITHM_NUMBER}/g" \
-e "s/@DISABLED_BITS@/${DISABLED_BITS}/g" \
$1 > $2
}
# parse_openssl_config - Parse OpenSSL configuration for HSM settings
#
# Will set SOFTHSM2_MODULE, OPENSSL_ENGINE and ENGINE_ARG based on openssl configuration.
parse_openssl_config() {
ENGINE_ARG=""
[ -f "$OPENSSL_CONF" ] || return 0
while IFS="=" read key val; do
# trim variables
key="${key## }"
key="${key%% }"
val="${val## }"
val="${val%% }"
case "$key" in
"engine_id")
OPENSSL_ENGINE="$val"
ENGINE_ARG="-E $OPENSSL_ENGINE"
;;
"MODULE_PATH"|"pkcs11-module-path")
SOFTHSM2_MODULE="$val"
;;
esac
done < "$OPENSSL_CONF"
sed -e "s/@TMPDIR@/${dir}/g" \
-e "s/@PORT@/${PORT}/g" \
-e "s/@TLSPORT@/${TLSPORT}/g" \
-e "s/@HTTPPORT@/${HTTPPORT}/g" \
-e "s/@HTTPSPORT@/${HTTPSPORT}/g" \
-e "s/@EXTRAPORT1@/${EXTRAPORT1}/g" \
-e "s/@EXTRAPORT2@/${EXTRAPORT2}/g" \
-e "s/@EXTRAPORT3@/${EXTRAPORT3}/g" \
-e "s/@EXTRAPORT4@/${EXTRAPORT4}/g" \
-e "s/@EXTRAPORT5@/${EXTRAPORT5}/g" \
-e "s/@EXTRAPORT6@/${EXTRAPORT6}/g" \
-e "s/@EXTRAPORT7@/${EXTRAPORT7}/g" \
-e "s/@EXTRAPORT8@/${EXTRAPORT8}/g" \
-e "s/@CONTROLPORT@/${CONTROLPORT}/g" \
-e "s/@DEFAULT_ALGORITHM@/${DEFAULT_ALGORITHM}/g" \
-e "s/@DEFAULT_ALGORITHM_NUMBER@/${DEFAULT_ALGORITHM_NUMBER}/g" \
-e "s/@DEFAULT_BITS@/${DEFAULT_BITS}/g" \
-e "s/@ALTERNATIVE_ALGORITHM@/${ALTERNATIVE_ALGORITHM}/g" \
-e "s/@ALTERNATIVE_ALGORITHM_NUMBER@/${ALTERNATIVE_ALGORITHM_NUMBER}/g" \
-e "s/@ALTERNATIVE_BITS@/${ALTERNATIVE_BITS}/g" \
-e "s/@DEFAULT_HMAC@/${DEFAULT_HMAC}/g" \
-e "s/@DISABLED_ALGORITHM@/${DISABLED_ALGORITHM}/g" \
-e "s/@DISABLED_ALGORITHM_NUMBER@/${DISABLED_ALGORITHM_NUMBER}/g" \
-e "s/@DISABLED_BITS@/${DISABLED_BITS}/g" \
$1 >$2
}
grep_v() { grep -v "$@" || test $? = 1; }
-99
View File
@@ -1,99 +0,0 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Common configuration data for system tests, to be sourced into
# other shell scripts.
#
# Find the top of the BIND9 tree.
export TOP_BUILDDIR=@abs_top_builddir@
export TOP_SRCDIR=@abs_top_srcdir@
# Provide TMPDIR variable for tests that need it.
export TMPDIR=${TMPDIR:-/tmp}
export ARPANAME=$TOP_BUILDDIR/bin/tools/arpaname
export CDS=$TOP_BUILDDIR/bin/dnssec/dnssec-cds
export CHECKCONF=$TOP_BUILDDIR/bin/check/named-checkconf
export CHECKZONE=$TOP_BUILDDIR/bin/check/named-checkzone
if [ -z "$TSAN_OPTIONS" ]; then # workaround for GL#4119
export DELV=$TOP_BUILDDIR/bin/delv/delv
else
export DELV=:
fi
export DIG=$TOP_BUILDDIR/bin/dig/dig
export DNSTAPREAD=$TOP_BUILDDIR/bin/tools/dnstap-read
export DSFROMKEY=$TOP_BUILDDIR/bin/dnssec/dnssec-dsfromkey
export FEATURETEST=$TOP_BUILDDIR/bin/tests/system/feature-test
export FSTRM_CAPTURE=@FSTRM_CAPTURE@
export HOST=$TOP_BUILDDIR/bin/dig/host
export IMPORTKEY=$TOP_BUILDDIR/bin/dnssec/dnssec-importkey
export JOURNALPRINT=$TOP_BUILDDIR/bin/tools/named-journalprint
export KEYFRLAB=$TOP_BUILDDIR/bin/dnssec/dnssec-keyfromlabel
export KEYGEN=$TOP_BUILDDIR/bin/dnssec/dnssec-keygen
export MDIG=$TOP_BUILDDIR/bin/tools/mdig
export NAMED=$TOP_BUILDDIR/bin/named/named
export NSEC3HASH=$TOP_BUILDDIR/bin/tools/nsec3hash
export NSLOOKUP=$TOP_BUILDDIR/bin/dig/nslookup
export NSUPDATE=$TOP_BUILDDIR/bin/nsupdate/nsupdate
export NZD2NZF=$TOP_BUILDDIR/bin/tools/named-nzd2nzf
export REVOKE=$TOP_BUILDDIR/bin/dnssec/dnssec-revoke
export RNDC=$TOP_BUILDDIR/bin/rndc/rndc
export RNDCCONFGEN=$TOP_BUILDDIR/bin/confgen/rndc-confgen
export RRCHECKER=$TOP_BUILDDIR/bin/tools/named-rrchecker
export SETTIME=$TOP_BUILDDIR/bin/dnssec/dnssec-settime
export SIGNER=$TOP_BUILDDIR/bin/dnssec/dnssec-signzone
export TSIGKEYGEN=$TOP_BUILDDIR/bin/confgen/tsig-keygen
export VERIFY=$TOP_BUILDDIR/bin/dnssec/dnssec-verify
export WIRETEST=$TOP_BUILDDIR/bin/tests/wire_test
export BIGKEY=$TOP_BUILDDIR/bin/tests/system/rsabigexponent/bigkey
export GENCHECK=$TOP_BUILDDIR/bin/tests/system/rndc/gencheck
export MAKEJOURNAL=$TOP_BUILDDIR/bin/tests/system/makejournal
export PIPEQUERIES=$TOP_BUILDDIR/bin/tests/system/pipelined/pipequeries
# we don't want a KRB5_CONFIG setting breaking the tests
export KRB5_CONFIG=/dev/null
# use local keytab instead of default /etc/krb5.keytab
export KRB5_KTNAME=dns.keytab
export ANS_LOG_LEVEL=debug
#
# Programs detected by configure
# Variables will be empty if no program was found by configure
#
export SHELL=@SHELL@
export CURL=@CURL@
export NC=@NC@
export XMLLINT=@XMLLINT@
export XSLTPROC=@XSLTPROC@
export PYTEST=@PYTEST@
#
# Interpreters for system tests detected by configure
#
export PERL=$(command -v "@PERL@" || true)
if ! test -x "$PERL"; then
echo "Perl interpreter is required for system tests."
exit 77
fi
export PYTHON=$(command -v "@PYTHON@" || true)
if ! test -x "$PYTHON"; then
echo "Python interpreter is required for system tests."
exit 77
fi
# Load common values
. $TOP_SRCDIR/bin/tests/system/conf.sh.common
+55 -105
View File
@@ -14,16 +14,20 @@ import os
from pathlib import Path
import re
import shutil
import socket
import subprocess
import tempfile
import time
from typing import Any, Dict, List, Optional
from typing import Any, List, Optional
import pyroute2 # TODO confitional
import pytest
pytest.register_assert_rewrite("isctest")
import isctest
from isctest.vars.dirs import SYSTEM_TEST_DIR_GIT_PATH
from namespaces import Namespace
# Silence warnings caused by passing a pytest fixture to another fixture.
@@ -32,6 +36,7 @@ import isctest
isctest.log.init_conftest_logger()
isctest.log.avoid_duplicated_logs()
isctest.vars.init_vars()
# ----------------- Older pytest / xdist compatibility -------------------
# As of 2023-01-11, the minimal supported pytest / xdist versions are
@@ -52,9 +57,6 @@ else:
XDIST_WORKER = os.environ.get("PYTEST_XDIST_WORKER", "")
FILE_DIR = os.path.abspath(Path(__file__).parent)
ENV_RE = re.compile(b"([^=]+)=(.*)")
PORT_MIN = 5001
PORT_MAX = 32767
PORTS_PER_TEST = 20
PRIORITY_TESTS = [
# Tests that are scheduled first. Speeds up parallel execution.
"rpz/",
@@ -64,48 +66,13 @@ PRIORITY_TESTS = [
"upforwd/",
]
PRIORITY_TESTS_RE = re.compile("|".join(PRIORITY_TESTS))
SYSTEM_TEST_DIR_GIT_PATH = "bin/tests/system"
SYSTEM_TEST_NAME_RE = re.compile(f"{SYSTEM_TEST_DIR_GIT_PATH}" + r"/([^/]+)")
SYMLINK_REPLACEMENT_RE = re.compile(r"/tests(_.*)\.py")
# ---------------------- Module initialization ---------------------------
# ----------------------- Global requirements ----------------------------
def parse_env(env_bytes):
"""Parse the POSIX env format into Python dictionary."""
out = {}
for line in env_bytes.splitlines():
match = ENV_RE.match(line)
if match:
# EL8+ workaround for https://access.redhat.com/solutions/6994985
# FUTURE: can be removed when we no longer need to parse env vars
if match.groups()[0] in [b"which_declare", b"BASH_FUNC_which%%"]:
continue
out[match.groups()[0]] = match.groups()[1]
return out
def get_env_bytes(cmd):
try:
proc = subprocess.run(
[cmd],
shell=True,
check=True,
cwd=FILE_DIR,
stdout=subprocess.PIPE,
)
except subprocess.CalledProcessError as exc:
isctest.log.error("failed to get shell env: %s", exc)
raise exc
env_bytes = proc.stdout
return parse_env(env_bytes)
# Read common environment variables for running tests from conf.sh.
# FUTURE: Remove conf.sh entirely and define all variables in pytest only.
CONF_ENV = get_env_bytes(". ./conf.sh && env")
os.environb.update(CONF_ENV)
isctest.log.debug("variables in env: %s", ", ".join([str(key) for key in CONF_ENV]))
isctest.check.is_executable(isctest.vars.ALL["PYTHON"], "Python interpreter required")
isctest.check.is_executable(isctest.vars.ALL["PERL"], "Perl interpreter required")
# --------------------------- pytest hooks -------------------------------
@@ -123,6 +90,7 @@ def pytest_configure(config):
# Ensure this hook only runs on the main pytest instance if xdist is
# used to spawn other workers.
if not XDIST_WORKER:
Namespace("user").__enter__()
if config.pluginmanager.has_plugin("xdist") and config.option.numprocesses:
# system tests depend on module scope for setup & teardown
# enforce use "loadscope" scheduler or disable paralelism
@@ -236,8 +204,10 @@ def module_base_ports(modules):
exactly what happens - every worker thread will call this fixture to
determine test ports.
"""
port_min = PORT_MIN
port_max = PORT_MAX - len(modules) * PORTS_PER_TEST
port_min = isctest.vars.ports.PORT_MIN
port_max = (
isctest.vars.ports.PORT_MAX - len(modules) * isctest.vars.ports.PORTS_PER_TEST
)
if port_max < port_min:
raise RuntimeError("not enough ports to assign unique port set to each module")
@@ -249,65 +219,38 @@ def module_base_ports(modules):
# be misleading.
base_port = int(time.time() // 3600) % (port_max - port_min) + port_min
return {mod: base_port + i * PORTS_PER_TEST for i, mod in enumerate(modules)}
return {
mod: base_port + i * isctest.vars.ports.PORTS_PER_TEST
for i, mod in enumerate(modules)
}
@pytest.fixture(scope="module")
@pytest.fixture(autouse=True, scope="module")
def base_port(request, module_base_ports):
"""Start of the port range assigned to a particular test module."""
port = module_base_ports[request.fspath]
isctest.vars.ports.set_base_port(port)
return port
@pytest.fixture(scope="module")
def ports(base_port):
"""Dictionary containing port names and their assigned values."""
return {
"PORT": base_port,
"TLSPORT": base_port + 1,
"HTTPPORT": base_port + 2,
"HTTPSPORT": base_port + 3,
"EXTRAPORT1": base_port + 4,
"EXTRAPORT2": base_port + 5,
"EXTRAPORT3": base_port + 6,
"EXTRAPORT4": base_port + 7,
"EXTRAPORT5": base_port + 8,
"EXTRAPORT6": base_port + 9,
"EXTRAPORT7": base_port + 10,
"EXTRAPORT8": base_port + 11,
"CONTROLPORT": base_port + 12,
}
def named_port():
return int(os.environ["PORT"])
@pytest.fixture(scope="module")
def named_port(ports):
return ports["PORT"]
def named_tlsport():
return int(os.environ["TLSPORT"])
@pytest.fixture(scope="module")
def named_tlsport(ports):
return ports["TLSPORT"]
def named_httpsport():
return int(os.environ["HTTPSPORT"])
@pytest.fixture(scope="module")
def named_httpsport(ports):
return ports["HTTPSPORT"]
@pytest.fixture(scope="module")
def control_port(ports):
return ports["CONTROLPORT"]
@pytest.fixture(scope="module")
def env(ports):
"""Dictionary containing environment variables for the test."""
env = os.environ.copy()
for portname, portnum in ports.items():
env[portname] = str(portnum)
env["builddir"] = f"{env['TOP_BUILDDIR']}/{SYSTEM_TEST_DIR_GIT_PATH}"
env["srcdir"] = f"{env['TOP_SRCDIR']}/{SYSTEM_TEST_DIR_GIT_PATH}"
return env
def control_port():
return int(os.environ["CONTROLPORT"])
@pytest.fixture(scope="module")
@@ -348,7 +291,7 @@ def logger(request, system_test_name):
@pytest.fixture(scope="module")
def system_test_dir(
request, env, system_test_name
request, system_test_name
): # pylint: disable=too-many-statements,too-many-locals
"""
Temporary directory for executing the test.
@@ -398,12 +341,13 @@ def system_test_dir(
pass
# Create a temporary directory with a copy of the original system test dir contents
system_test_root = Path(f"{env['TOP_BUILDDIR']}/{SYSTEM_TEST_DIR_GIT_PATH}")
system_test_root = Path(os.environ["builddir"])
testdir = Path(
tempfile.mkdtemp(prefix=f"{system_test_name}_tmp_", dir=system_test_root)
)
shutil.rmtree(testdir)
shutil.copytree(system_test_root / system_test_name, testdir)
isctest.vars.dirs.set_system_test_name(testdir.name)
# Create a convenience symlink with a stable and predictable name
module_name = SYMLINK_REPLACEMENT_RE.sub(r"\1", request.node.name)
@@ -458,7 +402,6 @@ def system_test_dir(
def _run_script( # pylint: disable=too-many-arguments
env,
system_test_dir: Path,
interpreter: str,
script: str,
@@ -482,7 +425,6 @@ def _run_script( # pylint: disable=too-many-arguments
cmd = [interpreter, script] + args
with subprocess.Popen(
cmd,
env=env,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
bufsize=1,
@@ -500,15 +442,15 @@ def _run_script( # pylint: disable=too-many-arguments
@pytest.fixture(scope="module")
def shell(env, system_test_dir):
def shell(system_test_dir):
"""Function to call a shell script with arguments."""
return partial(_run_script, env, system_test_dir, env["SHELL"])
return partial(_run_script, system_test_dir, os.environ["SHELL"])
@pytest.fixture(scope="module")
def perl(env, system_test_dir):
def perl(system_test_dir):
"""Function to call a perl script with arguments."""
return partial(_run_script, env, system_test_dir, env["PERL"])
return partial(_run_script, system_test_dir, os.environ["PERL"])
@pytest.fixture(scope="module")
@@ -521,13 +463,24 @@ def run_tests_sh(system_test_dir, shell):
return run_tests
@pytest.fixture(scope="module")
def namespace(shell):
with Namespace("net"):
shell("ifconfig.sh", ["up"])
with pyroute2.IPRoute() as ipr:
lo = ipr.link_lookup(ifname="lo")[0]
ipr.route("add", gateway="127.0.0.1", oif=lo)
ipr.route("add", family=socket.AF_INET6, gateway="::1", oif=lo)
yield
@pytest.fixture(scope="module", autouse=True)
def system_test( # pylint: disable=too-many-arguments,too-many-statements
request,
env: Dict[str, str],
system_test_dir,
shell,
perl,
namespace,
):
"""
Driver of the test setup/teardown process. Used automatically for every test module.
@@ -553,7 +506,7 @@ def system_test( # pylint: disable=too-many-arguments,too-many-statements
def check_net_interfaces():
try:
perl("testsock.pl", ["-p", env["PORT"]])
perl("testsock.pl", ["-p", os.environ["PORT"]])
except subprocess.CalledProcessError as exc:
isctest.log.error("testsock.pl: exited with code %d", exc.returncode)
pytest.skip("Network interface aliases not set up.")
@@ -577,7 +530,7 @@ def system_test( # pylint: disable=too-many-arguments,too-many-statements
def start_servers():
try:
perl("start.pl", ["--port", env["PORT"], system_test_dir.name])
perl("start.pl", ["--port", os.environ["PORT"], system_test_dir.name])
except subprocess.CalledProcessError as exc:
isctest.log.error("Failed to start servers")
pytest.fail(f"start.pl exited with {exc.returncode}")
@@ -597,10 +550,11 @@ def system_test( # pylint: disable=too-many-arguments,too-many-statements
isctest.log.error("Found core dumps or sanitizer reports")
pytest.fail(f"get_core_dumps.sh exited with {exc.returncode}")
os.environ.update(env) # Ensure pytests have the same env vars as shell tests.
isctest.log.info(f"test started: {request.node.name}")
port = int(env["PORT"])
isctest.log.info("using port range: <%d, %d>", port, port + PORTS_PER_TEST - 1)
port = int(os.environ["PORT"])
isctest.log.info(
"using port range: <%d, %d>", port, port + isctest.vars.ports.PORTS_PER_TEST - 1
)
if not hasattr(request.node, "stash"): # compatibility with pytest<7.0.0
request.node.stash = {} # use regular dict instead of pytest.Stash
@@ -628,17 +582,13 @@ def system_test( # pylint: disable=too-many-arguments,too-many-statements
@pytest.fixture
def servers(ports, system_test_dir):
def servers(system_test_dir):
instances = {}
for entry in system_test_dir.rglob("*"):
if entry.is_dir():
try:
dir_name = entry.name
# LATER: Make ports fixture return NamedPorts directly
named_ports = isctest.instance.NamedPorts(
dns=int(ports["PORT"]), rndc=int(ports["CONTROLPORT"])
)
instance = isctest.instance.NamedInstance(dir_name, named_ports)
instance = isctest.instance.NamedInstance(dir_name)
instances[dir_name] = instance
except ValueError:
continue
+1 -1
View File
@@ -6,7 +6,7 @@ scriptversion=2021-09-20.08 # UTC
# Copyright (C) 2011-2020 Free Software Foundation, Inc.
#
# SPDX-License-Identifier: GPL-2.0-or-later WITH LicenseRef-Automake-exception-2.0
# SPDX-License-Identifier: GPL-2.0-or-later WITH Autoconf-exception-generic
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
allow-transfer { any; };
heartbeat-interval 1;
recursion no;
dnssec-validation no;
@@ -21,6 +21,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
allow-transfer { any; };
heartbeat-interval 1;
recursion no;
dnssec-validation no;
+3 -2
View File
@@ -21,6 +21,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
notify yes;
dnssec-validation yes;
@@ -60,10 +61,10 @@ dnssec-policy "not-enough-hours-in-day" {
zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
/* validity 500 days, resign in 449 days */
/* validity 500 days, with one 1 day jitter (resign in 499 days) */
signatures-jitter 1d;
signatures-validity-dnskey 500d;
signatures-validity 500d;
signatures-refresh 449d;
};
zone "." {
@@ -21,6 +21,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
notify yes;
dnssec-validation yes;
@@ -30,7 +30,6 @@ g A 10.0.0.7
z A 10.0.0.26
a.a.a.a.a.a.a.a.a.a.e A 10.0.0.27
x CNAME a
zz DNSKEY 258 3 5 Cg==
private NS ns.private
ns.private A 10.53.0.2
+10 -5
View File
@@ -39,11 +39,6 @@ key auth {
include "trusted.conf";
zone "." {
type hint;
file "../../_common/root.hint";
};
view rec {
match-recursive-only yes;
recursion yes;
@@ -51,6 +46,11 @@ view rec {
dnssec-accept-expired yes;
minimal-responses no;
zone "." {
type hint;
file "../../_common/root.hint";
};
zone secure.example {
type static-stub;
server-addresses { 10.53.0.4; };
@@ -66,6 +66,11 @@ view auth {
recursion no;
allow-recursion { none; };
zone "." {
type hint;
file "../../_common/root.hint";
};
zone secure.example {
type secondary;
primaries { 10.53.0.3; };
+55 -18
View File
@@ -3734,9 +3734,6 @@ n=$((n + 1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status + ret))
echo_i "status: $status"
exit $status
echo_i "checking initialization with a revoked managed key ($n)"
ret=0
copy_setports ns5/named2.conf.in ns5/named.conf
@@ -3908,9 +3905,9 @@ ret=0
dig_with_opts any x.insecure.example. @10.53.0.3 >dig.out.ns3.1.test$n || ret=1
grep "status: NOERROR" dig.out.ns3.1.test$n >/dev/null || ret=1
grep "ANSWER: 0," dig.out.ns3.1.test$n >/dev/null || ret=1
dig_with_opts any zz.secure.example. @10.53.0.3 >dig.out.ns3.2.test$n || ret=1
dig_with_opts any z.secure.example. @10.53.0.3 >dig.out.ns3.2.test$n || ret=1
grep "status: NOERROR" dig.out.ns3.2.test$n >/dev/null || ret=1
# DNSKEY+RRSIG, NSEC+RRSIG
# A+RRSIG, NSEC+RRSIG
grep "ANSWER: 4," dig.out.ns3.2.test$n >/dev/null || ret=1
n=$((n + 1))
test "$ret" -eq 0 || echo_i "failed"
@@ -4083,6 +4080,10 @@ ZSK_ID=$(cat ns2/${zone}.zsk.id)
SECTIONS="+answer +noauthority +noadditional"
echo_i "testing zone $zone KSK=$KSK_ID ZSK=$ZSK_ID"
# Set key state for KSK. The ZSK rollovers below assume that there is a chain
# of trust established, so we tell named that the DS is in omnipresent state.
$SETTIME -s -d OMNIPRESENT now -K ns2 $KSK >/dev/null
# Print IDs of keys used for generating RRSIG records for RRsets of type $1
# found in dig output file $2.
get_keys_which_signed() {
@@ -4118,7 +4119,7 @@ test "$ret" -eq 0 || echo_i "failed"
status=$((status + ret))
# Roll the ZSK.
zsk2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -K ns2 -n zone "$zone")
zsk2=$("$KEYGEN" -q -P none -A none -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -K ns2 -n zone "$zone")
keyfile_to_key_id "$zsk2" >ns2/$zone.zsk.id2
ZSK_ID2=$(cat ns2/$zone.zsk.id2)
ret=0
@@ -4128,16 +4129,43 @@ n=$((n + 1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status + ret))
zsk_count_equals() {
expectedzsks=$1
dig_with_opts @10.53.0.2 DNSKEY $zone >dig.out.test$n
lines=$(cat dig.out.test$n | grep "DNSKEY.*256 3 13" | wc -l)
test "$lines" -eq $expectedzsks || return 1
}
echo_i "check DNSKEY RRset has successor ZSK $ZSK_ID2 ($n)"
ret=0
# The expected number of ZSKs is 2.
retry_quiet 5 zsk_count_equals 2 || ret=1
n=$((n + 1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status + ret))
# Make new ZSK active.
echo_i "make ZSK $ZSK_ID inactive and make new ZSK $ZSK_ID2 active for zone $zone ($n)"
ret=0
$SETTIME -I now -K ns2 $ZSK >/dev/null
$SETTIME -s -I now -K ns2 $ZSK >/dev/null
$SETTIME -s -k OMNIPRESENT now -A now -K ns2 $zsk2 >/dev/null
dnssec_loadkeys_on 2 $zone || ret=1
n=$((n + 1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status + ret))
# Wait for newest ZSK to become active.
echo_i "wait until new ZSK $ZSK_ID2 active and ZSK $ZSK_ID inactive"
for i in 1 2 3 4 5 6 7 8 9 10; do
ret=0
grep "DNSKEY $zone/$DEFAULT_ALGORITHM/$ZSK_ID2 (ZSK) is now active" ns2/named.run >/dev/null || ret=1
grep "DNSKEY $zone/$DEFAULT_ALGORITHM/$ZSK_ID (ZSK) is now inactive" ns2/named.run >/dev/null || ret=1
[ "$ret" -eq 0 ] && break
sleep 1
done
n=$((n + 1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status + ret))
# Remove the KSK from disk.
echo_i "remove the KSK $KSK_ID for zone $zone from disk"
mv ns2/$KSK.key ns2/$KSK.key.bak
@@ -4187,15 +4215,14 @@ mv ns2/$KSK.key.bak ns2/$KSK.key
mv ns2/$KSK.private.bak ns2/$KSK.private
# Roll the ZSK again.
zsk3=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -K ns2 -n zone "$zone")
echo_i "delete old ZSK $ZSK_ID, schedule ZSK $ZSK_ID2 inactive, and new ZSK $ZSK_ID3 active for zone $zone ($n)"
zsk3=$("$KEYGEN" -q -P none -A none -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -K ns2 -n zone "$zone")
ret=0
keyfile_to_key_id "$zsk3" >ns2/$zone.zsk.id3
ZSK_ID3=$(cat ns2/$zone.zsk.id3)
# Schedule the new ZSK (ZSK3) to become active.
echo_i "delete old ZSK $ZSK_ID schedule ZSK $ZSK_ID2 inactive and new ZSK $ZSK_ID3 active for zone $zone ($n)"
$SETTIME -s -k UNRETENTIVE -z HIDDEN -D now -K ns2 $ZSK >/dev/null
$SETTIME -I +3600 -K ns2 $zsk2 >/dev/null
$SETTIME -A +3600 -K ns2 $zsk3 >/dev/null
$SETTIME -s -k HIDDEN now -z HIDDEN now -D now -K ns2 $ZSK >/dev/null
$SETTIME -s -k OMNIPRESENT now -z OMNIPRESENT now -K ns2 $zsk2 >/dev/null
dnssec_loadkeys_on 2 $zone || ret=1
rndccmd 10.53.0.2 dnssec -rollover -key $ZSK_ID2 $zone 2>&1 | sed 's/^/ns2 /' | cat_i
n=$((n + 1))
test "$ret" -eq 0 || echo_i "failed"
@@ -4246,11 +4273,16 @@ for qtype in "SOA" "TXT"; do
status=$((status + ret))
done
# Put back the KSK.
echo_i "put back the KSK $KSK_ID for zone $zone from disk"
mv ns2/$KSK.key.bak ns2/$KSK.key
mv ns2/$KSK.private.bak ns2/$KSK.private
# Make the new ZSK (ZSK3) active.
echo_i "make new ZSK $ZSK_ID3 active for zone $zone ($n)"
$SETTIME -I now -K ns2 $zsk2 >/dev/null
ret=0
$SETTIME -s -I now -K ns2 $zsk2 >/dev/null
$SETTIME -s -k OMNIPRESENT now -A now -K ns2 $zsk3 >/dev/null
dnssec_loadkeys_on 2 $zone || ret=1
n=$((n + 1))
test "$ret" -eq 0 || echo_i "failed"
@@ -4269,6 +4301,11 @@ n=$((n + 1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status + ret))
# Remove the KSK from disk.
echo_i "remove the KSK $KSK_ID for zone $zone from disk"
mv ns2/$KSK.key ns2/$KSK.key.bak
mv ns2/$KSK.private ns2/$KSK.private.bak
# Update the zone that requires a resign of the SOA RRset.
echo_i "update the zone with $zone IN TXT nsupdate added me one more time"
(
@@ -4323,7 +4360,7 @@ status=$((status + ret))
echo_i "checking signatures-validity second field hours vs days ($n)"
ret=0
# zone configured with 'signatures-validity 500 499;'
# zone configured with 'signatures-validity 500d; signatures-refresh 1d'
# 499 days in the future w/ a 20 minute runtime to now allowance
min=$(TZ=UTC $PERL -e '@lt=localtime(time() + 499*3600*24 - 20*60); printf "%.4d%0.2d%0.2d%0.2d%0.2d%0.2d\n",$lt[5]+1900,$lt[4]+1,$lt[3],$lt[2],$lt[1],$lt[0];')
dig_with_opts @10.53.0.2 hours-vs-days AXFR >dig.out.ns2.test$n
@@ -4359,7 +4396,7 @@ dig_with_opts @10.53.0.4 does-not-exist.too-many-iterations >dig.out.ns4.test$n
digcomp dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
grep "flags: qr rd ra;" dig.out.ns4.test$n >/dev/null || ret=1
grep "status: NXDOMAIN" dig.out.ns4.test$n >/dev/null || ret=1
grep "ANSWER: 0, AUTHORITY: 6" dig.out.ns4.test$n >/dev/null || ret=1
grep "ANSWER: 0, AUTHORITY: 8" dig.out.ns4.test$n >/dev/null || ret=1
n=$((n + 1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status + ret))
+3 -6
View File
@@ -12,9 +12,9 @@
# information regarding copyright ownership.
import shutil
import subprocess
import pytest
import isctest
@pytest.fixture
@@ -25,11 +25,8 @@ def gnutls_cli_executable():
pytest.skip("gnutls-cli not found in PATH")
# Ensure gnutls-cli supports the --logfile command-line option.
output = subprocess.run(
[executable, "--logfile=/dev/null"],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
check=False,
output = isctest.run.cmd(
[executable, "--logfile=/dev/null"], log_stderr=False, raise_on_exception=False
).stdout
if b"illegal option" in output:
pytest.skip("gnutls-cli does not support the --logfile option")
+1 -1
View File
@@ -1,5 +1,6 @@
example. 86400 IN SOA ns2.example. hostmaster.example. 1397051952 5 5 1814400 3600
example. 3600 IN NS ns2.example.
example. 3600 IN DNSKEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aRyzWZriO6i2od GWWQVucZqKVsENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esga60z yGW6LFe9r8n6paHrlG5ojqf0BaqHT+8=
a01.example. 3600 IN A 0.0.0.0
a02.example. 3600 IN A 255.255.255.255
a601.example. 3600 IN A6 0 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
@@ -2541,7 +2542,6 @@ dlv.example. 3600 IN DLV 30795 1 1 310D27F4D82C1FC2400704EA9939FE6E1CEAA3B9
dname01.example. 3600 IN DNAME dname-target.
dname02.example. 3600 IN DNAME dname-target.example.
dname03.example. 3600 IN DNAME .
dnskey01.example. 3600 IN DNSKEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aRyzWZriO6i2od GWWQVucZqKVsENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esga60z yGW6LFe9r8n6paHrlG5ojqf0BaqHT+8=
doa01.example. 3600 IN DOA 1234567890 1234567890 1 "image/gif" R0lGODlhKAAZAOMCAGZmZgBmmf///zOZzMz//5nM/zNmmWbM/5nMzMzMzACZ/////////////////////yH5BAEKAA8ALAAAAAAoABkAAATH8IFJK5U2a4337F5ogRkpnoCJrly7PrCKyh8c3HgAhzT35MDbbtO7/IJIHbGiOiaTxVTpSVWWLqNq1UVyapNS1wd3OAxug0LhnCubcVhsxysQnOt4ATpvvzHlFzl1AwODhWeFAgRpen5/UhheAYMFdUB4SFcpGEGGdQeCAqBBLTuSk30EeXd9pEsAbKGxjHqDSE0Sp6ixN4N1BJmbc7lIhmsBich1awPAjkY1SZR8bJWrz382SGqIBQQFQd4IsUTaX+ceuudPEQA7
doa02.example. 3600 IN DOA 0 1 2 "" aHR0cHM6Ly93d3cuaXNjLm9yZy8=
ds01.example. 3600 IN NS ns42.example.
+1 -1
View File
@@ -1,5 +1,6 @@
example8. 86400 IN SOA ns2.example8. hostmaster.example8. 1397051952 5 5 1814400 3600
example8. 3600 IN NS ns2.example8.
example8. 3600 IN DNSKEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aRyzWZriO6i2od GWWQVucZqKVsENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esga60z yGW6LFe9r8n6paHrlG5ojqf0BaqHT+8=
a01.example8. 3600 IN A 0.0.0.0
a02.example8. 3600 IN A 255.255.255.255
a601.example8. 3600 IN A6 0 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
@@ -2541,7 +2542,6 @@ dlv.example8. 3600 IN DLV 30795 1 1 310D27F4D82C1FC2400704EA9939FE6E1CEAA3B9
dname01.example8. 3600 IN DNAME dname-target.
dname02.example8. 3600 IN DNAME dname-target.example8.
dname03.example8. 3600 IN DNAME .
dnskey01.example8. 3600 IN DNSKEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aRyzWZriO6i2od GWWQVucZqKVsENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esga60z yGW6LFe9r8n6paHrlG5ojqf0BaqHT+8=
doa01.example8. 3600 IN DOA 1234567890 1234567890 1 "image/gif" R0lGODlhKAAZAOMCAGZmZgBmmf///zOZzMz//5nM/zNmmWbM/5nMzMzMzACZ/////////////////////yH5BAEKAA8ALAAAAAAoABkAAATH8IFJK5U2a4337F5ogRkpnoCJrly7PrCKyh8c3HgAhzT35MDbbtO7/IJIHbGiOiaTxVTpSVWWLqNq1UVyapNS1wd3OAxug0LhnCubcVhsxysQnOt4ATpvvzHlFzl1AwODhWeFAgRpen5/UhheAYMFdUB4SFcpGEGGdQeCAqBBLTuSk30EeXd9pEsAbKGxjHqDSE0Sp6ixN4N1BJmbc7lIhmsBich1awPAjkY1SZR8bJWrz382SGqIBQQFQd4IsUTaX+ceuudPEQA7
doa02.example8. 3600 IN DOA 0 1 2 "" aHR0cHM6Ly93d3cuaXNjLm9yZy8=
ds01.example8. 3600 IN DS 12892 5 2 26584835CA80C81C91999F31CFAF2A0E89D4FF1C8FAFD0DDB31A85C7 19277C13
+3 -2
View File
@@ -15,6 +15,7 @@ import os
import pathlib
import subprocess
import isctest
import pytest
@@ -46,12 +47,12 @@ def run_sslyze_in_a_loop(executable, port, log_file_prefix):
# Run sslyze, logging stdout+stderr. Ignore the exit code since
# sslyze is only used for triggering crashes here rather than
# actual TLS analysis.
subprocess.run(
isctest.run.cmd(
sslyze_args,
stdout=sslyze_log,
stderr=subprocess.STDOUT,
timeout=30,
check=False,
raise_on_exception=False,
)
# Ensure ns1 is still alive after each sslyze run.
assert is_pid_alive(pid), f"ns1 (PID: {pid}) exited prematurely"
+3 -4
View File
@@ -363,14 +363,13 @@ setsigningtime(dns_db_t *db, dns_rdataset_t *rdataset, isc_stdtime_t resign) {
}
static isc_result_t
getsigningtime(dns_db_t *db, dns_rdataset_t *rdataset,
dns_name_t *name DNS__DB_FLARG) {
getsigningtime(dns_db_t *db, isc_stdtime_t *resign, dns_name_t *name,
dns_typepair_t *type) {
sampledb_t *sampledb = (sampledb_t *)db;
REQUIRE(VALID_SAMPLEDB(sampledb));
return (dns__db_getsigningtime(sampledb->rbtdb, rdataset,
name DNS__DB_FLARG_PASS));
return (dns_db_getsigningtime(sampledb->rbtdb, resign, name, type));
}
static dns_stats_t *
-1
View File
@@ -23,7 +23,6 @@
exit 255
}
parse_openssl_config
[ -f "$SOFTHSM2_MODULE" ] || {
echo_i "skip: softhsm2 module not available"
exit 1
-1
View File
@@ -20,7 +20,6 @@ $SHELL clean.sh
OPENSSL_CONF= softhsm2-util --init-token --free --pin 1234 --so-pin 1234 --label "softhsm2-enginepkcs11" | awk '/^The token has been initialized and is reassigned to slot/ { print $NF }'
parse_openssl_config
printf '%s' "${HSMPIN:-1234}" >ns1/pin
PWD=$(pwd)
-1
View File
@@ -16,7 +16,6 @@ set -e
# shellcheck source=conf.sh
. ../conf.sh
parse_openssl_config
PWD=$(pwd)
status=0
+7
View File
@@ -0,0 +1,7 @@
# bad NSEC3 owner (:) not in base32hex valid characters
# header: id=0008 opcode=query questions=1 authority=1
00 08 00 00 00 01 00 00 00 01 00 00
# question: ./A/IN
00 00 01 00 01
# :./NSEC3/IN/1 length=7 hashtype=240 flags=0 interations=0 salt=- hashlen=1 hash=ff
01 58 00 00 32 00 01 00 00 00 01 00 07 f0 00 00 00 00 01 ff
+21
View File
@@ -0,0 +1,21 @@
# oversized owner name
# header: additional=1
00 00 00 00 00 00 00 00 00 00 00 01
# owner name too big (256 octets) A/IN/1 0.0.0.0
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0f 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41
0e 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00
00 01 00 01 00 00 00 01 00 04 00 00 00 00
+20 -4
View File
@@ -11,10 +11,26 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f badnsec3owner.out
rm -f badrecordname.out
rm -f dupans.out
rm -f dupquestion.out
rm -f keyclass.out
rm -f malformeddeltype.out
rm -f malformedrrsig.out
rm -f nametoolong.out
rm -f twoquestions.out
rm -f noquestions.out
rm -f ns*/named.conf
rm -f ns*/named.run
rm -f ns*/named.memstats
rm -f optwrongname.out
rm -f ns*/managed-keys.bind*
rm -f ns*/named.conf
rm -f ns*/named.memstats
rm -f ns*/named.run
rm -f qtypeasanswer.out
rm -f questionclass.out
rm -f shortquestion.out
rm -f shortrecord.out
rm -f tsignotlast.out
rm -f tsigwrongclass.out
rm -f twoquestionnames.out
rm -f twoquestiontypes.out
rm -f wrongclass.out
+8
View File
@@ -0,0 +1,8 @@
# multiple singletons (SOA)
# header questions=1 answers=2
00 00 00 00 00 01 00 02 00 00 00 00
# question SOA/IN
00 00 06 00 01
# 2 SOA records that differ in expire
00 00 06 00 01 00 00 00 01 00 16 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05
00 00 06 00 01 00 00 00 01 00 16 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 06
+10
View File
@@ -0,0 +1,10 @@
# header: 2 questions
00 00 00 00 00 02 00 00 00 00 00 00
# question: AAAAAAAAAAAAAA./A/IN
0e 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00
00 01
00 01
# question: AAAAAAAAAAAAAA./A/IN
0e 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00
00 01
00 01
+7
View File
@@ -0,0 +1,7 @@
# mismatched key class
# header: questions=1 additional=1
00 00 00 00 00 01 00 00 00 00 00 01
# question: ./A/IN
00 00 01 00 01
# additional: ./KEY/CLASS2 flags=0 protocol=0 algorithm=248 keydata=00
00 00 19 00 02 00 00 00 01 00 05 00 00 00 f8 00
@@ -0,0 +1,5 @@
# UPDATE malformed 'delete type' update change (non empty data)
# header: UPDATE authority=1
00 00 28 00 00 00 00 00 00 01 00 00
# ./A/ANY TTL=0 length=1 data=00
00 00 01 00 ff 00 00 00 00 00 01 00
+5
View File
@@ -0,0 +1,5 @@
# malformed RRRSIG
# header: QUERY, additional=1
00 00 00 00 00 00 00 00 00 00 00 01
# ./RRSIG/IN TTL=1 covers=0 algorithm=240 labels=0 ttl=1 expire=2 signed=3 id=0
00 00 2e 00 01 00 00 00 01 00 14 00 00 f0 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 00
+5
View File
@@ -0,0 +1,5 @@
# OPT record with wrong name (not .)
# header: QUERY, additional=1
00 00 00 00 00 00 00 00 00 00 00 01
# OPT record (owner A.)
01 41 00 00 29 00 01 00 00 00 00 00 00
+5
View File
@@ -0,0 +1,5 @@
# QTYPE-only type as answer
# header, answers=1
00 00 00 00 00 00 00 01 00 00 00 00
# ./MAILB/IN
00 00 fd 00 01 00 00 00 01 00 00
+7
View File
@@ -0,0 +1,7 @@
# two questions of different classes
# header: QUERY, questions=2
00 00 00 00 00 02 00 00 00 00 00 00
# ./A/IN
00 00 01 00 01
# ./A/CLASS2
00 00 01 00 02
+5
View File
@@ -0,0 +1,5 @@
# truncated question section
# header: QUERY, questions=1
00 00 00 00 00 01 00 00 00 00 00 00
# truncated question (no class)
00 00 01
+5
View File
@@ -0,0 +1,5 @@
# truncated record
# header: QUERY, additional=1
00 09 00 00 00 00 00 00 00 00 00 01
# truncated A record (no ttl, length or data)
00 00 01 00 01
+132 -3
View File
@@ -25,14 +25,46 @@ if [ "${ans}" != "got: 000080010000000000000000" ]; then
status=$((status + 1))
fi
echo_i "two questions"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} twoquestions >twoquestions.out
ans=$(grep got: twoquestions.out)
echo_i "two question names"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} twoquestionnames >twoquestionnames.out
ans=$(grep got: twoquestionnames.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$((status + 1))
fi
echo_i "two question types"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} twoquestiontypes >twoquestiontypes.out
ans=$(grep got: twoquestiontypes.out)
if [ "${ans}" != "got: 0000800100020000000000000e41414141414141414141414141410000010001c00c00020001" ]; then
echo_i "failed"
status=$((status + 1))
fi
echo_i "duplicate questions"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} dupquestion >dupquestion.out
ans=$(grep got: dupquestion.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "duplicate answer"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} dupans >dupans.out
ans=$(grep got: dupans.out)
if [ "${ans}" != "got: 0000800100010000000000000000060001" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "question only type in answer"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} qtypeasanswer >qtypeasanswer.out
ans=$(grep got: qtypeasanswer.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
# this would be NOERROR if it included a COOKIE option,
# but is a FORMERR without one.
echo_i "empty question section (and no COOKIE option)"
@@ -43,6 +75,103 @@ if [ "${ans}" != "got: 000080010000000000000000" ]; then
status=$((status + 1))
fi
echo_i "bad nsec3 owner"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} badnsec3owner >badnsec3owner.out
ans=$(grep got: badnsec3owner.out)
# SERVFAIL (2) rather than FORMERR (1)
if [ "${ans}" != "got: 0008800200010000000000000000010001" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "short record before rdata "
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} shortrecord >shortrecord.out
ans=$(grep got: shortrecord.out)
if [ "${ans}" != "got: 000980010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "short question"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} shortquestion >shortquestion.out
ans=$(grep got: shortquestion.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "mismatch classes in question section"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} questionclass >questionclass.out
ans=$(grep got: questionclass.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "bad record owner name"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} badrecordname >badrecordname.out
ans=$(grep got: badrecordname.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "mismatched class in record"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} wrongclass >wrongclass.out
ans=$(grep got: wrongclass.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "mismatched KEY class"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} keyclass >keyclass.out
ans=$(grep got: keyclass.out)
if [ "${ans}" != "got: 0000800100010000000000000000010001" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "OPT wrong owner name"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} optwrongname >optwrongname.out
ans=$(grep got: optwrongname.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "RRSIG invalid covers"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} malformedrrsig >malformedrrsig.out
ans=$(grep got: malformedrrsig.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "UPDATE malformed delete type"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} malformeddeltype >malformeddeltype.out
ans=$(grep got: malformeddeltype.out)
if [ "${ans}" != "got: 0000a8010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "TSIG wrong class"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} tsigwrongclass >tsigwrongclass.out
ans=$(grep got: tsigwrongclass.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "TSIG not last"
$PERL formerr.pl -a 10.53.0.1 -p ${PORT} tsignotlast >tsignotlast.out
ans=$(grep got: tsignotlast.out)
if [ "${ans}" != "got: 000080010000000000000000" ]; then
echo_i "failed"
status=$(expr $status + 1)
fi
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+8
View File
@@ -0,0 +1,8 @@
# SIG not last in additional
# header: QUERY additional=2
00 00 00 00 00 00 00 00 00 00 00 02
# Additional records:
# SIG record (class ANY)
00 00 fa 00 ff 00 00 00 01 00 12 00 01 02 03 04 05 06 01 02 00 01 00 00 00 00 00 00 00
# A record
00 00 01 00 01 00 00 00 01 00 04 00 00 00 00
+5
View File
@@ -0,0 +1,5 @@
# TSIG wrong class
# header: QUERY, additional=1
00 00 00 00 00 00 00 00 00 00 00 01
# class should be ANY (00 ff) not IN (00 01)
00 00 fa 00 01 00 00 00 01 00 12 00 01 02 03 04 05 06 01 02 00 01 00 00 00 00 00 00 00
+11
View File
@@ -0,0 +1,11 @@
# two questions with different names
00 00 00 00 00 02 00 00 00 00 00 00
# AAAAAAAAAAAAAA./A/IN
0e 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00
00 01
00 01
# AAAAAAAAAAAAAB./A/IN
0e 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00
0e 41 41 41 41 41 41 41 41 41 41 41 41 41 42 00
00 01
00 01
@@ -1,7 +1,10 @@
# two questions that differ by type
00 00 00 00 00 02 00 00 00 00 00 00
# AAAAAAAAAAAAAAA./A/IN
0e 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00
00 01
00 01
# AAAAAAAAAAAAAAA./NS/IN
0e 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00
00 02
0e 41 41 41 41 41 41 41 41 41 41 41 41 41 41 00
00 01
00 01
+7
View File
@@ -0,0 +1,7 @@
# class mismatch
# header: QUERY, additional=2
00 00 00 00 00 00 00 00 00 00 00 02
# ./A/IN
00 00 01 00 01 00 00 00 01 00 04 00 00 00 00
# ./TYPE65280/CLASS256
00 ff 00 01 00 02 00 00 01 00 04 00 00 00 00
+1 -1
View File
@@ -277,7 +277,7 @@ nsec03 NSEC . TYPE1
nsec04 NSEC . TYPE127
; type 48
dnskey01 DNSKEY 512 ( 255 1 AQMFD5raczCJHViKtLYhWGz8hMY
@ DNSKEY 512 ( 255 1 AQMFD5raczCJHViKtLYhWGz8hMY
9UGRuniJDBzC7w0aRyzWZriO6i2odGWWQVucZqKV
sENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esg
a60zyGW6LFe9r8n6paHrlG5ojqf0BaqHT+8= )
@@ -15,7 +15,6 @@
# Clean up after allow query tests.
#
rm -f dig.out.*
rm -f ns*/named.conf
rm -f */named.memstats
rm -f ns*/named.run ns*/named.run.prev
@@ -17,7 +17,7 @@ options {
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
recursion no;
notify no;
notify no;
dnssec-validation no;
};
@@ -1,67 +0,0 @@
#!/bin/sh
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# Test of include statement with glob expression.
set -e
. ../conf.sh
DIGOPTS="+tcp +nosea +nostat +nocmd +norec +noques +noadd +nostats -p ${PORT}"
status=0
n=0
# Test 1 - check if zone1 was loaded.
n=$((n + 1))
echo_i "checking glob include of zone1 config ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 zone1.com. a >dig.out.ns2.$n || ret=1
grep 'status: NOERROR' dig.out.ns2.$n >/dev/null || ret=1
grep '^zone1.com.' dig.out.ns2.$n >/dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
# Test 2 - check if zone2 was loaded.
n=$((n + 1))
echo_i "checking glob include of zone2 config ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 zone2.com. a >dig.out.ns2.$n || ret=1
grep 'status: NOERROR' dig.out.ns2.$n >/dev/null || ret=1
grep '^zone2.com.' dig.out.ns2.$n >/dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
# Test 3 - check if standard file path (no magic chars) works.
n=$((n + 1))
echo_i "checking include of standard file path config ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 mars.com. a >dig.out.ns2.$n || ret=1
grep 'status: NOERROR' dig.out.ns2.$n >/dev/null || ret=1
grep '^mars.com.' dig.out.ns2.$n >/dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
# Test 4: named-checkconf correctly parses glob includes.
n=$((n + 1))
echo_i "checking named-checkconf with glob include ($n)"
ret=0
(
cd ns2
$CHECKCONF named.conf
) || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
@@ -0,0 +1,39 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import os
import isctest
import pytest
import dns.message
@pytest.mark.parametrize(
"qname",
[
"zone1.com.", # glob include of zone1 config
"zone2.com.", # glob include of zone2 config
"mars.com.", # checking include of standard file path config
],
)
def test_include_multiplecfg(qname):
msg = dns.message.make_query(qname, "A")
res = isctest.query.tcp(msg, "10.53.0.2")
isctest.check.noerror(res)
assert res.answer[0] == dns.rrset.from_text(qname, 86400, "IN", "A", "10.53.0.1")
def test_include_multiplecfg_checkconf():
"""Test that named-checkconf correctly parses glob includes"""
isctest.run.cmd([os.environ["CHECKCONF"], "named.conf"], cwd="ns2")
@@ -23,6 +23,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
notify yes;
dnssec-validation yes;
@@ -27,6 +27,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
notify yes;
notify-delay 0;
@@ -28,6 +28,7 @@ options {
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
recursion no;
allow-transfer { any; };
notify yes;
try-tcp-refresh no;
notify-delay 0;
@@ -21,6 +21,7 @@ options {
pid-file "named.pid";
listen-on { 10.53.0.4; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
notify yes;
notify-delay 0;

Some files were not shown because too many files have changed in this diff Show More