Compare commits

...

6094 Commits

Author SHA1 Message Date
Michał Kępień
73d28b368d Update BIND version to 9.17.17 2021-08-10 13:41:42 +02:00
Michał Kępień
84201cefaf Add a CHANGES marker 2021-08-10 13:41:42 +02:00
Michał Kępień
65c9e1a16d Merge branch 'michal/prepare-documentation-for-bind-9.17.17' into 'security-main'
Prepare documentation for BIND 9.17.17

See merge request isc-private/bind9!312
2021-08-10 11:32:59 +00:00
Michał Kępień
67f67488f4 Prepare release notes for BIND 9.17.17 2021-08-10 12:20:52 +02:00
Michał Kępień
a11356fb48 Add release note for GL #2756 2021-08-10 12:20:52 +02:00
Michał Kępień
50ca6ac50f Reorder release notes 2021-08-10 12:20:52 +02:00
Michał Kępień
371c72355c Tweak and reword release notes 2021-08-10 12:20:52 +02:00
Michał Kępień
fef0a79fe8 Tweak and reword recent CHANGES entries 2021-08-10 12:20:52 +02:00
Michał Kępień
19f97df29e Tweak library requirements in PLATFORMS.md 2021-08-10 12:20:52 +02:00
Michał Kępień
4d77f17797 Tweak jemalloc warning text in configure.ac 2021-08-10 12:20:52 +02:00
Michal Nowak
adbdedd5de Fix typos in lib/isc/trampoline_p.h 2021-08-10 12:20:52 +02:00
Michal Nowak
3b72aafd86 Merge branch '2839-confidential-rrl-msgsize' into 'security-main'
[CVE-2021-25218]: assertion failure in RRL after EMSGSIZE error

See merge request isc-private/bind9!313
2021-08-10 12:18:35 +02:00
Evan Hunt
d6afbd6782 Add CHANGES and release notes for [GL #2839] 2021-08-10 12:18:35 +02:00
Ondřej Surý
dd2746d810 Disable the Path MTU Discover on UDP Sockets
Instead of disabling the fragmentation on the UDP sockets, we now
disable the Path MTU Discovery by setting IP(V6)_MTU_DISCOVER socket
option to IP_PMTUDISC_OMIT on Linux and disabling IP(V6)_DONTFRAG socket
option on FreeBSD.  This option sets DF=0 in the IP header and also
ignores the Path MTU Discovery.

As additional mitigation on Linux, we recommend setting
net.ipv4.ip_no_pmtu_disc to Mode 3:

    Mode 3 is a hardend pmtu discover mode. The kernel will only accept
    fragmentation-needed errors if the underlying protocol can verify
    them besides a plain socket lookup. Current protocols for which pmtu
    events will be honored are TCP, SCTP and DCCP as they verify
    e.g. the sequence number or the association. This mode should not be
    enabled globally but is only intended to secure e.g. name servers in
    namespaces where TCP path mtu must still work but path MTU
    information of other protocols should be discarded. If enabled
    globally this mode could break other protocols.
2021-08-10 12:18:35 +02:00
Evan Hunt
893b2a794a ns_client_error() could assert if rcode was overridden to NOERROR
The client->rcode_override was originally created to force the server
to send SERVFAIL in some cases when it would normally have sent FORMERR.

More recently, it was used in a3ba95116e
commit (part of GL #2790) to force the sending of a TC=1 NOERROR
response, triggering a retry via TCP, when a UDP packet could not be
sent due to ISC_R_MAXSIZE.

This ran afoul of a pre-existing INSIST in ns_client_error() when
RRL was in use. the INSIST was based on the assumption that
ns_client_error() could never result in a non-error rcode. as
that assumption is no longer valid, the INSIST has been removed.
2021-08-10 12:18:35 +02:00
Michał Kępień
c3689e6d2c Merge branch '2839-placeholder' into 'main'
Add placeholder for GL #2839

See merge request isc-projects/bind9!5318
2021-08-09 19:45:31 +00:00
Michał Kępień
50ee7f930a Add placeholder for GL #2839 2021-08-09 21:41:59 +02:00
Artem Boldariev
0bb2fa307c Merge branch 'artem/doh-no-rwlocks' into 'main'
Get rid of RW locks in the DoH code

See merge request isc-projects/bind9!5278
2021-08-04 07:59:42 +00:00
Artem Boldariev
170cc41d5c Get rid of some HTTP/2 related types when NGHTTP2 is not available
This commit removes definitions of some DoH-related types when
libnghttp2 is not available.
2021-08-04 10:32:27 +03:00
Artem Boldariev
f388b71378 Get rid of RW locks in the DoH code
This commit gets rid of RW locks in a hot path of the DoH code. In the
original design, it was implied that we add new endpoints after the
HTTP listener was created. Such a design implies some locking. We do
not need such flexibility, though. Instead, we could build a set of
endpoints before the HTTP listener gets created. Such a design does
not need RW locks at all.
2021-08-04 10:32:25 +03:00
Mark Andrews
ebb670c8f8 Merge branch '2830-statistics-system-tests-needs-to-save-named-stats-files' into 'main'
Resolve "statistics system tests needs to save named.stats files"

Closes #2830

See merge request isc-projects/bind9!5290
2021-08-03 00:52:15 +00:00
Mark Andrews
53afccf42b save named.stats files 2021-08-02 17:05:06 +10:00
Matthijs Mekking
f563cd570c Merge branch '2836-parental-agents-documentation-missing-string-net' into 'main'
Fix parental-agents documentation

Closes #2836

See merge request isc-projects/bind9!5302
2021-07-27 12:11:05 +00:00
Matthijs Mekking
8d75ec8300 Fix parental-agents documentation
There is a missing string "net" in the ARM in the parental-agents
example.
2021-07-27 14:10:16 +02:00
Artem Boldariev
ca29677200 Merge branch '2809-doh-quota-systest-fix-on-fbsd11' into 'main'
Resolve "Fix the DoH quota stress test on FreeBSD 11"

Closes #2809

See merge request isc-projects/bind9!5304
2021-07-27 07:53:45 +00:00
Artem Boldariev
9e8ff1d6ad Increase the initial TCP timeout for the DoH quota test
This commit increases the idle TCP timeout to let the DoH quota system
test pass on some platforms (namely FreeBSD 11). It turned out to run
slow enough on the CI under load for the idle TCP timeout to kick in.
2021-07-27 10:30:12 +03:00
Artem Boldariev
ae26a1ec75 Refactor the DoH quota stress test to make it more reliable
This commit refactors the DoH quota system test to make it more
reliable.

The test tries to establish dummy TCP connections to stress the quota
one by one instead of in bulk until the BIND instance cannot answer
queries anymore. This design is better because the test itself does
not need to be aware of the actual quota size.
2021-07-27 10:30:11 +03:00
Michal Nowak
fb982dbdea Merge branch 'v9_17_16-release' into 'main'
Merge 9.17.16 release branch

See merge request isc-projects/bind9!5296
2021-07-23 07:28:30 +00:00
Michal Nowak
109bb0db47 Set up release notes for BIND 9.17.17 2021-07-23 09:19:37 +02:00
Michał Kępień
4b18384e60 Drop Windows zips from release tarballs 2021-07-23 09:19:37 +02:00
Michał Kępień
7aa7b0b419 Update BIND version to 9.17.16 2021-07-23 09:19:37 +02:00
Michał Kępień
c5fc7c22f0 Add a CHANGES marker 2021-07-23 09:19:36 +02:00
Michał Kępień
8600f0fa14 Merge branch 'mnowak/prepare-documentation-for-bind-9.17.16' into 'v9_17_16-release'
Prepare documentation for BIND 9.17.16

See merge request isc-private/bind9!307
2021-07-23 09:19:36 +02:00
Michał Kępień
3cc71752d9 Prepare release notes for BIND 9.17.16 2021-07-23 09:19:36 +02:00
Michał Kępień
565ed6f76a Add release note for GL #2758 2021-07-23 09:19:36 +02:00
Michał Kępień
db2e1de052 Add release note for GL #2686 2021-07-23 09:19:36 +02:00
Michał Kępień
8371f13b4e Reorder release notes 2021-07-23 09:19:36 +02:00
Michal Nowak
0048006114 Tweak and reword release notes 2021-07-23 09:19:36 +02:00
Michal Nowak
16d2d922ef Tweak and reword recent CHANGES entries 2021-07-23 09:19:36 +02:00
Michał Kępień
7c61550435 Restore release note for GL #2780 2021-07-23 09:19:36 +02:00
Mark Andrews
8a7e19c4f9 Merge branch '2735-bind-9-16-must-stop-named-delete-jnl-files-for-signed-zones-to-be-updated' into 'main'
Order the diff from dns_db_diffx so that deletes proceed adds

Closes #2735

See merge request isc-projects/bind9!5284
2021-07-22 22:26:54 +00:00
Mark Andrews
ba950cf193 Add CHANGES note for [GL #2735] 2021-07-23 07:53:15 +10:00
Mark Andrews
cf8aadfeb6 Check that reload with deleted journal works 2021-07-23 07:52:44 +10:00
Mark Andrews
163fb0b825 Check that restart with zone changes and deleted journal works 2021-07-23 07:52:44 +10:00
Mark Andrews
76453961bd Order the diff from dns_db_diffx so that deletes proceed adds
for the same rdataset.  This allows the diff when passed to
dns_diff_apply to succeed.
2021-07-23 07:52:44 +10:00
Mark Andrews
c7fc13a9fa Check reload of dnssec-policy zone works 2021-07-23 07:52:44 +10:00
Mark Andrews
9c9ee59fa7 Remove spurious early exit 2021-07-23 07:52:44 +10:00
Mark Andrews
af9a3f4e5f Merge branch '2542-inline-loadtime-not-recorded' into 'main'
Record load time of touched inline zones

Closes #2542

See merge request isc-projects/bind9!5289
2021-07-22 21:46:55 +00:00
Mark Andrews
10d3a48e2f Add CHANGES for [GL #2542] 2021-07-23 07:24:25 +10:00
Mark Andrews
b84c057130 Check that load time was recorded for unchanged inline zone
subsequent reloads should not report 'ixfr-from-differences: unchanged'
2021-07-23 07:23:53 +10:00
Mark Andrews
194e47cb0d Record load time when a inline zone file has been touched 2021-07-23 07:23:52 +10:00
Michal Nowak
4f84f0d3b9 Merge branch '2473-run-respdiff-as-part-of-daily-runs' into 'main'
Run respdiff CI job for scheduled and web pipelines

Closes #2473

See merge request isc-projects/bind9!4710
2021-07-22 12:15:24 +00:00
Michal Nowak
561b58196b Run respdiff also for scheduled and web pipelines
respdiff needs to be run regularly to identify problems with query
responses discrepancies sooner than after tagging a release.

MAX_DISAGREEMENTS_PERCENTAGE variable is set to 0.5 on the main branch
to make room for a greater number of response disagreements between a
relatively old baseline version and the Development Version.
2021-07-22 13:15:55 +02:00
Ondřej Surý
64f8852e6c Merge branch '2831-use-static-storage-for-ctx-water' into 'main'
Use static storage for isc_mem water_t

Closes #2831

See merge request isc-projects/bind9!5295
2021-07-22 10:19:50 +00:00
Ondřej Surý
22db2705cd Use static storage for isc_mem water_t
On the isc_mem water change the old water_t structure could be used
after free.  Instead of introducing reference counting on the hot-path
we are going to introduce additional constraints on the
isc_mem_setwater.  Once it's set for the first time, the additional
calls have to be made with the same water and water_arg arguments.
2021-07-22 11:51:46 +02:00
Evan Hunt
240f9d2037 Merge branch '2833-notify-delay-doc' into 'main'
clarify 'notify-delay' documentation

Closes #2833

See merge request isc-projects/bind9!5293
2021-07-22 02:57:36 +00:00
Evan Hunt
dcf2d48674 clarify 'notify-delay' documentation
- the explanation was unclear
- the reference to 'serial-query-rate' was outdated
2021-07-21 14:39:48 -07:00
Ondřej Surý
2e6b1afdb3 Merge branch 'ondrej/reduce-the-node-lock-count' into 'main'
Reduce the nodelock count for both cache and regular rbtdb

Closes #2829

See merge request isc-projects/bind9!5282
2021-07-21 15:36:27 +00:00
Ondřej Surý
28a684953d Add CHANGES note for [GL #2829] 2021-07-21 17:02:30 +02:00
Ondřej Surý
6b24460a40 Reduce the nodelock count for both cache and regular rbtdb
Increasing the nodelock count had major impact on the memory footprint
in scenarios where multiple rbtdb structure would be created like
hosting many zones in a single server.

This reverts commit 0344684385 and sets
the nodelock count to previously used values.
2021-07-21 17:00:15 +02:00
Michal Nowak
5a04b5bb1a Merge branch 'mnowak/support-cross-compilation-on-buster' into 'main'
Add 32-bit cross-compiled builds on Debian Buster

See merge request isc-projects/bind9!4516
2021-07-21 09:26:00 +00:00
Michal Nowak
bfcaa2a8f1 Add 32-bit cross-compiled CI jobs on Debian Buster
Since the forced removal of gcc:sid:i386 in 0aacabc6, we lacked a 32-bit
environment to build and test BIND 9 in the CI. gcc:buster:amd64cross32
adds an environment to cross-compile BIND 9 to 32-bits on Debian Buster
amd64 image with 32-bit BIND 9 dependencies. Commit also adds sanity
checks to ensure that compiled objects are not of the build platform
triplet type.
2021-07-21 10:03:12 +02:00
Mark Andrews
adb1ca6d54 Merge branch '2762-check-opcode' into 'main'
check returned opcodes

Closes #2762

See merge request isc-projects/bind9!5286
2021-07-21 02:38:13 +00:00
Mark Andrews
36720fb4a6 add release note for [GL #2762] 2021-07-20 15:18:14 +10:00
Mark Andrews
466db0f49e Add CHANGES for [GL #2762] 2021-07-20 15:18:13 +10:00
Mark Andrews
0bba0ab10d check nsupdate handles UPDATE response to QUERY 2021-07-20 15:17:32 +10:00
Mark Andrews
e97249e012 dns_rdata_tostruct() should reject rdata with DNS_RDATA_UPDATE set 2021-07-20 15:17:32 +10:00
Mark Andrews
ed4e00713f Check opcode of messages returned by dns_request_getresponse 2021-07-20 15:17:32 +10:00
Michal Nowak
42492890a7 Merge branch 'mnowak/process-core-dumps-when-named-fails-to-start' into 'main'
Process core dump from named which failed to start

See merge request isc-projects/bind9!4987
2021-07-16 16:13:54 +00:00
Michal Nowak
a39697635b Fix handling of restart option in run.sh
The support for stat.pl's --restart option was incomplete in run.sh.
This change makes sure it's handled properly and that named.run file is
not being removed by clean.sh when the --restart option is used.
2021-07-16 16:37:57 +02:00
Michal Nowak
bc097d3358 Process core dump from named which failed to start
When named failed to start and produced core dump, the core file wasn't
processed by GDB because of run.sh script exiting immediately. This
remedies the limitation, simplifies the surrounding code, and makes the
script shellcheck clean.
2021-07-16 16:37:57 +02:00
Michal Nowak
4339831e54 Merge branch 'mnowak/replace-literal-blocks-with-anchors' into 'main'
Use anchors instead of literal blocks in .gitlab-ci.yml

See merge request isc-projects/bind9!4742
2021-07-16 14:21:36 +00:00
Michal Nowak
c22008629e Use anchors instead of literal blocks in .gitlab-ci.yml
Anchor lets the user see the full command logged in GitLab CI:

    ${CONFIGURE} --disable-maintainer-mode --enable-developer ...

Instead of a folded multi-line when literal block is used:

    ${CONFIGURE} \ # collapsed multi-line command
2021-07-16 12:15:01 +02:00
Artem Boldariev
5f2b69a038 Merge branch 'artem/doh-quota-integration' into 'main'
Make DoH-quota separate and configurable, make it possible to limit the number of HTTP/2 streams per connection

See merge request isc-projects/bind9!5036
2021-07-16 09:41:01 +00:00
Artem Boldariev
87f79a67f2 Add a missing break on error when adding a DoH endpoint
The break on error when adding a DoH endpoint was implied but somehow
gotten missed. This commit fixes that.
2021-07-16 11:50:22 +03:00
Artem Boldariev
f5614be9df Update documentation to include the new HTTP configuration options
Documentation for the new DoH options has been added.
2021-07-16 11:50:22 +03:00
Artem Boldariev
3773802f20 Add a system test that tests connections quota for DoH
The system tests stress out the DoH quota by opening many TCP
connections and then running dig instances against the "overloaded"
server to perform some queries. The processes cannot make any
resolutions because the quota is exceeded. Then the opened connections
are getting closed in random order allowing the queries to proceed.
2021-07-16 11:50:22 +03:00
Artem Boldariev
ac9ce6f446 modify CHANGES [GL #2809]
Document the new HTTP specific options in the CHANGES file.
2021-07-16 11:50:22 +03:00
Artem Boldariev
147da54e13 Update grammar reference documentation
This commit updates the named grammar reference according to the
latest changes.
2021-07-16 11:50:22 +03:00
Artem Boldariev
590e8e0b86 Make max number of HTTP/2 streams configurable
This commit makes number of concurrent HTTP/2 streams per connection
configurable as a mean to fight DDoS attacks. As soon as the limit is
reached, BIND terminates the whole session.

The commit adds a global configuration
option (http-streams-per-connection) which can be overridden in an
http <name> {...} statement like follows:

http local-http-server {
    ...
    streams-per-connection 100;
    ...
};

For now the default value is 100, which should be enough (e.g. NGINX
uses 128, but it is a full-featured WEB-server). When using lower
numbers (e.g. ~70), it is possible to hit the limit with
e.g. flamethrower.
2021-07-16 11:50:22 +03:00
Artem Boldariev
03a557a9bb Add (http-)listener-clients option (DoH quota mechanism)
This commit adds support for http-listener-clients global options as
well as ability to override the default in an HTTP server description,
like:

http local-http-server {
    ...
    listener-clients 100;
    ...
};

This way we have ability to specify per-listener active connections
quota globally and then override it when required. This is exactly
what AT&T requested us: they wanted a functionality to specify quota
globally and then override it for specific IPs. This change
functionality makes such a configuration possible.

It makes sense: for example, one could have different quotas for
internal and external clients. Or, for example, one could use BIND's
internal ability to serve encrypted DoH with some sane quota value for
internal clients, while having un-encrypted DoH listener without quota
to put BIND behind a load balancer doing TLS offloading for external
clients.

Moreover, the code no more shares the quota with TCP, which makes
little sense anyway (see tcp-clients option), because of the nature of
interaction of DoH clients: they tend to keep idle opened connections
for longer periods of time, preventing the TCP and TLS client from
being served. Thus, the need to have a separate, generally larger,
quota for them.

Also, the change makes any option within "http <name> { ... };"
statement optional, making it easier to override only required default
options.

By default, the DoH connections are limited to 300 per listener. I
hope that it is a good initial guesstimate.
2021-07-16 11:50:20 +03:00
Artem Boldariev
0aac2d094a Merge branch 'artem/doh-http-path-validation' into 'main'
Verify HTTP paths both in incoming requests and in config file

See merge request isc-projects/bind9!5231
2021-07-16 07:51:43 +00:00
Artem Boldariev
dac3e4abc9 Update CHANGES
The CHANGES file was updated to include information that configuration
checking code now verifies HTTP paths properly.
2021-07-16 10:28:28 +03:00
Artem Boldariev
954240467d Verify HTTP paths both in incoming requests and in config file
This commit adds the code (and some tests) which allows verifying
validity of HTTP paths both in incoming HTTP requests and in BIND's
configuration file.
2021-07-16 10:28:08 +03:00
Michał Kępień
40aba825ae Merge branch '2759-extend-tests-for-signed-cname-sourced-delegations' into 'main'
Extend tests for signed, CNAME-sourced delegations

Closes #2759

See merge request isc-projects/bind9!5272
2021-07-16 05:23:15 +00:00
Michał Kępień
a14efdf54c Extend tests for signed, CNAME-sourced delegations
Extend the "chain" system test with AUTHORITY section checks for signed,
secure delegations.  This complements the checks for signed, insecure
delegations added by commit 26ec4b9a89.

Extend the existing AUTHORITY section checks for signed, insecure
delegations to ensure nonexistence of DS RRsets in such responses.
Adjust comments accordingly.

Ensure dig failures cause the "chain" system test to fail.
2021-07-16 07:20:15 +02:00
Michał Kępień
29d8d35869 Tweak query_addds() comments to avoid confusion
It has been noticed that commit 7a87bf468b
did not only fix NSEC record handling in signed, insecure delegations
prepared using both wildcard expansion and CNAME chaining - it also
inadvertently fixed DS record handling in signed, secure delegations
of that flavor.  This is because the 'rdataset' variable in the relevant
location in query_addds() can be either a DS RRset or an NSEC RRset.
Update a code comment in query_addds() to avoid confusion.

Update the comments describing the purpose of query_addds() so that they
also mention NSEC(3) records.
2021-07-16 07:20:15 +02:00
Mark Andrews
ddacc7e1b2 Merge branch '2820-rndc-reconfig-does-not-act-on-change-to-zone-statistics' into 'main'
Resolve "rndc reconfig does not act on change to zone-statistics"

Closes #2820

See merge request isc-projects/bind9!5271
2021-07-16 04:09:53 +00:00
Mark Andrews
f2461afff7 Add CHANGES for [GL #2820] 2021-07-16 13:49:22 +10:00
Mark Andrews
616896d735 zone->requeststats_on was not being set at the correct point 2021-07-16 13:49:22 +10:00
Mark Andrews
592f9ff6bc Test that 'zone-statistics full;' is properly processed 2021-07-16 13:49:22 +10:00
Matthijs Mekking
02c3a2decc Merge branch '2710-multisigner-cds' into 'main'
Allow update CDS/CDNSKEY records that do not match DNSKEY

Closes #2710

See merge request isc-projects/bind9!5270
2021-07-15 07:24:09 +00:00
Matthijs Mekking
ba5869943d Add change and release notes [#2710] 2021-07-15 08:32:16 +02:00
Matthijs Mekking
577bf913b9 Relax zone_cdscheck function
If we have a CDS or CDNSKEY we at least need to have a DNSKEY with the
same algorithm published and signing the CDS RRset. Same for CDNSKEY
of course.

This relaxes the zone_cdscheck function, because before the CDS or
CDNSKEY had to match a DNSKEY, now only the algorithm has to match.

This allows a provider in a multisigner model to update the CDS/CDNSKEY
RRset in the zone that is served by the other provider.
2021-07-14 12:10:11 -07:00
Matthijs Mekking
6b79db1fdd Add test for allowing update CDS/CDNSKEY
Add tests to the nsupdate system test to make sure that CDS and/or
CDNSKEY that match an algorithm in the DNSKEY RRset are allowed. Also
add tests that updates are rejected if the algorithm does not match.

Remove the now redundant test cases from the dnssec system test.

Update the checkzone system test: Change the algorithm of the CDS and
CDNSKEY records so that the zone is still rejected.
2021-07-14 12:10:11 -07:00
Evan Hunt
2292b48c2a Merge branch 'each-doc-trampoline' into 'main'
document isc__trampoline

See merge request isc-projects/bind9!5116
2021-07-14 17:59:28 +00:00
Evan Hunt
4f6e2317e9 document isc__trampoline
Added some header file documentation to the isc__trampoline
implementation in trampoline_p.h.
2021-07-14 10:55:12 -07:00
Artem Boldariev
9a7d2000e6 Merge branch 'artem/doh-empty-query-string-crash-fix' into 'main'
Fix crash in DoH on empty query string in GET requests

See merge request isc-projects/bind9!5268
2021-07-13 13:55:30 +00:00
Artem Boldariev
3e3c944d2e Add CHANGES for [GL !5268]
The commit updates the CHANGES file adding a note about a crash caused
by improper handling of DoH GET requests.
2021-07-13 16:54:25 +03:00
Artem Boldariev
64cd7e8a7f Fix crash in DoH on empty query string in GET requests
An unhandled code path left GET query string data uninitialised (equal
to NULL) and led to a crash during the requests' base64 data
decoding. This commit fixes that.
2021-07-13 16:53:51 +03:00
Ondřej Surý
1c5d033576 Merge branch '2822-inconsistent-recursive-performance' into 'main'
Disable setting the thread affinity

Closes #2822

See merge request isc-projects/bind9!5265
2021-07-13 13:50:53 +00:00
Ondřej Surý
41afe6bc5e Add CHANGES and release notes for [GL #2822] 2021-07-13 15:44:08 +02:00
Ondřej Surý
4c5dc1904b Disable the cpu system test
As we don't set the thread affinity, the cpu test would consistently
fail.  Disable it, but don't remove it as we might restore setting the
affinity in the future versions of BIND 9.
2021-07-13 14:48:29 +02:00
Ondřej Surý
a9e6a7ae57 Disable setting the thread affinity
It was discovered that setting the thread affinity on both the netmgr
and netthread threads lead to inconsistent recursive performance because
sometimes the netmgr and netthread threads would compete over single
resource and sometimes not.

Removing setting the affinity causes a slight dip in the authoritative
performance around 5% (the measured range was from 3.8% to 7.8%), but
the recursive performance is now consistently good.
2021-07-13 14:48:29 +02:00
Ondřej Surý
a92a89f4fa Merge branch '2815-increase-sizeinfo-memory-alignment-on-OpenBSD' into 'main'
Use max_align_t for memory sizeinfo alignment on OpenBSD

Closes #2815

See merge request isc-projects/bind9!5267
2021-07-13 12:00:01 +00:00
Ondrej Sury
6eca4b402e Use max_align_t for memory sizeinfo alignment on OpenBSD
On OpenBSD and more generally on platforms without either jemalloc or
malloc_(usable_)size, we need to increase the alignment for the memory
to sizeof(max_align_t) as with plain sizeof(void *), the compiled code
would be crashing when accessing the returned memory.
2021-07-13 13:48:33 +02:00
Matthijs Mekking
97e1a1f929 Merge branch '2811-checkds-memleak-shutdown' into 'main'
Fix leak in checkds code

Closes #2811

See merge request isc-projects/bind9!5262
2021-07-13 09:50:33 +00:00
Matthijs Mekking
2ccf342690 Add change entry for [#2811] 2021-07-13 11:12:37 +02:00
Matthijs Mekking
b676163933 Fix leak in checkds code
In 'checkds_send_toaddr' there is a goto bug that causes the TSIG key
and DNS message to not be detached. Remove the offending goto statement.
2021-07-13 11:12:37 +02:00
Ondřej Surý
ef467a5a7c Merge branch '2819-cache-the-isc_os_ncpu-result' into 'main'
Cache the isc_os_ncpu() result

Closes #2819

See merge request isc-projects/bind9!5263
2021-07-13 07:55:51 +00:00
Ondrej Sury
23751fe252 Cache the isc_os_ncpu() result
It was discovered that on some platforms (f.e. Alpine Linux with MUSL)
the result of isc_os_ncpus() call differ when called before and after we
drop privileges.  This commit changes the isc_os_ncpus() call to cache
the result from the first call and thus always return the same value
during the runtime of the named.  The first call to isc_os_ncpus() is
made as soon as possible on the library initalization.
2021-07-13 09:12:04 +02:00
Ondřej Surý
e04d69533d Merge branch '2816-mem-c-739-2-runtime-error-null-pointer-returned-from-function-declared-to-never-return-null' into 'main'
Remove nonnull attribute from isc_mem_{get,allocate,reallocate}

Closes #2816

See merge request isc-projects/bind9!5261
2021-07-12 08:23:40 +00:00
Ondřej Surý
b9722ce98f Merge branch '2815-crashes-related-to-memory-reallocation-on-openbsd' into 'main'
Fix the real allocation size in OpenBSD rallocx shim

Closes #2815

See merge request isc-projects/bind9!5260
2021-07-12 08:06:09 +00:00
Ondřej Surý
ce03015d48 Remove nonnull attribute from isc_mem_{get,allocate,reallocate}
The isc_mem_get(), isc_mem_allocate() and isc_mem_reallocate() can
return NULL ptr in case where the allocation size is NULL.  Remove the
nonnull attribute from the functions' declarations.

This stems from the following definition in the C11 standard:

> If the size of the space requested is zero, the behavior is
> implementation-defined: either a null pointer is returned, or the
> behavior is as if the size were some nonzero value, except that the
> returned pointer shall not be used to access an object.

In this case, we return NULL as it's easier to detect errors when
accessing pointer from zero-sized allocation which should obviously
never happen.
2021-07-12 10:02:18 +02:00
Ondřej Surý
d1a9e549b1 Fix the real allocation size in OpenBSD rallocx shim
In the rallocx() shim for OpenBSD (that's the only platform that doesn't
have malloc_size() or malloc_usable_size() equivalent), the newly
allocated size was missing the extra size_t member for storing the
allocation size leading to size_t sized overflow at the end of the
reallocated memory chunk.
2021-07-12 08:43:14 +02:00
Mark Andrews
592a4bc456 Merge branch '2703-gcc-10-fanalyzer-reports-dereference-of-null-text-in-server-c-14721' into 'main'
Resolve "gcc-10+ -fanalyzer reports dereference of NULL ‘text’ in server.c:14721"

Closes #2703

See merge request isc-projects/bind9!5047
2021-07-12 04:28:50 +00:00
Mark Andrews
ac0fc3c2de Add DBC REQUIRE to check that 'text' is non NULL
for all control channel commands.  This should silence
gcc-10-analyzer reporting NULL pointer dereference of 'text'.
2021-07-12 03:55:37 +00:00
Mark Andrews
7301ab8b47 Merge branch '2753-timer_test-subtests-are-not-independent' into 'main'
Resolve "timer_test subtests are not independent"

Closes #2753

See merge request isc-projects/bind9!5146
2021-07-12 03:55:00 +00:00
Mark Andrews
3945c289bb Reset errcnt at the start of each subtest 2021-07-12 03:47:11 +00:00
Mark Andrews
1e84ebd2f8 Merge branch '2808-v9_16-unchecked-returns-in-rbtdb_test-c-and-dnssec-signzone-c-main' into 'main'
Fix unchecked return of isc_rwlock_lock and isc_rwlock_unlock

Closes #2808

See merge request isc-projects/bind9!5257
2021-07-12 03:46:15 +00:00
Mark Andrews
9528ba5a22 Fix unchecked returns of dns_name_fromtext
(cherry picked from commit 8538c762cb)
2021-07-12 13:26:29 +10:00
Mark Andrews
ce5207699d Fix unchecked return of isc_rwlock_lock and isc_rwlock_unlock
(cherry picked from commit bcaf23dd27)
2021-07-12 13:26:29 +10:00
Mark Andrews
70a7973135 Merge branch '2249-stop-falling-back-to-plain-dns-on-formerr-opt' into 'main'
Resolve "Stop falling back to plain DNS on FORMERR+OPT"

Closes #2249

See merge request isc-projects/bind9!4634
2021-07-12 02:59:19 +00:00
Mark Andrews
e9c72ca95c Add release note for [GL #2249] 2021-07-12 12:33:46 +10:00
Mark Andrews
5ab0c9fdfe Add CHANGES note for [GL #2249] 2021-07-12 12:33:46 +10:00
Mark Andrews
3c942a3e3a Update out of date comment 2021-07-12 12:33:46 +10:00
Mark Andrews
0477938e2f Adjust expected queries for no fallback to plain DNS 2021-07-12 12:30:03 +10:00
Mark Andrews
a3fda086f7 Check that there was no OPT record before falling back
to plain DNS on FORMERR.
2021-07-12 12:30:03 +10:00
Mark Andrews
fb4b9d690f Merge branch '2810-silence-untrusted-loop-bound' into 'main'
Resolve "Silence untrusted loop bound"

Closes #2810

See merge request isc-projects/bind9!5251
2021-07-12 02:09:41 +00:00
Mark Andrews
c5e1c35e45 Silence untrusted loop bound on nsec3param.iterations
630
   	    1. tainted_argument: Calling function dns_rdata_tostruct taints argument nsec3param.iterations. [show details]
    631        result = dns_rdata_tostruct(nsec3rdata, &nsec3param, NULL);
   	    2. Condition !!(result == 0), taking true branch.
   	    3. Condition !!(result == 0), taking true branch.
    632        RUNTIME_CHECK(result == ISC_R_SUCCESS);
    633
    634        dns_fixedname_init(&fixed);

            CID 281425 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
            4. tainted_data: Passing tainted expression nsec3param.iterations to dns_nsec3_hashname, which uses it as a loop boundary. [show details]
   	    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    635        result = dns_nsec3_hashname(&fixed, rawhash, &rhsize, vctx->origin,
    636                                    vctx->origin, nsec3param.hash,
    637                                    nsec3param.iterations, nsec3param.salt,
    638                                    nsec3param.salt_length);
2021-07-12 00:48:13 +00:00
Mark Andrews
ad17419313 Merge branch '2807-coverity-reports-use-of-tainted-scalar' into 'main'
Resolve "Coverity reports use of tainted scalar"

Closes #2807

See merge request isc-projects/bind9!5249
2021-07-12 00:42:27 +00:00
Mark Andrews
f0fdca90f2 Silence tainted scalar on rdlen
2042        ttl = isc_buffer_getuint32(&j->it.source);
    	    13. tainted_data_transitive: Call to function isc_buffer_getuint16 with tainted argument *j->it.source.base returns tainted data. [show details]
    	    14. var_assign: Assigning: rdlen = isc_buffer_getuint16(&j->it.source), which taints rdlen.
    2043        rdlen = isc_buffer_getuint16(&j->it.source);
    2044
    2045        /*
    2046         * Parse the rdata.
    2047         */
    	    15. Condition j->it.source.used - j->it.source.current != rdlen, taking false branch.
    2048        if (isc_buffer_remaininglength(&j->it.source) != rdlen) {
    2049                FAIL(DNS_R_FORMERR);
    2050        }
    	    16. var_assign_var: Assigning: j->it.source.active = j->it.source.current + rdlen. Both are now tainted.
    2051        isc_buffer_setactive(&j->it.source, rdlen);
    2052        dns_rdata_reset(&j->it.rdata);
    	    17. lower_bounds: Checking lower bounds of unsigned scalar j->it.source.active by taking the true branch of j->it.source.active > j->it.source.current.

    CID 316506 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
    18. tainted_data: Passing tainted expression j->it.source.active to dns_rdata_fromwire, which uses it as a loop boundary. [show details]
    	    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    2053        CHECK(dns_rdata_fromwire(&j->it.rdata, rdclass, rdtype, &j->it.source,
    2054                                 &j->it.dctx, 0, &j->it.target));
2021-07-12 00:22:07 +00:00
Mark Andrews
83fd38dd2c Silence use of tainted scalar
2607
            43. tainted_argument: Calling function journal_read_xhdr taints argument xhdr.size. [show details]
    2608                        result = journal_read_xhdr(j1, &xhdr);
            44. Condition rewrite, taking true branch.
            45. Condition result == 29, taking false branch.
    2609                        if (rewrite && result == ISC_R_NOMORE) {
    2610                                break;
    2611                        }
            46. Condition result != 0, taking false branch.
    2612                        CHECK(result);
    2613
            47. var_assign_var: Assigning: size = xhdr.size. Both are now tainted.
    2614                        size = xhdr.size;

            CID 331088 (#3 of 3): Untrusted allocation size (TAINTED_SCALAR)
            48. tainted_data: Passing tainted expression size to isc__mem_get, which uses it as an allocation size. [show details]
            Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    2615                        buf = isc_mem_get(mctx, size);
2021-07-12 00:22:07 +00:00
Ondřej Surý
d7aa979a6c Merge branch '2812-fix-get-realloc-put-mismatch-in-netmgr' into 'main'
Revert the allocate/free -> get/put change from jemalloc change

Closes #2812

See merge request isc-projects/bind9!5252
2021-07-09 16:57:05 +00:00
Ondřej Surý
29a285a67d Revert the allocate/free -> get/put change from jemalloc change
In the jemalloc merge request, we missed the fact that ah_frees and ah_handles
are reallocated which is not compatible with using isc_mem_get() for allocation
and isc_mem_put() for deallocation.  This commit reverts that part and restores
use of isc_mem_allocate() and isc_mem_free().
2021-07-09 18:19:57 +02:00
Ondřej Surý
2ceca6f24d Merge branch '2433-improve-memory-contention' into 'main'
Reduce the contention of the memory allocator

Closes #2433

See merge request isc-projects/bind9!5012
2021-07-09 14:27:24 +00:00
Artem Boldariev
c55a747704 Merge branch 'artem/doh-ignore-accept-header' into 'main'
DoH: Improve compatiblity by ignoring an "Accept" HTTP header value

See merge request isc-projects/bind9!5246
2021-07-09 14:00:32 +00:00
Evan Hunt
d40d1fd590 Add CHANGES and release notes for [GL #2433] 2021-07-09 15:59:03 +02:00
Ondřej Surý
9c3bebc26f Properly disable the "water" in isc_mem
The proper way how to disable the water limit in the isc_mem context is
to call:

    isc_mem_setwater(ctx, NULL, NULL, 0, 0);

this ensures that the old water callback is called with ISC_MEM_LOWATER
if the callback was called with ISC_MEM_HIWATER before.

Historically, there were some places where the limits were disabled by
calling:

    isc_mem_setwater(ctx, water, water_arg, 0, 0);

which would also call the old callback, but it also causes the water_t
to be allocated and extra check to be executed because water callback is
not NULL.

This commits unifies the calls to disable water to the preferred form.
2021-07-09 15:58:02 +02:00
Ondřej Surý
ca228ec3e5 Disable jemalloc for Address and Thread Sanitizers
The Address and Thread Sanitizers both intercept the malloc calls and
using the extended jemalloc API interferes with that.  This commit
disables the use of jemalloc for both ASAN and TSAN enabled builds to
eliminate both false positives and false negatives.
2021-07-09 15:58:02 +02:00
Artem Boldariev
3673abc53c Use restrict and const in isc_mempool_t
This commit makes add restrict and const modifiers to some variables
to aid compiler to do its optimizations.
2021-07-09 15:58:02 +02:00
Artem Boldariev
c11a401add Do not use atomic variables in isc_mempool_t
As now mempool objects intended to be used in a thread-local manner,
there is no point in using atomic here.
2021-07-09 15:58:02 +02:00
Ondřej Surý
63b06571b9 Use isc_mem_get() and isc_mem_put() in isc_mem_total test
Previously, the isc_mem_allocate() and isc_mem_free() would be used for
isc_mem_total test, but since we now use the real allocation
size (sallocx, malloc_size, malloc_usable_size) to track the allocation
size, it's impossible to get the test value right.  Changing the test to
use isc_mem_get() and isc_mem_put() will use the exact size provided, so
the test would work again on all the platforms even when jemalloc is not
being used.
2021-07-09 15:58:02 +02:00
Ondřej Surý
d3676a1fc5 Disable jemalloc on softhsm2.4 branch
It was discovered that softhsm2.4 has a bug that causes invalid free()
call to be called when unloading libsofthsm.so.2 library.  The native
PKCS#11 API is scheduled to removed in the 9.17+ release, we could
safely just disable jemalloc for this particular build.
2021-07-09 15:58:02 +02:00
Ondřej Surý
6f162e8aa4 Rewrite isc_mem water to use single atomic exchange operation
This commit refactors the water mechanism in the isc_mem API to use
single pointer to a water_t structure that can be swapped with
atomic_exchange operation instead of having four different
values (water, water_arg, hi_water, lo_water) in the flat namespace.

This reduces the need for locking and prevents a race when water and
water_arg could be desynchronized.
2021-07-09 15:58:02 +02:00
Ondřej Surý
798333d456 Allow size == 0 in isc_mem_{get,allocate,reallocate}
Calls to jemalloc extended API with size == 0 ends up in undefined
behaviour.  This commit makes the isc_mem_get() and friends calls
more POSIX aligned:

  If size is 0, either a null pointer or a unique pointer that can be
  successfully passed to free() shall be returned.

We picked the easier route (which have been already supported in the old
code) and return NULL on calls to the API where size == 0.
2021-07-09 15:58:02 +02:00
Ondřej Surý
e20cc41e56 Use system allocator when jemalloc is unavailable
This commit adds support for systems where the jemalloc library is not
available as a package, here's the quick summary:

  * On Linux - the jemalloc is usually available as a package, if
    configured --without-jemalloc, the shim would be used around
    malloc(), free(), realloc() and malloc_usable_size()

  * On macOS - the jemalloc is available from homebrew or macports, if
    configured --without-jemalloc, the shim would be used around
    malloc(), free(), realloc() and malloc_size()

  * On FreeBSD - the jemalloc is *the* system allocator, we just need
    to check for <malloc_np.h> header to get access to non-standard API

  * On NetBSD - the jemalloc is *the* system allocator, we just need to
    check for <jemalloc/jemalloc.h> header to get access to non-standard
    API

  * On a system hostile to users and developers (read OpenBSD) - the
    jemalloc API is emulated by using ((size_t *)ptr)[-1] field to hold
    the size information.  The OpenBSD developers care only for
    themselves, so why should we care about speed on OpenBSD?
2021-07-09 15:58:02 +02:00
Evan Hunt
68a28cbc0a update the "memory" section of the developer doc
Information about memory allocation was outdated.
2021-07-09 15:58:02 +02:00
Evan Hunt
6591786102 document the dependency on jemalloc
updated README and PLATFORMS with new text on build requirements.
2021-07-09 15:58:02 +02:00
Evan Hunt
2ce0de6995 Remove error checks in dns_message for mem allocations
Removed error checks for several functions that can no longer fail due
to failed memory allocation.
2021-07-09 15:58:02 +02:00
Ondřej Surý
e754360170 Remove atomic thread synchronization from the memory hot-path
This commit refactors the hi/lo-water related code to remove contention
on the hot path in the memory allocator.
2021-07-09 15:58:02 +02:00
Ondřej Surý
efb385ecdc Clean up isc_mempool API
- isc_mempool_get() can no longer fail; when there are no more objects
  in the pool, more are always allocated. checking for NULL return is
  no longer necessary.
- the isc_mempool_setmaxalloc() and isc_mempool_getmaxalloc() functions
  are no longer used and have been removed.
2021-07-09 15:58:02 +02:00
Evan Hunt
62d06a4987 initialize state object in test-async driver
the hooks system test was failing due to a block of
memory not having been zeroed after allocation.
2021-07-09 15:58:02 +02:00
Ondřej Surý
7cbfbc8faa Clean up the dns_dispatch_getudp API
Cleanup unused parts of dns_dispatch_getudp API, remove
dns_dispatch_getudp_dup() function and related code.
2021-07-09 15:58:02 +02:00
Ondřej Surý
f487c6948b Replace locked mempools with memory contexts
Current mempools are kind of hybrid structures - they serve two
purposes:

 1. mempool with a lock is basically static sized allocator with
    pre-allocated free items

 2. mempool without a lock is a doubly-linked list of preallocated items

The first kind of usage could be easily replaced with jemalloc small
sized arena objects and thread-local caches.

The second usage not-so-much and we need to keep this (in
libdns:message.c) for performance reasons.
2021-07-09 15:58:02 +02:00
Ondřej Surý
fd3ceec475 Add debug tracing capability to isc_mempool_create/destroy
Previously, we only had capability to trace the mempool gets and puts,
but for debugging, it's sometimes also important to keep track how many
and where do the memory pools get created and destroyed.  This commit
adds such tracking capability.
2021-07-09 15:58:02 +02:00
Ondřej Surý
5ab05d1696 Replace isc_mem_allocate() usage with isc_mem_get() in netmgr.c
The isc_mem_allocate() comes with additional cost because of the memory
tracking.  In this commit, we replace the usage with isc_mem_get()
because we track the allocated sizes anyway, so it's possible to also
replace isc_mem_free() with isc_mem_put().
2021-07-09 15:58:02 +02:00
Ondřej Surý
fcc6814776 Replace internal memory calls with non-standard jemalloc API
The jemalloc non-standard API fits nicely with our memory contexts, so
just rewrite the memory context internals to use the non-public API.

There's just one caveat - since we no longer track the size of the
allocation for isc_mem_allocate/isc_mem_free combination, we need to use
sallocx() to get real allocation size in both allocator and deallocator
because otherwise the sizes would not match.
2021-07-09 15:58:02 +02:00
Ondřej Surý
4b3d0c6600 Remove ISC_MEM_DEBUGSIZE and ISC_MEM_DEBUGRECORD
The ISC_MEM_DEBUGSIZE and ISC_MEM_DEBUGCTX did sanity checks on matching
size and memory context on the memory returned to the allocator.  Those
will no longer needed when most of the allocator will be replaced with
jemalloc.
2021-07-09 15:58:02 +02:00
Ondřej Surý
692fd2a216 Remove default_memalloc and default_memfree
Now that we have xmalloc:true enabled, we can remove our xmalloc-like
wrappers around malloc and free.
2021-07-09 15:58:02 +02:00
Ondřej Surý
5184384efd Add recommended jemalloc configuration for our load
There's global variable called `malloc_conf` that can be used to
configure jemalloc behaviour at the program startup.  We use following
configuration:

  * xmalloc:true - abort-on-out-of-memory enabled.

  * background_thread:true - Enable internal background worker threads
    to handle purging asynchronously.

  * metadata_thp:auto - allow jemalloc to use transparent huge page
    (THP) for internal metadata initially, but may begin to do so when
    metadata usage reaches certain level.

  * dirty_decay_ms:30000 - Approximate time in milliseconds from the
    creation of a set of unused dirty pages until an equivalent set of
    unused dirty pages is purged and/or reused.

  * muzzy_decay_ms:30000 - Approximate time in milliseconds from the
    creation of a set of unused muzzy pages until an equivalent set of
    unused muzzy pages is purged and/or reused.

More information about the specific meaning can be found in the jemalloc
manpage or online at http://jemalloc.net/jemalloc.3.html
2021-07-09 15:58:02 +02:00
Ondřej Surý
7f1c525625 Compile with jemalloc to reduce memory allocator contention
The jemalloc allocator is scalable high performance allocator, this is
the first in the series of commits that will add jemalloc as a memory
allocator for BIND 9.

This commit adds configure.ac check and Makefile modifications to use
jemalloc as BIND 9 allocator.
2021-07-09 15:58:02 +02:00
Ondřej Surý
63924968d1 Add debug tracing capability to isc_mem_create/isc_mem_destroy
Previously, we only had capability to trace the memory gets and puts,
but for debugging, it's sometimes also important to keep track how many
and where do the memory contexts get created and destroyed.  This commit
adds such tracking capability.
2021-07-09 15:58:02 +02:00
Artem Boldariev
c6d0e3d3a7 Return HTTP status code for small/malformed requests
This commit makes BIND return HTTP status codes for malformed or too
small requests.

DNS request processing code would ignore such requests. Such an
approach works well for other DNS transport but does not make much
sense for HTTP, not allowing it to complete the request/response
sequence.

Suppose execution has reached the point where DNS message handling
code has been called. In that case, it means that the HTTP request has
been successfully processed, and, thus, we are expected to respond to
it either with a message containing some DNS payload or at least to
return an error status code. This commit ensures that BIND behaves
this way.
2021-07-09 16:37:08 +03:00
Artem Boldariev
debd0241f7 modify CHANGES
Add a note to changes regarding ignoring the "Accept" HTTP header.
2021-07-09 16:27:45 +03:00
Artem Boldariev
fedff2cd6c Return "Bad Request" (400) in a case of Base64 decoding error
This error code fits better than the more generic "Internal Server
Error" (500) which implies that the problem is on the server.

Also, do not end the whole HTTP/2 session on a bad request.
2021-07-09 16:26:46 +03:00
Artem Boldariev
1792740075 Ignore an "Accept" HTTP header value
We were too strict regarding the value and presence of "Accept" HTTP
header, slightly breaking compatibility with the specification.

According to RFC8484 client SHOULD add "Accept" header to the requests
but MUST be able to handle "application/dns-message" media type
regardless of the value of the header. That basically suggests we
ignore its value.

Besides, verifying the value of the "Accept" header is a bit tricky
because it could contain multiple media types, thus requiring proper
parsing. That is doable but does not provide us with any benefits.

Among other things, not verifying the value also fixes compatibility
with clients, which could advertise multiple media types as supported,
which we should accept. For example, it is possible for a perfectly
valid request to contain "application/dns-message", "application/*",
and "*/*" in the "Accept" header value. Still, we would treat such a
request as invalid.
2021-07-09 16:26:46 +03:00
Artem Boldariev
4bf1bd4da5 Merge branch 'artem/doh-hang-on-stop-fix' into 'main'
Fix BIND hanging when browsers end HTTP/2 streams prematurely

See merge request isc-projects/bind9!5245
2021-07-09 13:03:40 +00:00
Artem Boldariev
751c5744c4 Modify CHANGES
Document that BIND hanging in a case HTTP/2 streams been ended
prematurely is fixed.
2021-07-09 15:43:37 +03:00
Artem Boldariev
7b6945fb60 Fix BIND hanging when browsers end HTTP/2 streams prematurely
The commit fixes BIND hanging when browsers end HTTP/2 streams
prematurely (for example, by sending RST_STREAM). It ensures that
isc__nmsocket_prep_destroy() will be called for an HTTP/2 stream,
allowing it to be properly disposed.

The problem was impossible to reproduce using dig or DoH benchmarking
software (e.g. flamethrower) because these do not tend to end HTTP/2
streams prematurely.
2021-07-09 15:42:44 +03:00
Artem Boldariev
094fcc10e7 Move the code which calls server read callback into a separate func
This commit moves the code which calls server read callback into a
separate function to avoid code repetition.
2021-07-09 15:42:44 +03:00
Ondřej Surý
6302fdd196 Merge branch '2478-consider-making-the-build-time-dependency-on-nghttp2-optional' into 'main'
Make the DNS over HTTPS support optional

Closes #2478

See merge request isc-projects/bind9!4926
2021-07-07 08:15:26 +00:00
Ondřej Surý
29843bcde8 Add CHANGES and release notes for [GL #2478] 2021-07-07 09:50:53 +02:00
Ondřej Surý
2bb454182b Make the DNS over HTTPS support optional
This commit adds two new autoconf options `--enable-doh` (enabled by
default) and `--with-libnghttp2` (mandatory when DoH is enabled).

When DoH support is disabled the library is not linked-in and support
for http(s) protocol is disabled in the netmgr, named and dig.
2021-07-07 09:50:53 +02:00
Evan Hunt
390a522366 Merge branch '2756-rndc-multiple-algorithm' into 'main'
allow multiple key algorithms in the same control listener

Closes #2756

See merge request isc-projects/bind9!5153
2021-07-06 18:43:53 +00:00
Evan Hunt
a605a84b08 CHANGES 2021-07-06 10:54:13 -07:00
Evan Hunt
841b557df8 allow multiple key algorithms in the same control listener
if a control channel listener was configured with more than one
key algorithm, message verification would be attempted with each
algorithm in turn. if the first key failed due to the wrong
signature length, the entire verification process was aborted,
rather than continuing on to try with another key.
2021-07-06 10:54:13 -07:00
Ondřej Surý
f663701b1d Merge branch 'ondrej/remove-platform.h-header' into 'main'
Remove isc/platform.h

See merge request isc-projects/bind9!5162
2021-07-06 05:53:30 +00:00
Ondřej Surý
29c2e52484 The isc/platform.h header has been completely removed
The isc/platform.h header was left empty which things either already
moved to config.h or to appropriate headers.  This is just the final
cleanup commit.
2021-07-06 05:33:48 +00:00
Ondřej Surý
bf4a0e26dc Move NAME_MAX and PATH_MAX from isc/platform.h to isc/dir.h
The last remaining defines needed for platforms without NAME_MAX and
PATH_MAX (I'm looking at you, GNU Hurd) were moved to isc/dir.h where
it's prevalently used.
2021-07-06 05:33:48 +00:00
Ondřej Surý
4da0c49e80 Move ISC_STRERRORSIZE to isc/strerr.h header
The ISC_STRERRORSIZE was defined in isc/platform.h header as the
value was different between Windows and POSIX platforms.  Now that
Windows is gone, move the define to where it belongs.
2021-07-06 05:33:48 +00:00
Ondřej Surý
d881e30b0a Remove LIB<*>_EXTERNAL_DATA defines
After Windows has been removed, the LIB<*>_EXTERNAL_DATA defines
were just dummy leftovers.  Remove them.
2021-07-06 05:33:48 +00:00
Mark Andrews
e204b5c413 Merge branch 'marka-xmllint-html' into 'main'
Check for errors in html files

See merge request isc-projects/bind9!5242
2021-07-02 02:06:56 +00:00
Mark Andrews
ea0624b214 Check for errors in html files
xmllint doesn't know about the HTML 5 <section> tag so filter
those out.
2021-07-02 11:45:59 +10:00
Matthijs Mekking
b53c2416d6 Merge branch '1126-checkds-followup-cid332468' into 'main'
Fix CID 332468: Memory - illegal accesses (UNINIT)

Closes #1126

See merge request isc-projects/bind9!5241
2021-07-01 14:27:36 +00:00
Matthijs Mekking
b4a0e19290 Fix CID 332468: Memory - illegal accesses (UNINIT)
*** CID 332468:  Memory - illegal accesses  (UNINIT)
/lib/dns/zone.c: 6613 in dns_zone_getdnsseckeys()
6607                 ISC_LIST_UNLINK(dnskeys, k1, link);
6608                 ISC_LIST_APPEND(*keys, k1, link);
6609             }
6610         }
6611     6612     failure:
>>>     CID 332468:  Memory - illegal accesses  (UNINIT)
>>>     Using uninitialized value "keyset.methods" when calling
>>>     "dns_rdataset_isassociated".
6613         if (dns_rdataset_isassociated(&keyset)) {
6614             dns_rdataset_disassociate(&keyset);
6615         }
6616         if (node != NULL) {
6617             dns_db_detachnode(db, &node);
6618         }

Fix by initializing the 'keyset' with 'dns_rdataset_init'.
2021-07-01 15:49:43 +02:00
Matthijs Mekking
5e8cebb2e5 Merge branch '2786-keyfile-locking-race-condition-deadlock' into 'main'
Fix possible deadlock when locking key files

Closes #2786

See merge request isc-projects/bind9!5210
2021-07-01 09:27:54 +00:00
Matthijs Mekking
be87edd249 Add release note and change for [#2786] 2021-07-01 10:20:15 +02:00
Mark Andrews
68c4908292 Merge branch '2769-journal-rollforward-failed-journal-out-of-sync-with-zone' into 'main'
Resolve "journal rollforward failed: journal out of sync with zone"

Closes #2769, #2728, and #2686

See merge request isc-projects/bind9!5177
2021-07-01 04:54:11 +00:00
Mark Andrews
4b2b6fc42c Add CHANGES note for [GL #2769] 2021-07-01 14:34:57 +10:00
Mark Andrews
c6fa8a1d45 Handle placeholder KEYDATA record
A placeholder keydata record can appear in a zone file.  Allow them
to be read back in.
2021-07-01 14:34:28 +10:00
Matthijs Mekking
f3bce65661 Merge branch '1126-checkds' into 'main'
checkds

Closes #1126

See merge request isc-projects/bind9!5234
2021-06-30 15:49:42 +00:00
Matthijs Mekking
c92128eada Move private_type_record() to conf.sh.common
The function 'private_type_record()' is now used in multiple system
setup scripts and should be moved to the common configuration script
conf.sh.common.
2021-06-30 17:29:14 +02:00
Matthijs Mekking
22cd63bf81 Add change and release note for [#1126]
Seems pretty newsworthy.
2021-06-30 17:29:13 +02:00
Matthijs Mekking
b4c1f3b832 Update documentation
Update ARM and DNSSEC guide with the new checkds feature.
2021-06-30 17:28:49 +02:00
Matthijs Mekking
39df3f0475 Protect dst key metadata with lock
The DST key metadata can be written by several threads in parralel.
Protect the dst_key_get* and dst_key_set* functions with a mutex.
2021-06-30 17:28:49 +02:00
Matthijs Mekking
28c5179904 Replace zone keyflock with zonemgr keymgmt
The old approach where each zone structure has its own mutex that
a thread needs to obtain multiple locks to do safe keyfile I/O
operations lead to a race condition ending in a possible deadlock.

Consider a zone in two views. Each such zone is stored in a separate
zone structure. A thread that needs to read or write the key files for
this zone needs to obtain both mutexes in seperate structures. If
another thread is working on the same zone in a different view, they
race to get the locks. It would be possible that thread1 grabs the
lock of the zone in view1, while thread2 wins the race for the lock
of the zone in view2. Now both threads try to get the other lock,  both
of them are already locked.

Ideally, when a thread wants to do key file operations, it only needs
to lock a single mutex. This commit introduces a key management hash
table, stored in the zonemgr structure. Each time a zone is being
managed, an object is added to the hash table (and removed when the
zone is being released). This object is identified by the zone name
and contains a mutex that needs to be locked prior to reading or
writing key files.

(cherry-picked from commit ef4619366d49efd46f9fae5f75c4a67c246ba2e6)
2021-06-30 17:28:49 +02:00
Matthijs Mekking
f7872dbd20 Add checkds code
Similar to notify, add code to send and keep track of checkds requests.

On every zone_rekey event, we will check the DS at parental agents
(but we will only actually query parental agents if theree is a DS
scheduled to be published/withdrawn).

On a zone_rekey event, we will first clear the ongoing checkds requests.
Reset the counter, to avoid continuing KSK rollover premature.

This has the risk that if zone_rekey events happen too soon after each
other, there are redundant DS queries to the parental agents. But
if TTLs and the configured durations in the dnssec-policy are sane (as
in not ridiculous short) the chance of this happening is low.
2021-06-30 17:28:49 +02:00
Matthijs Mekking
1a50554963 Add checkds log notice
When the checkds published/withdrawn is activated, log a notice. Can
be used for testing, but also operationally useful.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
6e2c24be7c Add key metadata for DS published/withdrawn
In order to keep track of how many parents have the DS for a given key
published or withdrawn, keep a counter.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
4c337a8e72 Add missing VERIFY export
This makes the 'dnssec-verify' tool visible to the test environment.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
71d5932a14 Slightly improved dnssec tools fatal message
Return the offending key state identifier.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
40331a20c4 Add helpful function 'dns_zone_getdnsseckeys'
This code gathers DNSSEC keys from key files and from the DNSKEY RRset.
It is used for the 'rndc dnssec -status' command, but will also be
needed for "checkds". Turn it into a function.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
2872d6a12e Add "parental-source[-v6]" config option
Similar to "notify-source" and "transfer-source", add options to
set the source address when querying parental agents for DS records.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
c9b7f62767 Add dst_key_role function
Change the static function 'get_ksk_zsk' to a library function that
can be used to determine the role of a dst_key. Add checks if the
boolean parameters to store the role are not NULL. Rename to
'dst_key_role'.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
6f92d4b9a5 Parse "parental-agents" configuration
Parse the new "parental-agents" configuration and store it in the zone
structure.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
6040c71478 Make "primaries" config parsing generic
Make the code to parse "primaries" configuration more generic so
it can be reused for "parental-agents".
2021-06-30 17:28:48 +02:00
Matthijs Mekking
8327cb7839 Remove stray "setup zone" in kasp system setup 2021-06-30 17:28:48 +02:00
Matthijs Mekking
56262db9cd Add checkds system test
Add a Pytest based system test for the 'checkds' feature. There is
one nameserver (ns9, because it should be started the latest) that
has configured several zones with dnssec-policy. The zones are set
in such a state that they are waiting for DS publication or DS
withdrawal.

Then several other name servers act as parent servers that either have
the DS for these published, or not. Also one server in the mix is
to test a badly configured parental-agent.

There are tests for DS publication, DS publication error handling,
DS withdrawal and DS withdrawal error handling.

The tests ensures that the zone is DNSSEC valid, and that the
DSPublish/DSRemoved key metadata is set (or not in case of the error
handling).

It does not test if the rollover continues, this is already tested in
the kasp system test (that uses 'rndc -dnssec checkds' to set the
DSPublish/DSRemoved key metadata).
2021-06-30 17:28:48 +02:00
Matthijs Mekking
1e763e582b Check parental-agents config
Add checks for "parental-agents" configuration, checking for the option
being at wrong type of zone (only allowed for primaries and
secondaries), duplicate definitions, duplicate references, and
undefined parental clauses (the name referenced in the zone clause
does not have a matching "parental-agent" clause).
2021-06-30 17:28:48 +02:00
Matthijs Mekking
0311705d4b Add parental-agents configuration
Introduce a way to configure parental agents that can be used to
query DS records to be used in automatic key rollovers.
2021-06-30 17:28:47 +02:00
Matthijs Mekking
39a961112f Change primaries objects to remote-servers
Change the primaries configuration objects to the more generic
remote-servers, that we can reuse for other purposes (such as
parental-agents).
2021-06-30 17:21:11 +02:00
Petr Špaček
f4c4217eec Merge branch '2797-cfg-net-buf-sizes' into 'main'
fix tcp-send-buffer, udp-receive-buffer, udp-send-buffer limits

Closes #2797

See merge request isc-projects/bind9!5235
2021-06-28 10:15:12 +00:00
Petr Špaček
9290d9752d fix tcp-send-buffer, udp-receive-buffer, udp-send-buffer limits 2021-06-28 11:16:00 +02:00
Matthijs Mekking
6f84024cb5 Merge branch '2791-busy-wait-setnsec3param-shutdown-hang' into 'main'
Fix setnsec3param shutdown hang

Closes #2791

See merge request isc-projects/bind9!5219
2021-06-28 09:01:02 +00:00
Matthijs Mekking
2f270428fc Add changes for [#2791] 2021-06-28 10:38:31 +02:00
Matthijs Mekking
10055d44e3 Fix setnsec3param hang on shutdown
When performing the 'setnsec3param' task, zones that are not loaded will have
their task rescheduled. We should do this only if the zone load is still
pending, this prevents zones that failed to load get stuck in a busy wait and
causing a hang on shutdown.
2021-06-28 10:35:34 +02:00
Matthijs Mekking
3631a23c7f Add configuration that causes setnsec3param hang
Add a zone to the configuration file that uses NSEC3 with dnssec-policy
and fails to load. This will cause setnsec3param to go into a busy wait
and will cause a hang on shutdown.
2021-06-28 10:34:19 +02:00
Ondřej Surý
33394f11c3 Merge branch 'ondrej/fix-the-CFLAGS-order-in-tests' into 'main'
Move the include Makefile.tests to the bottom of Makefile.am(s)

See merge request isc-projects/bind9!4927
2021-06-24 13:49:03 +00:00
Ondřej Surý
e59a359929 Move the include Makefile.tests to the bottom of Makefile.am(s)
The Makefile.tests was modifying global AM_CFLAGS and LDADD and could
accidentally pull /usr/include to be listed before the internal
libraries, which is known to cause problems if the headers from the
previous version of BIND 9 has been installed on the build machine.
2021-06-24 15:33:52 +02:00
Ondřej Surý
5c82f7c71b Merge branch 'ondrej/remove-the-cvs-cruft' into 'main'
Remove unused or outdated utils, developer and design documentation

Closes #2745

See merge request isc-projects/bind9!5131
2021-06-24 09:45:48 +00:00
Matthijs Mekking
71c6d40942 Remove HISTORY file
We should drop the HISTORY file because it's confusing and the same
information is covered by the release notes for .0 releases (or at
least they should be).

Remove references to the HISTORY file, update the README to tell
people go look somewhere else.
2021-06-24 11:44:13 +02:00
Matthijs Mekking
717a39d5b9 Add steps to update copyrights
This was written down in the outdated doc/dev/release documentation.
Since the rest of that file can go, add these steps to a separate file
and update it to current standards (e.g. use git commands).
2021-06-24 11:14:27 +02:00
Ondřej Surý
df4d072c72 Remove unused or outdated utils, developer and design documentation
The util/, doc/design/, and doc/dev/ directories included couple of
tools or documents there were completely outdated because they either
refered the the VCS we no longer use (cvs) or described processes that
have been redesigned and they are documented elsewhere.
2021-06-24 11:14:27 +02:00
Matthijs Mekking
da8b5d7947 Merge branch '2780-checkconf-dnssec-policy-inheritance' into 'main'
Fix checkconf dnssec-policy inheritance bug

Closes #2780

See merge request isc-projects/bind9!5199
2021-06-24 08:40:52 +00:00
Matthijs Mekking
d0668bd4cc Add change and release note for [#2780] 2021-06-24 09:32:28 +02:00
Matthijs Mekking
75ec7d1d9f Fix checkconf dnssec-policy inheritance bug
Similar to #2778, the check for 'dnssec-policy' failed to account for
it being inheritable.
2021-06-24 09:31:59 +02:00
Ondřej Surý
30b23706d6 Merge branch '2183-tweak-the-safe-edns-udp-size-to-1432' into 'main'
Change the safe edns-udp-size from 1400 to 1432

Closes #2183

See merge request isc-projects/bind9!5228
2021-06-23 19:00:59 +00:00
Ondřej Surý
4266f6dd2b Change the safe edns-udp-size from 1400 to 1432
When backporting the Don't Fragment UDP socket option, it was noticed
that the edns-udp-size probing uses 1432 as one of the values to be
probed and the documentation would be recommending 1400 as the safe
value.  As the safe value can be from the 1400-1500 interval, the
documentation has been changed to match the probed value, so we do not
skip it.
2021-06-23 20:57:05 +02:00
Evan Hunt
cc39e4c8cf Merge branch '2758-nsupdate-refused' into 'main'
nsupdate: try next server on REFUSED

Closes #2758

See merge request isc-projects/bind9!5158
2021-06-23 16:01:55 +00:00
Evan Hunt
693eb67af9 CHANGES 2021-06-23 09:01:04 -07:00
Evan Hunt
d02210607d add test for server failover on REFUSED
- add an 'nsupdate -C' option to override resolv.conf file for nsupdate
- set resolv.conf to use two test servers, the first one of which will
  return REFUSED for a query for 'example'.
2021-06-23 09:00:29 -07:00
Evan Hunt
2100331307 nsupdate: try next server on REFUSED
when nsupdate sends an SOA query to a resolver, if it fails
with REFUSED, nsupdate will now try the next server rather than
aborting the update completely.
2021-06-23 09:00:29 -07:00
Ondřej Surý
f391a5edf9 Merge branch '2790-properly-handle-oversized-messages-in-isc_nm_send' into 'main'
Handle `UV_EMSGSIZE` in the uv_udp_send() callback

Closes #2790

See merge request isc-projects/bind9!5212
2021-06-23 15:55:52 +00:00
Ondřej Surý
5d9c0a3721 Add CHANGES and release note for [GL #2790] 2021-06-23 17:41:34 +02:00
Ondřej Surý
b941411072 Disable IP fragmentation on the UDP sockets
In DNS Flag Day 2020, we started setting the DF (Don't Fragment socket
option on the UDP sockets.  It turned out, that this code was incomplete
leading to dropping the outgoing UDP packets.

This has been now remedied, so it is possible to disable the
fragmentation on the UDP sockets again as the sending error is now
handled by sending back an empty response with TC (truncated) bit set.

This reverts commit 66eefac78c.
2021-06-23 17:41:34 +02:00
Evan Hunt
a3ba95116e Handle UDP send errors when sending DNS message larger than MTU
When the fragmentation is disabled on UDP sockets, the uv_udp_send()
call can fail with UV_EMSGSIZE for messages larger than path MTU.
Previously, this error would end with just discarding the response.  In
this commit, a proper handling of such case is added and on such error,
a new DNS response with truncated bit set is generated and sent to the
client.

This change allows us to disable the fragmentation on the UDP
sockets again.
2021-06-23 17:41:34 +02:00
Matthijs Mekking
e7e48414e0 Merge branch 'matthijs-2778-more-tests' into 'main'
Add more test cases for #2778

See merge request isc-projects/bind9!5198
2021-06-23 15:30:04 +00:00
Matthijs Mekking
9bd6c96b78 Add more test cases for #2778
Add three more test cases that detect a configuration error if the
key-directory is inherited but has the same value for a zone in a
different view with a deviating DNSSEC policy.
2021-06-23 17:28:06 +02:00
Ondřej Surý
38d42bb5be Merge branch '2788-add-rbtdb-ownercase-unittest' into 'main'
Add rbtdb setownercase/getownercase unit test

Closes #2788

See merge request isc-projects/bind9!5223
2021-06-23 15:13:09 +00:00
Ondřej Surý
c7a11bd5b4 Add rbtdb setownercase/getownercase unit test
This commit adds a unittest that tests private rdataset_getownercase()
and rdataset_setownercase() methods from rbtdb.c.  The test setups
minimal mock dns_rbtdb_t and dns_rbtdbnode_t data structures.

As the rbtdb methods are generally hidden behind layers and layers, we
include the "rbtdb.c" directly from rbtdb_test.c, and thus we can use
the private methods and data structures directly.  This also opens up
opportunity to add more unittest for the rbtdb private functions without
going through all the layers.
2021-06-23 16:38:46 +02:00
Matthijs Mekking
4db35fce0b Merge branch '2765-servestale-intermittent-test-failure-144' into 'main'
Resolve intermittent serve-stale test failure (144)

Closes #2765

See merge request isc-projects/bind9!5167
2021-06-23 13:10:28 +00:00
Matthijs Mekking
05e73a24f0 Bump wait time in servestale test with 1 second
This check intermittently failed:

I:serve-stale:check not in cache longttl.example times out...
I:serve-stale:failed

This corresponds to this query in the test:

$DIG -p ${PORT} +tries=1 +timeout=3  @10.53.0.3 longttl.example TXT

Looking at the dig output for a failed test, the query actually got a
response from the authoritative server (in one specific example the
query time was 2991 msec, close to 3 seconds).

After doing the query for the test, we enable the authoritative
server after a sleep of three seconds. If we bump this sleep to 4
seconds, the race will be more in favor of the query timing out,
making it unlikely that this test will fail intermittently.

Bump the subsequent wait_for_log checks also with one second.
2021-06-23 13:09:59 +00:00
Michał Kępień
3939385c13 Merge branch 'v9_17_15-release' into 'main'
Merge 9.17.15 release branch

See merge request isc-projects/bind9!5220
2021-06-23 11:02:05 +00:00
Michał Kępień
41de9ad84a Set up release notes for BIND 9.17.16 2021-06-23 12:56:35 +02:00
Michał Kępień
b16f9d5f0e Update BIND version to 9.17.15 2021-06-23 12:56:35 +02:00
Michał Kępień
eeb626d75c Add CHANGES annotations 2021-06-23 12:56:35 +02:00
Michał Kępień
0a75cd47bb Merge branch 'michal/prepare-documentation-for-bind-9.17.15' into 'v9_17_15-release'
Prepare documentation for BIND 9.17.15

See merge request isc-private/bind9!304
2021-06-23 12:56:35 +02:00
Michał Kępień
7b7dea04a3 Prepare release notes for BIND 9.17.15 2021-06-23 12:56:35 +02:00
Michał Kępień
7bfedd8c73 Tweak and reword release notes 2021-06-23 12:56:35 +02:00
Michał Kępień
4e3a5c83fe Tweak and reword recent CHANGES entries 2021-06-23 12:56:35 +02:00
Ondřej Surý
b813ea196a Merge branch '2788-use-tolower-toupper-isupper-from-ctype-h' into 'main'
Use tolower(), toupper() and isupper() from ctype.h

Closes #2788

See merge request isc-projects/bind9!5209
2021-06-23 09:45:28 +00:00
Ondřej Surý
7ccbe52060 Use POSIX tolower(), toupper() and isupper() functions
In the code that rdataset_setownercase() and rdataset_getownercase() we
now use tolower()/toupper()/isupper() functions appropriately instead of
rolling our own code.
2021-06-23 11:12:00 +02:00
Ondřej Surý
0d35b3f1a9 Don't set locale globally, just use it when needed
Previously, we would set the locale on a global level and that could
possibly lead to different behaviour in underlying functions.  In this
commit, we change to code to use the system locale only when calling the
libidn2 functions and reset the locale back to "POSIX" when exiting the
libidn2 code.
2021-06-23 11:12:00 +02:00
Michał Kępień
7e9e0ae195 Merge branch '1802-improve-description-of-mirror-zone-validation' into 'main'
Improve description of mirror zone validation

Closes #1802

See merge request isc-projects/bind9!5207
2021-06-22 20:53:48 +00:00
Michał Kępień
d877aa9adf Improve description of mirror zone validation
Expand the description of mirror zones in the ARM by adding a brief
discussion of how the validation process works for AXFR and IXFR.  Move
the paragraph mentioning the "file" option higher up.  Apply minor
stylistic and whitespace-related tweaks to the relevant section of the
ARM.
2021-06-22 22:49:36 +02:00
Michał Kępień
2fcd63cb35 Merge branch '2784-improve-descriptions-of-buffering-related-options' into 'main'
Improve descriptions of buffering-related options

Closes #2784

See merge request isc-projects/bind9!5215
2021-06-22 20:31:59 +00:00
Michał Kępień
a43cafe77d Tweak descriptions of buffering-related options
Apply minor stylistical and whitespace-related tweaks to the
descriptions of the "tcp-receive-buffer", "udp-receive-buffer",
"tcp-send-buffer", and "udp-send-buffer" options in the ARM.
2021-06-22 22:26:46 +02:00
Michał Kępień
3ee62883e3 Fix typos in buffering-related option names
The ARM contains typos in the names of the following two options:

  - "tcp-receive-buffer"
  - "udp-receive-buffer"

Fix the ARM so that it contains proper option names.
2021-06-22 22:26:46 +02:00
Michał Kępień
61bbfe208e Merge branch '2279-expand-description-of-the-max-cache-size-option' into 'main'
Expand description of the "max-cache-size" option

Closes #2279

See merge request isc-projects/bind9!5173
2021-06-22 19:37:59 +00:00
Petr Špaček
a67ceb8dda Rework description of the "max-cache-size" option
Improve the description of the "max-cache-size" option in the ARM by
focusing on its meaning for multiple views and default values.
Add mention of a hash table preallocation.
2021-06-22 21:33:08 +02:00
Artem Boldariev
4b813a80d6 Merge branch '2787-assertion-failure-handling-non-zero-opcodes-in-dot-and-doh' into 'main'
Replace netmgr per-protocol sequential function with a common one

Closes #2787

See merge request isc-projects/bind9!5208
2021-06-22 14:45:23 +00:00
Ondřej Surý
dd0e3b0213 Add CHANGES and release notes for [GL #2787] 2021-06-22 17:23:02 +03:00
Artem Boldariev
ef9f09252c System tests to check named behaviour for unexpected opcodes
This commit adds a set of tests to verify that BIND will not crash
when some opcodes are sent over DoT or DoH, leading to marking network
handle in question as sequential.
2021-06-22 17:21:44 +03:00
Ondřej Surý
ec86759401 Replace netmgr per-protocol sequential function with a common one
Previously, each protocol (TCPDNS, TLSDNS) has specified own function to
disable pipelining on the connection.  An oversight would lead to
assertion failure when opcode is not query over non-TCPDNS protocol
because the isc_nm_tcpdns_sequential() function would be called over
non-TCPDNS socket.  This commit removes the per-protocol functions and
refactors the code to have and use common isc_nm_sequential() function
that would either disable the pipelining on the socket or would handle
the request in per specific manner.  Currently it ignores the call for
HTTP sockets and causes assertion failure for protocols where it doesn't
make sense to call the function at all.
2021-06-22 17:21:44 +03:00
Michał Kępień
48256df57c Merge branch '2777-use-minimal-sized-caches-for-non-recursive-views' into 'main'
Use minimal-sized caches for non-recursive views

Closes #2777

See merge request isc-projects/bind9!5189
2021-06-22 13:31:03 +00:00
Michał Kępień
f9500f824d Add CHANGES entry 2021-06-22 15:28:31 +02:00
Michał Kępień
86698ded32 Hardcode "max-cache-size" for the "_bind" view
The built-in "_bind" view does not allow recursion and therefore does
not need a large cache database.  However, as "max-cache-size" is not
explicitly set for that view in the default configuration, it inherits
that setting from global options.  Set "max-cache-size" for the built-in
"_bind" view to a fixed value (2 MB, i.e. the smallest allowed value) to
prevent needlessly preallocating memory for its cache RBT hash table.
2021-06-22 15:28:31 +02:00
Michał Kępień
86541b39d3 Use minimal-sized caches for non-recursive views
Currently the implicit default for the "max-cache-size" option is "90%".
As this option is inherited by all configured views, using multiple
views can lead to memory exhaustion over time due to overcommitment.
The "max-cache-size 90%;" default also causes cache RBT hash tables to
be preallocated for every configured view, which does not really make
sense for views which do not allow recursion.

To limit this problem's potential for causing operational issues, use a
minimal-sized cache for views which do not allow recursion and do not
have "max-cache-size" explicitly set (either in global configuration or
in view configuration).

For configurations which include multiple views allowing recursion,
adjusting "max-cache-size" appropriately is still left to the operator.
2021-06-22 15:28:31 +02:00
Matthijs Mekking
a02710a476 Merge branch '2783-in-view-dnssec-policy-deadlock' into 'main'
Fix in-view /w dnssec-policy deadlock at startup

Closes #2783

See merge request isc-projects/bind9!5202
2021-06-22 07:23:59 +00:00
Matthijs Mekking
dae42dc9d4 Add changes and notes for [#2783] 2021-06-22 09:04:11 +02:00
Matthijs Mekking
42c601ae14 Fix deadlock issue with key-directory and in-view
When locking key files for a zone, we iterate over all the views and
lock a mutex inside the zone structure. However, if we envounter an
in-view zone, we will try to lock the key files twice, one time for
the home view and one time for the in-view view. This will lead to
a deadlock because one thread is trying to get the same lock twice.
2021-06-22 09:04:11 +02:00
Matthijs Mekking
acd83881ff Add test case for in-view with dnssec-policy
Add a test case for a zone that uses 'in-view' and 'dnssec-policy'.
BIND should not deadlock.
2021-06-21 16:03:35 +02:00
Mark Andrews
fb335e4b47 Merge branch '2778-unique-key-directories-reported-as-reused-in-9-16-17-regression-vs-9-16-16' into 'main'
Resolve "Unique key directories reported as reused in 9.16.17, regression vs 9.16.16"

Closes #2778

See merge request isc-projects/bind9!5195
2021-06-18 07:21:27 +00:00
Mark Andrews
85033788d3 Add release note for [GL #2778] 2021-06-18 16:46:02 +10:00
Mark Andrews
bd1419a9e8 Add CHANGES for [GL #2778] 2021-06-18 16:46:02 +10:00
Mark Andrews
d1e283ede1 Checking of key-directory and dnssec-policy was broken
the checks failed to account for key-directory being inheritable.
2021-06-18 16:46:02 +10:00
Mark Andrews
721237efb3 Merge branch '2779-name-in-answer-doesn-t-match-the-name-in-query' into 'main'
Resolve "name in answer doesn't match the name in query"

Closes #2779

See merge request isc-projects/bind9!5194
2021-06-18 06:27:22 +00:00
Mark Andrews
7372e9a60d Add release note for [GL #2779] 2021-06-18 15:51:37 +10:00
Mark Andrews
8c60debc18 Add CHANGES note for [GL #2779] 2021-06-18 15:51:37 +10:00
Mark Andrews
c65dc2f7dc Check wild card expansions by code point 2021-06-18 15:51:36 +10:00
Mark Andrews
08eeebb6a7 Add w and W to maptoupper and maptolower tables 2021-06-18 11:29:45 +10:00
Michal Nowak
7abde2c1d7 Merge branch 'mnowak/alpine-3.14' into 'main'
Add Alpine Linux 3.14

See merge request isc-projects/bind9!5183
2021-06-17 16:17:06 +00:00
Michal Nowak
80f828bc37 Add Alpine Linux 3.14 2021-06-17 18:16:00 +02:00
Michał Kępień
992b900557 Merge branch '2770-allow-hash-tables-for-cache-rbts-to-be-grown' into 'main'
Allow hash tables for cache RBTs to be grown

Closes #2770

See merge request isc-projects/bind9!5172
2021-06-17 15:16:38 +00:00
Michał Kępień
0c59f1362c Add CHANGES entry 2021-06-17 17:09:37 +02:00
Michał Kępień
6b77583f54 Allow resetting hash table size limits for DNS DBs
When "max-cache-size" is changed to "unlimited" (or "0") for a running
named instance (using "rndc reconfig"), the hash table size limit for
each affected cache DB is not reset to the maximum possible value,
preventing those hash tables from being allowed to grow as a result of
new nodes being added.

Extend dns_rbt_adjusthashsize() to interpret "size" set to 0 as a signal
to remove any previously imposed limits on the hash table size.  Adjust
API documentation for dns_db_adjusthashsize() accordingly.  Move the
call to dns_db_adjusthashsize() from dns_cache_setcachesize() so that it
also happens when "size" is set to 0.
2021-06-17 17:09:37 +02:00
Michał Kępień
c096f91451 Allow hash tables for cache RBTs to be grown
Upon creation, each dns_rbt_t structure has its "maxhashbits" field
initialized to the value of the RBT_HASH_MAX_BITS preprocessor macro,
i.e. 32.  When the dns_rbt_adjusthashsize() function is called for the
first time for a given RBT (for cache RBTs, this happens when they are
first created, i.e. upon named startup), it lowers the value of the
"maxhashbits" field to the number of bits required to index the
requested number of hash table slots.  When a larger hash table size is
subsequently requested, the value of the "maxhashbits" field should be
increased accordingly, up to RBT_HASH_MAX_BITS.  However, the loop in
the rehash_bits() function currently ensures that the number of bits
necessary to index the resized hash table will not be larger than
rbt->maxhashbits instead of RBT_HASH_MAX_BITS, preventing the hash table
from being grown once the "maxhashbits" field of a given dns_rbt_t
structure is set to any value lower than RBT_HASH_MAX_BITS.

Fix by tweaking the loop guard condition in the rehash_bits() function
so that it compares the new number of bits used for indexing the hash
table against RBT_HASH_MAX_BITS rather than rbt->maxhashbits.
2021-06-17 17:09:37 +02:00
Michał Kępień
64acd7c8c8 Merge branch '2763-increase-timeout-in-the-rndc-deadlock-test' into 'main'
Increase timeout in the rndc deadlock test

Closes #2763

See merge request isc-projects/bind9!5163
2021-06-17 10:40:31 +00:00
Michał Kępień
ac4c58e8ce Increase timeout in the rndc deadlock test
The timeout originally picked for "rndc status" invocations (2 seconds)
in the test attempting to reproduce a deadlock caused by running
multiple "rndc addzone", "rndc modzone", and "rndc delzone" commands
concurrently causes intermittent failures of the "addzone" system test
in GitLab CI.  Increase the timeout to 10 seconds to make such failures
less probable.  Adjust code comments accordingly.
2021-06-17 12:39:32 +02:00
Ondřej Surý
023fcf3365 Merge branch 'ondrej/fix-some-spelling' into 'main'
Fix various typos in the documentation

See merge request isc-projects/bind9!4498
2021-06-17 09:39:15 +00:00
Ondřej Surý
4ab9bb63ee Fix various typos in the documentation
Generally, the issues fixed here are missing articles, wrong articles
and double articles.  We especially like "the the".
2021-06-17 11:32:04 +02:00
Ondřej Surý
2cd6ec4857 Merge branch '2606-remove-support-for-builtin-atomics-on-legacy-clang-compilers' into 'main'
Resolve "Remove support for builtin atomics on legacy clang compilers"

Closes #2606

See merge request isc-projects/bind9!4854
2021-06-17 08:52:10 +00:00
Diego Fronza
20e968b70c Add CHANGES note for [GL #2606] 2021-06-17 09:51:05 +02:00
Ondřej Surý
54c389dbc0 Drop support for clang atomic and gcc __sync builtins
The requirements for BIND 9.17+ now requires C11 support from the
compiler, so we can safely drop most of the stdatomic.h shims from
lib/isc/unix/include/stdatomic.h.

This commit removes support for clang atomic builtins (clang >= 3.6.0
includes stdatomic.h header) and for Gcc __sync builtins.

The only compatibility shim that remains is support for __atomic
builtins for Gcc >= 4.7.0 since CentOS 7 still includes only Gcc 4.8.1
and the proper stdatomic.h header was only introduced in Gcc >= 4.9.
2021-06-17 09:51:04 +02:00
Ondřej Surý
4677bb28d1 Remove atomics emulated by a mutex-locked variable
Mutex atomics were intended to be used as a debugging tool only
and it has already served its purpose and it's not needed anymore.
2021-06-17 09:51:04 +02:00
Michał Kępień
aa626c6499 Merge branch 'v9_17_14-release' into 'main'
Merge 9.17.14 release branch

See merge request isc-projects/bind9!5186
2021-06-16 20:24:43 +00:00
Michał Kępień
f9e8c8057d Set up release notes for BIND 9.17.15 2021-06-16 22:18:12 +02:00
Michał Kępień
7e0e2dd667 Update BIND version to 9.17.14 2021-06-16 22:18:12 +02:00
Michał Kępień
2f3b74dec9 Add a CHANGES marker 2021-06-16 22:18:12 +02:00
Michał Kępień
1408f3572d Merge branch 'michal/prepare-documentation-for-bind-9.17.14' into 'v9_17_14-release'
Prepare documentation for BIND 9.17.14

See merge request isc-private/bind9!298
2021-06-16 22:18:12 +02:00
Michał Kępień
652d4a74fe Prepare release notes for BIND 9.17.14 2021-06-16 22:18:12 +02:00
Michał Kępień
54842d6349 Reorder release notes 2021-06-16 22:18:12 +02:00
Michał Kępień
451b29cbbf Tweak and reword release notes 2021-06-16 22:18:12 +02:00
Michał Kępień
59a9fa4863 Tweak and reword recent CHANGES entries 2021-06-16 22:18:12 +02:00
Michał Kępień
0439e92fa0 Remove leftover release note for GL #2603 2021-06-16 22:18:12 +02:00
Artem Boldariev
3549eed088 Merge branch 'artem/doh-memmove-null-asan-fix' into 'main'
Fix undefined behaviour in DoH (passing NULL to memmove())

See merge request isc-projects/bind9!5182
2021-06-16 15:51:02 +00:00
Artem Boldariev
dc356bb196 Fix ASAN error in DoH (passing NULL to memmove())
The warning was produced by an ASAN build:

runtime error: null pointer passed as argument 2, which is declared to
never be null

This commit fixes it by checking if nghttp2_session_mem_send() has
actually returned anything.
2021-06-16 17:46:10 +03:00
Mark Andrews
629d8a3096 Merge branch '2755-bad-tkey-samples-in-genzone-sh-comment' into 'main'
Resolve "Bad TKEY samples in genzone.sh comment"

Closes #2755

See merge request isc-projects/bind9!5152
2021-06-16 05:54:30 +00:00
Mark Andrews
47ca495108 make it clear algorithm field is a domain name 2021-06-16 05:26:00 +00:00
Mark Andrews
f035a22c42 Merge branch '2739-threadsanitizer-data-race-lib-isc-task-c-435-in-task_send-unprotected-access-to-task-threadid' into 'main'
Resolve "ThreadSanitizer: data race lib/isc/task.c:435 in task_send (unprotected access to `task->threadid`)"

Closes #2739

See merge request isc-projects/bind9!5149
2021-06-15 00:39:03 +00:00
Mark Andrews
234ad2d075 Lock access to task->threadid 2021-06-15 00:01:58 +00:00
Artem Boldariev
8d36cac81a Merge branch 'artem/dig-large-doh-responses-support' into 'main'
Fix BIND and dig to support large DNS messages over DoH, disable XFRs over DoH

See merge request isc-projects/bind9!5148
2021-06-14 09:22:40 +00:00
Evan Hunt
f8caebe152 CHANGES
Mention that XFRs over DoH are explicitly disabled for now.
2021-06-14 11:38:35 +03:00
Artem Boldariev
ccd2267b1c Set sock->iface and sock->peer properly for layered connection types
This change sets the mentioned fields properly and gets rid of klusges
added in the times when we were keeping pointers to isc_sockaddr_t
instead of copies. Among other things it helps to avoid a situation
when garbage instead of an address appears in dig output.
2021-06-14 11:37:36 +03:00
Artem Boldariev
b84fa122ce Make BIND refuse to serve XFRs over DoH
We cannot use DoH for zone transfers.  According to RFC8484 a DoH
request contains exactly one DNS message (see Section 6: Definition of
the "application/dns-message" Media Type,
https://datatracker.ietf.org/doc/html/rfc8484#section-6).  This makes
DoH unsuitable for zone transfers as often (and usually!) these need
more than one DNS message, especially for larger zones.

As zone transfers over DoH are not (yet) standardised, nor discussed
in RFC8484, the best thing we can do is to return "not implemented."

Technically DoH can be used to transfer small zones which fit in one
message, but that is not enough for the generic case.

Also, this commit makes the server-side DoH code ensure that no
multiple responses could be attempted to be sent over one HTTP/2
stream. In HTTP/2 one stream is mapped to one request/response
transaction. Now the write callback will be called with failure error
code in such a case.
2021-06-14 11:37:36 +03:00
Artem Boldariev
009752cab0 Pass an HTTP handle to the read callback when finishing a stream
This commit fixes a leftover from an earlier version of the client-side
DoH code when the underlying transport handle was used directly.
2021-06-14 11:37:36 +03:00
Artem Boldariev
d5d20cebb2 Fix a crash in the client-side DoH code (header processing callback)
Support a situation in header processing callback when client side
code could receive a belated response or part of it. That could
happen when the HTTP/2 session was already closed, but there were some
response data from server in flight. Other client-side nghttp2
callbacks code already handled this case.

The bug became apparent after HTTP/2 write buffering was supported,
leading to rare unit test failures.
2021-06-14 11:37:33 +03:00
Artem Boldariev
2dfc0d9afc Nullify connect.cstream in time and keep track of all client streams
This commit ensures that sock->h2.connect.cstream gets nullified when
the object in question is deleted. This fixes a nasty crash in dig
exposed when receiving large responses leading to double free()ing.

Also, it refactors how the client-side code keeps track of client
streams (hopefully) preventing from similar errors appearing in the
future.
2021-06-14 11:37:29 +03:00
Artem Boldariev
5b507c1136 Fix BIND to serve large HTTP responses
This commit makes NM code to report HTTP as a stream protocol. This
makes it possible to handle large responses properly. Like:

dig +https @127.0.0.1 A cmts1-dhcp.longlines.com
2021-06-14 11:37:17 +03:00
Ondřej Surý
b68121adbf Merge branch 'ondrej/bump-clang-dependency-to-llvm-12' into 'main'
Change the LLVM tools version to 12

See merge request isc-projects/bind9!5174
2021-06-13 08:51:12 +00:00
Ondřej Surý
b3de93e54c Update the source code formatting using clang-format-12
clang-format now tries to keep the type-cast on the same line as the
variable.  Update the formatting.
2021-06-13 08:46:28 +02:00
Ondřej Surý
9f7855322c Change the LLVM tools version to 12
LLVM 12 stable was released on 15. April 2021, change the default
version to the current stable.
2021-06-12 08:56:37 +02:00
Michał Kępień
e5673b89e3 Merge branch '2759-fix-no-ds-proofs-for-wildcard-cname-delegations' into 'main'
Fix "no DS" proofs for wildcard+CNAME delegations

Closes #2759

See merge request isc-projects/bind9!5155
2021-06-10 08:37:37 +00:00
Michał Kępień
16708682ad Add release note 2021-06-10 10:13:23 +02:00
Michał Kępień
c223d81691 Add CHANGES entry 2021-06-10 10:13:23 +02:00
Michał Kępień
7a87bf468b Fix "no DS" proofs for wildcard+CNAME delegations
When answering a query requires wildcard expansion, the AUTHORITY
section of the response needs to include NSEC(3) record(s) proving that
the QNAME does not exist.

When a response to a query is an insecure delegation, the AUTHORITY
section needs to include an NSEC(3) proof that no DS record exists at
the parent side of the zone cut.

These two conditions combined trip up the NSEC part of the logic
contained in query_addds(), which expects the NS RRset to be owned by
the first name found in the AUTHORITY section of a delegation response.
This may not always be true, for example if wildcard expansion causes an
NSEC record proving QNAME nonexistence to be added to the AUTHORITY
section before the delegation is added to the response.  In such a case,
named incorrectly omits the NSEC record proving nonexistence of QNAME
from the AUTHORITY section.

The same block of code is affected by another flaw: if the same NSEC
record proves nonexistence of both the QNAME and the DS record at the
parent side of the zone cut, this NSEC record will be added to the
AUTHORITY section twice.

Fix by looking for the NS RRset in the entire AUTHORITY section and
adding the NSEC record to the delegation using query_addrrset() (which
handles duplicate RRset detection).
2021-06-10 10:13:23 +02:00
Michał Kępień
26ec4b9a89 Add AUTHORITY tests for CNAME-sourced delegations
Add a set of system tests which check the contents of the AUTHORITY
section for signed, insecure delegation responses constructed from CNAME
records and wildcards, both for zones using NSEC and NSEC3.
2021-06-10 10:13:23 +02:00
Michał Kępień
439efc6e55 Merge branch 'michal/fix-the-variable-checked-by-a-post-load-assertion' into 'main'
Fix the variable checked by a post-load assertion

See merge request isc-projects/bind9!5164
2021-06-10 08:03:50 +00:00
Mark Andrews
098639dc59 Fix the variable checked by a post-load assertion
Instead of checking the value of the variable modified two lines earlier
(the number of SOA records present at the apex of the old version of the
zone), one of the RUNTIME_CHECK() assertions in zone_postload() checks
the number of SOA records present at the apex of the new version of the
zone, which is already checked before.  Fix the assertion by making it
check the correct variable.
2021-06-10 10:01:34 +02:00
Michał Kępień
9ec886bc53 Merge branch 'michal/update-release-checklist' into 'main'
Update release checklist

See merge request isc-projects/bind9!5165
2021-06-10 06:58:54 +00:00
Michał Kępień
d0886bd9c3 Update release checklist
Add two items to the release checklist to ensure that the start and the
end of the code freeze for each release cycle is announced on
Mattermost.
2021-06-10 08:49:38 +02:00
Mark Andrews
b3ef45127b Merge branch '2760-db-unit-test-failure' into 'main'
Resolve "db unit test failure"

Closes #2760

See merge request isc-projects/bind9!5156
2021-06-09 22:29:46 +00:00
Mark Andrews
2bc454dc2d Adjust acceptable count values
usleep(100000) can be slightly less than 10ms so allow the count
to reach 11.
2021-06-09 22:05:55 +00:00
Mark Andrews
efacee3d09 Merge branch '2720-threadsanitizer-data-race-lib-isc-unix-time-c-110-in-isc_time_isepoch' into 'main'
Resolve "ThreadSanitizer: data race lib/isc/unix/time.c:110 in isc_time_isepoch"

Closes #2720

See merge request isc-projects/bind9!5124
2021-06-09 13:51:10 +00:00
Mark Andrews
3d66e97a28 Address race between zone_settimer and set_key_expiry_warning by
adding missing lock.

    WARNING: ThreadSanitizer: data race
    Read of size 4 at 0x000000000001 by thread T1 (mutexes: read M1, write M2):
    #0 isc_time_isepoch lib/isc/unix/time.c:110
    #1 zone_settimer lib/dns/zone.c:14649
    #2 dns_zone_maintenance lib/dns/zone.c:6281
    #3 dns_zonemgr_forcemaint lib/dns/zone.c:18190
    #4 view_loaded server.c:9654
    #5 call_loaddone lib/dns/zt.c:301
    #6 doneloading lib/dns/zt.c:575
    #7 zone_asyncload lib/dns/zone.c:2259
    #8 task_run lib/isc/task.c:845
    #9 isc_task_run lib/isc/task.c:938
    #10 isc__nm_async_task lib/isc/netmgr/netmgr.c:855
    #11 process_netievent lib/isc/netmgr/netmgr.c:934
    #12 process_queue lib/isc/netmgr/netmgr.c:1003
    #13 process_all_queues lib/isc/netmgr/netmgr.c:775
    #14 async_cb lib/isc/netmgr/netmgr.c:804
    #15 <null> <null>
    #16 isc__trampoline_run lib/isc/trampoline.c:191
    #17 <null> <null>

    Previous write of size 4 at 0x000000000001 by thread T2:
    #0 isc_time_set lib/isc/unix/time.c:93
    #1 set_key_expiry_warning lib/dns/zone.c:6430
    #2 del_sigs lib/dns/zone.c:6711
    #3 zone_resigninc lib/dns/zone.c:7113
    #4 zone_maintenance lib/dns/zone.c:11111
    #5 zone_timer lib/dns/zone.c:14588
    #6 task_run lib/isc/task.c:845
    #7 isc_task_run lib/isc/task.c:938
    #8 isc__nm_async_task lib/isc/netmgr/netmgr.c:855
    #9 process_netievent lib/isc/netmgr/netmgr.c:934
    #10 process_queue lib/isc/netmgr/netmgr.c:1003
    #11 process_all_queues lib/isc/netmgr/netmgr.c:775
    #12 async_cb lib/isc/netmgr/netmgr.c:804
    #13 <null> <null>
    #14 isc__trampoline_run lib/isc/trampoline.c:191
    #15 <null> <null>

    SUMMARY: ThreadSanitizer: data race lib/isc/unix/time.c:110 in isc_time_isepoch
2021-06-09 13:31:05 +00:00
Ondřej Surý
0f47ad87c2 Merge branch '2690-remove-windows-support-for-bind-9-17-9-18' into 'main'
Completely remove BIND 9 Windows support

Closes #2690

See merge request isc-projects/bind9!5073
2021-06-09 12:59:33 +00:00
Ondřej Surý
0b5f205b57 Add CHANGES and release note for GL #2690 2021-06-09 14:35:35 +02:00
Ondřej Surý
440fb3d225 Completely remove BIND 9 Windows support
The Windows support has been completely removed from the source tree
and BIND 9 now no longer supports native compilation on Windows.

We might consider reviewing mingw-w64 port if contributed by external
party, but no development efforts will be put into making BIND 9 compile
and run on Windows again.
2021-06-09 14:35:14 +02:00
Matthijs Mekking
ad130e4509 Merge branch '2725-nsec3param-changes-on-restart' into 'main'
Fix NSEC3 resalt on restart

Closes #2725

See merge request isc-projects/bind9!5126
2021-06-09 08:29:51 +00:00
Matthijs Mekking
d51aed7112 Add release note and change entry for [#2725] 2021-06-09 09:14:51 +02:00
Matthijs Mekking
0ae3ffdc1c Fix NSEC3 resalting upon restart
When named restarts, it will examine signed zones and checks if the
current denial of existence strategy matches the dnssec-policy. If not,
it will schedule to create a new NSEC(3) chain.

However, on startup the zone database may not be read yet, fooling
BIND that the denial of existence chain needs to be created. This
results in a replacement of the previous NSEC(3) chain.

Change the code such that if the NSEC3PARAM lookup failed (the result
did not return in ISC_R_SUCCESS or ISC_R_NOTFOUND), we will try
again later. The nsec3param structure has additional variables to
signal if the lookup is postponed. We also need to save the signal
if an explicit resalt was requested.

In addition to the two added boolean variables, we add a variable to
store the NSEC3PARAM rdata. This may have a yet to be determined salt
value. We can't create the private data yet because there may be a
mismatch in salt length and the NULL salt value.
2021-06-09 09:14:09 +02:00
Matthijs Mekking
08a9e7add1 Add test for NSEC3PARAM not changed after restart
Add a test case where 'named' is restarted and ensure that an already
signed zone does not change its NSEC3 parameters.

The test case first tests the current zone and saves the used salt
value. Then after restart it checks if the salt (and other parameters)
are the same as before the restart.

This test case changes 'set_nsec3param'. This will now reset the salt
value, and when checking for NSEC3PARAM we will store the salt and
use it when testing the NXDOMAIN response. This does mean that for
every test case we now have to call 'set_nsec3param' explicitly (and
can not omit it because it is the same as the previous zone).

Finally, slightly changed some echo output to make debugging friendlier.
2021-06-09 09:14:09 +02:00
Ondřej Surý
be01f589d9 Merge branch '2732-pause-the-dbiterator-in-dumptostream' into 'main'
Pause the dbiterator when dumping the zone to the disk

Closes #2732

See merge request isc-projects/bind9!5150
2021-06-04 09:05:52 +00:00
Ondřej Surý
7e59b8a4a1 Pause the dbiterator when dumping the zone to the disk
When we rewrote the zone dumping to use the separate threadpool, the
dumping would acquire the read lock for the whole time the zone dumping
process is dumping the zone.

When combined with incoming IXFR that tries to acquire the write lock on
the same rwlock, we would end up blocking all the other readers.

In this commit, we pause the dbiterator every time we get next record
and before start dumping it to the disk.
2021-06-04 08:25:05 +00:00
Mark Andrews
7fef01201d Merge branch '2751-serve-stale-tests-false-negative' into 'main'
Resolve "serve-stale tests false negative"

Closes #2751

See merge request isc-projects/bind9!5143
2021-06-03 08:40:38 +00:00
Mark Andrews
af95cb8ccc Address test race condition in serve-stale
the dig.out.test# files could still be being written when the
content greps where being made.
2021-06-03 18:20:14 +10:00
Mark Andrews
d242ccfbdf Merge branch '2750-provide-more-insight-into-why-the-timer_test-is-failing' into 'main'
Resolve "Provide more insight into why the timer_test is failing."

Closes #2750

See merge request isc-projects/bind9!5142
2021-06-03 07:31:26 +00:00
Mark Andrews
66d1df57cb Report which assertion failed when calling set_global_error 2021-06-03 11:55:31 +10:00
Mark Andrews
5bd7caba9c Merge branch '2724-statschannel-system-test-sometimes-hangs' into 'main'
Resolve "statschannel system test sometimes hangs"

Closes #2724

See merge request isc-projects/bind9!5123
2021-06-02 22:37:10 +00:00
Mark Andrews
02726cb66e Add timeout to url get requests
to prevent the system test taking forever on failures.
2021-06-02 22:18:21 +00:00
Ondřej Surý
0dded90ae4 Merge branch '2746-fix-the-typo-in-setsockopt_off' into 'main'
Fix copy&paste error in setsockopt_off

Closes #2746

See merge request isc-projects/bind9!5138
2021-06-02 16:09:48 +00:00
Ondřej Surý
22aa929aac Add CHANGES and release note for [GL #2746] 2021-06-02 17:47:14 +02:00
Ondřej Surý
f14d870d15 Fix copy&paste error in setsockopt_off
Because of copy&paste error the setsockopt_off macro would enable
the socket option instead of disabling it.
2021-06-02 17:47:14 +02:00
Michał Kępień
5e1a48a605 Merge branch '2540-check-dname-resolution-via-itself' into 'main'
Check DNAME resolution via itself

Closes #2540

See merge request isc-projects/bind9!5135
2021-06-02 12:49:05 +00:00
Mark Andrews
cbdea694e8 Check DNAME resolution via itself 2021-06-02 14:20:35 +02:00
Michał Kępień
715dc196e2 Merge branch '2467-add-a-system-test-checking-a-malformed-ixfr' into 'main'
Add a system test checking a malformed IXFR

Closes #2467

See merge request isc-projects/bind9!5132
2021-06-02 11:35:55 +00:00
Mark Andrews
5547003a3d Add a system test checking a malformed IXFR
Make sure an incoming IXFR containing an SOA record which is not placed
at the apex of the transferred zone does not result in a broken version
of the zone being served by named and/or a subsequent crash.
2021-06-02 13:15:25 +02:00
Ondřej Surý
c70d9c4e9a Merge branch 'ondrej/fix-uv_udp_connect-detection' into 'main'
Cleanup the remaining of HAVE_UV_<func> macros

See merge request isc-projects/bind9!5127
2021-06-02 09:56:20 +00:00
Ondřej Surý
67afea6cfc Cleanup the remaining of HAVE_UV_<func> macros
While cleaning up the usage of HAVE_UV_<func> macros, we forgot to
cleanup the HAVE_UV_UDP_CONNECT in the actual code and
HAVE_UV_TRANSLATE_SYS_ERROR and this was causing Windows build to fail
on uv_udp_send() because the socket was already connected and we were
falsely assuming that it was not.

The platforms with autoconf support were not affected, because we were
still checking for the functions from the configure.
2021-06-02 11:23:36 +02:00
Ondřej Surý
479dc58877 Merge branch 'ondrej/add-libnghttp2-dev-to-lgtm.yml' into 'main'
Add libnghttp2-dev to .lgtm.yml

See merge request isc-projects/bind9!5125
2021-06-02 07:35:39 +00:00
Ondřej Surý
d67e16ae3c Add libnghttp2-dev to .lgtm.yml
The LGTM.com configuration was missing required library, so the
"Extraction" step of the analysis was failing.
2021-06-02 09:33:27 +02:00
Artem Boldariev
2fc89e0353 Merge branch 'artem-http-write-buffering' into 'main'
HTTP/2 write buffering

See merge request isc-projects/bind9!5121
2021-06-01 18:28:34 +00:00
Artem Boldariev
35d0027f36 HTTP/2 write buffering
This commit adds the ability to consolidate HTTP/2 write requests if
there is already one in flight. If it is the case, the code will
consolidate multiple subsequent write request into a larger one
allowing to utilise the network in a more efficient way by creating
larger TCP packets as well as by reducing TLS records overhead (by
creating large TLS records instead of multiple small ones).

This optimisation is especially efficient for clients, creating many
concurrent HTTP/2 streams over a transport connection at once.  This
way, the code might create a small amount of multi-kilobyte requests
instead of many 50-120 byte ones.

In fact, it turned out to work so well that I had to add a work-around
to the code to ensure compatibility with the flamethrower, which, at
the time of writing, does not support TLS records larger than two
kilobytes. Now the code tries to flush the write buffer after 1.5
kilobyte, which is still pretty adequate for our use case.

Essentially, this commit implements a recommendation given by nghttp2
library:

https://nghttp2.org/documentation/nghttp2_session_mem_send.html
2021-06-01 21:07:45 +03:00
Ondřej Surý
5a8a21a88d Merge branch '2732-zone-dumping-is-blocking-the-networking-io' into 'main'
Improve the zone dumping impact on the networking

Closes #2732

See merge request isc-projects/bind9!5107
2021-05-31 13:51:48 +00:00
Ondřej Surý
3e433b87fb Add CHANGES and release note for [GL #2732] 2021-05-31 14:52:05 +02:00
Ondřej Surý
e83b6569da Indicate to the kernel that we won't be needing the zone dumps
Add a call to posix_fadvise() to indicate to the kernel, that `named`
won't be needing the dumped zone files any time soon with:

 * POSIX_FADV_DONTNEED - The specified data will not be accessed in the
   near future.

Notes:

 POSIX_FADV_DONTNEED attempts to free cached pages associated with the
 specified region. This is useful, for example, while streaming large
 files. A program may periodically request the kernel to free cached
 data that has already been used, so that more useful cached pages are
 not discarded instead.
2021-05-31 14:52:05 +02:00
Ondřej Surý
8a5c62de83 Refactor zone dumping code to use netmgr async threadpools
Previously, dumping the zones to the files were quantized, so it doesn't
slow down network IO processing.  With the introduction of network
manager asynchronous threadpools, we can move the IO intensive work to
use that API and we don't have to quantize the work anymore as it the
file IO won't block anything except other zone dumping processes.
2021-05-31 14:52:05 +02:00
Ondřej Surý
7670f98377 Add isc_task_getnetmgr() function
Add a function to pull the attached netmgr from inside the executed
task.  This is needed for any task that needs to call the netmgr API.
2021-05-31 14:52:05 +02:00
Ondřej Surý
87fe97ed91 Add asynchronous work API to the network manager
The libuv has a support for running long running tasks in the dedicated
threadpools, so it doesn't affect networking IO.

This commit adds isc_nm_work_enqueue() wrapper that would wraps around
the libuv API and runs it on top of associated worker loop.

The only limitation is that the function must be called from inside
network manager thread, so the call to the function should be wrapped
inside a (bound) task.
2021-05-31 14:52:05 +02:00
Ondřej Surý
211bfefbaa Use UV_VERSION_HEX to decide whether we need libuv shim functions
Instead of having a configure check for every missing function that has
been added in later version of libuv, we now use UV_VERSION_HEX to
decide whether we need the shim or not.
2021-05-31 14:52:05 +02:00
Ondřej Surý
7477d1b2ed Add uv_os_getenv() and uv_os_setenv() compatibility shims
The uv_os_getenv() and uv_os_setenv() functions were introduced in the
libuv >= 1.12.0.  Add simple compatibility shims for older versions.
2021-05-31 14:52:05 +02:00
Ondřej Surý
f752840db3 Add uv_req_get_data() and uv_req_set_data() compatibility shims
The uv_req_get_data() and uv_req_set_data() functions were introduced in
libuv >= 1.19.0, so we need to add compatibility shims with older libuv
versions.
2021-05-31 14:52:05 +02:00
Ondřej Surý
7b02848865 Cleanup the uv_import check
The uv_import() is not needed anymore, so we can remove the autoconf
check for it.
2021-05-31 14:52:05 +02:00
Michał Kępień
db8ff45f0b Merge branch 'michal/regenerate-man-pages-with-docutils-0.16' into 'main'
Regenerate man pages with docutils 0.16

See merge request isc-projects/bind9!5119
2021-05-31 12:34:45 +00:00
Michał Kępień
6a2daddf5b Regenerate man pages with docutils 0.16
Commit bdb777b2a2 updated the man pages
to contents produced using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.17.1

However, sphinx-rtd-theme 0.5.2 is incompatible with versions 0.17+ of
the docutils package.  This problem was addressed in the Docker image
used for building man pages by downgrading the docutils package to
version 0.16.

Regenerate the man pages again, this time using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.16

This is necessary to prevent the "docs" GitLab CI job from failing.
2021-05-31 11:22:52 +02:00
Evan Hunt
6702f23dcd Merge branch 'kchen-servestale-fix' into 'main'
Several serve-stale fixes

See merge request isc-projects/bind9!199
2021-05-30 19:28:59 +00:00
Matthijs Mekking
f7f543d99b Reuse rdatset->ttl when dumping ancient RRsets
Rather than having an expensive 'expired' (fka 'stale_ttl') in the
rdataset structure, that is only used to be printed in a comment on
ancient RRsets, reuse the TTL field of the RRset.
2021-05-30 11:48:36 -07:00
Kevin Chen
0cdf85d204 Several serve-stale improvements
Commit a83c8cb0af updated masterdump so
that stale records in "rndc dumpdb" output no longer shows 0 TTLs.  In
this commit we change the name of the `rdataset->stale_ttl` field to
`rdataset->expired` to make its purpose clearer, and set it to zero in
cases where it's unused.

Add 'rbtdb->serve_stale_ttl' to various checks so that stale records
are not purged from the cache when they've been stale for RBTDB_VIRTUAL
(300) seconds.

Increment 'ns_statscounter_usedstale' when a stale answer is used.

Note: There was a question of whether 'overmem_purge' should be
purging ancient records, instead of stale ones.  It is left as purging
stale records, since stale records could take up the majority of the
cache.

This submission is copyrighted Akamai Technologies, Inc. and provided
under an MPL 2.0 license.

This commit was originally authored by Kevin Chen, and was updated by
Matthijs Mekking to match recent serve-stale developments.
2021-05-30 11:45:35 -07:00
Evan Hunt
fc1e3efc41 Merge branch '2733-serve-stale-prefetch-crash' into 'main'
Fix crash with serve-stale in combination with prefetch

Closes #2733

See merge request isc-projects/bind9!5111
2021-05-30 07:31:38 +00:00
Matthijs Mekking
7ca253818e Add CHANGES and notes for [#2733] 2021-05-30 00:04:01 -07:00
Evan Hunt
8c047feb3a add a system test for the prefetch bug
Ensure that if prefetch is triggered as a result of a query
restart, it won't have the TRYSTALE_ONTIMEOUT flag set.
2021-05-30 00:04:01 -07:00
Matthijs Mekking
c0dc5937c7 Reset DNS_FETCHOPT_TRYSTALE_ONTIMEOUT on resume
Once we resume a query, we should clear DNS_FETCHOPT_TRYSTALE_ONTIMEOUT
from the options to prevent triggering the stale-answer-client-timeout
on subsequent fetches.

If we don't this may cause a crash when for example when prefetch is
triggered after a query restart.
2021-05-30 00:03:51 -07:00
Michal Nowak
9fbe80d646 Merge branch 'mnowak/add-fedora-34' into 'main'
Add Fedora 34

See merge request isc-projects/bind9!5075
2021-05-28 10:50:51 +00:00
Michal Nowak
5f27aaa0ff Add Fedora 34 2021-05-28 11:57:31 +02:00
Evan Hunt
5ca27cc33d Merge branch '2731-servestale-dns64' into 'main'
fix a crash when using stale data with dns64

Closes #2731

See merge request isc-projects/bind9!5102
2021-05-27 18:52:31 +00:00
Evan Hunt
d8b793760c CHANGES, release note 2021-05-27 10:37:16 -07:00
Matthijs Mekking
c64589bf46 Test with stale timeout cache miss, then fetch completes
Add a test case where a client request is received and the stale
timeout occurs, but it is not served stale data because there is no entry
in the cache, then is served an authoritative answer once the background
fetch completes. This ensures that a stale timeout only affects a
subsequent response if the client was answered.
2021-05-27 10:35:48 -07:00
Evan Hunt
8bd8e995f1 clean up query correctly if already answered by serve-stale
when a serve-stale answer has been sent, the client continues waiting
for a proper answer. if a final completion event for the client does
arrive, it can just be cleaned up without sending a response, similar
to a canceled fetch.
2021-05-27 10:35:48 -07:00
Evan Hunt
453e905d7e add a test of DNS64 processing with a stale negative response
- send a query for an AAAA which will be resolved as a mapped A
- disable authoritative responses
- wait for the negative AAAA response to become stale
- send another query, wait for the stale answer
- re-enable authorative responses so that a real answer arrives
- currently, this triggers an assertion in query.c
2021-05-27 10:33:31 -07:00
Ondřej Surý
e7f5c9582a Merge branch '2708-named-doesn-t-compile-with-gcc-10' into 'main'
Resolve "named doesn't compile with GCC 10."

Closes #2708

See merge request isc-projects/bind9!5057
2021-05-27 06:22:14 +00:00
Mark Andrews
d68b009cfe Remove priority from attribute constructor/destructor
On some platforms, the __attribute__ constructor and destructor won't
take priorities and the compilation failed.  On such platform would be
macOS.  For this reason, the constructor/destructor in the libisc was
reworked to not use priorities, but have a single constructor and
destructor that calls the appropriate routines in correct order.

This commit removes the extra priority because it's now not needed and
it also breaks a compilation on macOS with GCC 10.
2021-05-27 08:02:21 +02:00
Mark Andrews
728422d939 Merge branch '2282-shutdown-system-test-needs-to-be-tweaked-to-account-for-recent-netmgr-changes' into 'main'
Resolve ""shutdown" system test needs to be tweaked to account for recent netmgr changes"

Closes #2282

See merge request isc-projects/bind9!4923
2021-05-27 02:56:57 +00:00
Diego Fronza
b19cd2d83b Handling NoNameservers exception
In the shutdown system test multiple queries are sent to a resolver
instance, in the meantime we terminate the same resolver process for
which the queries were sent to, either via rndc stop or a SIGTERM
signal, that means the resolver may not be able to answer all those
queries, since it has initiated the shutdown process.

The dnspython library raises a dns.resolver.NoNameservers exception when
a resolver object fails to receive an answer from the specified list
of nameservers (resolver.nameservers list), we need to handle this
exception as this is something that may happen since we asked the
resolver to terminate, as a result it may not answer clients even if
an answer is available, as the operation will be canceled.
2021-05-27 12:37:49 +10:00
Ondřej Surý
91cd1ef9ff Merge branch 'ondrej/revert-OpenBSD-system-wide-connection-timeout' into 'main'
Revert "Configure the system-wide TCP connection timeout on OpenBSD"

See merge request isc-projects/bind9!5100
2021-05-26 14:24:58 +00:00
Ondřej Surý
a0f6275ef8 Revert "Configure the system-wide TCP connection timeout on OpenBSD"
This reverts commit 8ff15fc028.
2021-05-26 16:16:00 +02:00
Mark Andrews
d3a8aa4daa Merge branch 'marka-missing-initialisations' into 'main'
Add missing initialisations

See merge request isc-projects/bind9!5097
2021-05-26 08:52:46 +00:00
Mark Andrews
715a2c7fc1 Add missing initialisations
configuring with --enable-mutex-atomics flagged these incorrectly
initialised variables on systems where pthread_mutex_init doesn't
just zero out the structure.
2021-05-26 08:15:08 +00:00
Ondřej Surý
5a10cde89a Merge branch '2722-bad-sizeof-declaration-in-main' into 'main'
Fix the sizeof() for array holding the pointers to clientmgr

Closes #2722

See merge request isc-projects/bind9!5098
2021-05-26 08:10:45 +00:00
Ondřej Surý
2db5290579 Fix the sizeof() for array holding the pointers to clientmgr
The size of the array holding the pointers to clientmgr was created so
big it could hold the actual clientmgr objects, not just the pointer.
This commit fixes the size to be just the ncpus * sizeof(pointer).
2021-05-26 10:03:52 +02:00
Ondřej Surý
da282bad6a Merge branch '2721-shutdown-race-in-interfacemgr-cleanup' into 'main'
Cleanup the struct isc_nmiface

Closes #2721

See merge request isc-projects/bind9!5096
2021-05-26 08:00:25 +00:00
Ondřej Surý
a227562f13 Cleanup the struct isc_nmiface
In previous MR, I forgot to remove the `struct isc_nmiface`, this commit
rectifies that.
2021-05-26 09:55:10 +02:00
Ondřej Surý
5d325e952d Merge branch '2721-shutdown-race-in-interfacemgr' into 'main'
Make a local copy of interface address when creating new socket

Closes #2721

See merge request isc-projects/bind9!5094
2021-05-26 07:48:00 +00:00
Ondřej Surý
50270de8a0 Refactor the interface handling in the netmgr
The isc_nmiface_t type was holding just a single isc_sockaddr_t,
so we got rid of the datatype and use plain isc_sockaddr_t in place
where isc_nmiface_t was used before.  This means less type-casting and
shorter path to access isc_sockaddr_t members.

At the same time, instead of keeping the reference to the isc_sockaddr_t
that was passed to us when we start listening, we will keep a local
copy. This prevents the data race on destruction of the ns_interface_t
objects where pending nmsockets could reference the sockaddr of already
destroyed ns_interface_t object.
2021-05-26 09:43:12 +02:00
Mark Andrews
bef3a9b01f Merge branch '2685-max-ixfr-ratio-appears-to-be-forcing-axfr-very-prematurely-on-bind-9-16-15' into 'main'
Resolve "max-ixfr-ratio appears to be forcing AXFR very prematurely on BIND 9.16.15"

Closes #2685

See merge request isc-projects/bind9!5011
2021-05-25 22:46:52 +00:00
Mark Andrews
80ca95a95c Add release note for [GL #2685] 2021-05-26 08:16:35 +10:00
Mark Andrews
d99c312938 Add CHANGES note for [GL #2685] 2021-05-26 08:16:35 +10:00
Mark Andrews
0a45af2e2f Consolidate xhdr fixups 2021-05-26 08:16:35 +10:00
Mark Andrews
68d203ff1c Check that IXFR delta size is correct 2021-05-25 22:27:54 +10:00
Mark Andrews
00609f5094 Correct size calculation in dns_journal_iter_init()
* dns_journal_next() leaves the read point in the journal after the
transaction header so journal_seek() should be inside the loop.
* we need to recover from transaction header inconsistencies

Additionally when correcting for <size, serial0, serial1, 0> the
correct consistency check is isc_serial_gt() rather than
isc_serial_ge().  All instances updated.
2021-05-25 22:27:54 +10:00
Michal Nowak
b6bdeb06be Merge branch '2629-man-pages-aren-t-installed-when-building-9-17-x' into 'main'
Install man pages when sphinx-build tool is missing

Closes #2629

See merge request isc-projects/bind9!4945
2021-05-25 09:34:11 +00:00
Michal Nowak
823bf3e79b Install BIND with "make DESTDIR=<PATH> install"
BIND installation should be done by setting DESTDIR during "make
install" not by setting prefix via ./configure.

Make sure that installation with DESTDIR=<PATH> works by checking that
named binary and it's respective man page were installed and that
well-known BIND9 directories - and only them - are present in DESTDIR.

Also rename install path variable from BIND_INSTALL_PATH to
INSTALL_PATH to avoid namespace clash in stress tests which use
BIND_INSTALL_PATH variable to configure path to BIND9 binaries.
2021-05-25 11:21:33 +02:00
Michal Nowak
c0566dd8d7 Install man pages when sphinx-build tool is missing
The exclusion of doc/man/ when the sphinx-build tool is missing was
excessive as some targets in doc/man/ are necessary to install man
pages.
2021-05-25 11:21:32 +02:00
Ondřej Surý
9359e1a8c0 Merge branch 'ondrej/dont-set-mctx-name-in-resolver' into 'main'
Don't set memory context name in resolver.c

See merge request isc-projects/bind9!5090
2021-05-25 05:27:59 +00:00
Ondřej Surý
d0d37aa6d1 Don't set memory context name in resolver.c
We now attach to existing memory context instead of creating a new
memory context, so we should not set its name.
2021-05-25 07:25:44 +02:00
Ondřej Surý
a778db3b7d Merge branch 'ondrej/replace-ubuntu-xenial-with-ubuntu-bionic' into 'main'
Replace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI

See merge request isc-projects/bind9!4800
2021-05-24 19:43:15 +00:00
Ondřej Surý
4402a90bb7 Replace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI
Ubuntu 16.04 (Xenial Xerus) is reaching End of Standard Support in April
2021 thus we are removing it from the list of supported platforms and
replacing it with Ubuntu 18.04 LTS (Bionic Beaver).
2021-05-24 21:34:09 +02:00
Ondřej Surý
664d8c1d24 Merge branch '2433-reduce-clientmgr-memory-contexts-and-tasks' into 'main'
Reduce the number of clientmgr objects created

Closes #2433

See merge request isc-projects/bind9!5085
2021-05-24 19:20:15 +00:00
Ondřej Surý
a7241bb5b3 Add CHANGES and release note for GL #2433 2021-05-24 20:45:19 +02:00
Ondřej Surý
a1c6fd5ede Adjust the fillcount and freemax for dns_message mempools
According to the measurements (recorded on GL!5085), the fillcount of 2
for namepool and fillcount of 4 for rdspool can fit 99.99% of request
for tested scenarios.

This was discovered by perf recording the single second recursive test
using flamethrower where the initial malloc lit up like a flare.
2021-05-24 20:44:58 +02:00
Ondřej Surý
28b65d8256 Reduce the number of clientmgr objects created
Previously, as a way of reducing the contention between threads a
clientmgr object would be created for each interface/IP address.

We tasks being more strictly bound to netmgr workers, this is no longer
needed and we can just create clientmgr object per worker queue (ncpus).

Each clientmgr object than would have a single task and single memory
context.
2021-05-24 20:44:54 +02:00
Ondřej Surý
aad7856b8e Don't create per bucket memory contexts in resolver
Similarly, the resolver code would create hundreds of memory contexts
just on the resolver setup.  The contention will be reduced directly in
the allocator, so for now just attach to the view memory instead of
creating separate memory context for each bucket.
2021-05-24 20:02:20 +02:00
Ondřej Surý
4db5e30177 Run shutdown events with the task's existing threadid
Previously, task->threadid was reassigned to 0 while shutting
down, which caused an assertion.
2021-05-24 20:02:20 +02:00
Ondřej Surý
0be7ea78be Reduce the number of client tasks and bind them to netmgr queues
Since a client object is bound to a netmgr handle, each client
will always be processed by the same netmgr worker, so we can
simplify the code by binding client->task to the same thread as
the client. Since ns__client_request() now runs in the same event
loop as client->task events, is no longer necessary to pause the
task manager before launching them.

Also removed some functions in isc_task that were not used.
2021-05-24 20:02:20 +02:00
Ondřej Surý
c07f8c5a43 Reduce the number of tasks in the clientmgr
We now use one task per CPU per dispatchmgr (that's still a lot).
2021-05-24 20:02:20 +02:00
Ondřej Surý
0719f032e1 Reduce the number of mctx created in clientmgr
The number of memory contexts created in the clientmgr was enormous.  It
could easily create thousands of memory contexts because the formula was:

    nprotocols * ncpus * ninterfaces * CLIENT_NMCTXS_PERCPU (8)

The original goal was to reduce the contention when allocating the
memory, but after a while nobody noticed that the amount of memory
context allocated would not reduce contention at all.

This commit removes the whole mctxpool and just uses the mctx from
clientmgr as the contention will be reduced directly in the allocator.
2021-05-24 20:02:20 +02:00
Michal Nowak
9f5a7a2ca4 Merge branch 'mnowak/freebsd-13' into 'main'
Add FreeBSD 13.0

See merge request isc-projects/bind9!4814
2021-05-24 16:15:35 +00:00
Michal Nowak
83617cea9a Run gcc:tarball CI job for merge requests
Running gcc:tarball CI job for merge requests is consistent with how we
run gcc:out-of-tree CI job and should help identify problems with the
build system during the review process, not once merged during daily
runs. For the sake of time, unit and system tests associated with the
gcc:tarball CI job are excluded from merge requests.
2021-05-24 17:57:53 +02:00
Michal Nowak
70eccd2952 Do not spawn FreeBSD 11 CI jobs in merge requests 2021-05-24 17:57:53 +02:00
Michal Nowak
e4f88c359c Create an anchor for schedules, tags, and web rules
It's a common pattern to spawn CI jobs only for pipelines triggered by
schedules, tags, and web. There should be an anchor so that the rules
are not repeated.
2021-05-24 17:57:53 +02:00
Michal Nowak
0714fe6f40 Add FreeBSD 13.0 2021-05-24 17:54:05 +02:00
Ondřej Surý
fd0f3c0af4 Merge branch '2643-fix-rndc-timeout' into 'main'
extend rndc timeout to 60 seconds

Closes #2643

See merge request isc-projects/bind9!5082
2021-05-22 09:46:27 +00:00
Evan Hunt
3ed35b3035 extend rndc timeout to 60 seconds
the idle timeout for rndc connections was set to 10 seconds, but this
caused intermittent system failures of the 'rndc' system test on slow
platforms, since 'rndc reconfig' could time out before reconfiguration
was complete.

this commit restores the original timeout value of 60 seconds, which was
changed inadvertently after rndc was updated to use the network manager.

even with this change, however, the test can still time out under
TSAN because loading the huge zone can take a very long time (upwards
of two minutes). so the test is modified here to generate a smaller zone
file when running under TSAN.
2021-05-22 01:11:31 -07:00
Evan Hunt
c819762dde Merge branch 'each-rename-copynf' into 'main'
rename dns_name_copynf() to dns_name_copy()

See merge request isc-projects/bind9!5081
2021-05-22 08:10:10 +00:00
Evan Hunt
d06b1ed11f CHANGES 2021-05-22 00:37:27 -07:00
Evan Hunt
1fa6f8662e update dev.md with name copying information
revise the Developer Information document with updated information
about copying names.
2021-05-22 00:37:27 -07:00
Evan Hunt
f3f1cab05e clean up coccinelle patches for dns_name_copy()
no need for semantic patches to use dns_name_copynf() any longer.
2021-05-22 00:37:27 -07:00
Evan Hunt
b0aadaac8e rename dns_name_copynf() to dns_name_copy()
dns_name_copy() is now the standard name-copying function.
2021-05-22 00:37:27 -07:00
Evan Hunt
ea7b28f101 remove dns_name_copy() implementation
Remove dns_name_copy() and refactor the underlying code since
it will only be called by dns_name_copynf() now, and can't fail.
2021-05-22 00:22:32 -07:00
Evan Hunt
b1fe1b8ae3 remove the remaining uses of dns_name_copy()
dns_name_copy() has been replaced nearly everywhere with
dns_name_copynf().  this commit changes the last two uses of
the original function.  afterward, we can remove the old
dns_name_copy() implementation, and replace it with _copynf().
2021-05-22 00:22:32 -07:00
Evan Hunt
6803f394c5 Merge branch '2713-intermittent-crashes-in-the-tkey-system-test-caused-by-broken-dns_name_t-structures' into 'main'
Use dns_name_copy() to hold the copied name

Closes #2713

See merge request isc-projects/bind9!5079
2021-05-22 04:30:19 +00:00
Ondřej Surý
ce3e1abc1d Use dns_name_copynf() with dns_message_gettempname() when needed
dns_message_gettempname() returns an initialized name with a dedicated
buffer, associated with a dns_fixedname object.  Using dns_name_copynf()
to write a name into this object will actually copy the name data
from a source name. dns_name_clone() merely points target->ndata to
source->ndata, so it is faster, but it can lead to a use-after-free if
the source is freed before the target object is released via
dns_message_puttempname().

In a few places, clone was being used where copynf should have been;
this is now fixed.

As a side note, no memory was lost, because the ndata buffer used in
the dns_fixedname_t is internal to the structure, and is freed when
the dns_fixedname_t is freed regardless of the .ndata contents.
2021-05-21 21:28:10 -07:00
Brian Conry
10ced46739 Merge branch '2662-fix-broken-SYSTEMTEST_NO_CLEAN' into 'main'
Preserve SYSTEMTEST_NO_CLEAN when run.sh calls make.

Closes #2662

See merge request isc-projects/bind9!5003
2021-05-21 13:38:25 +00:00
Brian Conry
44cadaf31b Preserve additional environment variables with run.sh
When executed in "legacy mode" (i.e. without the '-r' parameter)
run.sh invokes make with a modified environment.

SYSTEMTEST_FORCE_COLOR is now preserved for use by the individual test
scripts.

CYGWIN is now preserved for named, as it controls behavior relating to
crash reporting.
2021-05-21 13:07:28 +00:00
Brian Conry
516de44c9f Preserve SYSTEMTEST_NO_CLEAN when run.sh calls make
This restores legacy behavior in bin/tests/system where running:
  SYSTEMTEST_NO_CLEAN=1 ./run.sh <testname>
would run the test and preserve the output files.

This has been broken since the change that has run.sh invoke "make",
due to SYSTEMTEST_NO_CLEAN not being preserved in the environment
that's set up for "make".

Another option would be to completely remove SYSTEMTEST_NO_CLEAN.

This seems to be the only behavior-changing environment variable
not accounted for in the call to "make".

I don't think this needs a CHANGES entry.
2021-05-21 13:07:28 +00:00
Michał Kępień
97a821399b Merge branch 'michal/regenerate-man-pages-with-sphinx-4.0.2' into 'main'
Regenerate man pages with Sphinx 4.0.2

See merge request isc-projects/bind9!5077
2021-05-21 09:26:16 +00:00
Michał Kępień
9ec83d1f63 Explicitly set "man_make_section_directory"
The default value of the "man_make_section_directory" Sphinx option was
changed in Sphinx 4.0.1, which broke building man pages in maintainer
mode as the shell code in doc/man/Makefile.am expects man pages to be
built in doc/man/_build/man/, not doc/man/_build/man/<section_number>/.
The aforementioned change in defaults was reverted in Sphinx 4.0.2, but
this issue should still be prevented from reoccurring in the future.
Ensure that by explicitly setting the "man_make_section_directory"
option to False.
2021-05-21 10:29:02 +02:00
Michał Kępień
bdb777b2a2 Regenerate man pages with Sphinx 4.0.2
The man pages produced by Sphinx 4.0.2 are slightly different than those
produced by Sphinx 3.5.4.  As Sphinx 4.0.2 is now used in GitLab CI,
update all doc/man/*in files so that they reflect what that version of
Sphinx produces, in order to prevent GitLab CI job failures.
2021-05-21 10:29:02 +02:00
Ondřej Surý
596a3442a3 Merge branch '2515-improve-glue-cache-performance' into 'main'
use a fixedname buffer in dns_message_gettempname()

Closes #2515

See merge request isc-projects/bind9!5071
2021-05-20 19:04:35 +00:00
Ondřej Surý
5ee9edc4ce Optimize rdataset_getownercase not to use bitshifts
The last rdataset_getownercase() left it in a state where the code was
mix of microoptimizations (manual loop unrolling, complicated bitshifts)
with a code that would always rewrite the character even if it stayed
the same after transformation.

This commit makes sure that we modify only the characters that actually
need to change, removes the manual loop unrolling, and replaces the
weird bit arithmetics with a simple shift and bit-and.
2021-05-20 20:41:29 +02:00
Evan Hunt
e31cc1eeb4 use a fixedname buffer in dns_message_gettempname()
dns_message_gettempname() now returns a pointer to an initialized
name associated with a dns_fixedname_t object. it is no longer
necessary to allocate a buffer for temporary names associated with
the message object.
2021-05-20 20:41:29 +02:00
Michał Kępień
869e0feec7 Merge branch 'v9_17_13-release' into 'main'
Merge 9.17.13 release branch

See merge request isc-projects/bind9!5068
2021-05-20 10:10:37 +00:00
Michał Kępień
5a71af44b1 Set up release notes for BIND 9.17.14 2021-05-20 12:03:47 +02:00
Michał Kępień
f73d41d0a0 Update BIND version to 9.17.13 2021-05-20 12:03:47 +02:00
Michał Kępień
39b739b867 Add a CHANGES marker 2021-05-20 12:03:47 +02:00
Michał Kępień
c14a91f06e Merge branch 'michal/prepare-documentation-for-bind-9.17.13' into 'v9_17_13-release'
Prepare documentation for BIND 9.17.13

See merge request isc-private/bind9!293
2021-05-20 12:03:47 +02:00
Michał Kępień
8113dbe5bb Prepare release notes for BIND 9.17.13 2021-05-20 12:03:47 +02:00
Michał Kępień
e49bd0906e Add release note for GL #2626 2021-05-20 12:03:47 +02:00
Michał Kępień
620cccc3fc Reorder release notes 2021-05-20 12:03:47 +02:00
Michał Kępień
ced6c9b23a Tweak and reword release notes 2021-05-20 12:03:47 +02:00
Michał Kępień
43cbc773a7 Tweak and reword recent CHANGES entries 2021-05-20 12:03:47 +02:00
Michal Nowak
ab6060c538 Drop duplicate release note for GL #2347 2021-05-20 12:03:47 +02:00
Michal Nowak
15a345626a Fix typo in doc/dnssec-guide/recipes.rst 2021-05-20 12:03:47 +02:00
Matthijs Mekking
3ecd951da8 Merge branch '1875-kasp-views-keyfile-race' into 'main'
Lock key files when looking for zone keys

Closes #1875

See merge request isc-projects/bind9!4919
2021-05-20 07:55:26 +00:00
Matthijs Mekking
fa1cd0a1f1 Release notes and changes for [#1875] 2021-05-20 09:23:46 +02:00
Matthijs Mekking
252a1ae0a1 Lock kasp when looking for zone keys
We should also lock kasp when reading key files, because at the same
time the zone in another view may be updating the key file.
2021-05-20 09:15:43 +02:00
Michal Nowak
8de2d8137c Merge branch 'mnowak/openbsd-6.9' into 'main'
Add OpenBSD 6.9

See merge request isc-projects/bind9!5031
2021-05-19 17:10:53 +00:00
Michal Nowak
315b8522ba Add OpenBSD 6.9 2021-05-19 17:21:23 +02:00
Michal Nowak
38bc6c8aa3 Merge branch '2694-drop-seq-command-from-views-tests-sh' into 'main'
Replace seq command with POSIX-compliant shell code

Closes #2694

See merge request isc-projects/bind9!5061
2021-05-19 13:55:53 +00:00
Michal Nowak
a4b7eb7188 Make views system test ShellCheck-clean
Also, add "set -e" to all shell scripts of the views test to exit when
any command fails or is unknown, e.g., this on OpenBSD:

    tests.sh[174]: seq: not found
2021-05-19 14:04:48 +02:00
Michal Nowak
a08487ec3d Replace seq command with POSIX-compliant shell code
The seq command is not defined in the POSIX standard and is missing on
OpenBSD. Given that the system test code is meant to be POSIX-compliant
replace it with a shell construct.
2021-05-19 14:04:48 +02:00
Michał Kępień
7d6bcef66e Merge branch '2709-placeholder' into 'main'
Add placeholder for GL #2709

See merge request isc-projects/bind9!5060
2021-05-19 12:00:02 +00:00
Michał Kępień
6962335678 Add placeholder for GL #2709 2021-05-19 13:57:21 +02:00
Artem Boldariev
1a298b28e2 Merge branch 'artem/doh-quota-tests' into 'main'
Add DoH quota tests

See merge request isc-projects/bind9!5024
2021-05-19 08:30:17 +00:00
Artem Boldariev
67c50abe5a Add DoH quota tests
This commit adds unit tests which ensure that DoH code is compatible
with quota functionality.
2021-05-19 10:28:47 +03:00
Mark Andrews
c2c2b0da9a Merge branch '2688-cid331478-forwardnull' into 'main'
Fix possible null dereference (coverity issue 331478)

Closes #2688

See merge request isc-projects/bind9!5034
2021-05-19 01:55:53 +00:00
Matthijs Mekking
19395fd168 Fix coverity issue 331478
Move the "cannot start rollover" warning into code block that checks
if 'active_key' is not NULL.
2021-05-19 00:45:54 +00:00
Mark Andrews
954eb15052 Merge branch '2550-remove-dns_zone_setflag' into 'main'
Resolve "Remove dns_zone_setflag"

Closes #2550

See merge request isc-projects/bind9!4762
2021-05-18 23:54:35 +00:00
Mark Andrews
314b5362a8 Remove dns_zone_setflag()
This function has never been used since it was added to the source tree
by commit 686b27bfd3 back in 1999.  As
the dns_zoneflg_t type is only defined in lib/dns/zone.c, no function
external to that file would be able to use dns_zone_setflag() properly
anyway - the DNS_ZONE_SETFLAG() and DNS_ZONE_CLRFLAG() macros should be
used instead. Zone options that can be set from outside zone.c are set
using dns_zone_setoption().
2021-05-18 16:02:18 -07:00
Matthijs Mekking
b6f806e023 Merge branch '2463-kasp-views-different-policy-same-keydirectory' into 'main'
Check key-directory duplicates for kasp zones

Closes #2463

See merge request isc-projects/bind9!4989
2021-05-18 14:40:26 +00:00
Matthijs Mekking
a9f4b074c4 Release notes and changes for [GL #2463]
Mention the bugfix.
2021-05-18 15:47:02 +02:00
Matthijs Mekking
df1aecd5ff Add checkconf tests for [#2463]
Add two tests to make sure named-checkconf catches key-directory issues
where a zone in multiple views uses the same directory but has
different dnssec-policies. One test sets the key-directory specifically,
the other inherits the default key-directory (NULL, aka the working
directory).

Also update the good.conf test to allow zones in different views
with the same key-directory if they use the same dnssec-policy.

Also allow zones in different views with different key-directories if
they use different dnssec-policies.

Also allow zones in different views with the same key-directories if
only one view uses a dnssec-policy (the other is set to "none").

Also allow zones in different views with the same key-directories if
no views uses a dnssec-policy (zone in both views has the dnssec-policy
set to "none").
2021-05-18 15:47:02 +02:00
Matthijs Mekking
494e8b2cbd Check key-directory duplicates for kasp zones
Don't allow the same zone with different dnssec-policies in separate
views have the same key-directory.

Track zones plus key-directory in a symtab and if there is a match,
check the offending zone's dnssec-policy name. If the name is "none"
(there is no kasp for the offending zone), or if the name is the same
(the zone shares keys), it is fine, otherwise it is an error (zones
in views using different policies cannot share the same key-directory).
2021-05-18 15:47:02 +02:00
Mark Andrews
8a90139c2c Merge branch '2696-misleading-diagnostic-in-update_soa_serial-indicates-bind-will-use-increment-but-it-doesn-t' into 'main'
Resolve "Misleading diagnostic in update_soa_serial indicates BIND will use increment but it doesn't"

Closes #2696

See merge request isc-projects/bind9!5029
2021-05-18 12:51:00 +00:00
Mark Andrews
5d21042ed8 Adjust returned method from dns_updatemethod_date
if dns_updatemethod_date is used do that the returned method is only
set to dns_updatemethod_increment if the new serial does not encode
the current day (YYYYMMDDXX).
2021-05-18 12:30:22 +00:00
Michał Kępień
3dc094c8e0 Merge branch 'michal/use-context-managers-as-suggested-by-pylint-2.8.2' into 'main'
Use context managers as suggested by PyLint 2.8.2

See merge request isc-projects/bind9!5041
2021-05-18 08:56:50 +00:00
Michał Kępień
a8163551ed Use context managers as suggested by PyLint 2.8.2
PyLint 2.8.2 reports the following suggestions for two Python scripts
used in the system test suite:

    ************* Module tests_rndc_deadlock
    bin/tests/system/addzone/tests_rndc_deadlock.py:71:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    ************* Module tests-shutdown
    bin/tests/system/shutdown/tests-shutdown.py:68:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    bin/tests/system/shutdown/tests-shutdown.py:154:8: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)

Implement the above suggestions by using
concurrent.futures.ThreadPoolExecutor() and subprocess.Popen() as
context managers.
2021-05-18 10:53:17 +02:00
Mark Andrews
71284cb496 Merge branch '2706-worker-cond_prio-needs-to-be-initialised' into 'main'
Resolve "worker->cond_prio needs to be initialised"

Closes #2706

See merge request isc-projects/bind9!5048
2021-05-18 08:39:28 +00:00
Mark Andrews
7e83c6df94 initialise worker->cond_prio 2021-05-18 07:47:42 +00:00
Mark Andrews
cdb8c9bd35 Merge branch '2701-gcc-10-fanalyzer-reports-dereference-of-null-label-in-lib-dns-name-c-1167' into 'main'
Resolve "gcc-10+ -fanalyzer reports: dereference of NULL ‘label’ in lib/dns/name.c:1167"

Closes #2701

See merge request isc-projects/bind9!5046
2021-05-18 06:41:56 +00:00
Mark Andrews
29f1c1e677 Silence gcc-10-fanalyzer false positive
If 'state == ft_ordinary' then 'label' can't be NULL. Add
INSIST to reflect this.
2021-05-18 15:51:51 +10:00
Mark Andrews
ea305a4877 Merge branch '2702-gcc-10-fanalyzer-reports' into 'main'
Resolve "gcc-10+ -fanalyzer reports:"

Closes #2702

See merge request isc-projects/bind9!5043
2021-05-18 05:45:26 +00:00
Mark Andrews
683ad6e4bd Silence gcc-10-fanalyzer false positive
Add REQUIRE(type == dns_rdatatype_nsec3 || firstp != NULL); so
that dereferences of *firstp is not flagged as a NULL pointer
dereference.
2021-05-18 15:19:28 +10:00
Mark Andrews
3b0d6450db Merge branch '2689-cid-331477-resource-leaks-resource_leak' into 'main'
Resolve "CID 331477: Resource leaks (RESOURCE_LEAK)"

Closes #2689

See merge request isc-projects/bind9!5016
2021-05-18 00:53:38 +00:00
Mark Andrews
d24ea068c8 Add CHANGES for [GL #2689] 2021-05-18 10:34:10 +10:00
Mark Andrews
8eed392add Address potential resource leak in dst_key_fromnamedfile 2021-05-18 10:33:43 +10:00
Evan Hunt
27386db7fe Merge branch 'each-bufsize-doc' into 'main'
clarify buffer size options

See merge request isc-projects/bind9!5037
2021-05-17 17:02:18 +00:00
Evan Hunt
05985f6889 clarify buffer size options
the documentation for {udp,tcp}-{send,receive}-buffer options
was not complete. also revised for grammar.
2021-05-17 09:34:08 -07:00
Michał Kępień
e3b442e538 Merge branch 'michal/tweak-cve-handling-checklists' into 'main'
Tweak security incident handling checklists

See merge request isc-projects/bind9!5017
2021-05-17 12:09:44 +00:00
Michał Kępień
ba1145c017 Tweak security incident handling checklists
Add an item to the CVE issue template which calls for drafting the
security advisory early in the security incident handling process.  The
intention is to ensure there is enough time to review and polish ISC
security advisories before they get published.

Tweak the release checklist to make sure we carefully consider all
confidential issues before opening them up to the public.  This change
is intended as a safeguard against accidentally disclosing too much
information about a security vulnerability before our users get a chance
to patch it.
2021-05-17 14:07:27 +02:00
Ondřej Surý
f2b297a37d Merge branch 'ondrej/remove-netmgr-quantum' into 'main'
Replace netmgr quantum with loop-preventing barrier

See merge request isc-projects/bind9!5028
2021-05-17 10:05:11 +00:00
Ondřej Surý
9e3cb396b2 Replace netmgr quantum with loop-preventing barrier
Instead of using fixed quantum, this commit adds atomic counter for
number of items on each queue and uses the number of netievents
scheduled to run as the limit of maximum number of netievents for a
single process_queue() run.

This prevents the endless loops when the netievent would schedule more
netievents onto the same loop, but we don't have to pick "magic" number
for the quantum.
2021-05-17 11:59:19 +02:00
Michal Nowak
9e21b80cbd Merge branch '2693-add-py-test-to-the-list-of-tested-pytest-names' into 'main'
Add py.test to the list of tested pytest names

Closes #2693

See merge request isc-projects/bind9!5022
2021-05-17 09:23:25 +00:00
Michal Nowak
510b4b70e9 Add py.test to the list of tested pytest names
OpenBSD changed the name of the pytest script from py.test-3 in OpenBSD
6.8 to py.test in OpenBSD 6.9.

The py.test-3 name which was added in d5562a3e for the sake of OpenBSD
and CentOS is still required for CentOS.
2021-05-17 11:12:43 +02:00
Ondřej Surý
d34672796c Merge branch '2313-set-RCVBUF-SNDBUF' into 'main'
Resolve "Set reasonable values to SO_RCVBUF and SO_SNDBUF"

Closes #2313

See merge request isc-projects/bind9!4460
2021-05-17 07:42:37 +00:00
Ondřej Surý
3733b4f101 Add CHANGES and release note for GL #2313 2021-05-17 08:47:09 +02:00
Ondřej Surý
4509089419 Add configuration option to set send/recv buffers on the nm sockets
This commit adds a new configuration option to set the receive and send
buffer sizes on the TCP and UDP netmgr sockets.  The default is `0`
which doesn't set any value and just uses the value set by the operating
system.

There's no magic value here - set it too small and the performance will
drop, set it too large, the buffers can fill-up with queries that have
already timeouted on the client side and nobody is interested for the
answer and this would just make the server clog up even more by making
it produce useless work.

The `netstat -su` can be used on POSIX systems to monitor the receive
and send buffer errors.
2021-05-17 08:47:09 +02:00
Michal Nowak
089bfe20f9 Merge branch '2386-check-correct-copyright-dates-in-man-pages' into 'main'
Set copyright year to the current year

Closes #2386

See merge request isc-projects/bind9!4869
2021-05-14 12:46:33 +00:00
Michal Nowak
7eb44b05c5 Set copyright year to the current year
To ensure that a release with outdated copyright year is not produced at
the beginning of a year, set copyright year to the current year.
2021-05-14 14:21:58 +02:00
Michal Nowak
6f9ac0e997 Merge branch 'mnowak/add-unit-gcc-out-of-tree-ci-job' into 'main'
Add unit:gcc:out-of-tree CI job

See merge request isc-projects/bind9!4740
2021-05-14 12:21:06 +00:00
Michal Nowak
741fdd4fe1 Add unit:gcc:out-of-tree CI job
Also extract the workspace save-and-retrieve logic to YAML anchors.
2021-05-14 13:22:09 +02:00
Michal Nowak
c628f2c71b Make masterXX.data.in reachable by out-of-tree builds
Unit test run for out-of-tree builds used to fail to find
masterXX.data.in files:

    /usr/bin/perl -w /builds/mnowak/bind9/lib/dns/tests/mkraw.pl < testdata/master/master12.data.in > testdata/master/master12.data
    /bin/bash: testdata/master/master12.data.in: No such file or directory
    make[4]: *** [Makefile:1910: testdata/master/master12.data] Error 1
2021-05-14 13:22:09 +02:00
Ondřej Surý
1c5de1aa43 Merge branch 'ondrej/fix-outgoing-udp-socket-selection-on-windows' into 'main'
Fix the outgoing UDP socket selection on Windows

See merge request isc-projects/bind9!5021
2021-05-13 14:05:22 +00:00
Ondřej Surý
cd413234f7 Fix the outgoing UDP socket selection on Windows
The outgoing UDP socket selection would pick unintialized children
socket on Windows, because we have more netmgr workers than we have
listening sockets.  This commit fixes the selection by keeping the
outgoing socket the same, so it's always run on existing socket.
2021-05-13 15:04:48 +02:00
Artem Boldariev
d7689d8dbc Merge branch 'artem-flamethrower-fixes' into 'main'
DoH flamethrower fixes

See merge request isc-projects/bind9!5019
2021-05-13 10:01:26 +00:00
Artem Boldariev
bab9309231 Fix DoH unit tests logic
This commit fixes logic bugs in DoH test suite revealed by making DoH
not to call nghttp2_session_terminate_session() in server-side code.
2021-05-13 10:42:25 +03:00
Artem Boldariev
6816a741ca Fix crash in TLS caused by improper handling of shutdown messages
The problem was found when flamethrower was accidentally run in DoT
mode against DoH port.
2021-05-13 10:42:25 +03:00
Artem Boldariev
1947f6372d Limit the number of active concurrent HTTP/2 streams
The initial intent was to limit the number of concurrent streams by
the value of 100 but due to the error when reading the documentation
it was set to the maximum possible number of streams per session.

This could lead to security issues, e.g. a remote attacker could have
taken down the BIND instance by creating lots of sessions via low
number of transport connections. This commit fixes that.
2021-05-13 10:42:25 +03:00
Artem Boldariev
d80d1b0dd9 Do not allow empty DoH endpoints to be added
It was possible to specify empty DoH endpoint in BIND's configuration
file: that was an error, we should not allow doing so.
2021-05-13 10:42:25 +03:00
Artem Boldariev
9155a87528 Do not call nghttp2_session_terminate_session() in server-side code
We should not call nghttp2_session_terminate_session() in server-side
code after all of the active HTTP/2 streams are processed. The
underlying transport connection is expected to remain opened at least
for some time in this case for new HTTP/2 requests to arrive. That is
what flamethrower was expecting and it makes perfect sense from the
HTTP/2 perspective.
2021-05-13 10:42:25 +03:00
Mark Andrews
4d888458ab Merge branch '2528-check-soa-rdata' into 'main'
Check SOA rdata for consistency in AXFR.

Closes #2528

See merge request isc-projects/bind9!5014
2021-05-13 05:17:39 +00:00
Evan Hunt
4d94f82232 system test
Attempt a zone transfer with mismatched SOA records.
2021-05-13 03:36:50 +00:00
Mark Andrews
7e54d8d2cb Add CHANGES entry for [GL #2528] 2021-05-13 03:36:50 +00:00
Mark Andrews
e86508708d Check that the first and last SOA of an AXFR are consistent 2021-05-13 03:36:50 +00:00
Mark Andrews
72da25f31f Merge branch '2656-resolver-system-test-fails-on-macos' into 'main'
Resolve "resolver system test fails on macOS"

Closes #2656

See merge request isc-projects/bind9!4947
2021-05-12 03:40:52 +00:00
Mark Andrews
a83afc10f9 Add missing call to isc_app_ctxstart 2021-05-12 03:01:15 +00:00
Ondřej Surý
0860ed6f5b Merge branch 'marka/add-missing-isc_condition_init' into 'main'
initalise sock->cond

See merge request isc-projects/bind9!5013
2021-05-11 13:03:13 +00:00
Mark Andrews
0f6ae9000a initalise sock->cond 2021-05-11 14:06:26 +02:00
Ondřej Surý
4efd1e2ac8 Merge branch 'ondrej/increase-netmgr-quantum' into 'main'
Bump the netmgr quantum to 1024

See merge request isc-projects/bind9!5009
2021-05-10 20:04:10 +00:00
Ondřej Surý
3713a38689 Bump the netmgr quantum to 1024
During the stress testing, it was discovered that the default netmgr
quantum of 128 is not enough and there was a performance drop for TCP on
FreeBSD.  Bumping the default quantum to 1024 solves the performance
issue and is still enough to prevent the endless loops.
2021-05-10 21:32:31 +02:00
Evan Hunt
ee6e540004 Merge branch 'each-taskmgr-setmode' into 'main'
reset taskmgr immediately after loading zones

See merge request isc-projects/bind9!5010
2021-05-10 19:32:00 +00:00
Evan Hunt
220ada9422 reset taskmgr mode immediately after returning from zone load
all privileged tasks are complete by the time we return from
isc_task_endexclusive(), so it makes sense to reset the taskmgr
mode to non-privileged right then.
2021-05-10 12:26:27 -07:00
Ondřej Surý
1639bcb59e Merge branch 'ondrej/dereference-taskmgr-after-all-tasks-are-done' into 'main'
Destroy reference to taskmgr after all tasks are done

See merge request isc-projects/bind9!5008
2021-05-10 19:24:53 +00:00
Ondřej Surý
e623c12757 Destroy reference to taskmgr after all tasks are done
We were clearing the pointer to taskmgr as soon as isc_taskmgr_destroy()
would be called and before all tasks were finished.  Unfortunately, some
tasks would use global named_g_taskmgr objects from inside the events
and this would cause either a data race or NULL pointer dereference.

This commit fixes the data race by moving the destruction of the
referenced pointer to the time after all tasks are finished.
2021-05-10 12:13:27 -07:00
Ondřej Surý
d3ebd19e23 Merge branch 'ondrej/fix-missing-isc_taskmgr_detach-on-exiting' into 'main'
Add isc_taskmgr_detach when task is created while shutting down

See merge request isc-projects/bind9!5006
2021-05-10 11:33:46 +00:00
Ondřej Surý
6c57a6cc3d Add isc_taskmgr_detach when task is created while shutting down
When taskmgr is shutting down, the creating the task would attach
to the taskmgr, but don't detach on error condition.
2021-05-10 11:39:51 +02:00
Evan Hunt
0e92060833 Merge branch '2654-create-isc_managers-api' into 'main'
Destroy netmgr before destroying taskmgr

Closes #2654

See merge request isc-projects/bind9!4983
2021-05-07 21:37:01 +00:00
Evan Hunt
19431b1c83 CHANGES 2021-05-07 14:28:33 -07:00
Ondřej Surý
0133096c88 improvements to socket_test
- be more strict, but patient, waiting for event completion.
- use an atomic pointer for the socket to silence TSAN warnings.
2021-05-07 14:28:33 -07:00
Ondřej Surý
365c6a9851 ensure interlocked netmgr events run on worker[0]
Network manager events that require interlock (pause, resume, listen)
are now always executed in the same worker thread, mgr->workers[0],
to prevent races.

"stoplistening" events no longer require interlock.
2021-05-07 14:28:32 -07:00
Evan Hunt
c44423127d fix shutdown deadlocks
- ensure isc_nm_pause() and isc_nm_resume() work the same whether
  run from inside or outside of the netmgr.
- promote 'stop' events to the priority event level so they can
  run while the netmgr is pausing or paused.
- when pausing, drain the priority queue before acquiring an
  interlock; this prevents a deadlock when another thread is waiting
  for us to complete a task.
- release interlock after pausing, reacquire it when resuming, so
  that stop events can happen.

some incidental changes:
- use a function to enqueue pause and resume events (this was part of a
  different change attempt that didn't work out; I kept it because I
  thought was more readable).
- make mgr->nworkers a signed int to remove some annoying integer casts.
2021-05-07 14:28:32 -07:00
Ondřej Surý
4c8f6ebeb1 Use barriers for netmgr synchronization
The netmgr listening, stoplistening, pausing and resuming functions
now use barriers for synchronization, which makes the code much simpler.

isc/barrier.h defines isc_barrier macros as a front-end for uv_barrier
on platforms where that works, and pthread_barrier where it doesn't
(including TSAN builds).
2021-05-07 14:28:32 -07:00
Ondřej Surý
2eae7813b6 Run isc__nm_http_stoplistening() synchronously in netmgr
When isc__nm_http_stoplistening() is run from inside the netmgr, we need
to make sure it's run synchronously.  This commit is just a band-aid
though, as the desired behvaior for isc_nm_stoplistening() is not always
the same:

  1. When run from outside user of the interface, the call must be
     synchronous, e.g. the calling code expects the call to really stop
     listening on the interfaces.

  2. But if there's a call from listen<proto> when listening fails,
     that needs to be scheduled to run asynchronously, because
     isc_nm_listen<proto> is being run in a paused (interlocked)
     netmgr thread and we could get stuck.

The proper solution would be to make isc_nm_stoplistening()
behave like uv_close(), i.e., to have a proper callback.
2021-05-07 14:28:32 -07:00
Evan Hunt
5c08f97791 only run tasks as privileged if taskmgr is in privileged mode
all zone loading tasks have the privileged flag, but we only want
them to run as privileged tasks when the server is being initialized;
if we privilege them the rest of the time, the server may hang for a
long time after a reload/reconfig. so now we call isc_taskmgr_setmode()
to turn privileged execution mode on or off in the task manager.

isc_task_privileged() returns true if the task's privilege flag is
set *and* the taskmgr is in privileged execution mode. this is used
to determine in which netmgr event queue the task should be run.
2021-05-07 14:28:30 -07:00
Ondřej Surý
29a208aaf7 Fix crash when allocating UDP socket fails on OpenBSD
When socket() call fails, the UDP connect code would call the connectcb
with empty req->handle.  This has been fixed.
2021-05-07 14:28:30 -07:00
Ondřej Surý
0b491913df Don't clear dig lookup if it was already cleared
This workarounds couple of races where the current_lookup would be
already detached during shutting down the dig, but still processing the
pending reads.
2021-05-07 14:28:30 -07:00
Ondřej Surý
2836bc1854 Fix wrong query accounting in the connect function in dighost.c
The start_udp() function didn't properly attach to the query and thus
a callback with ISC_R_CANCELED would end with wrong accounting on the
query object.

Usually, this doesn't happen because underlying libuv API
uv_udp_connect() is synchronous, but isc_nm_udpconnect() could return
ISC_R_CANCELED in case it's called while the netmgr is shutting down.
2021-05-07 14:28:30 -07:00
Ondřej Surý
dacf586e18 Make the netmgr queue processing quantized
There was a theoretical possibility of clogging up the queue processing
with an endless loop where currently processing netievent would schedule
new netievent that would get processed immediately.  This wasn't such a
problem when only netmgr netievents were processed, but with the
addition of the tasks, there are at least two situation where this could
happen:

 1. In lib/dns/zone.c:setnsec3param() the task would get re-enqueued
    when the zone was not yet fully loaded.

 2. Tasks have internal quantum for maximum number of isc_events to be
    processed, when the task quantum is reached, the task would get
    rescheduled and then immediately processed by the netmgr queue
    processing.

As the isc_queue doesn't have a mechanism to atomically move the queue,
this commit adds a mechanism to quantize the queue, so enqueueing new
netievents will never stop processing other uv_loop_t events.
The default quantum size is 128.

Since the queue used in the network manager allows items to be enqueued
more than once, tasks are now reference-counted around task_ready()
and task_run(). task_ready() now has a public API wrapper,
isc_task_ready(), that the netmgr can use to reschedule processing
of a task if the quantum has been reached.

Incidental changes: Cleaned up some unused fields left in isc_task_t
and isc_taskmgr_t after the last refactoring, and changed atomic
flags to atomic_bools for easier manipulation.
2021-05-07 14:28:30 -07:00
Ondřej Surý
b5bf58b419 Destroy netmgr before destroying taskmgr
With taskmgr running on top of netmgr, the ordering of how the tasks and
netmgr shutdown interacts was wrong as previously isc_taskmgr_destroy()
was waiting until all tasks were properly shutdown and detached.  This
responsibility was moved to netmgr, so we now need to do the following:

  1. shutdown all the tasks - this schedules all shutdown events onto
     the netmgr queue

  2. shutdown the netmgr - this also makes sure all the tasks and
     events are properly executed

  3. Shutdown the taskmgr - this now waits for all the tasks to finish
     running before returning

  4. Shutdown the netmgr - this call waits for all the netmgr netievents
     to finish before returning

This solves the race when the taskmgr object would be destroyed before
all the tasks were finished running in the netmgr loops.
2021-05-07 14:28:30 -07:00
Ondřej Surý
a011d42211 Add new isc_managers API to simplify <*>mgr create/destroy
Previously, netmgr, taskmgr, timermgr and socketmgr all had their own
isc_<*>mgr_create() and isc_<*>mgr_destroy() functions.  The new
isc_managers_create() and isc_managers_destroy() fold all four into a
single function and makes sure the objects are created and destroy in
correct order.

Especially now, when taskmgr runs on top of netmgr, the correct order is
important and when the code was duplicated at many places it's easy to
make mistake.

The former isc_<*>mgr_create() and isc_<*>mgr_destroy() functions were
made private and a single call to isc_managers_create() and
isc_managers_destroy() is required at the program startup / shutdown.
2021-05-07 10:19:05 -07:00
Artem Boldariev
f23afce683 Merge branch 'artem/doh-tests-fix' into 'main'
Fix flawed DoH unit tests logic and some corner cases in the DoH code. Fix doh_test failure on FreeBSD 13.0

Closes #2632

See merge request isc-projects/bind9!5005
2021-05-07 13:25:56 +00:00
Artem Boldariev
8c0ea01f34 DoH: close active server streams when finishing session
Under some circumstances a situation might occur when server-side
session gets finished while there are still active HTTP/2
streams. This would lead to isc_nm_httpsocket object leaks.

This commit fixes this behaviour as well as refactors failed_read_cb()
to allow better code reuse.
2021-05-07 15:47:24 +03:00
Artem Boldariev
a9e97f28b7 Fix crash in client side DoH code
This commit fixes a situation when a cstream object could get unlinked
from the list as a result of a cstream->read_cb call. Thus, unlinking
it after the call could crash the program.
2021-05-07 15:47:24 +03:00
Artem Boldariev
cd178043d9 Make some TLS tests actually use quota
A directive to check quota was missing from some of the TLS tests
which were supposed to test TLS code with quotas.
2021-05-07 15:47:24 +03:00
Artem Boldariev
22376fc69a TLS: cancel reading on the underlying TCP socket after (see below)
... the last handle has been detached after calling write
callback. That makes it possible to detach from the underlying socket
and not to keep the socket object alive for too long. This issue was
causing TLS tests with quota to fail because quota might not have been
detached on time (because it was still referenced by the underlying
TCP socket).

One could say that this commit is an ideological continuation of:

513cdb52ec.
2021-05-07 15:47:24 +03:00
Artem Boldariev
3bf331c453 Fix crashes in TLS when handling TLS shutdown messages
This commit fixes some situations which could appear in TLS code when
dealing with shutdown messages and lead to crashes.
2021-05-07 15:47:24 +03:00
Artem Boldariev
0d3f503dc9 Avoid creating connect netievents during low level failures in HTTP
This way we create less netievent objects, not bombarding NM with the
messages in case of numerous low-level errors (like too many open
files) in e.g. unit tests.
2021-05-07 15:47:24 +03:00
Artem Boldariev
0e8ac61d6e Avoid creating httpclose netievents in case of low level failures
This way we create less load on NM workers by avoiding netievent
creation.
2021-05-07 15:47:24 +03:00
Artem Boldariev
8510c5cd59 Always call TCP connect callback from within a worker context
This change ensures that a TCP connect callback is called from within
the context of a worker thread in case of a low-level error when
descriptors cannot be created (e.g. when there are too many open file
descriptors).
2021-05-07 15:47:24 +03:00
Artem Boldariev
1349142333 Got rid of tlsconnect event and corresponding code
We do not need it since we decided to not return values from connect
functions.
2021-05-07 15:47:24 +03:00
Artem Boldariev
39448c1581 Finish HTTP session on write failure
Not doing so caused client-side code to not free file descriptors as
soon as possible, that was causing unit tests to fail.
2021-05-07 15:47:24 +03:00
Artem Boldariev
4c5b36780b Fix flawed DoH unit tests logic
This commit fixes some logical mistakes in DoH unit tests logic,
causing them either to fail or not to do what they are intended to do.
2021-05-07 15:47:24 +03:00
Michal Nowak
b31b29d166 Merge branch 'mnowak/add-placeholder-for-issue-2671' into 'main'
Add placeholder for #2671

See merge request isc-projects/bind9!5004
2021-05-07 11:15:42 +00:00
Michal Nowak
8cc6725280 Add placeholder for #2671
Issue #2671 was merged to 9.16 but a respective placeholder was not
added to "main".
2021-05-07 12:08:40 +02:00
Matthijs Mekking
cf99c1dc85 Merge branch '2603-test-dnssec-policy-none' into 'main'
Check zonefile is untouched if dnssec-policy none

Closes #2603

See merge request isc-projects/bind9!4888
2021-05-05 17:15:58 +00:00
Matthijs Mekking
66f2cd228d Use isdigit instead of checking character range
When looking for key files, we could use isdigit rather than checking
if the character is within the range [0-9].

Use (unsigned char) cast to ensure the value is representable in the
unsigned char type (as suggested by the isdigit manpage).

Change " & 0xff" occurrences to the recommended (unsigned char) type
cast.
2021-05-05 19:15:33 +02:00
Matthijs Mekking
0c09867e96 Changes and release notes for [#2603] 2021-05-05 19:15:32 +02:00
Matthijs Mekking
511bc1b882 Check for filename clashes /w dnssec-policy zones
Just like with dynamic and/or inline-signing zones, check if no two
or more zone configurations set the same filename. In these cases,
the zone files are not read-only and named-checkconf should catch
a configuration where multiple zone statements write to the same file.

Add some bad configuration tests where KASP zones reference the same
zone file.

Update the good-kasp test to allow for two zones configure the same
file name, dnssec-policy none.
2021-05-05 19:13:55 +02:00
Matthijs Mekking
2d1b3a9899 Check zonefile is untouched if dnssec-policy none
Make sure no DNSSEC contents are added to the zonefile if dnssec-policy
is set to "none" (and no .state files exist for the zone).
2021-05-05 19:13:55 +02:00
Mark Andrews
d8cc16a659 Merge branch '2670-always-set-rewrite-when-compacting-a-version-1-journal' into 'main'
Resolve "Always set 'rewrite' when compacting a version 1 journal."

Closes #2670

See merge request isc-projects/bind9!4985
2021-05-05 13:33:55 +00:00
Mark Andrews
a60b54e1df Add release note for [GL #2670] 2021-05-05 23:13:55 +10:00
Mark Andrews
79da175a76 Add CHANGES note for [GL #2670] 2021-05-05 23:13:09 +10:00
Mark Andrews
ae1ae07b03 Check journal compaction 2021-05-05 23:12:37 +10:00
Mark Andrews
4a8e33b9f0 Always perform a re-write when processing a version 1 journal
version 1 journals may have a mix of type 1 and type 2 transaction
headers so always use the recovery code.
2021-05-05 23:12:37 +10:00
Mark Andrews
71df4fb84c Allow named-journalprint to compact journals at a given serial 2021-05-05 23:12:37 +10:00
Matthijs Mekking
cecc905b46 Merge branch 'matthijs-follow-up-2596' into 'main'
Remove double "insecure" check

See merge request isc-projects/bind9!4997
2021-05-05 10:48:38 +00:00
Matthijs Mekking
22243ac804 Remove double "insecure" check
This was a conflict between dba13d280a
and 636ff1e15c.
2021-05-05 12:45:47 +02:00
Matthijs Mekking
09ed248f60 Merge branch '2596-dnssec-policy-keys-inaccessible' into 'main'
Don't roll keys when the private key file is offline

Closes #2596

See merge request isc-projects/bind9!4885
2021-05-05 10:33:46 +00:00
Matthijs Mekking
636ff1e15c No longer need to strcmp for "none"
When we introduced "dnssec-policy insecure" we could have removed the
'strcmp' check for "none", because if it was set to "none", the 'kasp'
variable would have been set to NULL.
2021-05-05 11:23:53 +02:00
Matthijs Mekking
366ed047dd Changes and release notes for [#2596] 2021-05-05 11:14:35 +02:00
Matthijs Mekking
4a8ad0a77f Add kasp tests for offline keys
Add a test for default.kasp that if we remove the private key file,
no successor key is created for it. We need to update the kasp script
to deal with a missing private key. If this is the case, skip checks
for private key files.

Add a test with a zone for which the private key of the ZSK is missing.

Add a test with a zone for which the private key of the KSK is missing.
2021-05-05 11:14:02 +02:00
Matthijs Mekking
6a60bf637d Update smart signing when key is offline
BIND 9 is smart about when to sign with what key. If a key is offline,
BIND will delete the old signature anyway if there is another key to
sign the RRset with.

With KASP we don't want to fallback to the KSK if the ZSK is missing,
only for the SOA RRset. If the KSK is missing, but we do have a ZSK,
deleting the signature is fine. Otherwise it depends on if we use KASP
or not. Update the 'delsig_ok' function to reflect that.
2021-05-05 11:13:19 +02:00
Matthijs Mekking
3e6fc49c16 Don't roll offline keys
When checking the current DNSSEC state against the policy, consider
offline keys. If we didn't found an active key, check if the key is
offline by checking the public key list. If there is a match in the
public key list (the key data is retrieved from the .key and the
.state files), treat the key as offline and don't create a successor
key for it.
2021-05-05 11:13:19 +02:00
Matthijs Mekking
b3a5859a9b rndc dnssec -status should include offline keys
The rndc command 'dnssec -status' only considered keys from
'dns_dnssec_findmatchingkeys' which only includes keys with accessible
private keys. Change it so that offline keys are also listed in the
status.
2021-05-05 11:13:19 +02:00
Matthijs Mekking
7ed089576f Try to read state when reading keylist from rdata
The function 'dns_dnssec_keylistfromrdataset()' creates a keylist from
the DNSKEY RRset. If we attempt to read the private key, we also store
the key state. However, if the private key is offline, the key state
will not be stored. To fix this, first attempt to read the public key
file. If then reading the private key file fails, and we do have a
public key, add that to the keylist, with appropriate state. If we
also failed to read the public key file, add the DNSKEY to the keylist,
as we did before.
2021-05-05 11:13:19 +02:00
Matthijs Mekking
fa05c1b8da When reading public key from file, also read state
The 'dst_key_fromnamedfile()' function did not read and store the
key state from the .state file when reading a public key file.
2021-05-05 11:13:19 +02:00
Matthijs Mekking
cf17698f87 Fix a kasp lock issue
The kasp lock would stay locked if 'dns_keymgr_run' failed.
2021-05-05 11:13:19 +02:00
Mark Andrews
2be319b759 Merge branch '2678-named-checkconf-doesn-t-catch-redefinition-of-dnssec-policy-insecure' into 'main'
Resolve "named-checkconf doesn't catch redefinition of dnssec-policy insecure"

Closes #2678

See merge request isc-projects/bind9!4994
2021-05-05 07:03:12 +00:00
Mark Andrews
dba13d280a named-checkconf now detects redefinition of dnssec-policy 'insecure' 2021-05-05 16:23:19 +10:00
Mark Andrews
0f53872542 Merge branch '2536-inline-signing-documentation-doesn-t-match-reality' into 'main'
Resolve "inline-signing documentation doesn't match reality"

Closes #2536

See merge request isc-projects/bind9!4751
2021-05-05 00:17:40 +00:00
Matthijs Mekking
a548a450b3 checkconf tests for inline-signing at options/view 2021-05-04 23:35:59 +00:00
Mark Andrews
03978a7881 Add Release note for [GL #2536] 2021-05-04 23:35:59 +00:00
Mark Andrews
475a553e37 Add CHANGES note for [GL #2536] 2021-05-04 23:35:59 +00:00
Mark Andrews
b3301da262 inline-signing should have been in zone_only_clauses 2021-05-04 23:35:59 +00:00
Ondřej Surý
74d9a917eb Merge branch '2675-wrong-rfc-reference-in-name-c' into 'main'
Fix RFC292 -> RFC952 typo

Closes #2675

See merge request isc-projects/bind9!4990
2021-05-04 15:22:49 +00:00
Ondřej Surý
d2dba352cb Fix RFC292 -> RFC952 typo 2021-05-04 17:21:52 +02:00
Matthijs Mekking
38a422ed81 Merge branch '2624-kasp-test-failure-job-1630205' into 'main'
Fix intermittent kasp test failure

Closes #2624

See merge request isc-projects/bind9!4884
2021-05-04 08:24:43 +00:00
Matthijs Mekking
572f421df4 Fix intermittent kasp test failure
The kasp system test performs for each zone a couple of checks to make
sure the zone is signed correctly. To avoid test failures caused by
timing issues, there is first a check to ensure the zone is done
signing, 'wait_for_done_signing'. This function waits with the DNSSEC
checks until a "zone_rekey done" log message is seen for a specific
key.

Unfortunately this is not sufficient to avoid test failures due to
timing issues, because there is a small amount of time in between this
log message and the newly signed zone actually being served.

Therefore, in 'check_apex', retry for three seconds the DNSKEY query
check. After that, additional checks should pass without retries,
because at that point we know for sure the zone has been resigned with
the expected keys.

Also reduce the number of redundant 'check_signatures'
2021-05-04 04:50:01 +00:00
Mark Andrews
33fd1a8437 Merge branch '2621-pull-request-to-fix-rdnc-addzone-doc' into 'main'
Resolve "Pull request to fix rdnc-addzone doc"

Closes #2621

See merge request isc-projects/bind9!4882
2021-05-04 02:37:51 +00:00
Mark Andrews
205d1bb762 Remove spurious $ and \ in addzone example 2021-05-04 02:18:34 +00:00
Ondřej Surý
44c6a69c9c Merge branch 'ondrej/add-backtrace-support-for-Windows' into 'main'
Add support for generating backtraces on Windows

See merge request isc-projects/bind9!4982
2021-05-03 18:40:30 +00:00
Ondřej Surý
dfd56b84f5 Add support for generating backtraces on Windows
This commit adds support for generating backtraces on Windows and
refactors the isc_backtrace API to match the Linux/BSD API (without
the isc_ prefix)

 * isc_backtrace_gettrace() was renamed to isc_backtrace(), the third
   argument was removed and the return type was changed to int
 * isc_backtrace_symbols() was added
 * isc_backtrace_symbols_fd() was added and used as appropriate
2021-05-03 20:31:52 +02:00
Ondřej Surý
c3ee539463 Merge branch 'ondrej/add-nanosleep-and-usleep-windows-shims' into 'main'
Add nanosleep and usleep Windows shims

See merge request isc-projects/bind9!4981
2021-05-03 18:25:55 +00:00
Ondřej Surý
c58dc55c82 Merge branch 'ondrej/replace-CreateThreads-with-isc_thread_create' into 'main'
Add trampoline around iocompletionport_createthreads()

See merge request isc-projects/bind9!4980
2021-05-03 18:24:06 +00:00
Ondřej Surý
37c0d196e3 Use uv_sleep in the netmgr code
libuv added uv_sleep(unsigned int msec) to the API since 1.34.0.  Use that in
the netmgr code and define usleep based shim for libuv << 1.34.0.
2021-05-03 20:22:54 +02:00
Ondřej Surý
c37ff5d188 Add nanosleep and usleep Windows shims
This commit adds POSIX nanosleep() and usleep() shim implementation for
Windows to help implementors use less #ifdef _WIN32 in the code.
2021-05-03 20:22:54 +02:00
Ondřej Surý
cd54bbbd9a Add trampoline around iocompletionport_createthreads()
On Windows, the iocompletionport_createthreads() didn't use
isc_thread_create() to create new threads for processing IO, but just a
simple CreateThread() function that completely circumvent the
isc_trampoline mechanism to initialize global isc_tid_v.  This lead to
segmentation fault in isc_hp API because '-1' isn't valid index to the
hazard pointer array.

This commit changes the iocompletionport_createthreads() to use
isc_thread_create() instead of CreateThread() to properly initialize
isc_tid_v.
2021-05-03 20:21:15 +02:00
Diego dos Santos Fronza
9dedfcdda6 Merge branch '2627-tlsstream-c-warning-comparison-of-integer-expressions-of-different-signedness' into 'main'
Resolve "tlsstream.c: warning: comparison of integer expressions of different signedness"

Closes #2627

See merge request isc-projects/bind9!4906
2021-05-03 17:03:44 +00:00
Diego Fronza
7729844150 Address comparison of integers with different signedess 2021-05-03 06:54:30 +00:00
Matthijs Mekking
7a3b6a7fb0 Merge branch 'matthijs-nsupdate-update_test' into 'main'
Update nsupdate test

See merge request isc-projects/bind9!4975
2021-04-30 12:26:12 +00:00
Matthijs Mekking
5b31811b5f Update nsupdate test
The nsupdate system test did not record failures from the
'update_test.pl' Perl script. This was because the 'ret' value was
not being saved outside the '{ $PERL ... || ret=1 } cat_i' scope.

Change this piece to store the output in a separate file and then
cat its contents. Now the 'ret' value is being saved.

Also record failures in 'update_test.pl' if sending the update
failed.

Add missing 'n' incrementals to 'nsupdate/test.sh' to keep track of
test numbers.
2021-04-30 12:25:25 +00:00
Petr Špaček
9d04a731ba Merge branch 'pspacek/rtd-sphinx-fix' into 'main'
Fix ARM build on readthedocs.org

See merge request isc-projects/bind9!4968
2021-04-30 10:57:30 +00:00
Petr Špaček
7df913aa3a Fix ARM build on readthedocs.org
By default readthedocs.org uses Sphinx 1.8.5, but MR !4563 has
introduced depedency on ReferenceRole class which is available only in
Sphinx 2.0.0.

Path to doc/arm/requirements.txt needs to be configured in
readthedocs.org.
2021-04-30 12:56:56 +02:00
Matthijs Mekking
968b9b5697 Merge branch '2645-dnssec-polic-insecure' into 'main'
Add built-in dnssec-policy "insecure"

Closes #2645

See merge request isc-projects/bind9!4929
2021-04-30 10:10:32 +00:00
Matthijs Mekking
287428e0aa Add kasp test policy goes straight to "none"
Add a test case when a dnssec-policy is reconfigured to "none",
without setting it to "insecure" first. This is unsupported behavior,
but we want to make sure the behavior is somewhat expected. The
zone should remain signed (but will go bogus once the signatures
expire).
2021-04-30 11:20:41 +02:00
Matthijs Mekking
75024736a4 Release notes and changes for [#2645]
The feature "going insecure gracefully" has been changed.
2021-04-30 11:20:40 +02:00
Matthijs Mekking
fadc57d3d0 Update documentation with "insecure" policy
Update the ARM to mention the new built-in "insecure" policy.  Update
the DNSSEC guide recipe "Revert to unsigned" to add the additional
step of reconfiguring the zone to "insecure" (instead of immediately
set it to "none").
2021-04-30 11:18:38 +02:00
Matthijs Mekking
9c6ff463fd Add test for "insecure" policy
While it is meant to be used for transitioning a zone to insecure,
add a test case where a zone uses the "insecure" policy immediately.

The zone will go through DNSSEC maintenance, but the outcome should
be the same as 'dnssec-policy none;', that is the zone should be
unsigned.
2021-04-30 11:18:38 +02:00
Matthijs Mekking
17e3b056c8 Update kasp tests to "insecure" policy
The tests for going insecure should be changed to use the built-in
"insecure" policy.

The function that checks dnssec status output should again check
for the special case "none".
2021-04-30 11:18:38 +02:00
Matthijs Mekking
2710d9a11d Add built-in dnssec-policy "insecure"
Add a new built-in policy "insecure", to be used to gracefully unsign
a zone. Previously you could just remove the 'dnssec-policy'
configuration from your zone statement, or remove it.

The built-in policy "none" (or not configured) now actually means
no DNSSEC maintenance for the corresponding zone. So if you
immediately reconfigure your zone from whatever policy to "none",
your zone will temporarily be seen as bogus by validating resolvers.

This means we can remove the functions 'dns_zone_use_kasp()' and
'dns_zone_secure_to_insecure()' again. We also no longer have to
check for the existence of key state files to figure out if a zone
is transitioning to insecure.
2021-04-30 11:18:38 +02:00
Mark Andrews
1f4234ec89 Merge branch '2668-handle-net-dns-versions-that-don-t-support-nsec3param' into 'main'
Resolve "Handle Net::DNS versions that don't support NSEC3PARAM"

Closes #2668

See merge request isc-projects/bind9!4971
2021-04-30 06:25:39 +00:00
Mark Andrews
044933756a NSEC3PARAM support was added to Net::DNS in 1.00_06
Require 1.01 or later to when adding a NSEC3PARAM records.
2021-04-30 15:59:30 +10:00
Mark Andrews
7b62af4e0e Merge branch '2658-update-zonemd-now-that-rfc-8976-has-been-issued' into 'main'
Resolve "Update ZONEMD now that RFC 8976 has been issued."

Closes #2658

See merge request isc-projects/bind9!4946
2021-04-30 01:08:46 +00:00
Mark Andrews
8510ccaa54 Update ZONEMD to match RFC 8976
* The location of the digest type field has changed to where the
  reserved field was.
* The reserved field is now called scheme and is where the digest
  type field was.
* Digest type 2 has been defined (SHA256).
2021-04-30 10:43:37 +10:00
Michal Nowak
c922608333 Merge branch 'mnowak/configure-with-enable-dnstap-by-default' into 'main'
Configure with --enable-dnstap by default

See merge request isc-projects/bind9!4618
2021-04-29 13:58:33 +00:00
Michal Nowak
c97c6fbfea Suppress TSAN errors from libfstrm.so
dnstap_test produces TSAN errors which originate in libfstrm.so. Unless
libfstrm is TSAN clean or a workaround is placed in libfstrm sources,
suppressing TSAN coming from libfstrm is necessary to test DNSTAP under
TSAN.
2021-04-29 15:57:07 +02:00
Michal Nowak
deff0ae317 Configure with --enable-dnstap by default
All platforms but OpenBSD have dnstap dependencies readily in their
respective repositories, and dnstap thus can be tested there. Given that
majority of images have dnstap dependencies available, it seems fitting
to make dnstap enabled by default.
2021-04-29 15:57:07 +02:00
Michal Nowak
f11f7d0086 Merge branch 'mnowak/disable-pytest-cacheprovider-plugin' into 'main'
Disable pytest cacheprovider plugin in CI

See merge request isc-projects/bind9!4961
2021-04-29 13:43:10 +00:00
Michal Nowak
e1c3034107 Disable pytest cacheprovider plugin in CI
The pytest "cacheprovider" plugin produces a .cache/v/cache/lastfailed
file, which holds a Python dictionary structure with failed tests.
However, on Ubuntu 16.04 (Xenial) the file is created even though the
test passed and the file contains just an empty dictionary ("{}").

Given that we are not interested in this feature, disabling the
"cacheprovider" plugin globally and removing per-test removals of the
.cache directory seems like the best course of action.
2021-04-29 15:29:18 +02:00
Matthijs Mekking
c2f43e9516 Merge branch '2445-nsec3-iterations-resolver' into 'main'
Resolve "NSEC3 iterations"

Closes #2445

See merge request isc-projects/bind9!4957
2021-04-29 13:09:30 +00:00
Mark Andrews
ad236976fc Add release note for [GL #2445] 2021-04-29 13:43:40 +02:00
Mark Andrews
fd1f7b6480 Add CHANGES for [GL #2445] 2021-04-29 13:43:40 +02:00
Mark Andrews
e6e0e29fbb Check insecure responses returned with too many NSEC3 iterations 2021-04-29 13:43:40 +02:00
Mark Andrews
af02bbcdd6 Mark DNSSEC responses with NSEC3 records that exceed 150 as insecure 2021-04-29 13:43:40 +02:00
Michał Kępień
b189defb6a Merge branch '2372-add-hyperlink-to-gl-xxxx-labels-in-documentation' into 'main'
Resolve "Add hyperlink to [GL XXXX] labels in documentation"

Closes #2372

See merge request isc-projects/bind9!4563
2021-04-29 11:35:33 +00:00
Michal Nowak
fe1dea6572 Update Danger check for GitLab references
Release notes now employ a custom :gl: Sphinx role for linking to GitLab
issues/MRs.  Tweak the relevant Danger checks to account for that.
2021-04-29 13:24:21 +02:00
Michał Kępień
2fadf29e6b Add a Sphinx role for linking GitLab issues/MRs
Define a :gl: Sphinx role that takes a GitLab issue/MR number as an
argument and creates a hyperlink to the relevant ISC GitLab URL.  This
makes it easy to reach ISC GitLab pages directly from the release notes.

Make all GitLab references in the release notes use the new Sphinx role.
2021-04-29 13:24:21 +02:00
Michal Nowak
aeb43a45ac Make use of the :rfc: role in the ARM consistent
Make sure all RFC references in the ARM use the stock :rfc: Sphinx role.
2021-04-29 13:24:21 +02:00
Ondřej Surý
9c3fac706e Merge branch 'ondrej/use-sigabrt-from-start.pl' into 'main'
Use SIGABRT instead of SIGKILL to produce cores on failed start

See merge request isc-projects/bind9!4928
2021-04-29 10:44:26 +00:00
Ondřej Surý
861a236937 Use SIGABRT instead of SIGKILL to produce cores on failed start
When the `named` would hang on startup it would be killed with SIGKILL
leaving us with no information about the state the process was in.
This commit changes the start.pl script to send SIGABRT instead, so we
can properly collect and process the coredump from the hung named
process.
2021-04-29 12:03:50 +02:00
Matthijs Mekking
d8355d197d Merge branch 'matthijs-follow-up-2642-nsec3-iter-kasp' into 'main'
dnssec-policy: reduce NSEC3 iterations to 150

See merge request isc-projects/bind9!4952
2021-04-29 09:32:20 +00:00
Matthijs Mekking
efa5d84dcf dnssec-policy: reduce NSEC3 iterations to 150
When reducing the number of NSEC3 iterations to 150, commit
aa26cde2ae added tests for dnssec-policy
to check that a too high iteration count is a configuration failure.

The test is not sufficient because 151 was always too high for
ECDSAP256SHA256. The test should check for a different algorithm.

There was an existing test case that checks for NSEC3 iterations.
Update the test with the new maximum values.

Update the code in 'kaspconf.c' to allow at most 150 iterations.
2021-04-29 10:41:16 +02:00
Michał Kępień
0fd3c8e48b Merge branch 'v9_17_12-release' into 'main'
Merge 9.17.12 release branch

See merge request isc-projects/bind9!4953
2021-04-29 08:37:11 +00:00
Michał Kępień
0c4694277f Set up release notes for BIND 9.17.13 2021-04-29 10:30:00 +02:00
Michał Kępień
3ea6421c49 Update BIND version to 9.17.12 2021-04-29 10:30:00 +02:00
Michał Kępień
a0618507c4 Add a CHANGES marker 2021-04-29 10:30:00 +02:00
Michał Kępień
628ed23b7c Merge branch 'michal/prepare-documentation-for-bind-9.17.12' into 'security-main'
Prepare documentation for BIND 9.17.12

See merge request isc-private/bind9!280
2021-04-29 10:30:00 +02:00
Michał Kępień
9879d2a6b4 Merge branch '2540-confidential-issue-existing-dname' into 'security-main'
[CVE-2021-25215] Properly answer queries for DNAME records that require the DNAME to be processed to resolve itself

See merge request isc-private/bind9!253
2021-04-29 10:30:00 +02:00
Michał Kępień
a051dd65e2 Prepare release notes for BIND 9.17.12 2021-04-29 10:30:00 +02:00
Michał Kępień
df2edd67da Merge branch '2467-confidential-issue-ixfr-checks' into 'security-main'
[CVE-2021-25214] Prevent malformed incoming zone transfers from producing a zone without an SOA record

See merge request isc-private/bind9!239
2021-04-29 10:30:00 +02:00
Mark Andrews
f1d81d4e89 Add Release Notes entry for [GL #2540] 2021-04-29 10:30:00 +02:00
Michał Kępień
e8d9de39ac Add release note for GL #2490 2021-04-29 10:30:00 +02:00
Mark Andrews
bd8a4a46df Add release note for [GL #2467] 2021-04-29 10:30:00 +02:00
Mark Andrews
a2954c3b57 Add CHANGES entry for [GL #2540] 2021-04-29 10:30:00 +02:00
Michał Kępień
4ac14c4a83 Reorder release notes 2021-04-29 10:30:00 +02:00
Mark Andrews
83ab536a30 Add CHANGES entry for [GL #2467] 2021-04-29 10:30:00 +02:00
Mark Andrews
c1190a3fe0 Handle DNAME lookup via itself
When answering a query, named should never attempt to add the same RRset
to the ANSWER section more than once.  However, such a situation may
arise when chasing DNAME records: one of the DNAME records placed in the
ANSWER section may turn out to be the final answer to a client query,
but there is no way to know that in advance.  Tweak the relevant INSIST
assertion in query_respond() so that it handles this case properly.
qctx->rdataset is freed later anyway, so there is no need to clean it up
in query_respond().
2021-04-29 10:30:00 +02:00
Michał Kępień
3270ac7d9b Tweak and reword release notes 2021-04-29 10:30:00 +02:00
Mark Andrews
5318627227 Unload a zone if a transfer breaks its SOA record
If a zone transfer results in a zone not having any NS records, named
stops serving it because such a zone is broken.  Do the same if an
incoming zone transfer results in a zone lacking an SOA record at the
apex or containing more than one SOA record.
2021-04-29 10:30:00 +02:00
Michał Kępień
d9011c2a4d Tweak and reword recent CHANGES entries 2021-04-29 10:30:00 +02:00
Mark Andrews
2ca0bd882d Address inconsistencies in checking added RRsets
loading_addrdataset() rejects SOA RRsets which are not at top of zone.
addrdataset() should similarly reject such RRsets.
2021-04-29 10:30:00 +02:00
Mark Andrews
01209dfa49 Check SOA owner names in zone transfers
An IXFR containing SOA records with owner names different than the
transferred zone's origin can result in named serving a version of that
zone without an SOA record at the apex.  This causes a RUNTIME_CHECK
assertion failure the next time such a zone is refreshed.  Fix by
immediately rejecting a zone transfer (either an incremental or
non-incremental one) upon detecting an SOA record not placed at the apex
of the transferred zone.
2021-04-29 10:30:00 +02:00
Mark Andrews
0695a42adb Merge branch '2642-reduce-the-maximum-nsec3-iterations-that-can-be-configured' into 'main'
Resolve "Reduce the maximum NSEC3 iterations that can be configured"

Closes #2642

See merge request isc-projects/bind9!4925
2021-04-29 07:39:10 +00:00
Mark Andrews
ca07b8e414 Add Release Note for [GL #2642] 2021-04-29 17:18:26 +10:00
Mark Andrews
e04f06873f Add CHANGES for [GL #2642]
5625.   [func]          Reduce the supported maximum number of iterations
                        that can be configured in an NSEC3 zones to 150.
                        [GL #2642]
2021-04-29 17:18:26 +10:00
Mark Andrews
46eb21c546 Check that excessive iterations in logged by named when
loading an existing zone or transfering from the primary.
2021-04-29 17:18:26 +10:00
Mark Andrews
8ec16c378d Check NSEC3 iterations with dnssec-signzone 2021-04-29 17:18:26 +10:00
Mark Andrews
4ce8437a6e Check that named rejects excessive iterations via UPDATE 2021-04-29 17:18:26 +10:00
Mark Andrews
3fe75d9809 nsupdate: reject attempts to add NSEC3PARAM with excessive iterations 2021-04-29 17:18:26 +10:00
Mark Andrews
c9f5f8a059 Warn if there is excessive NSEC3 iterations 2021-04-29 17:18:26 +10:00
Mark Andrews
aa26cde2ae Check dnssec-policy nsec3param iterations limit 2021-04-29 17:18:26 +10:00
Mark Andrews
29126500d2 Reduce nsec3 max iterations to 150 2021-04-29 17:18:26 +10:00
Matthijs Mekking
51f94b8c7c Merge branch 'matthijs-nit-serve-stale-fixes' into 'main'
Serve-stale nit fixes

See merge request isc-projects/bind9!4940
2021-04-28 10:43:49 +00:00
Matthijs Mekking
104b676235 Serve-stale nit fixes
While working on the serve-stale backports, I noticed the following
oddities:

1. In the serve-stale system test, in one case we keep track of the
   time how long it took for dig to complete. In commit
   aaed7f9d8c, the code removed the
   exception to check for result == ISC_R_SUCCESS on stale found
   answers, and adjusted the test accordingly. This failed to update
   the time tracking accordingly. Move the t1/t2 time track variables
   back around the two dig commands to ensure the lookups resolved
   faster than the resolver-query-timeout.

2. We can remove the setting of NS_QUERYATTR_STALEOK and
   DNS_RDATASETATTR_STALE_ADDED on the "else if (stale_timeout)"
   code path, because they are added later when we know we have
   actually found a stale answer on a stale timeout lookup.

3. We should clear the NS_QUERYATTR_STALEOK flag from the client
   query attributes instead of DNS_RDATASETATTR_STALE_ADDED (that
   flag is set on the rdataset attributes).

4. In 'bin/named/config.c' we should set the configuration options
   in alpabetical order.

5. In the ARM, in the backports we have added "(stale)" between
   "cached" and "RRset" to make more clear a stale RRset may be
   returned in this scenario.
2021-04-28 12:24:24 +02:00
Michał Kępień
7c7b97b916 Merge branch 'michal/limit-logging-for-verbose-system-tests' into 'main'
Limit logging for verbose system tests

See merge request isc-projects/bind9!4812
2021-04-28 06:58:34 +00:00
Michał Kępień
241e85ef0c Warn when log files grow too big in system tests
Exerting excessive I/O load on the host running system tests should be
avoided in order to limit the number of false positives reported by the
system test suite.  In some cases, running named with "-d 99" (which is
the default for system tests) results in a massive amount of logs being
generated, most of which are useless.  Implement a log file size check
to draw developers' attention to overly verbose named instances used in
system tests.  The warning threshold of 200,000 lines was chosen
arbitrarily.
2021-04-28 07:56:47 +02:00
Michał Kępień
17e5c2a50e Prevent useless logging in the "tcp" system test
The regression test for CVE-2020-8620 causes a lot of useless messages
to be logged.  However, globally decreasing the log level for the
affected named instance would be a step too far as debugging information
may be useful for troubleshooting other checks in the "tcp" system test.
Starting a separate named instance for a single check should be avoided
when possible and thus is also not a good solution.  As a compromise,
run "rndc trace 1" for the affected named instance before starting the
regression test for CVE-2020-8620.
2021-04-28 07:56:47 +02:00
Michał Kępień
4a8d404876 Limit logging for verbose system tests
The system test framework starts all named instances with the "-d 99"
command line option (unless it is overridden by a named.args file in a
given instance's working directory).  This causes a lot of log messages
to be written to named.run files - currently over 5 million lines for a
single test suite run.  While debugging information preserved in the log
files is essential for troubleshooting intermittent test failures, some
system tests involve sending hundreds or even thousands of queries,
which causes the relevant log files to explode in size.  When multiple
tests (or even multiple test suites) are run in parallel, excessive
logging contributes considerably to the I/O load on the test host,
increasing the odds of intermittent test failures getting triggered.

Decrease the debug level for the seven most verbose named instances:

  - use "-d 3" for ns2 in the "cacheclean" system test (it is the lowest
    logging level at which the test still passes without the need to
    apply any changes to tests.sh),

  - use "-d 1" for the other six named instances.

This roughly halves the number of lines logged by each test suite run
while still leaving enough information in the logs to allow at least
basic troubleshooting in case of test failures.

This approach was chosen as it results in a greater decrease in the
number of lines logged than running all named instances with "-d 3",
without causing any test failures.
2021-04-28 07:56:47 +02:00
Diego dos Santos Fronza
99a4f6119a Merge branch '2529-add-__attribute__-malloc-for-isc_mempool_get' into 'main'
Resolve "Add __attribute__((malloc)) for isc_mempool_get"

Closes #2529

See merge request isc-projects/bind9!4858
2021-04-26 14:50:15 +00:00
Diego Fronza
54aa60eef8 Add malloc attribute to memory allocation functions
The malloc attribute allows compiler to do some optmizations on
functions that behave like malloc/calloc, like assuming that the
returned pointer do not alias other pointers.
2021-04-26 11:32:17 -03:00
Diego Fronza
efb9c540cd Removed unnecessary check (mpctx->items == NULL)
There is no possibility for mpctx->items to be NULL at the point where
the code was removed, since we enforce that fillcount > 0, if
mpctx->items == NULL when isc_mempool_get is called, then we will
allocate fillcount more items and add to the mpctx->items list.
2021-04-26 11:32:17 -03:00
Diego dos Santos Fronza
19df09d225 Merge branch '2564-nslookup-segfaults-for-servfail' into 'main'
Add workaround for "nslookup segfaults for SERVFAIL"

See merge request isc-projects/bind9!4796
2021-04-26 14:30:46 +00:00
Mark Andrews
f2d00069c3 Add CHANGES note for [GL #2564] 2021-04-26 11:15:25 -03:00
Diego Fronza
4d6408b823 Fix following up lookup failure if more resolvers are available
_query_detach function was incorrectly unliking the query object from
the lookup->q query list, this made it impossible to follow a query
lookup failure with the next one in the list (possibly using a separate
resolver), as the link to the next query in the list was dissolved.

Fix by unliking the node only when the query object is about to be
destroyed, i.e. there is no more references to the object.
2021-04-26 11:14:14 -03:00
Michał Kępień
3793733704 Merge branch '2650-handle-soa-rrsigs-not-at-zone-apex' into 'main'
Handle RRSIG(SOA) RRsets not at zone apex

Closes #2650

See merge request isc-projects/bind9!4936
2021-04-26 11:06:00 +00:00
Matthijs Mekking
a64dd511f4 Merge branch '2628-kasp-create-multiple-key-keyid-conflict' into 'main'
Check for keyid conflicts between new keys

Closes #2628

See merge request isc-projects/bind9!4886
2021-04-26 09:29:19 +00:00
Matthijs Mekking
b99ec65745 Changes and release notes for [#2628] 2021-04-26 10:43:39 +02:00
Matthijs Mekking
668301f138 Check for keyid conflicts between new keys
When the keymgr needs to create new keys, it is possible it needs to
create multiple keys. The keymgr checks for keyid conflicts with
already existing keys, but it should also check against that it just
created.
2021-04-26 10:42:46 +02:00
Michał Kępień
c84399df64 Merge branch '2634-test-tkey-gssapi-credential-conditionally' into 'main'
Test "tkey-gssapi-credential" conditionally

Closes #2634

See merge request isc-projects/bind9!4938
2021-04-26 07:17:12 +00:00
Michał Kępień
a3957af864 Test "--without-gssapi" in GitLab CI
GitLab CI pipelines do not currently include a Linux job that would have
GSSAPI support disabled.  Add the "--without-gssapi" option to the
./configure invocation on Debian 9 to address that deficiency and also
to continuously test that build-time switch.
2021-04-26 07:16:38 +02:00
Michał Kępień
6feac68b50 Test "tkey-gssapi-credential" conditionally
If "tkey-gssapi-credential" is set in the configuration and GSSAPI
support is not available, named will refuse to start.  As the test
system framework does not support starting named instances
conditionally, ensure that "tkey-gssapi-credential" is only present in
named.conf if GSSAPI support is available.
2021-04-26 07:16:38 +02:00
Mark Andrews
a26e29896a Merge branch 'marka-shutdown-sync' into 'main'
shutdown: wait for named to start

See merge request isc-projects/bind9!4921
2021-04-24 04:36:45 +00:00
Mark Andrews
8d5870f9df Wait for named to start
If we don't wait for named to finish starting, 'rndc stop' may
fail due to the listen limit being reached in named leading
to a false negative test
2021-04-24 01:19:47 +00:00
Evan Hunt
f8275c30da Merge branch 'each-timeout-recovery' into 'main'
ensure read timeouts are recoverable

See merge request isc-projects/bind9!4930
2021-04-23 17:26:05 +00:00
Artem Boldariev
62033110b9 Use a constant for timeouts in soft-timeout tests
It makes it easier to change the value should the need arise.
2021-04-23 10:01:42 -07:00
Evan Hunt
7f367b0c7f use the correct handle when calling the read callback
when calling isc_nm_read() on an HTTP socket, the read callback
was being run with the incorrect handle. this has been corrected.
2021-04-23 10:01:42 -07:00
Evan Hunt
f0d75ee7c3 fix DOH timeout recovery
as with TLS, the destruction of a client stream on failed read
needs to be conditional: if we reached failed_read_cb() as a
result of a timeout on a timer which has subsequently been
reset, the stream must not be closed.
2021-04-23 10:01:42 -07:00
Michał Kępień
47a7b042e5 Add CHANGES entry 2021-04-23 14:26:48 +02:00
Michał Kępień
24bf4b946a Test handling of non-apex RRSIG(SOA) RRsets
Add a check to the "dnssec" system test which ensures that RRSIG(SOA)
RRsets present anywhere else than at the zone apex are automatically
removed after a zone containing such RRsets is loaded.
2021-04-23 14:26:48 +02:00
Mark Andrews
b7cdc3583e Be more precise with the stopping conditions in zone_resigninc
If there happens to be a RRSIG(SOA) that is not at the zone apex
for any reason it should not be considered as a stopping condition
for incremental zone signing.
2021-04-23 14:26:48 +02:00
Evan Hunt
b258df8562 add HTTP timeout recovery test
NOTE: this test currently fails
2021-04-22 12:40:04 -07:00
Evan Hunt
23ec011298 fix TLS timeout recovery
the destruction of the socket in tls_failed_read_cb() needs to be
conditional; if reached due to a timeout on a timer that has
subsequently been reset, the socket must not be destroyed.
2021-04-22 12:08:04 -07:00
Evan Hunt
c90da99180 fix TCP timeout recovery
removed an unnecessary assert in the failed_read_cb() function.
also renamed to isc__nm_tcp_failed_read_cb() to match the practice
in other modules.
2021-04-22 12:08:04 -07:00
Evan Hunt
25ef0547a9 add TCP and TLS timeout recovery tests
NOTE: currently these tests fail
2021-04-22 12:08:04 -07:00
Evan Hunt
52f256f9ae add TCPDNS and TLSDNS timeout recovery tests
this is similar in structure to the UDP timeout recovery test.

this commit adds a new mechanism to the netmgr test allowing the
listen socket to accept incoming TCP connections but never send
a response. this forces the client to time out on read.
2021-04-22 12:08:04 -07:00
Evan Hunt
bcf5b2a675 run read callbacks synchronously on timeout
when running read callbacks, if the event result is not ISC_R_SUCCESS,
the callback is always run asynchronously. this is a problem on timeout,
because there's no chance to reset the timer before the socket has
already been destroyed. this commit allows read callbacks to run
synchronously for both ISC_R_SUCCESS and ISC_R_TIMEDOUT result codes.
2021-04-22 12:08:04 -07:00
Evan Hunt
609975ad20 add a UDP timeout recovery test
this test sets up a server socket that listens for UDP connections
but never responds. the client will always time out; it should retry
five times before giving up.
2021-04-22 12:08:04 -07:00
Evan Hunt
1f41d59a5e allow client read callback to be assignable
allow netmgr client tests to choose the function that will be
used as a read callback, without having to write a different
connect callback handler.
2021-04-22 12:08:04 -07:00
Diego dos Santos Fronza
289d7c2acc Merge branch '2626-deadlock-with-concurrent-rndc-addzone-rndc-delzone-commands' into 'main'
Resolve "Deadlock with concurrent `rndc addzone`/`rndc delzone` commands"

Closes #2626

See merge request isc-projects/bind9!4904
2021-04-22 15:47:16 +00:00
Diego Fronza
6646655067 Add CHANGES note for GL #2626 2021-04-22 15:45:55 +00:00
Diego Fronza
d6224035d8 Add system test for the deadlock fix
The test spawns 4 parallel workers that keep adding, modifying and
deleting zones, the main thread repeatedly checks wheter rndc
status responds within a reasonable period.

While environment and timing issues may affect the test, in most
test cases the deadlock that was taking place before the fix used to
trigger in less than 7 seconds in a machine with at least 2 cores.
2021-04-22 15:45:55 +00:00
Diego Fronza
9298dcebbd Fix deadlock between rndc addzone/delzone/modzone
It follows a description of the steps that were leading to the deadlock:

1. `do_addzone` calls `isc_task_beginexclusive`.

2. `isc_task_beginexclusive` waits for (N_WORKERS - 1) halted tasks,
   this blocks waiting for those (no. workers -1) workers to halt.
...
isc_task_beginexclusive(isc_task_t *task0) {
    ...
	while (manager->halted + 1 < manager->workers) {
		wake_all_queues(manager);
		WAIT(&manager->halt_cond, &manager->halt_lock);
	}
```

3. It is possible that in `task.c / dispatch()` a worker is running a
   task event, if that event blocks it will not allow this worker to
   halt.

4. `do_addzone` acquires `LOCK(&view->new_zone_lock);`,

5. `rmzone` event is called from some worker's `dispatch()`, `rmzone`
   blocks waiting for the same lock.

6. `do_addzone` calls `isc_task_beginexclusive`.

7. Deadlock triggered, since:
	- `rmzone` is wating for the lock.
	- `isc_task_beginexclusive` is waiting for (no. workers - 1) to
	   be halted
	- since `rmzone` event is blocked it won't allow the worker to halt.

To fix this, we updated do_addzone code to call isc_task_beginexclusive
before the lock is acquired, we postpone locking to the nearest required
place, same for isc_task_beginexclusive.

The same could happen with rndc modzone, so that was addressed as well.
2021-04-22 15:45:55 +00:00
Petr Špaček
fa6b277b8d Merge branch '2634-test-tkey-gssapi-credential' into 'main'
Add tests for the "tkey-gssapi-credential" option

See merge request isc-projects/bind9!4905
2021-04-22 15:25:36 +00:00
Petr Špaček
1746d2e84a Add tests for the "tkey-gssapi-credential" option
Four named instances in the "nsupdate" system test have GSS-TSIG support
enabled.  All of them currently use "tkey-gssapi-keytab".  Configure two
of them with "tkey-gssapi-credential" to test that option.

As "tkey-gssapi-keytab" and "tkey-gssapi-credential" both provide the
same functionality, no test modifications are required.  The difference
between the two options is that the value of "tkey-gssapi-keytab" is an
explicit path to the keytab file to acquire credentials from, while the
value of "tkey-gssapi-credential" is the name of the principal whose
credentials should be used; those credentials are looked up in the
keytab file expected by the Kerberos library, i.e. /etc/krb5.keytab by
default.  The path to the default keytab file can be overridden using by
setting the KRB5_KTNAME environment variable.  Utilize that variable to
use existing keytab files with the "tkey-gssapi-credential" option.

The KRB5_KTNAME environment variable should not interfere with the
"tkey-gssapi-keytab" option.  Nevertheless, rename one of the keytab
files used with "tkey-gssapi-keytab" to something else than the contents
of the KRB5_KTNAME environment variable in order to make sure that both
"tkey-gssapi-keytab" and "tkey-gssapi-credential" are actually tested.
2021-04-22 16:15:22 +02:00
Ondřej Surý
c38bcb6968 Merge branch 'ondrej/autoconf-2.71-fixes' into 'main'
Update the configure.ac for autoconf >= 2.71 compatibility

See merge request isc-projects/bind9!4899
2021-04-22 12:41:11 +00:00
Ondřej Surý
f52872c3ed Update the configure.ac for autoconf >= 2.71 compatibility
This mostly removes stuff that's either deprecated, obsolete or not used
at all:

* Update the minimal autoconf version to 2.69
* AC_PROG_CC_C99 is deprecated, just use AC_PROG_CC as we require C11
  anyway
* AC_HEADER_TIME is deprecated, both <sys/time.h> and <time.h> can be
  included at the same time, and we don't use the macros that
  AC_HEADER_TIME defines anywhere
* AC_HEADER_STDC checks for ISO C90 and we require at least C11
* Replace AC_TRY_*([]) with AC_*_IFELSE([AC_LANG_PROGRAM()])
* Update m4/ax_check_openssl.m4 from serial 10 to serial 11
* Update m4/ax_gcc_func_attribute.m4 from serial 10 to serial 13
* Update m4/ax_pthread.m4 from serial 24 to serial 30
* Add early AC_CANONICAL_TARGET call to prevent warning from AX_PTHREAD
2021-04-22 13:52:40 +02:00
Mark Andrews
fdf5184bf5 Merge branch '2625-the-shutdown-system-test-is-not-capturing-enough' into 'main'
Resolve "The shutdown system test is not capturing enough"

Closes #2625

See merge request isc-projects/bind9!4883
2021-04-22 06:47:21 +00:00
Mark Andrews
c3c7f5849c Abort named if 'rndc stop' or 'kill TERM' has failed to shutdown 2021-04-22 05:43:00 +00:00
Ondřej Surý
60bf42b3e1 Merge branch '2638-run-internal-tasks-on-top-of-network-manager-worker-loops' into 'main'
Refactor taskmgr to run on top of netmgr

Closes #2638

See merge request isc-projects/bind9!4918
2021-04-20 22:16:42 +00:00
Ondřej Surý
f022d2db8c Add CHANGES and release note for [GL #2638] 2021-04-20 23:22:28 +02:00
Ondřej Surý
b540722bc3 Refactor taskmgr to run on top of netmgr
This commit changes the taskmgr to run the individual tasks on the
netmgr internal workers.  While an effort has been put into keeping the
taskmgr interface intact, couple of changes have been made:

 * The taskmgr has no concept of universal privileged mode - rather the
   tasks are either privileged or unprivileged (normal).  The privileged
   tasks are run as a first thing when the netmgr is unpaused.  There
   are now four different queues in in the netmgr:

   1. priority queue - netievent on the priority queue are run even when
      the taskmgr enter exclusive mode and netmgr is paused.  This is
      needed to properly start listening on the interfaces, free
      resources and resume.

   2. privileged task queue - only privileged tasks are queued here and
      this is the first queue that gets processed when network manager
      is unpaused using isc_nm_resume().  All netmgr workers need to
      clean the privileged task queue before they all proceed normal
      operation.  Both task queues are processed when the workers are
      finished.

   3. task queue - only (traditional) task are scheduled here and this
      queue along with privileged task queues are process when the
      netmgr workers are finishing.  This is needed to process the task
      shutdown events.

   4. normal queue - this is the queue with netmgr events, e.g. reading,
      sending, callbacks and pretty much everything is processed here.

 * The isc_taskmgr_create() now requires initialized netmgr (isc_nm_t)
   object.

 * The isc_nm_destroy() function now waits for indefinite time, but it
   will print out the active objects when in tracing mode
   (-DNETMGR_TRACE=1 and -DNETMGR_TRACE_VERBOSE=1), the netmgr has been
   made a little bit more asynchronous and it might take longer time to
   shutdown all the active networking connections.

 * Previously, the isc_nm_stoplistening() was a synchronous operation.
   This has been changed and the isc_nm_stoplistening() just schedules
   the child sockets to stop listening and exits.  This was needed to
   prevent a deadlock as the the (traditional) tasks are now executed on
   the netmgr threads.

 * The socket selection logic in isc__nm_udp_send() was flawed, but
   fortunatelly, it was broken, so we never hit the problem where we
   created uvreq_t on a socket from nmhandle_t, but then a different
   socket could be picked up and then we were trying to run the send
   callback on a socket that had different threadid than currently
   running.
2021-04-20 23:22:28 +02:00
Ondřej Surý
ae9edb1861 Merge branch '2630-tsan-error-in-xfrin-c' into 'main'
Prevent the double xfrin_fail() call

Closes #2630

See merge request isc-projects/bind9!4898
2021-04-20 12:13:35 +00:00
Ondřej Surý
30252aed88 Add CHANGES note for [GL #2630] 2021-04-20 14:12:26 +02:00
Ondřej Surý
6cf6de55bc Prevent the double xfrin_fail() call
When we are reading from the xfrin socket, and the transfer would be
shutdown, the shutdown function would call `xfrin_fail()` which in turns
calls `xfrin_cancelio()` that causes the read callback to be invoked
with `ISC_R_CANCELED` status code and that caused yet another
`xfrin_fail()` call.

The fix here is to ensure the `xfrin_fail()` would be run only once
properly using better synchronization on xfr->shuttingdown flag.
2021-04-20 14:12:26 +02:00
Ondřej Surý
27960e4208 Merge branch '2637-threadsanitizer-lock-order-inversion-potential-deadlock-in-zone_refreshkeys' into 'main'
Fix lock-order-inversion (potential deadlock) in dns_resolver_createfetch

Closes #2637

See merge request isc-projects/bind9!4909
2021-04-19 20:29:56 +00:00
Ondřej Surý
25d27851d8 Fix lock-order-inversion (potential deadlock) in dns_resolver_createfetch
There's a lock-order-inversion when running `zone_maintenance()` from
the timer while shutting down the server `shutdown_server()`.  This only
happens when the taskmgr scheduling is more relaxed and paralellized,
but the issue is real nevertheless.

The associated ThreadSanitizer warning:

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
      Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000000) => M1

      Mutex M2 acquired here while holding mutex M1 in thread T1:
	#0 pthread_mutex_lock <null>
	#1 dns_view_findzonecut lib/dns/view.c:1326:2
	#2 fctx_create lib/dns/resolver.c:5144:13
	#3 dns_resolver_createfetch lib/dns/resolver.c:10977:12
	#4 zone_refreshkeys lib/dns/zone.c:10830:13
	#5 zone_maintenance lib/dns/zone.c:11065:5
	#6 zone_timer lib/dns/zone.c:14652:2
	#7 task_run lib/isc/task.c:857:5
	#8 isc_task_run lib/isc/task.c:944:10
	#9 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#10 process_netievent lib/isc/netmgr/netmgr.c
	#11 process_queue lib/isc/netmgr/netmgr.c:885:8
	#12 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#13 process_queues lib/isc/netmgr/netmgr.c:772:7
	#14 async_cb lib/isc/netmgr/netmgr.c:671:2
	#15 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#16 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#17 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#18 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#19 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M1 previously acquired by the same thread here:
	#0 pthread_mutex_lock <null>
	#1 zone_refreshkeys lib/dns/zone.c:10717:2
	#2 zone_maintenance lib/dns/zone.c:11065:5
	#3 zone_timer lib/dns/zone.c:14652:2
	#4 task_run lib/isc/task.c:857:5
	#5 isc_task_run lib/isc/task.c:944:10
	#6 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#7 process_netievent lib/isc/netmgr/netmgr.c
	#8 process_queue lib/isc/netmgr/netmgr.c:885:8
	#9 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#10 process_queues lib/isc/netmgr/netmgr.c:772:7
	#11 async_cb lib/isc/netmgr/netmgr.c:671:2
	#12 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#13 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#14 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#15 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#16 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M1 acquired here while holding mutex M2 in thread T2:
	#0 pthread_mutex_lock <null>
	#1 dns_zone_flush lib/dns/zone.c:11443:2
	#2 view_flushanddetach lib/dns/view.c:657:5
	#3 dns_view_flushanddetach lib/dns/view.c:690:2
	#4 shutdown_server bin/named/server.c:10056:4
	#5 task_run lib/isc/task.c:857:5
	#6 isc_task_run lib/isc/task.c:944:10
	#7 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#8 process_netievent lib/isc/netmgr/netmgr.c
	#9 process_queue lib/isc/netmgr/netmgr.c:885:8
	#10 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#11 process_queues lib/isc/netmgr/netmgr.c:772:7
	#12 async_cb lib/isc/netmgr/netmgr.c:671:2
	#13 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#14 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#15 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#16 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#17 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M2 previously acquired by the same thread here:
	#0 pthread_mutex_lock <null>
	#1 view_flushanddetach lib/dns/view.c:645:3
	#2 dns_view_flushanddetach lib/dns/view.c:690:2
	#3 shutdown_server bin/named/server.c:10056:4
	#4 task_run lib/isc/task.c:857:5
	#5 isc_task_run lib/isc/task.c:944:10
	#6 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#7 process_netievent lib/isc/netmgr/netmgr.c
	#8 process_queue lib/isc/netmgr/netmgr.c:885:8
	#9 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#10 process_queues lib/isc/netmgr/netmgr.c:772:7
	#11 async_cb lib/isc/netmgr/netmgr.c:671:2
	#12 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#13 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#14 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#15 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#16 isc__trampoline_run lib/isc/trampoline.c:184:11

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:79:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:303:3
	#3 create_managers bin/named/main.c:957:15
	#4 setup bin/named/main.c:1267:11
	#5 main bin/named/main.c:1558:2

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:79:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:303:3
	#3 create_managers bin/named/main.c:957:15
	#4 setup bin/named/main.c:1267:11
	#5 main bin/named/main.c:1558:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in __interceptor_pthread_mutex_lock
2021-04-19 22:29:14 +02:00
Ondřej Surý
3f0c8189e7 Merge branch 'ondrej/cleanup-ISCAPI-remnants' into 'main'
Cleanup the public vs private ISCAPI remnants

See merge request isc-projects/bind9!4911
2021-04-19 11:48:14 +00:00
Ondřej Surý
16fe0d1f41 Cleanup the public vs private ISCAPI remnants
Since all the libraries are internal now, just cleanup the ISCAPI remnants
in isc_socket, isc_task and isc_timer APIs.  This means, there's one less
layer as following changes have been done:

 * struct isc_socket and struct isc_socketmgr have been removed
 * struct isc__socket and struct isc__socketmgr have been renamed
   to struct isc_socket and struct isc_socketmgr
 * struct isc_task and struct isc_taskmgr have been removed
 * struct isc__task and struct isc__taskmgr have been renamed
   to struct isc_task and struct isc_taskmgr
 * struct isc_timer and struct isc_timermgr have been removed
 * struct isc__timer and struct isc__timermgr have been renamed
   to struct isc_timer and struct isc_timermgr
 * All the associated code that dealt with typing isc_<foo>
   to isc__<foo> and back has been removed.
2021-04-19 13:18:24 +02:00
Ondřej Surý
5937c1f787 Merge branch 'ondrej/fixup-bin/tests/system/resolve-win32-directories' into 'main'
Fixup win32 paths for moved bin/tests/system/resolve

See merge request isc-projects/bind9!4916
2021-04-19 11:15:12 +00:00
Ondřej Surý
f14e678624 Fixup win32 paths for moved bin/tests/system/resolve
When resolve.c was moved from lib/samples to bin/tests/system, the
resolve.vcxproj.in would still contain old paths to the directory
root. This commit adds one more ..\ to match the directory depth.

Additionally, fixup the path in BINDInstall.vcxproj.in to be
bin/tests/system and not bin/tests/samples.
2021-04-19 12:51:33 +02:00
Ondřej Surý
11d3c475bd Merge branch '2636-timing-race-in-setnsec3param-task' into 'main'
Fix task timing race in setnsec3param()

Closes #2636

See merge request isc-projects/bind9!4908
2021-04-19 09:22:31 +00:00
Ondřej Surý
0127ba6472 Fix task timing race in setnsec3param()
When setnsec3param() is schedule from zone_postload() there's no
guarantee that `zone->db` is not `NULL` yet.  Thus when the
setnsec3param() is called, we need to check for `zone->db` existence and
reschedule the task, because calling `rss_post()` on a zone with empty
`.db` ends up with no-op (the function just returns).
2021-04-19 11:16:51 +02:00
Ondřej Surý
c216ace42a Merge branch 'ondrej/cleanup-double-createinctx-constructors' into 'main'
Cleanup the isc_<*>mgr_createinc() constructors

See merge request isc-projects/bind9!4910
2021-04-19 08:26:32 +00:00
Ondřej Surý
3388ef36b3 Cleanup the isc_<*>mgr_createinc() constructors
Previously, the taskmgr, timermgr and socketmgr had a constructor
variant, that would create the mgr on top of existing appctx.  This was
no longer true and isc_<*>mgr was just calling isc_<*>mgr_create()
directly without any extra code.

This commit just cleans up the extra function.
2021-04-19 10:22:56 +02:00
Mark Andrews
eb32677de5 Merge branch 'marka-initialise-resarg-lock' into 'main'
properly initialise resarg->lock

See merge request isc-projects/bind9!4907
2021-04-19 04:59:39 +00:00
Mark Andrews
eadb829dac properly initialise resarg->lock 2021-04-19 14:32:40 +10:00
Ondřej Surý
48c703e3d6 Merge branch 'each-cleanup-dns_client' into 'main'
clean up dns_client and related samples

See merge request isc-projects/bind9!4835
2021-04-16 13:35:44 +00:00
Evan Hunt
07e349de3c Add CHANGES note for [GL !4835] 2021-04-16 14:31:10 +02:00
Evan Hunt
d0ec7d1f33 move samples/resolve.c to bin/tests/system
"resolve" is used by the resolver system tests, and I'm not
certain whether delv exercises the same code, so rather than
remove it, I moved it to bin/tests/system.
2021-04-16 14:29:43 +02:00
Evan Hunt
056afe7bdc remove sample-async
sample code for export libraries is no longer needed and
this code is not used for any internal tests. also, sample-gai.c
had already been removed but there were some dangling references.
2021-04-16 14:29:43 +02:00
Evan Hunt
568d455c99 rename dns_client_createx() to dns_client_create()
there's no longer a need to use an alternate name.
2021-04-16 14:29:43 +02:00
Evan Hunt
1beb05f3e2 remove dns_client_request() and related code
continues the cleanup of dns_client started in the previous commit.
2021-04-16 14:29:43 +02:00
Evan Hunt
fb2a352e7c remove dns_client_update() and related code
the libdns client API is no longer being maintained for
external use, we can remove the code that isn't being used
internally, as well as the related tests.
2021-04-16 14:29:43 +02:00
Michał Kępień
409883adbd Merge branch '2634-placeholder' into 'main'
Add placeholder for GL #2634

See merge request isc-projects/bind9!4901
2021-04-16 12:20:37 +00:00
Michał Kępień
cd91f1c189 Add placeholder for GL #2634 2021-04-16 14:16:57 +02:00
Ondřej Surý
1ab099aa3b Merge branch '2623-9-16-13-overwrites-master-files-if-old-format-jnl-files-are-present' into 'main'
Resolve "9.16.13 overwrites master files if old format .jnl files are present"

Closes #2623

See merge request isc-projects/bind9!4880
2021-04-16 11:12:19 +00:00
Mark Andrews
3df637fb83 Add CHANGES and release note for [GL #2623] 2021-04-16 12:04:06 +02:00
Ondřej Surý
55b942b4a0 Refactor dns_journal_rollforward() to work over opened journal
Too much logic was cramped inside the dns_journal_rollforward() that
made it harder to follow.  The dns_journal_rollforward() was refactored
to work over already opened journal and some of the previous logic was
moved to new static zone_journal_rollforward() that separates the
journal "rollforward" logic from the "zone" logic.
2021-04-16 12:04:06 +02:00
Mark Andrews
ec7a9af381 Fixing a recoverable journal should not result in the zone being written
when dns_journal_rollforward returned ISC_R_RECOVERABLE the distintion
between 'up to date' and 'success' was lost, as a consequence
zone_needdump() was called writing out the zone file when it shouldn't
have been.   This change restores that distintion.  Adjust system
test to reflect visible changes.
2021-04-16 11:15:46 +02:00
Artem Boldariev
10ba2a40e2 Merge branch 'artem/move-tls-tests-into-netmgr-tests' into 'main'
Merge the tls_test.c into netmgr_test.c and extend the tests suite

See merge request isc-projects/bind9!4893
2021-04-15 14:03:14 +00:00
Artem Boldariev
66432dcd65 Handle a situation when SSL shutdown messages were sent and received
It fixes a corner case which was causing dig to print annoying
messages like:

14-Apr-2021 18:48:37.099 SSL error in BIO: 1 TLS error (errno:
0). Arguments: received_data: (nil), send_data: (nil), finish: false

even when all the data was properly processed.
2021-04-15 15:49:36 +03:00
Artem Boldariev
513cdb52ec TLS: try to close TCP socket descriptor earlier when possible
Before this fix underlying TCP sockets could remain opened for longer
than it is actually required, causing unit tests to fail with lots of
ISC_R_TOOMANYOPENFILES errors.

The change also enables graceful SSL shutdown (before that it  would
happen only in the case when isc_nm_cancelread() were called).
2021-04-15 15:49:36 +03:00
Ondřej Surý
202b1d372d Merge the tls_test.c into netmgr_test.c and extend the tests suite
This commit merges TLS tests into the common Network Manager unit
tests suite and extends the unit test framework to include support for
additional "ping-pong" style tests where all data could be sent via
lesser number of connections (the behaviour of the old test
suite). The tests for TCP and TLS were extended to make use of the new
mode, as this mode better translates to how the code is used in DoH.

Both TLS and TCP tests now share most of the unit tests' code, as they
are expected to function similarly from a users's perspective anyway.

Additionally to the above, the TLS test suite was extended to include
TLS tests using the connections quota facility.
2021-04-15 15:49:36 +03:00
Matthijs Mekking
2aad659550 Merge branch 'matthijs-keymgr2kasp-rework' into 'main'
Update keymgr2kasp system test

Closes #2631

See merge request isc-projects/bind9!4894
2021-04-15 12:45:25 +00:00
Matthijs Mekking
0de5a576c5 Fix view-related issues in the "keymgr2kasp" test
Due to the lack of "match-clients" clauses in ns4/named2.conf.in, the
same view is incorrectly chosen for all queries received by ns4 in the
"keymgr2kasp" system test.  This causes only one version of the
"view-rsasha256.kasp" zone to actually be checked.  Add "match-clients"
clauses to ns4/named2.conf.in to ensure the test really checks what it
claims to.

Use identical view names ("ext", "int") in ns4/named.conf.in and
ns4/named2.conf.in so that it is easier to quickly identify the
differences between these two files.

Update tests.sh to account for the above changes.  Also fix a copy-paste
error in a comment to prevent confusion.
2021-04-15 10:05:52 +02:00
Matthijs Mekking
ee02453a2e Merge branch '1100-inline-signing-include' into 'main'
Resolve "Test inline-signing with $INCLUDE"

Closes #1100

See merge request isc-projects/bind9!4825
2021-04-14 09:35:35 +00:00
Matthijs Mekking
bad5c3cf7c Document relative path of $INCLUDE
Add to the ARM from where relative paths are searched.
2021-04-14 10:04:40 +02:00
Matthijs Mekking
96583e7c40 Fix inline test with missing $INCLUDE
The test case for a zone with a missing include file was wrong for two
reasons:
1. It was loading the wrong file (master5 instead of master6)
2. It did actually not set the $ret variable to 1 if the test failed
   (it should default to ret=1 and clear the variable if the
   appropriate log is found).
2021-04-14 10:04:40 +02:00
Matthijs Mekking
6463ee0f40 Add inline-signing with $INCLUDE test
Add a test case for inline-signing for a zone with an $INCLUDE
statement. There is already a test for a missing include file, this
one adds a test for a zone with an include file that does exist.

Test if the record in the included file is loaded.
2021-04-14 10:04:40 +02:00
Matthijs Mekking
bb01030252 Merge branch '2347-draft-vandijk-dnsop-nsec-ttl' into 'main'
Implement draft-vandijk-dnsop-nsec-ttl

Closes #2347

See merge request isc-projects/bind9!4506
2021-04-13 12:14:53 +00:00
Matthijs Mekking
8fcbef2423 Small refactor lib/dns/zone.c
Introduce some macros that can be reused in 'zone_load_soa_rr()' and
'zone_get_from_db()' to make those functions more readable.
2021-04-13 11:26:26 +02:00
Matthijs Mekking
032110bd2e Use designated initializer in dns_zone_create
Shorten the code and make it less prone to initialisation errors
(it is still easy to forget adding an initializer, but it now defaults
to 0).
2021-04-13 11:26:26 +02:00
Matthijs Mekking
3b68dd426f Add change entry and release note for [#2347] 2021-04-13 11:26:26 +02:00
Matthijs Mekking
9af8caa733 Implement draft-vandijk-dnsop-nsec-ttl
The draft says that the NSEC(3) TTL must have the same TTL value
as the minimum of the SOA MINIMUM field and the SOA TTL. This was
always the intended behaviour.

Update the zone structure to also track the SOA TTL. Whenever we
use the MINIMUM value to determine the NSEC(3) TTL, use the minimum
of MINIMUM and SOA TTL instead.

There is no specific test for this, however two tests need adjusting
because otherwise they failed: They were testing for NSEC3 records
including the TTL. Update these checks to use 600 (the SOA TTL),
rather than 3600 (the SOA MINIMUM).
2021-04-13 11:26:26 +02:00
Matthijs Mekking
8ffb4b0a13 Merge branch '2289-cache-dump-stale-ttl-weird-values' into 'main'
Fix nonsensical stale TTL values in cache dump

Closes #2289

See merge request isc-projects/bind9!4799
2021-04-13 08:54:49 +00:00
Matthijs Mekking
a83c8cb0af Use stale TTL as RRset TTL in dumpdb
It is more intuitive to have the countdown 'max-stale-ttl' as the
RRset TTL, instead of 0 TTL. This information was already available
in a comment "; stale (will be retained for x more seconds", but
Support suggested to put it in the TTL field instead.
2021-04-13 09:48:20 +02:00
Matthijs Mekking
debee6157b Check staleness in bind_rdataset
Before binding an RRset, check the time and see if this record is
stale (or perhaps even ancient). Marking a header stale or ancient
happens only when looking up an RRset in cache, but binding an RRset
can also happen on other occasions (for example when dumping the
database).

Check the time and compare it to the header. If according to the
time the entry is stale, but not ancient, set the STALE attribute.
If according to the time is ancient, set the ANCIENT attribute.

We could mark the header stale or ancient here, but that requires
locking, so that's why we only compare the current time against
the rdh_ttl.

Adjust the test to check the dump-db before querying for data. In the
dumped file the entry should be marked as stale, despite no cache
lookup happened since the initial query.
2021-04-13 09:48:20 +02:00
Matthijs Mekking
2a5e0232ed Fix nonsensical stale TTL values in cache dump
When introducing change 5149, "rndc dumpdb" started to print a line
above a stale RRset, indicating how long the data will be retained.

At that time, I thought it should also be possible to load
a cache from file. But if a TTL has a value of 0 (because it is stale),
stale entries wouldn't be loaded from file. So, I added the
'max-stale-ttl' to TTL values, and adjusted the $DATE accordingly.

Since we actually don't have a "load cache from file" feature, this
is premature and is causing confusion at operators. This commit
changes the 'max-stale-ttl' adjustments.

A check in the serve-stale system test is added for a non-stale
RRset (longttl.example) to make sure the TTL in cache is sensible.

Also, the comment above stale RRsets could have nonsensical
values. A possible reason why this may happen is when the RRset was
marked a stale but the 'max-stale-ttl' has passed (and is actually an
RRset awaiting cleanup). This would lead to the "will be retained"
value to be negative (but since it is stored in an uint32_t, you would
get a nonsensical value (e.g. 4294362497).

To mitigate against this, we now also check if the header is not
ancient. In addition we check if the stale_ttl would be negative, and
if so we set it to 0. Most likely this will not happen because the
header would already have been marked ancient, but there is a possible
race condition where the 'rdh_ttl + serve_stale_ttl' has passed,
but the header has not been checked for staleness.
2021-04-13 09:48:20 +02:00
Mark Andrews
1941ce99d4 Merge branch '2622-command-line-option-l-not-shown-with-usage-message' into 'main'
Resolve "Command-line option -L not shown with usage message"

Closes #2622

See merge request isc-projects/bind9!4881
2021-04-13 01:33:28 +00:00
Mark Andrews
38449de93b Update named's usage description 2021-04-12 12:07:44 +10:00
Michał Kępień
b64af491bf Merge branch 'michal/add-placeholder-entries-to-CHANGES' into 'main'
Add placeholders for GL #2467, GL #2540, GL #2604

See merge request isc-projects/bind9!4878
2021-04-08 11:10:54 +00:00
Michał Kępień
0874242db6 Add placeholders for GL #2467, GL #2540, GL #2604 2021-04-08 13:06:57 +02:00
Michał Kępień
b517108cbc Merge branch '2578-rework-get_ports.sh-to-make-it-not-use-a-lock-file' into 'main'
Rework get_ports.sh to make it not use a lock file

Closes #2578

See merge request isc-projects/bind9!4801
2021-04-08 09:37:51 +00:00
Michał Kępień
c3718b926b Use the same port selection method on all systems
When system tests are run on Windows, they are assigned port ranges that
are 100 ports wide and start from port number 5000.  This is a different
port assignment method than the one used on Unix systems.  Drop the "-p"
command line option from bin/tests/system/run.sh invocations used for
starting system tests on Windows to unify the port assignment method
used across all operating systems.
2021-04-08 11:12:37 +02:00
Michał Kępień
31e5ca4bd9 Rework get_ports.sh to make it not use a lock file
The get_ports.sh script is used for determining the range of ports a
given system test should use.  It first determines the start of the port
range to return (the base port); it can either be specified explicitly
by the caller or chosen randomly.  Subsequent ports are picked
sequentially, starting from the base port.  To ensure no single port is
used by multiple tests, a state file (get_ports.state) containing the
last assigned port is maintained by the script.  Concurrent access to
the state file is protected by a lock file (get_ports.lock); if one
instance of the script holds the lock file while another instance tries
to acquire it, the latter retries its attempt to acquire the lock file
after sleeping for 1 second; this retry process can be repeated up to 10
times before the script returns an error.

There are some problems with this approach:

  - the sleep period in case of failure to acquire the lock file is
    fixed, which leads to a "thundering herd" type of problem, where
    (depending on how processes are scheduled by the operating system)
    multiple system tests try to acquire the lock file at the same time
    and subsequently sleep for 1 second, only for the same situation to
    likely happen the next time around,

  - the lock file is being locked and then unlocked for every single
    port assignment made, not just once for the entire range of ports a
    system test should use; in other words, the lock file is currently
    locked and unlocked 13 times per system test; this increases the
    odds of the "thundering herd" problem described above preventing a
    system test from getting one or more ports assigned before the
    maximum retry count is reached (assuming multiple system tests are
    run in parallel); it also enables the range of ports used by a given
    system test to be non-sequential (which is a rather cosmetic issue,
    but one that can make log interpretation harder than necessary when
    test failures are diagnosed),

  - both issues described above cause unnecessary delays when multiple
    system tests are started in parallel (due to high lock file
    contention among the system tests being started),

  - maintaining a state file requires ensuring proper locking, which
    complicates the script's source code.

Rework the get_ports.sh script so that it assigns non-overlapping port
ranges to its callers without using a state file or a lock file:

  - add a new command line switch, "-t", which takes the name of the
    system test to assign ports for,

  - ensure every instance of get_ports.sh knows how many ports all
    system tests which form the test suite are going to need in total
    (based on the number of subdirectories found in bin/tests/system/),

  - in order to ensure all instances of get_ports.sh work on the same
    global port range (so that no port range collisions happen), a
    stable (throughout the expected run time of a single system test
    suite) base port selection method is used instead of the random one;
    specifically, the base port, unless specified explicitly using the
    "-p" command line switch, is derived from the number of hours which
    passed since the Unix Epoch time,

  - use the name of the system test to assign ports for (passed via the
    new "-t" command line switch) as a unique index into the global
    system test range, to ensure all system tests use disjoint port
    ranges.
2021-04-08 11:12:37 +02:00
Michal Nowak
a2484f2673 Merge branch 'mnowak/fix-missing-fromhex.pl-in-out-of-tree' into 'main'
Move fromhex.pl script to bin/tests/system/

See merge request isc-projects/bind9!4875
2021-04-08 09:07:07 +00:00
Michal Nowak
cd0a34df1b Move fromhex.pl script to bin/tests/system/
The fromhex.pl script needs to be copied from the source directory to
the build directory before any test is run, otherwise the out-of-tree
fails to find it. Given that the script is used only in system test,
move it to bin/tests/system/.
2021-04-08 11:04:26 +02:00
Michał Kępień
e01b3ccfaa Merge branch '2620-free-resources-when-gss_accept_sec_context-fails' into 'main'
Free resources when gss_accept_sec_context() fails

Closes #2620

See merge request isc-projects/bind9!4873
2021-04-08 08:40:27 +00:00
Michał Kępień
7eb87270a4 Add CHANGES entry 2021-04-08 10:33:44 +02:00
Michał Kępień
d954e152d9 Free resources when gss_accept_sec_context() fails
Even if a call to gss_accept_sec_context() fails, it might still cause a
GSS-API response token to be allocated and left for the caller to
release.  Make sure the token is released before an early return from
dst_gssapi_acceptctx().
2021-04-08 10:33:44 +02:00
Ondřej Surý
3c5267cc5c Merge branch '2600-general-error-managed-keys-zone-dns_journal_compact-failed-no-more' into 'main'
Resolve "general: error: managed-keys-zone: dns_journal_compact failed: no more"

Closes #2600

See merge request isc-projects/bind9!4849
2021-04-07 19:28:39 +00:00
Mark Andrews
0174098aca Add CHANGES and release note for [GL #2600] 2021-04-07 21:02:10 +02:00
Mark Andrews
bb6f0faeed Check that upgrade of managed-keys.bind.jnl succeeded
Update the system to include a recoverable managed.keys journal created
with <size,serial0,serial1,0> transactions and test that it has been
updated as part of the start up process.
2021-04-07 20:27:22 +02:00
Mark Andrews
0fbdf189c7 Rewrite managed-key journal immediately
Both managed keys and regular zone journals need to be updated
immediately when a recoverable error is discovered.
2021-04-07 20:23:46 +02:00
Mark Andrews
83310ffd92 Update dns_journal_compact() to handle bad transaction headers
Previously, dns_journal_begin_transaction() could reserve the wrong
amount of space.  We now check that the transaction is internally
consistent when upgrading / downgrading a journal and we also handle the
bad transaction headers.
2021-04-07 20:23:46 +02:00
Mark Andrews
520509ac7e Compute transaction size based on journal/transaction type
previously the code assumed that it was a new transaction.
2021-04-07 20:20:57 +02:00
Mark Andrews
5a6112ec8f Use journal_write_xhdr() to write the dummy transaction header
Instead of journal_write(), use correct format call journal_write_xhdr()
to write the dummy transaction header which looks at j->header_ver1 to
determine which transaction header to write instead of always writing a
zero filled journal_rawxhdr_t header.
2021-04-07 20:18:44 +02:00
Ondřej Surý
81c5f5e6a8 Merge branch '2401-ISC_R_TIMEDOUT-is-recoverable' into 'main'
netmgr: Make it possible to recover from ISC_R_TIMEDOUT

Closes #2401

See merge request isc-projects/bind9!4845
2021-04-07 14:34:46 +00:00
Evan Hunt
5496e51a80 Add CHANGES note for GL #2401 2021-04-07 15:38:16 +02:00
Artem Boldariev
8da12738f1 Use T_CONNECT timeout constant for TCP tests (instead of 1 ms)
The netmgr_test would be failing on heavily loaded systems because the
connection timeout was set to 1 ms.  Use the global constant instead.
2021-04-07 15:37:10 +02:00
Evan Hunt
d2ea8f4245 Ensure dig lookup is detached on UDP connect failure
dig could hang when UDP connect failed due to a dangling lookup object.
2021-04-07 15:36:59 +02:00
Ondřej Surý
72ef5f465d Refactor async callbacks and fix the double tlsdnsconnect callback
The isc_nm_tlsdnsconnect() call could end up with two connect callbacks
called when the timeout fired and the TCP connection was aborted,
but the TLS handshake was not complete yet.  isc__nm_connecttimeout_cb()
forgot to clean up sock->tls.pending_req when the connect callback was
called with ISC_R_TIMEDOUT, leading to a second callback running later.

A new argument has been added to the isc__nm_*_failed_connect_cb and
isc__nm_*_failed_read_cb functions, to indicate whether the callback
needs to run asynchronously or not.
2021-04-07 15:36:59 +02:00
Ondřej Surý
58e75e3ce5 Skip long tls_tests in the CI
We already skip most of the recv_send tests in CI because they are
too timing-related to be run in overloaded environment.  This commit
adds a similar change to tls_test before we merge tls_test into
netmgr_test.
2021-04-07 15:36:59 +02:00
Artem Boldariev
340235c855 Prevent short TLS tests from hanging in case of errors
The tests in tls_test.c could hang in the event of a connect
error.  This commit allows the tests to bail out when such an
error occurs.
2021-04-07 15:36:59 +02:00
Evan Hunt
426c40c96d rearrange nm_teardown() to check correctness after shutting down
if a test failed at the beginning of nm_teardown(), the function
would abort before isc_nm_destroy() or isc_tlsctx_free() were reached;
we would then abort when nm_setup() was run for the next test case.
rearranging the teardown function prevents this problem.
2021-04-07 15:36:59 +02:00
Ondřej Surý
86f4872dd6 isc_nm_*connect() always return via callback
The isc_nm_*connect() functions were refactored to always return the
connection status via the connect callback instead of sometimes returning
the hard failure directly (for example, when the socket could not be
created, or when the network manager was shutting down).

This commit changes the connect functions in all the network manager
modules, and also makes the necessary refactoring changes in places
where the connect functions are called.
2021-04-07 15:36:59 +02:00
Evan Hunt
a70cd026df move UDP connect retries from dig into isc_nm_udpconnect()
dig previously ran isc_nm_udpconnect() three times before giving
up, to work around a freebsd bug that caused connect() to return
a spurious transient EADDRINUSE. this commit moves the retry code
into the network manager itself, so that isc_nm_udpconnect() no
longer needs to return a result code.
2021-04-07 15:36:59 +02:00
Ondřej Surý
ca12e25bb0 Use generic functions for reading and timers in TCP
The TCP module has been updated to use the generic functions from
netmgr.c instead of its own local copies.  This brings the module
mostly up to par with the TCPDNS and TLSDNS modules.
2021-04-07 15:36:59 +02:00
Ondřej Surý
7df8c7061c Fix and clean up handling of connect callbacks
Serveral problems were discovered and fixed after the change in
the connection timeout in the previous commits:

  * In TLSDNS, the connection callback was not called at all under some
    circumstances when the TCP connection had been established, but the
    TLS handshake hadn't been completed yet.  Additional checks have
    been put in place so that tls_cycle() will end early when the
    nmsocket is invalidated by the isc__nm_tlsdns_shutdown() call.

  * In TCP, TCPDNS and TLSDNS, new connections would be established
    even when the network manager was shutting down.  The new
    call isc__nm_closing() has been added and is used to bail out
    early even before uv_tcp_connect() is attempted.
2021-04-07 15:36:59 +02:00
Ondřej Surý
5a87c7372c Make it possible to recover from connect timeouts
Similarly to the read timeout, it's now possible to recover from
ISC_R_TIMEDOUT event by restarting the timer from the connect callback.

The change here also fixes platforms that missing the socket() options
to set the TCP connection timeout, by moving the timeout code into user
space.  On platforms that support setting the connect timeout via a
socket option, the timeout has been hardcoded to 2 minutes (the maximum
value of tcp-initial-timeout).
2021-04-07 15:36:58 +02:00
Ondřej Surý
33c00c281f Make it possible to recover from read timeouts
Previously, when the client timed out on read, the client socket would
be automatically closed and destroyed when the nmhandle was detached.
This commit changes the logic so that it's possible for the callback to
recover from the ISC_R_TIMEDOUT event by restarting the timer. This is
done by calling isc_nmhandle_settimeout(), which prevents the timeout
handling code from destroying the socket; instead, it continues to wait
for data.

One specific use case for multiple timeouts is serve-stale - the client
socket could be created with shorter timeout (as specified with
stale-answer-client-timeout), so we can serve the requestor with stale
answer, but keep the original query running for a longer time.
2021-04-07 15:36:58 +02:00
Ondřej Surý
0aad979175 Disable netmgr tests only when running under CI
The full netmgr test suite is unstable when run in CI due to various
timing issues.  Previously, we enabled the full test suite only when
CI_ENABLE_ALL_TESTS environment variable was set, but that went against
original intent of running the full suite when an individual developer
would run it locally.

This change disables the full test suite only when running in the CI and
the CI_ENABLE_ALL_TESTS is not set.
2021-04-07 15:36:58 +02:00
Matthijs Mekking
ad25ca8bc6 Merge branch '2608-stale-answer-client-timeout-default-off' into 'main'
Change default stale-answer-client-timeout to off

Closes #2608

See merge request isc-projects/bind9!4862
2021-04-07 12:45:48 +00:00
Matthijs Mekking
e443279bbf Change default stale-answer-client-timeout to off
Using "stale-answer-client-timeout" turns out to have unforeseen
negative consequences, and thus it is better to disable the feature
by default for the time being.
2021-04-07 14:10:31 +02:00
Diego dos Santos Fronza
e8313d91ea Merge branch '2582-threadsanitizer-data-race-lib-dns-zone-c-10272-7-in-zone_maintenance' into 'main'
Resolve "ThreadSanitizer: data race lib/dns/zone.c:10272:7 in zone_maintenance"

Closes #2582

See merge request isc-projects/bind9!4864
2021-04-07 12:05:05 +00:00
Diego Fronza
6e08307bc8 Resolve TSAN data race in zone_maintenance
Fix race between zone_maintenance and dns_zone_notifyreceive functions,
zone_maintenance was attempting to read a zone flag calling
DNS_ZONE_FLAG(zone, flag) while dns_zone_notifyreceive was updating
a flag in the same zone calling DNS_ZONE_SETFLAG(zone, ...).

The code reading the flag in zone_maintenance was not protected by the
zone's lock, to avoid a race the zone's lock is now being acquired
before an attempt to read the zone flag is made.
2021-04-07 12:04:01 +00:00
Michał Kępień
2e5a6ab7fc Merge branch '2579-enforce-a-run-time-limit-on-unit-test-binaries' into 'main'
Enforce a run time limit on unit test binaries

Closes #2579

See merge request isc-projects/bind9!4802
2021-04-07 09:46:40 +00:00
Michał Kępień
6bdd55a9b3 Enforce a run time limit on unit test binaries
When a unit test binary hangs, the GitLab CI job in which it is run is
stuck until its run time limit is exceeded.  Furthermore, it is not
trivial to determine which test(s) hung in a given GitLab CI job based
on its log.  To prevent these issues, enforce a run time limit on every
binary executed by the lib/unit-test-driver.sh script.  Use a timeout of
5 minutes for consistency with older BIND 9 branches, which employed
Kyua for running unit tests.  Report an exit code of 124 when the run
time limit is exceeded for a unit test binary, for consistency with the
"timeout" tool included in GNU coreutils.
2021-04-07 11:41:45 +02:00
Artem Boldariev
d1bb1b01b9 Merge branch '2611-doth-failure' into 'main'
Fix "doth" system test failure with SSL_ERROR_SYSCALL (5)

See merge request isc-projects/bind9!4863
2021-04-07 08:44:38 +00:00
Artem Boldariev
ee10948e2d Remove dead code which was supposed to handle TLS shutdowns nicely
Fixes Coverity issue CID 330954 (See #2612).
2021-04-07 11:21:08 +03:00
Artem Boldariev
e6062210c7 Handle buggy situations with SSL_ERROR_SYSCALL
See "BUGS" section at:

https://www.openssl.org/docs/man1.1.1/man3/SSL_get_error.html

It is mentioned there that when TLS status equals SSL_ERROR_SYSCALL
AND errno == 0 it means that underlying transport layer returned EOF
prematurely.  However, we are managing the transport ourselves, so we
should just resume reading from the TCP socket.

It seems that this case has been handled properly on modern versions
of OpenSSL. That being said, the situation goes in line with the
manual: it is briefly mentioned there that SSL_ERROR_SYSCALL might be
returned not only in a case of low-level errors (like system call
failures).
2021-04-07 11:21:08 +03:00
Mark Andrews
6b121171a5 Merge branch '2613-lib-dns-gen-is-not-deleted-on-make-clean' into 'main'
Resolve "lib/dns/gen is not deleted on make clean"

Closes #2613

See merge request isc-projects/bind9!4865
2021-04-07 07:18:53 +00:00
Mark Andrews
9c28df2204 remove lib/dns/gen when running 'make clean' 2021-04-07 08:06:49 +10:00
Matthijs Mekking
8556c7f854 Merge branch '2594-servestale-staleonly-recursion-race' into 'main'
Serve-stale "staleonly" recursion race condition

See merge request isc-projects/bind9!4859
2021-04-02 11:26:57 +00:00
Matthijs Mekking
3d3a6415f7 If RPZ config'd, bail stale-answer-client-timeout
When we are recursing, RPZ processing is not allowed. But when we are
performing a lookup due to "stale-answer-client-timeout", we are still
recursing. This effectively means that RPZ processing is disabled on
such a lookup.

In this case, bail the "stale-answer-client-timeout" lookup and wait
for recursion to complete, as we we can't perform the RPZ rewrite
rules reliably.
2021-04-02 10:02:40 +02:00
Matthijs Mekking
839df94190 Rename "staleonly"
The dboption DNS_DBFIND_STALEONLY caused confusion because it implies
we are looking for stale data **only** and ignore any active RRsets in
the cache. Rename it to DNS_DBFIND_STALETIMEOUT as it is more clear
the option is related to a lookup due to "stale-answer-client-timeout".

Rename other usages of "staleonly", instead use "lookup due to...".
Also rename related function and variable names.
2021-04-02 10:02:40 +02:00
Matthijs Mekking
3f81d79ffb Restore the RECURSIONOK attribute after staleonly
When doing a staleonly lookup we don't want to fallback to recursion.
After all, there are obviously problems with recursion, otherwise we
wouldn't do a staleonly lookup.

When resuming from recursion however, we should restore the
RECURSIONOK flag, allowing future required lookups for this client
to recurse.
2021-04-02 10:02:40 +02:00
Matthijs Mekking
aaed7f9d8c Remove result exception on staleonly lookup
When implementing "stale-answer-client-timeout", we decided that
we should only return positive answers prematurely to clients. A
negative response is not useful, and in that case it is better to
wait for the recursion to complete.

To do so, we check the result and if it is not ISC_R_SUCCESS, we
decide that it is not good enough. However, there are more return
codes that could lead to a positive answer (e.g. CNAME chains).

This commit removes the exception and now uses the same logic that
other stale lookups use to determine if we found a useful stale
answer (stale_found == true).

This means we can simplify two test cases in the serve-stale system
test: nodata.example is no longer treated differently than data.example.
2021-04-02 10:02:40 +02:00
Matthijs Mekking
e44bcc6f53 Add notes and changes for [#2594]
Pretty newsworthy.
2021-04-02 10:02:40 +02:00
Matthijs Mekking
3d5429f61f Remove INSIST on NS_QUERYATTR_ANSWERED
The NS_QUERYATTR_ANSWERED attribute is to prevent sending a response
twice. Without the attribute, this may happen if a staleonly lookup
found a useful answer and sends a response to the client, and later
recursion ends and also tries to send a response.

The attribute was also used to mask adding a duplicate RRset. This is
considered harmful. When we created a response to the client with a
stale only lookup (regardless if we actually have send the response),
we should clear the rdatasets that were added during that lookup.

Mark such rdatasets with the a new attribute,
DNS_RDATASETATTR_STALE_ADDED. Set a query attribute
NS_QUERYATTR_STALEOK if we may have added rdatasets during a stale
only lookup. Before creating a response on a normal lookup, check if
we can expect rdatasets to have been added during a staleonly lookup.
If so, clear the rdatasets from the message with the attribute
DNS_RDATASETATTR_STALE_ADDED set.
2021-04-02 09:15:07 +02:00
Matthijs Mekking
48b0dc159b Simplify when to detach the client
With stale-answer-client-timeout, we may send a response to the client,
but we may want to hold on to the network manager handle, because
recursion is going on in the background, or we need to refresh a
stale RRset.

Simplify the setting of 'nodetach':
* During a staleonly lookup we should not detach the nmhandle, so just
  set it prior to 'query_lookup()'.
* During a staleonly "stalefirst" lookup set the 'nodetach' to true
  if we are going to refresh the RRset.

Now there is no longer the need to clear the 'nodetach' if we go
through the "dbfind_stale", "stale_refresh_window", or "stale_only"
paths.
2021-04-02 09:14:09 +02:00
Matthijs Mekking
92f7a67892 Refactor stale lookups, ignore active RRsets
When doing a staleonly lookup, ignore active RRsets from cache. If we
don't, we may add a duplicate RRset to the message, and hit an
assertion failure in query.c because adding the duplicate RRset to the
ANSWER section failed.

This can happen on a race condition. When a client query is received,
the recursion is started. When 'stale-answer-client-timeout' triggers
around the same time the recursion completes, the following sequence
of events may happen:
1. Queue the "try stale" fetch_callback() event to the client task.
2. Add the RRsets from the authoritative response to the cache.
3. Queue the "fetch complete" fetch_callback() event to the client task.
4. Execute the "try stale" fetch_callback(), which retrieves the
   just-inserted RRset from the database.
5. In "ns_query_done()" we are still recursing, but the "staleonly"
   query attribute has already been cleared. In other words, the
   query will resume when recursion ends (it already has ended but is
   still on the task queue).
6. Execute the "fetch complete" fetch_callback(). It finds the answer
   from recursion in the cache again and tries to add the duplicate to
   the answer section.

This commit changes the logic for finding stale answers in the cache,
such that on "stale_only" lookups actually only stale RRsets are
considered. It refactors the code so that code paths for "dbfind_stale",
"stale_refresh_window", and "stale_only" are more clear.

First we call some generic code that applies in all three cases,
formatting the domain name for logging purposes, increment the
trystale stats, and check if we actually found stale data that we can
use.

The "dbfind_stale" lookup will return SERVFAIL if we didn't found a
usable answer, otherwise we will continue with the lookup
(query_gotanswer()). This is no different as before the introduction of
"stale-answer-client-timeout" and "stale-refresh-time".

The "stale_refresh_window" lookup is similar to the "dbfind_stale"
lookup: return SERVFAIL if we didn't found a usable answer, otherwise
continue with the lookup (query_gotanswer()).

Finally the "stale_only" lookup.

If the "stale_only" lookup was triggered because of an actual client
timeout (stale-answer-client-timeout > 0), and if database lookup
returned a stale usable RRset, trigger a response to the client.
Otherwise return and wait until the recursion completes (or the
resolver query times out).

If the "stale_only" lookup is a "stale-anwer-client-timeout 0" lookup,
preferring stale data over a lookup. In this case if there was no stale
data, or the data was not a positive answer, retry the lookup with the
stale options cleared, a.k.a. a normal lookup. Otherwise, continue
with the lookup (query_gotanswer()) and refresh the stale RRset. This
will trigger a response to the client, but will not detach the handle
because a fetch will be created to refresh the RRset.
2021-04-02 09:14:09 +02:00
Matthijs Mekking
fee164243f Keep track of allow client detach
The stale-answer-client-timeout feature introduced a dependancy on
when a client may be detached from the handle. The dboption
DNS_DBFIND_STALEONLY was reused to track this attribute. This overloads
the meaning of this database option, and actually introduced a bug
because the option was checked in other places. In particular, in
'ns_query_done()' there is a check for 'RECURSING(qctx->client) &&
(!QUERY_STALEONLY(&qctx->client->query) || ...' and the condition is
satisfied because recursion has not completed yet and
DNS_DBFIND_STALEONLY is already cleared by that time (in
query_lookup()), because we found a useful answer and we should detach
the client from the handle after sending the response.

Add a new boolean to the client structure to keep track of client
detach from handle is allowed or not. It is only disallowed if we are
in a staleonly lookup and we didn't found a useful answer.
2021-04-02 09:14:09 +02:00
Artem Boldariev
e7fe606020 Merge branch 'artem/tls-tests-and-fixes' into 'main'
TLS transport code refactoring and unit tests

See merge request isc-projects/bind9!4851
2021-04-01 15:41:52 +00:00
Artem Boldariev
fa062162a7 Fix crash (regression) in DIG when handling non-DoH responses
This commit fixes crash in dig when it encounters non-expected header
value. The bug was introduced at some point late in the last DoH
development cycle. Also, refactors the relevant code a little bit to
ensure better incoming data validation for client-side DoH
connections.
2021-04-01 17:31:29 +03:00
Artem Boldariev
11ed7aac5d TLS code refactoring, fixes and unit-tests
This commit fixes numerous stability issues with TLS transport code as
well as adds unit tests for it.
2021-04-01 17:31:29 +03:00
Ondřej Surý
01cd310407 Merge branch '2607-remove-custom-spnego' into 'main'
Remove custom ISC SPNEGO implementation

Closes #2607

See merge request isc-projects/bind9!4856
2021-04-01 14:14:00 +00:00
Ondřej Surý
66bd47a129 Add CHANGES and release note for GL #2607 2021-04-01 16:08:19 +02:00
Mark Andrews
1febea6d7c Merge branch '2538-bind-9-17-build-process-leaving-files-in-unexpected-locations' into 'main'
Resolve "BIND 9.17 build process leaving files in unexpected locations?"

Closes #2538

See merge request isc-projects/bind9!4757
2021-04-01 09:34:17 +00:00
Mark Andrews
35e8f56b49 Test dynamic libraries should not be installed
Tag the libraries with check_ to prevent them being installed
by "make install".  Additionally make check requires .so to be
create which requires .lai files to be constructed which, in
turn, requires -rpath <dir> as part of "linking" the .la file.
2021-04-01 19:11:54 +11:00
Michal Nowak
b34fd6d4f2 Merge branch 'mnowak/web-run-gcc-tarball-ci-job' into 'main'
Run gcc:tarball CI job in web-triggered pipelines

See merge request isc-projects/bind9!4850
2021-03-31 14:37:15 +00:00
Michal Nowak
4d5d3b75da Run gcc:tarball CI job in web-triggered pipelines
The gcc:tarball CI job may identify problems with tarballs created by
"make dist" of the tarball-create CI job. Enabling the gcc:tarball CI
job in web-triggered pipelines provides developers with a test vector.
2021-03-31 16:35:59 +02:00
Michał Kępień
aaac9345eb Merge branch 'michal/include-all-pre-generated-man-pages-in-make-dist' into 'main'
Include all pre-generated man pages in "make dist"

See merge request isc-projects/bind9!4838
2021-03-29 11:08:00 +00:00
Michał Kępień
490e5cb1f1 Include all pre-generated man pages in "make dist"
Some man pages (e.g. dnstap-read.1, named-nzd2nzf.1) should only be
installed conditionally (when the relevant features are enabled in a
given BIND 9 build).  This is achieved using Automake conditionals.
However, while all source reStructuredText files are included in
tarballs produced by "make dist" (distribution tarballs) as they should
be, the list of pre-generated man pages included in distribution
tarballs incorrectly depends on the ./configure switches used for the
build for which "make dist" is run.  Meanwhile, distribution tarballs
should always contain all the files necessary to build any flavor of
BIND 9.

Here is an example scenario which fails to work as intended:

    autoreconf -i
    ./configure --disable-maintainer-mode
    make dist
    tar --extract --file bind-9.17.11.tar.xz
    cd bind-9.17.11
    ./configure --disable-maintainer-mode --enable-dnstap
    make

Fix by always including pre-generated versions of all conditionally
installed man pages in EXTRA_DIST.  While this may cause some of them to
appear in EXTRA_DIST more than once (depending on the ./configure
switches used for the build for which "make dist" is run), it seems to
not be a problem for Automake.
2021-03-29 13:06:39 +02:00
Mark Andrews
99ff8f285c Merge branch '2597-make-calling-generic-rdata-methods-consistent' into 'main'
Resolve "Make calling generic rdata methods consistent"

Closes #2597

See merge request isc-projects/bind9!4834
2021-03-26 22:27:51 +00:00
Mark Andrews
a88d3963e2 Make calling generic rdata methods consistent
add matching macros to pass arguments from called methods
to generic methods.  This will reduce the amount of work
required when extending methods.

Also cleanup unnecessary UNUSED declarations.
2021-03-26 22:04:42 +00:00
Ondřej Surý
19b69e9a3b Merge branch 'bind-dyndb-ldap-v9.16.13' into 'main'
Do not require config.h to use isc/util.h

See merge request isc-projects/bind9!4840
2021-03-26 18:43:18 +00:00
Petr Mensik
81eb3396bf Do not require config.h to use isc/util.h
util.h requires ISC_CONSTRUCTOR definition, which depends on config.h
inclusion. It does not include it from isc/util.h (or any other header).
Using isc/util.h fails hard when isc/util.h is used without including
bind's config.h.

Move the check to c file, where ISC_CONSTRUCTOR is used. Ensure config.h
is included there.
2021-03-26 11:41:22 +01:00
Diego dos Santos Fronza
f38069cdf8 Merge branch '2490-dig-tcp-does-not-honor-tries-1-nor-retry-0' into 'main'
Resolve "dig +tcp does not honor +tries=1 nor +retry=0"

Closes #2490

See merge request isc-projects/bind9!4682
2021-03-25 17:30:24 +00:00
Diego Fronza
04537633a7 Add CHANGES note for [GL #2490] 2021-03-25 14:12:16 -03:00
Diego Fronza
3b98c4d311 Update dig's man page
Adjusted man page entries for +tries and +retry options to reflect the
fact that now those options apply to TCP as well.
2021-03-25 14:08:40 -03:00
Diego Fronza
4f82cc41cc Added tests for tries=1 and retry=0 on TCP EOF
Added tests to ensure that dig won't retry sending a query over tcp
(+tcp) when a TCP connection is closed prematurely (EOF is read) if
either +tries=1 or retry=0 is specified on the command line.
2021-03-25 14:08:40 -03:00
Diego Fronza
e680896003 Adjusted dig system tests
Now that premature EOF on tcp connections take +tries and +retry into
account, the dig system tests handling TCP EOF with +tries=1 were
expecting dig to do a second attempt in handling the tcp query, which
doesn't happen anymore.

To make the test work as expected +tries value was adjusted to 2, to
make it behave as before after the new update on dig.
2021-03-25 14:08:40 -03:00
Diego Fronza
78f6ead480 Don't retry +tcp queries on failure if tries=1 or retries=0
Before this commit, a premature EOF (connection closed) on tcp queries
was causing dig to automatically attempt to send the query again, even
if +tries=1 or +retries=0 was provided on command line.

This commit fix the problem by taking into account the no. of retries
specified by the user when processing a premature EOF on tcp
connections.
2021-03-25 14:08:39 -03:00
Michał Kępień
8bb1547208 Merge branch 'matthijs-configure-kaspsh' into 'main'
Configure kasp.sh

See merge request isc-projects/bind9!4836
2021-03-24 09:07:33 +00:00
Matthijs Mekking
93ed215065 Add kasp.sh to run.sh.in script
Add kasp.sh to the list of scripts copied from the source directory to
the build directory before any test is run. This will fix
the out-of-tree test failures introduced in commit
ecb073bdd6 on the 'main' branch.
2021-03-24 08:55:24 +01:00
Matthijs Mekking
c2c5701dfe Merge branch '2488-refresh-keys-after-rndc-rollover' into 'main'
Rekey immediately after rndc checkds/rollover

Closes #2488

See merge request isc-projects/bind9!4813
2021-03-22 13:35:12 +00:00
Matthijs Mekking
82d667e1d5 Fix some intermittent kasp failures
When calling "rndc dnssec -checkds", it may take some milliseconds
before the appropriate changes have been written to the state file.
Add retry_quiet mechanisms to allow the write operation to finish.

Also retry_quiet the check for the next key event. A "rndc dnssec"
command may trigger a zone_rekey event and this will write out
a new "next key event" log line, but it may take a bit longer than
than expected in the tests.
2021-03-22 11:58:26 +01:00
Matthijs Mekking
82f72ae249 Rekey immediately after rndc checkds/rollover
Call 'dns_zone_rekey' after a 'rndc dnssec -checkds' or 'rndc dnssec
-rollover' command is received, because such a command may influence
the next key event. Updating the keys immediately avoids unnecessary
rollover delays.

The kasp system test no longer needs to call 'rndc loadkeys' after
a 'rndc dnssec -checkds' or 'rndc dnssec -rollover' command.
2021-03-22 11:58:26 +01:00
Matthijs Mekking
28923bc695 Merge branch '2517-cds-dnskey-delete-records-prevent-loading-unsigned-zone' into 'main'
Resolve "CDS and CDNSKEY DELETE records prevent (re-)loading unsigned zone"

Closes #2517

See merge request isc-projects/bind9!4810
2021-03-22 10:06:45 +00:00
Matthijs Mekking
841e90c6fc Add CHANGES and notes for [#2517] 2021-03-22 10:31:23 +01:00
Matthijs Mekking
6f31f62d69 Delete CDS/CDNSKEY records when zone is unsigned
CDS/CDNSKEY DELETE records are only useful if they are signed,
otherwise the parent cannot verify these RRsets anyway. So once the DS
has been removed (and signaled to BIND), we can remove the DNSKEY and
RRSIG records, and at this point we can also remove the CDS/CDNSKEY
records.
2021-03-22 10:30:59 +01:00
Matthijs Mekking
f211c7c2a1 Allow CDS/CDNSKEY DELETE records in unsigned zone
While not useful, having a CDS/CDNSKEY DELETE record in an unsigned
zone is not an error and "named-checkzone" should not complain.
2021-03-22 10:25:30 +01:00
Matthijs Mekking
052ec16a44 Merge branch 'matthijs-test-keymgr2kasp' into 'main'
Test migrating to dnssec-policy

Closes #2544

See merge request isc-projects/bind9!4758
2021-03-22 09:09:06 +00:00
Matthijs Mekking
d5531df79a Retry quiet check keys
Change the 'check_keys' function to try three times. Some intermittent
kasp test failures are because we are inspecting the key files
before the actual change has happen. The 'retry_quiet' approach allows
for a bit more time to let the write operation finish.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
923c2a07bf Update copyrights for keymgr2kasp
This MR introduces a new system test 'keymgr2kasp' to test
migration to 'dnssec-policy'. It moves some existing tests from
the 'kasp' system test to here.

Also a common script 'kasp.sh', to be used in kasp specific tests,
is introduced.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
27e7d5f698 Fix keymgr key init bug
The 'keymgr_key_init()' function initializes key states if they have
not been set previously. It looks at the key timing metadata and
determines using the given times whether a state should be set to
RUMOURED or OMNIPRESENT.

However, the DNSKEY and ZRRSIG states were mixed up: When looking
at the Activate timing metadata we should set the ZRRSIG state, and
when looking at the Published timing metadata we should set the
DNSKEY state.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
c40c1ebcb1 Test keymgr2kasp state from timing metadata
Add two test zones that migrate to dnssec-policy. Test if the key
states are set accordingly given the timing metadata.

The rumoured.kasp zone has its Publish/Active/SyncPublish times set
not too long ago so the key states should be set to RUMOURED. The
omnipresent.kasp zone has its Publish/Active/SyncPublish times set
long enough to set the key states to OMNIPRESENT.

Slightly change the init_migration_keys function to set the
key lifetime to "none" (legacy keys don't have lifetime). Then in the
test case set the expected key lifetime explicitly.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
f6fa254256 Editorial commit keymgr2kasp test
This commit is somewhat editorial as it does not introduce something
new nor fixes anything.

The layout in keymgr2kasp/tests.sh has been changed, with the
intention to make more clear where a test scenario ends and begins.

The publication time of some ZSKs has been changed. It makes a more
clear distinction between publication time and activation time.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
ecb073bdd6 Introduce kasp.sh
Add a script similar to conf.sh to include common functions and
variables for testing KASP. Currently used in kasp, keymgr2kasp, and
nsec3.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
5389172111 Move kasp migration tests to different directory
The kasp system test was getting pretty large, and more tests are on
the way. Time to split up. Move tests that are related to migrating
to dnssec-policy to a separate directory 'keymgr2kasp'.
2021-03-22 09:50:05 +01:00
Michał Kępień
ea26306eba Merge branch '1946-man-page-fixes' into 'main'
Man page fixes

See merge request isc-projects/bind9!4817
2021-03-22 08:39:38 +00:00
Michał Kępień
185a1a5643 Install man page for named-compilezone
The named-checkzone tool can also be invoked as named-compilezone.  Make
sure a man page is installed for that alias.  Move and rename the
"man_named-checkzone" label to prevent a Sphinx duplicate label warning
from being raised (see commit 84862e96c1
for more information).
2021-03-22 09:36:48 +01:00
Michał Kępień
dcab218adc Install named-nzd2nzf man page conditionally
The named-nzd2nzf utility is only built and installed for LMDB-enabled
builds.  Adjust the relevant Makefile.am file to make sure the
named-nzd2nzf.1 man page is also only built and installed for
LMDB-enabled builds.
2021-03-22 09:36:48 +01:00
Michał Kępień
ceedee0785 Install dnstap-read man page conditionally
The dnstap-read utility is only built and installed for dnstap-enabled
builds.  Adjust the relevant Makefile.am file to make sure the
dnstap-read.1 man page is also only built and installed for
dnstap-enabled builds.
2021-03-22 09:36:48 +01:00
Evan Hunt
d04aa1d44e Merge branch 'placeholder' into 'main'
placeholder for #2575

See merge request isc-projects/bind9!4828
2021-03-20 19:16:16 +00:00
Evan Hunt
c452c0a0a5 placeholder for #2575
Issue #2575 was merged to 9.16 only as change 5603, but a placeholder
was not added to CHANGES in the main branch. This commit adds the
placeholder and renumbers the two subsequent changes.
2021-03-20 12:11:11 -07:00
Evan Hunt
8e0902b731 Merge branch '2592-dig-clock-realtime' into 'main'
Resolve "dig -u is extremely inaccurate, especially on machines with the kernel timer tick set at 100Hz"

Closes #2592

See merge request isc-projects/bind9!4826
2021-03-20 18:58:16 +00:00
Evan Hunt
1933bcf1d3 CHANGES 2021-03-20 11:25:55 -07:00
Patrick McLean
56cef1495f dig: Use high resolution clocks when microsecond accuracy is requested
The TIME_NOW macro calls isc_time_now which uses CLOCK_REALTIME_COARSE
for getting the current time. This is perfectly fine for millisecond,
however when the user request microsecond resolutiuon, they are going
to get very inaccurate results. This is especially true on a server
class machine where the clock ticks may be set to 100HZ.

This changes dig to use the new TIME_NOW_HIRES macro that uses the
CLOCK_MONOTONIC_RAW that is more expensive, but gets the *actual*
current time rather than the at the last kernel time tick.
2021-03-20 11:25:55 -07:00
Patrick McLean
ebced74b19 Add isc_time_now_hires function to get current time with high resolution
The current isc_time_now uses CLOCK_REALTIME_COARSE which only updates
on a timer tick. This clock is generally fine for millisecond accuracy,
but on servers with 100hz clocks, this clock is nowhere near accurate
enough for microsecond accuracy.

This commit adds a new isc_time_now_hires function that uses
CLOCK_REALTIME, which gives the current time, though it is somewhat
expensive to call. When microsecond accuracy is required, it may be
required to use extra resources for higher accuracy.
2021-03-20 11:25:55 -07:00
Ondřej Surý
bee4ee931f Merge branch '2416-improve-netmgr-unit-tests-reliability' into 'main'
Improve reliability of the netmgr unit tests

Closes #2455 and #2416

See merge request isc-projects/bind9!4628
2021-03-19 16:22:22 +00:00
Ondřej Surý
d96c94d754 Require CMocka >= 1.1.3 to run the unit tests
In CMocka versions << 1.1.3, the skip() function would cause the whole
unit test to abort when CMOCKA_TEST_ABORT is set.  As this is problem
only in Debian 9 Stretch and Ubuntu 16.04 Xenial, we just require the
CMocka >= 1.1.3 and disable the unit testing on Debian 9 Stretch until
we can pull the libcmocka-dev from stretch-backports and remove the
Ubuntu 16.04 Xenial from the CI as it is reaching End of Standard
Support at the end of April 2021.
2021-03-19 16:25:28 +01:00
Ondřej Surý
d016ea745f Fix compilation with NETMGR_TRACE(_VERBOSE) enabled on non-Linux
When NETMGR_TRACE(_VERBOSE) is enabled, the build would fail on some
non-Linux non-glibc platforms because:

  * Use <stdint.h> print macros because uint_fast32_t is not always
    unsigned long

  * The header <execinfo.h> is not available on non-glibc, thus commit
    adds dummy backtrace() and backtrace_symbols_fd() functions for
    platforms without HAVE_BACKTRACE
2021-03-19 16:25:28 +01:00
Ondřej Surý
42e4e3b843 Improve reliability of the netmgr unit tests
The netmgr unit tests were designed to push the system limits to maximum
by sending as many queries as possible in the busy loop from multiple
threads.  This mostly works with UDP, but in the stateful protocol where
establishing the connection takes more time, it failed quite often in
the CI.  On FreeBSD, this happened more often, because the socket() call
would fail spuriosly making the problem even worse.

This commit does several things to improve reliability:

* return value of isc_nm_<proto>connect() is always checked and retried
  when scheduling the connection fails

* The busy while loop has been slowed down with usleep(1000); so the
  netmgr threads could schedule the work and get executed.

* The isc_thread_yield() was replaced with usleep(1000); also to allow
  the other threads to do any work.

* Instead of waiting on just one variable, we wait for multiple
  variables to reach the final value

* We are wrapping the netmgr operations (connects, reads, writes,
  accepts) with reference counting and waiting for all the callbacks to
  be accounted for.

  This has two effects:

  a) the isc_nm_t is always clean of active sockets and handles when
     destroyed, so it will prevent the spurious INSIST(references == 1)
     from isc_nm_destroy()

  b) the unit test now ensures that all the callbacks are always called
     when they should be called, so any stuck test means that there was
     a missing callback call and it is always a real bug

These changes allows us to remove the workaround that would not run
certain tests on systems without port load-balancing.
2021-03-19 16:25:28 +01:00
Ondřej Surý
e8cd3d3cf7 Merge branch 'ondrej/call-failed_read-from-tls_error' into 'main'
Call isc__nm_tlsdns_failed_read on tls_error to cleanup the socket

See merge request isc-projects/bind9!4824
2021-03-19 14:57:53 +00:00
Ondřej Surý
e4e0e9e3c1 Call isc__nm_tlsdns_failed_read on tls_error to cleanup the socket
In tls_error(), we now call isc__nm_tlsdns_failed_read() instead of just
stopping timer and reading from the socket.  This allows us to properly
cleanup any pending operation on the socket.
2021-03-19 15:28:52 +01:00
Matthijs Mekking
085c2e3249 Merge branch 'treysis-filter-a' into 'main'
filter-a plugin

Closes #2585

See merge request isc-projects/bind9!4816
2021-03-19 09:41:02 +00:00
Matthijs Mekking
9a256347ab Add changes for filter-a plugin 2021-03-19 08:06:55 +01:00
treysis
6b2ea00621 Add filter-a plugin for IPv6-dominant environments
(cherry picked from commit 78f6cd57e1cc166823415438fe2d19a324cf7a67)
2021-03-19 08:06:55 +01:00
Ondřej Surý
6ae0a90583 Merge branch '2581-oldsize-assertion' into 'main'
Fix memory accounting bug in TLSDNS

Closes #2581

See merge request isc-projects/bind9!4809
2021-03-18 22:03:25 +00:00
Ondřej Surý
e4b0730387 Call the isc__nm_failed_connect_cb() early when shutting down
When shutting down, calling the isc__nm_failed_connect_cb() was delayed
until the connect callback would be called.  It turned out that the
connect callback might not get called at all when the socket is being
shut down.  Call the failed_connect_cb() directly in the
tlsdns_shutdown() instead of waiting for the connect callback to call it.
2021-03-18 14:31:15 -07:00
Ondřej Surý
73c574e553 Fix typo in processbuffer() - tcpdns vs tlsdns
The processbuffer() would call isc__nm_tcpdns_processbuffer() instead of
isc__nm_tlsdns_processbuffer() for the isc_nm_tlsdnssocket type of
socket.
2021-03-18 21:35:13 +01:00
Ondřej Surý
1d64d4cde8 Fix memory accounting bug in TLSDNS
After a partial write the tls.senddata buffer would be rearranged to
contain only the data tha wasn't sent and the len part would be made
shorter, which would lead to attempt to free only part of a socket's
tls.senddata buffer.
2021-03-18 18:14:38 +01:00
Ondřej Surý
15f676f111 Merge branch 'ondrej/fix-dangling-uvreq-in-tlsdns' into 'main'
Fix dangling uvreq when data is sent from tlsdns_cycle()

See merge request isc-projects/bind9!4820
2021-03-18 17:02:18 +00:00
Ondřej Surý
5cc406a920 Fix dangling uvreq when data is sent from tlsdns_cycle()
The tlsdns_cycle() might call uv_write() to write data to the socket,
when this happens and the socket is shutdown before the callback
completes, the uvreq structure was not freed because the callback would
be called with non-zero status code.
2021-03-18 17:58:56 +01:00
Ondřej Surý
06913d3d74 Merge branch '2573-dont-timeout-when-sending-data' into 'main'
Resolve "Fix TCPDNS and TLSDNS timers"

Closes #2583 and #2573

See merge request isc-projects/bind9!4807
2021-03-18 16:01:01 +00:00
Michal Nowak
2edba8777f Merge branch 'v9_17_11-release' into 'main'
Merge 9.17.11 release branch

See merge request isc-projects/bind9!4818
2021-03-18 15:38:54 +00:00
Ondřej Surý
98f7495426 Add CHANGES and release note for GL #2573 2021-03-18 16:37:57 +01:00
Ondřej Surý
36ddefacb4 Change the isc_nm_(get|set)timeouts() to work with milliseconds
The RFC7828 specifies the keepalive interval to be 16-bit, specified in
units of 100 milliseconds and the configuration options tcp-*-timeouts
are following the suit.  The units of 100 milliseconds are very
unintuitive and while we can't change the configuration and presentation
format, we should not follow this weird unit in the API.

This commit changes the isc_nm_(get|set)timeouts() functions to work
with milliseconds and convert the values to milliseconds before passing
them to the function, not just internally.
2021-03-18 16:37:57 +01:00
Ondřej Surý
1ef232f93d Merge the common parts between udp, tcpdns and tlsdns protocol
The udp, tcpdns and tlsdns contained lot of cut&paste code or code that
was very similar making the stack harder to maintain as any change to
one would have to be copied to the the other protocols.

In this commit, we merge the common parts into the common functions
under isc__nm_<foo> namespace and just keep the little differences based
on the socket type.
2021-03-18 16:37:57 +01:00
Ondřej Surý
caa5b6548a Fix TCPDNS and TLSDNS timers
After the TCPDNS refactoring the initial and idle timers were broken and
only the tcp-initial-timeout was always applied on the whole TCP
connection.

This broke any TCP connection that took longer than tcp-initial-timeout,
most often this would affect large zone AXFRs.

This commit changes the timeout logic in this way:

  * On TCP connection accept the tcp-initial-timeout is applied
    and the timer is started
  * When we are processing and/or sending any DNS message the timer is
    stopped
  * When we stop processing all DNS messages, the tcp-idle-timeout
    is applied and the timer is started again
2021-03-18 16:37:57 +01:00
Ondřej Surý
64cff61c02 Add TCP timeouts system test
The system tests were missing a test that would test tcp-initial-timeout
and tcp-idle-timeout.

This commit adds new "timeouts" system test that adds:

  * Test that waits longer than tcp-initial-timeout and then checks
    whether the socket was closed

  * Test that sends and receives DNS message then waits longer than
    tcp-initial-timeout but shorter time than tcp-idle-timeout than
    sends DNS message again than waits longer than tcp-idle-timeout
    and checks whether the socket was closed

  * Similar test, but bursting 25 DNS messages than waiting longer than
    tcp-initial-timeout and shorter than tcp-idle-timeout than do second
    25 DNS message burst

  * Check whether transfer longer than tcp-initial-timeout succeeds
2021-03-18 16:37:57 +01:00
Michal Nowak
3265dfa929 Set up release notes for BIND 9.17.12 2021-03-18 15:58:15 +01:00
Michal Nowak
8853ec09a5 Update BIND version to 9.17.11 2021-03-18 15:55:36 +01:00
Michal Nowak
9d4da23850 Add a CHANGES marker 2021-03-18 15:55:32 +01:00
Michal Nowak
a8b525290f Merge branch 'mnowak/prepare-documentation-for-bind-9.17.11' into 'v9_17_11-release'
Prepare documentation for BIND 9.17.11

See merge request isc-private/bind9!252
2021-03-18 15:55:11 +01:00
Michal Nowak
924f8ceb06 Prepare release notes for BIND 9.17.11 2021-03-18 15:55:11 +01:00
Michal Nowak
e6ca82b2c4 Add release notes for GL #2472 2021-03-18 15:55:10 +01:00
Michal Nowak
566b8ab85e Add release note for GL #2504 2021-03-18 15:55:10 +01:00
Michal Nowak
baf79279f0 Add release note for GL #2041 2021-03-18 15:55:10 +01:00
Michal Nowak
70076fb7c8 Reorder release notes 2021-03-18 15:55:10 +01:00
Michal Nowak
b66bb0c89e Tweak and reword release notes 2021-03-18 15:54:41 +01:00
Michal Nowak
188d605c2a Tweak and reword recent CHANGES entries 2021-03-18 15:53:30 +01:00
Michal Nowak
68128f2092 Release template: update the -S edition delivery tickets
Change requested by the Support team.
2021-03-18 15:53:30 +01:00
Mark Andrews
ffea605679 Merge branch '2580-does-not-compile-without-deprecated-openssl-apis' into 'main'
Resolve "Does not compile without deprecated OpenSSL APIs"

Closes #2580

See merge request isc-projects/bind9!4806
2021-03-17 20:10:11 +00:00
Mark Andrews
a9f883cbc2 Stop using deprecated calls in lib/isc/tls.c
from Rosen Penev @neheb
2021-03-17 20:05:47 +00:00
Matthijs Mekking
8d8373c21c Merge branch '2523-thaw-dnssec-policy-zone' into 'main'
Resolve "Unable to thaw a frozen dynamic zone when KASP is configured."

Closes #2523

See merge request isc-projects/bind9!4777
2021-03-17 10:11:13 +00:00
Matthijs Mekking
0cae3249e3 Add test for thaw dynamic kasp zone
Add a test for freezing, manually updating, and then thawing a dynamic
zone with "dnssec-policy". In the kasp system test we add parameters
to the "update_is_signed" check to signal the indicated IP addresses
for the labels "a" and "d". If set to '-', the test is skipped.

After nsupdating the dynamic.kasp zone, we revert the update (with
nsupdate) and update the zone again, but now with the freeze/thaw
approach.
2021-03-17 08:24:17 +01:00
Matthijs Mekking
b90846f222 Fully sign a thawed zone
When thawing a zone, we don't know what changes have been made. If we
do DNSSEC maintenance on this zone, schedule a full sign.
2021-03-17 08:24:17 +01:00
Matthijs Mekking
b518ed9f46 Fix "unable to thaw dynamic kasp zone"
Dynamic zones with dnssec-policy could not be thawed because KASP
zones were considered always dynamic. But a dynamic KASP zone should
also check whether updates are disabled.
2021-03-17 08:24:15 +01:00
Matthijs Mekking
0eb0dabdcc Merge branch '2561-dnssec-guide-signing-type' into 'main'
Fix typo in DNSSEC Guide

Closes #2561

See merge request isc-projects/bind9!4791
2021-03-16 13:37:32 +00:00
Matthijs Mekking
d45af8877a Fix typo in DNSSEC Guide
The "dnssec-policy" example should say "keys" instead of "key".
2021-03-16 13:37:16 +00:00
Artem Boldariev
50eaa0f38f Merge branch '2514-tls-cert-chain' into 'main'
Load full certificate chain from a certificate chain file

Closes #2514

See merge request isc-projects/bind9!4792
2021-03-16 10:33:35 +00:00
Matthijs Mekking
c69fafdd65 Add change entry for [#2514] 2021-03-16 11:50:32 +02:00
Artem Boldariev
75363dcb7c Load full certificate chain from a certificate chain file
This commit fixes loading the certificate chain files so that the full
chain could be sent to the clients which require that for
verification. Before that fix only the top most certificate would be
loaded from the chain and sent to clients preventing some of them to
perform certificate validation (e.g. Windows 10 DoH client).
2021-03-16 11:49:04 +02:00
Matthijs Mekking
6dee5c1b28 Merge branch '2562-xot-crash' into 'main'
Fix a XoT crash

Closes #2562

See merge request isc-projects/bind9!4803
2021-03-16 09:42:18 +00:00
Matthijs Mekking
ee0835d977 Fix a XoT crash
The transport should also be detached when we skip a master, otherwise
named will crash when sending a SOA query to the next master over TLS,
because the transport must be NULL when we enter
'dns_view_gettransport'.
2021-03-16 10:11:12 +01:00
Mark Andrews
24c796942f Merge branch '2569-nsupdate-on-solaris-produces-different-failure-text-than-expected' into 'main'
Resolve "nsupdate on Solaris produces different failure text than expected"

Closes #2569

See merge request isc-projects/bind9!4804
2021-03-16 00:11:02 +00:00
Mark Andrews
25d1276170 Ignore the actual error code returned by getaddrinfo
when testing if interactive mode continues or not on
invalid hostname.  We only need to detect that getaddrinfo
failed and that we continued or not.
2021-03-16 10:20:28 +11:00
Mark Andrews
a9339fe7fc Merge branch '2567-warning-array-subscript-is-of-type-char-on-netbsd-9' into 'main'
Resolve "warning: array subscript is of type 'char' on NetBSD 9"

Closes #2567

See merge request isc-projects/bind9!4794
2021-03-15 03:33:21 +00:00
Mark Andrews
d768336cc6 Add CHANGES for [GL #2567] 2021-03-15 14:18:46 +11:00
Mark Andrews
99bd0c346f cast (char) to (unsigned char) when calling is*() 2021-03-15 14:18:03 +11:00
Michal Nowak
e391209212 Merge branch '2565-servestale-fetchlimits-crash' into 'main'
Fix servestale fetchlimits crash

Closes #2565

See merge request isc-projects/bind9!4797
2021-03-11 12:14:47 +00:00
Matthijs Mekking
87591de6f7 Fix servestale fetchlimits crash
When we query the resolver for a domain name that is in the same zone
for which is already one or more fetches outstanding, we could
potentially hit the fetch limits. If so, recursion fails immediately
for the incoming query and if serve-stale is enabled, we may try to
return a stale answer.

If the resolver is also is authoritative for the parent zone (for
example the root zone), first a delegation is found, but we first
check the cache for a better response.

Nothing is found in the cache, so we try to recurse to find the
answer to the query.

Because of fetch-limits 'dns_resolver_createfetch()' returns an error,
which 'ns_query_recurse()' propagates to the caller,
'query_delegation_recurse()'.

Because serve-stale is enabled, 'query_usestale()' is called,
setting 'qctx->db' to the cache db, but leaving 'qctx->version'
untouched. Now 'query_lookup()' is called to search for stale data
in the cache database with a non-NULL 'qctx->version'
(which is set to a zone db version), and thus we hit an assertion
in rbtdb.

This crash was introduced in 'main' by commit
8bcd7fe69e.
2021-03-11 12:16:14 +01:00
Ondřej Surý
74a0294be0 Merge branch '2568-test_client-c-error-static-declaration-of-yield-follows-non-static-declaration-on-solaris' into 'main'
Resolve "test_client.c: error: static declaration of 'yield' follows non-static declaration on Solaris"

Closes #2568

See merge request isc-projects/bind9!4795
2021-03-11 06:09:49 +00:00
Mark Andrews
af0ee2c718 Rename 'yield' to 'waitforsignal' due to namespace clash 2021-03-11 11:34:15 +11:00
Michał Kępień
77ac8db0c6 Merge branch '2556-fix-documentation-for-the-max-ixfr-ratio-option' into 'main'
Fix documentation for the "max-ixfr-ratio" option

Closes #2556

See merge request isc-projects/bind9!4787
2021-03-08 11:28:37 +00:00
Michał Kępień
3878cf4ac5 Fix documentation for the "max-ixfr-ratio" option
Commit 9fb6d11abb (which converted BIND 9
documentation from DocBook to Sphinx) inadvertently removed a paragraph
from the description of the "max-ixfr-ratio" option.  Add the missing
paragraph back.
2021-03-08 12:27:39 +01:00
Ondřej Surý
8bd1da8e4e Merge branch 'ondrej/disable-github-pr-fix' into 'main'
Fix syntax error in GitHub Actions lockdown.yml file

See merge request isc-projects/bind9!4789
2021-03-08 11:25:15 +00:00
Ondřej Surý
c4a4ee2db9 Fix syntax error in GitHub Actions lockdown.yml file 2021-03-08 12:24:17 +01:00
Ondřej Surý
494057b8f4 Merge branch 'ondrej/disable-github-pr' into 'main'
Add GitHub Action that immediately closes issue / PRs

See merge request isc-projects/bind9!4788
2021-03-08 11:13:24 +00:00
Ondřej Surý
2463f62c93 Add GitHub Action that immediately closes issue / PRs
Unfortunately, it's not possible to disable Pull Requests on the
mirrored repository on the GitHub, so this commit adds external action
that closes any new open Issue or Pull Requests instead letting them rot
unnoticed.
2021-03-08 12:09:14 +01:00
Ondřej Surý
42e8db9e74 Merge branch '2555-workaround-truncated-64-bit-enum-in-journal-on-windows' into 'main'
Resolve "journal test fails on Windows"

Closes #2555

See merge request isc-projects/bind9!4784
2021-03-08 08:42:14 +00:00
Evan Hunt
990dd9dbff fix automatic journal upgrade on windows
- use a value less than 2^32 for DNS_ZONEFLG_FIXJOURNAL; a larger value
  could cause problems in some build environments. the zone flag
  DNS_ZONEFLG_DIFFONRELOAD, which was no longer in use, has now been
  deleted and its value reused for _FIXJOURNAL.
2021-03-08 08:51:34 +01:00
Evan Hunt
46c11726d4 add start and end serial numbers to 'named-printjournal -x'
add the starting and ending serial number from the journal
header to the output of dns_journal_print().
2021-03-08 08:51:34 +01:00
Mark Andrews
bc714bc5c5 Merge branch '2559-cid-329159-logically-dead-code-in-lib-dns-journal-c' into 'main'
Resolve "CID 329159: Logically dead code in lib/dns/journal.c"

Closes #2559

See merge request isc-projects/bind9!4780
2021-03-08 05:25:17 +00:00
Mark Andrews
848e336db4 Silence CID 329159: Logically dead code in lib/dns/journal.c
*** CID 329159:    (DEADCODE)
    /lib/dns/journal.c: 1719 in dns_journal_print()
    1713     		}
    1714     		CHECK(dns_difftuple_create(
    1715     			diff.mctx, n_soa == 1 ? DNS_DIFFOP_DEL : DNS_DIFFOP_ADD,
    1716     			name, ttl, rdata, &tuple));
    1717     		dns_diff_append(&diff, &tuple);
    1718
    >>>     CID 329159:    (DEADCODE)
    >>>     Execution cannot reach the expression "printxhdr" inside this statement: "if (++n_put != 0U || printx...".
    1719     		if (++n_put != 0 || printxhdr) {
    1720     			result = dns_diff_print(&diff, file);
    1721     			dns_diff_clear(&diff);
    1722     			n_put = 0;
    1723     			if (result != ISC_R_SUCCESS) {
    1724     				break;
    /lib/dns/journal.c: 1734 in dns_journal_print()
    1728     	if (result == ISC_R_NOMORE) {
    1729     		result = ISC_R_SUCCESS;
    1730     	}
    1731     	CHECK(result);
    1732
    1733     	if (!printxhdr && n_put != 0) {
    >>>     CID 329159:    (DEADCODE)
    >>>     Execution cannot reach this statement: "result = dns_diff_print(&di...".
    1734     		result = dns_diff_print(&diff, file);
    1735     		dns_diff_clear(&diff);
    1736     	}
    1737     	goto cleanup;
    1738
    1739     failure:
2021-03-08 05:06:29 +00:00
Mark Andrews
279c8a837b Merge branch '2560-cid-329157-dereference-before-null-check-in-lib-dns-journal-c' into 'main'
Resolve "CID 329157: Dereference before null check in lib/dns/journal.c"

Closes #2560

See merge request isc-projects/bind9!4779
2021-03-08 05:06:06 +00:00
Mark Andrews
4054405909 Silence CID 329157: Dereference before null check in lib/dns/journal.c
*** CID 329157:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/journal.c: 754 in journal_open()
    748     			    j->header.index_size * sizeof(journal_rawpos_t));
    749     	}
    750     	if (j->index != NULL) {
    751     		isc_mem_put(j->mctx, j->index,
    752     			    j->header.index_size * sizeof(journal_pos_t));
    753     	}
       CID 329157:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "j->filename" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    754     	if (j->filename != NULL) {
    755     		isc_mem_free(j->mctx, j->filename);
    756     	}
    757     	if (j->fp != NULL) {
    758     		(void)isc_stdio_close(j->fp);
    759     	}
2021-03-08 05:05:28 +00:00
Mark Andrews
27117f7b46 Merge branch 'marka-add-journal-to-conf-sh-common' into 'main'
Add journal to conf.sh.common

See merge request isc-projects/bind9!4781
2021-03-08 01:12:54 +00:00
Mark Andrews
926b9056b7 add journal to conf.sh.common 2021-03-08 11:36:00 +11:00
Artem Boldariev
d6f33fcd6c Merge branch '1641-doh-dig' into 'main'
Resolve "RFC8484, DoH support in DIG (and any other relevant utilities)"

Closes #2464 and #1641

See merge request isc-projects/bind9!4672
2021-03-05 16:46:02 +00:00
Evan Hunt
f3b13c6027 CHANGES, release notes 2021-03-05 18:09:42 +02:00
Evan Hunt
dbffb212ce add basic DoH system tests
- rename dot to doth, as it now covers both dot and doh.
- merge xot into doth as it's closely related.
- added long-lived key and cert files (expiring 2121).
- add tests with https-get, https-post, http-plain, alternate
  endpoints, and both static and ephemeral TLS configuration.
- incidentally fixed a memory leak in dig that occurred if +https
  was specified more than once.
2021-03-05 18:09:42 +02:00
Artem Boldariev
7a59fb8207 Disable Nagle's algorithm for HTTP/2 connections
It is advisable to disable Nagle's algorithm for HTTP/2 connections
because multiple HTTP/2 streams could be multiplexed over one
transport connection. Thus, delays when delivering small packets could
bring down performance for the whole session. HTTP/2 is meant to be
used this way.
2021-03-05 18:09:42 +02:00
Artem Boldariev
66d20cf28b Fix deadlock in isc_nm_tlsconnect()
when called from within the context of a network thread,
isc_nm_tlsconnect() hangs. it is waiting for the socket's
result code to be updated, but that update is supposed to happen
asynchronously in the network thread, and if we're already blocking
in the network thread, it can never occur.

we can kluge around this by setting the socket result code
early; this works for most clients (including "dig"), but it causes
inconsistent behaviors that manifest as test failures in the DoH unit
test.

so we kluged around it even more by setting the socket result code
early *only when running in the network thread*. we need a better
solution for this problem, but this will do for now.
2021-03-05 18:09:22 +02:00
Artem Boldariev
ca9a15e3bc DoH: call send callbacks after data was actually sent 2021-03-05 13:29:32 +02:00
Artem Boldariev
71668437d4 Put sane limitations in place to handle bad requests gracefully
This commit makes the server-side code polite.

It fixes the error handling code on the server side and fixes
returning error code in responses (there was a nasty bug which could
potentially crash the server).

Also, in this commit we limit max size POST request data to 96K, max
processed data size in headers to 128K (should be enough to handle any
GET requests).

If these limits are surpassed, server will terminate the request with
RST_STREAM without responding with error code. Otherwise it politely
responds with error code.

This commit also limits number of concurrent HTTP/2 streams per
transport connection on server to 100 (as nghttp2 advises by default).

Ideally, these parameters should be configurable both globally and per
every HTTP endpoint description in the configuration file, but for now
putting sane limits should be enough.
2021-03-05 13:29:32 +02:00
Evan Hunt
88752b1121 refactor outgoing HTTP connection support
- style, cleanup, and removal of unnecessary code.
- combined isc_nm_http_add_endpoint() and isc_nm_http_add_doh_endpoint()
  into one function, renamed isc_http_endpoint().
- moved isc_nm_http_connect_send_request() into doh_test.c as a helper
  function; remove it from the public API.
- renamed isc_http2 and isc_nm_http2 types and functions to just isc_http
  and isc_nm_http, for consistency with other existing names.
- shortened a number of long names.
- the caller is now responsible for determining the peer address.
  in isc_nm_httpconnect(); this eliminates the need to parse the URI
  and the dependency on an external resolver.
- the caller is also now responsible for creating the SSL client context,
  for consistency with isc_nm_tlsdnsconnect().
- added setter functions for HTTP/2 ALPN. instead of setting up ALPN in
  isc_tlsctx_createclient(), we now have a function
  isc_tlsctx_enable_http2client_alpn() that can be run from
  isc_nm_httpconnect().
- refactored isc_nm_httprequest() into separate read and send functions.
  isc_nm_send() or isc_nm_read() is called on an http socket, it will
  be stored until a corresponding isc_nm_read() or _send() arrives; when
  we have both halves of the pair the HTTP request will be initiated.
- isc_nm_httprequest() is renamed isc__nm_http_request() for use as an
  internal helper function by the DoH unit test. (eventually doh_test
  should be rewritten to use read and send, and this function should
  be removed.)
- added implementations of isc__nm_tls_settimeout() and
  isc__nm_http_settimeout().
- increased NGHTTP2 header block length for client connections to 128K.
- use isc_mem_t for internal memory allocations inside nghttp2, to
  help track memory leaks.
- send "Cache-Control" header in requests and responses. (note:
  currently we try to bypass HTTP caching proxies, but ideally we should
  interact with them: https://tools.ietf.org/html/rfc8484#section-5.1)
2021-03-05 13:29:26 +02:00
Ondřej Surý
9c8b7a5c45 add preliminary DoH client support to dig
add options "+https", "+https-get" and "+http-plain" to
allow dig to connect over HTTP/2 channels.
2021-03-05 13:28:17 +02:00
Ondřej Surý
13d23b0c8e Merge branch '1529-add-threadsanitizer-core-dumping-flags-when-we-are-threadsanitizer-clean' into 'main'
Resolve "Add ThreadSanitizer core dumping flags when we are ThreadSanitizer-clean"

Closes #1529

See merge request isc-projects/bind9!4774
2021-03-04 15:25:00 +00:00
Ondřej Surý
4072cc2b93 Disable allow_failure for ThreadSanitizer jobs
Since the main branch is now TSAN-clean, it's a good opportunity to
enable hard failures for the TSAN system test jobs.
2021-03-04 15:32:55 +01:00
Michal Nowak
a730bc47f5 Add ThreadSanitizer core dumping flags
This should let us have core dumps from crashed system test when
ThreadSanitizer is enabled.
2021-03-04 15:32:50 +01:00
Ondřej Surý
80f01cbf42 Merge branch '2455-tcpdns_test-c-runtime-error-load-of-misaligned-address-for-type-uint64_t' into 'main'
Assigning uint64_t from buffer might be misaligned in netmgr tests

Closes #2455

See merge request isc-projects/bind9!4769
2021-03-04 14:28:11 +00:00
Ondřej Surý
a55bdb28f9 Assigning uint64_t from buffer might be misaligned in netmgr tests
Resolve possible 8-byte unaligned access when assigning the magic
value from the received buffer.
2021-03-04 15:02:24 +01:00
Ondřej Surý
cb9df06f7d Merge branch '2533-mdig-move-cleanup' into 'main'
Move cleanup of queries to later in the shutdown sequence

Closes #2533

See merge request isc-projects/bind9!4768
2021-03-04 14:01:15 +00:00
Mark Andrews
4015af02d8 Move cleanup of queries to later in the shutdown sequence
to avoid TSAN report

    WARNING: ThreadSanitizer: data race
      Write of size 8 at 0x000000000001 by main thread:
        #0 free <null>
        #1 default_memfree lib/isc/mem.c:440
        #2 mem_put lib/isc/mem.c:363
        #3 isc__mem_free lib/isc/mem.c:1012
        #4 main bin/tools/mdig.c:2231

      Previous read of size 1 at 0x000000000005 by thread T1:
        #0 dns_name_fromtext lib/dns/name.c:1121
        #1 sendquery bin/tools/mdig.c:596
        #2 sendqueries bin/tools/mdig.c:779
        #3 dispatch lib/isc/task.c:1153
        #4 run lib/isc/task.c:1345
        #5 isc__trampoline_run lib/isc/trampoline.c:184
        #6 <null> <null>

      Thread T1 (running) created by main thread at:
        #0 pthread_create <null>
        #1 isc_thread_create pthreads/thread.c:79
        #2 isc_taskmgr_create lib/isc/task.c:1435
        #3 main bin/tools/mdig.c:2148

    SUMMARY: ThreadSanitizer: data race in __interceptor_free
2021-03-04 13:21:56 +01:00
Michal Nowak
1f8463a6e9 Merge branch '2357-add-CHANGES-entry' into 'main'
Add CHANGES entry for GL #2357

Closes #2357

See merge request isc-projects/bind9!4770
2021-03-04 11:45:06 +00:00
Michal Nowak
d98f72de25 Add CHANGES entry for GL #2357 2021-03-04 12:26:58 +01:00
Ondřej Surý
b532eb3029 Merge branch '2552-comparison-between-signed-and-unsigned-on-arm7' into 'main'
Fix comparison between signed and unsigned integer expressions

Closes #2552

See merge request isc-projects/bind9!4766
2021-03-04 10:24:00 +00:00
Ondřej Surý
d3bb3ae64f Fix comparison between signed and unsigned integer expressions
Simple typecast to size_t should be enough to silence the warning on
ARMv7, even though the code is in fact correct, because the readlen is
checked for being < 0 in the block before the warning.
2021-03-04 11:21:43 +01:00
Ondřej Surý
2c9c16e334 Merge branch '2551-char-is-unsigned-on-arm64' into 'main'
Use int type to store result from isc_commandline_parse()

Closes #2551

See merge request isc-projects/bind9!4765
2021-03-04 10:20:18 +00:00
Ondřej Surý
8153729d3a Use int type to store result from isc_commandline_parse()
The C standard actually doesn't define char as signed or unsigned, and
it could be either according to underlying architecture.  It turns out
that while it's usually signed type, it isn't on arm64 where it's
unsigned.

isc_commandline_parse() return int, just use that instead of the char.
2021-03-04 10:43:00 +01:00
Mark Andrews
fc57dd4c41 Merge branch '2298-multiple-definition-of-librpz_dnsrpzd_path' into 'main'
Resolve "multiple definition of `librpz_dnsrpzd_path'"

Closes #2298

See merge request isc-projects/bind9!4703
2021-03-04 08:22:16 +00:00
Mark Andrews
e12cf5eb57 Add CHANGES for [GL #2298] 2021-03-04 19:21:44 +11:00
Mark Andrews
8f016dd57a Fixed librpz_dnsrpzd_path being a duplicate symbol
librpz_dnsrpzd_path should have been declared extern in dns/librpz.h
2021-03-04 19:20:59 +11:00
Evan Hunt
add81d6480 Merge branch '2505-journal-compatibility' into 'main'
allow dns_journal_rollforward() to read old journal files

Closes #2505

See merge request isc-projects/bind9!4720
2021-03-04 03:18:42 +00:00
Evan Hunt
82b82bb821 CHANGES, release note 2021-03-03 17:54:47 -08:00
Evan Hunt
a0aefa1de6 create 'journal' system test
tests that version 1 journal files containing version 1 transaction
headers are rolled forward correctly on server startup, then updated
into version 2 journals. also checks journal file consistency and
'max-journal-size' behavior.
2021-03-03 17:54:47 -08:00
Evan Hunt
a4972324a6 print journal index data and test for consistency
'named-journalprint -x' now prints the journal's index table and
the offset of each transaction in the journal, so that index consistency
can be confirmed.
2021-03-03 17:54:47 -08:00
Mark Andrews
fb2d0e2897 extend named-journalprint to be able to force the journal version
named-journalprint can now upgrade or downgrade a journal file
in place; the '-u' option upgrades and the '-d' option downgrades.
2021-03-03 17:54:47 -08:00
Evan Hunt
ee19966326 allow dns_journal_rollforward() to read old journal files
when the 'max-ixfr-ratio' option was added, journal transaction
headers were revised to include a count of RR's in each transaction.
this made it impossible to read old journal files after an upgrade.

this branch restores the ability to read version 1 transaction
headers. when rolling forward, printing journal contents, if
the wrong transaction header format is found, we can switch.

when dns_journal_rollforward() detects a version 1 transaction
header, it returns DNS_R_RECOVERABLE.  this triggers zone_postload()
to force a rewrite of the journal file in the new format, and
also to schedule a dump of the zone database with minimal delay.
journal repair is done by dns_journal_compact(), which rewrites
the entire journal, ignoring 'max-journal-size'. journal size is
corrected later.

newly created journal files now have "BIND LOG V9.2" in their headers
instead of "BIND LOG V9". files with the new version string cannot be
read using the old transaction header format. note that this means
newly created journal files will be rejected by older versions of named.

named-journalprint now takes a "-x" option, causing it to print
transaction header information before each delta, including its
format version.
2021-03-03 17:54:47 -08:00
Ondřej Surý
695caaf8d6 Merge branch 'ondrej/call-isc__initialize-shutdown-from-DllMain' into 'main'
Call isc__initialize()/isc__shutdown() from win32 DllMain

See merge request isc-projects/bind9!4759
2021-03-02 07:48:19 +00:00
Ondřej Surý
a50f5d0cf5 Call isc__initialize()/isc__shutdown() from win32 DllMain
Call the libisc isc__initialize() constructor and isc__shutdown()
destructor from DllMain instead of having duplicate code between
those and DllMain() code.
2021-03-01 14:24:57 +01:00
Evan Hunt
8795b12c49 Merge branch 'ondrej/improve-mempool-AddressSanitizer-integration' into 'main'
Improve allocation-deallocation tracking with AddressSanitizer

See merge request isc-projects/bind9!4748
2021-02-26 18:26:28 +00:00
Ondřej Surý
888bdfc1ff Add mempool get/put tracking with AddressSanitizer
When AddressSanitizer is in use, disable the internal mempool
implementation and redirect the isc_mempool_get to isc_mem_get
(and similarly for isc_mempool_put).  This is the method recommended
by the AddressSanitizer authors for tracking allocations and
deallocations instead of custom poison/unpoison code (see
https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning).
2021-02-26 10:05:42 -08:00
Ondřej Surý
aa8f730a22 Merge branch '2396-add-thread-trampoline-for-thread-accounting' into 'main'
Resolve "BIND 9.16 unit tests failing reliably on x86_64 NUMA machines"

Closes #2396

See merge request isc-projects/bind9!4687
2021-02-26 12:44:15 +00:00
Ondřej Surý
4f2ca15201 Add CHANGES note for GL #2396 2021-02-25 16:21:43 +01:00
Ondřej Surý
a0181056a8 Change the isc_thread_self() return type to uintptr_t
The pthread_self(), thrd_current() or GetCurrentThreadId() could
actually be a pointer, so we should rather convert the value into
uintptr_t instead of unsigned long.
2021-02-25 16:21:10 +01:00
Ondřej Surý
bea333f7c9 Use globally assigned thread_id in the isc_hp API
Convert the isc_hp API to use the globally available isc_tid_v instead
of locally defined tid_v.  This should solve most of the problems on
machines with many number of cores / CPUs.
2021-02-25 16:21:10 +01:00
Ondřej Surý
cbbecfcc82 Add isc_trampoline API to have simple accounting around threads
The current isc_hp API uses internal tid_v variable that gets
incremented for each new thread using hazard pointers.  This tid_v
variable is then used as a index to global shared table with hazard
pointers state.  Since the tid_v is only incremented and never
decremented the table could overflow very quickly if we create set of
threads for short period of time, they finish the work and cease to
exist.  Then we create identical set of threads and so on and so on.
This is not a problem for a normal `named` operation as the set of
threads is stable, but the problematic place are the unit tests where we
test network manager or other APIs (task, timer) that create threads.

This commits adds a thin wrapper around any function called from
isc_thread_create() that adds unique-but-reusable small digit thread id
that can be used as index to f.e. hazard pointer tables.  The trampoline
wrapper ensures that the thread ids will be reused, so the highest
thread_id number doesn't grow indefinitely when threads are created and
destroyed and then created again.  This fixes the hazard pointer table
overflow on machines with many cores. [GL #2396]
2021-02-25 16:21:10 +01:00
Matthijs Mekking
6dbdffd7b8 Merge branch '2503-stale-answer-client-timeout-crash' into 'main'
Resolve "New stale-answer-client-timeout crashes BIND 9.16 and 9.17"

Closes #2503

See merge request isc-projects/bind9!4714
2021-02-25 11:03:13 +00:00
Matthijs Mekking
a404eaaffd Add CHANGES and release notes for GL #2503 2021-02-25 11:32:53 +01:00
Matthijs Mekking
f8b7b597e9 Don't servfail on staleonly lookups
When a staleonly lookup doesn't find a satisfying answer, it should
not try to respond to the client.

This is not true when the initial lookup is staleonly (that is when
'stale-answer-client-timeout' is set to 0), because no resolver fetch
has been created at this point. In this case continue with the lookup
normally.
2021-02-25 11:32:17 +01:00
Matthijs Mekking
9e061faaae Don't allow recursion on staleonly lookups
Fix a crash that can happen in the following scenario:

A client request is received. There is no data for it in the cache,
(not even stale data). A resolver fetch is created as part of
recursion.

Some time later, the fetch still hasn't completed, and
stale-answer-client-timeout is triggered. A staleonly lookup is
started. It will also find no data in the cache.

So 'query_lookup()' will call 'query_gotanswer()' with ISC_R_NOTFOUND,
so this will call 'query_notfound()' and this will start recursion.

We will eventually end up in 'ns_query_recurse()' and that requires
the client query fetch to be NULL:

    REQUIRE(client->query.fetch == NULL);

If the previously started fetch is still running this assertion
fails.

The crash is easily prevented by not requiring recursion for
staleonly lookups.

Also remove a redundant setting of the staleonly flag at the end of
'query_lookup_staleonly()' before destroying the query context.

Add a system test to catch this case.
2021-02-25 11:32:17 +01:00
Matthijs Mekking
e53af87f2c Merge branch '2498-nsec3-dynamic-update-dnssec-policy' into 'main'
Resolve "Regression in BIND 9.16.10, DNSSEC fails due to improper NSEC3 creation witihin named"

Closes #2498

See merge request isc-projects/bind9!4739
2021-02-25 09:49:29 +00:00
Matthijs Mekking
89c47b3b42 Add changes and notes for [#2498] 2021-02-25 17:21:17 +11:00
Matthijs Mekking
4b176c850b Fix dnssec-policy NSEC3 on dynamic zones
When applying dnssec-policy on a dynamic zone (e.g. that allows Dynamic
Updates), the NSEC3 parameters were put on the queue, but they were
not being processed (until a reload of the zone or reconfiguration).

Process the NSEC3PARAM queue on zone postload when handling a
dynamic zone.
2021-02-25 17:21:17 +11:00
Matthijs Mekking
0c0f10b53f Add tests for NSEC3 on dynamic zones
GitLab issue #2498 is a bug report on NSEC3 with dynamic zones. Tests
for it in the nsec3 system test directory were missing.
2021-02-25 17:21:17 +11:00
Mark Andrews
95cf93081c Merge branch '2507-cid-320483-api-usage-errors-lock' into 'main'
Resolve "CID 320483:  API usage errors  (LOCK)"

Closes #2507

See merge request isc-projects/bind9!4721
2021-02-25 05:54:20 +00:00
Mark Andrews
3ac53daa06 Address unbalanced lock/unlock
Also address race between reading and testing mpctx->allocated
and incrementing mpctx->allocated.
2021-02-25 13:08:07 +11:00
Ondřej Surý
965848a11a Merge branch '2519-disable-assertion-in-DLL_THREAD_ATTACH-DLL_THREAD_DETACH' into 'main'
Disable safe-guard assertion in DLL_THREAD_ATTACH/DLL_THREAD_DETACH

Closes #2519

See merge request isc-projects/bind9!4738
2021-02-24 08:03:16 +00:00
Ondřej Surý
c5887c4312 Disable safe-guard assertion in DLL_THREAD_ATTACH/DLL_THREAD_DETACH
The BIND 9 libraries on Windows define DllMain() optional entry point
into a dynamic-link library (DLL).  When the system starts or terminates
a process or thread, it calls the entry-point function for each loaded
DLL using the first thread of the process.

When the DLL is being loaded into the virtual address space of the
current process as a result of the process starting up, we make a call
to DisableThreadLibraryCalls() which should disable the
DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified
dynamic-link library (DLL).

This seems not be the case because we never check the return value of
the DisableThreadLibraryCalls() call, and it could in fact fail.  The
DisableThreadLibraryCalls() function fails if the DLL specified by
hModule has active static thread local storage, or if hModule is an
invalid module handle.

In this commit, we remove the safe-guard assertion put in place for the
DLL_THREAD_ATTACH and DLL_THREAD_DETACH events and we just ignore them.
BIND 9 doesn't create/destroy enough threads for it actually to make any
difference, and in fact we do use static thread local storage in the
code.
2021-02-24 08:31:42 +01:00
Mark Andrews
de00c105bb Merge branch 'marka-placeholder' into 'main'
add placeholder

See merge request isc-projects/bind9!4737
2021-02-23 22:53:34 +00:00
Mark Andrews
57c70624d9 add placeholder 2021-02-24 09:49:27 +11:00
Michal Nowak
6a21522579 Merge branch '2446-query-c-5430-16-runtime-error' into 'main'
Initialize checknames field in dns_view_create()

Closes #2446

See merge request isc-projects/bind9!4706
2021-02-23 15:43:50 +00:00
Michal Nowak
0c6fa16477 Initialize checknames field in dns_view_create()
The 'checknames' field wasn't initialized in dns_view_create(), but it
should otherwise AddressSanitizer identifies the following runtime error
in query_test.c.

    runtime error: load of value 190, which is not a valid value for type '_Bool'
2021-02-23 16:08:13 +01:00
Michal Nowak
40b6db58a1 Revert "Initialize checknames field in query_test.c"
This reverts commit c75484c4dff04698c183b456a6cc85f951264e75.
2021-02-23 16:08:13 +01:00
Michal Nowak
efe11d4383 Initialize checknames field in query_test.c
'checknames' field of struct dns_view is not initialized by
dns_view_create(). ASAN identified this as runtime error:

    runtime error: load of value 190, which is not a valid value for type '_Bool'
2021-02-23 16:08:13 +01:00
Michal Nowak
63c7300f97 Merge branch 'mnowak/alpine-3.13' into 'main'
Add Alpine Linux 3.13

See merge request isc-projects/bind9!4724
2021-02-23 14:45:19 +00:00
Michal Nowak
909c85f7a9 Add Alpine Linux 3.13 2021-02-23 15:33:59 +01:00
Michal Nowak
ed13fb7ad2 Merge branch 'mnowak/pairwise-pict-keep-stderr' into 'main'
Do not remove stderr from pict output

See merge request isc-projects/bind9!4727
2021-02-23 14:25:38 +00:00
Michal Nowak
079debaa10 Do not remove stderr from pict output
Removing stderr from the pict tool serves no purpose and drops valuable
information, we might use when debugging failed pairwise CI job, such
as:

    Input Error: A parameter names must be unique
2021-02-23 15:23:58 +01:00
Mark Andrews
076bb4f989 Merge branch '2508-cid-320481-null-pointer-dereferences-reverse_inull' into 'main'
Resolve "CID 320481:  Null pointer dereferences  (REVERSE_INULL)"

Closes #2508

See merge request isc-projects/bind9!4722
2021-02-23 13:04:38 +00:00
Mark Andrews
658c950d7b Silence CID 320481: Null pointer dereferences
*** CID 320481:  Null pointer dereferences  (REVERSE_INULL)
    /bin/tests/wire_test.c: 261 in main()
    255     			process_message(input);
    256     		}
    257     	} else {
    258     		process_message(input);
    259     	}
    260
       CID 320481:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "input" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    261     	if (input != NULL) {
    262     		isc_buffer_free(&input);
    263     	}
    264
    265     	if (printmemstats) {
    266     		isc_mem_stats(mctx, stdout);
2021-02-23 12:45:45 +00:00
Mark Andrews
3e9fba94e3 Merge branch '2493-cid-281450-dereference-before-null-check-reverse_inull' into 'main'
Resolve "CID 281450: Dereference before null check (REVERSE_INULL)"

Closes #2493

See merge request isc-projects/bind9!4684
2021-02-23 12:40:56 +00:00
Mark Andrews
5fb168fab3 Silence CID 281450: Dereference before null check
remove redundant 'inst != NULL' test

    162cleanup:

    CID 281450 (#1 of 1): Dereference before null check (REVERSE_INULL)
    check_after_deref: Null-checking inst suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    163        if (result != ISC_R_SUCCESS && inst != NULL) {
    164                plugin_destroy((void **)&inst);
    165        }
2021-02-23 11:58:40 +00:00
Mark Andrews
441aadab6c Merge branch '2492-304936-dereference-before-null-check' into 'main'
Resolve "CID 304936: Dereference before null check"

Closes #2492

See merge request isc-projects/bind9!4683
2021-02-23 11:57:29 +00:00
Mark Andrews
c4906be2d4 Silence CID 304936 Dereference before null check
Removed redundant 'listener != NULL' check.

    1191cleanup:

    CID 304936 (#1 of 1): Dereference before null check (REVERSE_INULL)
    check_after_deref: Null-checking listener suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    1192        if (listener != NULL) {
    1193                isc_refcount_decrement(&listener->refs);
    1194                listener->exiting = true;
    1195                free_listener(listener);
    1196        }
2021-02-23 11:39:00 +00:00
Matthijs Mekking
5cadcff801 Merge branch '2408-dnssec-policy-purge-keys' into 'main'
Resolve "kasp: Purge deleted keys"

Closes #2408

See merge request isc-projects/bind9!4665
2021-02-23 09:37:56 +00:00
Matthijs Mekking
5a99a124fb Add changes and notes for [#2408] 2021-02-23 09:17:24 +01:00
Matthijs Mekking
5be26898c0 Minor kasp test fixes
Two minor fixes in the kasp system test:

1. A wrong comment in ns3/setup.sh (we are subtracting 2 hours, not
   adding them).
2. 'get_keyids' used bad parameters "$1" "$2" when 'check_numkeys'
   failed. Also, 'check_numkeys' can use $DIR, $ZONE, and $NUMKEYS
   directly, no need to pass them.
2021-02-23 09:16:48 +01:00
Matthijs Mekking
6333ff15f0 Test purge-keys option
Add some more zones to the kasp system test to test the 'purge-keys'
option. Three zones test that the predecessor key files are removed
after the purge keys interval, one test checks that the key files
are retained if 'purge-keys' is disabled. For that, we change the
times to 90 days in the past (the default value for 'purge-keys').
2021-02-23 09:16:48 +01:00
Matthijs Mekking
8c526cb67f Purge keys implementation
On each keymgr run, we now also check if key files can be removed.
The 'purge-keys' interval determines how long keys should be retained
after they have become completely hidden.

Key files should not be removed if it has a state that is set to
something else then HIDDEN, if purge-keys is 0 (disabled), if
the key goal is set to OMNIPRESENT, or if the key is unused (a key is
unused if no timing metadata set, and no states are set or if set,
they are set to HIDDEN).

If the last changed timing metadata plus the purge-keys interval is
in the past, the key files may be removed.

Add a dst_key_t variable 'purge' to signal that the key file should
not be written to file again.
2021-02-23 09:16:48 +01:00
Matthijs Mekking
313de3a7e2 Add purge-keys config option
Add a new option 'purge-keys' to 'dnssec-policy' that will purge key
files for deleted keys. The option determines how long key files
should be retained prior to removing the corresponding files from
disk.

If set to 0, the option is disabled and 'named' will not remove key
files from disk.
2021-02-23 09:16:48 +01:00
Mark Andrews
d4cb312555 Merge branch '2509-cid-281489-resource-leaks-resource_leak' into 'main'
Resolve "CID 281489:  Resource leaks  (RESOURCE_LEAK)"

Closes #2509

See merge request isc-projects/bind9!4723
2021-02-22 22:39:23 +00:00
Mark Andrews
003dd8cc70 Address theoretical resource leak in dns_dt_open()
dns_dt_open() is not currently called with mode dns_dtmode_unix.

    *** CID 281489:  Resource leaks  (RESOURCE_LEAK)
    /lib/dns/dnstap.c: 983 in dns_dt_open()
    977
    978     		if (!dnstap_file(handle->reader)) {
    979     			CHECK(DNS_R_BADDNSTAP);
    980     		}
    981     		break;
    982     	case dns_dtmode_unix:
       CID 281489:  Resource leaks  (RESOURCE_LEAK)
       Variable "handle" going out of scope leaks the storage it points to.
    983     		return (ISC_R_NOTIMPLEMENTED);
    984     	default:
    985     		INSIST(0);
    986     		ISC_UNREACHABLE();
    987     	}
    988
2021-02-22 12:22:31 +11:00
Ondřej Surý
bb124d6056 Merge branch 'ondrej/add-tls_p.h-to-Makefile.am' into 'main'
Include lib/isc/tls_p.h in release tarballs

See merge request isc-projects/bind9!4716
2021-02-19 12:30:50 +00:00
Ondřej Surý
f53e7ed12c Include lib/isc/tls_p.h in release tarballs
The addition of lib/isc/tls_p.h to the source tree was not accounted for
in the relevant variable in lib/isc/Makefile.am and thus the former file
is not being included in release tarballs prepared using "make dist".
Fix by tweaking the libisc_la_SOURCES list in lib/isc/Makefile.am
accordingly.
2021-02-19 13:25:18 +01:00
Michał Kępień
5d473f92ed Merge branch '2504-do-not-require-libtool-in-PATH-at-build-time' into 'main'
Do not require libtool in PATH at build time

Closes #2504

See merge request isc-projects/bind9!4715
2021-02-19 12:09:48 +00:00
Michał Kępień
c8bddd2e64 Add CHANGES entry 2021-02-19 11:52:56 +01:00
Michał Kępień
b630c698f9 Do not require libtool in PATH at build time
The build-time requirement for libtool was introduced inadvertently:

 1. Commit 1628f5865a added a check to
    configure.ac which claims to test whether the libtool script is
    available.  There are two problems with that check:

      - it is effectively a no-op as the AC_PROG_LIBTOOL() macro always
        sets the LIBTOOL variable [1],

      - this check was intended to be performed before autoreconf is
        run, not when ./configure is run; the libtool script is supposed
        to be dynamically generated by ./configure on the build host and
        thus there is no need for a standalone libtool script to be
        installed system-wide on every host attempting to build BIND 9
        e.g. from a tarball produced by "make dist".

 2. Commit a7982d14dd was based on the
    incorrect assumption that the AC_PROG_LIBTOOL() macro looks for the
    libtool binary in PATH and sets the LIBTOOL variable accordingly,
    which is what other AC_PROG_*() macros do.  Meanwhile, the
    AC_PROG_LIBTOOL() macro only initializes libtool for use with
    Automake.  It is not necessary for a standalone libtool script to be
    available in PATH on the build host when ./configure is run.

Do not look for libtool in PATH at build time as it prevents hosts
without a libtool script available system-wide from building BIND 9 from
source tarballs prepared using "make dist".  Note that libtool m4
macros, utilities, etc. still need to be present on a given host if
autoreconf is to be run on it.

[1] https://git.savannah.gnu.org/cgit/libtool.git/tree/m4/libtool.m4?h=v2.4.6#n89
2021-02-19 11:52:56 +01:00
Mark Andrews
0b8d2bfb4c Merge branch '2499-a-loc-record-with-a-invalid-direction-field-triggers-an-insist' into 'main'
Resolve "A LOC record with a invalid direction field triggers an INSIST"

Closes #2499

See merge request isc-projects/bind9!4704
2021-02-18 22:37:41 +00:00
Mark Andrews
3d340ecfd2 Add release note for [GL #2499] 2021-02-19 09:18:08 +11:00
Mark Andrews
6f47e0956c Add CHANGES for [GL #2499] 2021-02-19 09:18:06 +11:00
Mark Andrews
009358d77d Correctly detect when get_direction failed 2021-02-19 09:17:32 +11:00
Mark Andrews
07902d9f9d Test a LOC record with an invalid direction field 2021-02-19 09:17:32 +11:00
Ondřej Surý
3547c0c1ff Merge branch '2433-improve-memory-contention' into 'main'
Resolve "investigate and improve lock contention around mctx"

Closes #2433

See merge request isc-projects/bind9!4659
2021-02-18 20:08:09 +00:00
Ondřej Surý
0302e54892 Add CHANGES note for GL #2433 2021-02-18 19:33:54 +01:00
Ondřej Surý
494d0da522 Use library constructor/destructor to initialize OpenSSL
Instead of calling isc_tls_initialize()/isc_tls_destroy() explicitly use
gcc/clang attributes on POSIX and DLLMain on Windows to initialize and
shutdown OpenSSL library.

This resolves the issue when isc_nm_create() / isc_nm_destroy() was
called multiple times and it would call OpenSSL library destructors from
isc_nm_destroy().

At the same time, since we now have introduced the ctor/dtor for libisc,
this commit moves the isc_mem API initialization (the list of the
contexts) and changes the isc_mem_checkdestroyed() to schedule the
checking of memory context on library unload instead of executing the
code immediately.
2021-02-18 19:33:54 +01:00
Ondřej Surý
4bde4f050b Disable calling DllMain() on thread creation/destruction
Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for
the specified dynamic-link library (DLL).  This can reduce the size of
the working set for some applications.
2021-02-18 19:33:54 +01:00
Ondřej Surý
f225462055 Fix the invalid condition variable
Although harmless, the memmove() in tlsdns and tcpdns was guarded by a
current message length variable that was always bigger than 0 instead of
correct current buffer length remainder variable.
2021-02-18 19:33:54 +01:00
Ondřej Surý
4775e9f256 Move most of the OpenSSL initialization to isc_tls
Since we now require both libcrypto and libssl to be initialized for
netmgr, we move all the OpenSSL initialization code except the engine
initialization to isc_tls API.

The isc_tls_initialize() and isc_tls_destroy() has been made idempotent,
so they could be called multiple time.  However when isc_tls_destroy()
has been called, the isc_tls_initialize() could not be called again.
2021-02-18 19:33:54 +01:00
Ondřej Surý
ff47b47f1a Remove overrun checking code from memory allocator
The ISC_MEM_CHECKOVERRUN would add canary byte at the end of every
allocations and check whether the canary byte hasn't been changed at the
free time.  The AddressSanitizer and valgrind memory checks surpases
simple checks like this, so there's no need to actually keep the code
inside the allocator.
2021-02-18 19:33:54 +01:00
Ondřej Surý
549e5b693a Modify the way we benchmark mem_{get,put}
Previously, the mem_{get,put} benchmark would pass the allocation size
as thread_create argument.  This has been now changed, so the allocation
size is stored and decremented (divided) in atomic variable and the
thread create routing is given a memory context.  This will allow to
write tests where each thread is given different memory context and do
the same for mempool benchmarking.
2021-02-18 19:33:54 +01:00
Ondřej Surý
f34f943b16 Disable memory debugging features in non-developer build
The two memory debugging features: ISC_MEM_DEFAULTFILL
(ISC_MEMFLAG_FILL) and ISC_MEM_TRACKLINES were always enabled in all
builds and the former was only disabled in `named`.

This commits disables those two features in non-developer build to make
the memory allocator significantly faster.
2021-02-18 19:33:54 +01:00
Ondřej Surý
c9fe12443f Make the mempool names unconditional
The named memory pools were default and always compiled-in.  Remove the
extra complexity by removing the #define and #ifdefs around the code.
2021-02-18 19:33:54 +01:00
Ondřej Surý
b09106e93a Make the memory and mempool counters to be stdatomic types
This is yet another step into unlocking some parts of the memory
contexts.  All the regularly updated variables has been turned into
atomic types, so we can later remove the locks when updating various
counters.

Also unlock as much code as possible without breaking anything.
2021-02-18 19:33:51 +01:00
Ondřej Surý
0f44139145 Bump the maximum number of hazard pointers in tests
On 24-core machine, the tests would crash because we would run out of
the hazard pointers.  We now adjust the number of hazard pointers to be
in the <128,256> interval based on the number of available cores.

Note: This is just a band-aid and needs a proper fix.
2021-02-18 19:32:55 +01:00
Ondřej Surý
7de846977b Remove the extra level of indirection via isc_memmethods_t
Previously, the applications using libisc would be able to override the
internal memory methods with own implementation.  This was no longer
possible, but the extra level of indirection was not removed.  This
commit removes the extra level of indirection for the memory methods and
the default_memalloc() and default_memfree().
2021-02-18 19:32:55 +01:00
Ondřej Surý
55ace5d3aa Remove the internal memory allocator
The internal memory allocator had an extra code to keep a list of blocks
for small size allocation.  This would help to reduce the interactions
with the system malloc as the memory would be already allocated from the
system, but there's an extra cost associated with that - all the
allocations/deallocations must be locked, effectively eliminating any
optimizations in the system allocator targeted at multi-threaded
applications. While the isc_mem API is still using locks pretty heavily,
this is a first step into reducing the memory allocation/deallocation
contention.
2021-02-18 19:32:02 +01:00
Michal Nowak
706c57280f Merge branch 'mnowak/fix-feature-test-tool-location' into 'main'
Use FEATURETEST variable instead of a path

See merge request isc-projects/bind9!4694
2021-02-18 14:43:29 +00:00
Michal Nowak
102f012631 Use FEATURETEST variable instead of a path
feature-test tool location needs to be determined by its associated
variable; otherwise, the tool is not found on Windows:

    setup.sh: line 22: ../feature-test: No such file or directory
2021-02-18 15:41:09 +01:00
Michał Kępień
da21650949 Merge branch 'michal/add-a-checklist-for-handling-cves' into 'main'
Add a checklist for handling security issues

See merge request isc-projects/bind9!3950
2021-02-18 10:16:57 +00:00
Michał Kępień
3e5efc46d4 Add a checklist for handling security issues 2021-02-18 11:11:40 +01:00
Michał Kępień
a55f4106ef Merge branch 'v9_17_10-release' into 'main'
Merge 9.17.10 release branch

See merge request isc-projects/bind9!4699
2021-02-17 21:29:03 +00:00
Michał Kępień
ac95a9db99 Set up release notes for BIND 9.17.11 2021-02-17 22:25:26 +01:00
Michał Kępień
2b88a255d9 Update BIND version to 9.17.10 2021-02-17 22:20:24 +01:00
Michał Kępień
a02c5c350e Add a CHANGES marker 2021-02-17 22:20:24 +01:00
Michał Kępień
77026a0fc2 Merge branch 'michal/prepare-documentation-for-bind-9.17.10' into 'v9_17_10-release'
Prepare documentation for BIND 9.17.10

See merge request isc-private/bind9!237
2021-02-17 22:20:24 +01:00
Michał Kępień
48353879e5 Prepare release notes for BIND 9.17.10 2021-02-17 22:20:24 +01:00
Michał Kępień
5c15c6ab21 Add release note for GL #2073 2021-02-17 22:20:24 +01:00
Michał Kępień
fc4b7e72cc Reorder release notes 2021-02-17 22:20:24 +01:00
Michał Kępień
3799e66f04 Tweak and reword release notes 2021-02-17 22:20:24 +01:00
Michał Kępień
589cbe9bad Tweak and reword recent CHANGES entries 2021-02-17 22:20:24 +01:00
Michał Kępień
234ff52725 Use :rfc:<number> references in release notes 2021-02-17 22:20:24 +01:00
Michał Kępień
e63b385073 Document the build-time requirement for nghttp2 2021-02-17 22:20:24 +01:00
Michal Nowak
8836a6e2b5 Merge branch 'mnowak/system-test-check-for-file-not-removed' into 'main'
Check for "file not removed" in system test output

See merge request isc-projects/bind9!4680
2021-02-17 16:08:26 +00:00
Michal Nowak
f310b75250 Prevent Git to expand $systest
CentOS 8 "git status" unexpectedly expands search directory "tsig" to
also search in the "tsiggss" directory, thus incorrectly identifying
files as "not removed" in the "tsig" directory:

$ git status -su --ignored tsig
$ touch tsiggss/ns1/{named.run,named.memstats}
$ git status -su --ignored tsig
!! tsiggss/ns1/named.memstats
!! tsiggss/ns1/named.run
2021-02-17 16:35:21 +01:00
Michal Nowak
14a104d121 Clean omitted files from system tests
Any CI job:
- I:dnssec:file dnssec/ns1/trusted.keys not removed
- I:rpzrecurse:file rpzrecurse/ns3/named.run.prev not removed

system:clang:freebsd11:amd64:
- I:tkey:file tkey/ns1/named.conf-e not removed

system:gcc:sid:amd64:
- I:mirror:file mirror/ns3/_default.nzf not removed

system:gcc:xenial:amd64:
- I:rpzextra:file rpzextra/.cache/v/cache/lastfailed not removed
- I:rpzrecurse:file rpzrecurse/ns3/named.run.prev not removed
- I:shutdown:file shutdown/.cache/v/cache/lastfailed not removed
2021-02-17 16:35:21 +01:00
Michal Nowak
e48d7db13a Copy testcrypto.sh to out-of-tree directory
System tests run in out-of-tree directory fail to find testcrypto.sh and
produce:

    /bin/bash: ../testcrypto.sh: No such file or directory
2021-02-17 16:35:21 +01:00
Michal Nowak
4a2778abdf Check for "file not removed" in system test output
Run this check only when in Git repository, because the run.sh function
which produces the "file not removed" warning is run only when build
directory is the same as the source directory, that is only for in-tree
builds.
2021-02-17 16:35:21 +01:00
Michal Nowak
10bf725ee2 Add system test name to "file not removed" info 2021-02-17 16:35:21 +01:00
Michal Nowak
09acebd910 Merge branch 'mnowak/enable-dh-unit-test-to-run-under-pkcs11' into 'main'
Drop USE_OPENSSL constraint from dh_test

See merge request isc-projects/bind9!4621
2021-02-17 11:44:39 +00:00
Michal Nowak
c341e7f740 Drop USE_OPENSSL constraint from dh_test
The USE_OPENSSL constraint in dh_test does not seems to be necessary
anymore, the test runs with PKCS#11 as well.
2021-02-17 12:21:41 +01:00
Ondřej Surý
f8fa64b706 Merge branch '2487-rollback-setting-dontfrag-option' into 'main'
Rollback setting IP_DONTFRAG option on the UDP sockets

Closes #2466 and #2487

See merge request isc-projects/bind9!4668
2021-02-17 08:02:08 +00:00
Ondřej Surý
6d442e9c04 Add CHANGES and release notes for GL #2487 2021-02-17 08:10:45 +01:00
Ondřej Surý
66eefac78c Rollback setting IP_DONTFRAG option on the UDP sockets
In DNS Flag Day 2020, the development branch started setting the
IP_DONTFRAG option on the UDP sockets.  It turned out, that this
code was incomplete leading to dropping the outgoing UDP packets.
Henceforth this commit rolls back this setting until we have a
proper fix that would send back empty response with TC flag set.
2021-02-17 08:09:56 +01:00
Evan Hunt
0f1a4ff2b1 Merge branch 'each-note-cleanup' into 'main'
some release note corrections

See merge request isc-projects/bind9!4690
2021-02-17 00:59:01 +00:00
Evan Hunt
3126eb652d some release note corrections 2021-02-16 16:56:25 -08:00
Evan Hunt
62cf011eaa Merge branch '2472-tls-none' into 'main'
Resolve "too easy to configure unencrypted DoH"

Closes #2472

See merge request isc-projects/bind9!4653
2021-02-17 00:55:33 +00:00
Evan Hunt
5950b5c803 CHANGES 2021-02-16 16:24:52 -08:00
Evan Hunt
2b2e1a02bd allow configuration of "default" http endpoint
specifying "http default" in a listen-on statement sets up
the default "/dns-query" endpoint. tests and documentation
have been updated.
2021-02-16 16:24:35 -08:00
Evan Hunt
957052eea5 move listen-on correctness checks into check.c
errors in listen-on and listen-on-v6 can now be detected
by named-checkconf.
2021-02-16 16:24:35 -08:00
Evan Hunt
fd763d7223 enable listen-on parameters to be specified in any order
updated the parser to allow the "port", "tls" and "http"
paramters to "listen-on" and "listen-on-v6" to be specified in any
order. previously the parser would throw an error if any other order
was used than port, tls, http.
2021-02-16 16:24:35 -08:00
Evan Hunt
07f525bae5 require "tls none" for unencrypted HTTP listeners
unencrypted DoH connections may be used in some operational
environments where encryption is handled by a reverse proxy,
but it's going to be relatively rare, so we shouldn't make it
easy to do by mistake.  this commit changes the syntax for
listen-on and listen-on-v6 so that if "http" is specified, "tls"
must also be specified; for unencrypted listeners, "tls none"
can be used.
2021-02-16 16:24:35 -08:00
Mark Andrews
59a0637a8f Merge branch '2402-bind-9-16-11-build-fails-with-static-openssl-library' into 'main'
Resolve "BIND 9.16.11 build fails with static OpenSSL library"

Closes #2402

See merge request isc-projects/bind9!4591
2021-02-16 23:29:53 +00:00
Mark Andrews
98dc47d351 Add CHANGES for [GL #2402] 2021-02-16 22:54:03 +00:00
Mark Andrews
9223c7d599 Fix linking order for OpenSSL libraries
As libssl depends on libcrypto, -lssl needs to precede -lcrypto in
linker invocations or else the build will fail with static OpenSSL
libraries.  Adjust m4/ax_check_openssl.m4 to prevent this issue from
getting triggered when pkg-config files for OpenSSL are not available.
2021-02-16 22:54:03 +00:00
Evan Hunt
a36b0918a7 Merge branch '2484-nghttp2-version' into 'main'
report libnghttp2 version in 'named -V'

Closes #2484

See merge request isc-projects/bind9!4689
2021-02-16 22:45:52 +00:00
Evan Hunt
70da5c79cb report libnghttp2 version in 'named -V'
add lines indicating the versions of the nghttp2 library
against which named was compiled and to which it is linked.
2021-02-16 14:40:18 -08:00
Michal Nowak
1f44e6d442 Merge branch 'mnowak/consistent-use-of-SKIPPED_TEST_EXIT_CODE' into 'main'
Use SKIPPED_TEST_EXIT_CODE consistently in unit tests

See merge request isc-projects/bind9!4685
2021-02-16 13:56:18 +00:00
Michal Nowak
c286341703 Use SKIPPED_TEST_EXIT_CODE consistently
Commit fa505bfb0e omitted two unit tests
while introducing the SKIP_TEST_EXIT_CODE preprocessor macro.  Fix the
outliers to make use of SKIP_TEST_EXIT_CODE consistent across all unit
tests.  Also make sure lib/dns/tests/dnstap_test returns an exit code
that indicates a skipped test when dnstap is not enabled.
2021-02-16 13:41:50 +01:00
Ondřej Surý
2be0b5b90e Merge branch '2357-cleanup-public-headers' into 'main'
Resolve "Cannot compile current versions on macOS "Catalina""

Closes #2357

See merge request isc-projects/bind9!4670
2021-02-16 12:17:30 +00:00
Ondřej Surý
a5d2ce79c8 Stop including gssapi.h from dst/gssapi.h header
The only reason for including the gssapi.h from the dst/gssapi.h header
was to get the typedefs of gss_cred_id_t and gss_ctx_id_t.  Instead of
using those types directly this commit introduces dns_gss_cred_id_t and
dns_gss_ctx_id_t types that are being used in the public API and
privately retyped to their counterparts when we actually call the gss
api.

This also conceals the gssapi headers, so users of the libdns library
doesn't have to add GSSAPI_CFLAGS to the Makefile when including libdns
dst API.
2021-02-16 01:04:46 +00:00
Ondřej Surý
23c3bcc711 Stop including dnstap headers from <dns/dnstap.h>
The <fstrm.h> and <protobuf-c/protobuf-c.h> headers are only directly
included where used and we stopped exposing those headers from libdns
headers.
2021-02-16 01:04:46 +00:00
Ondřej Surý
dce292e7f4 Stop including lmdb.h from <dns/view.h>
The lmdb.h doesn't have to be included from the dns/view.h header as it
is separately included where used.  This stops exposing the inclusion of
lmdb.h from the libdns headers.
2021-02-16 01:04:46 +00:00
Ondřej Surý
d1448a4c2a Move the <isc/readline.h> header to bin/dig/readline.h
The <isc/readline.h> header provided a compatibility shim to use when
other non-GNU readline libraries are in use.  The two places where
readline library is being used is nslookup and nsupdate, so the header
file has been moved to bin/dig directory and it's directly included from
bin/nsupdate.

This also conceals any readline headers exposed from the libisc headers.
2021-02-16 01:04:46 +00:00
Ondřej Surý
00b5f4c389 Remove the extra CFLAGS from libisc_CFLAGS and libdns_CFLAGS
The extra library CFLAGS were causing the headers to be included in
wrong order possibly pulling header files from previously installed
BIND 9 version.

This commit cleans up the extra <foo>_CFLAGS from the includes in favor
of not exposing 3rd party headers in our own header files.
2021-02-16 01:04:46 +00:00
Diego dos Santos Fronza
5f1a76c710 Merge branch '2041-bug-reconfig-auto-dnssec-high-thread-number-leak-resources-and-crash-named' into 'main'
Resolve "BUG reconfig+auto-dnssec+high thread number leak resources and crash named"

Closes #2041

See merge request isc-projects/bind9!4669
2021-02-15 18:12:17 +00:00
Diego Fronza
757be6ec16 Add CHANGES note for [GL #2041] 2021-02-15 12:02:31 -03:00
Diego Fronza
43b0b20b43 Test reconfig after adding inline signed zones won't crash named
This test ensures that named won't crash after many inline-signed zones
are added to configurarion, followed by a rndc reconfig.
2021-02-15 11:15:20 -03:00
Diego Fronza
30729c7013 Fix dangling references to outdated views after reconfig
This commit fix a leak which was happening every time an inline-signed
zone was added to the configuration, followed by a rndc reconfig.

During the reconfig process, the secure version of every inline-signed
zone was "moved" to a new view upon a reconfig and it "took the raw
version along", but only once the secure version was freed (at shutdown)
was prev_view for the raw version detached from, causing the old view to
be released as well.

This caused dangling references to be kept for the previous view, thus
keeping all resources used by that view in memory.
2021-02-15 11:15:20 -03:00
Michal Nowak
fe6bd687d7 Merge branch 'mnowak/merge-skipped-and-untested-system-test-results' into 'main'
Merge UNTESTED and SKIPPED system test results

See merge request isc-projects/bind9!4517
2021-02-15 11:52:46 +00:00
Michal Nowak
3cc3f1712b Add CHANGES note for [GL !4517] 2021-02-15 11:20:18 +01:00
Michal Nowak
cfd0f7d2eb Do not build geoip_test when GeoIP is not available 2021-02-15 11:19:15 +01:00
Michal Nowak
fa505bfb0e Record skipped unit test as skipped in Automake framework 2021-02-15 11:18:03 +01:00
Michal Nowak
29d7c6e449 Merge UNTESTED and SKIPPED system test results
Descriptions of UNTESTED and SKIPPED system test results are very
similar to one another and it may be confusing when to pick one and
when the other. Merging these two system test results removes the
confusion and also makes system test more aligned with Automake,
which does not know about UNTESTED test result.
2021-02-15 11:15:20 +01:00
Michal Nowak
fbdd464038 Record skipped test as skipped in testsuite summary
When system test execution was ported to Automake, SKIPPED and UNTESTED
system test result were not made to match Automake expectations,
therefore a skipped test is recorded by Automake as "PASS":

    $ make check TESTS=cpu V=1
    I:cpu:cpu test only runs on Linux, skipping test
    I:cpu:Prerequisites missing, skipping test.
    R:cpu:SKIPPED
    E:cpu:2020-12-16T11:36:58+0000
    PASS: cpu
    ====================================================================
    Testsuite summary for BIND 9.17.7
    ====================================================================
    # TOTAL: 1
    # PASS:  1

For a test to be recorded by Automake as skipped, the test, or it's test
driver, needs to exit with code 77:

    $ make check TESTS=cpu V=1
    I:cpu:cpu test only runs on Linux, skipping test
    I:cpu:Prerequisites missing, skipping test.
    R:cpu:SKIPPED
    E:cpu:2020-12-16T11:39:10+0000
    SKIP: cpu
    ====================================================================
    Testsuite summary for BIND 9.17.7
    ====================================================================
    # TOTAL: 1
    # PASS:  0
    # SKIP:  1
2021-02-15 11:15:20 +01:00
Mark Andrews
8c1df63312 Merge branch '2443-cid-316608-memory-corruptions-overrun' into 'main'
Resolve "CID 316608:  Memory - corruptions  (OVERRUN)"

Closes #2443

See merge request isc-projects/bind9!4623
2021-02-14 23:02:44 +00:00
Mark Andrews
59bf6e71e2 Address theoretical buffer overrun in recent change
The strlcat() call was wrong.

    *** CID 316608:  Memory - corruptions  (OVERRUN)
    /lib/dns/resolver.c: 5017 in fctx_create()
    5011     	 * Make fctx->info point to a copy of a formatted string
    5012     	 * "name/type".
    5013     	 */
    5014     	dns_name_format(name, buf, sizeof(buf));
    5015     	dns_rdatatype_format(type, typebuf, sizeof(typebuf));
    5016     	p = strlcat(buf, "/", sizeof(buf));
    >>>     CID 316608:  Memory - corruptions  (OVERRUN)
    >>>     Calling "strlcat" with "buf + p" and "1036UL" is suspicious because "buf" points into a buffer of 1036 bytes and the function call may access "(char *)(buf + p) + 1035UL". [Note: The source code implementation of the function has been overridden by a builtin model.]
    5017     	strlcat(buf + p, typebuf, sizeof(buf));
    5018     	fctx->info = isc_mem_strdup(mctx, buf);
    5019
    5020     	FCTXTRACE("create");
    5021     	dns_name_init(&fctx->name, NULL);
    5022     	dns_name_dup(name, mctx, &fctx->name);
2021-02-14 22:41:46 +00:00
Petr Špaček
1d1408567f Merge branch 'pspacek/ci-python-allthetime' into 'main'
Run Python linters in CI even outside of merge requests

See merge request isc-projects/bind9!4540
2021-02-12 13:23:47 +00:00
Petr Špaček
74d7cddc4c Run Python linters in CI even outside of merge requests
Previously it did not get run on scheduled CI pipelines.
2021-02-12 14:21:23 +01:00
Michal Nowak
11df3ef0c3 Merge branch 'mnowak/check-for-unrecognized-options' into 'main'
Check for unrecognized configure options

See merge request isc-projects/bind9!4567
2021-02-12 13:14:41 +00:00
Michal Nowak
4295c82e45 Add --enable-option-checking=fatal to ./configure in CI
The --enable-option-checking=fatal option prevents ./configure from
proceeding when an unknown option is used in the ./configure step in CI.
This change will avoid adding unsupported ./configure options or options
with typo or typo in pairwise testing "# [pairwise: ...]" marker.
2021-02-12 13:56:38 +01:00
Michal Nowak
40600d6bf6 Merge branch '2312-lint-generated-manual-pages' into 'main'
Lint manual pages

Closes #2312

See merge request isc-projects/bind9!4475
2021-02-12 11:54:18 +00:00
Michal Nowak
22fdcb30db Lint manual pages
As we generate manual pages from reStructuredText sources, we don't have
absolute control on manual page output and therefore 'mandoc -Tlint' may
always report warnings we can't eliminate. In light of this some mandoc
warnings need to be ignored.
2021-02-12 12:15:02 +01:00
Michal Nowak
2a8b4f2a79 Build man pages when "make doc" is run
Man pages are currently only generated from reStructuredText sources
when "make man" is run in the doc/man/ directory.  Tweak
doc/man/Makefile.am so that running "make doc" in the top-level
directory also causes man pages to be generated, so that all potential
documentation building problems can be detected by a single make
invocation.
2021-02-12 12:15:01 +01:00
Mark Andrews
5750f89351 Merge branch '2421-cid-316509-untrusted-value-as-argument-tainted_scalar' into 'main'
Resolve "CID 316509: Untrusted value as argument (TAINTED_SCALAR)"

Closes #2423 and #2421

See merge request isc-projects/bind9!4606
2021-02-11 23:39:18 +00:00
Mark Andrews
c40133d840 Silence Insecure data handling (TAINTED_SCALAR)
Coverity assumes that the memory holding any value read using byte
swapping is tainted.  As we store the NSEC3PARAM records in wire
form and iterations is byte swapped the memory holding the record
is marked as tainted.  nsec3->salt_length is marked as tainted
transitively. To remove the taint the value need to be range checked.
For a correctly formatted record region.length should match
nsec3->salt_length and provides a convenient value to check the field
against.

    *** CID 316507:  Insecure data handling  (TAINTED_SCALAR)
    /lib/dns/rdata/generic/nsec3param_51.c: 241 in tostruct_nsec3param()
    235     	region.length = rdata->length;
    236     	nsec3param->hash = uint8_consume_fromregion(&region);
    237     	nsec3param->flags = uint8_consume_fromregion(&region);
    238     	nsec3param->iterations = uint16_consume_fromregion(&region);
    239
    240     	nsec3param->salt_length = uint8_consume_fromregion(&region);
    >>>     CID 316507:  Insecure data handling  (TAINTED_SCALAR)
    >>>     Passing tainted expression "nsec3param->salt_length" to "mem_maybedup", which uses it as an offset.
    241     	nsec3param->salt = mem_maybedup(mctx, region.base,
    242     					nsec3param->salt_length);
    243     	if (nsec3param->salt == NULL) {
    244     		return (ISC_R_NOMEMORY);
    245     	}
    246     	isc_region_consume(&region, nsec3param->salt_length);
2021-02-12 10:19:27 +11:00
Mark Andrews
fd8d1337a5 Silence Untrusted value as argument (TAINTED_SCALAR)
Coverity assumes that the memory holding any value read using byte
swapping is tainted.  As we store the NSEC3 records in wire form
and iterations is byte swapped the memory holding the record is
marked as tainted.  nsec3->salt_length and nsec3->next_length are
marked as tainted transitively. To remove the taint the values need
to be range checked.  Valid values for these should never exceed
region.length so that is becomes a reasonable value to check against.

    *** CID 316509:    (TAINTED_SCALAR)
    /lib/dns/rdata/generic/nsec3_50.c: 312 in tostruct_nsec3()
    306     	if (nsec3->salt == NULL) {
    307     		return (ISC_R_NOMEMORY);
    308     	}
    309     	isc_region_consume(&region, nsec3->salt_length);
    310
    311     	nsec3->next_length = uint8_consume_fromregion(&region);
    >>>     CID 316509:    (TAINTED_SCALAR)
    >>>     Passing tainted expression "nsec3->next_length" to "mem_maybedup", which uses it as an offset.
    312     	nsec3->next = mem_maybedup(mctx, region.base, nsec3->next_length);
    313     	if (nsec3->next == NULL) {
    314     		goto cleanup;
    315     	}
    316     	isc_region_consume(&region, nsec3->next_length);
    317
    /lib/dns/rdata/generic/nsec3_50.c: 305 in tostruct_nsec3()
    299     	region.length = rdata->length;
    300     	nsec3->hash = uint8_consume_fromregion(&region);
    301     	nsec3->flags = uint8_consume_fromregion(&region);
    302     	nsec3->iterations = uint16_consume_fromregion(&region);
    303
    304     	nsec3->salt_length = uint8_consume_fromregion(&region);
    >>>     CID 316509:    (TAINTED_SCALAR)
    >>>     Passing tainted expression "nsec3->salt_length" to "mem_maybedup", which uses it as an offset.
    305     	nsec3->salt = mem_maybedup(mctx, region.base, nsec3->salt_length);
    306     	if (nsec3->salt == NULL) {
    307     		return (ISC_R_NOMEMORY);
    308     	}
    309     	isc_region_consume(&region, nsec3->salt_length);
    310
2021-02-12 10:19:21 +11:00
Michal Nowak
698d6372aa Merge branch 'mnowak/enable-libns-tests-to-run-under-asan' into 'main'
Drop AddressSanitizer constraint from libns unit tests

See merge request isc-projects/bind9!4622
2021-02-10 10:02:16 +00:00
Michal Nowak
613be8706e Drop AddressSanitizer constraint from libns unit tests
The AddressSanitizer constraint in some libns unit tests does not seem
to be necessary anymore, these tests run fine under AddressSanitizer.
2021-02-10 09:54:32 +00:00
Mark Andrews
1c428cc157 Merge branch '2460-incorrect-size-passed-to-isc_mem_put' into 'main'
Resolve "Incorrect size passed to isc_mem_put"

Closes #2460

See merge request isc-projects/bind9!4633
2021-02-09 12:49:38 +00:00
Mark Andrews
7a47262626 Add release note for [GL #2460] 2021-02-09 12:30:14 +00:00
Mark Andrews
bef5e723b2 Add CHANGES note for [GL #2460] 2021-02-09 12:30:14 +00:00
Mark Andrews
0a966315b2 Fix wrong length passed to isc_mem_put
If an invalid key name (e.g. "a..b") in a primaries list in named.conf
is specified the wrong size is passed to isc_mem_put resulting in the
returned memory being put on the wrong freed list.

    *** CID 316784:  Incorrect expression  (SIZEOF_MISMATCH)
    /bin/named/config.c: 636 in named_config_getname()
    630     	isc_buffer_constinit(&b, objstr, strlen(objstr));
    631     	isc_buffer_add(&b, strlen(objstr));
    632     	dns_fixedname_init(&fname);
    633     	result = dns_name_fromtext(dns_fixedname_name(&fname), &b, dns_rootname,
    634     				   0, NULL);
    635     	if (result != ISC_R_SUCCESS) {
       CID 316784:  Incorrect expression  (SIZEOF_MISMATCH)
       Passing argument "*namep" of type "dns_name_t *" and argument "8UL /* sizeof (*namep) */" to function "isc__mem_put" is suspicious.
    636     		isc_mem_put(mctx, *namep, sizeof(*namep));
    637     		*namep = NULL;
    638     		return (result);
    639     	}
    640     	dns_name_dup(dns_fixedname_name(&fname), mctx, *namep);
    641
2021-02-09 12:30:14 +00:00
Matthijs Mekking
5c0847e997 Merge branch '1810-refactor-ecdsa-eddsa-system-tests' into 'main'
Resolve "Refactor ecdsa and eddsa tests after testcrypto.sh changes"

Closes #1810

See merge request isc-projects/bind9!4645
2021-02-09 11:59:20 +00:00
Matthijs Mekking
51827ddcd3 Update copyrights for [#1810] 2021-02-09 11:59:08 +00:00
Matthijs Mekking
650b0d4691 Refactor ecdsa system test
Similar to eddsa system test.
2021-02-09 11:59:08 +00:00
Matthijs Mekking
fd7d0f7968 Enable eddsa test
It should be fixed now.
2021-02-09 11:59:08 +00:00
Matthijs Mekking
8bf31d0592 Refactor eddsa system test
Test for Ed25519 and Ed448. If both algorithms are not supported, skip
test. If only one algorithm is supported, run test, skip the
unsupported algorithm. If both are supported, run test normally.

Create new ns3. This will test Ed448 specifically, while now ns2 only
tests Ed25519. This moves some files from ns2/ to ns3/.
2021-02-09 11:59:08 +00:00
Matthijs Mekking
572d7ec3b7 Fix testcrypto.sh
Testing Ed448 was actually testing Ed25519.
2021-02-09 11:59:08 +00:00
Michal Nowak
e74187a056 Merge branch 'mnowak/drop-kyua-references-in-.gitlab-ci.yml' into 'main'
Remove remnant Kyua references

See merge request isc-projects/bind9!4638
2021-02-09 11:48:07 +00:00
Michal Nowak
f557480078 Remove remnant Kyua references
Unit tests were ported from Kyua to Automake.  All references to Kyua
thus should be removed from the main branch.
2021-02-09 12:45:53 +01:00
Michal Nowak
566b65e513 Merge branch 'mnowak/check-asan-errors-in-configure' into 'main'
Check config.log for ASAN errors

See merge request isc-projects/bind9!4655
2021-02-09 11:02:20 +00:00
Michal Nowak
0db934d401 Check config.log for ASAN errors
./configure checks might produce a false negative error due to ASAN
errors and thus disable some options.
2021-02-09 11:56:08 +01:00
Matthijs Mekking
8dd1106bda Merge branch '2434-fetch-limit-serve-stale-follow-up' into 'main'
Resolve "Serve stale when fetch limits are hit" (follow-up)

Closes #2434

See merge request isc-projects/bind9!4654
2021-02-08 15:01:07 +00:00
Matthijs Mekking
00f575e7ef Adjust serve-stale test
The number of queries to use in the burst can be reduced, as we have
a very low fetch limit of 1.

The dig command in 'wait_for_fetchlimits()' should time out sooner as
we expect a SERVFAIL to be returned promptly.

Enabling serve-stale can be done before hitting fetch-limits. This
reduces the chance that the resolver queries time out and fetch count
is reset. The chance of that happening is already slim because
'resolver-query-timeout' is 10 seconds, but better to first let the
data become stale rather than doing that while attempting to resolve.
2021-02-08 15:17:09 +01:00
Matthijs Mekking
8bcd7fe69e Use stale on error also when unable to recurse
The 'query_usestale()' function was only called when in
'query_gotanswer()' and an unexpected error occurred. This may have
been "quota reached", and thus we were in some cases returning
stale data on fetch-limits (and if serve-stale enabled of course).

But we can also hit fetch-limits when recursing because we are
following a referral (in 'query_notfound()' and
'query_delegation_recurse()'). Here we should also check for using
stale data in case an error occurred.

Specifically don't check for using stale data when refetching a
zero TTL RRset from cache.

Move the setting of DNS_DBFIND_STALESTART into the 'query_usestale()'
function to avoid code duplication.
2021-02-08 15:17:09 +01:00
Mark Andrews
a415424339 Merge branch '2469-cid-281461-untrusted-loop-bound' into 'main'
Resolve "CID 281461: untrusted loop bound"

Closes #2469

See merge request isc-projects/bind9!4642
2021-02-08 02:55:31 +00:00
Mark Andrews
2f946c831a Attempt to silence untrusted loop bound
Assign hit_len + key_len to len and test the result
rather than recomputing and letting the compiler simplify.

    213        isc_region_consume(&region, 2); /* hit length + algorithm */
        9. tainted_return_value: Function uint16_fromregion returns tainted data. [show details]
        10. tainted_data_transitive: Call to function uint16_fromregion with tainted argument *region.base returns tainted data.
        11. tainted_return_value: Function uint16_fromregion returns tainted data.
        12. tainted_data_transitive: Call to function uint16_fromregion with tainted argument *region.base returns tainted data.
        13. var_assign: Assigning: key_len = uint16_fromregion(&region), which taints key_len.
    214        key_len = uint16_fromregion(&region);
        14. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        15. Condition key_len == 0, taking false branch.
    215        if (key_len == 0) {
    216                RETERR(DNS_R_FORMERR);
    217        }
        16. Condition !!(_r->length >= _l), taking true branch.
        17. Condition !!(_r->length >= _l), taking true branch.
    218        isc_region_consume(&region, 2);
        18. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        19. Condition region.length < (unsigned int)(hit_len + key_len), taking false branch.
    219        if (region.length < (unsigned)(hit_len + key_len)) {
    220                RETERR(DNS_R_FORMERR);
    221        }
    222
        20. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        21. Condition _r != 0, taking false branch.
    223        RETERR(mem_tobuffer(target, rr.base, 4 + hit_len + key_len));
        22. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        23. var_assign_var: Compound assignment involving tainted variable 4 + hit_len + key_len to variable source->current taints source->current.
    224        isc_buffer_forward(source, 4 + hit_len + key_len);
    225
    226        dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);

    CID 281461 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
        24. tainted_data: Using tainted variable source->active - source->current as a loop boundary.
    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    227        while (isc_buffer_activelength(source) > 0) {
    228                dns_name_init(&name, NULL);
    229                RETERR(dns_name_fromwire(&name, source, dctx, options, target));
    230        }
2021-02-08 02:02:29 +00:00
Michal Nowak
64d5dad92a Merge branch 'mnowak/check-arm-pdf-validity' into 'main'
Check PDF file structure with QPDF

See merge request isc-projects/bind9!4620
2021-02-03 16:41:06 +00:00
Michal Nowak
359708b9d6 Check PDF file structure with QPDF
"qpdf --check" checks file structure of generated ARM PDF.
2021-02-03 17:39:58 +01:00
Matthijs Mekking
3648eb2936 Merge branch '2377-allow-a-records-below-an-_spf-label-as-a-check-names-exception' into 'main'
Resolve "Allow A records below an '_spf' label as a check-names exception"

Closes #2377

See merge request isc-projects/bind9!4529
2021-02-03 16:38:48 +00:00
Mark Andrews
1294918702 Add release note entry 2021-02-03 16:24:44 +01:00
Mark Andrews
2b5091ac17 Add CHANGES 2021-02-03 16:24:43 +01:00
Mark Andrews
a3b2b86e7f Check that A record is accepted with _spf label present 2021-02-03 16:23:20 +01:00
Mark Andrews
63c16c8506 Allow A records below '_spf' labels as recommend by RFC7208 2021-02-03 16:23:20 +01:00
Matthijs Mekking
5b8c86606e Merge branch '2375-dnssec-policy-three-is-a-crowd-rollover-bug' into 'main'
Resolve "three is a crowd" dnssec-policy key rollover bug

Closes #2375

See merge request isc-projects/bind9!4541
2021-02-03 15:22:47 +00:00
Matthijs Mekking
189f5a3f28 Add kasp test todo for [#2375]
This bugfix has been manually verified but is missing a unit test.
Created GL #2471 to track this.
2021-02-03 15:35:06 +01:00
Matthijs Mekking
98ace6d97d Use NUM_KEYSTATES constant where appropriate
We use the number 4 a lot when working on key states. Better to use
the NUM_KEYSTATES constant instead.
2021-02-03 15:35:06 +01:00
Matthijs Mekking
7947f7f9c6 Add change and release note for [#2375]
News worthy.
2021-02-03 15:35:06 +01:00
Matthijs Mekking
189d9a2d21 Cleanup keymgr.c
Three small cleanups:

1. Remove an unused keystr/dst_key_format.
2. Initialize a dst_key_state_t state with NA.
3. Update false comment about local policy (local policy only adds
   barrier on transitions to the RUMOURED state, not the UNRETENTIVE
   state).
2021-02-03 15:35:06 +01:00
Matthijs Mekking
291bcc3721 Fix DS/DNSKEY hidden or chained functions
There was a bug in function 'keymgr_ds_hidden_or_chained()'.

The funcion 'keymgr_ds_hidden_or_chained()' implements (3e) of rule2
as defined in the "Flexible and Robust Key Rollover" paper. The rules
says: All DS records need to be in the HIDDEN state, or if it is not
there must be a key with its DNSKEY and KRRSIG in OMNIPRESENT, and
its DS in the same state as the key in question. In human langauge,
if all keys have their DS in HIDDEN state you can do what you want,
but if a DS record is available to some validators, there must be
a chain of trust for it.

Note that the barriers on transitions first check if the current
state is valid, and then if the next state is valid too. But
here we falsely updated the 'dnskey_omnipresent' (now 'dnskey_chained')
with the next state. The next state applies to 'key' not to the state
to be checked. Updating the state here leads to (true) always, because
the key that will move its state will match the falsely updated
expected state. This could lead to the assumption that Key 2 would be
a valid chain of trust for Key 1, while clearly the presence of any
DS is uncertain.

The fix here is to check if the DNSKEY and KRRSIG are in OMNIPRESENT
state for the key that does not have its DS in the HIDDEN state, and
only if that is not the case, ensure that there is a key with the same
algorithm, that provides a valid chain of trust, that is, has its
DNSKEY, KRRSIG, and DS in OMNIPRESENT state.

The changes in 'keymgr_dnskey_hidden_or_chained()' are only cosmetical,
renaming 'rrsig_omnipresent' to 'rrsig_chained' and removing the
redundant initialization of the DST_KEY_DNSKEY expected state to NA.
2021-02-03 15:34:36 +01:00
Matthijs Mekking
600915d1b2 Update keymgr_key_is_successor() calls
The previous commit changed the function definition of
'keymgr_key_is_successor()', this commit updates the code where
this function is called.

In 'keymgr_key_exists_with_state()' the logic is also updated slightly
to become more readable. First handle the easy cases:
- If the key does not match the state, continue with the next key.
- If we found a key with matching state, and there is no need to
  check the successor relationship, return (true).
- Otherwise check the successor relationship.

In 'keymgr_key_has_successor()' it is enough to check if a key has
a direct successor, so instead of calling 'keymgr_key_is_successor()',
we can just check 'keymgr_direct_dep()'.

In 'dns_keymgr_run()', we want to make sure that there is no
dependency on the keys before retiring excess keys, so replace
'keymgr_key_is_successor()' with 'keymgr_dep()'.
2021-02-03 15:34:36 +01:00
Matthijs Mekking
cc38527b63 Implement Equation(2) of "Flexible Key Rollover"
So far the key manager could only deal with two keys in a rollover,
because it used a simplified version of the successor relationship
equation from "Flexible and Robust Key Rollover" paper. The simplified
version assumes only two keys take part in the key rollover and it
for that it is enough to check the direct relationship between two
keys (is key x the direct predecessor of key z and is key z the direct
successor of key x?).

But when a third key (or more keys) comes into the equation, the key
manager would assume that one key (or more) is redundant and removed
it from the zone prematurely.

Fix by implementing Equation(2) correctly, where we check for
dependencies on keys:

z ->T x: Dep(x, T) = ∅ ∧
         (x ∈ Dep(z, T) ∨
          ∃ y ∈ Dep(z, T)(y != z ∧ y ->T x ∧ DyKyRySy = DzKzRzSz))

This says: key z is a successor of key x if:
- key x depends on key z if z is a direct successor of x,
- or if there is another key y that depends on key z that has identical
  key states as key z and key y is a successor of key x.
- Also, key x may not have any other keys depending on it.

This is still a simplified version of Equation(2) (but at least much
better), because the paper allows for a set of keys to depend on a
key. This is defined as the set Dep(x, T). Keys in the set Dep(x, T)
have a dependency on key x for record type T. The BIND implementation
can only have one key in the set Dep(x, T). The function
'keymgr_dep()' stores this key in 'uint32_t *dep' if there is a
dependency.

There are two scenarios where multiple keys can depend on a single key:

1. Rolling keys is faster than the time required to finish the
   rollover procedure. This scenario is covered by the recursive
   implementation, and checking for a chain of direct dependencies
   will suffice.

2. Changing the policy, when a zone is requested to be signed with
   a different key length for example. BIND 9 will not mark successor
   relationships in this case, but tries to move towards the new
   policy. Since there is no successor relationship, the rules are
   even more strict, and the DNSSEC reconfiguration is actually slower
   than required.

Note: this commit breaks the build, because the function definition
of 'keymgr_key_is_successor' changed. This will be fixed in the
following commit.
2021-02-03 15:34:36 +01:00
Ondřej Surý
de8058e828 Merge branch '2468-cid-318094-null-pointer-dereferences-reverse_inull' into 'main'
Resolve "CID 318094:  Null pointer dereferences  (REVERSE_INULL)"

Closes #2468

See merge request isc-projects/bind9!4641
2021-02-03 12:08:52 +00:00
Mark Andrews
456d53d1fb Remove redundant 'version == NULL' check
*** CID 318094:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/rbtdb.c: 1389 in newversion()
    1383     	version->xfrsize = rbtdb->current_version->xfrsize;
    1384     	RWUNLOCK(&rbtdb->current_version->rwlock, isc_rwlocktype_read);
    1385     	rbtdb->next_serial++;
    1386     	rbtdb->future_version = version;
    1387     	RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
    1388
       CID 318094:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "version" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    1389     	if (version == NULL) {
    1390     		return (result);
    1391     	}
    1392
    1393     	*versionp = version;
    1394
2021-02-03 13:06:27 +01:00
Ondřej Surý
adf5051afc Merge branch '1144-dns-over-https-server' into 'main'
Resolve "Encrypted DNS - RFC 8484, DNS over HTTPS, DOH (also DoT comments)"

Closes #1144

See merge request isc-projects/bind9!4644
2021-02-03 12:01:47 +00:00
Evan Hunt
91718fe4fb CHANGES, release notes 2021-02-03 12:06:17 +01:00
Ondřej Surý
0aacabc6dc Drop gcc:sid:i386 from GitLab CI
Building sid-i386 in Docker no longer works and we don't have a viable
alternative now, so dropping gcc:sid:i386 is our only option in this
very moment.
2021-02-03 12:06:17 +01:00
Evan Hunt
fe99484e14 support "tls ephemeral" with https 2021-02-03 12:06:17 +01:00
Evan Hunt
aa9d51c494 tls and http configuration code was unnecessarily complex
removed the isc_cfg_http_t and isc_cfg_tls_t structures
and the functions that loaded and accessed them; this can
be done using normal config parser functions.
2021-02-03 12:06:17 +01:00
Ondřej Surý
1cc24a2c8b Unit-test fixes and manual page updates for DoH configuration
This commit contains fixes to unit tests to make them work well on
various platforms (in particular ones shipping old versions of
OpenSSL) and for different configurations.

It also updates the generated manpage to include DoH configuration
options.
2021-02-03 12:06:17 +01:00
Artem Boldariev
08da09bc76 Initial support for DNS-over-HTTP(S)
This commit completes the support for DNS-over-HTTP(S) built on top of
nghttp2 and plugs it into the BIND. Support for both GET and POST
requests is present, as required by RFC8484.

Both encrypted (via TLS) and unencrypted HTTP/2 connections are
supported. The latter are mostly there for debugging/troubleshooting
purposes and for the means of encryption offloading to third-party
software (as might be desirable in some environments to simplify TLS
certificates management).
2021-02-03 12:06:17 +01:00
Witold Kręcicki
7a96081360 nghttp2-based HTTP layer in netmgr
This commit includes work-in-progress implementation of
DNS-over-HTTP(S).

Server-side code remains mostly untested, and there is only support
for POST requests.
2021-02-03 12:06:17 +01:00
Witold Kręcicki
cdf9d21731 Add isc_mem_strndup() function
This commit adds an implementation of strndup() function which
allocates memory from the supplied isc_mem_t memory context.
2021-02-03 12:06:17 +01:00
Evan Hunt
931ccd225f update ARM with "http" grammar
add a link to the http statement grammar and explanations and examples
for configuring DoH listeners.
2021-02-03 12:06:17 +01:00
Evan Hunt
06951472dd Add parser support for DoH configuration options
This commit adds stub parser support and tests for:
- an "http" global option for HTTP/2 endpoint configuration.
- command line options to set http or https port numbers by
  specifying -p http=PORT or -p https=PORT.  (NOTE: this change
  only affects syntax; specifying HTTP and HTTPS ports on the
  command line currently has no effect.)
- named.conf options "http-port" and "https-port"
- HTTPSPORT environment variable for use when running tests.
2021-02-03 12:06:17 +01:00
Artem Boldariev
6b9a31989c Resurrect old TLS code
This commit resurrects the old TLS code from
8f73c70d23.

It also includes numerous stability fixes and support for
isc_nm_cancelread() for the TLS layer.

The code was resurrected to be used for DoH.
2021-02-03 12:06:17 +01:00
Michał Kępień
677cc94671 Merge branch '2448-tweak-sphinx-build-invocations' into 'main'
Tweak sphinx-build invocations

Closes #2448

See merge request isc-projects/bind9!4640
2021-02-03 10:57:51 +00:00
Michał Kępień
51479ed9a3 Make sphinx-build warnings fatal
In order to prevent documentation building issues from being glossed
over, pass the -W command line switch to all sphinx-build invocations.
This causes the latter to return with a non-zero exit code whenever any
Sphinx warnings are triggered.
2021-02-03 11:44:02 +01:00
Michał Kępień
84862e96c1 Address a Sphinx duplicate label warning
Both doc/man/ddns-confgen.rst and doc/man/tsig-keygen.rst include
bin/confgen/tsig-keygen.rst, which defines a "man_tsig-keygen" label.
This triggers the following warning when running sphinx-build with the
-W command line switch in the doc/man/ directory:

    ../../bin/confgen/tsig-keygen.rst:27: WARNING: duplicate label man_tsig-keygen, other instance in /tmp/bind9/doc/man/ddns-confgen.rst

Move the offending label from bin/confgen/tsig-keygen.rst to the proper
spot in doc/arm/manpages.rst to avoid effectively defining it twice in
different source documents while still allowing the relevant man page to
be referenced in the ARM.  Also rename that label so that it more
closely matches the content it points to.  As the label no longer
immediately precedes a section title in its new location, use
:ref:`Title <label>` syntax for the only reference to the
tsig-keygen/ddns-confgen man page in the ARM.
2021-02-03 11:44:02 +01:00
Michał Kępień
33db7ea16d Use separate sphinx-build cache directories
Simultaneously starting multiple sphinx-build instances with the -d
command line switch set to a common value (which is what happens when
e.g. "make -j6 doc" is run) causes intermittent problems which we failed
to notice before because they only trigger Sphinx warnings, not errors,
e.g.:

    WARNING: toctree contains ref to nonexisting file 'reference'

The message above is not triggered because doc/arm/reference.rst is
actually missing from disk at any point, but rather because a temporary
file created by one sphinx-build instance gets truncated by another one
working in parallel (the confusing message quoted above is logged
because of an overly broad "except" statement in Sphinx code).

Prevent this problem from being triggered by making each sphinx-build
process use its own dedicated cache directory.
2021-02-03 11:44:02 +01:00
Matthijs Mekking
62af115fa9 Merge branch '2406-kasp-init-inactive-delete-metadata' into 'main'
Resolve "kasp: look at Inactive/Delete when initializing state files"

Closes #2406

See merge request isc-projects/bind9!4599
2021-02-03 08:49:14 +00:00
Matthijs Mekking
82632fa6d9 Remove initialize goal code
Since keys now have their goals initialized in 'keymgr_key_init()',
remove this redundant piece of code in 'keymgr_key_run()'.
2021-02-03 08:36:14 +01:00
Matthijs Mekking
76cf72e65a Correctly initialize old key with state file
The 'key_init()' function is used to initialize a state file for keys
that don't have one yet. This can happen if you are migrating from a
'auto-dnssec' or 'inline-signing' to a 'dnssec-policy' configuration.

It did not look at the "Inactive" and "Delete" timing metadata and so
old keys left behind in the key directory would also be considered as
a possible active key. This commit fixes this and now explicitly sets
the key goal to OMNIPRESENT for keys that have their "Active/Publish"
timing metadata in the past, but their "Inactive/Delete" timing
metadata in the future. If the "Inactive/Delete" timing metadata is
also in the past, the key goal is set to HIDDEN.

If the "Inactive/Delete" timing metadata is in the past, also the
key states are adjusted to either UNRETENTIVE or HIDDEN, depending on
how far in the past the metadata is set.
2021-02-03 08:36:01 +01:00
Matthijs Mekking
d4b2b7072d Update legacy-keys kasp test
The 'legacy-keys.kasp' test checks that a zone with key files but not
yet state files is signed correctly. This test is expanded to cover
the case where old key files still exist in the key directory. This
covers bug #2406 where keys with the "Delete" timing metadata are
picked up by the keymgr as active keys.

Fix the 'legacy-keys.kasp' test, by creating the right key files
(for zone 'legacy-keys.kasp', not 'legacy,kasp').

Use a unique policy for this zone, using shorter lifetimes.

Create two more keys for the zone, and use 'dnssec-settime' to set
the timing metadata in the past, long enough ago so that the keys
should not be considered by the keymgr.

Update the 'key_unused()' test function, and consider keys with
their "Delete" timing metadata in the past as unused.

Extend the test to ensure that the keys to be used are not the old
predecessor keys (with their "Delete" timing metadata in the past).

Update the test so that the checks performed are consistent with the
newly configured policy.
2021-02-03 08:35:56 +01:00
Mark Andrews
6b79a0ce9d Merge branch '1697-isc_rwlock_init-can-no-longer-fail-in-master-clean-up-calls' into 'main'
Resolve "isc_rwlock_init can no longer fail in master, clean up calls."

Closes #2462 and #1697

See merge request isc-projects/bind9!4635
2021-02-03 02:36:24 +00:00
Mark Andrews
3b11bacbb7 Cleanup redundant isc_rwlock_init() result checks 2021-02-03 12:22:33 +11:00
Ondřej Surý
48a89e5fbe Merge branch '2444-call-freeaddrinfo-in-test_client' into 'main'
Fix addrinfo leak in test_client.c

Closes #2444

See merge request isc-projects/bind9!4629
2021-01-29 14:54:42 +00:00
Ondřej Surý
6aa4d59526 Fix addrinfo leak in test_client.c
The addrinfo we got from getaddrinfo() was never freed.
2021-01-29 13:26:28 +01:00
Ondřej Surý
b42137c453 Merge branch '2392-xot-xfrin' into 'main'
Add support for incoming tranfers via XoT

Closes #2392

See merge request isc-projects/bind9!4571
2021-01-29 11:55:16 +00:00
Evan Hunt
220bca9ebf CHANGES and release notes 2021-01-29 12:07:38 +01:00
Ondřej Surý
e488309da7 implement xfrin via XoT
Add support for a "tls" key/value pair for zone primaries, referencing
either a "tls" configuration statement or "ephemeral". If set to use
TLS, zones will send SOA and AXFR/IXFR queries over a TLS channel.
2021-01-29 12:07:38 +01:00
Matthijs Mekking
778d0c03a9 Merge branch '2442-tsan-error-lib-dns-rbtdb-c' into 'main'
Resolve "TSAN error: lib/dns/rbtdb.c"

Closes #2442

See merge request isc-projects/bind9!4609
2021-01-29 10:45:40 +00:00
Diego Fronza
c75575e350 Fix race condition on check_stale_header
This commit fix a race that could happen when two or more threads have
failed to refresh the same RRset, the threads could simultaneously
attempt to update the header->last_refresh_fail_ts field in
check_stale_header, a field used to implement stale-refresh-time.

By making this field atomic we avoid such race.
2021-01-29 10:29:51 +01:00
Matthijs Mekking
0fab6cf88e Merge branch '2434-fetch-limit-serve-stale' into 'main'
Resolve "Serve stale when fetch limits are hit"

Closes #2434

See merge request isc-projects/bind9!4607
2021-01-28 16:57:20 +00:00
Matthijs Mekking
ed8421693c Add notes and change entry for [#2434]
This concludes the serve-stale improvements.
2021-01-28 17:02:56 +01:00
Matthijs Mekking
11b74fc176 Add test for serve-stale /w fetch-limits
Add a test case when fetch-limits are reached and we have stale data
in cache.

This test starts with a positive answer for 'data.example/TXT' in
cache.

1. Reload named.conf to set fetch limits.
2. Disable responses from the authoritative server.
3. Now send a batch of queries to the resolver, until hitting the
   fetch limits. We can detect this by looking at the response RCODE,
   at some point we will see SERVFAIL responses.
4. At that point we will turn on serve-stale.
5. Clients should see stale answers now.
6. An incoming query should not set the stale-refresh-time window,
   so a following query should still get a stale answer because of a
   resolver failure (and not because it was in the stale-refresh-time
   window).
2021-01-28 16:39:30 +01:00
Matthijs Mekking
aabdedeae3 Only start stale refresh window when resuming
If we did not attempt a fetch due to fetch-limits, we should not start
the stale-refresh-time window.

Introduce a new flag DNS_DBFIND_STALESTART to differentiate between
a resolver failure and unexpected error. If we are resuming, this
indicates a resolver failure, then start the stale-refresh-time window,
otherwise don't start the stale-refresh-time window, but still fall
back to using stale data.

(This commit also wraps some docstrings to 80 characters width)
2021-01-28 16:38:34 +01:00
Matthijs Mekking
c6fd02aed5 Use stale data also if we are not resuming
Before this change, BIND will only fallback to using stale data if
there was an actual attempt to resolve the query. Then on a timeout,
the stale data from cache becomes eligible.

This commit changes this so that on any unexpected error stale data
becomes eligble (you would still have to have 'stale-answer-enable'
enabled of course).

If there is no stale data, this may return in an error again, so don't
loop on stale data lookup attempts. If the DNS_DBFIND_STALEOK flag is
set, this means we already tried to lookup stale data, so if that is
the case, don't use stale again.
2021-01-28 16:36:46 +01:00
Mark Andrews
c1c7e1ac5c Merge branch '2420-xmlfreetextwriter-could-be-called-twice' into 'main'
Resolve "CID 316510: Memory - corruptions (USE_AFTER_FREE)"

Closes #2420

See merge request isc-projects/bind9!4613
2021-01-28 05:19:53 +00:00
Mark Andrews
95114f7d60 Add CHANGES entry for [GL #2420] 2021-01-28 04:15:06 +00:00
Mark Andrews
b5cf54252a Stop xmlFreeTextWriter being called twice
xmlFreeTextWriter could be called twice if xmlDocDumpFormatMemoryEnc
failed.
2021-01-28 04:15:06 +00:00
Mark Andrews
838d3673a8 Merge branch 'marka-changes-line-length' into 'main'
Detect overly long CHANGES lines

See merge request isc-projects/bind9!4603
2021-01-28 04:06:14 +00:00
Mark Andrews
28449acded fix overly long line 2021-01-28 14:12:40 +11:00
Mark Andrews
b1ecab6383 Detect overly long CHANGES lines 2021-01-28 13:49:02 +11:00
Mark Andrews
12c5b2a1b8 Merge branch '2413-after-upgrade-to-bind9-9-16-11-named-is-killed-with-status-11-segv' into 'main'
Resolve "after upgrade to bind9 9.16.11 named is killed with status=11/SEGV"

Closes #2413

See merge request isc-projects/bind9!4592
2021-01-28 02:34:43 +00:00
Mark Andrews
79fad620a2 Add release note for [GL #2413] 2021-01-28 01:54:59 +00:00
Mark Andrews
5ec9999b28 Add CHANGES for [GL #2413] 2021-01-28 01:54:59 +00:00
Mark Andrews
3dee62cfa5 Add a named acl example 2021-01-28 01:54:59 +00:00
Mark Andrews
a8b55992a8 Require 'ctx' to be non-NULL in cfg_acl_fromconfig{,2} 2021-01-28 01:54:59 +00:00
Mark Andrews
2b3fcd7156 Pass an afg_aclconfctx_t structure to cfg_acl_fromconfig
in named_zone_inlinesigning.  A NULL pointer does not work.
2021-01-28 01:54:59 +00:00
Mark Andrews
b111592dca Merge branch '2391-check-nsupdate-y-for-all-hmac-algorithms' into 'main'
Resolve "Check 'nsupdate -y' for all hmac algorithms."

Closes #2391

See merge request isc-projects/bind9!4569
2021-01-28 01:54:30 +00:00
Mark Andrews
4b01ba44ea Check that 'nsupdate -y' works for all HMAC algorithms 2021-01-28 01:21:27 +00:00
Mark Andrews
5921af4c7f Merge branch '2073-dnssec-verify-tries-all-keys-which-results-in-poor-performance' into 'main'
Resolve "dnssec-verify tries all keys which results in poor performance"

Closes #2073

See merge request isc-projects/bind9!4411
2021-01-28 01:06:47 +00:00
Mark Andrews
3f0859d223 Add CHANGES note 2021-01-28 11:07:52 +11:00
Mark Andrews
c75b325832 Optimise dnssec-verify
dns_dnssec_keyfromrdata() only needs to be called once per DNSKEY
rather than once per verification attempt.
2021-01-28 11:07:03 +11:00
Mark Andrews
d7f41c3dce Merge branch '2342-rndc-retransfer-issues-misleading-diagnostic-on-primary-zone' into 'main'
Resolve "rndc retransfer issues misleading diagnostic on primary zone"

Closes #2342

See merge request isc-projects/bind9!4482
2021-01-27 22:42:05 +00:00
Mark Andrews
1f55f49f21 Add CHANGES 2021-01-28 08:43:50 +11:00
Mark Andrews
8f36b8567a Check 'rndc retransfer' of primary error message 2021-01-28 08:43:03 +11:00
Mark Andrews
dd3520ae41 Improve the diagnostic 'rndc retransfer' error message 2021-01-28 08:43:03 +11:00
Matthijs Mekking
1fcc6132c4 Merge branch '2178-dnssec-fromlabel-ec_crash' into 'main'
Resolve "dnssec-keyfromlabel  ECDSAP256SHA256 error on AEP Keypers HSM"

Closes #2178

See merge request isc-projects/bind9!4495
2021-01-26 14:02:49 +00:00
Matthijs Mekking
57ac70ad46 Make opensslecdsa_parse use fromlabel
When 'opensslecdsa_parse()' encounters a label tag in the private key
file, load the private key with 'opensslecdsa_fromlabel()'. Otherwise
load it from the private structure.

This was attempted before with 'load_privkey()' and 'uses_engine()',
but had the same flaw as 'opensslecdsa_fromlabel()' had previously,
that is getting the private and public key separately, juggling with
pointers between EC_KEY and EVP_PKEY, did not create a valid
cryptographic key that could be used for signing.
2021-01-26 15:01:26 +01:00
Matthijs Mekking
393052d6ff Simplify opensslecdsa_fromlabel
The 'opensslecdsa_fromlabel()' function does not need to get the
OpenSSL engine twice to load the private and public key. Also no need
to call 'dst_key_to_eckey()' as the EC_KEY can be derived from the
loaded EVP_PKEY's.

Add some extra checks to ensure the key has the same base id and curve
(group nid) as the dst key.

Since we already have the EVP_PKEY, no need to call 'finalize_eckey()',
instead just set the right values in the key structure.
2021-01-26 15:01:26 +01:00
Matthijs Mekking
1fcd0ef8bd Replace EVP_DigestFinal with EVP_DigestFinal_ex
The openssl docs claim that EVP_DigestFinal() is obsolete and that
one should use EVP_DigestFinal_ex() instead.
2021-01-26 15:01:26 +01:00
Matthijs Mekking
37d11f5be0 Add notes and changes for [#2178] 2021-01-26 15:01:24 +01:00
Matthijs Mekking
06b9724152 Don't set pubkey if eckey already has public key
The 'ecdsa_check()' function tries to correctly set the public key
on the eckey, but this should be skipped if the public key is
retrieved via the private key.
2021-01-26 15:01:04 +01:00
Matthijs Mekking
46afeca8bf ECDSA code should not use RSA label
The 'opensslecdsa_tofile()' function tags the label as an RSA label,
that is a copy paste error and should be of course an ECDSA label.
2021-01-26 15:01:04 +01:00
Matthijs Mekking
01239691a1 Correctly update pointers to pubkey and privkey
The functions 'load_pubkey_from_engine()' and
'load_privkey_from_engine()' did not correctly store the pointers.

Update both functions to add 'EC_KEY_set_public_key()' and
'EC_KEY_set_private_key()' respectively, so that the pointers to
the public and private keys survive the "load from engine" functions.
2021-01-26 15:01:04 +01:00
Matthijs Mekking
370285a62d load_pubkey_from_engine() should load public key
The 'function load_pubkey_from_engine()' made a call to the libssl
function 'ENGINE_load_private_key'.  This is a copy paste error and
should be 'ENGINE_load_public_key'.
2021-01-26 15:01:04 +01:00
Ondřej Surý
61ba7b9cba Merge branch '2403-dig-has-a-fit-with-option-multi-typo-on-multi' into 'main'
Report unknown dash option during the pre-parse phase

Closes #2403

See merge request isc-projects/bind9!4590
2021-01-26 13:17:02 +00:00
Mark Andrews
0b6da18f31 Add CHANGES note for [GL #2403] 2021-01-26 13:26:29 +01:00
Mark Andrews
3361c0d6f8 Report unknown dash option during the pre-parse phase 2021-01-26 13:26:10 +01:00
Michal Nowak
1869846858 Merge branch 'mnowak/add-rsabigexponent-README' into 'main'
Add README.md file to rsabigexponent system test

See merge request isc-projects/bind9!4579
2021-01-26 10:44:10 +00:00
Michal Nowak
a247f24dfa Add README.md file to rsabigexponent system test
This README.md describes why is bigkey needed.
2021-01-26 11:40:42 +01:00
Diego dos Santos Fronza
e96bf1f3dc Merge branch '2247-add-serve-stale-option-to-set-client-timeout' into 'main'
Resolve "Add serve-stale option to set client timeout"

Closes #2247

See merge request isc-projects/bind9!4514
2021-01-25 14:25:32 +00:00
Matthijs Mekking
d8c6655d7d Rewrap comments to 80 char width serve-stale test 2021-01-25 10:48:16 -03:00
Matthijs Mekking
fa0c9280d2 Update code flow in query.c wrt stale data
First of all, there was a flaw in the code related to the
'stale-refresh-time' option. If stale answers are enabled, and we
returned stale data, then it was assumed that it was because we were
in the 'stale-refresh-time' window. But now we could also have returned
stale data because of a 'stale-answer-client-timeout'. To fix this,
introduce a rdataset attribute DNS_RDATASETATTR_STALE_WINDOW to
indicate whether the stale cache entry was returned because the
'stale-refresh-time' window is active.

Second, remove the special case handling when the result is
DNS_R_NCACHENXRRSET. This can be done more generic in the code block
when dealing with stale data.

Putting all stale case handling in the code block when dealing with
stale data makes the code more easy to follow.

Update documentation to be more verbose and to match then new code
flow.
2021-01-25 10:48:16 -03:00
Diego Fronza
966060c03b Extracted common function from query_lookup and query_refresh_rrset
Both functions employed the same code lines to allocate query context
buffers, which are used to store query results, so this shared portion
of code was extracted out to a new function, qctx_prepare_buffers.

Also, this commit uses qctx_init to initialize the query context whitin
query_refresh_rrset function.
2021-01-25 10:48:16 -03:00
Diego Fronza
f89ac07b28 Small optimization in query_usestale
This commit makes the code in query_usestale easier to follow, it also
doesn't attach/detach to the database if stale answers are not enabled.
2021-01-25 10:48:16 -03:00
Diego Fronza
42c789c763 Add CHANGES note for [GL #2247] 2021-01-25 10:48:09 -03:00
Diego Fronza
6ab9070457 Add documentation for stale-answer-client-timeout 2021-01-25 10:47:14 -03:00
Diego Fronza
35fd039d03 Add system tests for stale-answer-client-timeout
This commit add 4 tests for the new option:
	1. Test default configuration of stale-answer-client-timeout, a
	   value of 1.8 seconds, with stale-refresh-time disabled.

	2. Test disabling of stale-answer-client-timeout.

	3. Test stale-answer-client-timeout with a value of zero, in this
	   case we take advantage of a log entry which shows that a stale
	   answer was promptly used before an attempt to refresh the RRset
	   is made. We also check, by activating a disabled authoritative
	   server, that the RRset was successfully refreshed after that.

	4. Test stale-answer-client-timeout 0 with stale-refresh-time 4, in
	   this test we want to ensure a couple things:

	   - If we have a stale RRSet entry in cache, a request must be
		 promptly answered with this data, while BIND must also attempt
		 to refresh the RRSet in background.

	   - If the attempt to refresh the RRSet times out, the RRSet must
		 have its stale-refresh-time window activated.

	   - If a new request for the same RRSet arrives, it must be
		 promptly answered with stale data due to stale-refresh-time
		 being active for this RRSet, in this case no attempt to refresh
		 the RRSet is made.

	   - Enable authoritative server, ensure that the RRSet was not
		 refreshed, to honor stale-refresh-time.

	   - Wait for stale-refresh-window time pass, send another request
		 for the same RRSet, this time we expect the answer to be the
		 stale entry in cache being hit due to
		 stale-answer-client-timeout 0.

	    - Send another request, this time we expect the answer to be an
		  active RRSet, since it must have been refreshed during the
		  previous request.
2021-01-25 10:47:14 -03:00
Diego Fronza
e219422575 Allow stale data to be used before name resolution
This commit allows stale RRset to be used (if available) for responding
a query, before an attempt to refresh an expired, or otherwise resolve
an unavailable RRset in cache is made.

For that to work, a value of zero must be specified for
stale-answer-client-timeout statement.

To better understand the logic implemented, there are three flags being
used during database lookup and other parts of code that must be
understood:

. DNS_DBFIND_STALEOK: This flag is set when BIND fails to refresh a
  RRset due to timeout (resolver-query-timeout), its intent is to
  try to look for stale data in cache as a fallback, but only if
  stale answers are enabled in configuration.

  This flag is also used to activate stale-refresh-time window, since it
  is the only way the database knows that a resolution has failed.

. DNS_DBFIND_STALEENABLED: This flag is used as a hint to the database
  that it may use stale data. It is always set during query lookup if
  stale answers are enabled, but only effectively used during
  stale-refresh-time window. Also during this window, the resolver will
  not try to resolve the query, in other words no attempt to refresh the
  data in cache is made when the stale-refresh-time window is active.

. DNS_DBFIND_STALEONLY: This new introduced flag is used when we want
  stale data from the database, but not due to a failure in resolution,
  it also doesn't require stale-refresh-time window timer to be active.
  As long as there is a stale RRset available, it should be returned.
  It is mainly used in two situations:

    1. When stale-answer-client-timeout timer is triggered: in that case
       we want to know if there is stale data available to answer the
       client.
    2. When stale-answer-client-timeout value is set to zero: in that
       case, we also want to know if there is some stale RRset available
       to promptly answer the client.

We must also discern between three situations that may happen when
resolving a query after the addition of stale-answer-client-timeout
statement, and how to handle them:

	1. Are we running query_lookup() due to stale-answer-client-timeout
       timer being triggered?

       In this case, we look for stale data, making use of
       DNS_DBFIND_STALEONLY flag. If a stale RRset is available then
       respond the client with the data found, mark this query as
       answered (query attribute NS_QUERYATTR_ANSWERED), so when the
       fetch completes the client won't be answered twice.

       We must also take care of not detaching from the client, as a
       fetch will still be running in background, this is handled by the
       following snippet:

       if (!QUERY_STALEONLY(&client->query)) {
           isc_nmhandle_detach(&client->reqhandle);
       }

       Which basically tests if DNS_DBFIND_STALEONLY flag is set, which
       means we are here due to a stale-answer-client-timeout timer
       expiration.

    2. Are we running query_lookup() due to resolver-query-timeout being
       triggered?

       In this case, DNS_DBFIND_STALEOK flag will be set and an attempt
       to look for stale data will be made.
       As already explained, this flag is algo used to activate
       stale-refresh-time window, as it means that we failed to refresh
       a RRset due to timeout.
       It is ok in this situation to detach from the client, as the
       fetch is already completed.

    3. Are we running query_lookup() during the first time, looking for
       a RRset in cache and stale-answer-client-timeout value is set to
       zero?

       In this case, if stale answers are enabled (probably), we must do
       an initial database lookup with DNS_DBFIND_STALEONLY flag set, to
       indicate to the database that we want stale data.

       If we find an active RRset, proceed as normal, answer the client
       and the query is done.

       If we find a stale RRset we respond to the client and mark the
       query as answered, but don't detach from the client yet as an
       attempt in refreshing the RRset will still be made by means of
       the new introduced function 'query_resolve'.

       If no active or stale RRset is available, begin resolution as
       usual.
2021-01-25 10:47:14 -03:00
Diego Fronza
0ad6f594f6 Added option for disabling stale-answer-client-timeout
This commit allows to specify "disabled" or "off" in
stale-answer-client-timeout statement. The logic to support this
behavior will be added in the subsequent commits.

This commit also ensures an upper bound to stale-answer-client-timeout
which equals to one second less than 'resolver-query-timeout'.
2021-01-25 10:47:14 -03:00
Diego Fronza
a12bf4b61b Adjusted serve-stale test
After the addition of stale-answer-client-timeout a test was broken due
to the following behavior expected by the test.

1. Prime cache data.example txt.
2. Disable authoritative server.
3. Send a query for data.example txt.
4. Recursive server will timeout and answer from cache with stale RRset.
5. Recursive server will activate stale-refresh-time due to the previous
   failure in attempting to refresh the RRset.
6. Send a query for data.example txt.
7. Expect stale answer from cache due to stale-refresh-time
window being active, even if authoritative server is up.

Problem is that in step 4, due to the new option
stale-answer-client-timeout, recursive server will answer with stale
data before the actual fetch completes.

Since the original fetch is still running in background, if we re-enable
the authoritative server during that time, the RRset will actually be
successfully refreshed, and stale-refresh-window will not be activated.

The next queries will fail because they expect the TTL of the RRset to
match the one in the stale cache, not the one just refreshed.

To solve this, we explicitly disable stale-answer-client-timeout for
this test, as it's not the feature we are interested in testing here
anyways.
2021-01-25 10:47:14 -03:00
Diego Fronza
171a5b7542 Add stale-answer-client-timeout option
The general logic behind the addition of this new feature works as
folows:

When a client query arrives, the basic path (query.c / ns_query_recurse)
was to create a fetch, waiting for completion in fetch_callback.

With the introduction of stale-answer-client-timeout, a new event of
type DNS_EVENT_TRYSTALE may invoke fetch_callback, whenever stale
answers are enabled and the fetch took longer than
stale-answer-client-timeout to complete.

When an event of type DNS_EVENT_TRYSTALE triggers fetch_callback, we
must ensure that the folowing happens:

1. Setup a new query context with the sole purpose of looking up for
   stale RRset only data, for that matters a new flag was added
   'DNS_DBFIND_STALEONLY' used in database lookups.

    . If a stale RRset is found, mark the original client query as
      answered (with a new query attribute named NS_QUERYATTR_ANSWERED),
      so when the fetch completion event is received later, we avoid
      answering the client twice.

    . If a stale RRset is not found, cleanup and wait for the normal
      fetch completion event.

2. In ns_query_done, we must change this part:
	/*
	 * If we're recursing then just return; the query will
	 * resume when recursion ends.
	 */
	if (RECURSING(qctx->client)) {
		return (qctx->result);
	}

   To this:

	if (RECURSING(qctx->client) && !QUERY_STALEONLY(qctx->client)) {
		return (qctx->result);
	}

   Otherwise we would not proceed to answer the client if it happened
   that a stale answer was found when looking up for stale only data.

When an event of type DNS_EVENT_FETCHDONE triggers fetch_callback, we
proceed as before, resuming query, updating stats, etc, but a few
exceptions had to be added, most important of which are two:

1. Before answering the client (ns_client_send), check if the query
   wasn't already answered before.

2. Before detaching a client, e.g.
   isc_nmhandle_detach(&client->reqhandle), ensure that this is the
   fetch completion event, and not the one triggered due to
   stale-answer-client-timeout, so a correct call would be:
   if (!QUERY_STALEONLY(client)) {
        isc_nmhandle_detach(&client->reqhandle);
   }

Other than these notes, comments were added in code in attempt to make
these updates easier to follow.
2021-01-25 10:47:14 -03:00
Diego Fronza
74840ec50b Added dns_view_staleanswerenabled() function
Since it takes a couple lines of code to check whether stale answers
are enabled for a given view, code was extracted out to a proper
function.
2021-01-25 10:47:14 -03:00
Diego Fronza
49c40827f6 Avoid iterating name twice when constructing fctx->info
This is a minor performance improvement, we store the result of the
first call to strlcat to use as an offset in the next call when
constructing fctx->info string.
2021-01-25 10:47:14 -03:00
Michał Kępień
91acd207d2 Merge branch '2387-use--release-for-SONAME' into 'main'
Use -release instead of -version-info for internal library SONAMEs

Closes #2387

See merge request isc-projects/bind9!4552
2021-01-25 13:36:49 +00:00
Ondřej Surý
b30aaa3748 Add CHANGES and release note for GL #2387 2021-01-25 14:19:53 +01:00
Ondřej Surý
c605d75ea5 Use -release instead of -version-info for internal library SONAMEs
The BIND 9 libraries are considered to be internal only and hence the
API and ABI changes a lot.  Keeping track of the API/ABI changes takes
time and it's a complicated matter as the safest way to make everything
stable would be to bump any library in the dependency chain as in theory
if libns links with libdns, and a binary links with both, and we bump
the libdns SOVERSION, but not the libns SOVERSION, the old libns might
be loaded by binary pulling old libdns together with new libdns loaded
by the binary.  The situation gets even more complicated with loading
the plugins that have been compiled with few versions old BIND 9
libraries and then dynamically loaded into the named.

We are picking the safest option possible and usable for internal
libraries - instead of using -version-info that has only a weak link to
BIND 9 version number, we are using -release libtool option that will
embed the corresponding BIND 9 version number into the library name.

That means that instead of libisc.so.1701 (as an example) the library
will now be named libisc-9.17.10.so.
2021-01-25 14:19:53 +01:00
Michal Nowak
7939e7fd71 Merge branch '2415-update-coverity-scan-ci-job-to-2020-09' into 'main'
Update Coverity Scan CI job to 2020.09

Closes #2415

See merge request isc-projects/bind9!4593
2021-01-25 11:32:52 +00:00
Michal Nowak
7d428be79b Update Coverity Scan CI job to 2020.09 2021-01-25 12:31:11 +01:00
Ondřej Surý
5c27eef817 Merge branch '2335-tlsdns-refactoring' into 'main'
refactor TLSDNS module to work with libuv/ssl directly

Closes #2335

See merge request isc-projects/bind9!4584
2021-01-25 09:15:52 +00:00
Evan Hunt
f472390bc2 Add CHANGES note for #2335 2021-01-25 09:19:22 +01:00
Ondřej Surý
e493e04c0f Refactor TLSDNS module to work with libuv/ssl directly
* Following the example set in 634bdfb16d, the tlsdns netmgr
  module now uses libuv and SSL primitives directly, rather than
  opening a TLS socket which opens a TCP socket, as the previous
  model was difficult to debug.  Closes #2335.

* Remove the netmgr tls layer (we will have to re-add it for DoH)

* Add isc_tls API to wrap the OpenSSL SSL_CTX object into libisc
  library; move the OpenSSL initialization/deinitialization from dstapi
  needed for OpenSSL 1.0.x to the isc_tls_{initialize,destroy}()

* Add couple of new shims needed for OpenSSL 1.0.x

* When LibreSSL is used, require at least version 2.7.0 that
  has the best OpenSSL 1.1.x compatibility and auto init/deinit

* Enforce OpenSSL 1.1.x usage on Windows

* Added a TLSDNS unit test and implemented a simple TLSDNS echo
  server and client.
2021-01-25 09:19:22 +01:00
Michał Kępień
8f73c70d23 Merge branch 'v9_17_9-release' into 'main'
Merge 9.17.9 release branch

See merge request isc-projects/bind9!4586
2021-01-21 08:05:29 +00:00
Michał Kępień
7751a8eaf6 Set up release notes for BIND 9.17.10 2021-01-21 09:02:04 +01:00
Michał Kępień
f28804cd98 Bump BIND_BASELINE_VERSION for ABI checks 2021-01-21 09:02:04 +01:00
Michał Kępień
60b3c67cf0 Update GitLab issue number for CHANGES entry 5557 2021-01-21 08:57:22 +01:00
Michał Kępień
49d2aafdc4 Update BIND version to 9.17.9 2021-01-21 08:57:22 +01:00
Michał Kępień
cacf290ad2 Add a CHANGES marker 2021-01-21 08:57:22 +01:00
Michał Kępień
347d666b0f Update library API versions 2021-01-21 08:57:22 +01:00
Michał Kępień
5eac635fc0 Merge branch 'michal/prepare-documentation-for-bind-9.17.9' into 'v9_17_9-release'
Prepare documentation for BIND 9.17.9

See merge request isc-private/bind9!230
2021-01-21 08:57:22 +01:00
Michał Kępień
6118f75c70 Prepare release notes for BIND 9.17.9 2021-01-21 08:57:22 +01:00
Michał Kępień
cf9d818be3 Add release note for GL #2091 2021-01-21 08:57:22 +01:00
Michał Kępień
09ff03bb1c Reorder release notes 2021-01-21 08:57:22 +01:00
Michał Kępień
e343aa5b94 Tweak and reword release notes 2021-01-21 08:57:22 +01:00
Michał Kępień
598a026cae Tweak and reword recent CHANGES entries 2021-01-21 08:57:22 +01:00
Michał Kępień
b2b451d0bf Fix location of the CHANGES marker for BIND 9.17.8 2021-01-21 08:57:22 +01:00
Evan Hunt
9ec5dcf79c Merge branch 'each-fix-cpu-test' into 'main'
check whether taskset works before running cpu test

See merge request isc-projects/bind9!4583
2021-01-20 23:42:55 +00:00
Evan Hunt
a8a49bb783 check whether taskset works before running cpu test
the taskset command used for the cpu system test seems
to be failing under vmware, causing a test failure. we
can try the taskset command and skip the test if it doesn't
work.
2021-01-20 13:37:52 -08:00
Michal Nowak
56616c783b Merge branch 'mnowak/drop-issue-1941-workaround' into 'main'
Drop #1941 workaround

See merge request isc-projects/bind9!4580
2021-01-19 10:46:31 +00:00
Michal Nowak
fe5978f5ba Drop #1941 workaround
Workaround for issue #1941 is not needed anymore as the underlying
performance issue which manifested on FreeBSD was addressed.
2021-01-19 11:45:10 +01:00
Matthijs Mekking
0d6347b55e Merge branch '1086-cleanup-config-option-flags' into 'main'
Resolve "Reduce the number of "bad configuration options" flags"

Closes #1086

See merge request isc-projects/bind9!4476
2021-01-19 09:59:03 +00:00
Matthijs Mekking
f411f510f7 Remove the option 'filter-aaaa' options
The 'filter-aaaa', 'filter-aaaa-on-v4', and 'filter-aaaa-on-v6' options
are replaced by the filter-aaaa plugin. This plugin was introduced in
9.13.5 and so it is safe to remove the named.conf options.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
437d271483 Special case tests for lmdb
When compiling BIND 9 without lmdb, this is promoted from
'not operational' to 'not configured', resulting in a failure (and no
longer a warning) if ldmb-related configuration options are set.

Special case certain system tests to avoid test failures on systems
that do not have lmdb.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
dc6de216af Update copyrights for [#1086] 2021-01-19 10:12:40 +01:00
Matthijs Mekking
9d96350f4f Add notes for [#1086]
Mention the configuration cleanup.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
c6c3e2d074 Update doc files
Run make doc after all the code changes related to #1086.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
87744f218d Remove a lot of obsoleted options
These options were ancient or made obsolete a long time ago, it is
safe to remove them.

Also stop printing ancient options, they should be treated the same as
unknown options.

Removed options: lwres, geoip-use-ecs, sit-secret, use-ixfr,
acache-cleaning-interval, acache-enable, additional-from-auth,
additional-from-cache, allow-v6-synthesis, dnssec-enable,
max-acache-size, nosit-udp-size, queryport-pool-ports,
queryport-pool-updateinterval, request-sit, use-queryport-pool, and
support-ixfr.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
df435fc7da Remove the option 'dnssec-lookaside'
Obsoleted in 9.15, we can remove the option in 9.17.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
a889ed38ef Remove the option 'cleaning-interval'
Obsoleted in 9.15, we can remove the option in 9.17.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
6e2597b55a Log experimental options
Log a warning for the 'experimental' clause flag similar to
the 'deprecated' flag.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
d5f70b2237 Obsolete CLAUSEFLAG NEWDEFAULT
The 'new default' option was introduced in 2002 to signal that a
default option had changed its default value, in this specific case
the value for 'auth-nxdomain'. However, this default has been unchanged
for 18 years now, and logging that the default has changed does not
have significant value nowadays.

This is also a good example that the clause flag 'new default' is
broken: it is easy to get out of date.

It is also easy to forget, because we have changed the default value
for 'max-stale-ttl' and haven't been flagging it with 'new default'

Also, if the operator cares for a specific value it should set it
explicitly. Using the default is telling the software: use whatever
you think is best, and this may change over time. Default value
changes should be mentioned in the release note, but do not require
further special treatment.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
dda3a68efc Obsolete CLAUSEFLAG NOOP
The clause flag 'not operational' is promoted to 'not configured'.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
ff1957e95b Obsolete CLAUSEFLAG NOTIMP and NYI
The clause flags 'not implented' and 'not implemented yet' are the
same as 'obsoleted' when it comes to behavior. These options will
now be treated similar as obsoleted (the idea being that if an
option is implemented it should be functional).

The new options for DoT are new options and rather than flagging them
obsolete, they should have been flagged as experimental, signalling
that these options are subject to change in the future.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
ef28737af8 Merge branch '2380-doc-engine-pkcs11' into 'main'
Resolve "Documentation  update - use of "-E pkcs11""

Closes #2380

See merge request isc-projects/bind9!4572
2021-01-19 09:10:32 +00:00
Matthijs Mekking
a9828dd170 Update documentation on -E option
The -E option does not default to pkcs11 if --with-pkcs11 is set,
but always needs to be set explicitly.
2021-01-19 09:05:28 +01:00
Michał Kępień
a23c5d2921 Merge branch 'michal/improve-danger-checks' into 'main'
Improve Danger checks

Closes #1923 and #1917

See merge request isc-projects/bind9!4503
2021-01-18 14:12:42 +00:00
Michał Kępień
bc42690c99 Skip subject line length check for merge commits
Some merge requests (e.g. those created for release branches) include
merge commits.  Prevent Danger from warning about excessive subject line
length for merge commits.  (While the proper way to detect a merge
commit would be to check the 'parents' attribute of a commit object,
Danger Python does not seem to populate that attribute, so a simple
string search is performed on the commit subject instead.)
2021-01-18 14:57:47 +01:00
Michał Kępień
09964e8085 Skip length check for lines containing references
The Danger GitLab CI job currently flags excessively long lines in
commit log messages.  Exclude lines containing references (i.e. starting
with "[1]", "[2]", etc.) from this check.  This allows e.g. long URLs to
be included in commit log messages without triggering Danger warnings.
2021-01-18 14:57:47 +01:00
Michał Kępień
801d13f62f Only warn about fixup commits once per run
The Danger GitLab CI job currently generates a separate error message
about fixup commits being present in a merge request for every such
commit found.  Prevent that by making it only log that error message
once per run.
2021-01-18 14:57:47 +01:00
Michał Kępień
953c810f41 Flag trailing dots in commit subject lines
Make the Danger GitLab CI job fail when the subject line for any commit
belonging to a merge request contains a trailing dot.
2021-01-18 14:57:47 +01:00
Michał Kępień
ff58ec8cef Flag missing pairwise testing markers
Make the Danger GitLab CI job fail when a merge request adds a new
./configure switch without also adding a "# [pairwise: ...]" marker that
the relevant GitLab CI job uses for preparing the pairwise testing
model.  This helps to ensure that any newly added ./configure switches
are tested by the pairwise testing GitLab CI job.
2021-01-18 14:57:47 +01:00
Michał Kępień
d81ad454cc Suggest adding release notes for customer issues
Make Danger suggest adding a release note to a merge request if the
latter is marked with the "Customer" label but not with the "Release
Notes" label.
2021-01-18 14:57:47 +01:00
Michał Kępień
2f77c7680a Handle [placeholder] CHANGES entries
Make the Danger GitLab CI job fail when a merge request targeting a
branch different than "main" adds any [placeholder] entries to the
CHANGES file.  Prevent Danger from flagging missing GitLab identifiers
for [placeholder] CHANGES entries.
2021-01-18 14:57:47 +01:00
Michał Kępień
97364f5518 Flag missing CVE identifiers
Make Danger ensure that if a merge request fixes a security issue then
that merge request includes a CHANGES entry and a release note, both of
which contain a CVE identifier.
2021-01-18 14:57:47 +01:00
Matthijs Mekking
f5c3863530 Merge branch '2364-cid314969-coverity-deadcode-zoneconf' into 'main'
Fix control flow issue CID 314969 in zoneconf.c

Closes #2364

See merge request isc-projects/bind9!4573
2021-01-18 12:35:30 +00:00
Matthijs Mekking
8df629d0b2 Fix control flow issue CID 314969 in zoneconf.c
Coverity Scan identified the following issue in bin/named/zoneconf.c:

    *** CID 314969:  Control flow issues  (DEADCODE)
    /bin/named/zoneconf.c: 2212 in named_zone_inlinesigning()

    if (!inline_signing && !zone_is_dynamic &&
        cfg_map_get(zoptions, "dnssec-policy", &signing) == ISC_R_SUCCESS &&
        signing != NULL)
    {
        if (strcmp(cfg_obj_asstring(signing), "none") != 0) {
            inline_signing = true;
    >>>     CID 314969:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach the expression ""no"" inside this statement: "dns_zone_log(zone, 1, "inli...".
            dns_zone_log(
                zone, ISC_LOG_DEBUG(1), "inline-signing: %s",
                inline_signing
                ? "implicitly through dnssec-policy"
                : "no");
        } else {
                ...
        }
    }

This is because we first set 'inline_signing = true' and then check
its value in 'dns_zone_log'.
2021-01-18 11:48:09 +01:00
Ondřej Surý
2dd54fa62f Merge branch '2354-placeholder' into 'main'
Add placeholder for GL #2354

Closes #2354

See merge request isc-projects/bind9!4564
2021-01-12 20:19:30 +00:00
Ondřej Surý
4387e4a632 Add placeholder for GL #2354 2021-01-12 21:14:53 +01:00
Matthijs Mekking
739a5ea135 Merge branch '2383-kasp-sig-validity-dnskey-bug' into 'main'
Fix signatures-validity config option

Closes #2383

See merge request isc-projects/bind9!4543
2021-01-12 11:22:22 +00:00
Matthijs Mekking
ad63e9e4f8 Fix signatures-validity config option
KASP was using 'signatures-validity-dnskey' instead of
'signatures-validity'.
2021-01-12 10:54:48 +00:00
Michal Nowak
031cc284fc Merge branch 'mnowak/fix-copyright-date-in-man-pages' into 'main'
Update copyright date in man pages

See merge request isc-projects/bind9!4548
2021-01-11 11:35:57 +00:00
Michal Nowak
358c133ee2 Update copyright date in man pages 2021-01-11 12:27:17 +01:00
Michał Kępień
34cb46aed0 Make sure ddns-confgen man page stays up to date 2021-01-11 12:27:17 +01:00
Matthijs Mekking
98ad051c16 Merge branch 'matthijs-fix-notes' into 'main'
Fix current release notes

See merge request isc-projects/bind9!4549
2021-01-11 11:22:19 +00:00
Matthijs Mekking
aa69753470 Fix current release notes
Remove entry that was release in 9.17.8 already.
2021-01-11 12:21:03 +01:00
Matthijs Mekking
a559faeaec Merge branch '2248-serve-stale-config-defaults' into 'main'
Update serve-stale config defaults

Closes #2248

See merge request isc-projects/bind9!4477
2021-01-11 10:55:53 +00:00
Matthijs Mekking
3be65246f8 Update serve-stale system test with new defaults 2021-01-11 11:13:45 +01:00
Matthijs Mekking
e15a433b23 Update serve-stale config defaults
Change the serve-stale configuration defaults so that they match the
recommendations from RFC 8767.
2021-01-11 11:13:45 +01:00
Michał Kępień
06e4004bf0 Merge branch '606-add-the-isc-dnssec-guide-as-a-bind-9-arm-appendix' into 'main'
Add the ISC DNSSEC Guide as a BIND 9 ARM appendix

Closes #606

See merge request isc-projects/bind9!4471
2021-01-08 12:53:13 +00:00
Michał Kępień
f96e6a1e1d Add the ISC DNSSEC Guide as a BIND 9 ARM appendix
Add the ISC DNSSEC Guide to the BIND 9 ARM in order to include the
former in every BIND release.
2021-01-08 13:12:20 +01:00
Michał Kępień
b65629f7a5 Merge branch '2366-add-CHANGES-entry' into 'main'
Add CHANGES entry for GL #2366

Closes #2366

See merge request isc-projects/bind9!4544
2021-01-08 11:51:03 +00:00
Michał Kępień
995b72d2b7 Add CHANGES entry for GL #2366 2021-01-08 12:48:37 +01:00
Michal Nowak
e797d7caff Merge branch 'marka-explicitly-add-gen.c' into 'main'
Explicitly add gen.c and gen-unix.h to dist

See merge request isc-projects/bind9!4538
2021-01-07 15:24:21 +00:00
Mark Andrews
e583fdfed9 Explicitly add gen.c and gen-unix.h to dist 2021-01-07 16:06:12 +01:00
Mark Andrews
35ccdf0583 Merge branch '1978-cross-compilation-doesn-t-work-in-9-17' into 'main'
Resolve "Cross-compilation doesn’t work in 9.17"

Closes #1978

See merge request isc-projects/bind9!4505
2021-01-07 02:49:41 +00:00
Mark Andrews
33c907b1c6 don't enable maintainer mode when cross compiling 2021-01-07 13:23:18 +11:00
Mark Andrews
96f91d7a53 lib/dns/gen should be built with CC_FOR_BUILD 2021-01-07 13:23:18 +11:00
Evan Hunt
2faa0f6676 Merge branch 'jinmei-bind9-fix-async-hook-assertion-failure' into 'main'
fix async hook assertion failure

Closes #2379

See merge request isc-projects/bind9!4537
2021-01-06 22:02:42 +00:00
Evan Hunt
1079701bd7 CHANGES 2021-01-06 13:26:02 -08:00
JINMEI Tatuya
2ed12d90c9 more s/recurse/async/ for consistency
(no behavior change)
2021-01-06 13:14:13 -08:00
JINMEI Tatuya
d520f01c7b detach fetchhandle before resume query processing
otherwise, another hook async event or DNS recursion would
trigger an assertion failure.
2021-01-06 13:14:13 -08:00
Mark Andrews
5a05cbebc4 Merge branch '2366-bind-9-16-10-build-fails-with-libmaxminddb-1-4-3-2' into 'main'
Resolve "BIND 9.16.10 build fails with libmaxminddb-1.4.3"

Closes #2366

See merge request isc-projects/bind9!4532
2021-01-06 08:03:38 +00:00
Mark Andrews
fcca836a20 Fix 'configure --with-maxminddb=<path>' 2021-01-06 18:05:58 +11:00
Mark Andrews
c668cf6692 Merge branch '2355-incorrect-increment-of-inactive-in-rbtdb-c-maybe_free_rbtdb' into 'main'
Resolve "Incorrect increment of inactive in rbtdb.c:maybe_free_rbtdb()"

Closes #2317 and #2355

See merge request isc-projects/bind9!4504
2021-01-06 05:30:11 +00:00
Mark Andrews
584e589d84 Add release note 2021-01-06 15:28:23 +11:00
Mark Andrews
65702896bd Add CHANGES 2021-01-06 15:27:50 +11:00
Mark Andrews
859d2fdad6 Inactive incorrectly incremented
It is possible to have two threads destroying an rbtdb at the same
time when detachnode() executes and removes the last reference to
a node between exiting being set to true for the node and testing
if the references are zero in maybe_free_rbtdb().  Move NODE_UNLOCK()
to after checking if references is zero to prevent detachnode()
changing the reference count too early.
2021-01-06 15:27:07 +11:00
Matthijs Mekking
d86ad80654 Merge branch '2359-too-many-newlines-dnssec-signzone-verify' into 'main'
Fix dnssec-signzone and -verify logging (again)

Closes #2359

See merge request isc-projects/bind9!4523
2021-01-05 12:40:40 +00:00
Matthijs Mekking
18c62a077e Fix dnssec-signzone and -verify logging (again)
While fixing #2359, 'report()' was changed so that it would print the
newline.

Newlines were missing from the output of 'dnssec-signzone'
and 'dnssec-verify' because change
664b8f04f5 moved the printing from
newlines to the library.

This had to be reverted because this also would print redundant
newlines in logfiles.

While doing the revert, some newlines in 'lib/dns/zoneverify.c'
were left in place, now making 'dnssec-signzone' and 'dnssec-verify'
print too many newlines.

This commit removes those newlines, so that the output looks nice
again.
2021-01-05 12:06:23 +01:00
Mark Andrews
ba4073ef0d Merge branch 'marka-placeholder' into 'main'
placeholder

See merge request isc-projects/bind9!4521
2021-01-05 00:29:26 +00:00
Mark Andrews
27fa7dd73b placeholder 2021-01-05 11:25:38 +11:00
Mark Andrews
8c6db04f60 Merge branch '2359-missing-newlines-in-log-messages-dnssec-signzone-dnssec-verify-c' into 'main'
Resolve "missing newlines in log messages dnssec-signzone/dnssec-verify"

Closes #2359

See merge request isc-projects/bind9!4511
2021-01-04 06:21:13 +00:00
Mark Andrews
244525a303 Add CHANGES 2021-01-04 03:59:10 +00:00
Mark Andrews
c36bd83822 Fix dnssec-signzone and dnssec-verify logging
The newlines need to be appended to the messages generated by report
in a atomic manner.
2021-01-04 03:59:10 +00:00
Mark Andrews
fa0171fdeb Merge branch 'marka-copyrights' into 'main'
update for 2021

See merge request isc-projects/bind9!4518
2021-01-04 03:58:45 +00:00
Mark Andrews
faf9d8beba update for 2021 2021-01-04 11:52:00 +11:00
Matthijs Mekking
6c0e172308 Merge branch 'matthijs-fixup-notes' into 'main'
Matthijs fixup notes

See merge request isc-projects/bind9!4512
2020-12-23 11:04:45 +00:00
Matthijs Mekking
2e7ccecefe Fixup notes
I screwed up the notes in !4474
2020-12-23 12:03:26 +01:00
Matthijs Mekking
1c26ab64a4 Merge branch '1750-dnssec-policy-none' into 'main'
Resolve 'dnssec-policy' graceful transition to insecure

Closes #2341 and #1750

See merge request isc-projects/bind9!4474
2020-12-23 10:55:20 +00:00
Matthijs Mekking
08b6e8c2c9 Add notes for [#2341]
Mention the bugfix in the release.
2020-12-23 11:43:03 +01:00
Matthijs Mekking
7825d8f916 Add documentation and notes for [#1750] 2020-12-23 09:10:13 +01:00
Matthijs Mekking
2fc42b598b Fix a quirky mkeys test failure
The mkeys system test started to fail after introducing support for
zones transitioning to unsigned without going bogus. This is because
there was actually a bug in the code: if you reconfigure a zone and
remove the "auto-dnssec" option, the zone is actually still DNSSEC
maintained. This is because in zoneconf.c there is no call
to 'dns_zone_setkeyopt()' if the configuration option is not used
(cfg_map_get(zoptions, "auto-dnssec", &obj) will return an error).

The mkeys system test implicitly relied on this bug: initially the
root zone is being DNSSEC maintained, then at some point it needs to
reset the root zone in order to prepare for some tests with bad
signatures. Because it needs to inject a bad signature, 'auto-dnssec'
is removed from the configuration.

The test pass but for the wrong reasons:

I:mkeys:reset the root server
I:mkeys:reinitialize trust anchors
I:mkeys:check positive validation (18)

The 'check positive validation' test works because the zone is still
DNSSEC maintained: The DNSSEC records in the signed root zone file on
disk are being ignored.

After fixing the bug/introducing graceful transition to insecure,
the root zone is no longer DNSSEC maintained after the reconfig.

The zone now explicitly needs to be reloaded because otherwise the
'check positive validation' test works against an old version of the
zone (the one with all the revoked keys), and the test will obviously
fail.
2020-12-23 09:02:11 +01:00
Matthijs Mekking
9134100069 Update keymgr to allow transition to insecure mode
The keymgr prevented zones from going to insecure mode. If we
have a policy with an empty key list this is a signal that the zone
wants to go back to insecure mode. In this case allow one extra state
transition to be valid when checking for DNSSEC safety.
2020-12-23 09:02:11 +01:00
Matthijs Mekking
68d715a229 Publish CDS/CDNSKEY Delete Records
Check if zone is transitioning from secure to insecure. If so,
delete the CDS/CDNSKEY records, otherwise make sure they are not
part of the RRset.
2020-12-23 09:02:11 +01:00
Matthijs Mekking
cf420b2af0 Treat dnssec-policy "none" as a builtin zone
Configure "none" as a builtin policy. Change the 'cfg_kasp_fromconfig'
api so that the 'name' will determine what policy needs to be
configured.

When transitioning a zone from secure to insecure, there will be
cases when a zone with no DNSSEC policy (dnssec-policy none) should
be using KASP. When there are key state files available, this is an
indication that the zone once was DNSSEC signed but is reconfigured
to become insecure.

If we would not run the keymgr, named would abruptly remove the
DNSSEC records from the zone, making the zone bogus. Therefore,
change the code such that a zone will use kasp if there is a valid
dnssec-policy configured, or if there are state files available.
2020-12-23 09:02:11 +01:00
Matthijs Mekking
8f2c5e45da Add function to see if dst key uses kasp
For purposes of zones transitioning back to insecure mode, it is
practical to see if related keys have a state file associated.
2020-12-23 09:02:11 +01:00
Matthijs Mekking
756674f6d1 Small adjustments to kasp rndc_checkds function
Slightly better test output, and only call 'load keys' if the
'rndc checkds' call succeeded.
2020-12-23 09:02:11 +01:00
Matthijs Mekking
fa2e4e66b0 Add tests for going from secure to insecure
Add two test zones that will be reconfigured to go insecure, by
setting the 'dnssec-policy' option to 'none'.

One zone was using inline-signing (implicitly through dnssec-policy),
the other is a dynamic zone.

Two tweaks to the kasp system test are required: we need to set
when to except the CDS/CDS Delete Records, and we need to know
when we are dealing with a dynamic zone (because the logs to look for
are slightly different, inline-signing prints "(signed)" after the
zone name, dynamic zones do not).
2020-12-23 09:02:11 +01:00
Mark Andrews
89c35b7164 Merge branch '2245-bind-9-16-8-does-not-honor-cpu-affinity' into 'main'
Resolve "bind 9.16.8 does not honor CPU affinity"

Closes #2245

See merge request isc-projects/bind9!4395
2020-12-22 22:17:12 +00:00
Mark Andrews
fc4af548e7 Add CHANGES and release notes for [GL #2245] 2020-12-23 09:16:26 +11:00
Mark Andrews
09f00ad5dd PYTHON may be null
When Python is not present, PYTHON=$(command -v "@PYTHON@") will exit
the script with 1, prevent that by adding "|| true".
2020-12-23 09:16:26 +11:00
Matthijs Mekking
f1a097964c Add test for cpu affinity
Add a test to check BIND 9 honors CPU affinity mask. This requires
some changes to the start script, to construct the named command.
2020-12-23 09:16:26 +11:00
Mark Andrews
698d9285d4 Only pick CPUs that are part of the existing CPU affinity set when
assigning a thread to a CPU.
2020-12-21 15:09:57 +01:00
Mark Andrews
c850a334d9 Merge branch '2348-bin-tools-mdig-compile-link-failure-because-of-missing-isccfg-dependency-3' into 'main'
Resolve "bin/tools/mdig: compile/link failure because of missing isccfg dependency"

Closes #2348

See merge request isc-projects/bind9!4497
2020-12-21 02:07:45 +00:00
Mark Andrews
77372e9e24 Handle shared library platforms that don't support inter library dependancies 2020-12-21 01:09:45 +00:00
Mark Andrews
08df4f420a Reorder in library dependancy order 2020-12-21 01:09:45 +00:00
Ondřej Surý
6990f0bc3e Merge branch 'jpmens-main-patch-60230' into 'main'
Adjust number of rule types from 13 to the 16 there are. (16 is accurately...

See merge request isc-projects/bind9!4507
2020-12-20 16:50:03 +00:00
JP Mens
4658a1e657 Adjust number of rule types from 13 to the 16 there are. (16 is accurately specified further down in the section.) 2020-12-20 09:56:44 +00:00
Michał Kępień
90972fd782 Merge branch 'v9_17_8-release' into 'main'
Merge 9.17.8 release branch

See merge request isc-projects/bind9!4500
2020-12-16 21:15:24 +00:00
Michał Kępień
7c1c021fc5 Set up release notes for BIND 9.17.9 2020-12-16 22:09:14 +01:00
Michał Kępień
909a84c08b Bump BIND_BASELINE_VERSION for ABI checks 2020-12-16 22:09:14 +01:00
Michał Kępień
843c9144c6 Update BIND version to 9.17.8 2020-12-16 22:05:50 +01:00
Michał Kępień
8e47965f41 Add a CHANGES marker 2020-12-16 22:05:50 +01:00
Michał Kępień
2c44266a5a Update library API versions 2020-12-16 22:05:50 +01:00
Michał Kępień
23861dd8a7 Merge branch 'michal/prepare-release-notes-for-bind-9.17.8' into 'v9_17_8-release'
Prepare release notes for BIND 9.17.8

See merge request isc-private/bind9!224
2020-12-16 22:05:50 +01:00
Michał Kępień
a5f1af7c14 Prepare release notes for BIND 9.17.8 2020-12-16 22:05:50 +01:00
Michał Kępień
af58fcc92a Add release note for GL #2321 2020-12-16 22:05:50 +01:00
Michał Kępień
552418b68c Add release note for GL #1816 2020-12-16 22:05:50 +01:00
Michał Kępień
bdc45c82c5 Reorder release notes 2020-12-16 22:05:50 +01:00
Michał Kępień
0f889b9c7d Tweak and reword release notes 2020-12-16 22:05:50 +01:00
Michał Kępień
fc111622c2 Tweak and reword recent CHANGES entries 2020-12-16 22:05:50 +01:00
Michał Kępień
2ecff5dc43 Fix formatting of "dnssec-policy" documentation 2020-12-16 22:05:50 +01:00
Michal Nowak
ae05e5b691 Miscellaneous minor documentation updates 2020-12-16 22:05:50 +01:00
Michal Nowak
c99fe579b9 Merge branch 'mnowak/fix-rndc-8-reference-in-named-8-man-page' into 'main'
Fix a reference to rndc(8) in named(8) manual page

See merge request isc-projects/bind9!4478
2020-12-14 12:12:54 +00:00
Michal Nowak
befcbcac28 Fix a reference to rndc(8) in named(8) manual page 2020-12-14 13:10:10 +01:00
Ondřej Surý
27f0988b52 Merge branch '2058-print-warning-when-fallback-to-soaserial-increment' into 'main'
Resolve "`dnssec-signzone -N unixtime` behaves like `increment`"

Closes #2058

See merge request isc-projects/bind9!4487
2020-12-12 06:52:50 +00:00
Ondřej Surý
ba887a688c Add CHANGES and release notes for GL #2058 2020-12-12 07:15:45 +01:00
Mark Andrews
eb1b29b19e Update dnssec-signzone -N soa-serial-format description
document the autoincrement when the serial would go backwards.
2020-12-11 10:48:28 +01:00
Ondřej Surý
ef685bab5c Print warning when falling back to increment soa serial method
When using the `unixtime` or `date` method to update the SOA serial,
`named` and `dnssec-signzone` would silently fallback to `increment`
method to prevent the new serial number to be smaller than the old
serial number (using the serial number arithmetics).  Add a warning
message when such fallback happens.
2020-12-11 10:48:28 +01:00
Mark Andrews
3e4f5319ef Merge branch '385-add-a-built-in-ipv4only-arpa-default-zone' into 'main'
Resolve "Add a built-in ipv4only.arpa default zone."

Closes #385

See merge request isc-projects/bind9!479
2020-12-11 06:04:47 +00:00
Mark Andrews
ea0dbb5338 Add CHANGES note 2020-12-11 14:21:54 +11:00
Mark Andrews
88943974de Add release note entry 2020-12-11 14:17:52 +11:00
Mark Andrews
6d10a57397 Add RFC 7050 and RFC 8880 to rfc-compliance 2020-12-11 14:17:52 +11:00
Mark Andrews
64c45abab2 Document ipv4only-enable, ipv4only-contact and ipv4only-server. 2020-12-11 14:17:52 +11:00
Mark Andrews
5684c21bcf Generate PTR records for DNS64 mapped ipv4only.arpa reverses.
Rather than generating CNAMES records pointing into IN-ADDR.ARPA,
generate PTR records directly as the names are known as per RFC 8880.
2020-12-11 14:17:52 +11:00
Mark Andrews
cdfe660326 Checking synthesis of AAAA of builtin ipv4only.arpa 2020-12-11 14:17:47 +11:00
Mark Andrews
c51ef23c22 Implement ipv4only.arpa forward and reverse zones as per RFC 8880. 2020-12-11 14:16:40 +11:00
Mark Andrews
e4557f4203 Merge branch 'marka-placeholder' into 'main'
Add placeholders for [GL !4454] and [GL #2324]

See merge request isc-projects/bind9!4485
2020-12-10 02:43:41 +00:00
Mark Andrews
4257415cfb Add placeholders for [GL !4454] and [GL #2324] 2020-12-10 13:40:56 +11:00
Ondřej Surý
8129fce759 Merge branch 'ondrej/release-notes-doesnt-need-copyright' into 'main'
Remove the requirement for the release notes to have copyright

See merge request isc-projects/bind9!4483
2020-12-09 09:48:53 +00:00
Ondřej Surý
cb30d9892d Remove the requirement for the release notes to have copyright
The release notes doesn't have to have copyright header, it doesn't add
any value there as the release notes are useless outside the project.
2020-12-09 10:38:05 +01:00
Ondřej Surý
afcfb22fc3 Merge branch 'ondrej/clang-format-11' into 'main'
Update the clang version to new stable llvm/clang 11

See merge request isc-projects/bind9!4003
2020-12-08 18:35:25 +00:00
Ondřej Surý
c1eb385fdf Bump the clang version to 11 (stable) 2020-12-08 18:36:23 +01:00
Ondřej Surý
7ba18870dc Reformat sources using clang-format-11 2020-12-08 18:36:23 +01:00
Ondřej Surý
6c28834354 Explicitly configure new clang-format-11 options 2020-12-08 18:40:43 +01:00
Evan Hunt
ff315d328f Merge branch 'placeholder' into 'main'
placeholder for change 5546

See merge request isc-projects/bind9!4473
2020-12-04 19:40:42 +00:00
Evan Hunt
5af9b85eda placeholder for change 5546 2020-12-04 11:37:58 -08:00
Ondřej Surý
c64dfadf32 Merge branch 'ondrej/fix-using-the-load-balanced-sockets' into 'main'
Fix s/HAVE_REUSEPORT_LB/HAVE_SO_REUSEPORT_LB/ typo in #define

See merge request isc-projects/bind9!4472
2020-12-04 13:55:56 +00:00
Ondřej Surý
5caf33feda Fix HAVE_SO_REUSEPORT_LB macro name definition
A typo in macro definition caused the load-balanced sockets to be
disabled even on platforms with existing support for load-balanced
sockets.
2020-12-04 14:45:22 +01:00
Ondřej Surý
7176530ecd Merge branch 'ondrej/fix-the-windows-nchildren-problem' into 'main'
Use sock->nchildren instead of mgr->nworkers when initializing NM

See merge request isc-projects/bind9!4469
2020-12-03 17:42:53 +00:00
Ondřej Surý
87c5867202 Use sock->nchildren instead of mgr->nworkers when initializing NM
On Windows, we were limiting the number of listening children to just 1,
but we were then iterating on mgr->nworkers.  That lead to scheduling
more async_*listen() than actually allocated and out-of-bound read-write
operation on the heap.
2020-12-03 18:03:25 +01:00
Ondřej Surý
ae35829faf Merge branch '2314-fix-datarace-in-nm-connect-functions' into 'main'
Fix datarace when UDP/TCP connect fails and we are in nmthread

Closes #2332 and #2314

See merge request isc-projects/bind9!4468
2020-12-03 14:41:57 +00:00
Ondřej Surý
8e1a05c86b Merge branch 'ondrej/set-openbsd-system-connection-timeout' into 'main'
Configure the system-wide TCP connection timeout on OpenBSD

See merge request isc-projects/bind9!4466
2020-12-03 13:02:57 +00:00
Ondřej Surý
8ff15fc028 Configure the system-wide TCP connection timeout on OpenBSD
As there's no TCP connection timeout socket option that we can use, we
need to configure the TCP connection timeout system-wide in the CI, so
the netmgr unit tests doesn't cause assertion failure when there stuck
outgoing TCP connection waiting for 150 second timeout.
2020-12-03 13:02:36 +00:00
Ondřej Surý
151852f428 Fix datarace when UDP/TCP connect fails and we are in nmthread
When we were in nmthread, the isc__nm_async_<proto>connect() function
executes in the same thread as the isc__nm_<proto>connect() and on a
failure, it would block indefinitely because the failure branch was
setting sock->active to false before the condition around the wait had a
chance to skip the WAIT().

This also fixes the zero system test being stuck on FreeBSD 11, so we
re-enable the test in the commit.
2020-12-03 13:56:34 +01:00
Michał Kępień
bd59843a4b Merge branch '2333-temporarily-disable-the-legacy-test-on-windows' into 'main'
Temporarily disable the "legacy" test on Windows

See merge request isc-projects/bind9!4462
2020-12-03 11:49:43 +00:00
Michał Kępień
6697f6f066 Temporarily disable the "legacy" test on Windows
The current issues with the way dig handles TCP "connection refused"
errors cause the "legacy" system test to consistently fail on Windows
due to the expected strings not being present in dig output.
Temporarily disable the "legacy" system test on Windows by moving it
from the PARALLEL_COMMON list to the PARALLEL_UNIX list until the
situation is rectified.
2020-12-03 12:48:43 +01:00
Ondřej Surý
48a52234ee Merge branch '2137-so_reuseport-doesn-t-distribute-udp-queries-to-multiple-netmgr-workers-on-macos' into 'main'
Distribute queries among threads even on platforms without SO_REUSEPORT_LB

Closes #2137

See merge request isc-projects/bind9!4459
2020-12-03 09:58:02 +00:00
Ondřej Surý
5e1a23a1b6 Add CHANGES and release note for GL #2137 2020-12-03 09:23:24 +01:00
Ondřej Surý
4adeaab73d Add FreeBSD connection timeout socket option
On FreeBSD, the option to configure connection timeout is called
TCP_KEEPINIT, use it to configure the connection timeout there.

This also fixes the dangling socket problems in the unit test, so
re-enable them.
2020-12-03 09:23:24 +01:00
Ondřej Surý
d0f5407825 Merge branch '2332-fix-use-after-free-in-tcpdns_send_direct' into 'main'
Don't use stack allocated buffer for uv_write()

Closes #2332

See merge request isc-projects/bind9!4465
2020-12-03 08:21:10 +00:00
Ondřej Surý
1d066e4bc5 Distribute queries among threads even on platforms without lb sockets
On platforms without load-balancing socket all the queries would be
handle by a single thread.  Currently, the support for load-balanced
sockets is present in Linux with SO_REUSEPORT and FreeBSD 12 with
SO_REUSEPORT_LB.

This commit adds workaround for such platforms that:

1. setups single shared listening socket for all listening nmthreads for
   UDP, TCP and TCPDNS netmgr transports

2. Calls uv_udp_bind/uv_tcp_bind on the underlying socket just once and
   for rest of the nmthreads only copy the internal libuv flags (should
   be just UV_HANDLE_BOUND and optionally UV_HANDLE_IPV6).

3. start reading on UDP socket or listening on TCP socket

The load distribution among the nmthreads is uneven, but it's still
better than utilizing just one thread for processing all the incoming
queries
2020-12-03 09:20:33 +01:00
Ondřej Surý
94afea9325 Don't use stack allocated buffer for uv_write()
On FreeBSD, the stack is destroyed more aggressively than on Linux and
that revealed a bug where we were allocating the 16-bit len for the
TCPDNS message on the stack and the buffer got garbled before the
uv_write() sendback was executed.  Now, the len is part of the uvreq, so
we can safely pass it to the uv_write() as the req gets destroyed after
the sendcb is executed.
2020-12-03 08:58:16 +01:00
Artem Boldariev
aefe2b9958 Merge branch 'artem/random-additions-to-the-gitignore' into 'main'
Some small, random additions to the .gitignore.

See merge request isc-projects/bind9!4463
2020-12-02 22:25:55 +00:00
Artem Boldariev
e6ac4480a4 Some small, random additions to the .gitignore.
Ignores some auxiliary files generated/used by the following tools: -

- clangd
- GNU Global
- Emacs
2020-12-03 00:21:23 +02:00
Michał Kępień
81c080e429 Merge branch '2328-make-netmgr-initialize-and-cleanup-winsock-itself' into 'main'
Make netmgr initialize and cleanup Winsock itself

Closes #2328

See merge request isc-projects/bind9!4458
2020-12-02 21:39:14 +00:00
Michał Kępień
88f96faba8 Make netmgr initialize and cleanup Winsock itself
On Windows, WSAStartup() needs to be called to initialize Winsock before
any sockets are created or else socket() calls will return error code
10093 (WSANOTINITIALISED).  Since BIND's Network Manager is intended to
work as a reusable networking library, it should take care of calling
WSAStartup() - and its cleanup counterpart, WSACleanup() - itself rather
than relying on external code to do it.  Add the necessary WSAStartup()
and WSACleanup() calls to isc_nm_start() and isc_nm_destroy(),
respectively.
2020-12-02 22:36:23 +01:00
Michał Kępień
dc2e1dea86 Extend log message for unexpected socket() errors
Make sure the error code is included in the message logged for
unexpected socket creation errors in order to facilitate troubleshooting
on Windows.
2020-12-02 22:36:23 +01:00
Michal Nowak
d7f2db0e91 Merge branch '2327-error-uv_wrap-h-no-such-file-or-directory-on-unit-gcc-tarball-ci-job' into 'main'
Add uv_wrap.h to libisctest_la_SOURCES

Closes #2327

See merge request isc-projects/bind9!4451
2020-12-02 15:09:45 +00:00
Michal Nowak
8499825525 Add uv_wrap.h to libisctest_la_SOURCES
uv_wrap.h is included in tcp_test.c and udp_test.c and therefore should
be listed in lib/isc/tests/Makefile.am, otherwise unit test run from
distribution tarball fails to compile:

tcp_test.c:37:10: fatal error: uv_wrap.h: No such file or directory
 #include "uv_wrap.h"
          ^~~~~~~~~~~

udp_test.c:37:10: fatal error: uv_wrap.h: No such file or directory
 #include "uv_wrap.h"
          ^~~~~~~~~~~
2020-12-02 16:08:18 +01:00
Ondřej Surý
a6acff5328 Merge branch '2250-dns-flag-day-2020-revert-nocookie-udp-size' into 'main'
Resolve "DNS Flag Day 2020 - EDNS buffer size configuring does not work anymore"

Closes #2250

See merge request isc-projects/bind9!4449
2020-12-02 11:01:16 +00:00
Ondřej Surý
c7d81f12f8 Add CHANGES and release not for GL #2250 2020-12-02 11:07:01 +01:00
Ondřej Surý
79c196fc77 Change the default value for nocookie-udp-size back to 4096
The DNS Flag Day 2020 reduced all the EDNS buffer sizes to 1232.  In
this commit, we revert the default value for nocookie-udp-size back to
4096 because the option is too obscure and most people don't realize
that they also need to change this configuration option in addition to
max-udp-size.
2020-12-02 11:06:42 +01:00
Ondřej Surý
a958d646ee Merge branch '2320-avoid-netievent-allocations-if-not-needed' into 'main'
Avoid netievent allocations when the callbacks can be called directly

Closes #2320

See merge request isc-projects/bind9!4452
2020-12-02 10:04:25 +00:00
Ondřej Surý
4e80190663 Add CHANGES note for GL #2320 2020-12-02 10:14:31 +01:00
Ondřej Surý
2e1dd56d0b Fix the data race in accessing the isc_nm_t timers
The following TSAN report about accessing the mgr timers (mgr->init,
mgr->idle, mgr->keepalive and mgr->advertised) has been fixed in this
commit:

    ==================
    WARNING: ThreadSanitizer: data race (pid=2746)
    Read of size 4 at 0x7b440008a948 by thread T18:
    #0 isc__nm_tcpdns_read /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:849:25 (libisc.so.1706+0x2ba0f)
    #1 isc_nm_read /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1679:3 (libisc.so.1706+0x22258)
    #2 tcpdns_connect_connect_cb /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:363:2 (tcpdns_test+0x4bc5fb)
    #3 isc__nm_async_connectcb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1816:2 (libisc.so.1706+0x228c9)
    #4 isc__nm_connectcb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1791:3 (libisc.so.1706+0x22713)
    #5 tcpdns_connect_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:343:2 (libisc.so.1706+0x2d89d)
    #6 uv__stream_connect /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1381:5 (libuv.so.1+0x27c18)
    #7 uv__stream_io /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1298:5 (libuv.so.1+0x25977)
    #8 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11 (libuv.so.1+0x2e795)
    #9 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:385:5 (libuv.so.1+0x158ec)
    #10 nm_thread /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:530:11 (libisc.so.1706+0x1c94a)

    Previous write of size 4 at 0x7b440008a948 by main thread:
    #0 isc_nm_settimeouts /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:490:12 (libisc.so.1706+0x1dda5)
    #1 tcpdns_recv_two /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:601:2 (tcpdns_test+0x4bad0e)
    #2 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70be)
    #3 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    Location is heap block of size 281 at 0x7b440008a840 allocated by main thread:
    #0 malloc <null> (tcpdns_test+0x42864b)
    #1 default_memalloc /home/ondrej/Projects/bind9/lib/isc/mem.c:713:8 (libisc.so.1706+0x6d261)
    #2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:622:8 (libisc.so.1706+0x69b9c)
    #3 isc___mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:1044:9 (libisc.so.1706+0x6d379)
    #4 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:2432:10 (libisc.so.1706+0x6889e)
    #5 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:203:8 (libisc.so.1706+0x1c219)
    #6 nm_setup /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:244:11 (tcpdns_test+0x4baaa4)
    #7 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70fd)
    #8 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    Thread T18 'isc-net-0000' (tid=3513, running) created by main thread at:
    #0 pthread_create <null> (tcpdns_test+0x429e7b)
    #1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:73:8 (libisc.so.1706+0x8476a)
    #2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:271:3 (libisc.so.1706+0x1c66a)
    #3 nm_setup /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:244:11 (tcpdns_test+0x4baaa4)
    #4 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70fd)
    #5 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    SUMMARY: ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:849:25 in isc__nm_tcpdns_read
    ==================
    ThreadSanitizer: reported 1 warnings
2020-12-02 10:14:31 +01:00
Ondřej Surý
d6d2fbe0e9 Avoid netievent allocations when the callbacks can be called directly
After turning the users callbacks to be asynchronous, there was a
visible performance drop.  This commit prevents the unnecessary
allocations while keeping the code paths same for both asynchronous and
synchronous calls.

The same change was done to the isc__nm_udp_{read,send} as those two
functions are in the hot path.
2020-12-02 09:45:05 +01:00
Ondřej Surý
886eb5722d Merge branch '2321-netmgr-v2' into 'main'
Refactor netmgr and add more unit tests

Closes #2321, #2061, #1920, #2034, #2266, #2318, #2283, and #2194

See merge request isc-projects/bind9!4444
2020-12-01 17:07:06 +00:00
Ondřej Surý
3e5ee16eb6 Disable the new netmgr tests on non-Linux platforms
The new netmgr tests are not-yet fine-tuned for non-Linux platforms.
Disable them now, so we can move forward and fix the tests of *BSD
in the next iteration.

This commit will get reverted when we add support for netmgr
multi-threading.
2020-12-01 17:24:15 +01:00
Ondřej Surý
0f57732d13 Skip the zero, xfer and ixfr tests on non-Linux platforms
Due to the platform differences, on non-Linux platforms, the xfer and
ixfr tests fails and zero test gets stuck.

This commit will get reverted when we add support for netmgr
multi-threading.
2020-12-01 17:24:06 +01:00
Ondřej Surý
0ba697fe8c The cmocka.h header MUST be included before isc/util.h gets included
The isc/util.h header redefine the DbC checks (REQUIRE, INSIST, ...)  to
be cmocka "fake" assertions.  However that means that cmocka.h needs to
be included after UNIT_TESTING is defined but before isc/util.h is
included.  Because isc/util.h is included in most of the project headers
this means that the sequence MUST be:

    #define UNIT_TESTING
    #include <cmocka.h>

    #include <isc/_anything_.h>

See !2204 for other header requirements for including cmocka.h.
2020-12-01 16:47:25 +01:00
Ondřej Surý
c26a2ea134 Add release note for known issue #2137 2020-12-01 16:47:25 +01:00
Ondřej Surý
9811361c4b Add CHANGES note for multiple netmgr issues 2020-12-01 16:47:25 +01:00
Ondřej Surý
634bdfb16d Refactor netmgr and add more unit tests
This is a part of the works that intends to make the netmgr stable,
testable, maintainable and tested.  It contains a numerous changes to
the netmgr code and unfortunately, it was not possible to split this
into smaller chunks as the work here needs to be committed as a complete
works.

NOTE: There's a quite a lot of duplicated code between udp.c, tcp.c and
tcpdns.c and it should be a subject to refactoring in the future.

The changes that are included in this commit are listed here
(extensively, but not exclusively):

* The netmgr_test unit test was split into individual tests (udp_test,
  tcp_test, tcpdns_test and newly added tcp_quota_test)

* The udp_test and tcp_test has been extended to allow programatic
  failures from the libuv API.  Unfortunately, we can't use cmocka
  mock() and will_return(), so we emulate the behaviour with #define and
  including the netmgr/{udp,tcp}.c source file directly.

* The netievents that we put on the nm queue have variable number of
  members, out of these the isc_nmsocket_t and isc_nmhandle_t always
  needs to be attached before enqueueing the netievent_<foo> and
  detached after we have called the isc_nm_async_<foo> to ensure that
  the socket (handle) doesn't disappear between scheduling the event and
  actually executing the event.

* Cancelling the in-flight TCP connection using libuv requires to call
  uv_close() on the original uv_tcp_t handle which just breaks too many
  assumptions we have in the netmgr code.  Instead of using uv_timer for
  TCP connection timeouts, we use platform specific socket option.

* Fix the synchronization between {nm,async}_{listentcp,tcpconnect}

  When isc_nm_listentcp() or isc_nm_tcpconnect() is called it was
  waiting for socket to either end up with error (that path was fine) or
  to be listening or connected using condition variable and mutex.

  Several things could happen:

    0. everything is ok

    1. the waiting thread would miss the SIGNAL() - because the enqueued
       event would be processed faster than we could start WAIT()ing.
       In case the operation would end up with error, it would be ok, as
       the error variable would be unchanged.

    2. the waiting thread miss the sock->{connected,listening} = `true`
       would be set to `false` in the tcp_{listen,connect}close_cb() as
       the connection would be so short lived that the socket would be
       closed before we could even start WAIT()ing

* The tcpdns has been converted to using libuv directly.  Previously,
  the tcpdns protocol used tcp protocol from netmgr, this proved to be
  very complicated to understand, fix and make changes to.  The new
  tcpdns protocol is modeled in a similar way how tcp netmgr protocol.
  Closes: #2194, #2283, #2318, #2266, #2034, #1920

* The tcp and tcpdns is now not using isc_uv_import/isc_uv_export to
  pass accepted TCP sockets between netthreads, but instead (similar to
  UDP) uses per netthread uv_loop listener.  This greatly reduces the
  complexity as the socket is always run in the associated nm and uv
  loops, and we are also not touching the libuv internals.

  There's an unfortunate side effect though, the new code requires
  support for load-balanced sockets from the operating system for both
  UDP and TCP (see #2137).  If the operating system doesn't support the
  load balanced sockets (either SO_REUSEPORT on Linux or SO_REUSEPORT_LB
  on FreeBSD 12+), the number of netthreads is limited to 1.

* The netmgr has now two debugging #ifdefs:

  1. Already existing NETMGR_TRACE prints any dangling nmsockets and
     nmhandles before triggering assertion failure.  This options would
     reduce performance when enabled, but in theory, it could be enabled
     on low-performance systems.

  2. New NETMGR_TRACE_VERBOSE option has been added that enables
     extensive netmgr logging that allows the software engineer to
     precisely track any attach/detach operations on the nmsockets and
     nmhandles.  This is not suitable for any kind of production
     machine, only for debugging.

* The tlsdns netmgr protocol has been split from the tcpdns and it still
  uses the old method of stacking the netmgr boxes on top of each other.
  We will have to refactor the tlsdns netmgr protocol to use the same
  approach - build the stack using only libuv and openssl.

* Limit but not assert the tcp buffer size in tcp_alloc_cb
  Closes: #2061
2020-12-01 16:47:07 +01:00
Mark Andrews
3a36662207 Merge branch '2305-adjust-recursion-limits' into 'main'
Adjust recursion limits

Closes #2305

See merge request isc-projects/bind9!4424
2020-12-01 13:51:16 +00:00
Mark Andrews
ab0bf49203 Adjust default value of "max-recursion-queries"
Since the queries sent towards root and TLD servers are now included in
the count (as a result of the fix for CVE-2020-8616),
"max-recursion-queries" has a higher chance of being exceeded by
non-attack queries.  Increase its default value from 75 to 100.
2020-12-01 23:47:23 +11:00
Mark Andrews
1d11013a18 Merge branch '2315-bind-9-11-22-9-11-25-fails-to-build-for-aep-hsm-native-pkcs11' into 'main'
Resolve "BIND 9.11.22 - 9.11.25 fails to build for AEP HSM native pkcs11"

Closes #2315

See merge request isc-projects/bind9!4441
2020-12-01 12:15:57 +00:00
Mark Andrews
356243aaec Add release note for [GL #2315] 2020-12-01 10:52:41 +01:00
Mark Andrews
11a3545e32 Add CHANGES 2020-12-01 10:46:58 +11:00
Mark Andrews
49b9219bb3 Fix misplaced declaration 2020-12-01 10:46:58 +11:00
Michal Nowak
90298dfc18 Merge branch 'mnowak/drop_headerdep_test.sh.in' into 'main'
Drop bin/tests/headerdep_test.sh.in, revise OPTIONS.md

See merge request isc-projects/bind9!4401
2020-11-27 12:14:29 +00:00
Michal Nowak
9567cefd39 Drop bin/tests/headerdep_test.sh.in
The bin/tests/headerdep_test.sh script has not been updated since it was
first created and it cannot be used as-is with the current BIND source
code.  Better tools (e.g. "include-what-you-use") emerged since the
script was committed back in 2000, so instead of trying to bring it up
to date, remove it from the source repository.
2020-11-27 13:11:41 +01:00
Michal Nowak
e0e644352c Revise OPTIONS.md
- The STD_CDEFINES build-time variable was dropped when the build
    system was migrated to Automake.  CPPFLAGS is the variable which
    should now be used for setting preprocessor macros.

  - Sort the list of preprocessor macros which affect BIND behavior.
    Remove ISC_BUFFER_USEINLINE from the list as it can be controlled
    using its relevant ./configure option (--enable-buffer-useinline).
    Rename NS_RUN_PID_DIR to NAMED_RUN_PID_DIR to match the source code.

  - Tweak Markdown formatting.
2020-11-27 13:11:41 +01:00
Mark Andrews
3d7a0e7af7 Merge branch '2275-tighten-dns-cookie-response-handling' into 'main'
Resolve "Tighten DNS COOKIE response handling"

Closes #2275

See merge request isc-projects/bind9!4391
2020-11-26 21:10:28 +00:00
Mark Andrews
d0dd71380b Add release note for [GL #2275] 2020-11-26 20:48:46 +00:00
Mark Andrews
15e7a4b047 Add CHANGES note for [GL #2275] 2020-11-26 20:48:46 +00:00
Mark Andrews
304df53991 Add comment about cookie sizes 2020-11-26 20:48:46 +00:00
Mark Andrews
bd9155590e Check that missing cookies are handled 2020-11-26 20:48:46 +00:00
Mark Andrews
0e3b1f5a25 Tighten DNS COOKIE response handling
Fallback to TCP when we have already seen a DNS COOKIE response
from the given address and don't have one in this UDP response. This
could be a server that has turned off DNS COOKIE support, a
misconfigured anycast server with partial DNS COOKIE support, or a
spoofed response. Falling back to TCP is the correct behaviour in
all 3 cases.
2020-11-26 20:48:46 +00:00
Michal Nowak
8fed3b3e17 Merge branch '2224-fixup-core-back-traces' into 'main'
Resolve "Fixup core back traces."

Closes #2224

See merge request isc-projects/bind9!4279
2020-11-26 17:03:43 +00:00
Michal Nowak
6428fc26af Write traceback file to the same directory as core file
The traceback files could overwrite each other on systems which do not
use different core dump file names for different processes.  Prevent
that by writing the traceback file to the same directory as the core
dump file.

These changes still do not prevent the operating system from overwriting
a core dump file if the same binary crashes multiple times in the same
directory and core dump files are named identically for different
processes.
2020-11-26 18:01:34 +01:00
Mark Andrews
0f0a006c7e Unify whitespace in bin/tests/system/run.sh.in
Replace tabs with spaces to make whitespace consistent across the entire
bin/tests/system/run.sh.in script.
2020-11-26 18:01:33 +01:00
Diego dos Santos Fronza
9d56be5ab2 Merge branch '2281-cid-313104-error-handling-issues-in-lib-ns-query-c' into 'main'
Resolve "CID 313104: Error handling issues in lib/ns/query.c"

Closes #2281

See merge request isc-projects/bind9!4416
2020-11-26 14:57:02 +00:00
Diego Fronza
95add01643 Silence coverity warnings in query.c
Return value of dns_db_getservestalerefresh() and
dns_db_getservestalettl() functions were previously unhandled.

This commit purposefully ignore those return values since there is
no side effect if those results are != ISC_R_SUCCESS, it also supress
Coverity warnings.
2020-11-26 14:55:14 +00:00
Matthijs Mekking
5434529a77 Merge branch '1620-dnssec-policy-nsec3-saltlen-followup' into 'main'
Add one missing check to nsec3param unit test

See merge request isc-projects/bind9!4432
2020-11-26 14:40:34 +00:00
Matthijs Mekking
dff01583db Add one missing check to nsec3param unit test
Caught this missing check with clang-build while backporting #1620
to the v9_16 branch.
2020-11-26 12:40:22 +00:00
Michał Kępień
dcb8394c0c Merge branch 'michal/use-proper-cmocka-macros-for-pointer-checks' into 'main'
Use proper cmocka macros for pointer checks

See merge request isc-projects/bind9!4415
2020-11-26 12:12:02 +00:00
Michał Kępień
f440600126 Use proper cmocka macros for pointer checks
Make sure pointer checks in unit tests use cmocka assertion macros
dedicated for use with pointers instead of those dedicated for use with
integers or booleans.
2020-11-26 13:10:40 +01:00
Michał Kępień
1c9273a40b Merge branch '2310-update-release-checklist' into 'main'
Update release checklist

See merge request isc-projects/bind9!4425
2020-11-26 12:08:09 +00:00
Michał Kępień
a83f838a6f Update release checklist
Add an item to the release checklist to make sure the man pages
generated during release preparation are formatted correctly.
2020-11-26 13:07:19 +01:00
Michał Kępień
07c0db2661 Merge branch 'v9_17_7-release' into 'main'
Merge 9.17.7 release branch

See merge request isc-projects/bind9!4426
2020-11-26 11:19:45 +00:00
Michał Kępień
2011a86881 Set up release notes for BIND 9.17.8 2020-11-26 12:16:49 +01:00
Michał Kępień
2bb071ec06 Bump BIND_BASELINE_VERSION for ABI checks 2020-11-26 12:16:49 +01:00
Michał Kępień
09aa4a564d Update BIND version to 9.17.7 2020-11-26 12:12:17 +01:00
Michał Kępień
7475ba842d Add a CHANGES marker 2020-11-26 12:12:17 +01:00
Michał Kępień
2bb0a5dcdb Update library API versions 2020-11-26 12:12:17 +01:00
Michał Kępień
1328a7cbda Merge branch 'michal/prepare-release-notes-for-bind-9.17.7' into 'v9_17_7-release'
Prepare release notes for BIND 9.17.7

See merge request isc-private/bind9!220
2020-11-26 12:12:17 +01:00
Michał Kępień
3a447d02b4 Prepare release notes for BIND 9.17.7 2020-11-26 12:12:17 +01:00
Michał Kępień
42cf594b37 Add release note for GL #2244 2020-11-26 12:12:17 +01:00
Michał Kępień
563f8a78e9 Add release note for GL #2236 2020-11-26 12:12:17 +01:00
Michał Kępień
572bc05aca Add release note for GL #1736 2020-11-26 12:12:17 +01:00
Michał Kępień
a4dea3c70c Reorder release notes 2020-11-26 12:12:17 +01:00
Michał Kępień
59221c4b3b Tweak and reword release notes 2020-11-26 12:12:17 +01:00
Michał Kępień
429cac9d1a Tweak and reword recent CHANGES entries 2020-11-26 12:12:17 +01:00
Michał Kępień
3f7ddefdd1 Remove any mention of "make depend" from README.md 2020-11-26 12:12:17 +01:00
Matthijs Mekking
84bf7ce4a6 Merge branch '1620-dnssec-policy-nsec3-saltlen' into 'main'
Resolve "dnssec-policy NSEC3 support"

Closes #1620

See merge request isc-projects/bind9!4299
2020-11-26 10:12:26 +00:00
Matthijs Mekking
64db30942d Add NSEC3PARAM unit test, refactor zone.c
Add unit test to ensure the right NSEC3PARAM event is scheduled in
'dns_zone_setnsec3param()'.  To avoid scheduling and managing actual
tasks, split up the 'dns_zone_setnsec3param()' function in two parts:

1. 'dns__zone_lookup_nsec3param()' that will check if the requested
   NSEC3 parameters already exist, and if a new salt needs to be
   generated.

2. The actual scheduling of the new NSEC3PARAM event (if needed).
2020-11-26 10:43:59 +01:00
Matthijs Mekking
6b5d7357df Detect NSEC3 salt collisions
When generating a new salt, compare it with the previous NSEC3
paremeters to ensure the new parameters are different from the
previous ones.

This moves the salt generation call from 'bin/named/*.s' to
'lib/dns/zone.c'. When setting new NSEC3 parameters, you can set a new
function parameter 'resalt' to enforce a new salt to be generated. A
new salt will also be generated if 'salt' is set to NULL.

Logging salt with zone context can now be done with 'dnssec_log',
removing the need for 'dns_nsec3_log_salt'.
2020-11-26 10:43:59 +01:00
Matthijs Mekking
3b4c764b43 Add zone context to "generated salt" logs 2020-11-26 10:43:59 +01:00
Matthijs Mekking
7878f300ff Move logging of salt in separate function
There may be a desire to log the salt without losing the context
of log module, level, and category.
2020-11-26 10:43:59 +01:00
Matthijs Mekking
6f97bb6b1f Change nsec3param salt config to saltlen
Upon request from Mark, change the configuration of salt to salt
length.

Introduce a new function 'dns_zone_checknsec3aram' that can be used
upon reconfiguration to check if the existing NSEC3 parameters are
in sync with the configuration. If a salt is used that matches the
configured salt length, don't change the NSEC3 parameters.
2020-11-26 10:43:59 +01:00
Matthijs Mekking
00c5dabea3 Add check for NSEC3 and key algorithms
NSEC3 is not backwards compatible with key algorithms that existed
before the RFC 5155 specification was published.
2020-11-26 10:43:59 +01:00
Matthijs Mekking
f10790b02d Disable one nsec3 test due to GL #2216
This known bug makes the test fail. There is no trivial fix so disable
test case for now.
2020-11-26 10:43:59 +01:00
Matthijs Mekking
9adad77ac3 Add changes and notes for kasp NSEC3 support
This feature is news worthy.
2020-11-26 10:43:58 +01:00
Matthijs Mekking
a5b45bdd03 Add some NSEC3 optout tests
Make sure that just changing the optout value recreates the chain.
2020-11-26 10:43:27 +01:00
Matthijs Mekking
7039c5f805 Check nsec3param configuration values
Check 'nsec3param' configuration for the number of iterations.  The
maximum number of iterations that are allowed are based on the key
size (see https://tools.ietf.org/html/rfc5155#section-10.3).

Check 'nsec3param' configuration for correct salt. If the string is
not "-" or hex-based, this is a bad salt.
2020-11-26 10:43:27 +01:00
Matthijs Mekking
eae9a6d297 Don't use 'rndc signing' with kasp
The 'rndc signing' command allows you to manipulate the private
records that are used to store signing state. Don't use these with
'dnssec-policy' as such manipulations may violate the policy (if you
want to change the NSEC3 parameters, change the policy and reconfig).
2020-11-26 10:43:27 +01:00
Matthijs Mekking
ba8128ea00 Fix a reconfig bug wrt inline-signing
When doing 'rndc reconfig', named may complain about a zone not being
reusable because it has a raw version of the zone, and the new
configuration has not set 'inline-signing'. However, 'inline-signing'
may be implicitly true if a 'dnssec-policy' is used for the zone, and
the zone is not dynamic.

Improve the check in 'named_zone_reusable'.  Create a new function for
checking 'inline-signing' configuration that matches existing code in
'bin/named/server.c'.
2020-11-26 10:43:27 +01:00
Matthijs Mekking
114af58ee2 Support for NSEC3 in dnssec-policy
Implement support for NSEC3 in dnssec-policy.  Store the configuration
in kasp objects. When configuring a zone, call 'dns_zone_setnsec3param'
to queue an nsec3param event. This will ensure that any previous
chains will be removed and a chain according to the dnssec-policy is
created.

Add tests for dnssec-policy zones that uses the new 'nsec3param'
option, as well as changing to new values, changing to NSEC, and
changing from NSEC.
2020-11-26 10:43:27 +01:00
Matthijs Mekking
f7ca96c805 Add kasp nsec3param configuration
Add configuration and documentation on how to enable NSEC3 when
using dnssec-policy for signing your zones.
2020-11-26 10:43:27 +01:00
Matthijs Mekking
84a4273074 Move generate_salt function to lib/dns/nsec3
We will be using this function also on reconfig, so it should have
a wider availability than just bin/named/server.
2020-11-26 10:43:27 +01:00
Michał Kępień
aa3b489216 Merge branch 'michal/fix-cppcheck-2.2-issues' into 'main'
Fix cppcheck 2.2 issues

See merge request isc-projects/bind9!4292
2020-11-25 12:16:53 +00:00
Michał Kępień
ea54a932d2 Convert add_quota() to a function
cppcheck 2.2 reports the following false positive:

    lib/isc/tests/quota_test.c:71:21: error: Array 'quotas[101]' accessed at index 110, which is out of bounds. [arrayIndexOutOfBounds]
     isc_quota_t *quotas[110];
                        ^

The above is not even an array access, so this report is obviously
caused by a cppcheck bug.  Yet, it seems to be triggered by the presence
of the add_quota() macro, which should really be a function.  Convert
the add_quota() macro to a function in order to make the code cleaner
and to prevent the above cppcheck 2.2 false positive from being
triggered.
2020-11-25 12:45:47 +01:00
Michał Kępień
0b6216d1c7 Silence cppcheck 2.2 false positive in udp_recv()
cppcheck 2.2 reports the following false positive:

    lib/dns/dispatch.c:1239:14: warning: Either the condition 'resp==NULL' is redundant or there is possible null pointer dereference: resp. [nullPointerRedundantCheck]
     if (disp != resp->disp) {
                 ^
    lib/dns/dispatch.c:1210:11: note: Assuming that condition 'resp==NULL' is not redundant
     if (resp == NULL) {
              ^
    lib/dns/dispatch.c:1239:14: note: Null pointer dereference
     if (disp != resp->disp) {
                 ^

Apparently this version of cppcheck gets confused about conditional
"goto" statements because line 1239 can never be reached if 'resp' is
NULL.

Move a code block to prevent the above false positive from being
reported without affecting the processing logic.
2020-11-25 12:45:47 +01:00
Michał Kępień
d9701e22b5 Teach cppcheck that fatal() does not return
cppcheck is not aware that the bin/dnssec/dnssectool.c:fatal() function
does not return.  This triggers certain cppcheck 2.2 false positives,
for example:

    bin/dnssec/dnssec-signzone.c:3471:13: warning: Either the condition 'ndskeys==8' is redundant or the array 'dskeyfile[8]' is accessed at index 8, which is out of bounds. [arrayIndexOutOfBoundsCond]
       dskeyfile[ndskeys++] = isc_commandline_argument;
                ^
    bin/dnssec/dnssec-signzone.c:3468:16: note: Assuming that condition 'ndskeys==8' is not redundant
       if (ndskeys == MAXDSKEYS) {
                   ^
    bin/dnssec/dnssec-signzone.c:3471:13: note: Array index out of bounds
       dskeyfile[ndskeys++] = isc_commandline_argument;
                ^

    bin/dnssec/dnssec-signzone.c:772:20: warning: Either the condition 'l->hashbuf==NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
     memset(l->hashbuf + l->entries * l->length, 0, l->length);
                       ^
    bin/dnssec/dnssec-signzone.c:768:18: note: Assuming that condition 'l->hashbuf==NULL' is not redundant
      if (l->hashbuf == NULL) {
                     ^
    bin/dnssec/dnssec-signzone.c:772:20: note: Null pointer addition
     memset(l->hashbuf + l->entries * l->length, 0, l->length);
                       ^

Instead of suppressing all such warnings individually, conditionally
define a preprocessor macro which prevents them from being triggered.
2020-11-25 12:45:47 +01:00
Michał Kępień
f06dfe0397 Remove cppcheck 2.0 false positive workarounds
The cppcheck bug which commit 481fa34e50
works around was fixed in cppcheck 2.2.  Drop the relevant hack from the
definition of the cppcheck GitLab CI job.
2020-11-25 12:45:47 +01:00
Evan Hunt
7d1e2e6692 Merge branch '2141-asynchrony-support-for-bind-9-query-plugins' into 'main'
Resolve "asynchrony support for BIND 9 query plugins"

Closes #2141

See merge request isc-projects/bind9!4407
2020-11-25 00:59:19 +00:00
Evan Hunt
5285443c5f CHANGES 2020-11-24 15:11:57 -08:00
Evan Hunt
c3a90b1d2c create system test with asynchronous plugin
the test-async plugin uses ns_query_hookasync() at the
NS_QUERY_DONE_SEND hook point to call an asynchronous function.
the only effect is to change the query response code to "NOTIMP",
so we can confirm that the hook ran and resumed correctly.
2020-11-24 15:11:39 -08:00
JINMEI Tatuya
75cdd758ed implementation of hook-based asynchronous functionality
previously query plugins were strictly synchrounous - the query
process would be interrupted at some point, data would be looked
up or a change would be made, and then the query processing would
resume immediately.

this commit enables query plugins to initiate asynchronous processes
and resume on a completion event, as with recursion.
2020-11-24 15:11:39 -08:00
JINMEI Tatuya
9c8dae041d ns_query refactoring for hook-based recursion
several small changes to query processing to make it easier to
use hook-based recursion (and other asynchronous functionlity)
later.

- recursion quota check is now a separate function,
  check_recursionquota(), which is called by ns_query_recurse().
- pass isc_result to query_nxdomain() instead of bool.
  the value of 'empty_wild' will be determined in the function
  based on the passed result.  this is similar to query_nodata(),
  and makes the signatures of the two functions more consistent.
- pass the current 'result' value into plugin hooks.
2020-11-24 15:11:39 -08:00
Mark Andrews
bdb8729f88 Merge branch '1154-add-dns64-prefix-discover-support' into 'main'
Resolve "Add dns64 prefix discover support"

Closes #1154

See merge request isc-projects/bind9!2178
2020-11-24 21:45:56 +00:00
Mark Andrews
fbad04a51a Add release note 2020-11-25 08:25:29 +11:00
Mark Andrews
9cb3294ff6 add CHANGES 2020-11-25 08:25:29 +11:00
Mark Andrews
9a224a3c27 add +dns64prefix to dig to display any DNS64 prefixes at IPV4ONLY.ARPA 2020-11-25 08:25:29 +11:00
Mark Andrews
38d6f68de4 add dns_dns64_findprefix 2020-11-25 08:25:29 +11:00
Michal Nowak
9c8dd9b678 Merge branch '1730-clean-up-no-op-ac_subst-calls' into 'main'
Remove unused Autoconf variables

See merge request isc-projects/bind9!4402
2020-11-24 17:33:51 +00:00
Michał Kępień
f8d155a9ef Refactor libidn2 detection code
Make the code block handling the --with-libidn2=/path/to/libidn2 form of
the --with-libidn2 build-time option behave more similarly to the
PKG_CHECK_MODULES() macro.
2020-11-24 14:51:51 +01:00
Michal Nowak
ef18d9251e Remove unused DLZ_DRIVER_MYSQL_* build variables
The DLZ_DRIVER_MYSQL_INCLUDES and DLZ_DRIVER_MYSQL_LIBS build variables
are not used anywhere.  Remove their definitions and the associated
AC_SUBST() calls.
2020-11-24 14:51:51 +01:00
Michal Nowak
6db5088e17 Remove AC_SUBST() calls from AX_LIB_LMDB()
LMDB build variables are already substituted by AC_SUBST() calls in
configure.ac and therefore the latter should not be duplicated in the
AX_LIB_LMDB() helper macro.
2020-11-24 14:51:51 +01:00
Michał Kępień
856a52a672 Merge branch 'michal/update-release-checklist' into 'main'
Update release checklist

See merge request isc-projects/bind9!4406
2020-11-24 12:57:47 +00:00
Michał Kępień
9b9f7b09f2 Update release checklist
Apply a number of tweaks to the release checklist in order to make it
better reflect the current release process.
2020-11-24 13:50:57 +01:00
Evan Hunt
dbb4c3a0e8 Merge branch '2288-dig-interrupt-crash' into 'main'
Resolve ""dig" crashes when interrupted while waiting for a TCP connection"

Closes #2288

See merge request isc-projects/bind9!4397
2020-11-23 20:28:46 +00:00
Evan Hunt
17145e4ef4 dig could crash on interrupt
dig could crash if it was shut down by an interrupt while a connection
was pending.
2020-11-23 20:00:04 +00:00
Michał Kępień
a4487688dd Merge branch 'michal/enable-stress-tests-to-be-run-on-demand' into 'main'
Enable "stress" tests to be run on demand

See merge request isc-projects/bind9!4313
2020-11-23 10:51:32 +00:00
Michał Kępień
f23094223e Enable "stress" tests to be run on demand
The "stress" test can be run in different ways, depending on:

  - the tested scenario (authoritative, recursive),
  - the operating system used (Linux, FreeBSD),
  - the architecture used (amd64, arm64).

Currently, all supported "stress" test variants are automatically
launched for all scheduled pipelines and for pipelines started for tags;
there is no possibility of running these tests on demand, which could be
useful in certain circumstances.

Employ the "only:variables" key to enable fine-grained control over the
list of "stress" test jobs to be run for a given pipeline.  Three CI
variables are used to specify the list of "stress" test jobs to create:

  - BIND_STRESS_TEST_MODE: specifies the test mode to use; must be
    explicitly set in order for any "stress" test job to be created;
    allowed values are: "authoritative", "recursive",

  - BIND_STRESS_TEST_OS: specifies the operating system to run the test
    on; allowed values are: "linux", "freebsd"; defaults to "linux", may
    be overridden at pipeline creation time,

  - BIND_STRESS_TEST_ARCH: specifies the architecture to run the test
    on; allowed values are: "amd64", "arm64"; defaults to "amd64", may
    be overridden at pipeline creation time.

Since case-insensitive regular expressions are used for determining
which jobs to run, every variable described above may contain multiple
values.  For example, setting the BIND_STRESS_TEST_MODE variable to
"authoritative,recursive" will cause the "stress" test to be run in both
supported scenarios (either on the default OS/architecture combination,
i.e. Linux/amd64, or, if the relevant variables are explicitly
specified, the requested OS/architecture combinations).
2020-11-23 11:46:50 +01:00
Mark Andrews
79a1074cbe Merge branch 'matthijs-fix-echo_i-in-auth-test' into 'main'
Fix syntax in echo_i messages

See merge request isc-projects/bind9!4400
2020-11-19 23:41:22 +00:00
Matthijs Mekking
53188daf5b Fix syntax in echo_i messages
It's either "record returns" or "records return".
2020-11-19 11:40:19 +01:00
Mark Andrews
41b13dab64 Merge branch 'marka-fix-stop.sh' into 'main'
bin/tests/system/stop.sh was not working

See merge request isc-projects/bind9!4399
2020-11-19 05:19:56 +00:00
Mark Andrews
da1243fe9d bin/tests/system/stop.sh was not working
It failed to export builddir srcdir resulting in stop.pl failing
when these where looked for in the environment.
2020-11-19 16:15:26 +11:00
Mark Andrews
3065d54142 Merge branch '2280-check-dname-handling-when-qtype-is-cname-any' into 'main'
Resolve "Check DNAME handling when QTYPE is CNAME/ANY"

Closes #2280

See merge request isc-projects/bind9!4393
2020-11-18 23:48:30 +00:00
Mark Andrews
e980affba0 Fix DNAME when QTYPE is CNAME or ANY
The synthesised CNAME is not supposed to be followed when the
QTYPE is CNAME or ANY as the lookup is satisfied by the CNAME
record.
2020-11-19 10:18:01 +11:00
Ondřej Surý
ff2bc7891e Merge branch '2255-dig-crashed-in-tcp_connected-on-openbsd' into 'main'
Turn all the callback to be always asynchronous

Closes #2255

See merge request isc-projects/bind9!4386
2020-11-11 21:48:13 +00:00
Ondřej Surý
a49d88568f Turn all the callback to be always asynchronous
When calling the high level netmgr functions, the callback would be
sometimes called synchronously if we catch the failure directly, or
asynchronously if it happens later.  The synchronous call to the
callback could create deadlocks as the caller would not expect the
failed callback to be executed directly.
2020-11-11 22:15:40 +01:00
Diego dos Santos Fronza
fece7a4881 Merge branch '2066-fix-serve-stale' into 'main'
Resolve "Fix serve-stale so that it is usable when needed"

Closes #2066

See merge request isc-projects/bind9!4273
2020-11-11 16:19:10 +00:00
Diego Fronza
1ba2215c29 Update ARM and other documents 2020-11-11 12:53:24 -03:00
Diego Fronza
b4c997537b Add CHANGES and release notes entry 2020-11-11 12:53:24 -03:00
Diego Fronza
8cca23a147 Adjusted test to match new rndc serve-stale status output 2020-11-11 12:53:24 -03:00
Diego Fronza
d4142d2bed Output 'stale-refresh-time' value on rndc serve-stale status 2020-11-11 12:53:24 -03:00
Diego Fronza
581e2a8f28 Check 'stale-refresh-time' when sharing cache between views
This commit ensures that, along with previous restrictions, a cache is
shareable between views only if their 'stale-refresh-time' value are
equal.
2020-11-11 12:53:24 -03:00
Matthijs Mekking
e99671e8dd Add two more system tests for stale-refresh-time
Add one test that checks the behavior when serve-stale is enabled
via configuration (as opposed to enabled via rndc).

Add one test that checks the behavior when stale-refresh-time is
disabled (set to 0).
2020-11-11 12:53:24 -03:00
Matthijs Mekking
dee778de12 Change serve-stale test stale-answer-ttl
Using a 'stale-answer-ttl' the same value as the authoritative ttl
value makes it hard to differentiate between a response from the
stale cache and a response from the authoritative server.

Change the stale-answer-ttl from 2 to 4, so that it differs from the
authoritative ttl.
2020-11-11 12:53:24 -03:00
Diego Fronza
cc70ea860b Wait for multiple parallel dig commands to fully finish
The strategy of running many dig commands in parallel and
waiting for the respective output files to be non empty was
resulting in random test failures, hard to reproduce, where
it was possible that the subsequent reading of the files could
have been failing due to the file's content not being fully flushed.

Instead of checking if output files are non empty, we now wait
for the dig processes to finish.
2020-11-11 12:53:24 -03:00
Diego Fronza
a3dbc5fb05 Added system test for stale-refresh-time
This test works as follow:
- Query for data.example rrset.
- Sleep until its TTL expires (2 secs).
- Disable authoritative server.
- Query for data.example again.
- Since server is down, answer come from stale cache, which has
  a configured stale-answer-ttl of 3 seconds.
- Enable authoritative server.
- Query for data.example again
- Since last query before activating authoritative server failed, and
  since 'stale-refresh-time' seconds hasn't elapsed yet, answer should
  come from stale cache and not from the authoritative server.
2020-11-11 12:53:24 -03:00
Diego Fronza
fc074f15a8 Adjusted ancient rrset system test
Before the stale-refresh-time feature, the system test for ancient rrset
was somewhat based on the average time the previous tests and queries
were taking, thus not very precise.

After the addition of stale-refresh-time the system test for ancient
rrset started to fail since the queries for stale records (low
max-stale-ttl) were not taking the time to do a full resolution
anymore, since the answers now were coming from the cache (because the
rrset were stale and within stale-refresh-time window after the
previous resolution failure).

To handle this, the correct time to wait before rrset become ancient is
calculated from max-stale-ttl configuration plus the TTL set in the
rrset used in the tests (ans2/ans.pl).

Then before sending queries for ancient rrset, we check if we need to
sleep enough to ensure those rrset will be marked as ancient.
2020-11-11 12:53:24 -03:00
Diego Fronza
5e47a13fd0 Warn if 'stale-refresh-time' < 30 (default)
RFC 8767 recommends that attempts to refresh to be done no more
frequently than every 30 seconds.

Added check into named-checkconf, which will warn if values below the
default are found in configuration.

BIND will also log the warning during loading of configuration in the
same fashion.
2020-11-11 12:53:23 -03:00
Diego Fronza
4827ad0ec4 Add stale-refresh-time option
Before this update, BIND would attempt to do a full recursive resolution
process for each query received if the requested rrset had its ttl
expired. If the resolution fails for any reason, only then BIND would
check for stale rrset in cache (if 'stale-cache-enable' and
'stale-answer-enable' is on).

The problem with this approach is that if an authoritative server is
unreachable or is failing to respond, it is very unlikely that the
problem will be fixed in the next seconds.

A better approach to improve performance in those cases, is to mark the
moment in which a resolution failed, and if new queries arrive for that
same rrset, try to respond directly from the stale cache, and do that
for a window of time configured via 'stale-refresh-time'.

Only when this interval expires we then try to do a normal refresh of
the rrset.

The logic behind this commit is as following:

- In query.c / query_gotanswer(), if the test of 'result' variable falls
  to the default case, an error is assumed to have happened, and a call
  to 'query_usestale()' is made to check if serving of stale rrset is
  enabled in configuration.

- If serving of stale answers is enabled, a flag will be turned on in
  the query context to look for stale records:
  query.c:6839
  qctx->client->query.dboptions |= DNS_DBFIND_STALEOK;

- A call to query_lookup() will be made again, inside it a call to
  'dns_db_findext()' is made, which in turn will invoke rbdb.c /
  cache_find().

- In rbtdb.c / cache_find() the important bits of this change is the
  call to 'check_stale_header()', which is a function that yields true
  if we should skip the stale entry, or false if we should consider it.

- In check_stale_header() we now check if the DNS_DBFIND_STALEOK option
  is set, if that is the case we know that this new search for stale
  records was made due to a failure in a normal resolution, so we keep
  track of the time in which the failured occured in rbtdb.c:4559:
  header->last_refresh_fail_ts = search->now;

- In check_stale_header(), if DNS_DBFIND_STALEOK is not set, then we
  know this is a normal lookup, if the record is stale and the query
  time is between last failure time + stale-refresh-time window, then
  we return false so cache_find() knows it can consider this stale
  rrset entry to return as a response.

The last additions are two new methods to the database interface:
- setservestale_refresh
- getservestale_refresh

Those were added so rbtdb can be aware of the value set in configuration
option, since in that level we have no access to the view object.
2020-11-11 12:53:23 -03:00
Michal Nowak
04d9ac6321 Merge branch '1913-remove-unused-leftovers' into 'main'
Resolve "Remove unused leftovers"

Closes #1913

See merge request isc-projects/bind9!4366
2020-11-11 09:26:09 +00:00
Michal Nowak
096b0b2195 Add CHANGES entry 2020-11-11 10:09:36 +01:00
Michal Nowak
a0d359bbfa Add unused headers check to CI 2020-11-11 10:08:12 +01:00
Michal Nowak
9088052225 Drop unused headers 2020-11-11 10:08:12 +01:00
Michal Nowak
221d5049b1 Merge branch 'mnowak/drop-OPENSSL_LIB' into 'main'
Drop @OPENSSL_LIB@ in bigkey

See merge request isc-projects/bind9!4383
2020-11-11 08:52:01 +00:00
Michal Nowak
24d5052e74 Drop @OPENSSL_LIB@ in bigkey
@OPENSSL_LIB@ was brought back with the
2f9f6f1fac revert.
2020-11-11 09:49:40 +01:00
Mark Andrews
b88a0d7cf5 Merge branch '2211-tsan-error-previous_closest_nsec-dns_rbt_findnode-vs-subtractrdataset' into 'main'
Resolve "tsan error previous_closest_nsec(dns_rbt_findnode) vs subtractrdataset"

Closes #2211

See merge request isc-projects/bind9!4259
2020-11-10 21:16:05 +00:00
Mark Andrews
244f84a84b Address TSAN error between dns_rbt_findnode() and subtractrdataset().
Having dns_rbt_findnode() in previous_closest_nsec() check of
node->data is a optimisation that triggers a TSAN error with
subtractrdataset().  find_closest_nsec() still needs to check if
the NSEC record are active or not and look for a earlier NSEC records
if it isn't.  Set DNS_RBTFIND_EMPTYDATA so node->data isn't referenced
without the node lock being held.

    WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1 (mutexes: read M1, read M2):
    #0 dns_rbt_findnode lib/dns/rbt.c:1708
    #1 previous_closest_nsec lib/dns/rbtdb.c:3760
    #2 find_closest_nsec lib/dns/rbtdb.c:3942
    #3 zone_find lib/dns/rbtdb.c:4091
    #4 dns_db_findext lib/dns/db.c:536
    #5 query_lookup lib/ns/query.c:5582
    #6 ns__query_start lib/ns/query.c:5505
    #7 query_setup lib/ns/query.c:5229
    #8 ns_query_start lib/ns/query.c:11380
    #9 ns__client_request lib/ns/client.c:2166
    #10 processbuffer netmgr/tcpdns.c:230
    #11 dnslisten_readcb netmgr/tcpdns.c:309
    #12 read_cb netmgr/tcp.c:832
    #13 <null> <null>
    #14 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M3):
    #0 subtractrdataset lib/dns/rbtdb.c:7133
    #1 dns_db_subtractrdataset lib/dns/db.c:742
    #2 diff_apply lib/dns/diff.c:368
    #3 dns_diff_apply lib/dns/diff.c:459
    #4 do_one_tuple lib/dns/update.c:247
    #5 update_one_rr lib/dns/update.c:275
    #6 delete_if_action lib/dns/update.c:689
    #7 foreach_rr lib/dns/update.c:471
    #8 delete_if lib/dns/update.c:716
    #9 dns_update_signaturesinc lib/dns/update.c:1948
    #10 receive_secure_serial lib/dns/zone.c:15637
    #11 dispatch lib/isc/task.c:1152
    #12 run lib/isc/task.c:1344
    #13 <null> <null>

    Location is heap block of size 130 at 0x000000000028 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 create_node lib/dns/rbt.c:2239
    #9 dns_rbt_addnode lib/dns/rbt.c:1202
    #10 dns_rbtdb_create lib/dns/rbtdb.c:8668
    #11 dns_db_create lib/dns/db.c:118
    #12 receive_secure_db lib/dns/zone.c:16154
    #13 dispatch lib/isc/task.c:1152
    #14 run lib/isc/task.c:1344
    #15 <null> <null>

    Mutex M1 (0x000000000040) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8527
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Mutex M2 (0x000000000044) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8600
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Mutex M3 (0x000000000046) created at:
    #0 pthread_rwlock_init <null>
    #1 isc_rwlock_init lib/isc/rwlock.c:39
    #2 dns_rbtdb_create lib/dns/rbtdb.c:8600
    #3 dns_db_create lib/dns/db.c:118
    #4 receive_secure_db lib/dns/zone.c:16154
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_nm_start netmgr/netmgr.c:232
    #3 create_managers bin/named/main.c:909
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    SUMMARY: ThreadSanitizer: data race lib/dns/rbt.c:1708 in dns_rbt_findnode
2020-11-10 20:17:48 +00:00
Michal Nowak
79d5a67e24 Merge branch 'mnowak/revert-4350' into 'main'
Revert "Drop bigkey"

See merge request isc-projects/bind9!4369
2020-11-10 16:51:47 +00:00
Michal Nowak
2f9f6f1fac Revert "Drop bigkey"
This reverts commit ef6703351a.

It is believed that the bigkey test is still useful.
2020-11-10 17:34:05 +01:00
Matthijs Mekking
d8caccb9a5 Merge branch 'matthijs-query-header-cleanup' into 'main'
Cleanup query.h duplicate definitions

See merge request isc-projects/bind9!4381
2020-11-10 15:01:42 +00:00
Matthijs Mekking
b7856d2675 Cleanup duplicate definitions in query.h 2020-11-10 14:42:47 +00:00
Ondřej Surý
152f49b6c3 Merge branch '1840-netmgr-tls-layer' into 'main'
Server-side TLS support in netmgr

Closes #1840

See merge request isc-projects/bind9!3532
2020-11-10 14:12:53 +00:00
Witold Kręcicki
bc19dc84ba CHANGES note 2020-11-10 14:20:31 +01:00
Ondřej Surý
fa424225af netmgr: Add additional safeguards to netmgr/tls.c
This commit adds couple of additional safeguards against running
sends/reads on inactive sockets.  The changes was modeled after the
changes we made to netmgr/tcpdns.c
2020-11-10 14:17:20 +01:00
Witold Kręcicki
d2a2804069 DoT test
Preliminary test for DNSoverTLS - add the dot-port template to system
tests, test a simple query to an authoritative.
2020-11-10 14:17:18 +01:00
Witold Kręcicki
e94afa5bc0 Add 'ephemeral' keyword to 'tls' option in listen-on directive.
listen-on tls ephemeral will cause named to create an ephemeral
TLS self-signed certificate and key, stored only in memory.
2020-11-10 14:17:14 +01:00
Witold Kręcicki
2cfc8a45a4 Shutdown interface if we can't listen on it to avoid shutdown hang 2020-11-10 14:17:09 +01:00
Witold Kręcicki
f68fe9ff14 Fix a startup/shutdown crash in ns_clientmgr_create 2020-11-10 14:17:05 +01:00
Witold Kręcicki
3c00fb71db isc_nm_tls_create_server_ctx can create ephemeral certs
In-memory ephemeral certs creation for easy DoT/DoH deployment.
2020-11-10 14:17:04 +01:00
Witold Kręcicki
38b78f59a0 Add DoT support to bind
Parse the configuration of tls objects into SSL_CTX* objects.  Listen on
DoT if 'tls' option is setup in listen-on directive.  Use DoT/DoH ports
for DoT/DoH.
2020-11-10 14:16:55 +01:00
Evan Hunt
8ed005f924 add parser support for TLS configuration options
This commit adds stub parser support and tests for:
- "tls" statement, specifying key and cert.
- an optional "tls" keyvalue in listen-on statements for DoT
  configuration.

Documentation for these options has also been added to the ARM, but
needs further work.
2020-11-10 14:16:49 +01:00
Evan Hunt
8886569e9d report peer address in TLS mode, and specify protocol
- peer address was not being reported correctly by "dig +tls"
- the protocol used is now reported in the dig output: UDP, TCP, or TLS.
2020-11-10 14:16:41 +01:00
Witold Kręcicki
03b2c948b6 add "dig +tls"
- add "+[no]tls" option to dig to enable TLS mode
- override the default port number in dig from 53 to 853 when using TLS
2020-11-10 14:16:35 +01:00
Witold Kręcicki
b2ee0e9dc3 netmgr: server-side TLS support
Add server-side TLS support to netmgr - that includes moving some of the
isc_nm_ functions from tcp.c to a wrapper in netmgr.c calling a proper
tcp or tls function, and a new isc_nm_listentls() function.

Add DoT support to tcpdns - isc_nm_listentlsdns().
2020-11-10 14:16:27 +01:00
Mark Andrews
fb8f1e49ab Merge branch '2252-ns_client_sendraw-is-missing-dnstap-support' into 'main'
Resolve "ns_client_sendraw() is missing DNSTAP support."

Closes #2252

See merge request isc-projects/bind9!4368
2020-11-10 06:41:08 +00:00
Mark Andrews
157e3a98f2 Add CHANGES not for [GL #2252] 2020-11-10 06:15:46 +00:00
Mark Andrews
2b7128fede Check that DNSTAP captures forwarded UPDATE responses 2020-11-10 06:15:46 +00:00
Mark Andrews
b09727a765 Implement DNSTAP support in ns_client_sendraw()
ns_client_sendraw() is currently only used to relay UPDATE
responses back to the client.  dns_dt_send() is called with
this assumption.
2020-11-10 06:15:46 +00:00
Mark Andrews
a66b638d41 Merge branch '2259-zone_namerd_tostr-called-w-o-lock-being-held' into 'main'
Resolve "zone_namerd_tostr called w/o lock being held"

Closes #2259

See merge request isc-projects/bind9!4376
2020-11-10 06:14:21 +00:00
Mark Andrews
84f43903da Lock zone before calling zone_namerd_tostr()
WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1:
    #0 inline_raw lib/dns/zone.c:1375
    #1 zone_namerd_tostr lib/dns/zone.c:15316
    #2 dns_zone_name lib/dns/zone.c:15391
    #3 xfrin_log lib/dns/xfrin.c:1605
    #4 xfrin_destroy lib/dns/xfrin.c:1477
    #5 dns_xfrin_detach lib/dns/xfrin.c:739
    #6 xfrin_connect_done lib/dns/xfrin.c:970
    #7 tcpdnsconnect_cb netmgr/tcpdns.c:786
    #8 tcp_connect_cb netmgr/tcp.c:292
    #9 <null> <null>
    #10 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M1):
    #0 zone_shutdown lib/dns/zone.c:14462
    #1 dispatch lib/isc/task.c:1152
    #2 run lib/isc/task.c:1344
    #3 <null> <null>

    Location is heap block of size 2769 at 0x000000000013 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 dns_zone_create lib/dns/zone.c:984
    #9 configure_zone bin/named/server.c:6502
    #10 do_addzone bin/named/server.c:13391
    #11 named_server_changezone bin/named/server.c:13788
    #12 named_control_docommand bin/named/control.c:207
    #13 control_command bin/named/controlconf.c:392
    #14 dispatch lib/isc/task.c:1152
    #15 run lib/isc/task.c:1344
    #16 <null> <null>
2020-11-10 15:56:13 +11:00
Mark Andrews
bd3cc31f2b Merge branch '2230-legacy-system-test-fails-intermittently' into 'main'
Resolve "legacy system test fails intermittently"

Closes #2207

See merge request isc-projects/bind9!4295
2020-11-09 22:18:29 +00:00
Mark Andrews
06db7a153f Retry edns512 multiple times to trigger fallback to edns at 512
We want named to have slow resolving (multiple retries) when
there is a very small working MTU
2020-11-09 21:45:44 +00:00
Mark Andrews
b5145f46dc Fixup legacy test to account for not falling back to EDNS 512 lookups.
The SOA lookup for edns512 could succeed if the negative response
for ns.edns512/AAAA completed before all the edns512/SOA query
attempts are made.  The ns.edns512/AAAA lookup returns tc=1 and
the SOA record is cached after processing the NODATA response.
Lookup a TXT record at edns512 and look it up instead of the
SOA record.

Removed 'checking that TCP failures do not influence EDNS statistics
in the ADB' as it is no longer appropriate.
2020-11-09 21:45:44 +00:00
Evan Hunt
45f1df5412 Merge branch '2258-xfrin-shutdown-race' into 'main'
address some possible shutdown races in xfrin

Closes #2258

See merge request isc-projects/bind9!4374
2020-11-09 21:45:14 +00:00
Evan Hunt
e011521ef1 address some possible shutdown races in xfrin
there were two failures during observed in testing, both occurring
when 'rndc halt' was run rather than 'rndc stop' - the latter dumps
zone contents to disk and presumably introduced enough delay to
prevent the races:

- a failure when the zone was shut down and called dns_xfrin_detach()
  before the xfrin had finished connecting; the connect timeout
  terminated without detaching its handle
- a failure when the tcpdns socket timer fired after the outerhandle
  had already been cleared.

this commit incidentally addresses a failure observed in mutexatomic
due to a variable having been initialized incorrectly.
2020-11-09 12:33:37 -08:00
Ondřej Surý
ce58a149ce Merge branch '1840-netmgr-tls-layer-link-with-libssl' into 'main'
Add support to link with libssl

See merge request isc-projects/bind9!4373
2020-11-09 15:38:22 +00:00
Ondřej Surý
127ba7e930 Add libssl libraries to Windows build
This commit extends the perl Configure script to also check for libssl
in addition to libcrypto and change the vcxproj source files to link
with both libcrypto and libssl.
2020-11-09 16:00:28 +01:00
Witold Kręcicki
9a2065e2f4 autoconf: link with libssl
This is prerequisite to adding DoT and DoH support to BIND 9.
2020-11-09 15:59:01 +01:00
Ondřej Surý
c62f3af395 Merge branch '2016-xfrin-netmgr' into 'main'
use netmgr for xfrin

Closes #2016

See merge request isc-projects/bind9!4246
2020-11-09 14:45:17 +00:00
Evan Hunt
42d94614e4 CHANGES and release notes 2020-11-09 14:50:48 +01:00
Ondřej Surý
934d6c6f92 Refactor the xfrin reference counting
Previously, the xfrin object relied on four different reference counters
(`refs`, `connects`, `sends`, `recvs`) and destroyed the xfrin object
only if all of them were zero.  This commit reduces the reference
counting only to the `references` (renamed from `refs`) counter.  We
keep the existing `connects`, `sends` and `recvs` as safe guards, but
they are not formally needed.
2020-11-09 14:50:48 +01:00
Evan Hunt
1170a52f48 remove isc_task from xfrin
since the network manager is now handling timeouts, xfrin doesn't
need an isc_task object.

it may be necessary to revert this later if we find that it's
important for zone_xfrdone() to be executed in the zone task context.
currently things seem to be working well without that, though.
2020-11-09 13:45:43 +01:00
Evan Hunt
a8d28881d1 remove isc_timer from xfrin
the network manager can now handle timeouts, so it isn't
necessary for xfrin to use isc_timer for the purpose any
longer.
2020-11-09 13:45:43 +01:00
Evan Hunt
49d53a4aa9 use netmgr for xfrin
Use isc_nm_tcpdnsconnect() in xfrin.c for zone transfers.
2020-11-09 13:45:43 +01:00
Michal Nowak
917e365159 Merge branch 'mnowak/test-with-DDEBUG' into 'main'
Enable debug build on Tumbleweed in CI

See merge request isc-projects/bind9!4367
2020-11-09 12:36:24 +00:00
Michal Nowak
59a09b5db8 Enable debug build on Tumbleweed in CI 2020-11-09 13:34:51 +01:00
Evan Hunt
f6d967db54 Merge branch '2140-dig-netmgr' into 'main'
Resolve "convert dig and friends to use the netmgr"

Closes #2140

See merge request isc-projects/bind9!4115
2020-11-08 22:06:04 +00:00
Evan Hunt
3ff0ee568d CHANGES and release note 2020-11-08 13:36:12 -08:00
Ondřej Surý
8af7f81d6c netmgr: Don't crash if socket() returns an error in udpconnect
socket() call can return an error - e.g. EMFILE, so we need to handle
this nicely and not crash.

Additionally wrap the socket() call inside a platform independent helper
function as the Socket data type on Windows is unsigned integer:

> This means, for example, that checking for errors when the socket and
> accept functions return should not be done by comparing the return
> value with –1, or seeing if the value is negative (both common and
> legal approaches in UNIX). Instead, an application should use the
> manifest constant INVALID_SOCKET as defined in the Winsock2.h header
> file.
2020-11-08 13:36:12 -08:00
Ondřej Surý
b558eca633 dig: Refactor recv_done, so there's less exit paths
The recv_done() callback had many exit paths with different conditions,
and every path had it's own set of destructors.  The refactored code now
has unified exit path with descriptive goto labels matching the intent:

 - cancel_lookup
 - next_lookup
 - detach_query
 - keep_query

The only exception to the rule is check_for_more_data() path, where the
part of the query gets reused, so the query->readhandle and query gets
detached on it's own, and by going to the keep_query, we are just
skipping calling the destructors again.
2020-11-08 13:36:12 -08:00
Ondřej Surý
050258bda4 netmgr: Always load the result from async socket
Because we use result earlier for setting the loadbalancing on the
socket, we could be left with a ISC_R_NOTIMPLEMENTED value stored in the
variable and when the UDP connection would succeed, we would
errorneously return this value instead of ISC_R_SUCCESS.
2020-11-07 21:12:08 +01:00
Evan Hunt
88f5f3915b dig: prevent query from being detached if udpconnect fails on first attempt
FreeBSD sometimes returns spurious errors in UDP connect() attempts,
so we try a few times before giving up. However, each failed attempt
triggers a call to udp_ready() in dighost.c, and that was causing
the query object to be detached prematurely.
2020-11-07 21:11:58 +01:00
Ondřej Surý
6d63ffe46d dig: add reference counter to the dig_lookup_t object
Sometimes, the dig_lookup_t could be destroyed before the final
send_done() callback was be called, leading to dereferencing an
already freed dig_lookup_t object.  By making the dig_lookup_t
reference counted, we are ensuring that it won't be freed until
the last reference (from dig_query_t .lookup) is released.
2020-11-07 21:11:42 +01:00
Ondřej Surý
ecd70eb4b5 dig: add new debugging output
track creation, attachment and detachment of dig_query objects.
2020-11-07 20:49:53 +01:00
Ondřej Surý
a2bc627c30 dig: add reference counting to dig_query_t
add a reference counter to the dig_query object to ensure
it isn't freed until the last caller releases it.
2020-11-07 20:49:53 +01:00
Evan Hunt
5307bf64ce reduce timing dependencies in system tests
one of the tests in the resolver system test depends on dig
getting no response to its first two query attempts, and SERVFAIL
on the third after resolution times out.

using a 5-second retry timer in dig means the SERVFAIL response
could occur while dig is discarding the second query and preparing
to send the third. in this case the server's response could be
missed.  shortening the retry interval to 4 seconds ensures that
dig has already sent the third query when the SERVFAIL response
arrives.

also, the serve-stale system test could fail due to a race in which
it timed out after waiting ten seconds for a file to be written, and
the dig timeout was just a bit longer. this is addressed by extending
the dig timeout to 11 seconds for this test.
2020-11-07 20:49:53 +01:00
Evan Hunt
ea2b04c361 dig: use new netmgr timeout mechanism
use isc_nmhandle_settimeout() to set read/recv timeouts, and get rid
of connect_timeout() and related functions in dighost.c.
2020-11-07 20:49:53 +01:00
Evan Hunt
4be63c5b00 add isc_nmhandle_settimeout() function
this function sets the read timeout for the socket associated
with a netmgr handle and, if the timer is running, resets it.
for TCPDNS sockets it also sets the read timeout and resets the
timer on the outer TCP socket.
2020-11-07 20:49:53 +01:00
Evan Hunt
e12dc1faa2 dig: setup IDN whenever printing a message
because dig now uses the netmgr, printing of response messages
happens in a different thread than setup. the IDN output filtering
procedure, which set using dns_name_settotextfilter(), is stored as
thread-local data, and so if it's set during setup, it won't be
accessible when printing. we now set it immediately before printing,
in the same thread, and clear it immedately afterward.
2020-11-07 20:49:53 +01:00
Evan Hunt
cde27d2d2b dig: remove "+unexpected" option
The network manager does not support returning UDP datagrams to
clients from unexpected sources; it is therefore not possible for
dig to accept them.  The "+[no]unexpected" option has therefore
been removed from the dig command and its documentation.
2020-11-07 20:49:53 +01:00
Evan Hunt
94b7988efb convert dig/host/nslookup to use the netmgr
use netmgr functions instead of isc_socket for dig, host, and
nslookup. note that `dig +unexpected` is not working.
2020-11-07 20:49:53 +01:00
Ondřej Surý
2191d2bf44 fix nmhandle attach/detach errors in tcpdnsconnect_cb()
we need to attach to the statichandle when connecting TCPDNS sockets,
same as with UDP.
2020-11-07 20:49:53 +01:00
Artem Boldariev
d48e040035 Merge branch 'artem/fix-build-with-DEBUG-defined' into 'main'
Fix build with DEBUG defined (-DDEBUG)

See merge request isc-projects/bind9!4351
2020-11-06 10:40:33 +00:00
Artem Boldariev
a236151608 Fix build with DEBUG defined (-DDEBUG)
The problem was introduced by commit 98b55eb4.
2020-11-06 12:20:41 +02:00
Mark Andrews
9a5aa8cf3a Merge branch '2239-fctx-id-is-uninitialized-and-effectively-unused' into 'main'
Resolve "fctx:id is uninitialized and effectively unused"

Closes #2239

See merge request isc-projects/bind9!4346
2020-11-06 02:26:11 +00:00
Mark Andrews
ed783a8139 remove fctx:id field 2020-11-06 01:54:44 +00:00
Michal Nowak
d7308c86a6 Merge branch '1728-drop-big-key' into 'main'
Drop bigkey

Closes #1728

See merge request isc-projects/bind9!4350
2020-11-05 16:25:32 +00:00
Michal Nowak
ef6703351a Drop bigkey
The 'bigkey' binary is not used anywhere, therefor it's sources should
be removed.
2020-11-05 17:17:14 +01:00
Michał Kępień
cec8493af5 Merge branch 'michal/miscellaneous-windows-tweaks' into 'main'
Miscellaneous Windows tweaks

Closes images#10

See merge request isc-projects/bind9!4354
2020-11-05 14:06:43 +00:00
Michał Kępień
64a091d587 Fix detection of CMake-built libuv on Windows
As of libuv 1.36.0, CMake is the only supported build method for libuv
on Windows.  Account for that fact by adjusting the relevant paths and
DLL file names used in the win32utils/Configure script.  Update
Windows-specific documentation accordingly.
2020-11-05 11:45:19 +01:00
Michał Kępień
004ca913f2 Use "image" key in Windows GitLab CI job templates
Our GitLab Runner Custom executor scripts now use the "image" key for
determining the Windows Docker image to use for a given CI job.  Update
.gitlab-ci.yml to reflect that change.
2020-11-05 11:45:19 +01:00
Michał Kępień
f54e2e623b Merge branch 'michal/rpz-system-test-fix-fast-expire' into 'main'
"rpz" system test: fix intermittent false positive (expired RPZ zone)

See merge request isc-projects/bind9!4357
2020-11-05 07:03:30 +00:00
Michał Kępień
39191052ad Wait for the "fast-expire" zone to be transferred
In order for a "fast-expire/IN: response-policy zone expired" message to
be logged in ns3/named.run, the "fast-expire" zone must first be
transferred in by that server.  However, with unfavorable timing, ns3
may be stopped before it manages to fetch the "fast-expire" zone from
ns5 and after the latter has been reconfigured to no longer serve that
zone.  In such a case, the "rpz" system test will report a false
positive for the relevant check.  Prevent that from happening by
ensuring ns3 manages to transfer the "fast-expire" zone before getting
shut down.
2020-11-05 07:53:43 +01:00
Mark Andrews
31b49a82d7 Merge branch '2243-cid-312970-incorrect-expression-copy_paste_error-in-tcp-c' into 'main'
Resolve "CID 312970: Incorrect expression (COPY_PASTE_ERROR) in tcp.c"

Closes #2243

See merge request isc-projects/bind9!4355
2020-11-05 00:32:06 +00:00
Mark Andrews
0073cb7356 Incorrect result code passed to failed_connect_cb
*** CID 312970:  Incorrect expression  (COPY_PASTE_ERROR) /lib/isc/netmgr/tcp.c: 282 in tcp_connect_cb()
    276     	}
    277
    278     	isc__nm_incstats(sock->mgr, sock->statsindex[STATID_CONNECT]);
    279     	r = uv_tcp_getpeername(&sock->uv_handle.tcp, (struct sockaddr *)&ss,
    280     			       &(int){ sizeof(ss) });
    281     	if (r != 0) {
    >>>     CID 312970:  Incorrect expression  (COPY_PASTE_ERROR)
    >>>     "status" in "isc___nm_uverr2result(status, true, "netmgr/tcp.c", 282U)" looks like a copy-paste error.
    282     		failed_connect_cb(sock, req, isc__nm_uverr2result(status));
    283     		return;
    284     	}
    285
    286     	atomic_store(&sock->connecting, false);
    287
2020-11-04 21:58:05 +00:00
Matthijs Mekking
1299630324 Merge branch 'matthijs-test-multi-signer-model' into 'main'
Add a test for RFC 8901 signer model 2

See merge request isc-projects/bind9!4306
2020-11-04 13:27:22 +00:00
Matthijs Mekking
518dd0bb17 kasp test: Use DEFAULT_ALGORITHM in tests.sh
Some setup scripts uses DEFAULT_ALGORITHM in their dnssec-policy
and/or initial signing. The tests still used the literal values
13, ECDSAP256SHA256, and 256. Replace those occurrences where
appropriate.
2020-11-04 12:41:25 +01:00
Matthijs Mekking
7e0ec9f624 Add a test for RFC 8901 signer model 2
The new 'dnssec-policy' was already compatible with multi-signer
model 2, now we also have a test for it.
2020-11-04 12:40:04 +01:00
Mark Andrews
5a8d95ea2a Merge branch '2244-nta-related-crash-after-reconfiguring-views' into 'main'
Resolve "NTA-related crash after reconfiguring views"

Closes #2244

See merge request isc-projects/bind9!4345
2020-11-03 12:47:43 +00:00
Mark Andrews
2ef0f252a8 Add CHANGES for [GL #2244] 2020-11-03 12:29:04 +00:00
Mark Andrews
ea956976d1 Call nta_detach() before dns_view_weakdetach() so view is available. 2020-11-03 12:29:04 +00:00
Mark Andrews
1be2a83c67 Merge branch 'marka-fixup-dnssec' into 'main'
dnssec system test needs python and perl

See merge request isc-projects/bind9!4342
2020-11-03 00:48:58 +00:00
Mark Andrews
40ae128922 dnssec system test needs python and perl 2020-11-03 11:22:36 +11:00
Ondřej Surý
3ec9b5f1d9 Merge branch '2227-tcp-connection-closed-second-fix' into 'main'
Fix improper closed connection handling in tcpdns.

Closes #2227

See merge request isc-projects/bind9!4341
2020-11-02 22:52:01 +00:00
Ondřej Surý
c14c1fdd2c Put up additional safe guards to not use inactive/closed tcpdns socket
When we are operating on the tcpdns socket, we need to double check
whether the socket or its outerhandle or its listener or its mgr is
still active and when not, bail out early.
2020-11-02 20:58:00 +01:00
Ondřej Surý
cea4b4db8f Add CHANGES note for [GL #2227] 2020-11-02 15:10:28 +01:00
Witold Kręcicki
3ab3d90de0 Fix improper closed connection handling in tcpdns.
If dnslisten_readcb gets a read callback it needs to verify that the
outer socket wasn't closed in the meantime, and issue a CANCELED callback
if it was.
2020-11-02 15:10:28 +01:00
Michał Kępień
f8730ae1a2 Merge branch '2237-placeholder' into 'main'
Add placeholder for #2237

See merge request isc-projects/bind9!4343
2020-11-02 11:25:30 +00:00
Michał Kępień
2a33e5bf60 Add placeholder for #2237 2020-11-02 12:24:11 +01:00
Ondřej Surý
c933fa8d47 Merge branch '2235-add-netmgr-functions-to-support-outgoing-dns-queries' into 'main'
Resolve "Add netmgr functions to support outgoing DNS queries"

Closes #2235

See merge request isc-projects/bind9!4318
2020-10-30 13:40:18 +00:00
Evan Hunt
3a2dc05c92 CHANGES 2020-10-30 11:11:54 +01:00
Evan Hunt
8fcad58ea6 check return value from uv_tcp_getpeername() when connecting
if we can't determine the peer, the connect should fail.
2020-10-30 11:11:54 +01:00
Ondřej Surý
14f54d13dc add a netmgr unit test
tests of UDP and TCP cases including:
- sending and receiving
- closure sockets without reading or sending
- closure of sockets at various points while sending and receiving
- since the teste is multithreaded, cmocka now aborts tests on the
  first failure, so that failures in subthreads are caught and
  reported correctly.
2020-10-30 11:11:54 +01:00
Evan Hunt
26a3a22895 set REUSEPORT and REUSEADDR on TCP sockets if needed
When binding a TCP socket, if bind() fails with EADDRINUSE,
try again with REUSEPORT/REUSEADDR (or the equivalent options).
2020-10-30 11:11:54 +01:00
Ondřej Surý
ed3ab63f74 Fix more races between connect and shutdown
There were more races that could happen while connecting to a
socket while closing or shutting down the same socket.  This
commit introduces a .closing flag to guard the socket from
being closed twice.
2020-10-30 11:11:54 +01:00
Ondřej Surý
6cfadf9db0 Fix a race between isc__nm_async_shutdown() and new sends/reads
There was a data race where a new event could be scheduled after
isc__nm_async_shutdown() had cleaned up all the dangling UDP/TCP
sockets from the loop.
2020-10-30 11:11:54 +01:00
Ondřej Surý
5fcd52209a Refactor udp_recv_cb()
- more logical code flow.
- propagate errors back to the caller.
- add a 'reading' flag and call the callback from failed_read_cb()
  only when it the socket was actively reading.
2020-10-30 11:11:54 +01:00
Ondřej Surý
cdccac4993 Fix netmgr read/connect timeout issues
- don't bother closing sockets that are already closing.
- UDP read timeout timer was not stopped after reading.
- improve handling of TCP connection failures.
2020-10-30 11:11:54 +01:00
Ondřej Surý
7a6056bc8f Add isc__nm_udp_shutdown() function
This function will be called during isc_nm_closedown() to ensure
that all UDP sockets are closed and detached.
2020-10-30 11:11:54 +01:00
Evan Hunt
5dcdc00b93 add netmgr functions to support outgoing DNS queries
- isc_nm_tcpdnsconnect() sets up up an outgoing TCP DNS connection.
- isc_nm_tcpconnect(), _udpconnect() and _tcpdnsconnect() now take a
  timeout argument to ensure connections time out and are correctly
  cleaned up on failure.
- isc_nm_read() now supports UDP; it reads a single datagram and then
  stops until the next time it's called.
- isc_nm_cancelread() now runs asynchronously to prevent assertion
  failure if reading is interrupted by a non-network thread (e.g.
  a timeout).
- isc_nm_cancelread() can now apply to UDP sockets.
- added shim code to support UDP connection in versions of libuv
  prior to 1.27, when uv_udp_connect() was added

all these functions will be used to support outgoing queries in dig,
xfrin, dispatch, etc.
2020-10-30 11:11:54 +01:00
Michał Kępień
2111ea05cd Merge branch 'mnowak/OpenBSD_6.8' into 'main'
Add OpenBSD 6.8

See merge request isc-projects/bind9!4298
2020-10-30 09:39:33 +00:00
Michal Nowak
773649f413 Update to OpenBSD 6.8 2020-10-30 10:11:06 +01:00
Michal Nowak
fa1f00affe Merge branch 'mnowak/add-freebsd12.2' into 'main'
Update to FreeBSD 12.2

See merge request isc-projects/bind9!4323
2020-10-29 15:01:23 +00:00
Michal Nowak
11ab0528d9 Update to FreeBSD 12.2 2020-10-29 16:00:22 +01:00
Michal Nowak
9190b1ed18 Merge branch 'mnowak/add-fedora-33' into 'main'
Add Fedora 33

See merge request isc-projects/bind9!4326
2020-10-29 14:45:04 +00:00
Michal Nowak
b1e17e475a Add Fedora 33 2020-10-29 15:37:45 +01:00
Mark Andrews
e9b6747888 Merge branch '2236-resolver-sometimes-treats-signed-insecure-zone-with-broken-dnskey-as-bogus' into 'main'
Resolve "Resolver sometimes treats signed, insecure zone with broken DNSKEY as bogus"

Closes #2236

See merge request isc-projects/bind9!4319
2020-10-29 13:46:53 +00:00
Mark Andrews
decf117eb6 Add CHANGES note for [GL #2236] 2020-10-30 00:18:03 +11:00
Mark Andrews
d7840f4b93 Check that a zone in the process of being signed resolves
ans10 simulates a local anycast server which has both signed and
unsigned instances of a zone.  'A' queries get answered from the
signed instance.  Everything else gets answered from the unsigned
instance.  The resulting answer should be insecure.
2020-10-30 00:17:24 +11:00
Mark Andrews
718e597def Handle DNS_R_NCACHENXRRSET in fetch_callback_{dnskey,validator}()
DNS_R_NCACHENXRRSET can be return when zones are in transition state
from being unsigned to signed and signed to unsigned.  The validation
should be resumed and should result in a insecure answer.
2020-10-30 00:17:24 +11:00
Ondřej Surý
d9f3220424 Merge branch '2227-tcp-connection-closed-fix' into 'main'
Properly handle outer TCP connection closed in TCPDNS.

Closes #2227

See merge request isc-projects/bind9!4309
2020-10-29 12:21:05 +00:00
Witold Kręcicki
cd3117b747 Add CHANGES and release note for GL #2227 2020-10-29 12:34:00 +01:00
Witold Kręcicki
c41ce8e0c9 Properly handle outer TCP connection closed in TCPDNS.
If the connection is closed while we're processing the request
we might access TCPDNS outerhandle which is already reset. Check
for this condition and call the callback with ISC_R_CANCELED result.
2020-10-29 12:32:25 +01:00
Evan Hunt
0241d9ddc8 Merge branch 'each-rpz-test-typo' into 'main'
fix a typo in rpz test

See merge request isc-projects/bind9!4320
2020-10-29 05:33:40 +00:00
Evan Hunt
78af071c11 fix a typo in rpz test
"tcp-only" was not being tested correctly in the RPZ system test
because the option to the "digcmd" function that causes queries to
be sent via TCP was misspelled in one case, and was being interpreted
as a query name.

the "ckresult" function has also been changed to be case sensitive
for consistency with "digcmd".
2020-10-28 21:39:35 -07:00
Ondřej Surý
d0a988dcab Merge branch 'ondrej/use-libuv-instead-libltdl' into 'main'
Replace ltdl with libuv shared library handling interface

See merge request isc-projects/bind9!4278
2020-10-28 16:28:49 +00:00
Ondřej Surý
b349fd7402 Add CHANGES note for !4278 2020-10-28 15:48:58 +01:00
Ondřej Surý
38f34c266d Fix possible NULL dereference in cd->dlz_destroy()
If the call to cd->dlz_create() in dlopen_dlz_create() fails, cd->dbdata
may be NULL when dlopen_dlz_destroy() gets called in the cleanup path
and passing NULL to the cd->dlz_destroy() callback may cause a NULL
dereference.  Ensure that does not happen by checking whether cd->dbdata
is non-NULL before calling the cd->dlz_destroy() callback.
2020-10-28 15:48:58 +01:00
Ondřej Surý
37b9511ce1 Use libuv's shared library handling capabilities
While libltdl is a feature-rich library, BIND 9 code only uses its basic
capabilities, which are also provided by libuv and which BIND 9 already
uses for other purposes.  As libuv's cross-platform shared library
handling interface is modeled after the POSIX dlopen() interface,
converting code using the latter to the former is simple.  Replace
libltdl function calls with their libuv counterparts, refactoring the
code as necessary.  Remove all use of libltdl from the BIND 9 source
tree.
2020-10-28 15:48:58 +01:00
Ondřej Surý
e2436159ab Refactor the cleanup code in lt_dl code
The cleanup code that would clean the object after plugin/dlz/dyndb
loading has failed was duplicating the destructor for the object, so
instead of the extra code, we just use the destructor instead.
2020-10-28 15:48:58 +01:00
Ondřej Surý
4e9a58a3e6 Unify lt_dlopen() error handling
Make sure an error gets logged when any lt_dlopen() call in the source
tree fails.  Also make sure that NULL values returned by lt_dlerror()
are replaced with a generic error message to prevent passing NULL as an
argument for the %s format specifier.
2020-10-28 15:48:58 +01:00
Ondřej Surý
0f49b02fc5 Remove redundant lt_dlerror() calls
The redundant lt_dlerror() calls were taken from the examples to clean
any previous errors from lt_dl...() calls.  However upon code
inspection, it was discovered there are no such paths that could cause
the lt_dlerror() to return spurious error messages.
2020-10-28 15:48:58 +01:00
Michal Nowak
e06972eb2f Merge branch 'mnowak/enhanced-test-portability' into 'main'
POSIX compatibility fixes to system test

See merge request isc-projects/bind9!4310
2020-10-27 11:24:10 +00:00
Michal Nowak
c0c4c024c6 Replace a seq invocation with a shell loop
seq is not portable.  Use a while loop instead to make the "dnssec"
system test script POSIX-compatible.
2020-10-27 12:21:53 +01:00
Michal Nowak
481dfb9671 Get rid of bashisms in string comparisons
The double equal sign ('==') is a Bash-specific string comparison
operator.  Ensure the single equal sign ('=') is used in all POSIX shell
scripts in the system test suite in order to retain their portability.
2020-10-27 12:21:07 +01:00
Michal Nowak
ffbfa9582f Merge branch 'mnowak/add-stress-test-to-CI' into 'main'
Add stress test to CI

See merge request isc-projects/bind9!3716
2020-10-26 17:02:37 +00:00
Michal Nowak
39305411e8 Add "stress" tests to GitLab CI
Run "stress" tests for scheduled pipelines and pipelines created for
tags.  These tests were previously only performed manually (as part of
pre-release testing of each new BIND version).  Their purpose is to
detect memory leaks and potential performance issues.

As the run time of each "stress" test itself is set to 1 hour, set the
GitLab CI job timeout to 2 hours in order to account for the extra time
needed to set the test up and gather its results.
2020-10-26 18:01:19 +01:00
Michal Nowak
58aca6d9d5 Merge branch 'mnowak/openbsd-fix-gdb-in-system-test' into 'main'
Fix system test backtrace generation on OpenBSD

See merge request isc-projects/bind9!4272
2020-10-26 13:59:07 +00:00
Michal Nowak
f0b13873a3 Fix system test backtrace generation on OpenBSD
On Linux core dump contains absolute path to crashed binary

    Core was generated by `/home/newman/isc/ws/bind9/bin/named/.libs/lt-named -D glue-ns1 -X named.lock -m'.

However, on OpenBSD there's only a basename

    Core was generated by `named'.

This commit adds support for the latter, retains the former.
2020-10-26 14:58:15 +01:00
Mark Andrews
f8de3df76c Merge branch '2226-tsan-error-in-dispatch-c' into 'main'
Resolve "TSAN error in dispatch.c accessing disp->portentry"

Closes #2226

See merge request isc-projects/bind9!4286
2020-10-23 20:08:43 +00:00
Mark Andrews
5c253c416d Hold qid->lock when calling deref_portentry() as
socket_search() need portentry to be unchanging.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 deref_portentry lib/dns/dispatch.c:630
    #1 deactivate_dispsocket lib/dns/dispatch.c:861
    #2 udp_recv lib/dns/dispatch.c:1105
    #3 udp_exrecv lib/dns/dispatch.c:1028
    #4 dispatch lib/isc/task.c:1152
    #5 run lib/isc/task.c:1344
    #6 <null> <null>

    Previous read of size 8 at 0x000000000001 by thread T2 (mutexes: write M1, write M2):
    #0 socket_search lib/dns/dispatch.c:661
    #1 get_dispsocket lib/dns/dispatch.c:744
    #2 dns_dispatch_addresponse lib/dns/dispatch.c:3120
    #3 resquery_send lib/dns/resolver.c:2467
    #4 fctx_query lib/dns/resolver.c:2217
    #5 fctx_try lib/dns/resolver.c:4245
    #6 fctx_timeout lib/dns/resolver.c:4570
    #7 dispatch lib/isc/task.c:1152
    #8 run lib/isc/task.c:1344
    #9 <null> <null>
2020-10-23 13:49:41 +00:00
Mark Andrews
399cc3ebdf Merge branch '2215-dns_zoneflag_noixfr-is-misnamed' into 'main'
Resolve "DNS_ZONEFLAG_NOIXFR is misnamed"

Closes #2215

See merge request isc-projects/bind9!4285
2020-10-23 13:23:47 +00:00
Mark Andrews
3a044444bd DNS_ZONEFLAG_NOIXFR should be DNS_ZONEFLG_NOIXFR 2020-10-23 13:06:41 +00:00
Michal Nowak
c29bd51c12 Merge branch 'mnowak/ifconfig.sh-use-posix-shell' into 'main'
Use POSIX shell in ifconfig.sh.in

See merge request isc-projects/bind9!4297
2020-10-23 08:40:33 +00:00
Michal Nowak
a0426e0466 Use a POSIX shell in bin/tests/system/ifconfig.sh
Some non-POSIX shells, like /bin/csh on FreeBSD, are unable to execute
the config.guess file:

    + /bin/csh /var/tmp/gitlab_runner/builds/YdCaoq4b/0/mnowak/bind9/config.guess
    timestamp=2018-02-24: Command not found.
    me=config.guess: Command not found.
    Unmatched '"'.

When ./configure is run, it attempts to locate a POSIX-compliant shell.
Use the result of that search in the bin/tests/system/ifconfig.sh
script.
2020-10-23 10:32:21 +02:00
Mark Andrews
246324fc8e Merge branch 'marka-update-gitignore' into 'main'
update gitignore

See merge request isc-projects/bind9!4250
2020-10-22 23:41:44 +00:00
Mark Andrews
4f4a728dee update gitignore 2020-10-22 23:21:06 +00:00
Ondřej Surý
f3d08cd4d5 Merge branch '2221-netmgr-fixes-from-unit-testing' into 'main'
Fix the problems found when writing the unit test for netmgr

See merge request isc-projects/bind9!4283
2020-10-22 21:50:20 +00:00
Evan Hunt
58a0e95976 CHANGES 2020-10-22 13:38:09 -07:00
Ondřej Surý
64e56a9704 Postpone the isc_app_shutdown() after rndc response has been sent
When `rndc stop` is received, the isc_app_shutdown() was being called
before response to the rndc client has been sent; as the
isc_app_shutdown() also tears down the netmgr, the message was never
sent and rndc would complain about connection being interrupted in the
middle of the transaction.  We now postpone the shutdown after the rndc
response has been sent.
2020-10-22 11:46:58 -07:00
Ondřej Surý
8797e5efd5 Fix the data race when read-writing sock->active by using cmpxchg 2020-10-22 11:46:58 -07:00
Ondřej Surý
5ef71c420f Ignore and don't log ISC_R_NOTCONNECTED from uv_accept()
When client disconnects before the connection can be accepted, the named
would log a spurious log message:

    error: Accepting TCP connection failed: socket is not connected

We now ignore the ISC_R_NOTCONNECTED result code and log only other
errors
2020-10-22 11:37:16 -07:00
Ondřej Surý
f7c82e406e Fix the isc_nm_closedown() to actually close the pending connections
1. The isc__nm_tcp_send() and isc__nm_tcp_read() was not checking
   whether the socket was still alive and scheduling reads/sends on
   closed socket.

2. The isc_nm_read(), isc_nm_send() and isc_nm_resumeread() have been
   changed to always return the error conditions via the callbacks, so
   they always succeed.  This applies to all protocols (UDP, TCP and
   TCPDNS).
2020-10-22 11:37:16 -07:00
Ondřej Surý
6af08d1ca6 Fix the way tcp_send_direct() is used
There were two problems how tcp_send_direct() was used:

1. The tcp_send_direct() can return ISC_R_CANCELED (or translated error
   from uv_tcp_send()), but the isc__nm_async_tcpsend() wasn't checking
   the error code and not releasing the uvreq in case of an error.

2. In isc__nm_tcp_send(), when the TCP send is already in the right
   netthread, it uses tcp_send_direct() to send the TCP packet right
   away.  When that happened the uvreq was not freed, and the error code
   was returned to the caller.  We need to return ISC_R_SUCCESS and
   rather use the callback to report an error in such case.
2020-10-22 11:37:16 -07:00
Ondřej Surý
d72bc3eb52 Detach the sock->server in uv_close() callback, not before 2020-10-22 11:37:16 -07:00
Ondřej Surý
97b33e5bde Explicitly stop reading before closing the nmtcpsocket
When closing the socket that is actively reading from the stream, the
read_cb() could be called between uv_close() and close callback when the
server socket has been already detached hence using sock->statichandle
after it has been already freed.
2020-10-22 11:37:16 -07:00
Witold Kręcicki
ff0a336d52 Proper handling of socket references in case of TCP conn failure. 2020-10-22 11:37:16 -07:00
Witold Kręcicki
ae9a6befa8 Don't crash if isc_uv_export returns an error in accept_connection.
isc_uv_export can return an error - e.g. EMFILE (from dup), handle this
nicely.
2020-10-22 11:37:16 -07:00
Ondřej Surý
afca2e3b21 Fix the way udp_send_direct() is used
There were two problems how udp_send_direct() was used:

1. The udp_send_direct() can return ISC_R_CANCELED (or translated error
   from uv_udp_send()), but the isc__nm_async_udpsend() wasn't checking
   the error code and not releasing the uvreq in case of an error.

2. In isc__nm_udp_send(), when the UDP send is already in the right
   netthread, it uses udp_send_direct() to send the UDP packet right
   away.  When that happened the uvreq was not freed, and the error code
   was returned to the caller.  We need to return ISC_R_SUCCESS and
   rather use the callback to report an error in such case.
2020-10-22 11:37:16 -07:00
Michal Nowak
417632ebba Merge branch 'mnowak/test-coverage-visualization' into 'main'
Enable Test Coverage Visualization in merge requests

See merge request isc-projects/bind9!3875
2020-10-22 12:47:15 +00:00
Michal Nowak
2dabf328c4 Enable Test Coverage Visualization for merge requests
This feature allows GitLab to visualize test coverage information in the
file diff view of merge requests.

This commit makes the gcov CI job depend on the following chain of jobs:

    gcc:buster:amd64 → unit:gcc:buster:amd64 → system:gcc:buster:amd64

The reason for running the last two jobs above sequentially rather than
in parallel is that both of them create *.gcda files (containing
coverage data) in the same locations.  While some way of merging these
files from different job artifact archives could probably be designed
with the help of additional tools, the simplest thing to do is not to
run unit test and system test jobs in parallel, carrying *.gcda files
over between jobs as gcov knows how to append coverage data to existing
*.gcda files.

Also note that test coverage will not be visualized if any of the jobs
in the above dependency chain fails (because the gcov job will not be
run).
2020-10-22 14:46:23 +02:00
Michal Nowak
8d5a7cb0dc Merge branch '2060-identify-unused-source-files-via-gcov-ci-job' into 'main'
Resolve "Identify unused source files via gcov CI job"

Closes #2060

See merge request isc-projects/bind9!4261
2020-10-22 11:29:04 +00:00
Michal Nowak
c453b79a7c Add CHANGES entry 2020-10-22 13:12:16 +02:00
Michal Nowak
7ef268bb4b Drop unused bufferlist code 2020-10-22 13:11:16 +02:00
Michal Nowak
1f6f7ccad6 Drop unused portlist code 2020-10-22 13:11:16 +02:00
Michal Nowak
e67737aa75 Drop unused dbtable code 2020-10-22 13:11:16 +02:00
Michal Nowak
e40097559a Merge branch '2218-ensure-use-of-echo_i-where-possible-in-system-tests' into 'main'
Ensure use of "echo_i" where possible

Closes #2218

See merge request isc-projects/bind9!4268
2020-10-22 08:16:41 +00:00
Michal Nowak
1319875c46 Ensure use of "echo_i" where possible
In many instances 'echo "I:' construct was used where echo_i function
should have been.
2020-10-22 09:54:24 +02:00
Michał Kępień
beb3ad5494 Merge branch 'v9_17_6-release' into 'main'
Merge 9.17.6 release branch

See merge request isc-projects/bind9!4287
2020-10-22 07:02:41 +00:00
Michał Kępień
3e007be912 Set up release notes for BIND 9.17.7 2020-10-22 08:58:55 +02:00
Michał Kępień
ca7096fd18 Bump BIND_BASELINE_VERSION for ABI checks 2020-10-22 08:58:55 +02:00
Michał Kępień
fadaf3393d Bump BIND_BASELINE_VERSION for respdiff tests 2020-10-22 08:58:55 +02:00
Michał Kępień
58d8c52b09 Update BIND version to 9.17.6 2020-10-22 08:54:32 +02:00
Michał Kępień
b054318491 Add a CHANGES marker 2020-10-22 08:54:32 +02:00
Michał Kępień
9014ff0cc6 Update library API versions 2020-10-22 08:54:32 +02:00
Michał Kępień
3916f81b1e Merge branch 'michal/prepare-release-notes-for-bind-9.17.6' into 'v9_17_6-release'
Prepare release notes for BIND 9.17.6

See merge request isc-private/bind9!214
2020-10-22 08:54:32 +02:00
Michał Kępień
2291356b08 Prepare release notes for BIND 9.17.6 2020-10-22 08:54:32 +02:00
Michał Kępień
ef3bd208aa Reorder release notes 2020-10-22 08:54:32 +02:00
Michał Kępień
65f88149de Tweak and reword release notes 2020-10-22 08:54:32 +02:00
Michał Kępień
88cb988cc3 Restore release note for GL #2146 2020-10-22 08:54:32 +02:00
Michał Kępień
35fe33b7d9 Tweak and reword recent CHANGES entries 2020-10-22 08:54:32 +02:00
Michał Kępień
43beb080fc Minor documentation formatting tweaks 2020-10-22 08:54:32 +02:00
Diego dos Santos Fronza
e64e3322a6 Merge branch '1736-stub-zone-foiled-by-minimal-responses' into 'main'
Resolve "stub zone foiled by minimal-responses"

Closes #1736

See merge request isc-projects/bind9!4113
2020-10-21 15:06:04 +00:00
Diego Fronza
6026cea10c Add CHANGES entry 2020-10-21 12:03:42 -03:00
Diego Fronza
8f5545fa0b Adjusted additional system test (NS, non-root zone)
After the updates from this branch, BIND now sends glue records for
NS queries even when configured with minimal-responses yes.
2020-10-21 12:03:42 -03:00
Diego Fronza
b0f61f92b3 Added test for the proposed fix
This test is very simple, two nameserver instances are created:
    - ns4: master, with 'minimal-responses yes', authoritative
        for example. zone
    - ns5: slave, stub zone

The first thing verified is the transfer of zone data from master
to slave, which should be saved in ns5/example.db.

After that, a query is issued to ns5 asking for target.example.
TXT, a record present in the master database with the "test" string
as content.

If that query works, it means stub zone successfully request
nameserver addresses from master, ns4.example. A/AAAA

The presence of both A/AAAA records for ns4 is also verified in the
stub zone local file, ns5/example.db.
2020-10-21 12:03:42 -03:00
Diego Fronza
d727eaae6c Always return address records in additional section for NS queries 2020-10-21 12:03:42 -03:00
Diego Fronza
1cee557993 Fix transfer of glue records in stub zones if master has minimal-responses set
Stub zones don't make use of AXFR/IXFR for the transfering of zone
data, instead, a single query is issued to the master asking for
their nameserver records (NS).

That works fine unless master is configured with 'minimal-responses'
set to yes, in which case glue records are not provided by master
in the answer with nameservers authoritative for the zone, leaving
stub zones with incomplete databases.

This commit fix this problem in a simple way, when the answer with
the authoritative nameservers is received from master (stub_callback),
for each nameserver listed (save_nsrrset), a A and AAAA records for
the name is verified in the additional section, and if not present
a query is created to resolve the corresponsing missing glue.

A struct 'stub_cb_args' was added to keep relevant information for
performing a query, like TSIG key, udp size, dscp value, etc, this
information is borrowed from, and created within function 'ns_query',
where the resolving of nameserver from master starts.

A new field was added to the struct 'dns_stub', an atomic integer,
namely pending_requests, which is used to keep how many queries are
created when resolving nameserver addresses that were missing in
the glue.

When the value of pending_requests is zero we know we can release
resources, adjust zone timers, dump to zone file, etc.
2020-10-21 12:03:42 -03:00
Michal Nowak
803d12d430 Merge branch '1490-run-unit-tests-on-openbsd-in-ci' into 'main'
Add OpenBSD unit tests to CI

Closes #1490

See merge request isc-projects/bind9!4269
2020-10-21 11:15:23 +00:00
Michal Nowak
cf7db2003b Run unit tests on OpenBSD in GitLab CI
Unlike other maintained BIND branches, the "main" BIND branch does not
require Kyua for running unit tests, which has been an obstacle for
adding an OpenBSD unit test job to GitLab CI.  Experiments show that a
complete BIND unit test suite completes in a few minutes on OpenBSD and
that unit tests are not as severely affected by OpenBSD performance
issues as system tests are.  Add a GitLab CI job which runs unit tests
on OpenBSD to every pipeline.
2020-10-21 13:06:52 +02:00
Diego dos Santos Fronza
ef050228f7 Merge branch '2195-freebsd-dnstap-system-test-failure' into 'main'
Resolve "FreeBSD dnstap system test failure"

Closes #2195

See merge request isc-projects/bind9!4213
2020-10-20 13:20:04 +00:00
Diego Fronza
d934513c42 Fix dnstap system test on FreeBSD
This commit ensures that dnstap output files captured
by fstrm_capture are properly flushed before any attempt
on reading them with dnstap-read is done.

By reading fstrm-capture source code it was noticed that
signal SIGHUP is used to flush the capture file.
2020-10-20 10:18:28 -03:00
Matthijs Mekking
7350c7555d Merge branch '2208-tcp4recverr-stat-miscount' into 'main'
Don't increment network error stats on UV_EOF

Closes #2208

See merge request isc-projects/bind9!4274
2020-10-20 11:57:35 +00:00
Matthijs Mekking
6c5ff94218 Don't increment network error stats on UV_EOF
When networking statistics was added to the netmgr (in commit
5234a8e00a), two lines were added that
increment the 'STATID_RECVFAIL' statistic: One if 'uv_read_start'
fails and one at the end of the 'read_cb'.  The latter happens
if 'nread < 0'.

According to the libuv documentation, I/O read callbacks (such as for
files and sockets) are passed a parameter 'nread'. If 'nread' is less
than 0, there was an error and 'UV_EOF' is the end of file error, which
you may want to handle differently.

In other words, we should not treat EOF as a RECVFAIL error.
2020-10-20 10:57:16 +02:00
Mark Andrews
a63ac933bb Merge branch 'marka-fix-not-enough-categories' into 'main'
Tune the minimum number of expected categories.

See merge request isc-projects/bind9!4216
2020-10-15 01:02:49 +00:00
Mark Andrews
0abb49034e Drop the expected minimum number of buckets to 4.
The previous value of 5 produced too many false errors.
2020-10-15 00:40:14 +00:00
Mark Andrews
1a4a7f4671 Merge branch 'marka-rrl-mdig-burst' into 'main'
Try to improve rrl timing

See merge request isc-projects/bind9!4126
2020-10-15 00:37:59 +00:00
Mark Andrews
92cdc7b6c7 Try to improve rrl timing
Add a +burst option to mdig so that we have a second to setup the
mdig calls then they run at the start of the next second.

RRL uses 'queries in a second' as a approximation to
'queries per second'. Getting the bursts of traffic to all happen in
the same second should prevent false negatives in the system test.

We now have a second to setup the traffic in.  Then the traffic should
be sent at the start of the next second.  If that still fails we
should move to +burst=<now+2> (further extend mdig) instead of the
implicit <now+1> as the trigger second.
2020-10-15 00:05:12 +00:00
Mark Andrews
3562cc7c89 Merge branch '2209-tsan-error-bin-named-controlconf-c-related' into 'main'
Resolve "TSAN error bin/named/controlconf.c related."

Closes #2209

See merge request isc-projects/bind9!4257
2020-10-15 00:01:36 +00:00
Mark Andrews
f95ba8aa20 Complete the isc_nmhandle_detach() in the worker thread.
isc_nmhandle_detach() needs to complete in the same thread
as shutdown_walk_cb() to avoid a race.  Clear the caller's
pointer then pass control to the worker if necessary.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1:
    #0 isc_nmhandle_detach lib/isc/netmgr/netmgr.c:1258:15
    #1 control_command bin/named/controlconf.c:388:3
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Previous read of size 8 at 0x000000000001 by thread T2:
    #0 isc_nm_pauseread lib/isc/netmgr/netmgr.c:1449:33
    #1 recv_data lib/isccc/ccmsg.c:109:2
    #2 isc__nm_tcp_shutdown lib/isc/netmgr/tcp.c:1157:4
    #3 shutdown_walk_cb lib/isc/netmgr/netmgr.c:1515:3
    #4 uv_walk <null>
    #5 process_queue lib/isc/netmgr/netmgr.c:659:4
    #6 process_normal_queue lib/isc/netmgr/netmgr.c:582:10
    #7 process_queues lib/isc/netmgr/netmgr.c:590:8
    #8 async_cb lib/isc/netmgr/netmgr.c:548:2
    #9 <null> <null>
2020-10-12 17:51:09 +11:00
Ondřej Surý
8c4cf5d2e5 Merge branch 'ondrej/little-socket-fixes' into 'main'
Various little fixes in the old socket code

See merge request isc-projects/bind9!4253
2020-10-08 07:02:15 +00:00
Ondřej Surý
96ac91a18a Clean the last remnant of ISC_PLATFORM_HAVEIPV6 macro
In set_sndbuf() we were using ISC_PLATFORM_HAVEIPV6 macro that doesn't
exist anymore, because we assume that IPv6 support is always available.
2020-10-08 08:28:33 +02:00
Ondřej Surý
1672e851c8 Always set the DF flag (not only when CMSG is available)
By mistake, we were setting the DF flag only when CMSG was available for
said platform.
2020-10-08 08:28:14 +02:00
Ondřej Surý
442a45966a Merge branch 'ondrej/clean-netmgr-callback-locks' into 'main'
Clean the locking around nm callbacks

See merge request isc-projects/bind9!4220
2020-10-08 05:42:39 +00:00
Ondřej Surý
e8b56acb49 Clone the csock in accept_connection(), not in callback
If we clone the csock (children socket) in TCP accept_connection()
instead of passing the ssock (server socket) to the call back and
cloning it there we unbreak the assumption that every socket is handled
inside it's own worker thread and therefore we can get rid of (at least)
callback locking.
2020-10-08 07:24:31 +02:00
Ondřej Surý
d86a74d8a4 Change the isc__nm_tcpdns_stoplistening() to be asynchronous event
The isc__nm_tcpdns_stoplistening() would call isc__nmsocket_clearcb()
that would clear the .accept_cb from non-netmgr thread.  Change the
tcpdns_stoplistening to enqueue ievent that would get processed in the
right netmgr thread to avoid locking.
2020-10-08 07:24:31 +02:00
Mark Andrews
fe0a62654c Merge branch '2204-investigate-pipeline-system-test-failure' into 'main'
Resolve "Investigate pipeline system test failure"

Closes #2204

See merge request isc-projects/bind9!4247
2020-10-08 05:21:52 +00:00
Mark Andrews
1f63bb15b3 Restore the dns_message_reset() call before the dns_dispatch_getnext()
This was accidentally lost in the process of moving rmessage from fctx
to query.  Without this dns_message_setclass() will fail.
2020-10-08 10:55:35 +11:00
Matthijs Mekking
372142d371 Merge branch 'matthijs-kasp-test-requires-python' into 'main'
The kasp system test requires Python

See merge request isc-projects/bind9!4241
2020-10-07 15:22:23 +00:00
Matthijs Mekking
fedd621f37 The kasp system test requires Python
Only run the kasp system test if HAVE_PYTHON.
2020-10-07 10:21:43 +00:00
Mark Andrews
a3892cf783 Merge branch 'marka-wait-for-isc_nm_stoplistening' into 'main'
Wait for isc_nm_stoplistening() to complete

See merge request isc-projects/bind9!4217
2020-10-07 08:15:44 +00:00
Mark Andrews
402ac79833 Fix the data race on shutdown/reconfig in control channel
The controllistener could be freed before the event posted by
isc_nm_stoplistening() has been processed. This commit adds
a reference counter to the controllistener to determine when
to free the listener.
2020-10-07 18:24:25 +11:00
Mark Andrews
08c996c80a Merge branch '2200-the-fuzzer-dns_message_parser-c-is-leaking-memory' into 'main'
Resolve "The fuzzer dns_message_parse.c is leaking memory."

Closes #2200

See merge request isc-projects/bind9!4239
2020-10-06 13:20:36 +00:00
Mark Andrews
0d978878c5 invalidate cctx on error 2020-10-06 23:50:01 +11:00
Mark Andrews
40e54142f8 Merge branch 'marka-create_query-fix-REVERSE_INULL' into 'main'
Silence Coverity REVERSE_INULL report

Closes #2198

See merge request isc-projects/bind9!4234
2020-10-06 12:33:56 +00:00
Mark Andrews
f0a66cb5aa Silence Coverity REVERSE_INULL report
message does not need to be tested to NULL
2020-10-06 12:11:25 +00:00
Matthijs Mekking
d2d7f2a14e Merge branch 'he32-test-fix' into 'main'
Avoid a non-standard bashism: use of "==" in "test".

See merge request isc-projects/bind9!4235
2020-10-06 08:28:12 +00:00
Havard Eidnes
1f83daa4ac Avoid a non-standard bashism: use of "==" in "test". 2020-10-06 08:27:56 +00:00
Mark Andrews
4134980448 Merge branch 'marka-render_buf-was-too-big' into 'main'
render_buf was too big

See merge request isc-projects/bind9!4231
2020-10-06 07:37:30 +00:00
Mark Andrews
8faf12eace render buf was too big
It was misdeclared as a array of pointers (uint8_t*[]) and there
where too many elements (64 * 1024) instead of (64 * 1024 - 1).
2020-10-06 09:49:28 +11:00
Ondřej Surý
50df71a881 Merge branch '2183-dns-flag-day-2020' into 'main'
Resolve "DNS Flag Day 2020"

Closes #2183

See merge request isc-projects/bind9!4179
2020-10-05 15:13:12 +00:00
Ondřej Surý
096d41b4e2 Add text describing the changes done in the MR in more detail 2020-10-05 16:21:21 +02:00
Ondřej Surý
b9a42446e8 Enable DF (don't fragment) flag on listening UDP sockets
This commits uses the isc__nm_socket_dontfrag() helper function to
enable setting DF bit on the outgoing UDP packets.
2020-10-05 16:21:21 +02:00
Ondřej Surý
63c29dcdfa Change the default EDNS buffer size for dig, mdig and host to 1232
The dig should behave closely to how the resolver code in `named` work,
so we need to change the buffer size in dig, mdig and host too.
2020-10-05 16:21:21 +02:00
Ondřej Surý
f1556f8c41 Adjust legacy and digdelv tests for default 1232 EDNS Buffer Size
* the legacy test with -T maxudp512 will just fail, e.g. if the packets
  larger than 512 octets are dropped along the path, the proper response
  is to fail

* digdelv test was just expecting default server EDNS buffer size to be
  4096, the test needed only slight adjustment
2020-10-05 16:21:21 +02:00
Ondřej Surý
bb990030d3 Simplify the EDNS buffer size logic for DNS Flag Day 2020
The DNS Flag Day 2020 aims to remove the IP fragmentation problem from
the UDP DNS communication.  In this commit, we implement the required
changes and simplify the logic for picking the EDNS Buffer Size.

1. The defaults for `edns-udp-size`, `max-udp-size` and
   `nocookie-udp-size` have been changed to `1232` (the value picked by
   DNS Flag Day 2020).

2. The probing heuristics that would try 512->4096->1432->1232 buffer
   sizes has been removed and the resolver will always use just the
   `edns-udp-size` value.

3. Instead of just disabling the PMTUD mechanism on the UDP sockets, we
   now set IP_DONTFRAG (IPV6_DONTFRAG) flag.  That means that the UDP
   packets won't get ever fragmented.  If the ICMP packets are lost the
   UDP will just timeout and eventually be retried over TCP.
2020-10-05 16:21:21 +02:00
Ondřej Surý
d51f09a8d0 Merge branch 'ondrej/refactor-setsockopt' into 'main'
Refactor the setsockopt() code in network manager into helper functions

See merge request isc-projects/bind9!4227
2020-10-05 14:11:55 +00:00
Ondřej Surý
fd975a551d Split reusing the addr/port and load-balancing socket options
The SO_REUSEADDR, SO_REUSEPORT and SO_REUSEPORT_LB has different meaning
on different platform. In this commit, we split the function to set the
reuse of address/port and setting the load-balancing into separate
functions.

The libuv library already have multiplatform support for setting
SO_REUSEADDR and SO_REUSEPORT that allows binding to the same address
and port, but unfortunately, when used after the load-balancing socket
options have been already set, it overrides the previous setting, so we
need our own helper function to enable the SO_REUSEADDR/SO_REUSEPORT
first and then enable the load-balancing socket option.
2020-10-05 15:18:28 +02:00
Ondřej Surý
acb6ad9e3c Use uv_os_sock_t instead of uv_os_fd_t for sockets
On POSIX based systems both uv_os_sock_t and uv_os_fd_t are both typedef
to int.  That's not true on Windows, where uv_os_sock_t is SOCKET and
uv_os_fd_t is HANDLE and they differ in level of indirection.
2020-10-05 15:18:28 +02:00
Ondřej Surý
9dc01a636b Refactor isc__nm_socket_freebind() to take fd and sa_family as args
The isc__nm_socket_freebind() has been refactored to match other
isc__nm_socket_...() helper functions and take uv_os_fd_t and
sa_family_t as function arguments.
2020-10-05 15:18:24 +02:00
Ondřej Surý
d685bbc822 Add helper function to enable DF (don't fragment) flag on UDP sockets
This commits add isc__nm_socket_dontfrag() helper functions.
2020-10-05 14:55:20 +02:00
Ondřej Surý
5daaca7146 Add SO_REUSEPORT and SO_INCOMING_CPU helper functions
The setting of SO_REUSE**** and SO_INCOMING_CPU have been moved into a
separate helper functions.
2020-10-05 14:54:24 +02:00
Matthijs Mekking
1567524a4f Merge branch '1749-rndc-dnssec-rollover' into 'main'
Resolve "rndc trigger rollover"

Closes #1749

See merge request isc-projects/bind9!4004
2020-10-05 09:46:48 +00:00
Matthijs Mekking
78c09f5622 Use default algorithm in kasp test if possible
These tests don't require a specific algorithm so they should use
the DEFAULT_ALGORITHM from 'conf.sh.common'.
2020-10-05 10:53:46 +02:00
Matthijs Mekking
70d1ec432f Use explicit result codes for 'rndc dnssec' cmd
It is better to add new result codes than to overload existing codes.
2020-10-05 10:53:46 +02:00
Matthijs Mekking
edc53fc416 Various rndc dnssec -checkds fixes
While working on 'rndc dnssec -rollover' I noticed the following
(small) issues:

- The key files where updated with hints set to "-when" and that
  should always be "now.
- The kasp system test did not properly update the test number when
  calling 'rndc dnssec -checkds' (and ensuring that works).
- There was a missing ']' in the rndc.c help output.
2020-10-05 10:53:46 +02:00
Matthijs Mekking
fcd34abb9e Test rndc rollover inactive key
When users (accidentally) try to roll an inactive key, throw an error.
2020-10-05 10:53:46 +02:00
Matthijs Mekking
e826facadb Add rndc dnssec -rollover command
This command is similar in arguments as -checkds so refactor the
'named_server_dnssec' function accordingly.  The only difference
are that:

- It does not take a "publish" or "withdrawn" argument.
- It requires the key id to be set (add a check to make sure).

Add tests that will trigger rollover immediately and one that
schedules a test in the future.
2020-10-05 10:53:45 +02:00
Matthijs Mekking
df8276aef0 Add manual key rollover logic
Add to the keymgr a function that will schedule a rollover. This
basically means setting the time when the key needs to retire,
and updating the key lifetime, then update the state file. The next
time that named runs the keymgr the new lifetime will be taken into
account.
2020-10-05 10:52:19 +02:00
Matthijs Mekking
b7c9a80dbe Merge branch '1870-fix-after-backport-to-9_11_s' into 'main'
Change condition for rndc dumpdb -expired

See merge request isc-projects/bind9!4219
2020-10-05 08:47:07 +00:00
Matthijs Mekking
5614454c3b Change condition for rndc dumpdb -expired
After backporting #1870 to 9.11-S I saw that the condition check there
is different than in the main branch. In 9.11-S "stale" can mean
stale and serve-stale, or not active (awaiting cleanup). In 9.16 and
later versions, "stale" is stale and serve-stale, and "ancient" means
not active (awaiting cleanup). An "ancient" RRset is one that is not
active (TTL expired) and is not eligble for serve-stale.

Update the condition for rndc dumpdb -expired to closer match what is
in 9.11-S.
2020-10-05 10:44:50 +02:00
Matthijs Mekking
45e68016d0 Merge branch '2171-dnssec-policy-weird-algo-15-bug' into 'main'
Resolve "dnssec-policy behaviour for algorithm 15 keys different to algorithm 8 keys"

Closes #2171

See merge request isc-projects/bind9!4199
2020-10-02 08:06:45 +00:00
Matthijs Mekking
af3b014976 Fix a timing issue in kasp system test
Sometimes, not all keys have been created in time before 'check_keys'
is called. Run a 'retry_quiet' on checking the number of keys before
continuing checking the key data.
2020-10-02 09:20:40 +02:00
Matthijs Mekking
7c555254fe Fix kasp min key size bug
The minimal size for RSASHA1, RSASHA256 is 512, but due to bad
assignment it was set to 1024.
2020-10-02 09:20:40 +02:00
Matthijs Mekking
621093fe69 Test migration to dnssec-policy with views
This test case is unrelated to the fix for #2171 but was added to
reproduce the problem.
2020-10-02 09:20:40 +02:00
Matthijs Mekking
43c6806779 Minor fix in kasp system test
The 'wait_for_nsec' does not need to add TSIG because it calls
'dig_with_opts' and that already checks for TSIG.
2020-10-02 09:20:40 +02:00
Matthijs Mekking
d6d41e96a3 Add change and note for #2171
This is a bug that needs to be noted.
2020-10-02 09:20:39 +02:00
Matthijs Mekking
0e207392ec Fix Ed25519 and Ed448 in dnssec-policy keymgr
The kasp code had bad implicit size values for the cryptographic
algorithms Ed25519 and Ed448. When creating keys they would never
match the dnssec-policy, leading to new attempts to create keys.

These algorithms were previously not yet added to the system tests,
due to lack of availability on some systems.
2020-10-02 09:20:19 +02:00
Matthijs Mekking
7be1835795 Add kasp tests for Ed25519 and Ed448
Use the testcrypto script to see if these algorithms are supported by
openssl. If so, add the specific configuration to the named.conf file
and touch a file to indicate support. If the file exists, the
corresponding setup and tests are performed.
2020-10-02 09:20:19 +02:00
Michał Kępień
e620f3a3ab Merge branch '2139-rrset-order-fixes-and-cleanups' into 'main'
"rrset-order" fixes and cleanups

Closes #2139

See merge request isc-projects/bind9!4195
2020-10-02 06:50:02 +00:00
Michał Kępień
27c815a220 Add CHANGES entries 2020-10-02 08:41:43 +02:00
Michał Kępień
2ac04dc930 Rework "rrset-order" documentation
Certain parts of the existing documentation for the "rrset-order"
statement are incorrect, others are ambiguous.  Rework the relevant
section of the ARM to make it clear and up-to-date with the source code.
2020-10-02 08:41:43 +02:00
Michał Kępień
abdd4c89fc Add tests for "order none" RRset ordering rules
Make sure "order none" RRset ordering rules are tested in the
"rrsetorder" system test just like all other rule types are.  As the
check for the case of no "rrset-order" rule matching a given RRset also
tests "order none" (rather than "order random", as the test code may
suggest at first glance), replace the test code for that case so that it
matches other "order none" tests.
2020-10-02 08:41:43 +02:00
Michał Kępień
dbcf683c1a Allow "order none" in "rrset-order" rules
named-checkconf treats the following configuration as valid:

    options {
        rrset-order {
            order none;
        };
    };

Yet, the above configuration causes named to crash on startup with:

    order.c:74: REQUIRE(mode == 0x00000800 || mode == 0x00000400 || mode == 0x00800000) failed, back trace

Add DNS_RDATASETATTR_NONE to the list of RRset ordering modes accepted
by dns_order_add() to allow "order none" to be used in "rrset-order"
rules.  This both prevents the aforementioned crashes and addresses the
discrepancy between named-checkconf and named.
2020-10-02 08:41:43 +02:00
Mark Andrews
b154abd393 Merge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime' into 'main'
Resolve "Allow task_test and rdata_tests subtests to be selected at runtime."

Closes #2112

See merge request isc-projects/bind9!4059
2020-10-01 12:46:00 +00:00
Mark Andrews
6293682020 Add the ability select individual tests to rdata_test 2020-10-01 08:21:42 +00:00
Mark Andrews
a9c3374717 Add the ability to print out the list of test names (-l) 2020-10-01 08:21:42 +00:00
Mark Andrews
76837484e7 Add the ability to select tests to run
task_test [-t <test_name>]
2020-10-01 08:21:42 +00:00
Mark Andrews
96febe6b38 Alphabetise tests 2020-10-01 08:21:42 +00:00
Mark Andrews
c969cf86e8 Merge branch '2191-missing-locks-when-accessing-keynode-initial-and-keynode-managed-triggering-tsan' into 'main'
Resolve "Missing locks when accessing keynode.initial and keynode.managed triggered TSAN."

Closes #2191

See merge request isc-projects/bind9!4205
2020-10-01 08:12:29 +00:00
Mark Andrews
840cf7adb3 Add missing rwlock calls when access keynode.initial and keynode.managed
WARNING: ThreadSanitizer: data race
    Write of size 1 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 dns_keynode_trust lib/dns/keytable.c:836
    #1 keyfetch_done lib/dns/zone.c:10187
    #2 dispatch lib/isc/task.c:1152
    #3 run lib/isc/task.c:1344
    #4 <null> <null>

    Previous read of size 1 at 0x000000000001 by thread T2 (mutexes: read M2):
    #0 keynode_dslist_totext lib/dns/keytable.c:682
    #1 dns_keytable_totext lib/dns/keytable.c:732
    #2 named_server_dumpsecroots bin/named/server.c:11357
    #3 named_control_docommand bin/named/control.c:264
    #4 control_command bin/named/controlconf.c:390
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Location is heap block of size 241 at 0x000000000010 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 new_keynode lib/dns/keytable.c:346
    #9 insert lib/dns/keytable.c:393
    #10 dns_keytable_add lib/dns/keytable.c:421
    #11 process_key bin/named/server.c:955
    #12 load_view_keys bin/named/server.c:983
    #13 configure_view_dnsseckeys bin/named/server.c:1140
    #14 configure_view bin/named/server.c:5371
    #15 load_configuration bin/named/server.c:9110
    #16 loadconfig bin/named/server.c:10310
    #17 named_server_reconfigcommand bin/named/server.c:10693
    #18 named_control_docommand bin/named/control.c:250
    #19 control_command bin/named/controlconf.c:390
    #20 dispatch lib/isc/task.c:1152
    #21 run lib/isc/task.c:1344
    #22 <null> <null>

    Mutex M1 is already destroyed.

    Mutex M2 is already destroyed.

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    SUMMARY: ThreadSanitizer: data race lib/dns/keytable.c:836 in dns_keynode_trust
2020-10-01 17:26:09 +10:00
Mark Andrews
061fb5e07e Merge branch '2192-tsan-error-accessing-listener-connections' into 'main'
Resolve "TSAN error accessing listener->connections"

Closes #2192

See merge request isc-projects/bind9!4206
2020-10-01 07:13:09 +00:00
Mark Andrews
bea1326cdc Lock access to listener->connections
as it is accessed from multiple threads with libuv.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1:
    #0 conn_reset bin/named/controlconf.c:574
    #1 isc_nmhandle_detach netmgr/netmgr.c:1257
    #2 isc__nm_uvreq_put netmgr/netmgr.c:1389
    #3 tcp_send_cb netmgr/tcp.c:1030
    #4 <null> <null>
    #5 <null> <null>

    Previous read of size 8 at 0x000000000001 by thread T2:
    #0 conn_reset bin/named/controlconf.c:574
    #1 isc_nmhandle_detach netmgr/netmgr.c:1257
    #2 control_recvmessage bin/named/controlconf.c:556
    #3 recv_data lib/isccc/ccmsg.c:110
    #4 isc__nm_tcp_shutdown netmgr/tcp.c:1161
    #5 shutdown_walk_cb netmgr/netmgr.c:1511
    #6 uv_walk <null>
    #7 process_queue netmgr/netmgr.c:656
    #8 process_normal_queue netmgr/netmgr.c:582
    #9 process_queues netmgr/netmgr.c:590
    #10 async_cb netmgr/netmgr.c:548
    #11 <null> <null>
    #12 <null> <null>

    Location is heap block of size 265 at 0x000000000017 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 isc___mem_get lib/isc/mem.c:1044
    #4 isc__mem_get lib/isc/mem.c:2432
    #5 add_listener bin/named/controlconf.c:1127
    #6 named_controls_configure bin/named/controlconf.c:1324
    #7 load_configuration bin/named/server.c:9181
    #8 run_server bin/named/server.c:9819
    #9 dispatch lib/isc/task.c:1152
    #10 run lib/isc/task.c:1344
    #11 <null> <null>

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_nm_start netmgr/netmgr.c:232
    #3 create_managers bin/named/main.c:909
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_nm_start netmgr/netmgr.c:232
    #3 create_managers bin/named/main.c:909
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    SUMMARY: ThreadSanitizer: data race bin/named/controlconf.c:574 in conn_reset
2020-10-01 15:18:59 +10:00
Ondřej Surý
cdd9852447 Merge branch 'ondrej/remove-dot-at-start-of-the-line-rst' into 'main'
Remove the .key from the beginning of the line in rst file

See merge request isc-projects/bind9!4203
2020-09-30 19:39:58 +00:00
Ondřej Surý
a00ca65ae6 Remove the .key from the beginning of the line in rst file
The handling of . (dot) characted at the beginning of the line has
changed between the sphinx-doc versions, and it was constantly giving us
trouble when generating man pages when using different sphinx-doc.  This
commit just changes the source rst file, so there's no more . (dot) the
beginning of the line.
2020-09-30 21:12:15 +02:00
Mark Andrews
cf64834630 Merge branch '2180-threadsanitizer-data-race-bin-named-server-c-9678-25-in-view_loaded' into 'main'
Resolve "ThreadSanitizer: data race bin/named/server.c:9678:25 in view_loaded"

Closes #2180

See merge request isc-projects/bind9!4167
2020-09-30 14:37:37 +00:00
Mark Andrews
b00ba7ac94 make (named_server_t).reload_status atomic
WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1:
    #0 view_loaded bin/named/server.c:9678:25
    #1 call_loaddone lib/dns/zt.c:308:3
    #2 doneloading lib/dns/zt.c:582:3
    #3 zone_asyncload lib/dns/zone.c:2322:3
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Previous read of size 4 at 0x000000000001 by thread T2:
    #0 named_server_status bin/named/server.c:11903:14
    #1 named_control_docommand bin/named/control.c:272:12
    #2 control_command bin/named/controlconf.c:390:17
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Location is heap block of size 409 at 0x000000000011 allocated by main thread:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713:8
    #2 mem_get lib/isc/mem.c:622:8
    #3 mem_allocateunlocked lib/isc/mem.c:1268:8
    #4 isc___mem_allocate lib/isc/mem.c:1288:7
    #5 isc__mem_allocate lib/isc/mem.c:2453:10
    #6 isc___mem_get lib/isc/mem.c:1037:11
    #7 isc__mem_get lib/isc/mem.c:2432:10
    #8 named_server_create bin/named/server.c:9978:27
    #9 setup bin/named/main.c:1256:2
    #10 main bin/named/main.c:1523:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race bin/named/server.c:9678:25 in view_loaded
2020-09-30 14:19:09 +00:00
Mark Andrews
6e6ad6d303 Merge branch '2190-in-new-yaml-output-when-truncation-is-query-time-usec' into 'main'
dig: print timestamps with microsecond precision if "-u" is used in YAML output mode

Closes #2190

See merge request isc-projects/bind9!4193
2020-09-30 14:11:49 +00:00
Mark Andrews
b7512e87b1 add CHANGES 2020-09-30 23:56:49 +10:00
Mark Andrews
3fe7fa3db2 Output timestamps in yaml to the microsecond if -u is specified. 2020-09-30 23:56:18 +10:00
Mark Andrews
519b070618 Add ISO time stamps to the microsecond 2020-09-30 23:56:18 +10:00
Mark Andrews
f2762acd13 Merge branch '2188-bug-in-message-c-673-ensure-isc_mempool_getallocated-msg-namepool-0-failed' into 'main'
Resolve "Bug in message.c:673: ENSURE(isc_mempool_getallocated(msg->namepool) == 0) failed"

Closes #2188

See merge request isc-projects/bind9!4189
2020-09-30 13:43:20 +00:00
Mark Andrews
5b5f1ba0b2 Check that sig0 name is the root. 2020-09-30 13:24:29 +00:00
Mark Andrews
b736d86697 Have -d print out the message 2020-09-30 13:24:29 +00:00
Mark Andrews
450fab92b1 Always clean sig0name in msgresetsigs() and dns_message_renderreset()
The fuzzing harness operates on dns_message_t in non-standard ways
and if 'sig0name' is non-NULL when msgresetsigs() and
dns_message_renderreset() are called it should be cleaned up.
2020-09-30 13:24:29 +00:00
Mark Andrews
fc5c9e6bce Add packet from issue #4189 2020-09-30 13:24:29 +00:00
Ondřej Surý
0665f01c97 Merge branch 'marka-regen-ddns-confgen.8in' into 'main'
regenerate ddns-confgen.8in

See merge request isc-projects/bind9!4198
2020-09-30 12:19:26 +00:00
Mark Andrews
eeafbddccc regenerate ddns-confgen.8in 2020-09-30 15:52:54 +10:00
Ondřej Surý
6e156834e2 Merge branch '2124-fix-assertion-failure-in-dns-message' into 'main'
Resolve "Bind 9.16.6 Assertion failure message.c:4733: REQUIRE(msg->state == (-1)) failed"

Closes #2124

See merge request isc-projects/bind9!4194
2020-09-29 08:14:23 +00:00
Ondřej Surý
6179a38810 Add CHANGES and release note for GL #2124 2020-09-29 08:22:09 +02:00
Ondřej Surý
33eefe9f85 The dns_message_create() cannot fail, change the return to void
The dns_message_create() function cannot soft fail (as all memory
allocations either succeed or cause abort), so we change the function to
return void and cleanup the calls.
2020-09-29 08:22:08 +02:00
Diego Fronza
7deaf9a93c cocci: Add semantic patch to refactor dns_message_destroy()
dns_message_t objects are now being handled using reference counting
semantics, so now dns_message_destroy() is not called directly anymore,
dns_message_detach must be called instead.
2020-09-29 08:22:08 +02:00
Diego Fronza
cde6227a68 Properly handling dns_message_t shared references
This commit fix the problems that arose when moving the dns_message_t
object from fetchctx_t to the query structure.

Since the lifetime of query objects are different than that of a fetchctx
and the dns_message_t object held by the query may be being used by some
external module, e.g. validator, even after the query may have been destroyed,
propery handling of the references to the message were added in this commit to
avoid accessing an already destroyed object.

Specifically, in rctx_done(), a reference to the message is attached at
the beginning of the function and detached at the end, since a possible call
to fctx_cancelquery() would release the dns_message_t object, and in the next
lines of code a call to rctx_nextserver() or rctx_chaseds() would require
a valid pointer to the same object.

In valcreate() a new reference is attached to the message object, this
ensures that if the corresponding query object is destroyed before the
validator attempts to access it, no invalid pointer access occurs.

In validated() we have to attach a new reference to the message, since
we destroy the validator object at the beginning of the function,
and we need access to the message in the next lines of the same function.

rctx_nextserver() and rctx_chaseds() functions were adapted to receive
a new parameter of dns_message_t* type, this was so they could receive a
valid reference to a dns_message_t since using the response context respctx_t
to access the message through rctx->query->rmessage could lead to an already
released reference due to the query being canceled.
2020-09-29 08:22:08 +02:00
Diego Fronza
02f9e125c1 Fix invalid dns message state in resolver's logic
The assertion failure REQUIRE(msg->state == DNS_SECTION_ANY),
caused by calling dns_message_setclass within function resquery_response()
in resolver.c, was happening due to wrong management of dns message_t
objects used to process responses to the queries issued by the resolver.

Before the fix, a resolver's fetch context (fetchctx_t) would hold
a pointer to the message, this same reference would then be used over all
the attempts to resolve the query, trying next server, etc... for this to work
the message object would have it's state reset between each iteration, marking
it as ready for a new processing.

The problem arose in a scenario with many different forwarders configured,
managing the state of the dns_message_t object was lacking better
synchronization, which have led it to a invalid dns_message_t state in
resquery_response().

Instead of adding unnecessarily complex code to synchronize the object,
the dns_message_t object was moved from fetchctx_t structure to the
query structure, where it better belongs to, since each query will produce
a response, this way whenever a new query is created an associated
dns_messate_t is also created.

This commit deals mainly with moving the dns_message_t object from fetchctx_t
to the query structure.
2020-09-29 08:22:08 +02:00
Diego Fronza
12d6d13100 Refactored dns_message_t for using attach/detach semantics
This commit will be used as a base for the next code updates in order
to have a better control of dns_message_t objects' lifetime.
2020-09-29 08:22:08 +02:00
Mark Andrews
e6f2f79ff2 Merge branch '2189-some-comments-in-lib-dns-stats-c-use-incorrect-notation-for-bit-values' into 'main'
Resolve "some comments in lib/dns/stats.c use incorrect notation for bit values"

Closes #2189

See merge request isc-projects/bind9!4191
2020-09-29 00:38:14 +00:00
Mark Andrews
6727e23a47 Update comments to have binary notation 2020-09-29 10:36:07 +10:00
Michał Kępień
90e1acfd92 Merge branch '114-out-of-tree-system-tests' into 'main'
Add out-of-tree system test job

Closes #114

See merge request isc-projects/bind9!3895
2020-09-28 19:39:22 +00:00
Michal Nowak
47075f64c3 Do not remove $systest for out-of-tree builds
Previously, the $systest directory was being removed for out-of-tree
builds at the end of each system test.  Because of that, running tests
which depend on compiled objects was breaking subsequent "make check"
invocations:

    make: Target 'check' not remade because of errors.
    Making all in dyndb/driver
    /bin/bash: line 20: cd: dyndb/driver: No such file or directory
    Making all in dlzexternal/driver
    /bin/bash: line 20: cd: dlzexternal/driver: No such file or directory

Address by first removing build/test artifacts for a given test and then
removing empty directories inside (and potentially including) $systest.
2020-09-28 21:38:15 +02:00
Michal Nowak
483e5af534 Add an out-of-tree system test job to GitLab CI
Make sure the new job does not get run for every pipeline as it is not
expected to break often and it is similar enough to other system test
jobs.  Change the name of the variable holding the path to the
out-of-tree build directory to a more generic one.
2020-09-28 21:38:15 +02:00
Ondřej Surý
36195cf797 Merge branch 'ondrej/clear-the-uv-event-loop-before-exiting' into 'main'
Clear the libuv event loop before exiting

See merge request isc-projects/bind9!4181
2020-09-28 10:56:33 +00:00
Ondřej Surý
e5ab137ba3 Refactor the pausing/unpausing and finishing the nm_thread
The isc_nm_pause(), isc_nm_resume() and finishing the nm_thread() from
nm_destroy() has been refactored, so all use the netievents instead of
directly touching the worker structure members.  This allows us to
remove most of the locking as the .paused and .finished members are
always accessed from the matching nm_thread.

When shutting down the nm_thread(), instead of issuing uv_stop(), we
just shutdown the .async handler, so all uv_loop_t events are properly
finished first and uv_run() ends gracefully with no outstanding active
handles in the loop.
2020-09-28 11:17:11 +02:00
Michał Kępień
b8b3ddb02f Merge branch '1725-drop-function-wrapping' into 'main'
Drop function wrapping as it is redundant for now

Closes #1725

See merge request isc-projects/bind9!4174
2020-09-28 07:11:48 +00:00
Michał Kępień
b60d7345ed Fix function overrides in unit tests on macOS
Since Mac OS X 10.1, Mach-O object files are by default built with a
so-called two-level namespace which prevents symbol lookups in BIND unit
tests that attempt to override the implementations of certain library
functions from working as intended.  This feature can be disabled by
passing the "-flat_namespace" flag to the linker.  Fix unit tests
affected by this issue on macOS by adding "-flat_namespace" to LDFLAGS
used for building all object files on that operating system (it is not
enough to only set that flag for the unit test executables).
2020-09-28 09:09:21 +02:00
Michał Kępień
8bdba2edeb Drop function wrapping as it is redundant for now
As currently used in the BIND source tree, the --wrap linker option is
redundant because:

  - static builds are no longer supported,

  - there is no need to wrap around existing functions - what is
    actually required (at least for now) is to replace them altogether
    in unit tests,

  - only functions exposed by shared libraries linked into unit test
    binaries are currently being replaced.

Given the above, providing the alternative implementations of functions
to be overridden in lib/ns/tests/nstest.c is a much simpler alternative
to using the --wrap linker option.  Drop the code detecting support for
the latter from configure.ac, simplify the relevant Makefile.am, and
remove lib/ns/tests/wrap.c, updating lib/ns/tests/nstest.c accordingly
(it is harmless for unit tests which are not calling the overridden
functions).
2020-09-28 09:09:21 +02:00
Mark Andrews
aee29706f2 Merge branch '2185-nsdname-wait-recurse-speed-test-fails-under-tsan' into 'main'
Resolve "nsdname-wait-recurse speed test fails under tsan"

Closes #2185

See merge request isc-projects/bind9!4184
2020-09-28 00:05:56 +00:00
Mark Andrews
bdf8194af8 Wait for 'rpz: policy: reload done' to signalled before proceeding.
RPZ rules cannot be fully relied upon until the summary RPZ database is
updated after an "rndc reload".  Wait until the relevant message is
logged after an "rndc reload" to prevent false positives in the
"rpzrecurse" system test caused by the RPZ rules not yet being in effect
by the time ns3 is queried.
2020-09-28 09:14:21 +10:00
Mark Andrews
22d10df0f0 add test markers to ns3 named.log 2020-09-28 09:14:21 +10:00
Evan Hunt
bfe9d3a70d Merge branch '1041-filter-aaaa-purge-memory-pool-upon-plugin-destruction' into 'main'
filter-aaaa: Purge memory pool upon plugin destruction

Closes #1041

See merge request isc-projects/bind9!1957
2020-09-25 21:02:20 +00:00
Michał Kępień
555e1f446c Add CHANGES entry
5238.	[bug]		filter-aaaa: named crashed upon shutdown if it was in
			the process of recursing for A RRsets. [GL #1040]
2020-09-25 13:32:34 -07:00
Evan Hunt
86eddebc83 Purge memory pool upon plugin destruction
The typical sequence of events for AAAA queries which trigger recursion
for an A RRset at the same name is as follows:

 1. Original query context is created.
 2. An AAAA RRset is found in cache.
 3. Client-specific data is allocated from the filter-aaaa memory pool.
 4. Recursion is triggered for an A RRset.
 5. Original query context is torn down.

 6. Recursion for an A RRset completes.
 7. A second query context is created.
 8. Client-specific data is retrieved from the filter-aaaa memory pool.
 9. The response to be sent is processed according to configuration.
10. The response is sent.
11. Client-specific data is returned to the filter-aaaa memory pool.
12. The second query context is torn down.

However, steps 6-12 are not executed if recursion for an A RRset is
canceled.  Thus, if named is in the process of recursing for A RRsets
when a shutdown is requested, the filter-aaaa memory pool will have
outstanding allocations which will never get released.  This in turn
leads to a crash since every memory pool must not have any outstanding
allocations by the time isc_mempool_destroy() is called.

Fix by creating a stub query context whenever fetch_callback() is called,
including cancellation events. When the qctx is destroyed, it will ensure
the client is detached and the plugin memory is freed.
2020-09-25 13:32:34 -07:00
Mark Andrews
b2408003d4 Merge branch '2184-add-rfc8096-to-list-of-rfcs-in-doc-general-rst' into 'main'
Resolve "Add RFC8906 to list of RFCs in doc/arm/general.rst"

Closes #2184

See merge request isc-projects/bind9!4180
2020-09-24 00:28:59 +00:00
Suzanne Goldlust
bc604793d3 Accidentally wrote RFC8096 instead of 8906 2020-09-23 19:41:58 +00:00
Suzanne Goldlust
4c36b6bdf0 Add RFC8096 to list in doc/arm/general.rst 2020-09-23 19:34:42 +00:00
Matthijs Mekking
bfa8c6a822 Merge branch '1870-rndc-dumpdb-expired-v2' into 'main'
Resolve "[Support#12071] [RT#46548] Output stale/expired data with 'rndc dumpdb'"

Closes #1870

See merge request isc-projects/bind9!4088
2020-09-23 14:38:54 +00:00
Matthijs Mekking
d14c2d0d73 rndc dumpdb -expired: print when RRsets expired
When calling 'rndc dumpdb -expired', also print when the RRset expired.
2020-09-23 16:09:26 +02:00
Matthijs Mekking
1728599684 Add notes and CHANGES for #1870
This is a new features so it requires a CHANGE and release notes entry.
2020-09-23 16:09:24 +02:00
Matthijs Mekking
388cc666e5 Handle ancient rrsets in bind_rdataset
An ancient RRset is one still in the cache but expired, and awaiting
cleanup.
2020-09-23 16:08:29 +02:00
Matthijs Mekking
17d5bd4493 Include expired rdatasets in iteration functions
By changing the check in 'rdatasetiter_first' and 'rdatasetiter_next'
from "now > header->rdh_ttl" to "now - RBDTB_VIRTUAL > header->rdh_ttl"
we include expired rdataset entries so that they can be used for
"rndc dumpdb -expired".
2020-09-23 16:08:29 +02:00
Matthijs Mekking
1c3e6f4045 Add test for 'rdnc dumpdb -expired'
This test makes sure that expired records are dumped with rndc's
'dumpdb' command if the '-expired' flag is used.
2020-09-23 16:08:29 +02:00
Matthijs Mekking
86a1bbfe28 Minor changes to serve-stale tests
Minor changes are:
- Replace the "$RNDCCMD dumpdb" logic with "rndc_dumpdb" from
  conf.sh.common (it does the same thing).
- Update a comment to match the grep calls below it (comment said the
  rest should be expired, while the grep calls indicate that they
  are still in the cache, the comment now explains why).
2020-09-23 16:08:29 +02:00
Matthijs Mekking
8beda7d2ea Add -expired flag to rndc dumpdb command
This flag is the same as -cache, but will use a different style format
that will also print expired entries (awaiting cleanup) from the cache.
2020-09-23 16:08:29 +02:00
Mark Andrews
c7156d2116 Merge branch '2162-threadsanitizer-data-race-in-epoll_ctl' into 'main'
Resolve "ThreadSanitizer: data race in epoll_ctl"

Closes #2162

See merge request isc-projects/bind9!4171
2020-09-23 04:19:58 +00:00
Mark Andrews
c37b251eb9 It appears that you can't change what you are polling for while connecting.
WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 epoll_ctl <null>
    #1 watch_fd lib/isc/unix/socket.c:704:8
    #2 wakeup_socket lib/isc/unix/socket.c:897:11
    #3 process_ctlfd lib/isc/unix/socket.c:3362:3
    #4 process_fds lib/isc/unix/socket.c:3275:10
    #5 netthread lib/isc/unix/socket.c:3516:10

    Previous write of size 8 at 0x000000000001 by thread T2 (mutexes: write M2):
    #0 connect <null>
    #1 isc_socket_connect lib/isc/unix/socket.c:4737:7
    #2 resquery_send lib/dns/resolver.c:2892:13
    #3 fctx_query lib/dns/resolver.c:2202:12
    #4 fctx_try lib/dns/resolver.c:4300:11
    #5 resquery_connected lib/dns/resolver.c:3130:4
    #6 dispatch lib/isc/task.c:1152:7
    #7 run lib/isc/task.c:1344:2

    Location is file descriptor 513 created by thread T2 at:
    #0 connect <null>
    #1 isc_socket_connect lib/isc/unix/socket.c:4737:7
    #2 resquery_send lib/dns/resolver.c:2892:13
    #3 fctx_query lib/dns/resolver.c:2202:12
    #4 fctx_try lib/dns/resolver.c:4300:11
    #5 resquery_connected lib/dns/resolver.c:3130:4
    #6 dispatch lib/isc/task.c:1152:7
    #7 run lib/isc/task.c:1344:2

    Mutex M1 (0x000000000016) created at:
    #0 pthread_mutex_init <null>
    #1 isc__mutex_init lib/isc/pthreads/mutex.c:288:8
    #2 setup_thread lib/isc/unix/socket.c:3584:3
    #3 isc_socketmgr_create2 lib/isc/unix/socket.c:3825:3
    #4 create_managers bin/named/main.c:932:11
    #5 setup bin/named/main.c:1223:11
    #6 main bin/named/main.c:1523:2

    Mutex M2 is already destroyed.

    Thread T1 'isc-socket-1' (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_socketmgr_create2 lib/isc/unix/socket.c:3826:3
    #3 create_managers bin/named/main.c:932:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race in epoll_ctl
2020-09-23 13:54:06 +10:00
Mark Andrews
62053255ec Merge branch '2156-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_mutex_lock' into 'main'
Resolve "ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_mutex_lock"

Closes #2156

See merge request isc-projects/bind9!4150
2020-09-23 01:30:23 +00:00
Mark Andrews
a669c919c8 Address lock order inversions.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 dns_view_findzonecut lib/dns/view.c:1310:2
    #2 fctx_create lib/dns/resolver.c:5070:13
    #3 dns_resolver_createfetch lib/dns/resolver.c:10813:12
    #4 dns_resolver_prime lib/dns/resolver.c:10442:12
    #5 dns_view_find lib/dns/view.c:1176:4
    #6 dbfind_name lib/dns/adb.c:3833:11
    #7 dns_adb_createfind lib/dns/adb.c:3155:12
    #8 findname lib/dns/resolver.c:3497:11
    #9 fctx_getaddresses lib/dns/resolver.c:3808:3
    #10 fctx_try lib/dns/resolver.c:4197:12
    #11 fctx_start lib/dns/resolver.c:4824:4
    #12 dispatch lib/isc/task.c:1152:7
    #13 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 dns_resolver_createfetch lib/dns/resolver.c:10767:2
    #2 dns_resolver_prime lib/dns/resolver.c:10442:12
    #3 dns_view_find lib/dns/view.c:1176:4
    #4 dbfind_name lib/dns/adb.c:3833:11
    #5 dns_adb_createfind lib/dns/adb.c:3155:12
    #6 findname lib/dns/resolver.c:3497:11
    #7 fctx_getaddresses lib/dns/resolver.c:3808:3
    #8 fctx_try lib/dns/resolver.c:4197:12
    #9 fctx_start lib/dns/resolver.c:4824:4
    #10 dispatch lib/isc/task.c:1152:7
    #11 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 dns_resolver_shutdown lib/dns/resolver.c:10530:4
    #2 view_flushanddetach lib/dns/view.c:632:4
    #3 dns_view_detach lib/dns/view.c:689:2
    #4 qctx_destroy lib/ns/query.c:5152:2
    #5 fetch_callback lib/ns/query.c:5749:3
    #6 dispatch lib/isc/task.c:1152:7
    #7 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 view_flushanddetach lib/dns/view.c:630:3
    #2 dns_view_detach lib/dns/view.c:689:2
    #3 qctx_destroy lib/ns/query.c:5152:2
    #4 fetch_callback lib/ns/query.c:5749:3
    #5 dispatch lib/isc/task.c:1152:7
    #6 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_mutex_lock
2020-09-23 01:13:28 +00:00
Mark Andrews
3ed13455cc Merge branch '2109-sig0-computation-could-be-wrong' into 'main'
Resolve "kind of use-after-free condition in SIG(0) signing"

Closes #2109

See merge request isc-projects/bind9!4168
2020-09-23 01:12:57 +00:00
Mark Andrews
c7406db46f add CHANGES note 2020-09-23 10:49:26 +10:00
Mark Andrews
f0d9bf7c30 Clone the saved / query message buffers
The message buffer passed to ns__client_request is only valid for
the life of the the ns__client_request call.  Save a copy of it
when we recurse or process a update as ns__client_request will
return before those operations complete.
2020-09-23 10:37:42 +10:00
Mark Andrews
ab19d0a73d Merge branch '2156-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_mutex_lock-2' into 'main'
Resolve "ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_mutex_lock"

Closes #2156

See merge request isc-projects/bind9!4157
2020-09-22 13:01:16 +00:00
Mark Andrews
3c4b68af7c Break lock order loop by sending TAT in an event
The dotat() function has been changed to send the TAT
query asynchronously, so there's no lock order loop
because we initialize the data first and then we schedule
the TAT send to happen asynchronously.

This breaks following lock-order loops:

zone->lock (dns_zone_setviewcommit) while holding view->lock
(dns_view_setviewcommit)

keytable->lock (dns_keytable_find) while holding zone->lock
(zone_asyncload)

view->lock (dns_view_findzonecut) while holding keytable->lock
(dns_keytable_forall)
2020-09-22 12:33:58 +00:00
Mark Andrews
2bb27e4a61 Merge branch '2157-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_rwlock_wrlock' into 'main'
Resolve "ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock"

Closes #2157

See merge request isc-projects/bind9!4158
2020-09-22 12:06:00 +00:00
Mark Andrews
1090876693 Address lock-order-inversion
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000002) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_wrlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:52:4
    #2 zone_postload lib/dns/zone.c:5101:2
    #3 receive_secure_db lib/dns/zone.c:16206:11
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 receive_secure_db lib/dns/zone.c:16204:2
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 get_raw_serial lib/dns/zone.c:2518:2
    #2 zone_gotwritehandle lib/dns/zone.c:2559:4
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_gotwritehandle lib/dns/zone.c:2552:2
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock
2020-09-22 11:43:44 +00:00
Ondřej Surý
52b0186b1d Merge branch '2144-double-attach-when-prefetching' into 'main'
Resolve "double-attach when prefetching"

Closes #2144

See merge request isc-projects/bind9!4124
2020-09-22 08:53:31 +00:00
Ondřej Surý
d4976e0ebe Add separate prefetch nmhandle to ns_client_t
As the query_prefetch() or query_rpzfetch() could be called during
"regular" fetch, we need to introduce separate storage for attaching
the nmhandle during prefetching the records.  The query_prefetch()
and query_rpzfetch() are guarded for re-entrance by .query.prefetch
member of ns_client_t, so we can reuse the same .prefetchhandle for
both.
2020-09-22 09:56:26 +02:00
Matthijs Mekking
e60370bacd Merge branch '2127-xml2rst-add-missing-updates' into 'main'
Resolve "Update ARM with lost changes since the conversion to RST files"

Closes #2127

See merge request isc-projects/bind9!4112
2020-09-22 07:28:01 +00:00
Matthijs Mekking
49e76c15dd Improve language in documentation
Various language specific improvements, from Suzanne Goldlust's
review.
2020-09-22 09:15:57 +02:00
Matthijs Mekking
0b0320360f Update DNSSEC documentation
This was originally done in commit
da0ae5299f but was lost when the
documentation was converted to RST files.
2020-09-22 09:15:57 +02:00
Matthijs Mekking
3a3ace0f41 Add a note on DNSSEC sign metrics in the ARM
This was added previously in commit
3a3f40e372 but was lost when the
documentation was converted to RST files.
2020-09-22 09:15:57 +02:00
Matthijs Mekking
e6b335c2ab Remove leftover 'dnssec-keys' references
The option 'dnssec-keys' was introduced in 9.15 and also renamed to
'trust-anchors'. Rename the leftover references to 'trust-anchors'.
2020-09-22 09:15:57 +02:00
Michał Kępień
5ca1b9be90 Merge branch 'michal/minimize-stdout-logging-in-pairwise-testing-jobs' into 'main'
Minimize stdout logging in pairwise testing jobs

See merge request isc-projects/bind9!4159
2020-09-22 06:41:08 +00:00
Michał Kępień
a8dd69a431 Minimize stdout logging in pairwise testing jobs
The size of the log generated by each GitLab CI job is limited to 4 MB
by default.  While this limit is configurable, it makes little sense to
print build logs to standard output if they are being captured to files
anyway.  Limit use of "tee" in util/pairwise-testing.sh to printing the
combination of configure switches used for a given build.  This way the
job should never exceed the default 4 MB log size limit, yet it will
still indicate its progress in a concise way.
2020-09-22 08:40:04 +02:00
Michał Kępień
f6e2d6ced9 Merge branch 'michal/extend-the-artifact-list-for-the-pairwise-ci-job' into 'main'
Extend the artifact list for the "pairwise" CI job

See merge request isc-projects/bind9!4156
2020-09-21 10:11:16 +00:00
Michał Kępień
9d181b8d82 Extend the artifact list for the "pairwise" CI job
Include the log file generated by the last failed pairwise build among
the artifacts produced by the "pairwise" GitLab CI job in order to
simplify troubleshooting pairwise build failures.
2020-09-21 12:08:50 +02:00
Michał Kępień
3cb9ecc951 Merge branch 'matthijs-fix-deprected-typo' into 'main'
Fix deprected typo

See merge request isc-projects/bind9!4155
2020-09-21 09:34:53 +00:00
Michał Kępień
3ec72c49e2 Merge branch 'mnowak/pairwise-configure-testing' into 'main'
Add pairwise testing

Closes isc-private/bind-qa#21

See merge request isc-projects/bind9!3784
2020-09-21 09:32:16 +00:00
Matthijs Mekking
0a8cb3fa97 Fix 'deprected' typo 2020-09-21 11:26:52 +02:00
Michal Nowak
420986bf18 Add pairwise testing
Pairwise testing is a test case generation technique based on the
observation that most faults are caused by interactions of at most two
factors.  For BIND, its configure options can be thought of as such
factors.

Process BIND configure options into a model that is subsequently
processed by the PICT tool in order to find an effective test vector.
That test vector is then used for configuring and building BIND using
various combinations of configure options.
2020-09-21 11:19:19 +02:00
Mark Andrews
2430dff4ba Merge branch '2158-threadsanitizer-data-race-in-memmove' into 'main'
Resolve "ThreadSanitizer: data race in memmove"

Closes #2158

See merge request isc-projects/bind9!4149
2020-09-21 09:18:35 +00:00
Mark Andrews
48d54368d5 Remove the memmove call on dns_rbtnode_t structure that contains atomics
Calling the plain memmove on the structure that contains atomic members
triggers following TSAN warning (even when we don't really use the
atomic members in the code):

    WARNING: ThreadSanitizer: data race
      Read of size 8 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
	#0 memmove <null>
	#1 memmove /usr/include/x86_64-linux-gnu/bits/string_fortified.h:40:10
	#2 deletefromlevel lib/dns/rbt.c:2675:3
	#3 dns_rbt_deletenode lib/dns/rbt.c:2143:2
	#4 delete_node lib/dns/rbtdb.c
	#5 decrement_reference lib/dns/rbtdb.c:2202:4
	#6 prune_tree lib/dns/rbtdb.c:2259:3
	#7 dispatch lib/isc/task.c:1152:7
	#8 run lib/isc/task.c:1344:2

      Previous atomic write of size 8 at 0x000000000001 by thread T2 (mutexes: read M3):
	#0 __tsan_atomic64_fetch_sub <null>
	#1 decrement_reference lib/dns/rbtdb.c:2103:7
	#2 detachnode lib/dns/rbtdb.c:5440:6
	#3 dns_db_detachnode lib/dns/db.c:588:2
	#4 qctx_clean lib/ns/query.c:5104:3
	#5 ns_query_done lib/ns/query.c:10868:2
	#6 query_sign_nodata lib/ns/query.c
	#7 query_nodata lib/ns/query.c:8438:11
	#8 query_gotanswer lib/ns/query.c
	#9 query_lookup lib/ns/query.c:5624:10
	#10 ns__query_start lib/ns/query.c:5500:10
	#11 query_setup lib/ns/query.c:5224:11
	#12 ns_query_start lib/ns/query.c:11357:8
	#13 ns__client_request lib/ns/client.c:2166:3
	#14 udp_recv_cb lib/isc/netmgr/udp.c:414:2
	#15 uv__udp_recvmsg /home/ondrej/Projects/tsan/libuv/src/unix/udp.c
	#16 uv__udp_io /home/ondrej/Projects/tsan/libuv/src/unix/udp.c:180:5
	#17 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:461:11
	#18 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:385:5
	#19 nm_thread lib/isc/netmgr/netmgr.c:500:11

      Location is heap block of size 132 at 0x000000000030 allocated by thread T3:
	#0 malloc <null>
	#1 default_memalloc lib/isc/mem.c:713:8
	#2 mem_get lib/isc/mem.c:622:8
	#3 mem_allocateunlocked lib/isc/mem.c:1268:8
	#4 isc___mem_allocate lib/isc/mem.c:1288:7
	#5 isc__mem_allocate lib/isc/mem.c:2453:10
	#6 isc___mem_get lib/isc/mem.c:1037:11
	#7 isc__mem_get lib/isc/mem.c:2432:10
	#8 create_node lib/dns/rbt.c:2239:9
	#9 dns_rbt_addnode lib/dns/rbt.c:1435:12
	#10 findnodeintree lib/dns/rbtdb.c:2895:12
	#11 findnode lib/dns/rbtdb.c:2941:10
	#12 dns_db_findnode lib/dns/db.c:439:11
	#13 diff_apply lib/dns/diff.c:306:5
	#14 dns_diff_apply lib/dns/diff.c:459:10
	#15 do_one_tuple lib/ns/update.c:444:11
	#16 update_one_rr lib/ns/update.c:495:10
	#17 update_action lib/ns/update.c:3123:6
	#18 dispatch lib/isc/task.c:1152:7
	#19 run lib/isc/task.c:1344:2

      Mutex M1 is already destroyed.

      Mutex M2 is already destroyed.

      Mutex M3 is already destroyed.

      Thread T1 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
	#2 isc_taskmgr_create lib/isc/task.c:1434:3
	#3 create_managers bin/named/main.c:915:11
	#4 setup bin/named/main.c:1223:11
	#5 main bin/named/main.c:1523:2

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:223:3
	#3 create_managers bin/named/main.c:909:15
	#4 setup bin/named/main.c:1223:11
	#5 main bin/named/main.c:1523:2

      Thread T3 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
	#2 isc_taskmgr_create lib/isc/task.c:1434:3
	#3 create_managers bin/named/main.c:915:11
	#4 setup bin/named/main.c:1223:11
	#5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race in memmove
2020-09-21 08:58:20 +00:00
Ondřej Surý
317af42ae3 Merge branch '2166-bind-9-16-7-trap-divide-error' into 'main'
Resolve "bind 9.16.7 trap divide error"

Closes #2166

See merge request isc-projects/bind9!4141
2020-09-21 08:57:12 +00:00
Ondřej Surý
2869ca1401 Add CHANGES and release note for GL #2166 2020-09-21 10:55:00 +02:00
Ondřej Surý
79ca724d46 Handle the errors from sysconf() call in isc_meminfo_totalphys()
isc_meminfo_totalphys() would return invalid memory size when sysconf()
call would fail, because ((size_t)-1 * -1) is very large number.
2020-09-21 10:55:00 +02:00
Mark Andrews
08dd2838a6 Merge branch '2164-threadsanitizer-data-race-bin-named-controlconf-c-257-22-in-control_senddone' into 'main'
Resolve "ThreadSanitizer: data race bin/named/controlconf.c:257:22 in control_senddone"

Closes #2164

See merge request isc-projects/bind9!4147
2020-09-21 08:43:21 +00:00
Ondřej Surý
ee40b96327 Remove .listener member of controlistener struct
In the new netmgr code, the .listener member was mostly functionally
only duplicating the .exiting member and was unneeded.  This also
resolves following ThreadSanitizer (harmless) warning:

    WARNING: ThreadSanitizer: data race
      Write of size 1 at 0x000000000001 by thread T1:
	#0 control_senddone bin/named/controlconf.c:257:22
	#1 tcp_send_cb lib/isc/netmgr/tcp.c:1027:2
	#2 uv__write_callbacks /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:953:7
	#3 uv__stream_io /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1330:5
	#4 uv__run_pending /home/ondrej/Projects/tsan/libuv/src/unix/core.c:812:5
	#5 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:377:19
	#6 nm_thread lib/isc/netmgr/netmgr.c:500:11

      Previous write of size 1 at 0x000000000001 by thread T2:
	#0 control_senddone bin/named/controlconf.c:257:22
	#1 tcp_send_cb lib/isc/netmgr/tcp.c:1027:2
	#2 uv__write_callbacks /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:953:7
	#3 uv__stream_io /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1330:5
	#4 uv__run_pending /home/ondrej/Projects/tsan/libuv/src/unix/core.c:812:5
	#5 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:377:19
	#6 nm_thread lib/isc/netmgr/netmgr.c:500:11

      Location is heap block of size 265 at 0x000000000009 allocated by thread T3:
	#0 malloc <null>
	#1 default_memalloc lib/isc/mem.c:713:8
	#2 mem_get lib/isc/mem.c:622:8
	#3 isc___mem_get lib/isc/mem.c:1044:9
	#4 isc__mem_get lib/isc/mem.c:2432:10
	#5 add_listener bin/named/controlconf.c:1133:13
	#6 named_controls_configure bin/named/controlconf.c:1331:6
	#7 load_configuration bin/named/server.c:9133:2
	#8 run_server bin/named/server.c:9771:2
	#9 dispatch lib/isc/task.c:1152:7
	#10 run lib/isc/task.c:1344:2

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:223:3
	#3 create_managers bin/named/main.c:909:15
	#4 setup bin/named/main.c:1223:11
	#5 main bin/named/main.c:1523:2

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:223:3
	#3 create_managers bin/named/main.c:909:15
	#4 setup bin/named/main.c:1223:11
	#5 main bin/named/main.c:1523:2

      Thread T3 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
	#2 isc_taskmgr_create lib/isc/task.c:1434:3
	#3 create_managers bin/named/main.c:915:11
	#4 setup bin/named/main.c:1223:11
	#5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race bin/named/controlconf.c:257:22 in control_senddone
2020-09-21 10:21:04 +02:00
Michał Kępień
78304690b7 Merge branch '2169-fix-updating-summary-rpz-db-for-mixed-case-rpzs' into 'main'
Fix updating summary RPZ DB for mixed-case RPZs

Closes #2169

See merge request isc-projects/bind9!4146
2020-09-21 07:32:09 +00:00
Michał Kępień
e6e4922fe8 Add CHANGES entry 2020-09-21 09:28:36 +02:00
Michał Kępień
853a51d4a9 Add release note 2020-09-21 09:28:36 +02:00
Michał Kępień
dc8a7791bd Fix updating summary RPZ DB for mixed-case RPZs
Each dns_rpz_zone_t structure keeps a hash table of the names this RPZ
database contains.  Here is what happens when an RPZ is updated:

  - a new hash table is prepared for the new version of the RPZ by
    iterating over it; each name found is added to the summary RPZ
    database,

  - every name added to the new hash table is searched for in the old
    hash table; if found, it is removed from the old hash table,

  - the old hash table is iterated over; all names found in it are
    removed from the summary RPZ database (because at that point the old
    hash table should only contain names which are not present in the
    new version of the RPZ),

  - the new hash table replaces the old hash table.

When the new version of the RPZ is iterated over, if a given name is
spelled using a different letter case than in the old version of the
RPZ, the new variant will hash to a different value than the old
variant, which means it will not be removed from the old hash table.
When the old hash table is subsequently iterated over to remove
seemingly deleted names, the old variant of the name will still be
there, causing the name to be deleted from the summary RPZ database
(which effectively causes a given rule to be ignored).

The issue can be triggered not just by altering the case of existing
names in an RPZ, but also by adding sibling names spelled with a
different letter case.  This is because RBT code preserves case when
node splitting occurs.  The end result is that when the RPZ is iterated
over, a given name may be using a different case than in the zone file
(or XFR contents).

Fix by downcasing all names found in the RPZ database before adding them
to the summary RPZ database.
2020-09-21 09:28:36 +02:00
Mark Andrews
91a46bda8b Merge branch '2160-threadsanitizer-data-race-bin-named-controlconf-c-422-37-in-control_recvmessage' into 'main'
Resolve "ThreadSanitizer: data race bin/named/controlconf.c:422:37 in control_recvmessage"

Closes #2160

See merge request isc-projects/bind9!4148
2020-09-21 03:41:49 +00:00
Mark Andrews
631617d4ec make controls->shuttingdown an atomic_bool 2020-09-21 12:48:10 +10:00
Ondřej Surý
46d2a36c6c Merge branch '2163-threadsanitizer-data-race-lib-isc-mem-c-1119-19-in-isc___mem_put' into 'main'
Exclude isc_mem_isovermem from ThreadSanitizer

Closes #2163

See merge request isc-projects/bind9!4140
2020-09-17 15:34:35 +00:00
Ondřej Surý
0110d1ab17 Exclude isc_mem_isovermem from ThreadSanitizer
The .is_overmem member of isc_mem_t structure is intentionally accessed
unlocked as 100% accuracy isn't necessary here.

Without the attribute, following TSAN warning would show up:

    WARNING: ThreadSanitizer: data race
      Write of size 1 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
	#0 isc___mem_put lib/isc/mem.c:1119:19
	#1 isc__mem_put lib/isc/mem.c:2439:2
	#2 dns_rdataslab_fromrdataset lib/dns/rdataslab.c:327:2
	#3 addrdataset lib/dns/rbtdb.c:6761:11
	#4 dns_db_addrdataset lib/dns/db.c:719:10
	#5 cache_name lib/dns/resolver.c:6538:13
	#6 cache_message lib/dns/resolver.c:6628:14
	#7 resquery_response lib/dns/resolver.c:7883:13
	#8 dispatch lib/isc/task.c:1152:7
	#9 run lib/isc/task.c:1344:2

      Previous read of size 1 at 0x000000000001 by thread T2 (mutexes: write M3):
	#0 isc_mem_isovermem lib/isc/mem.c:1553:15
	#1 addrdataset lib/dns/rbtdb.c:6866:25
	#2 dns_db_addrdataset lib/dns/db.c:719:10
	#3 addoptout lib/dns/ncache.c:281:10
	#4 dns_ncache_add lib/dns/ncache.c:101:10
	#5 ncache_adderesult lib/dns/resolver.c:6668:12
	#6 ncache_message lib/dns/resolver.c:6845:11
	#7 rctx_ncache lib/dns/resolver.c:9174:11
	#8 resquery_response lib/dns/resolver.c:7894:2
	#9 dispatch lib/isc/task.c:1152:7
	#10 run lib/isc/task.c:1344:2

      Location is heap block of size 328 at 0x000000000020 allocated by thread T3:
	#0 malloc <null>
	#1 default_memalloc lib/isc/mem.c:713:8
	#2 mem_create lib/isc/mem.c:763:8
	#3 isc_mem_create lib/isc/mem.c:2425:2
	#4 configure_view bin/named/server.c:4494:4
	#5 load_configuration bin/named/server.c:9062:3
	#6 run_server bin/named/server.c:9771:2
	#7 dispatch lib/isc/task.c:1152:7
	#8 run lib/isc/task.c:1344:2

    [...]

    SUMMARY: ThreadSanitizer: data race lib/isc/mem.c:1119:19 in isc___mem_put
2020-09-17 13:51:50 +00:00
Michał Kępień
ed9a133bbc Merge branch 'michal/update-release-checklist' into 'main'
Update release checklist

See merge request isc-projects/bind9!4142
2020-09-17 13:43:23 +00:00
Michał Kępień
66a1fa77a1 Update release checklist
Add an item to the release checklist to make sure eligible customers get
notified about the location of the latest version of BIND Subscription
Edition upon its release.
2020-09-17 15:39:11 +02:00
Mark Andrews
d83ddea5f6 Merge branch '2131-tsan-data-race-in-accessing-controls-symtab' into 'main'
Resolve "TSAN data race in accessing controls->symtab"

Closes #2131

See merge request isc-projects/bind9!4098
2020-09-17 09:28:40 +00:00
Mark Andrews
0450acc1b6 Lock access to control->symtab to prevent data race
WARNING: ThreadSanitizer: data race
    Read of size 8 at 0x000000000001 by thread T1:
    #0 isccc_symtab_foreach lib/isccc/symtab.c:277:14
    #1 isccc_cc_cleansymtab lib/isccc/cc.c:954:2
    #2 control_recvmessage bin/named/controlconf.c:477:2
    #3 recv_data lib/isccc/ccmsg.c:110:2
    #4 read_cb lib/isc/netmgr/tcp.c:769:4
    #5 <null> <null>

    Previous write of size 8 at 0x000000000001 by thread T2:
    #0 isccc_symtab_define lib/isccc/symtab.c:242:2
    #1 isccc_cc_checkdup lib/isccc/cc.c:1026:11
    #2 control_recvmessage bin/named/controlconf.c:478:11
    #3 recv_data lib/isccc/ccmsg.c:110:2
    #4 read_cb lib/isc/netmgr/tcp.c:769:4
    #5 <null> <null>

    Location is heap block of size 190352 at 0x000000000011 allocated by main thread:
    #0 malloc <null>
    #1 isccc_symtab_create lib/isccc/symtab.c:76:18
    #2 isccc_cc_createsymtab lib/isccc/cc.c:948:10
    #3 named_controls_create bin/named/controlconf.c:1483:11
    #4 named_server_create bin/named/server.c:10057:2
    #5 setup bin/named/main.c:1256:2
    #6 main bin/named/main.c:1523:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_nm_start lib/isc/netmgr/netmgr.c:215:3
    #3 create_managers bin/named/main.c:909:15
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_nm_start lib/isc/netmgr/netmgr.c:215:3
    #3 create_managers bin/named/main.c:909:15
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race lib/isccc/symtab.c:277:14 in isccc_symtab_foreach
2020-09-17 18:51:42 +10:00
Mark Andrews
56ff7bece9 Merge branch '2123-lock-order-inversions-in-main' into 'main'
Resolve "Lock order inversions in main"

Closes #2123

See merge request isc-projects/bind9!4090
2020-09-17 08:12:21 +00:00
Mark Andrews
9e584a4511 Pause dbiterator ealier to prevent lock-order-inversion
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 resume_addnsec3chain lib/dns/zone.c:3776:11
    #6 rss_post lib/dns/zone.c:20659:3
    #7 setnsec3param lib/dns/zone.c:20471:3
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 rss_post lib/dns/zone.c:20658:3
    #2 setnsec3param lib/dns/zone.c:20471:3
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8666:5
    #2 zone_maintenance lib/dns/zone.c:11063:4
    #3 zone_timer lib/dns/zone.c:14098:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_nsec3chain lib/dns/zone.c:8656:13
    #6 zone_maintenance lib/dns/zone.c:11063:4
    #7 zone_timer lib/dns/zone.c:14098:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2
2020-09-17 07:03:56 +00:00
Mark Andrews
2e63de94aa Pause the database iterator to release rwlock 2020-09-17 07:03:56 +00:00
Mark Andrews
fbed962204 Pause dbiterator to release rwlock to prevent lock-order-inversion.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000001) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 getsigningtime lib/dns/rbtdb.c:8198:2
    #3 dns_db_getsigningtime lib/dns/db.c:979:11
    #4 set_resigntime lib/dns/zone.c:3887:11
    #5 dns_zone_markdirty lib/dns/zone.c:11119:4
    #6 update_action lib/ns/update.c:3376:3
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 dns_zone_markdirty lib/dns/zone.c:11089:2
    #2 update_action lib/ns/update.c:3376:3
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8502:3
    #2 zone_maintenance lib/dns/zone.c:11056:4
    #3 zone_timer lib/dns/zone.c:14091:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_current lib/dns/rbtdb.c:9695:3
    #4 dns_dbiterator_current lib/dns/dbiterator.c:101:10
    #5 zone_nsec3chain lib/dns/zone.c:8539:3
    #6 zone_maintenance lib/dns/zone.c:11056:4
    #7 zone_timer lib/dns/zone.c:14091:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock
2020-09-17 07:03:56 +00:00
Mark Andrews
c9dbad97b2 Pause dbiterator to release rwlock to prevent lock-order-inversion.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_sign lib/dns/zone.c:9247:3
    #3 zone_maintenance lib/dns/zone.c:11047:4
    #4 zone_timer lib/dns/zone.c:14090:2
    #5 dispatch lib/isc/task.c:1152:7
    #6 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_sign lib/dns/zone.c:9488:13
    #6 zone_maintenance lib/dns/zone.c:11047:4
    #7 zone_timer lib/dns/zone.c:14090:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 dns_db_getsoaserial lib/dns/db.c:780:11
    #6 dump_done lib/dns/zone.c:11428:15
    #7 dump_quantum lib/dns/masterdump.c:1487:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 dump_done lib/dns/zone.c:11426:4
    #3 dump_quantum lib/dns/masterdump.c:1487:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock
2020-09-17 07:03:56 +00:00
Mark Andrews
98025e15d0 Pause dbiterator to release rwlock to prevent lock-order-inversion.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 getsigningtime lib/dns/rbtdb.c:8198:2
    #3 dns_db_getsigningtime lib/dns/db.c:979:11
    #4 set_resigntime lib/dns/zone.c:3887:11
    #5 dns_zone_markdirty lib/dns/zone.c:11115:4
    #6 update_action lib/ns/update.c:3376:3
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 dns_zone_markdirty lib/dns/zone.c:11085:2
    #2 update_action lib/ns/update.c:3376:3
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8274:3
    #2 zone_maintenance lib/dns/zone.c:11052:4
    #3 zone_timer lib/dns/zone.c:14087:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_nsec3chain lib/dns/zone.c:8412:13
    #6 zone_maintenance lib/dns/zone.c:11052:4
    #7 zone_timer lib/dns/zone.c:14087:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock
2020-09-17 07:03:56 +00:00
Mark Andrews
e185e37137 Pause dbiterator to release rwlock to prevent lock-order-inversion.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000002) => M3 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 copy_non_dnssec_records lib/dns/zone.c:16031:11
    #6 receive_secure_db lib/dns/zone.c:16163:12
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_first lib/dns/rbtdb.c:9407:3
    #4 dns_dbiterator_first lib/dns/dbiterator.c:43:10
    #5 receive_secure_db lib/dns/zone.c:16160:16
    #6 dispatch lib/isc/task.c:1152:7
    #7 run lib/isc/task.c:1344:2

    Mutex M3 acquired here while holding mutex M2 in thread T2:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_sign lib/dns/zone.c:9244:3
    #3 zone_maintenance lib/dns/zone.c:11044:4
    #4 zone_timer lib/dns/zone.c:14087:2
    #5 dispatch lib/isc/task.c:1152:7
    #6 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_sign lib/dns/zone.c:9485:13
    #6 zone_maintenance lib/dns/zone.c:11044:4
    #7 zone_timer lib/dns/zone.c:14087:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M3 in thread T3:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 zone_get_from_db lib/dns/zone.c:5602:11
    #6 get_raw_serial lib/dns/zone.c:2520:12
    #7 zone_gotwritehandle lib/dns/zone.c:2559:4
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M3 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_gotwritehandle lib/dns/zone.c:2552:2
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock
2020-09-17 07:03:56 +00:00
Mark Andrews
9e5f83c499 Address lock-order-inversion between the keytable and the db locks.
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 dns_keytable_find lib/dns/keytable.c:522:2
    #3 sync_keyzone lib/dns/zone.c:4560:12
    #4 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #5 mkey_refresh bin/named/server.c:15423:2
    #6 named_server_mkeys bin/named/server.c:15727:4
    #7 named_control_docommand bin/named/control.c:236:12
    #8 control_command bin/named/controlconf.c:365:17
    #9 dispatch lib/isc/task.c:1152:7
    #10 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_first lib/dns/rbtdb.c:9407:3
    #4 dns_dbiterator_first lib/dns/dbiterator.c:43:10
    #5 dns_rriterator_first lib/dns/rriterator.c:71:15
    #6 sync_keyzone lib/dns/zone.c:4543:16
    #7 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #8 mkey_refresh bin/named/server.c:15423:2
    #9 named_server_mkeys bin/named/server.c:15727:4
    #10 named_control_docommand bin/named/control.c:236:12
    #11 control_command bin/named/controlconf.c:365:17
    #12 dispatch lib/isc/task.c:1152:7
    #13 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_find lib/dns/rbtdb.c:4029:2
    #3 dns_db_find lib/dns/db.c:500:11
    #4 addifmissing lib/dns/zone.c:4481:11
    #5 dns_keytable_forall lib/dns/keytable.c:786:4
    #6 sync_keyzone lib/dns/zone.c:4586:2
    #7 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #8 mkey_refresh bin/named/server.c:15423:2
    #9 named_server_mkeys bin/named/server.c:15727:4
    #10 named_control_docommand bin/named/control.c:236:12
    #11 control_command bin/named/controlconf.c:365:17
    #12 dispatch lib/isc/task.c:1152:7
    #13 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 dns_keytable_forall lib/dns/keytable.c:770:2
    #3 sync_keyzone lib/dns/zone.c:4586:2
    #4 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #5 mkey_refresh bin/named/server.c:15423:2
    #6 named_server_mkeys bin/named/server.c:15727:4
    #7 named_control_docommand bin/named/control.c:236:12
    #8 control_command bin/named/controlconf.c:365:17
    #9 dispatch lib/isc/task.c:1152:7
    #10 run lib/isc/task.c:1344:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock
2020-09-17 07:03:56 +00:00
Mark Andrews
41b96b024f Merge branch '2155-reference-leak-on-error-in-controlconf-c-control_respond' into 'main'
Resolve "reference leak on error in controlconf.c:control_respond"

Closes #2155

See merge request isc-projects/bind9!4135
2020-09-17 07:00:33 +00:00
Mark Andrews
d988383b4a control_respond fails to detach from cmdhandle on error 2020-09-17 06:32:41 +00:00
Mark Andrews
459ded8b5a Merge branch '2151-use-after-free-in-named' into 'main'
Resolve "Use after free in named"

Closes #2151

See merge request isc-projects/bind9!4134
2020-09-17 06:32:18 +00:00
Mark Andrews
c5c2a4820b Cleanup connection before detaching 2020-09-17 15:18:27 +10:00
Michał Kępień
e24d73b9b3 Merge branch 'v9_17_5-release' into 'main'
Merge 9.17.5 release branch

See merge request isc-projects/bind9!4131
2020-09-16 20:46:53 +00:00
Michał Kępień
9040f9d63a Set up release notes for BIND 9.17.6 2020-09-16 22:41:35 +02:00
Michał Kępień
c835d4936b Bump BIND_BASELINE_VERSION for ABI checks 2020-09-16 22:41:35 +02:00
Michał Kępień
8a5aae541e Update BIND version to 9.17.5 2020-09-16 22:34:18 +02:00
Michał Kępień
9c8ef6285d Add a CHANGES marker 2020-09-16 22:34:17 +02:00
Michał Kępień
6be91b9d99 Update library API versions 2020-09-16 22:34:06 +02:00
Michał Kępień
b42f7d3677 Merge branch 'michal/prepare-release-notes-for-bind-9.17.5' into 'v9_17_5-release'
Prepare release notes for BIND 9.17.5

See merge request isc-private/bind9!208
2020-09-16 22:34:06 +02:00
Michał Kępień
74ac8bf33a Prepare release notes for BIND 9.17.5 2020-09-16 22:34:05 +02:00
Michał Kępień
c3685f5351 Add release note for OSS-Fuzz fixes 2020-09-16 22:34:05 +02:00
Michał Kępień
b989be60bf Add release note for GL #2074 2020-09-16 22:34:05 +02:00
Michał Kępień
dbe63c7ae7 Tweak and reword release notes 2020-09-16 22:34:05 +02:00
Michał Kępień
5d0e1afed7 Tweak and reword recent CHANGES entries 2020-09-16 22:34:05 +02:00
Michal Nowak
e6d778b24d Miscellaneous formatting and wording tweaks 2020-09-16 22:34:05 +02:00
Michał Kępień
cc97353750 Merge branch '2146-deprecate-the-glue-cache-option' into 'main'
Deprecate the "glue-cache" option

Closes #2146

See merge request isc-projects/bind9!4123
2020-09-16 09:19:15 +00:00
Michał Kępień
ced27cf201 Add CHANGES for GL #2146 2020-09-16 11:18:07 +02:00
Michał Kępień
e56e3aeb6a Add release note for #2146 2020-09-16 11:18:07 +02:00
Michał Kępień
5ae33351f2 Deprecate the "glue-cache" option
No issues with the glue cache feature have been reported since its
introduction in BIND 9.12.  As the rationale for introducing the
"glue-cache" option was to have a safety switch readily available in
case the glue cache turns out to cause problems, it is time to deprecate
the option.  Glue cache will be permanently enabled in a future release,
at which point the "glue-cache" option will be made obsolete.
2020-09-16 11:18:07 +02:00
Michał Kępień
29a0c999a4 Merge branch 'ondrej/fix-split-string-warnings-clang-12' into 'main'
Fix the clang 12 warnings with multi-line strings in string arrays

See merge request isc-projects/bind9!4130
2020-09-16 09:13:00 +00:00
Ondřej Surý
7b07f22969 Fix the clang 12 warnings with multi-line strings in string arrays
The clang 12 has a new warning that warns when using multi-line strings
in the string arrays, f.e.:

    { "aa",
      "b"
      "b",
      "cc" }

would generate warning like this:

    private_test.c:162:7: error: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Werror,-Wstring-concatenation]
                                      "33333/RSASHA1" };
                                      ^
    private_test.c:161:7: note: place parentheses around the string literal to silence warning
                                      "Done removing signatures for key "
                                      ^
    private_test.c:197:7: error: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Werror,-Wstring-concatenation]
                                      "NSEC chain",
                                      ^
    private_test.c:196:7: note: place parentheses around the string literal to silence warning
                                      "Removing NSEC3 chain 1 0 30 DEAF / creating "
                                      ^
    2 errors generated.
2020-09-16 11:01:39 +02:00
Evan Hunt
b5abdee5c5 Merge branch 'each-copyright-header' into 'main'
copyright header typos

See merge request isc-projects/bind9!4119
2020-09-14 23:46:38 +00:00
Evan Hunt
dcee985b7f update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
Evan Hunt
481a7aae44 fix a typo in copyright headers, and change "http" to "https" 2020-09-14 16:19:37 -07:00
Evan Hunt
51ac7a6e75 Merge branch '2145-minor-documentation-updates' into 'main'
Resolve "Minor documentation updates"

Closes #2145

See merge request isc-projects/bind9!4118
2020-09-14 23:13:31 +00:00
Suzanne Goldlust
f4432a9137 Fix typos and change http to https
Fixed minor typographical errors and changed URLs from "http" to
"https" where appropriate.
2020-09-14 16:11:51 -07:00
Mark Andrews
00c3533a70 Merge branch '2142-write-after-free-in-unit-test-lib-ns-tests-query_test-c' into 'main'
Resolve "write after free in unit test lib/ns/tests/query_test.c"

Closes #2142

See merge request isc-projects/bind9!4116
2020-09-14 05:28:47 +00:00
Mark Andrews
1418f7e186 TSAN errors on unit tests should now be fatal 2020-09-14 12:03:45 +10:00
Mark Andrews
baf165ffd0 clear pointer before subtracting reference 2020-09-14 11:02:33 +10:00
Evan Hunt
5f45cea2c5 Merge branch '2122-netmgr-refcount-cleanup' into 'main'
Resolve "clean up netmgr reference counting"

Closes #2122

See merge request isc-projects/bind9!4089
2020-09-11 20:16:28 +00:00
Evan Hunt
e460e321bd CHANGES 2020-09-11 12:17:57 -07:00
Witold Kręcicki
00e04a86c8 tracing of active sockets and handles
If NETMGR_TRACE is defined, we now maintain a list of active sockets
in the netmgr object and a list of active handles in each socket
object; by walking the list and printing `backtrace` in a debugger
we can see where they were created, to assist in in debugging of
reference counting errors.

On shutdown, if netmgr finds there are still active sockets after
waiting, isc__nm_dump_active() will be called to log the list of
active sockets and their underlying handles, along with some details
about them.
2020-09-11 12:17:57 -07:00
Evan Hunt
2f2d60a989 limit the time we wait for netmgr to be destroyed
if more than 10 seconds pass while we wait for netmgr events to
finish running on shutdown, something is almost certainly wrong
and we should assert and crash.
2020-09-11 12:17:57 -07:00
Evan Hunt
cc7ceace7d add more logging to the shutdown system test
the test server running in shutdown/resolver was not logging
any debug info, which made it difficult to diagnose test failures.
2020-09-11 12:17:57 -07:00
Ondřej Surý
89c534d3b9 properly lock the setting/unsetting of callbacks in isc_nmsocket_t
changes to socket callback functions were not thread safe.
2020-09-11 12:17:57 -07:00
Evan Hunt
57b4dde974 change from isc_nmhandle_ref/unref to isc_nmhandle attach/detach
Attaching and detaching handle pointers will make it easier to
determine where and why reference counting errors have occurred.

A handle needs to be referenced more than once when multiple
asynchronous operations are in flight, so callers must now maintain
multiple handle pointers for each pending operation. For example,
ns_client objects now contain:

        - reqhandle:    held while waiting for a request callback (query,
                        notify, update)
        - sendhandle:   held while waiting for a send callback
        - fetchhandle:  held while waiting for a recursive fetch to
                        complete
        - updatehandle: held while waiting for an update-forwarding
                        task to complete

control channel connection objects now contain:

        - readhandle: held while waiting for a read callback
        - sendhandle: held while waiting for a send callback
        - cmdhandle:  held while an rndc command is running

httpd connections contain:

        - readhandle: held while waiting for a read callback
        - sendhandle: held while waiting for a send callback
2020-09-11 12:17:57 -07:00
Evan Hunt
cfa4ea64bc fix LD_WRAP test in configure
The LD_WRAP test in configure was broken, and failed to
indicate LD_WRAP support correctly, resulting in some unit
tests failing to run.
2020-09-11 12:17:03 -07:00
Witold Kręcicki
7eb4564895 assorted small netmgr-related changes
- rename isc_nmsocket_t->tcphandle to statichandle
- cancelread functions now take handles instead of sockets
- add a 'client' flag in socket objects, currently unused, to
  indicate whether it is to be used as a client or server socket
2020-09-11 10:24:36 -07:00
Mark Andrews
68943d8fa6 Merge branch '2119-the-runtime-system-tests-interfered-with-each-other' into 'main'
Resolve "The runtime system tests interfered with each other"

Closes #2119

See merge request isc-projects/bind9!4080
2020-09-10 09:58:36 +00:00
Mark Andrews
dda5b7b0b8 Wait for test instance of named to exit before completing subtest. 2020-09-10 18:47:51 +10:00
Mark Andrews
1f14705938 Don't use production address (127.0.0.1) in runtime system test. 2020-09-10 18:47:51 +10:00
Mark Andrews
a6ce0a3242 Merge branch '2116-views-system-test-was-not-waiting-for-example-to-finish-loading' into 'main'
Resolve "Views system test was not waiting for example to finish loading."

Closes #2116

See merge request isc-projects/bind9!4078
2020-09-10 08:45:17 +00:00
Mark Andrews
7b65bea6d2 Also wait for 'zone_dump: zone example/IN: enter'
use nextpartpeek as we don't want to reset the starting point
2020-09-10 18:17:45 +10:00
Mark Andrews
0a8fc4062d Merge branch '2114-cid-306652-null-pointer-dereferences-reverse_inull' into 'main'
Resolve "CID 306652:  Null pointer dereferences  (REVERSE_INULL)"

Closes #2114

See merge request isc-projects/bind9!4099
2020-09-09 21:51:49 +00:00
Mark Andrews
584dbffab1 Silence REVERSE_INULL warning (CID 306652) 2020-09-09 21:01:55 +00:00
Evan Hunt
1ffe8a6c76 Merge branch 'each-fix-packet' into 'main'
work around perl error

See merge request isc-projects/bind9!4093
2020-09-09 19:27:47 +00:00
Evan Hunt
bf9aee1b88 work around perl error
some versions of perl failed to run packet.pl because the 'last'
keyword can't be used outside of a loop block. this commit changes
the packet dumping code to a function so we can use 'return' instead.
2020-09-09 19:27:20 +00:00
Mark Andrews
e5fc907934 Merge branch '2090-main-dig-tsan-error' into 'main'
Resolve "main dig tsan error"

Closes #2090

See merge request isc-projects/bind9!4100
2020-09-09 05:24:08 +00:00
Mark Andrews
7b3c7f52c2 Turn off TSAN for isc_log_wouldlog 2020-09-09 14:12:29 +10:00
Mark Andrews
93dd7b1b93 make all artifacts visible 2020-09-09 14:12:29 +10:00
Mark Andrews
71ef3a8038 Only test node->data if we care about whether data is present or not.
WARNING: ThreadSanitizer: data race (pid=28788)
  Write of size 8 at 0x7b200002e060 by thread T1 (mutexes: write M2947):
    #0 add32 /builds/isc-projects/bind9/lib/dns/rbtdb.c:6638:18 (libdns.so.1110+0xe7843)
    #1 addrdataset /builds/isc-projects/bind9/lib/dns/rbtdb.c:6975:12 (libdns.so.1110+0xe4185)
    #2 dns_db_addrdataset /builds/isc-projects/bind9/lib/dns/db.c:783:10 (libdns.so.1110+0x650ee)
    #3 validated /builds/isc-projects/bind9/lib/dns/resolver.c:5140:11 (libdns.so.1110+0x1909f7)
    #4 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507f5)
    #5 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d749)

  Previous read of size 8 at 0x7b200002e060 by thread T5 (mutexes: write M521146194917735760):
    #0 dns_rbt_findnode /builds/isc-projects/bind9/lib/dns/rbt.c:1708:9 (libdns.so.1110+0xd910d)
    #1 cache_find /builds/isc-projects/bind9/lib/dns/rbtdb.c:5098:11 (libdns.so.1110+0xe188e)
    #2 dns_db_find /builds/isc-projects/bind9/lib/dns/db.c:554:11 (libdns.so.1110+0x642bb)
    #3 dns_view_find2 /builds/isc-projects/bind9/lib/dns/view.c:1068:11 (libdns.so.1110+0x1cc2c4)
    #4 dbfind_name /builds/isc-projects/bind9/lib/dns/adb.c:3714:11 (libdns.so.1110+0x46a4b)
    #5 dns_adb_createfind2 /builds/isc-projects/bind9/lib/dns/adb.c:3133:12 (libdns.so.1110+0x45278)
    #6 findname /builds/isc-projects/bind9/lib/dns/resolver.c:3166:11 (libdns.so.1110+0x1827f0)
    #7 fctx_getaddresses /builds/isc-projects/bind9/lib/dns/resolver.c:3462:3 (libdns.so.1110+0x18032d)
    #8 fctx_try /builds/isc-projects/bind9/lib/dns/resolver.c:3819:12 (libdns.so.1110+0x17e174)
    #9 fctx_start /builds/isc-projects/bind9/lib/dns/resolver.c:4219:4 (libdns.so.1110+0x1787a3)
    #10 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507f5)
    #11 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d749)
2020-09-09 14:12:29 +10:00
Mark Andrews
992a79a14b Address lock-order-inversion
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=12714)
  Cycle in lock order graph: M100252 (0x7b7c00010a08) => M1171 (0x7b7400000dc8) => M100252

  Mutex M1171 acquired here while holding mutex M100252 in thread T1:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 dns_resolver_createfetch3 /builds/isc-projects/bind9/lib/dns/resolver.c:9585:2 (libdns.so.1110+0x1769fd)
    #2 dns_resolver_createfetch /builds/isc-projects/bind9/lib/dns/resolver.c:9504:10 (libdns.so.1110+0x174e17)
    #3 create_fetch /builds/isc-projects/bind9/lib/dns/validator.c:1156:10 (libdns.so.1110+0x1c1e5f)
    #4 validatezonekey /builds/isc-projects/bind9/lib/dns/validator.c:2124:13 (libdns.so.1110+0x1c3b6d)
    #5 start_positive_validation /builds/isc-projects/bind9/lib/dns/validator.c:2301:10 (libdns.so.1110+0x1bfde9)
    #6 validator_start /builds/isc-projects/bind9/lib/dns/validator.c:3647:12 (libdns.so.1110+0x1bef62)
    #7 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #8 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M100252 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 validator_start /builds/isc-projects/bind9/lib/dns/validator.c:3628:2 (libdns.so.1110+0x1bee31)
    #2 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #3 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M100252 acquired here while holding mutex M1171 in thread T1:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 dns_validator_destroy /builds/isc-projects/bind9/lib/dns/validator.c:3912:2 (libdns.so.1110+0x1bf788)
    #2 validated /builds/isc-projects/bind9/lib/dns/resolver.c:4916:2 (libdns.so.1110+0x18fdfd)
    #3 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #4 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M1171 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 validated /builds/isc-projects/bind9/lib/dns/resolver.c:4907:2 (libdns.so.1110+0x18fc3d)
    #2 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #3 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Thread T1 'isc-worker0000' (tid=12729, running) created by main thread at:
    #0 pthread_create <null> (delv+0x42afdb)
    #1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:60:8 (libisc.so.1107+0x726d8)
    #2 isc__taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:1468:7 (libisc.so.1107+0x4d635)
    #3 isc_taskmgr_createinctx /builds/isc-projects/bind9/lib/isc/task.c:2091:11 (libisc.so.1107+0x4f4ac)
    #4 main /builds/isc-projects/bind9/bin/delv/delv.c:1639:2 (delv+0x4b7f96)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/builds/isc-projects/bind9/bin/delv/.libs/delv+0x4483a6) in pthread_mutex_lock
2020-09-09 14:08:33 +10:00
Mark Andrews
cdcfde9e65 Address lock-order-inversion
Obtain references to view->redirect and view->managed_keys then
release view->lock so dns_zone_setviewcommit and dns_zone_setviewrevert
can obtain the view->lock while holding zone->lock.

WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=9132)
  Cycle in lock order graph: M987831431424375936 (0x000000000000) => M1012319771577875480 (0x000000000000) => M987831431424375936

  Mutex M1012319771577875480 acquired here while holding mutex M987831431424375936 in thread T2:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 dns_zone_setviewcommit /builds/isc-projects/bind9/lib/dns/zone.c:1571:2 (libdns.so.1110+0x1d74eb)
    #2 dns_view_setviewcommit /builds/isc-projects/bind9/lib/dns/view.c:2388:3 (libdns.so.1110+0x1cfe29)
    #3 load_configuration /builds/isc-projects/bind9/bin/named/./server.c:8188:3 (named+0x51eadd)
    #4 loadconfig /builds/isc-projects/bind9/bin/named/./server.c:9438:11 (named+0x510c66)
    #5 ns_server_reconfigcommand /builds/isc-projects/bind9/bin/named/./server.c:9773:2 (named+0x510b41)
    #6 ns_control_docommand /builds/isc-projects/bind9/bin/named/control.c:243:12 (named+0x4e451a)
    #7 control_recvmessage /builds/isc-projects/bind9/bin/named/controlconf.c:465:13 (named+0x4e9056)
    #8 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #9 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M987831431424375936 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 dns_view_setviewcommit /builds/isc-projects/bind9/lib/dns/view.c:2382:2 (libdns.so.1110+0x1cfde7)
    #2 load_configuration /builds/isc-projects/bind9/bin/named/./server.c:8188:3 (named+0x51eadd)
    #3 loadconfig /builds/isc-projects/bind9/bin/named/./server.c:9438:11 (named+0x510c66)
    #4 ns_server_reconfigcommand /builds/isc-projects/bind9/bin/named/./server.c:9773:2 (named+0x510b41)
    #5 ns_control_docommand /builds/isc-projects/bind9/bin/named/control.c:243:12 (named+0x4e451a)
    #6 control_recvmessage /builds/isc-projects/bind9/bin/named/controlconf.c:465:13 (named+0x4e9056)
    #7 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #8 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M987831431424375936 acquired here while holding mutex M1012319771577875480 in thread T7:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 dns_view_findzonecut2 /builds/isc-projects/bind9/lib/dns/view.c:1300:2 (libdns.so.1110+0x1cc93a)
    #2 dns_view_findzonecut /builds/isc-projects/bind9/lib/dns/view.c:1261:9 (libdns.so.1110+0x1cc864)
    #3 fctx_create /builds/isc-projects/bind9/lib/dns/resolver.c:4459:13 (libdns.so.1110+0x1779d3)
    #4 dns_resolver_createfetch3 /builds/isc-projects/bind9/lib/dns/resolver.c:9628:12 (libdns.so.1110+0x176cb6)
    #5 dns_resolver_createfetch /builds/isc-projects/bind9/lib/dns/resolver.c:9504:10 (libdns.so.1110+0x174e17)
    #6 zone_refreshkeys /builds/isc-projects/bind9/lib/dns/zone.c:10061:12 (libdns.so.1110+0x2055a5)
    #7 zone_maintenance /builds/isc-projects/bind9/lib/dns/zone.c:10274:5 (libdns.so.1110+0x203a78)
    #8 zone_timer /builds/isc-projects/bind9/lib/dns/zone.c:13106:2 (libdns.so.1110+0x1e815a)
    #9 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #10 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M1012319771577875480 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 zone_refreshkeys /builds/isc-projects/bind9/lib/dns/zone.c:9951:2 (libdns.so.1110+0x204dc3)
    #2 zone_maintenance /builds/isc-projects/bind9/lib/dns/zone.c:10274:5 (libdns.so.1110+0x203a78)
    #3 zone_timer /builds/isc-projects/bind9/lib/dns/zone.c:13106:2 (libdns.so.1110+0x1e815a)
    #4 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #5 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Thread T2 'isc-worker0001' (tid=9163, running) created by main thread at:
    #0 pthread_create <null> (named+0x446edb)
    #1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:60:8 (libisc.so.1107+0x726d8)
    #2 isc__taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:1468:7 (libisc.so.1107+0x4d635)
    #3 isc_taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:2109:11 (libisc.so.1107+0x4f587)
    #4 create_managers /builds/isc-projects/bind9/bin/named/./main.c:886:11 (named+0x4f1a97)
    #5 setup /builds/isc-projects/bind9/bin/named/./main.c:1305:11 (named+0x4f05ee)
    #6 main /builds/isc-projects/bind9/bin/named/./main.c:1556:2 (named+0x4ef12d)

  Thread T7 'isc-worker0006' (tid=9168, running) created by main thread at:
    #0 pthread_create <null> (named+0x446edb)
    #1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:60:8 (libisc.so.1107+0x726d8)
    #2 isc__taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:1468:7 (libisc.so.1107+0x4d635)
    #3 isc_taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:2109:11 (libisc.so.1107+0x4f587)
    #4 create_managers /builds/isc-projects/bind9/bin/named/./main.c:886:11 (named+0x4f1a97)
    #5 setup /builds/isc-projects/bind9/bin/named/./main.c:1305:11 (named+0x4f05ee)
    #6 main /builds/isc-projects/bind9/bin/named/./main.c:1556:2 (named+0x4ef12d)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/builds/isc-projects/bind9/bin/named/.libs/named+0x4642a6) in pthread_mutex_lock
2020-09-09 14:08:33 +10:00
Mark Andrews
552e0b852e isc_mutex_init_errcheck prototype should not be under ISC_MUTEX_PROFILE 2020-09-09 13:58:31 +10:00
Mark Andrews
9b445f33e2 Defer read of zl->server and zl->reconfig until
the reference counter has gone to zero and there is
no longer a possibility of changes in other threads.
2020-09-09 13:58:31 +10:00
Mark Andrews
c82b216f25 Merge branch '2120-the-dynamic-load-flags-are-inconsistent-with-thread-analysis' into 'main'
Resolve "The dynamic load flags are inconsistent with thread analysis"

Closes #2120

See merge request isc-projects/bind9!4084
2020-09-07 22:20:26 +00:00
Mark Andrews
86316ed29d Don't run dyndb and dlzexternal if running TSAN as
the dlopen flags being used are incompatible with TSAN.
2020-09-07 22:07:40 +00:00
Mark Andrews
bbece7389e alphabetize tests/usage 2020-09-07 22:07:40 +00:00
Evan Hunt
4ed3238eac Merge branch 'each-faster-tcp-test' into 'main'
shorten the tcp system test

See merge request isc-projects/bind9!4091
2020-09-04 21:22:20 +00:00
Evan Hunt
1ceea908b6 shorten the tcp system test
the tcp system test uses the 'packet.pl' test tool to send a packet
thousands of times. this took a long time because the tool was waiting
for replies and parsing them; however, for that particular test the
replies aren't relevant.

this commit uses non-blocking sockets and moves the reply parsing
outside the send loop, which speeds the system test up substantially.
2020-09-04 13:55:01 -07:00
Michał Kępień
e5f31ce242 Merge branch '1919-include-bind-documentation-in-windows-zips' into 'main'
Include BIND documentation in Windows zips

Closes #1919

See merge request isc-projects/bind9!4085
2020-09-03 10:01:55 +00:00
Michał Kępień
549ddca256 Include BIND documentation in Windows zips
As generated documentation files are no longer stored in the BIND Git
repository, put a copy of the PDF version of the BIND ARM generated by
the "docs" GitLab CI job into the Windows zips to make it easily
available to the end users on that platform.

Make sure Windows zips also contain certain documentation files included
in source tarballs to make the contents of each release more consistent
across different platforms.
2020-09-03 10:35:37 +02:00
Mark Andrews
1d21552ed7 Merge branch 'marka-check-deny-name-with-grant-subdomain' into 'main'
Check 'deny name' + 'grant subdomain' for the same name

See merge request isc-projects/bind9!4079
2020-09-03 06:16:01 +00:00
Mark Andrews
a402ffbced Check 'deny name' + 'grant subdomain' for the same name 2020-09-03 08:16:00 +10:00
Mark Andrews
6c578e75d6 Merge branch '2115-the-load-of-huge-zone-can-take-over-100-secs-when-running-under-a-sanitiser' into 'main'
Resolve "The load of huge.zone can take over 100 secs when running under a sanitiser."

Closes #2115

See merge request isc-projects/bind9!4068
2020-09-02 21:12:02 +00:00
Mark Andrews
fd08918df5 Increase zone load timeout in the "rndc" test
The "huge.zone" zone can take longer than 100 seconds to load when
running under a sanitizer.  Increase the relevant zone load timeout to
prevent intermittent failures of the "rndc" system test.
2020-09-02 22:38:11 +02:00
Ondřej Surý
aa42c8676f Merge branch '2091-print-out-more-diagnostics-on-dns_name_issubdomain' into 'main'
Print diagnostics on dns_name_issubdomain() failure in fctx_create()

Closes #2091

See merge request isc-projects/bind9!4071
2020-09-02 16:33:19 +00:00
Ondřej Surý
0a22024c27 Print diagnostics on dns_name_issubdomain() failure in fctx_create()
Log diagnostic message when dns_name_issubdomain() in the fctx_create()
when the resolver is qname minimizing and forwarding at the same time.
2020-09-02 18:08:15 +02:00
Ondřej Surý
323be476b8 Merge branch '2054-dig-bufsize-0-sets-bufsize-to-4096-2' into 'main'
Resolve "dig +bufsize=0 sets bufsize to 4096"

Closes #2054

See merge request isc-projects/bind9!4055
2020-09-02 15:01:00 +00:00
Mark Andrews
1134f077fd Add CHANGES and release note for GL #2054 2020-09-02 16:59:10 +02:00
Mark Andrews
1d55bd943b 'dig +bufsize=0' no longer disables EDNS as a side effect.
Additionally 'dig +bufsize' restores the default EDNS buffer size.
2020-09-02 16:58:43 +02:00
Mark Andrews
fa9ba8c5f8 Merge branch '2084-9-11-data-race-in-dispatch_test-2' into 'main'
watch_fd also requires lockfd to be held. (9.16/9.17)

See merge request isc-projects/bind9!4058
2020-09-02 13:57:59 +00:00
Mark Andrews
22f499cdc4 watch_fd also requires thread->fdlock[lockid] to be held 2020-09-02 12:17:48 +00:00
Mark Andrews
e923e62f6c remove dead code 2020-09-02 12:17:48 +00:00
Ondřej Surý
c9a9bc5437 Merge branch '2037-deferred-system-test-tcp-buffers-filling-fix' into 'main'
Reorder the response reading in packet.pl to not fill TCP buffers

Closes #2037

See merge request isc-projects/bind9!4065
2020-09-02 12:16:05 +00:00
Ondřej Surý
91322d72c2 Skip the large TCP assertion failure test in the CI environment 2020-09-02 13:10:17 +02:00
Ondřej Surý
ff133ebabd Reorder the response reading in packet.pl to not fill TCP buffers 2020-09-02 12:45:56 +02:00
Matthijs Mekking
27f0d104d3 Merge branch '1748-log-cds-cdnskey-publication' into 'main'
Resolve "Logging of CDS/CDNSKEY generation for workflow"

Closes #2103 and #1748

See merge request isc-projects/bind9!4028
2020-09-02 10:03:15 +00:00
Matthijs Mekking
ff006a1730 Add change entry and release note for #1748 2020-09-02 12:01:22 +02:00
Matthijs Mekking
f9ef5120c1 Log when CDS/CDNSKEY is published in zone.
Log when named decides to add a CDS/CDNSKEY record to the zone. Now
you understand how the bug was found that was fixed in the previous
commits.
2020-09-02 12:00:16 +02:00
Matthijs Mekking
c8205bfa0e Fix CDS (non-)publication
The CDS/CDNSKEY record will be published when the DS is in the
rumoured state. However, with the introduction of the rndc '-checkds'
command, the logic in the keymgr was changed to prevent the DS
state to go in RUMOURED unless the specific command was given. Hence,
the CDS was never published before it was seen in the parent.

Initially I thought this was a policy approval rule, however it is
actually a DNSSEC timing rule. Remove the restriction from
'keymgr_policy_approval' and update the 'keymgr_transition_time'
function. When looking to move the DS state to OMNIPRESENT it will
no longer calculate the state from its last change, but from when
the DS was seen in the parent, "DS Publish". If the time was not set,
default to next key event of an hour.

Similarly for moving the DS state to HIDDEN, the time to wait will
be derived from the "DS Delete" time, not from when the DS state
last changed.
2020-09-02 12:00:14 +02:00
Matthijs Mekking
2d2b8e7c02 Silence two grep calls 2020-09-02 11:59:49 +02:00
Matthijs Mekking
dd754a974c Update rndc_checkds test util
The 'rndc_checkds' utility now allows "now" as the time when the DS
has been seen in/seen removed from the parent.

Also it uses "KEYX" as the key argument, rather than key id.
The 'rndc_checkds' will retrieve the key from the "KEYX" string. This
makes the call a bit more readable.
2020-09-02 11:59:49 +02:00
Matthijs Mekking
8cb394e047 Improve kasp test readability
This commit has a lot of updates on comments, mainly to make the
system test more readable.

Also remove some redundant signing policy checks (check_keys,
check_dnssecstatus, check_keytimes).

Finally, move key time checks and expected key time settings above
'rndc_checkds' calls (with the new way of testing next key event
times there is no need to do them after 'rndc_checkds', and moving
them above 'rndc_checkds' makes the flow of testing easier to follow.
2020-09-02 11:59:49 +02:00
Matthijs Mekking
4a67cdabfe Add dnssec-settime [-P ds|-D ds] to kasp test
Add the new '-P ds' and '-D ds' calls to the kasp test setup so that
next key event times can reliably be tested.
2020-09-02 11:59:49 +02:00
Matthijs Mekking
d4c4f6a669 Add '-P ds' and '-D ds' to dnssec-settime
Add two more arguments to the dnssec-settime tool. '-P ds' sets the
time that the DS was published in the parent, '-D ds' sets the time
that the DS was removed from the parent (these times are not accurate,
but rely on the user to use them appropriately, and as long as the
time is not before actual publication/withdrawal, it is fine).

These new arguments are needed for the kasp system test. We want to
test when the next key event is once a DS is published, and now
that 'parent-registration-delay' is obsoleted, we need a different
approach to reliable test the timings.
2020-09-02 11:59:47 +02:00
Michal Nowak
1f5c47e4e6 Merge branch 'mnowak/drop-gperftools-profiler-configure-switch' into 'main'
Drop gperftools-profiler configure switch

See merge request isc-projects/bind9!4045
2020-09-02 09:34:29 +00:00
Michal Nowak
10dd78126a Add CHANGES and release note for GL !4045 2020-09-02 11:08:40 +02:00
Michal Nowak
de49699b66 Drop gperftools-profiler configure switch
This switch is believed to be unnecessary. The possibility to use
gperftools CPU profiler was kept, one needs to set 'CFLAGS' and
'LDFLAGS' accordingly.
2020-09-02 11:07:46 +02:00
Mark Andrews
57673de99e Merge branch 'marka-placeholder' into 'main'
placeholder

See merge request isc-projects/bind9!4061
2020-09-02 09:05:12 +00:00
Mark Andrews
10b2620ec5 placeholder 2020-09-02 18:46:56 +10:00
Mark Andrews
c4b8b831c0 Merge branch '2081-data-race-in-zonemgr_test' into 'main'
Resolve "data race in zonemgr_test"

Closes #2081

See merge request isc-projects/bind9!3989
2020-09-02 01:36:51 +00:00
Mark Andrews
ca1b0f1539 Add CHANGES note 2020-09-02 10:33:12 +10:00
Mark Andrews
b8e4b6d303 isc_ratelimiter needs to hold a reference to its task
to prevent the task subsystem shutting down before the
ratelimiter is freed.
2020-09-02 10:32:33 +10:00
Mark Andrews
d1d58a2e78 Merge branch '2111-restore-d-option-to-packet-pl' into 'main'
Resolve "Restore '-d' option to packet.pl"

Closes #2111

See merge request isc-projects/bind9!4054
2020-09-02 00:24:03 +00:00
Mark Andrews
c070bab169 Dump the returned packet 2020-09-02 09:40:45 +10:00
Mark Andrews
6da018dcce Merge branch '2049-cleanup-sock' into 'main'
Resolve "Compiler warnings identified by Intel C++ Compiler"

See merge request isc-projects/bind9!3924
2020-09-01 22:38:43 +00:00
Mark Andrews
b1c424ddf3 remove unused variable sock 2020-09-01 22:24:32 +00:00
Diego dos Santos Fronza
61e8e13c91 Merge branch '1847-recursor-has-issues-recursing-ip6-arpa' into 'main'
Resolve "9.16.* recursor has issues recursing"

Closes #1847

See merge request isc-projects/bind9!4027
2020-09-01 18:49:23 +00:00
Diego Fronza
044a72cca9 Add CHANGES and release note for GL #1847 2020-09-01 15:47:00 -03:00
Diego Fronza
11add69198 Added test for the proposed fix
The test works as follows:

1. Client wants to resolve unusual ip6.arpa. name:

   test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN TXT

2. Query is sent to ns7, a qmin enabled resolver.

3. ns7 do the first stage in query minimization for the name and send a new
   query to root (ns1):

  _.1.0.0.2.ip6.arpa.        IN  A

4. ns1 delegates ip6.arpa. to ns2.good.:

    ;; AUTHORITY SECTION:
    ;ip6.arpa.      20  IN  NS  ns2.good.

    ;; ADDITIONAL SECTION:
    ;ns2.good.      20  IN  A   10.53.0.2

5. ns7 do a second round in minimizing the name and send a new query
   to ns2.good. (10.53.0.2):

   _.8.2.6.0.1.0.0.2.ip6.arpa.    IN  A

6. ans2 delegates 8.2.6.0.1.0.0.2.ip6.arpa. to ns3.good.:

    ;; AUTHORITY SECTION:
    ;8.2.6.0.1.0.0.2.ip6.arpa. 60   IN  NS  ns3.good.

    ;; ADDITIONAL SECTION:
    ;ns3.good.      60  IN  A   10.53.0.3

7. ns7 do a third round in minimizing the name and send a new query to
   ns3.good.:

    _.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN A

8. ans3 delegates 1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. to ns4.good.:

    ;; AUTHORITY SECTION:
    ;1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 60 IN    NS  ns4.good.

    ;; ADDITIONAL SECTION:
    ;ns4.good.      60  IN  A   10.53.0.4

9. ns7 do fourth round in minimizing the name and send a new query to
   ns4.good.:

	_.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa.    IN A

10. ns4.good. doesn't know such name, but answers stating it is authoritative for
    the domai:

	;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id:  53815
	...
	;; AUTHORITY SECTION:
	1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 60 IN    SOA ns4.good.  ...

11. ns7 do another minimization on name:
   _.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa
   sends to ns4.good. and gets the same SOA response stated in item #10

12. ns7 do another minimization on name:
	_.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa
	sends to ns4.good. and gets the same SOA response stated in item #10.

13. ns7 do the last query minimization name for the ip6.arpa. QNAME.
	After all IPv6 labels are exausted the algorithm falls back to the
	original QNAME:
	test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa

    ns7 sends a new query with the original QNAME to ans4.

14. Finally ans4 answers with the expected response:
	;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:  40969
	;; flags: qr aa; QUESTION: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
	;; OPT PSEUDOSECTION:
	; EDNS: version: 0, flags:; udp: 8192
	;; QUESTION SECTION:
	;test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. IN TXT

	;; ANSWER SECTION:
	;test1.test2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.9.0.9.4.1.1.1.1.8.2.6.0.1.0.0.2.ip6.arpa. 1    IN TXT "long_ip6_name"
2020-09-01 15:47:00 -03:00
Diego Fronza
230d79c191 Fix resolution of unusual ip6.arpa names
Before this commit, BIND was unable to resolve ip6.arpa names like
the one reported in issue #1847 when using query minimization.

As reported in the issue, an attempt to resolve a name like
'rec-test-dom-158937817846788.test123.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.3.4.3.5.4.0.8.2.6.0.1.0.0.2.ip6.arpa'
using default settings would fail.

The reason was that query minimization algorithm in 'fctx_minimize_qname'
would divide any ip6.arpa names in increasing number of labels,
7,11, ... up to 35, thus limiting the destination name (minimized) to a number
of 35 labels.

In case the last query minimization attempt (with 35 labels) would fail with
NXDOMAIN, BIND would attempt the query mininimization again with the exact
same QNAME, limited on the 35 labels, and that in turn would fail again.

This fix avoids this fail loop by considering the extra labels that may appear
in the leftmost part of an ip6.arpa name, those after the IPv6 part.
2020-09-01 15:47:00 -03:00
Ondřej Surý
045478ad6a Merge branch '2037-deferred-system-test-fix' into 'main'
Unhexlify 2037-pk11_numbits-crash-test.pkt file

Closes #2037

See merge request isc-projects/bind9!4047
2020-09-01 14:17:21 +00:00
Ondřej Surý
5f6eb014aa Multiply 1996-alloc_dnsbuf-crash-test.pkt by 300000 via TCP
The test for assertion failure via large TCP packet needs to be repeated
multiple times (we use 300000).  This commit fixes the input file to be
properly hexlified and uses the new packet.pl -r feature to send it
300000 times via TCP.
2020-09-01 16:16:02 +02:00
Ondřej Surý
dd46559a19 Add -r <repeats> option to packet.pl
For some tests, we need to send big data streams (for TCP) or repeated
packets (for UDP), this commits adds `-r` option to packet.pl that sends
the same input <repeats> times using the specified protocol.
2020-09-01 16:16:02 +02:00
Ondřej Surý
22e0272063 Properly format 2037-pk11_numbits-crash-test.pkt file 2020-09-01 16:16:02 +02:00
Mark Andrews
84aa74a111 Merge branch '2096-isc_refcount_decrement-needs-acquire-release-memory-ordering' into 'main'
Resolve "isc_refcount_decrement  needs acquire release memory ordering."

Closes #2096

See merge request isc-projects/bind9!4010
2020-09-01 12:21:25 +00:00
Mark Andrews
6278899a38 Use memory_order_acq_rel in isc_refcount_decrement.
While

if (isc_refcount_decrement() == 1) {	// memory_order_release
	isc_refcount_destroy();		// memory_order_acquire
	...
}

is theoretically the most efficent in practice, using
memory_order_acq_rel produces the same code on x86_64 and doesn't
trigger tsan data races (which use a idealistic model) if
isc_refcount_destroy() is not called immediately.  In fact
isc_refcount_destroy() could be removed if we didn't want
to check for the count being 0 when isc_refcount_destroy() is
called.

https://stackoverflow.com/questions/49112732/memory-order-in-shared-pointer-destructor
2020-09-01 12:05:18 +00:00
Michał Kępień
fcd6962e8b Merge branch '2075-add-T-maxcachesize-command-line-option' into 'main'
Add "-T maxcachesize=..." command line option

Closes #2075

See merge request isc-projects/bind9!4043
2020-08-31 21:40:28 +00:00
Michał Kępień
dad6572093 Use "-T maxcachesize=2097152" in all system tests
In order to lower the amount of memory allocated at startup by named
instances used in the BIND system test suite, set the default value of
"max-cache-size" for these to 2 megabytes.  The purpose of this change
is to prevent named instances (or even entire virtual machines) from
getting killed by the operating system on the test host due to excessive
memory use.

Remove all "max-cache-size" statements from named configuration files
used in system tests ("checkconf" notwithstanding) to prevent confusion
as the "-T maxcachesize=..." command line option takes precedence over
configuration files.
2020-08-31 13:15:33 +02:00
Michał Kępień
9ac1f6a9bc Add "-T maxcachesize=..." command line option
An implicit default of "max-cache-size 90%;" may cause memory use issues
on hosts which run numerous named instances in parallel (e.g. GitLab CI
runners) due to the cache RBT hash table now being pre-allocated [1] at
startup.  Add a new command line option, "-T maxcachesize=...", to allow
the default value of "max-cache-size" to be overridden at runtime.  When
this new option is in effect, it overrides any other "max-cache-size"
setting in the configuration, either implicit or explicit.  This
approach was chosen because it is arguably the simplest one to
implement.

The following alternative approaches to solving this problem were
considered and ultimately rejected (after it was decided they were not
worth the extra code complexity):

  - adding the same command line option, but making explicit
    configuration statements have priority over it,

  - adding a build-time option that allows the implicit default of
    "max-cache-size 90%;" to be overridden.

[1] see commit e24bc324b4
2020-08-31 13:15:33 +02:00
Ondřej Surý
96c4010fe5 Merge branch '1996-deferred-system-test' into 'main'
[CVE-2020-8620] Fix TCP DNS buffer sizes [TEST]

See merge request isc-projects/bind9!4038
2020-08-31 10:04:42 +00:00
Ondřej Surý
2c796bb9c8 Add PoC for assertion failure on large TCP DNS messages 2020-08-31 12:04:01 +02:00
Ondřej Surý
bd3d9f33dc Merge branch '1997-deferred-system-test' into 'main'
[CVE-2020-8621] Ensure QNAME minimization is permanently disabled when forwarding [TEST]

See merge request isc-projects/bind9!4039
2020-08-31 09:59:01 +00:00
Evan Hunt
dd8db89525 test whether DS chasing works correctly when forwarding 2020-08-31 11:21:22 +02:00
Ondřej Surý
ed98f65479 Merge branch '2037-deferred-system-test' into 'main'
Resolve "[CVE-2020-8623] A flaw in native PKCS#11 code can lead to a remotely triggerable assertion failure in pk11.c"

See merge request isc-projects/bind9!4037
2020-08-31 08:58:03 +00:00
Ondřej Surý
a69433ba40 Add PoC system test for pk11_numbits() assertion 2020-08-31 09:18:13 +02:00
Michał Kępień
a7b78f3a40 Fix relative path to conf.sh in cleanpkcs11.sh 2020-08-31 09:18:13 +02:00
Ondřej Surý
c3a351275b Merge branch '2028-deferred-system-test' into 'main'
[CVE-2020-8622] Properly handle malformed truncated responses to TSIG queries [TEST]

See merge request isc-projects/bind9!4034
2020-08-31 06:24:41 +00:00
Mark Andrews
8bbf3eb5f3 check that a malformed truncated response to a TSIG query is handled 2020-08-31 08:19:13 +02:00
Ondřej Surý
9af47af0f7 Merge branch '1928-handle-EPROTO' into 'main'
Resolve "error: socket.c:1540: unexpected error:"

Closes #1928

See merge request isc-projects/bind9!4023
2020-08-28 18:47:43 +00:00
Ondřej Surý
4722196b13 Add CHANGES and release note for GL #1928 2020-08-28 20:46:34 +02:00
Ondřej Surý
e0380d437d Handle EPROTO errno from recvmsg
It was discovered, that some systems might set EPROTO instead of EACCESS
on recvmsg() call causing spurious syslog messages from the socket
code.  This commit returns soft handling of EPROTO errno code to the
socket code. [GL #1928]
2020-08-28 20:45:52 +02:00
Ondřej Surý
f59067807e Merge branch '2104-fix-off-by-one-error-in-rehash_bits' into 'main'
Resolve "Bind 9.16.6 due to assertion failure"

Closes #2104

See merge request isc-projects/bind9!4030
2020-08-28 15:42:13 +00:00
Ondřej Surý
d47d2b3fe0 Add CHANGES and release notes for GL #2104 2020-08-28 16:21:56 +02:00
Ondřej Surý
78543ad5a7 Fix off-by-one error when calculating new hashtable size
When calculating the new hashtable bitsize, there was an off-by-one
error that would allow the new bitsize to be larger than maximum allowed
causing assertion failure in the rehash() function.
2020-08-28 16:21:21 +02:00
Michal Nowak
25d35029eb Merge branch 'mnowak/fix-tarball-test-suite.log-print' into 'main'
Print test-suite.log correctly in tarball system test job

See merge request isc-projects/bind9!3990
2020-08-28 12:38:32 +00:00
Michal Nowak
0c9c755952 Print test-suite.log correctly in tarball system test job
Printing test-suite.log on system test failure does not work for system
test run from tarball because the "after_script" step does not honour
directory change from the "before_script" step and fails with:

    Running after script...
    $ cat bin/tests/system/test-suite.log
    cat: bin/tests/system/test-suite.log: No such file or directory
2020-08-28 14:00:10 +02:00
Ondřej Surý
56ee60e130 Merge branch '2074-bind-allows-an-empty-cm-value-for-optional-loc-rdata-fields' into 'main'
Resolve "BIND allows an empty 'cm' value for optional LOC RDATA fields"

Closes #2074

See merge request isc-projects/bind9!3988
2020-08-26 14:28:17 +00:00
Mark Andrews
d9594cffab Add CHANGES note 2020-08-26 15:31:51 +02:00
Mark Andrews
2ca4d35037 Refactor totext_loc 2020-08-26 15:31:31 +02:00
Mark Andrews
337cc878fa Correctly encode LOC records with non integer negative altitudes. 2020-08-26 15:31:31 +02:00
Mark Andrews
888dfd78c7 Check LOC's altitude field is properly parsed and encoded. 2020-08-26 15:31:31 +02:00
Mark Andrews
9225c67835 Tighten LOC parsing to reject period and/or m as a value. 2020-08-26 15:31:31 +02:00
Mark Andrews
daca5e8912 Merge branch '2080-data-race-in-rdataset_addglue' into 'main'
Resolve "data race in rdataset_addglue"

Closes #2080

See merge request isc-projects/bind9!3987
2020-08-26 11:32:57 +00:00
Mark Andrews
48973c3ec6 Add CHANGES note 2020-08-26 21:16:04 +10:00
Ondřej Surý
01684cc219 Use the Fibonacci Hashing for the RBTDB glue table
The rbtdb version glue_table has been refactored similarly to rbt.c hash
table, so it does use 32-bit hash function return values and apply
Fibonacci Hashing to lookup the index to the hash table instead of
modulo.  For more details, see the lib/dns/rbt.c commit log.
2020-08-26 21:16:04 +10:00
Mark Andrews
33d0e8d168 rbtversion->glue_table_size must be read when holding a lock 2020-08-26 21:16:04 +10:00
Michal Nowak
0ede73b9f1 Merge branch 'mnowak/tumbleweed-fix-krb5-config-location' into 'main'
Tumbleweed changed location of krb5-config

See merge request isc-projects/bind9!4016
2020-08-26 08:57:20 +00:00
Michal Nowak
6095811461 Tumbleweed changed location of krb5-config
krb5-config is now in /usr/bin/ and we should detect it automatically.
2020-08-26 10:56:01 +02:00
Ondřej Surý
045173f8a7 Merge branch '2097-manual-page-tools-need-updating' into 'main'
Fix generated documentation

Closes #2097

See merge request isc-projects/bind9!4017
2020-08-26 08:51:49 +00:00
Michal Nowak
56abe27b9e Fix generated documentation
With Sphinx 3.2.1 line-leading period should be escaped.
2020-08-26 10:34:01 +02:00
Ondřej Surý
f3270a6d88 Merge branch 'ondrej/copy-wire-test-to-fuzz' into 'main'
Add dns_message_parse() fuzzer

See merge request isc-projects/bind9!4009
2020-08-25 18:19:02 +00:00
Ondřej Surý
9d14522469 Add minimized (cmin-tmin-cmin) corpus for dns_message_parse fuzzer
The non-minimized corpus from https://github.com/CZ-NIC/dns-fuzzing was
used as input to afl-cmin, then every case were processed by afl-tmin
and then afl-cmin was used to further minimize the corpus again.
2020-08-25 16:40:24 +02:00
Ondřej Surý
01cc80376e Add dns_message_parse() fuzzer
Previously, the bin/system/wire_test.c was optionally used as a fuzzer,
this commit extracts the parts relevant to the fuzzing into a
specialized fuzzer that can be used in oss-fuzz project.

The fuzzer parses the input as UDP DNS message, then prints parsed DNS
message, then renders the DNS message and then prints the rendered DNS
message.  No part of the code should cause a assertion failure.
2020-08-25 16:40:24 +02:00
Ondřej Surý
2164b6926f Merge branch '2095-shifting-large-rcode-in-dns-message-c-results-in-undefined-behaviour' into 'main'
Resolve "Shifting large rcode in dns/message.c results in undefined behaviour"

Closes #2095

See merge request isc-projects/bind9!4011
2020-08-25 14:11:04 +00:00
Mark Andrews
a347641782 Cast the original rcode to (dns_ttl_t) when setting extended rcode
Shifting (signed) integer left could trigger undefined behaviour when
the shifted value would overflow into the sign bit (e.g. 2048).

The issue was found when using AFL++ and UBSAN:

    message.c:2274:33: runtime error: left shift of 2048 by 20 places cannot be represented in type 'int'
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior message.c:2274:33 in
2020-08-25 14:10:05 +00:00
Michal Nowak
3f85b0fe3b Merge branch '2053-test-disable-buffer-useinline-in-gitlab-ci' into 'main'
Resolve "Test --disable-buffer-useinline in GitLab CI"

Closes #2053

See merge request isc-projects/bind9!3983
2020-08-25 14:04:47 +00:00
Michal Nowak
f34df4ef90 Build CentOS 8 with --enable-buffer-useinline 2020-08-25 16:02:55 +02:00
Michal Nowak
dd425254a7 Fix warnings in when build with --enable-buffer-useinline
sockaddr.c:147:49: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness
    rdata.c:1780:30: error: pointer targets in passing argument 2 of ‘isc__buffer_putmem’ differ in signedness
2020-08-25 16:02:55 +02:00
Mark Andrews
f036e0bc7f Merge branch 'marka-add-missing-isc_mutex_init' into 'main'
Add missing isc_mutex_init to manytasks subtest.

See merge request isc-projects/bind9!3996
2020-08-24 23:54:46 +00:00
Mark Andrews
2eb5c29c83 Add missing isc_mutex_init to manytasks subtest. 2020-08-24 22:38:08 +00:00
Ondřej Surý
273d21fc93 Merge branch 'ondrej/update-pregenerated-files' into 'main'
Update pregenerated documentation files

See merge request isc-projects/bind9!4005
2020-08-24 17:48:14 +00:00
Ondřej Surý
ca487a5db0 Sync the pregenerated files with their source counterparts 2020-08-24 14:44:05 +02:00
Ondřej Surý
586415fea2 Make sure the maintainer files are clean after rebuild
When updating source files, we might forget to update pre-generated
files (generated by sphinx-build and cfg_gen) and then the extra changes
would get included in the random merge request.

This commit updates the tarball-create job to enable the maintainer
mode, then clean all maintainer files (`make maintainer-clean`) rebuild
all the file from scratch and compare the result which must be a clean
git directory.
2020-08-24 14:40:39 +02:00
Ondřej Surý
62971d4a3c Merge branch 'ondrej/update-readline-support-fix' into 'main'
Add missing support for --with-readline=yes

See merge request isc-projects/bind9!3984
2020-08-24 11:39:18 +00:00
Michal Nowak
727272934e editline's pkg-config name is libeditline 2020-08-24 09:11:47 +02:00
Michal Nowak
bc1c0d2ef4 Make sure readline configuration works 2020-08-24 09:11:47 +02:00
Ondřej Surý
713b77c70e Add missing support for --with-readline=yes
By error, ./configure --with-readline would fail, because 'yes' wasn't
handled properly in the top level case.
2020-08-24 09:11:47 +02:00
Ondřej Surý
41c9a5e428 Merge branch 'ondrej/add-notes-current.rst-to-util-copyright' into 'main'
Update util/copyright to include doc/notes/notes-current.rst

See merge request isc-projects/bind9!4002
2020-08-24 07:10:22 +00:00
Ondřej Surý
334350a75a Update util/copyright to include doc/notes/notes-current.rst 2020-08-24 09:06:13 +02:00
Michal Nowak
3df3dadaf2 Merge branch 'mnowak/update_BIND_BASELINE_VERSION_to_v9_17_4' into 'main'
Update BIND_BASELINE_VERSION to v9_17_4

See merge request isc-projects/bind9!3999
2020-08-21 09:22:09 +00:00
Michal Nowak
1b1b11a3fe Update BIND_BASELINE_VERSION to v9_17_4 2020-08-21 11:10:36 +02:00
Evan Hunt
d7362ff16d Merge tag 'v9_17_4' into main
BIND 9.17.4
2020-08-20 12:05:01 -07:00
Mark Andrews
ac67436758 Merge branch '2077-negative-hook-point-value-in-filter-aaaa-c' into 'main'
Resolve "negative hook point value in filter-aaaa.c"

Closes #2077

See merge request isc-projects/bind9!3985
2020-08-19 00:17:05 +00:00
Mark Andrews
2fd5ba6507 Remove stray '-' from filter-aaaa initialisation 2020-08-19 09:21:59 +10:00
Ondřej Surý
e51c8613e4 Merge branch 'ondrej/dns_rdata_fromwire_text-corpus-update' into 'main'
Expand, but minimize (tmin, cmin) dns_rdata_fromwire_text corpus

See merge request isc-projects/bind9!3981
2020-08-18 15:44:11 +00:00
Ondřej Surý
df26656e4b Expand, but minimize (tmin, cmin) dns_rdata_fromwire_text corpus 2020-08-18 16:39:23 +02:00
Ondřej Surý
2a8c0282da Merge branch 'marka-fuzz-consolidated' into 'main'
Consolidated fuzz fixes

See merge request isc-projects/bind9!3975
2020-08-18 09:07:47 +00:00
Ondřej Surý
62c448beaf Merge branch 'ondrej/update-readline-support' into 'main'
Update and cleanup the readline library support

See merge request isc-projects/bind9!3942
2020-08-18 09:05:51 +00:00
Mark Andrews
8452404bd7 A6: return FORMERR in fromwire if bits are non zero.
oss_fuzz: Issue 24864: bind9:dns_rdata_fromwire_text_fuzzer: Overwrites-const-input in dns_rdata_fromwire_text_fuzzer
2020-08-18 11:04:05 +02:00
Mark Andrews
f6d7b8c20d RRSIG: reject records with empty SIG section 2020-08-18 11:04:05 +02:00
Mark Andrews
3e743da1bd Disable compression in dns_rdata_fromwire_text() 2020-08-18 11:04:05 +02:00
Mark Andrews
aa811801cb dns_rdata_fromwire() only accepts input up to 2^16-1 octets. 2020-08-18 11:04:05 +02:00
Mark Andrews
e4d30cb007 Print out input if dns_rdata_fromtext() fails in debug mode. 2020-08-18 11:04:05 +02:00
Mark Andrews
2e748ba397 Add the ability to specify an input file 2020-08-18 11:04:05 +02:00
Ondřej Surý
be8c589f28 Add CHANGES note for GL !3942 2020-08-18 10:27:37 +02:00
Ondřej Surý
ba2376b9e0 Update and cleanup the readline library support
This commit updates and simplifies the checks for the readline support
in nslookup and nsupdate:

  * Change the autoconf checks to pkg-config only, all supported
    libraries have accompanying .pc files now.
  * Add editline support in addition to libedit and GNU readline
  * Add isc/readline.h shim header that defines dummy readline()
    function when no readline library is available
2020-08-18 10:27:14 +02:00
Michal Nowak
99ca842e0a Merge branch 'mnowak/gcovr' into 'main'
Report coverage with gcovr

Closes isc-private/bind-qa#23

See merge request isc-projects/bind9!3606
2020-08-17 15:21:41 +00:00
Michal Nowak
8d15bef0dd Report coverage with gcovr 2020-08-17 17:19:32 +02:00
Michal Nowak
d5350db5bc Merge branch 'mnowak/broaden-abi-check-scope' into 'main'
Broaden scope of abi-check

See merge request isc-projects/bind9!3927
2020-08-17 13:07:15 +00:00
Michal Nowak
8e43f5e860 Broaden scope of abi-check
For abi-check we should use as broad 'configure' options as possible.
2020-08-17 14:58:32 +02:00
Mark Andrews
f85bb0691c Merge branch 'patch-3' into 'main'
Option -s is not supported in tsig-keygen

See merge request isc-projects/bind9!3966
2020-08-17 02:35:33 +00:00
JP Mens
b01d26c608 Option -s is not supported in tsig-keygen 2020-08-16 16:23:48 +00:00
Mark Andrews
4005cc3864 Merge branch 'marka-bad-bool-value' into 'main'
Ensure that a bool is stored in 'eol'

See merge request isc-projects/bind9!3960
2020-08-14 04:42:23 +00:00
Mark Andrews
8b75833aaa Ensure that a bool is stored in 'eol'
oss-fuzz: Issue 24875: bind9:isc_lex_getmastertoken_fuzzer: Invalid-bool-value in isc_lex_getmastertoken.c
2020-08-14 08:35:17 +10:00
Ondřej Surý
53f229f499 Merge branch 'ondrej/fix-oss-fuzz-debug' into 'main'
Move the debug variable from main.c to individual fuzzer

See merge request isc-projects/bind9!3959
2020-08-13 16:00:08 +00:00
Ondřej Surý
915616a34e Move the debug variable from main.c to individual fuzzer
The fuzzers needs to be completely independent of the main.c for
OSS-Fuzz to work.
2020-08-13 17:55:38 +02:00
Mark Andrews
dd29e2550c Merge branch 'marka-fuzz-fixes' into 'main'
Add issues found by dns_rdata_fromwiretext fuzzer.

See merge request isc-projects/bind9!3953
2020-08-13 14:08:50 +00:00
Mark Andrews
80d69ba04c Add CHANGES note 2020-08-13 23:16:18 +10:00
Mark Andrews
7ae055cef1 Add previously detected dns_rdata_fromwire_text failures 2020-08-13 23:16:18 +10:00
Mark Andrews
7e49689746 X25: Check that record is all ASCII digits 2020-08-13 23:06:55 +10:00
Mark Andrews
9d446142d8 WKS: reject records with zero octets at the end of the bitmap 2020-08-13 23:06:55 +10:00
Mark Andrews
3429c35f52 TLSA: fix fromwire length checks 2020-08-13 23:06:55 +10:00
Mark Andrews
9b93e5d684 SIG: reject records with a zero length signature 2020-08-13 23:06:55 +10:00
Mark Andrews
73dd849655 NXT: fix fromwire bitmap checks 2020-08-13 23:06:55 +10:00
Mark Andrews
7dc8e720ff NSEC3PARAM: check that saltlen is consistent with the rdata length 2020-08-13 23:06:55 +10:00
Mark Andrews
031ee9e279 NSEC3: reject records with a zero length hash field 2020-08-13 23:06:55 +10:00
Mark Andrews
d7f7014803 IPSECKEY: require non-zero length public keys 2020-08-13 23:06:55 +10:00
Mark Andrews
a238f37239 CERT: reject records with a empty certificate field 2020-08-13 23:06:55 +10:00
Mark Andrews
3c492b3ef1 Get rid of type 'RESERVED0'. 2020-08-13 23:06:55 +10:00
Mark Andrews
a92d973430 dns_rdata_fromwire_text fixes:
* Disallow compression pointers in names as we are not
  reading from a packet and as a result length checks fail.
* Increase totext buffer size as fuzzer ran out of space on
  big bitmaps.
* NUL terminate totext to make fault diagnosis easier.
* Add debugging messages to make fault diagnosie easier.
2020-08-13 23:06:55 +10:00
Mark Andrews
6c7e50c267 base32_decode*() could incorrectly decode a input.
base32_decode_char() added a extra zero octet to the output
if the fifth character was a pad character.  The length
of octets to copy to the output was set to 3 instead of 2.
2020-08-13 23:06:55 +10:00
Matthijs Mekking
9bb966d579 Merge branch 'matthijs-fix-kasp-test-next-key-event' into 'main'
Update check next key events after rndc checkds

See merge request isc-projects/bind9!3937
2020-08-13 10:04:10 +00:00
Matthijs Mekking
262b52a154 Fix check next key event check in kasp test
Prevent intermittent false positives on slow platforms by subtracting
the number of seconds which passed between key creation and invoking
'rndc dnssec -checkds'.

This particularly fails for the step3.csk-roll2.autosign zone because
the closest next key event is when the zone signatures become
omnipresent. Running 'rndc dnssec -checkds' some time later means
that the next key event is in fact closer than the calculated time
and thus we need to adjust the expected time by the time already
passed.
2020-08-13 10:30:31 +02:00
Ondřej Surý
eeb8b80547 Merge branch 'marka-handle-eof' into 'main'
Address infinite loop on EOF.

See merge request isc-projects/bind9!3954
2020-08-13 07:21:19 +00:00
Mark Andrews
c59ab04f6f Address infinite loop on EOF. 2020-08-13 16:42:40 +10:00
Ondřej Surý
191887ef2b Merge branch 'ondrej/oss-fuzz' into 'main'
Couple of minor changes to the autoconf for the OSS-Fuzz project

See merge request isc-projects/bind9!3951
2020-08-12 20:56:50 +00:00
Ondřej Surý
f9aba90342 Add explicit support of OSS-Fuzz
The --enable-fuzzing option now allows third choice "ossfuzz" that just
adds $LIB_FUZZING_ENGINE to FUZZ_LDFLAGS to make the fuzzer builds
compatible with OSS-Fuzz project that has some special quirks (the
main() routine is provided in the static library the project provides).
2020-08-12 21:58:45 +02:00
Ondřej Surý
eb0d5a9526 Allow static linking in the developer mode
Previously, we have disallowed static linking (for good reasons).
However, there are legitimate reasons where static linking might be
useful, and one of the reasons is the OSS-Fuzz project that doesn't have
the libraries used for build, so static linking is the sane option here.

The static linking is still disallowed in the "production" builds, but
it's not possible to disable shared and enable static libraries when
used together with --enable-developer.
2020-08-12 21:56:37 +02:00
Ondřej Surý
c8538c50b4 Merge branch '2064-fix-isc_lex_getmastertoken-fuzzing' into 'main'
Really fuzz isc_lex_getmastertoken() in the test

Closes #2064

See merge request isc-projects/bind9!3949
2020-08-12 19:53:49 +00:00
Ondřej Surý
790476332e Really fuzz isc_lex_getmastertoken() in the test
There was a copy&paste error in fuzz/isc_lex_getmastertoken.c where we
didn't really test the function we wanted to test.  Update the test to
have the input data to always include expected 'tokentype' in the first
byte, `eol` argument in the second byte and the rest of the input is the
data to parse.
2020-08-12 21:49:31 +02:00
Michal Nowak
88ad7b85e6 Merge branch 'mnowak/fix-core-dumps-were-found-line' into 'main'
Make sure .txt files are not identified as crashed test

See merge request isc-projects/bind9!3909
2020-08-12 07:48:05 +00:00
Michal Nowak
c2dcd95966 Make sure .txt files are not identified as crashed test
Previously .txt files with full backtrace may be identified as a
crashed test:

    I:Core dumps were found for the following system tests:
    I:	 core.19948-backtrace.txt
    I:   shutdown

Now .txt files are removed from the list.

Change 'run.sh.in' to match the core matching pattern in
'testsummary.sh'.
2020-08-12 09:45:56 +02:00
Mark Andrews
852a2d834f Merge branch '2045-readline-rltypedefs-h-35-22-error-this-function-declaration-is-not-a-prototype-on-netbsd-9' into 'main'
Resolve "readline/rltypedefs.h:35:22: error: this function declaration is not a prototype on NetBSD 9"

Closes #2045

See merge request isc-projects/bind9!3926
2020-08-11 23:34:55 +00:00
Mark Andrews
fd126553d4 Ensure rl_message() gets prototype. 2020-08-11 23:21:17 +00:00
Mark Andrews
1532a34658 Stop deprecated functions being defined 2020-08-11 23:21:17 +00:00
Michal Nowak
a53a0a8df1 Merge branch 'mnowak/run-tarball-tests-in-schedule' into 'main'
Run unit and system tarball tests on schedules

See merge request isc-projects/bind9!3928
2020-08-11 14:59:35 +00:00
Michal Nowak
439fe9bc3c Run unit and system tarball tests on schedules
To prevent problems with unit and system tarball tests being revealed
during release process, run these tests on schedules.
2020-08-11 16:58:28 +02:00
Mark Andrews
ba6af6d507 Merge branch '2067-nta-related-crash-in-checkbogus-after-an-rndc-reload' into 'main'
Resolve "NTA-related crash in checkbogus() after an "rndc reload""

Closes #2067

See merge request isc-projects/bind9!3930
2020-08-11 01:45:43 +00:00
Mark Andrews
0b2555e8cf Address use after free between view, resolver and nta.
Hold a weak reference to the view so that it can't go away while
nta is performing its lookups.  Cancel nta timers once all external
references to the view have gone to prevent them triggering new work.
2020-08-11 11:00:49 +10:00
Mark Andrews
f9537a6f2a Merge branch '2027-update-managed-keys-log-messages' into 'main'
Resolve "Slightly misleading diagnostic when revoked key is removed from managed-keys zone"

Closes #2027

See merge request isc-projects/bind9!3934
2020-08-11 00:54:39 +00:00
Mark Andrews
c9f019c931 Update managed keys log messages to be less confusing. 2020-08-11 00:10:10 +00:00
Evan Hunt
fec73c7e79 Merge branch 'each-fix-typo' into 'main'
fix ARM typo

See merge request isc-projects/bind9!3938
2020-08-10 19:38:49 +00:00
Evan Hunt
a69afb37e0 fix ARM typo 2020-08-10 12:36:29 -07:00
Ondřej Surý
9a2a819817 Reduce the default RBT hash table size to 16 entries (4 bits)
The hash table rework MRs (!3865, !3871) increased the default RBT hash
table size from 64 to 65,536 entries (for 64-bit architectures, that is
512 bytes before vs. 524,288 bytes after).  This works fine for RBTs
used for cache databases, but since three separate RBT databases are
created for every zone loaded (RRs, NSEC, NSEC3), memory usage would
skyrocket when BIND 9 is used as an authoritative DNS server with many
zones.

The default RBT hash table size before the rework was 64 entries, this
commit reduces it to 16 entries because our educated guess is that most
zones are just couple of entries (SOA, NS, A, AAAA, MX) and rehashing
small hash tables is actually cheap.  The rework we did in the previous
MRs tries to avoid growing the hash tables for big-to-huge caches where
growing the hash table comes at a price because the whole cache needs to
be locked.

(cherry picked from commit 1e043a011b)
2020-08-10 12:08:09 +02:00
Michał Kępień
e151eb3aa3 Merge branch '1775-pick-smaller-default-rbt-hash-table-size' into 'main'
Reduce the default rbt hashtable size to 16 entries (4 bits)

Closes #1775

See merge request isc-projects/bind9!3935
2020-08-10 09:29:16 +00:00
Ondřej Surý
1e043a011b Reduce the default RBT hash table size to 16 entries (4 bits)
The hash table rework MRs (!3865, !3871) increased the default RBT hash
table size from 64 to 65,536 entries (for 64-bit architectures, that is
512 bytes before vs. 524,288 bytes after).  This works fine for RBTs
used for cache databases, but since three separate RBT databases are
created for every zone loaded (RRs, NSEC, NSEC3), memory usage would
skyrocket when BIND 9 is used as an authoritative DNS server with many
zones.

The default RBT hash table size before the rework was 64 entries, this
commit reduces it to 16 entries because our educated guess is that most
zones are just couple of entries (SOA, NS, A, AAAA, MX) and rehashing
small hash tables is actually cheap.  The rework we did in the previous
MRs tries to avoid growing the hash tables for big-to-huge caches where
growing the hash table comes at a price because the whole cache needs to
be locked.
2020-08-10 10:31:19 +02:00
Michal Nowak
cde7f982eb Merge branch 'michal/do-not-run-make-recheck-if-the-test-suite-fails' into 'main'
Do not run "make recheck" if the test suite fails

See merge request isc-projects/bind9!3932
2020-08-07 14:38:38 +00:00
Michał Kępień
5a4076fc40 Do not run "make recheck" if the test suite fails
Running "make recheck" after the test suite fails hides intermittent
system test failures in GitLab CI.  This makes it hard to identify which
branches are affected by a particular test failure mode and causes CI
results to be overly optimistic.  Prevent "make recheck" from being run
when "make check" fails to ensure GitLab CI results properly reflect the
stability of the "main" branch.
2020-08-07 14:35:05 +02:00
Matthijs Mekking
82e9287459 Merge branch '1613-rndc-dnssec-checkds' into 'main'
Resolve "Signal DS submitting via rndc"

Closes #1613

See merge request isc-projects/bind9!3906
2020-08-07 11:19:09 +00:00
Matthijs Mekking
46fcd927e7 rndc dnssec -checkds set algorithm
In the rare case that you have multiple keys acting as KSK and that
have the same keytag, you can now set the algorithm when calling
'-checkds'.
2020-08-07 11:26:09 +02:00
Matthijs Mekking
e4c82fc7ae Add notes for #1613 (rndc dnssec -checkds)
This is a new feature that should be mentioned in the notes.
2020-08-07 11:26:09 +02:00
Matthijs Mekking
a43bb41909 Test 'rndc dnssec -checkds' on multiple zones
Make sure the 'checkds' command correctly sets the right key timing
metadata and also make sure that it rejects setting the key timing
metadata if there are multiple keys with the KSK role and no key
identifier is provided.
2020-08-07 11:26:09 +02:00
Matthijs Mekking
a25f49f153 Make 'parent-registration-delay' obsolete
With the introduction of 'checkds', the 'parent-registration-delay'
option becomes obsolete.
2020-08-07 11:26:09 +02:00
Matthijs Mekking
38cb43bc86 Adjust kasp tests to use 'checkds'
With 'checkds' replacing 'parent-registration-delay', the kasp
test needs the expected times to be adjusted. Also the system test
needs to call 'rndc dnssec -checkds' to progress the rollovers.

Since we pretend that the KSK is active as soon as the DS is
submitted (and parent registration delay is no longer applicable)
we can simplify the 'csk_rollover_predecessor_keytimes' function
to take only one "addtime" parameter.

This commit also slightly changes the 'check_dnssecstatus' function,
passing the zone as a parameter.
2020-08-07 11:26:09 +02:00
Matthijs Mekking
e3eb55fd1c Fix time printing in key files
Don't strip off the final character when printing times in key files.

With the introduction of 'rndc dnssec -status' we introduced
'isc_stdtime_tostring()'. This changed in behavior such that it was no
longer needed to strip of the final '\n' of the string format
datetime. However, in 'printtime()' it still stripped the final
character.
2020-08-07 11:26:09 +02:00
Matthijs Mekking
04d8fc0143 Implement 'rndc dnssec -checkds'
Add a new 'rndc' command 'dnssec -checkds' that allows the user to
signal named that a new DS record has been seen published in the
parent, or that an existing DS record has been withdrawn from the
parent.

Upon the 'checkds' request, 'named' will write out the new state for
the key, updating the 'DSPublish' or 'DSRemoved' timing metadata.

This replaces the "parent-registration-delay" configuration option,
this was unreliable because it was purely time based (if the user
did not actually submit the new DS to the parent for example, this
could result in an invalid DNSSEC state).

Because we cannot rely on the parent registration delay for state
transition, we need to replace it with a different guard. Instead,
if a key wants its DS state to be moved to RUMOURED, the "DSPublish"
time must be set and must not be in the future. If a key wants its
DS state to be moved to UNRETENTIVE, the "DSRemoved" time must be set
and must not be in the future.

By default, with '-checkds' you set the time that the DS has been
published or withdrawn to now, but you can set a different time with
'-when'. If there is only one KSK for the zone, that key has its
DS state moved to RUMOURED. If there are multiple keys for the zone,
specify the right key with '-key'.
2020-08-07 11:26:09 +02:00
Michał Kępień
94d9ffd4a2 Include fuzz/fuzz.h in source tarballs 2020-08-06 09:10:06 +02:00
Michał Kępień
6707a8558b Update BIND version to 9.17.4 2020-08-06 09:10:06 +02:00
Michał Kępień
8e212e96af Add a CHANGES marker 2020-08-06 09:10:06 +02:00
Michał Kępień
b096a038e3 Update library API versions 2020-08-06 09:10:06 +02:00
Michał Kępień
5ef9233326 Merge branch 'michal/prepare-release-notes-for-bind-9.17.4' into 'security-main'
Prepare release notes for BIND 9.17.4

See merge request isc-private/bind9!186
2020-08-06 06:14:38 +00:00
Michał Kępień
8980d219c7 Reorder release notes 2020-08-05 16:02:38 +02:00
Michał Kępień
e0f394bbc4 Prepare release notes for BIND 9.17.4 2020-08-05 16:02:38 +02:00
Michał Kępień
9d932c6ddc Add release note for #1976 2020-08-05 16:02:38 +02:00
Michał Kępień
23a60ecd15 Add release note for #1619 2020-08-05 16:02:38 +02:00
Michał Kępień
bc212cf163 Tweak and reword release notes 2020-08-05 16:02:38 +02:00
Michał Kępień
76421c885e Tweak and reword recent CHANGES entries 2020-08-05 16:02:38 +02:00
Michał Kępień
18b71e9c25 Merge branch '2055-grant-subdomain-fix' into 'security-main'
[CVE-2020-8624] Fix processing of "update-policy" rules of type "subdomain"

See merge request isc-private/bind9!189
2020-08-05 13:57:57 +00:00
Mark Andrews
4fb94906fa Add CHANGES and release note for GL #2055 2020-08-05 15:54:50 +02:00
Mark Andrews
94bc07cf05 Add a test for update-policy 'zonesub'
The new test checks that 'update-policy zonesub' is properly enforced.
2020-08-05 15:54:50 +02:00
Mark Andrews
9b242cc707 Add a test for update-policy 'subdomain'
The new test checks that 'update-policy subdomain' is properly enforced.
2020-08-05 15:54:50 +02:00
Mark Andrews
952955aa4c Update-policy 'subdomain' was incorrectly treated as 'zonesub'
resulting in names outside the specified subdomain having the wrong
restrictions for the given key.
2020-08-05 15:54:50 +02:00
Michał Kępień
10954a11de Merge branch '2037-confidential-issue' into 'security-main'
[CVE-2020-8623]: Fix crash in pk11_numbits() with crafted packet when native-pkcs11 is used

See merge request isc-private/bind9!187
2020-08-05 13:54:14 +00:00
Ondřej Surý
aaeea046ed Add CHANGES and release note for GL #2037 2020-08-05 15:51:29 +02:00
Ondřej Surý
52733368fd Don't strip the SOFTHSM2_CONF and SLOT environment variables when using ./run.sh 2020-08-05 15:51:29 +02:00
Ondřej Surý
6b7629f323 Fix crash in pk11_numbits() when native-pkcs11 is used
When pk11_numbits() is passed a user provided input that contains all
zeroes (via crafted DNS message), it would crash with assertion
failure.  Fix that by properly handling such input.
2020-08-05 15:51:29 +02:00
Michał Kępień
aa863855f5 Merge branch '2028-unexpectedend-and-tsig' into 'security-main'
[CVE-2020-8622] Properly handle malformed truncated responses to TSIG queries

See merge request isc-private/bind9!185
2020-08-05 13:50:27 +00:00
Mark Andrews
e576baad9d Add CHANGES and release notes for GL #2028 2020-08-05 15:47:14 +02:00
Mark Andrews
70a71de9c9 Always keep a copy of the message
this allows it to be available even when dns_message_parse()
returns a error.
2020-08-05 15:47:14 +02:00
Michał Kępień
57fbc57b2e Merge branch '1997-confidential-issue' into 'security-main'
[CVE-2020-8621] Ensure QNAME minimization is permanently disabled when forwarding

See merge request isc-private/bind9!184
2020-08-05 13:46:23 +00:00
Evan Hunt
a3e42f8599 Add CHANGES and release note for GL #1997 2020-08-05 15:43:52 +02:00
Evan Hunt
51c9ea98a3 permanently disable QNAME minimization in a fetch when forwarding
QNAME minimization is normally disabled when forwarding. if, in the
course of processing a fetch, we switch back to normal recursion at
some point, we can't safely start minimizing because we may have
been left in an inconsistent state.
2020-08-05 15:43:52 +02:00
Michał Kępień
c6a08a727d Merge branch '1996-confidential-issue' into 'security-main'
[CVE-2020-8620] Fix TCP DNS buffer sizes

See merge request isc-private/bind9!181
2020-08-05 13:31:59 +00:00
Ondřej Surý
f2b41e11b4 Add CHANGES and release note for GL #1996 2020-08-05 12:57:23 +02:00
Evan Hunt
38264b6a4d Use different allocators for UDP and TCP
Each worker has a receive buffer with space for 20 DNS messages of up
to 2^16 bytes each, and the allocator function passed to uv_read_start()
or uv_udp_recv_start() will reserve a portion of it for use by sockets.
UDP can use recvmmsg() and so it needs that entire space, but TCP reads
one message at a time.

This commit introduces separate allocator functions for TCP and UDP
setting different buffer size limits, so that libuv will provide the
correct buffer sizes to each of them.
2020-08-05 12:57:23 +02:00
Michał Kępień
f0fa6f0245 Merge branch 'michal/remove-arm64-jobs-from-gitlab-ci' into 'main'
Remove arm64 jobs from GitLab CI

See merge request isc-projects/bind9!3920
2020-08-05 10:07:20 +00:00
Michał Kępień
49f245f7c0 Remove arm64 jobs from GitLab CI
The only arm64 runner we have at our disposal is suffering from
intermittent connectivity issues which make it unusable for extended
periods of time.  Remove arm64 jobs from GitLab CI until we manage to
set up an arm64 runner with more reliable connectivity.
2020-08-05 12:04:59 +02:00
Michał Kępień
72786a27c7 Merge branch '2065-set-max-cache-size-in-the-geoip2-system-test' into 'main'
Set "max-cache-size" in the "geoip2" system test

Closes #2065

See merge request isc-projects/bind9!3919
2020-08-05 09:07:52 +00:00
Michał Kępień
4292d5bdfe Set "max-cache-size" in the "geoip2" system test
The named configuration files used in the "geoip2" system test cause a
rather large number of views (6-8) to be set up in each tested named
instance.  Each view has its own cache.

Commit e24bc324b4 caused the RBT hash
table to be pre-allocated to a size derived from "max-cache-size", so
that it never needs to be rehashed.  The size of that hash table is not
expected to be significant enough to cause memory use issues in typical
conditions even for large "max-cache-size" settings.

However, these two factors combined can cause memory exhaustion issues
in GitLab CI, where we run multiple "instances" of the test suite in
parallel on the same runner, each test suite executes multiple system
tests concurrently, and each system test may potentially start multiple
named instances at the same time.  In practice, this problem currently
only seems to be affecting the "geoip2" system test, which is failing
intermittently due to named instances used by that test getting killed
by oom-killer.

Prevent the "geoip2" system test from failing intermittently by setting
"max-cache-size" in named configuration files used in that test to a low
value in order to keep memory usage at bay even with a large number of
views configured.
2020-08-05 10:38:06 +02:00
Michał Kępień
550b82e27b Merge branch '2030-bind-arm-incorrectly-documents-the-processing-of-forwarders-still-has-the-pre-9-3-0-explanation' into 'main'
Resolve "BIND ARM incorrectly documents the processing of forwarders (still has the pre 9.3.0 explanation)"

Closes #2030

See merge request isc-projects/bind9!3881
2020-08-04 19:44:27 +00:00
Suzanne Goldlust
30e126ad02 Update description of forwarding behavior in ARM 2020-08-04 21:39:31 +02:00
Michał Kępień
500527b4da Merge branch 'michal/add-placeholder-for-1475' into 'main'
Add placeholder for #1475

See merge request isc-projects/bind9!3916
2020-08-04 13:49:37 +00:00
Michał Kępień
232297142d Add placeholder for #1475 2020-08-04 15:46:34 +02:00
Mark Andrews
dc8fe44224 Merge branch 'marka-DNS_R_BADTSIG-map-to-FORMERR' into 'main'
Map DNS_R_BADTSIG to FORMERR

See merge request isc-projects/bind9!3877
2020-08-04 13:02:24 +00:00
Mark Andrews
88ff6b846c Check rcode is FORMERR 2020-08-04 12:20:37 +00:00
Mark Andrews
20488d6ad3 Map DNS_R_BADTSIG to FORMERR
Now that the log message has been printed set the result code to
DNS_R_FORMERR.  We don't do this via dns_result_torcode() as we
don't want upstream errors to produce FORMERR if that processing
end with DNS_R_BADTSIG.
2020-08-04 12:20:37 +00:00
Matthijs Mekking
bf760383e8 Merge branch 'ondrej/serve-stale-improvements' into 'main'
Serve-stale improvements

Closes #1712 and #1829

See merge request isc-projects/bind9!3872
2020-08-04 12:17:57 +00:00
Ondřej Surý
dd62275152 Add CHANGES and release notes for GL #1712 and GL #1829 2020-08-04 10:51:09 +02:00
Ondřej Surý
abc2ab9223 Add tests with stale-cache-disabled into serve-stale system test
Add a fifth named (ns5) that runs with `stale-cache-enable no;` and
check that there are no stale records in the cache.
2020-08-04 10:50:31 +02:00
Ondřej Surý
6ffa2ddae0 Expire the 0 TTL RRSet quickly rather using them for serve-stale
When a received RRSet has TTL 0, they would be preserved for
serve-stale (default `max-stale-cache` is 12 hours) rather than expiring
them quickly from the cache database.

This commit makes sure the RRSet didn't have TTL 0 before marking the
entry in the database as "stale".
2020-08-04 10:50:31 +02:00
Ondřej Surý
ce53db34d6 Add stale-cache-enable option and disable serve-stable by default
The current serve-stale implementation in BIND 9 stores all received
records in the cache for a max-stale-ttl interval (default 12 hours).

This allows DNS operators to turn the serve-stale answers in an event of
large authoritative DNS outage.  The caching of the stale answers needs
to be enabled before the outage happens or the feature would be
otherwise useless.

The negative consequence of the default setting is the inevitable
cache-bloat that happens for every and each DNS operator running named.

In this MR, a new configuration option `stale-cache-enable` is
introduced that allows the operators to selectively enable or disable
the serve-stale feature of BIND 9 based on their decision.

The newly introduced option has been disabled by default,
e.g. serve-stale is disabled in the default configuration and has to be
enabled if required.
2020-08-04 10:50:31 +02:00
Mark Andrews
f2040a0039 Merge branch '2026-readme-md-typo' into 'main'
Resolve "README.md -- typo"

Closes #2026

See merge request isc-projects/bind9!3912
2020-08-04 02:23:54 +00:00
Mark Andrews
532bf267af Fixup typo in 'xcode-select --install' 2020-08-04 12:19:15 +10:00
Michał Kępień
4b6113379a Merge branch 'michal/restore-placeholder-entry-at-sequence-number-5481' into 'main'
Restore placeholder entry at sequence number 5481

See merge request isc-projects/bind9!3910
2020-08-03 20:13:12 +00:00
Michał Kępień
029e32c01a Restore placeholder entry at sequence number 5481 2020-08-03 22:09:47 +02:00
Ondřej Surý
0c85c4c424 Merge branch 'ondrej/add-isc_lex-fuzzing-test' into 'main'
Re-enable tests in fuzz directory and add isc_lex_gettoken() and isc_lex_getmastertoken() tests

See merge request isc-projects/bind9!3908
2020-07-31 15:55:58 +00:00
Ondřej Surý
ba99bdbf6f Add fuzzing for the isc_lex (isc_lex_gettoken,isc_lex_getmastertoken) API
In this commit, the simple fuzzing tests for the isc_lex_gettoken() and
isc_lex_getmastertoken() functions have been added.

As part of this commit, the initialization has been moved from fuzz.h
constructor/destructor to LLVMFuzzerInitialize() in each fuzz test.  The
main.c of no-fuzzing and AFL modes have been modified to run the
LLVMFuzzerInitialize() at the start of the main() function mimicking
the libfuzzer mode of operation.
2020-07-31 17:28:35 +02:00
Ondřej Surý
23b1caabae Re-enable the fuzzing tests
The fuzzing tests were temporarily disabled when the build system has been
converted to automake.  This commit restores the functionality to run the
fuzzing tests as part of the `make check`.  When the afl or libfuzzer
is enabled via ./configure, it uses a custom LOG_DRIVER (fuzz/<fuzzer.sh>).

Currently only libfuzzer.sh has been implemented that runs each fuzz
test for 5 seconds each.
2020-07-31 17:28:35 +02:00
Ondřej Surý
8acdccc955 Merge branch '2038-use-freebind-when-bind-fails' into 'main'
Resolve "Bind not handling interfaces changes correctly when listen-on-v6  any  specified"

Closes #2038

See merge request isc-projects/bind9!3873
2020-07-31 11:32:40 +00:00
Witold Kręcicki
94eda43ab2 Add CHANGES and release note for GL #2038 2020-07-31 12:44:22 +02:00
Witold Kręcicki
a0f7d28967 netmgr: retry binding with IP_FREEBIND when EADDRNOTAVAIL is returned.
When a new IPv6 interface/address appears it's first in a tentative
state - in which we cannot bind to it, yet it's already being reported
by the route socket. Because of that BIND9 is unable to listen on any
newly detected IPv6 addresses. Fix it by setting IP_FREEBIND option (or
equivalent option on other OSes) and then retrying bind() call.
2020-07-31 12:44:22 +02:00
Ondřej Surý
2ac7748d2b Merge branch 'ondrej/remove-distros-near-eol' into 'main'
Remove CentOS 6 from GitLab CI, it will EOL before BIND 9.18 is released

See merge request isc-projects/bind9!3799
2020-07-31 10:27:03 +00:00
Ondřej Surý
db1b344020 Remove CentOS 6 from GitLab CI
CentOS 6 will reach EoL on November 30th, 2020, i.e. before BIND 9.18
will be released.  Remove it from GitLab CI.
2020-07-31 12:09:17 +02:00
Ondřej Surý
fcdf0d3bc3 Merge branch 'ondrej/documentation-rebuild' into 'main'
Rebuild the documentation

See merge request isc-projects/bind9!3905
2020-07-31 08:52:28 +00:00
Ondřej Surý
4a8670ddaf Rebuild the documentation 2020-07-31 10:02:23 +02:00
Ondřej Surý
12c9a767eb Merge branch 'ondrej/august-release-placeholders-1' into 'main'
Add placeholders for August release

See merge request isc-projects/bind9!3903
2020-07-31 07:28:38 +00:00
Ondřej Surý
852c5cde5a Add CHANGES placeholder for [GL #2055] 2020-07-31 09:27:00 +02:00
Ondřej Surý
c50fb6f30d Add CHANGES placeholder for [GL #1997] 2020-07-31 09:24:56 +02:00
Ondřej Surý
107e6997fb Add CHANGES placeholder for [GL #1996] 2020-07-31 09:23:52 +02:00
Ondřej Surý
ec4883ff52 Add CHANGES placeholder for [GL #2037] 2020-07-31 09:21:32 +02:00
Mark Andrews
649cb54400 Merge branch '2020-configure-call-needs-to-be-cleaned-up-main-gcc-centos6-amd64' into 'main'
Resolve "configure call needs to be cleaned up main: gcc:centos6:amd64"

Closes #2020

See merge request isc-projects/bind9!3853
2020-07-31 06:26:11 +00:00
Mark Andrews
305ca032a0 remove --with-python from summary 2020-07-31 05:21:40 +00:00
Mark Andrews
355b7899ee remove references to --with-libtool 2020-07-31 05:21:40 +00:00
Mark Andrews
11207eacd5 Remove --with-libtool comment from README 2020-07-31 05:21:40 +00:00
Mark Andrews
2cd8fc02b0 Remove no longer valid configure flags from configure calls:
--with-libtool, --without-make-clean, --with-python
2020-07-31 05:21:40 +00:00
Mark Andrews
9b0b045554 Merge branch '1456-always-check-return-from-isc_refcount_decrement' into 'main'
Resolve "always check return from isc_refcount_decrement"

Closes #1456

See merge request isc-projects/bind9!2707
2020-07-31 00:56:45 +00:00
Mark Andrews
bde5c7632a Always check the return from isc_refcount_decrement.
Created isc_refcount_decrement_expect macro to test conditionally
the return value to ensure it is in expected range.  Converted
unchecked isc_refcount_decrement to use isc_refcount_decrement_expect.
Converted INSIST(isc_refcount_decrement()...) to isc_refcount_decrement_expect.
2020-07-31 10:15:44 +10:00
Mark Andrews
92059fc7db Merge branch '2033-rndc-dnstap-roll-fix-was-incomplete' into 'main'
Resolve "'rndc dnstap --roll' fix was incomplete"

Closes #2033

See merge request isc-projects/bind9!3868
2020-07-30 23:59:42 +00:00
Mark Andrews
aca18b8b5b Refactor the code that counts the last log version to keep
When silencing the Coverity warning in remove_old_tsversions(), the code
was refactored to reduce the indentation levels and break down the long
code into individual functions.  This improve fix for [GL #1989].
2020-07-31 09:30:12 +10:00
Michal Nowak
d9f862337a Merge branch '48-drop-systemtesttop-from-bin-tests-system' into 'main'
Drop $SYSTEMTESTTOP from bin/tests/system/

Closes #48

See merge request isc-projects/bind9!3623
2020-07-30 14:14:39 +00:00
Michal Nowak
954731cfa3 Make sure we don't introduce SYSTEMTESTTOP anymore
':!.gitlab-ci.yml' is a pathspec pattern used to limit paths in the "git
grep" command to all but the .gitlab-ci.yml file which includes the
checked word itself. This requires Git 2.13.
2020-07-30 15:58:54 +02:00
Michal Nowak
a3b02d627f Remove cross-test dependency on ckdnsrps.sh 2020-07-30 15:58:54 +02:00
Michal Nowak
68488dd98c Fix name of the test directory of stop.pl in masterformat test 2020-07-30 15:58:54 +02:00
Michal Nowak
32ee08e21a Ensure test fails if packet.pl does not work as expected 2020-07-30 15:58:54 +02:00
Michal Nowak
14bc22d7a4 Source config.guess from source root
It seems that config.guess gets always created in source root, so for
that sake of out-of-tree system test, we should expect the file there
instead of where configure was run.
2020-07-30 15:58:53 +02:00
Michal Nowak
093af1c00a Drop $SYSTEMTESTTOP from bin/tests/system/
The $SYSTEMTESTTOP shell variable if often set to .. in various shell
scripts inside bin/tests/system/, but most of the time it is only
used one line later, while sourcing conf.sh. This hardly improves
code readability.

$SYSTEMTESTTOP is also used for the purpose of referencing
scripts/files living in bin/tests/system/, but given that the
variable is always set to a short, relative path, we can drop it and
replace all of its occurrences with the relative path without adversely
affecting code readability.
2020-07-30 15:58:50 +02:00
Michał Kępień
6237be992f Merge branch 'michal/only-run-system-tests-as-root-in-developer-mode' into 'main'
Only run system tests as root in developer mode

See merge request isc-projects/bind9!3894
2020-07-30 13:45:00 +00:00
Michał Kępień
3ef106f69d Only run system tests as root in developer mode
Running system tests with root privileges is potentially dangerous.
Only allow it when explicitly requested (by building with
--enable-developer).
2020-07-30 14:07:49 +02:00
Michał Kępień
1ce582ca47 Merge branch '2024-fix-idle-timeout-for-connected-tcp-sockets' into 'main'
Fix idle timeout for connected TCP sockets

Closes #2024

See merge request isc-projects/bind9!3854
2020-07-30 09:32:07 +00:00
Michał Kępień
18efb2456f Add CHANGES for GL #2024 2020-07-30 10:58:39 +02:00
Michał Kępień
953d704bd2 Fix idle timeout for connected TCP sockets
When named acting as a resolver connects to an authoritative server over
TCP, it sets the idle timeout for that connection to 20 seconds.  This
fixed timeout was picked back when the default processing timeout for
each client query was hardcoded to 30 seconds.  Commit
000a8970f8 made this processing timeout
configurable through "resolver-query-timeout" and decreased its default
value to 10 seconds, but the idle TCP timeout was not adjusted to
reflect that change.  As a result, with the current defaults in effect,
a single hung TCP connection will consistently cause the resolution
process for a given query to time out.

Set the idle timeout for connected TCP sockets to half of the client
query processing timeout configured for a resolver.  This allows named
to handle hung TCP connections more robustly and prevents the timeout
mismatch issue from resurfacing in the future if the default is ever
changed again.
2020-07-30 10:58:39 +02:00
Mark Andrews
e7771dc902 Merge branch 'marka-placeholder' into 'main'
placeholder for [GL #2028]

See merge request isc-projects/bind9!3893
2020-07-29 23:39:16 +00:00
Mark Andrews
8e142e6e80 placeholder for [GL #2028] 2020-07-30 09:34:58 +10:00
Evan Hunt
c99381ce20 Merge branch '2050-libuv-version' into 'main'
report libuv version string in `named -V`

Closes #2050

See merge request isc-projects/bind9!3887
2020-07-28 02:49:19 +00:00
Evan Hunt
1036338a10 report libuv version string in named -V 2020-07-28 02:41:39 +00:00
Evan Hunt
730226b674 Merge branch '2031-win32-fix' into 'main'
Resolve "Windows crashes with netmgr-based statschannel"

Closes #2031

See merge request isc-projects/bind9!3888
2020-07-27 21:33:07 +00:00
Evan Hunt
881b635141 initialize, rather than invalidating, new http buffers
when building without ISC_BUFFER_USEINLINE (which is the default on
Windows) an assertion failure could occur when setting up a new
isc_httpd_t object for the statistics channel.
2020-07-27 14:29:37 -07:00
Diego dos Santos Fronza
83b50bb901 Merge branch '1619-rpz-wildcard-passthru-ignored' into 'main'
Resolve "RPZ wildcard passthru ignored"

Closes #1619

See merge request isc-projects/bind9!3682
2020-07-27 14:34:08 +00:00
Diego Fronza
ad6f65649a Add CHANGES entry 2020-07-24 11:48:14 -07:00
Diego Fronza
c5a4bc8bcc Add test for RPZ wildcard passthru ignored fix 2020-07-24 11:48:14 -07:00
Diego Fronza
c2928c2ed4 Fix rpz wildcard name matching
Whenever an exact match is found by dns_rbt_findnode(),
the highest level node in the chain will not be put into
chain->levels[] array, but instead the chain->end
pointer will be adjusted to point to that node.

Suppose we have the following entries in a rpz zone:
example.com     CNAME rpz-passthru.
*.example.com   CNAME rpz-passthru.

A query for www.example.com would result in the
following chain object returned by dns_rbt_findnode():

chain->level_count = 2
chain->level_matches = 2
chain->levels[0] = .
chain->levels[1] = example.com
chain->levels[2] = NULL
chain->end = www

Since exact matches only care for testing rpz set bits,
we need to test for rpz wild bits through iterating the nodechain, and
that includes testing the rpz wild bits in the highest level node found.

In the case of an exact match, chain->levels[chain->level_matches]
will be NULL, to address that we must use chain->end as the start point,
then iterate over the remaining levels in the chain.
2020-07-24 11:34:40 -07:00
Michal Nowak
5ab7d1c920 Merge branch '1999-add-a-regular-make-dist-job-to-ci' into 'main'
Add a regular "make dist" job to CI

Closes #1999

See merge request isc-projects/bind9!3803
2020-07-24 13:53:54 +00:00
Michal Nowak
654c64c60b Add a regular "make dist" job to CI
It's easy to break "make dist" by adding and moving files around.
We should test this scenario regularly, to prevent release-time
surprises.
2020-07-24 15:27:25 +02:00
Mark Andrews
a14445d472 Merge branch '2043-dns_rdata_hip_next-fails-to-return-isc_r_nomore-at-the-right-time' into 'main'
Resolve "dns_rdata_hip_next() fails to return ISC_R_NOMORE at the right time."

Closes #2043

See merge request isc-projects/bind9!3880
2020-07-24 05:19:45 +00:00
Mark Andrews
bcd049f116 Add CHANGES note 2020-07-24 04:15:56 +00:00
Mark Andrews
78db46d746 Check walking the hip rendezvous servers.
Also fixes extraneous white space at end of record when
there are no rendezvous servers.
2020-07-24 04:15:56 +00:00
Mark Andrews
e31bcac441 Merge branch 'marka-add-fallthrough' into 'main'
Add fallthrough and braces

See merge request isc-projects/bind9!3884
2020-07-24 04:15:03 +00:00
Mark Andrews
70c060120f Add fallthrough and braces 2020-07-24 13:49:56 +10:00
Mark Andrews
1ba814a28c Merge branch 'feature/master/unix-cleanup' into 'main'
Remove few lines in unix socket handling

See merge request isc-projects/bind9!2687
2020-07-24 03:02:07 +00:00
Petr Menšík
72d81c4768 Remove few lines in unix socket handling
Reuse the same checks two times, make difference minimal.
2020-07-24 12:59:38 +10:00
Mark Andrews
cc1b77a0c7 Merge branch 'dstlib-failure-abort' into 'main'
Prevent crash on dst initialization failure

See merge request isc-projects/bind9!3876
2020-07-23 00:46:12 +00:00
Petr Menšík
c5e7152cf0 Prevent crash on dst initialization failure
server might be created, but not yet fully initialized, when fatal
function is called. Check both server and task before attaching
exclusive task.
2020-07-23 00:31:52 +00:00
Michal Nowak
064e314df7 Merge branch '1727-drop-use-of-featuretest-have-dlopen' into 'main'
Drop feature test for dlopen()

Closes #1727

See merge request isc-projects/bind9!3625
2020-07-21 09:24:38 +00:00
Michal Nowak
2064e01cd0 Drop feature test for dlopen()
With libtool being mandatory from 9.17 on, so is dlopen() (via libltdl).
2020-07-21 11:22:13 +02:00
Ondřej Surý
451ed397f0 Merge branch '1775-resizing-growing-of-cache-hash-tables-causes-delays-in-processing-of-client-queries' into 'main'
Fix the rbt hashtable and grow it when setting max-cache-size

Closes #1775

See merge request isc-projects/bind9!3865
2020-07-21 08:38:26 +00:00
Ondřej Surý
2b4f0f03f5 Add CHANGES and release note for #1775 2020-07-21 08:44:26 +02:00
Ondřej Surý
a9182c89a6 Change the dns_name hashing to use 32-bit values
Change the dns_hash_name() and dns_hash_fullname() functions to use
isc_hash32() as the maximum hashtable size in rbt is 0..UINT32_MAX
large.
2020-07-21 08:44:26 +02:00
Ondřej Surý
f59fd49fd8 Add isc_hash32() and rename isc_hash_function() to isc_hash64()
As the names suggest the original isc_hash64 function returns 64-bit
long hash values and the isc_hash32() returns 32-bit values.
2020-07-21 08:44:26 +02:00
Ondřej Surý
344d66aaff Add HalfSipHash 2-4 reference implementation
The HalfSipHash implementation has 32-bit keys and returns 32-bit
value.
2020-07-21 08:44:26 +02:00
Ondřej Surý
21d751dfc7 Remove OpenSSL based SipHash 2-4 implementation
Creation of EVP_MD_CTX and EVP_PKEY is quite expensive, so until we fix the code
to reuse the OpenSSL contexts and keys we'll use our own implementation of
siphash instead of trying to integrate with OpenSSL.
2020-07-21 08:44:26 +02:00
Ondřej Surý
e24bc324b4 Fix the rbt hashtable and grow it when setting max-cache-size
There were several problems with rbt hashtable implementation:

1. Our internal hashing function returns uint64_t value, but it was
   silently truncated to unsigned int in dns_name_hash() and
   dns_name_fullhash() functions.  As the SipHash 2-4 higher bits are
   more random, we need to use the upper half of the return value.

2. The hashtable implementation in rbt.c was using modulo to pick the
   slot number for the hash table.  This has several problems because
   modulo is: a) slow, b) oblivious to patterns in the input data.  This
   could lead to very uneven distribution of the hashed data in the
   hashtable.  Combined with the single-linked lists we use, it could
   really hog-down the lookup and removal of the nodes from the rbt
   tree[a].  The Fibonacci Hashing is much better fit for the hashtable
   function here.  For longer description, read "Fibonacci Hashing: The
   Optimization that the World Forgot"[b] or just look at the Linux
   kernel.  Also this will make Diego very happy :).

3. The hashtable would rehash every time the number of nodes in the rbt
   tree would exceed 3 * (hashtable size).  The overcommit will make the
   uneven distribution in the hashtable even worse, but the main problem
   lies in the rehashing - every time the database grows beyond the
   limit, each subsequent rehashing will be much slower.  The mitigation
   here is letting the rbt know how big the cache can grown and
   pre-allocate the hashtable to be big enough to actually never need to
   rehash.  This will consume more memory at the start, but since the
   size of the hashtable is capped to `1 << 32` (e.g. 4 mio entries), it
   will only consume maximum of 32GB of memory for hashtable in the
   worst case (and max-cache-size would need to be set to more than
   4TB).  Calling the dns_db_adjusthashsize() will also cap the maximum
   size of the hashtable to the pre-computed number of bits, so it won't
   try to consume more gigabytes of memory than available for the
   database.

   FIXME: What is the average size of the rbt node that gets hashed?  I
   chose the pagesize (4k) as initial value to precompute the size of
   the hashtable, but the value is based on feeling and not any real
   data.

For future work, there are more places where we use result of the hash
value modulo some small number and that would benefit from Fibonacci
Hashing to get better distribution.

Notes:
a. A doubly linked list should be used here to speedup the removal of
   the entries from the hashtable.
b. https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/
2020-07-21 08:44:26 +02:00
Michal Nowak
9dcf229634 Merge branch 'mnowak/try-harder-to-analyze-cores' into 'main'
Rationalize backtrace logging, fail on core file presence

See merge request isc-projects/bind9!3867
2020-07-20 08:13:37 +00:00
Michal Nowak
1b13123c45 Check tests for core files regardless of test status
Failed test should be checked for core files et al. and have
backtrace generated.
2020-07-17 10:04:59 +02:00
Michal Nowak
05c13e50d3 Rationalize backtrace logging
GDB backtrace generated via "thread apply all bt full" is too long for
standard output, lets save them to .txt file among other log files.
2020-07-17 10:04:04 +02:00
Michal Nowak
b232e8585a Ensure various test issues are treated as failures
Make sure bin/tests/system/run.sh returns a non-zero exit code if any of
the following happens:

  - the test being run produces a core dump,
  - assertion failures are found in the test's logs,
  - ThreadSanitizer reports are found after the test completes,
  - the servers started by the test fail to shut down cleanly.

This change is necessary to always fail a test in such cases (before the
migration to Automake, test failures were determined based on the
presence of "R:<test-name>:FAIL" lines in the test suite output and thus
it was not necessary for bin/tests/system/run.sh to return a non-zero
exit code).
2020-07-17 10:00:21 +02:00
Michał Kępień
f27c0c3257 Merge branch 'michal/update-release-checklist' into 'main'
Update release checklist

See merge request isc-projects/bind9!3864
2020-07-16 09:31:09 +00:00
Michał Kępień
4fa2dfe72e Update release checklist
Add an item to the release checklist to make sure confidential issues
assigned to the relevant milestone are made public after the BIND
versions addressing them are released.
2020-07-16 11:28:09 +02:00
Evan Hunt
b4cdd00fa3 Merge branch '2022-stats-netmgr' into 'main'
Resolve "use netmgr for statschannel"

Closes #2022

See merge request isc-projects/bind9!3847
2020-07-16 06:04:21 +00:00
Evan Hunt
efa5639934 CHANGES, release note 2020-07-15 22:35:07 -07:00
Evan Hunt
69c1ee1ce9 rewrite statschannel to use netmgr
modify isc_httpd to use the network manager instead of the
isc_socket API.

also cleaned up bin/named/statschannel.c to use CHECK.
2020-07-15 22:35:07 -07:00
Michał Kępień
d8e6b32a18 Merge branch 'v9_17_3-release' into 'main'
Merge 9.17.3 release branch

See merge request isc-projects/bind9!3860
2020-07-15 21:09:46 +00:00
Michał Kępień
2b2e97a815 Set up release notes for BIND 9.17.4 2020-07-15 23:06:25 +02:00
Michał Kępień
02de51d957 Bump BIND_BASELINE_VERSION for ABI checks 2020-07-15 23:06:25 +02:00
Michał Kępień
49c62f3e8e Fix "make dist" 2020-07-15 22:54:13 +02:00
Michał Kępień
fc6d0a932b Update BIND version to 9.17.3 2020-07-15 22:54:13 +02:00
Michał Kępień
28d32ca7da Add a CHANGES marker 2020-07-15 22:54:13 +02:00
Michał Kępień
97a2733ef9 Update library API versions 2020-07-15 22:54:13 +02:00
Michał Kępień
3e74f894d4 Merge branch 'michal/prepare-release-notes-for-bind-9.17.3' into v9_17_3-release 2020-07-15 22:51:33 +02:00
Michał Kępień
fba5ce8a75 Reorder release notes 2020-07-15 22:51:33 +02:00
Michał Kępień
af35a186d0 Add release note for #1958 2020-07-15 22:51:33 +02:00
Michał Kępień
eedbd6ecf5 Add release note for #1938 2020-07-15 22:51:33 +02:00
Michał Kępień
41a79d068c Add release note for #1937 2020-07-15 22:51:33 +02:00
Michał Kępień
e9a869f51e Tweak and reword release notes 2020-07-15 22:51:33 +02:00
Michał Kępień
aa1d6a46ab Prepare release notes for BIND 9.17.3 2020-07-15 22:51:32 +02:00
Michał Kępień
267794244f Tweak and reword recent CHANGES entries 2020-07-15 22:50:16 +02:00
Matthijs Mekking
f8ef2c0439 Merge branch '2006-coverity-checked-return-keymgr' into 'main'
Fix Coverity keymgr reports

Closes #2006

See merge request isc-projects/bind9!3808
2020-07-14 15:46:56 +00:00
Matthijs Mekking
e645d2ef1e Check return value of dst_key_getbool()
Fix Coverity CHECKED_RETURN reports for dst_key_getbool().  In most
cases we do not really care about its return value, but it is prudent
to check it.

In one case, where a dst_key_getbool() error should be treated
identically as success, cast the return value to void and add a relevant
comment.
2020-07-14 12:53:54 +00:00
Michał Kępień
df72c52239 Merge branch 'michal/use-image-key-in-qemu-based-ci-job-templates' into 'main'
Use "image" key in QEMU-based CI job templates

See merge request isc-projects/bind9!3855
2020-07-14 08:24:42 +00:00
Michał Kępień
72201badf0 Use "image" key in QEMU-based CI job templates
Our GitLab Runner Custom executor scripts now use the "image" key
instead of the job name for determining the QCOW2 image to use for a
given CI job.  Update .gitlab-ci.yml to reflect that change.
2020-07-14 09:58:04 +02:00
Mark Andrews
c53bfb30e8 Merge branch 'u/fanf2/fix-signing' into 'main'
Fix re-signing when `sig-validity-interval` has two arguments

See merge request isc-projects/bind9!3735
2020-07-14 02:07:28 +00:00
Mark Andrews
3ff60b881f Add release note for [GL !3735] 2020-07-14 10:59:59 +10:00
Mark Andrews
f4fbca6e16 Add CHANGES note for [GL !3735] 2020-07-14 10:59:59 +10:00
Mark Andrews
11ecf7901b Add regression test for [GL !3735]
Check that resign interval is actually in days rather than hours
by checking that RRSIGs are all within the allowed day range.
2020-07-14 10:59:59 +10:00
Tony Finch
030674b2a3 Fix re-signing when sig-validity-interval has two arguments
Since October 2019 I have had complaints from `dnssec-cds` reporting
that the signatures on some of my test zones had expired. These were
zones signed by BIND 9.15 or 9.17, with a DNSKEY TTL of 24h and
`sig-validity-interval 10 8`.

This is the same setup we have used for our production zones since
2015, which is intended to re-sign the zones every 2 days, keeping
at least 8 days signature validity. The SOA expire interval is 7
days, so even in the presence of zone transfer problems, no-one
should ever see expired signatures. (These timers are a bit too
tight to be completely correct, because I should have increased
the expiry timers when I increased the DNSKEY TTLs from 1h to 24h.
But that should only matter when zone transfers are broken, which
was not the case for the error reports that led to this patch.)

For example, this morning my test zone contained:

        dev.dns.cam.ac.uk. 86400 IN RRSIG DNSKEY 13 5 86400 (
                                20200701221418 20200621213022 ...)

But one of my resolvers had cached:

        dev.dns.cam.ac.uk. 21424 IN RRSIG DNSKEY 13 5 86400 (
                                20200622063022 20200612061136 ...)

This TTL was captured at 20200622105807 so the resolver cached the
RRset 64976 seconds previously (18h02m56s), at 20200621165511
only about 12h before expiry.

The other symptom of this error was incorrect `resign` times in
the output from `rndc zonestatus`.

For example, I have configured a test zone

        zone fast.dotat.at {
                file "../u/z/fast.dotat.at";
                type primary;
                auto-dnssec maintain;
                sig-validity-interval 500 499;
        };

The zone is reset to a minimal zone containing only SOA and NS
records, and when `named` starts it loads and signs the zone. After
that, `rndc zonestatus` reports:

        next resign node: fast.dotat.at/NS
        next resign time: Fri, 28 May 2021 12:48:47 GMT

The resign time should be within the next 24h, but instead it is
near the signature expiry time, which the RRSIG(NS) says is
20210618074847. (Note 499 hours is a bit more than 20 days.)
May/June 2021 is less than 500 days from now because expiry time
jitter is applied to the NS records.

Using this test I bisected this bug to 09990672d which contained a
mistake leading to the resigning interval always being calculated in
hours, when days are expected.

This bug only occurs for configurations that use the two-argument form
of `sig-validity-interval`.
2020-07-14 10:57:43 +10:00
Mark Andrews
2ac2d83265 Merge branch '1994-netscope-c-23-50-error-unused-parameter-addr-when-have_if_nametoindex-undefined-on-illumos' into 'main'
Resolve "netscope.c:23:50: error: unused parameter 'addr' when HAVE_IF_NAMETOINDEX undefined on illumos"

Closes #1994

See merge request isc-projects/bind9!3829
2020-07-14 00:51:22 +00:00
Mark Andrews
e7662c4c63 Mark 'addr' as unused if HAVE_IF_NAMETOINDEX is not defined
Also 'zone' should be initialised to zero.
2020-07-14 00:13:40 +00:00
Mark Andrews
1a1e52b7fe Merge branch '1995-gssapictx-c-681-10-error-implicit-declaration-of-function-gsskrb5_register_acceptor_identity' into 'main'
Resolve "gssapictx.c:681:10: error: implicit declaration of function 'gsskrb5_register_acceptor_identity' on illumos"

Closes #1995

See merge request isc-projects/bind9!3830
2020-07-14 00:05:39 +00:00
Mark Andrews
488eef63ca Only call gsskrb5_register_acceptor_identity if we have gssapi_krb5.h. 2020-07-14 08:55:13 +10:00
Mark Andrews
35ea733e2c Merge branch '1993-check-c-1576-37-error-expected-identifier-before-numeric-constant-on-illumos' into 'main'
Resolve "check.c:1576:37: error: expected identifier before numeric constant on illumos"

Closes #1993

See merge request isc-projects/bind9!3828
2020-07-13 22:06:48 +00:00
Mark Andrews
18eef20241 Handle namespace clash over 'SEC' on illumos. 2020-07-14 07:46:10 +10:00
Mark Andrews
bc5bd577d7 Merge branch '2005-coverity-is-reporting-double-unlock' into 'main'
Resolve "Coverity is reporting double unlock."

Closes #2005

See merge request isc-projects/bind9!3807
2020-07-13 21:28:10 +00:00
Mark Andrews
4e03bfac86 Add CHANGES for [GL #2005] 2020-07-14 07:07:58 +10:00
Mark Andrews
cc0089c66b Address potential double unlock in process_fd 2020-07-14 07:07:14 +10:00
Evan Hunt
d97710acdc Merge branch 'each-rndc-netmgr-pt2' into 'main'
RNDC using netmgr

See merge request isc-projects/bind9!3724
2020-07-13 20:39:49 +00:00
Evan Hunt
7c703c851f CHANGES, release note 2020-07-13 13:17:08 -07:00
Witold Kręcicki
ae5d316f64 isccc: merge recv_message and recv_nonce into one function
- make isccc message receiving code clearer by merging recv_nonce and
  recv_message into a single recv_data function and adding a boolean
  state field.
2020-07-13 13:17:08 -07:00
Evan Hunt
55896df79d use handles for isc_nm_pauseread() and isc_nm_resumeread()
by having these functions act on netmgr handles instead of socket
objects, they can be used in callback functions outside the netgmr.
2020-07-13 13:17:08 -07:00
Evan Hunt
29dcdeba1b purge pending command events when shutting down
When we're shutting the system down via "rndc stop" or "rndc halt",
or reconfiguring the control channel, there are potential shutdown
races between the server task and network manager.  These are adressed by:

- purging any pending command tasks when shutting down the control channel
- adding an extra handle reference before the command handler to
  ensure the handle can't be deleted out from under us before calling
  command_respond()
2020-07-13 13:17:08 -07:00
Evan Hunt
45ab0603eb use an isc_task to execute rndc commands
- using an isc_task to execute all rndc functions makes it relatively
  simple for them to acquire task exclusive mode when needed
- control_recvmessage() has been separated into two functions,
  control_recvmessage() and control_respond(). the respond function
  can be called immediately from control_recvmessage() when processing
  a nonce, or it can be called after returning from the task event
  that ran the rndc command function.
2020-07-13 13:16:53 -07:00
Evan Hunt
3551d3ffd2 convert rndc and control channel to use netmgr
- updated libisccc to use netmgr events
- updated rndc to use isc_nm_tcpconnect() to establish connections
- updated control channel to use isc_nm_listentcp()

open issues:

- the control channel timeout was previously 60 seconds, but it is now
  overridden by the TCP idle timeout setting, which defaults to 30
  seconds. we should add a function that sets the timeout value for
  a specific listener socket, instead of always using the global value
  set in the netmgr. (for the moment, since 30 seconds is a reasonable
  timeout for the control channel, I'm not prioritizing this.)
- the netmgr currently has no support for UNIX-domain sockets; until
  this is addressed, it will not be possible to configure rndc to use
  them. we will need to either fix this or document the change in
  behavior.
2020-07-13 13:16:53 -07:00
Evan Hunt
002c328437 don't use exclusive mode for rndc commands that don't need it
"showzone" and "tsig-list" both used exclusive mode unnecessarily;
changing this will simplify future refactoring a bit.
2020-07-13 13:12:33 -07:00
Evan Hunt
0580d9cd8c style cleanup
clean up style in rndc and the control channel in preparation for
changing them to use the new network manager.
2020-07-13 12:41:04 -07:00
Evan Hunt
e7602e2d51 Merge branch 'each-lmdb-lock-fix' into 'main'
ensure new_zone_lock is released after count_newzones()

See merge request isc-projects/bind9!3833
2020-07-13 19:26:46 +00:00
Evan Hunt
ed37c63e2b make sure new_zone_lock is locked before unlocking it
it was possible for the count_newzones() function to try to
unlock view->new_zone_lock on return before locking it, which
caused a crash on shutdown.
2020-07-13 12:06:26 -07:00
Diego dos Santos Fronza
4aaef76c58 Merge branch '1719-observed-stats-underflow-in-multiple-stats' into 'main'
Resolve "Observed stats underflow in multiple stats"

Closes #1719

See merge request isc-projects/bind9!3818
2020-07-13 18:28:58 +00:00
Diego Fronza
a22e61d554 Add CHANGES and release note for #1719 2020-07-13 11:48:55 -03:00
Diego Fronza
aab691d512 Fix ns_statscounter_recursclients underflow
The basic scenario for the problem was that in the process of
resolving a query, if any rrset was eligible for prefetching, then it
would trigger a call to query_prefetch(), this call would run in
parallel to the normal query processing.

The problem arises due to the fact that both query_prefetch(), and,
in the original thread, a call to ns_query_recurse(), try to attach
to the recursionquota, but recursing client stats counter is only
incremented if ns_query_recurse() attachs to it first.

Conversely, if fetch_callback() is called before prefetch_done(),
it would not only detach from recursionquota, but also decrement
the stats counter, if query_prefetch() attached to te quota first
that would result in a decrement not matched by an increment, as
expected.

To solve this issue an atomic bool was added, it is set once in
ns_query_recurse(), allowing fetch_callback() to check for it
and decrement stats accordingly.

For a more compreensive explanation check the thread comment below:
https://gitlab.isc.org/isc-projects/bind9/-/issues/1719#note_145857
2020-07-13 11:46:18 -03:00
Mark Andrews
600128ac27 Merge branch '1235-system-tests-fail-with-new-etc-bind-keys-installed' into 'main'
Fallback to built in trust-anchors, managed-keys, or trusted-keys

Closes #1235

See merge request isc-projects/bind9!3827
2020-07-13 05:09:10 +00:00
Mark Andrews
d02a14c795 Fallback to built in trust-anchors, managed-keys, or trusted-keys
if the bind.keys file cannot be parsed.
2020-07-13 14:12:14 +10:00
Mark Andrews
1d739a95dd Merge branch '1989-rndc-dnstap-roll-with-too-big-a-argument-128-can-cause-a-buffer-overflow' into 'main'
Resolve "'rndc dnstap --roll' with too big a argument (>128) can cause a buffer overflow."

Closes #1989

See merge request isc-projects/bind9!3788
2020-07-13 03:52:02 +00:00
Mark Andrews
42b2290c3a Add changes for [GL #1989] 2020-07-13 13:10:45 +10:00
Mark Andrews
6ca78bc57d Address overrun in remove_old_tsversions
If too many versions of log / dnstap files to be saved where requests
the memory after to_keep could be overwritten.  Force the number of
versions to be saved to a save level.  Additionally the memmove length
was incorrect.
2020-07-13 13:10:45 +10:00
Mark Andrews
98de853740 Merge branch '2012-add-assertion-check-to-silence-dereference-before-null-check-in-tsig_test-c-v9_11' into 'main'
Resolve "Add assertion check to silence dereference before NULL check in tsig_test.c"

Closes #2012

See merge request isc-projects/bind9!3814
2020-07-13 03:06:25 +00:00
Mark Andrews
827746e89b Assert tsigout is non-NULL 2020-07-13 02:26:06 +00:00
Mark Andrews
1c73ea491b Merge branch '2014-statschannel-system-test-failed-at-setup-stage' into 'main'
Resolve "Statschannel system test failed at setup stage."

Closes #2014

See merge request isc-projects/bind9!3823
2020-07-13 02:22:09 +00:00
Mark Andrews
a0e8a11cc6 Don't verify the zone when setting expire to "now+1s" as it can fail
as too much wall clock time may have elapsed.

Also capture signzone output for forensic analysis
2020-07-13 01:39:13 +00:00
Mark Andrews
ef55dbf4fc Merge branch '2013-unchecked-returns-of-inet_pton-in-geoip_test-c' into 'main'
Resolve "Unchecked returns of inet_pton in geoip_test.c"

Closes #2013

See merge request isc-projects/bind9!3815
2020-07-13 01:21:52 +00:00
Mark Andrews
9499adeb5e check returns from inet_pton() 2020-07-13 00:31:29 +00:00
Mark Andrews
2e89dd7cb8 Merge branch 'marka-placeholder' into 'main'
placeholder for [GL #2010]

See merge request isc-projects/bind9!3834
2020-07-13 00:23:01 +00:00
Mark Andrews
93a336e248 placeholder for [GL #2010] 2020-07-13 00:21:22 +00:00
Mark Andrews
b02c3e4f8e Merge branch '2003-remove-redundant-listener-null-check' into 'main'
Resolve "Remove redundant listener != NULL check"

Closes #2003

See merge request isc-projects/bind9!3806
2020-07-13 00:13:52 +00:00
Mark Andrews
c91dc92410 Remove redundant check for listener being non-NULL 2020-07-12 23:46:35 +00:00
Michał Kępień
a87ac96b56 Merge branch '1976-fix-locking-for-lmdb-0.9.26' into 'main'
Fix locking for LMDB 0.9.26

Closes #1976

See merge request isc-projects/bind9!3758
2020-07-10 09:50:47 +00:00
Michał Kępień
7fffa5abba Add CHANGES for GL #1976 2020-07-10 11:29:18 +02:00
Michał Kępień
53120279b5 Fix locking for LMDB 0.9.26
When "rndc reconfig" is run, named first configures a fresh set of views
and then tears down the old views.  Consider what happens for a single
view with LMDB enabled; "envA" is the pointer to the LMDB environment
used by the original/old version of the view, "envB" is the pointer to
the same LMDB environment used by the new version of that view:

 1. mdb_env_open(envA) is called when the view is first created.
 2. "rndc reconfig" is called.
 3. mdb_env_open(envB) is called for the new instance of the view.
 4. mdb_env_close(envA) is called for the old instance of the view.

This seems to have worked so far.  However, an upstream change [1] in
LMDB which will be part of its 0.9.26 release prevents the above
sequence of calls from working as intended because the locktable mutexes
will now get destroyed by the mdb_env_close() call in step 4 above,
causing any subsequent mdb_txn_begin() calls to fail (because all of the
above steps are happening within a single named process).

Preventing the above scenario from happening would require either
redesigning the way we use LMDB in BIND, which is not something we can
easily backport, or redesigning the way BIND carries out its
reconfiguration process, which would be an even more severe change.

To work around the problem, set MDB_NOLOCK when calling mdb_env_open()
to stop LMDB from controlling concurrent access to the database and do
the necessary locking in named instead.  Reuse the view->new_zone_lock
mutex for this purpose to prevent the need for modifying struct dns_view
(which would necessitate library API version bumps).  Drop use of
MDB_NOTLS as it is made redundant by MDB_NOLOCK: MDB_NOTLS only affects
where LMDB reader locktable slots are stored while MDB_NOLOCK prevents
the reader locktable from being used altogether.

[1] 2fd44e3251
2020-07-10 11:29:18 +02:00
Ondřej Surý
42f8f17627 Merge branch 'ondrej/update-pregenerated-manpages' into 'main'
Fixup the manpages after ddns-confgen.rst -> tsig-keygen.rst rename

See merge request isc-projects/bind9!3817
2020-07-08 10:19:15 +00:00
Ondřej Surý
3da9909430 Fail the build if it updates any of the files in the git repository
There are still some pregenerated files left in the git
repository (cleaned up during `make maintainer-clean`) and we currently
don't notice if any of those needs to be updated in the git repository
because we ignore changes in the repository done during the build.

This commit adds a safeguard that fails the build job if the contents of
the git repository gets modified during the build.
2020-07-08 11:05:24 +02:00
Ondřej Surý
514ab2cc4f Fixup the manpages after ddns-confgen.rst -> tsig-keygen.rst rename
There were some missing bits in the other rst files and Makefile.am(s)
that didn't reflect the rename of the main document.  Also add
ddns-confgen.8 manpage.
2020-07-08 11:05:24 +02:00
Mark Andrews
1dd265df8f Merge branch '2011-off-by-one-error-in-dns_rdatatype_attributes' into 'main'
Resolve "Off-by-one error in dns_rdatatype_attributes?"

Closes #2011

See merge request isc-projects/bind9!3820
2020-07-08 03:01:05 +00:00
Mark Andrews
092a159dcd Adjust range limit of unknown meta types 2020-07-08 02:04:16 +00:00
Mark Andrews
13321a20ce Merge branch '2009-update-isc-logo-in-documentation' into 'main'
Resolve "Update ISC logo in documentation"

Closes #2009

See merge request isc-projects/bind9!3811
2020-07-08 02:00:31 +00:00
Mark Andrews
875a637eeb Update ISC logo 2020-07-08 02:00:11 +00:00
Mark Andrews
bb60192f70 Merge branch '1475-convert-header-attributes-to-atomic' into 'main'
Convert header->attributes to stdatomic

Closes #1475

See merge request isc-projects/bind9!3750
2020-07-08 01:24:10 +00:00
Mark Andrews
adf7cb4ba7 Add CHANGES note for [GL #1475] 2020-07-08 10:50:52 +10:00
Ondřej Surý
81d4230e60 Update STALE and ANCIENT header attributes atomically
The ThreadSanitizer found a data race when updating the stale header.
Instead of trying to acquire the write lock and failing occasionally
which would skew the statistics, the dns_rdatasetheader_t.attributes
field has been promoted to use stdatomics.  Updating the attributes in
the mark_header_ancient() and mark_header_stale() now uses the cmpxchg
to update the attributes forfeiting the need to hold the write lock on
the tree.  Please note that mark_header_ancient() still needs to hold
the lock because .dirty is being updated in the same go.
2020-07-08 10:50:52 +10:00
Mark Andrews
ef41dc097b Merge branch 'ondrej/add-16-bit-stdatomic-shims' into 'main'
Make the stdatomic shim and mutexatomic type complete

See merge request isc-projects/bind9!3816
2020-07-08 00:26:26 +00:00
Mark Andrews
bccea5862d Make the stdatomic shim and mutexatomic type complete
The stdatomic shims for non-C11 compilers (Windows, old gcc, ...) and
mutexatomic implemented only and minimal subset of the atomic types.
This commit adds 16-bit operations for Windows and all atomic types as
defined in standard.
2020-07-08 09:39:02 +10:00
Evan Hunt
f34b179d12 Merge branch '1998-fully-rename-tsig-keygen' into 'main'
use 'tsig-keygen' as the primary name for the tool

Closes #1998

See merge request isc-projects/bind9!3801
2020-07-06 09:00:26 +00:00
Evan Hunt
ba52377b37 use 'tsig-keygen' as the primary name for the tool
'ddns-confgen' is now an alias for 'tsig-keygen', rather than
the other way around.
2020-07-06 01:41:52 -07:00
Mark Andrews
858082de51 Merge branch '1990-bad-isc_mem_put-size' into 'main'
Resolve "Bad  isc_mem_put size."

Closes #1990

See merge request isc-projects/bind9!3790
2020-07-06 00:53:13 +00:00
Mark Andrews
c2c333e3f3 Bad isc_mem_put() size when an invalid type was specified in a ssu rule. 2020-07-06 10:33:27 +10:00
Mark Andrews
4e7cca965c Merge branch '1991-cleanup-redundant-non-null-check' into 'main'
Resolve "Cleanup redundant non-NULL check."

Closes #1991

See merge request isc-projects/bind9!3791
2020-07-06 00:14:42 +00:00
Mark Andrews
2fa2dbd5fb remove redundant rctx != NULL check 2020-07-05 23:52:19 +00:00
Matthijs Mekking
2995024458 Merge branch '1988-windows-rndc-dnssec-status-bad-output' into 'main'
Increase rndc output buffer size for rndc dnssec -status

Closes #1988

See merge request isc-projects/bind9!3802
2020-07-03 13:13:05 +00:00
Matthijs Mekking
9347e7db7e Increase "rndc dnssec -status" output size
BUFSIZ (512 bytes on Windows) may not be enough to fit the status of a
DNSSEC policy and three DNSSEC keys.

Set the size of the relevant buffer to a hardcoded value of 4096 bytes,
which should be enough for most scenarios.
2020-07-03 12:14:53 +02:00
Ondřej Surý
ee5b77ccb0 Merge branch '1925-additional-text-edits-to-bind-arm' into 'main'
Resolve "Additional text edits to BIND ARM"

Closes #1925

See merge request isc-projects/bind9!3800
2020-07-03 07:20:48 +00:00
Suzanne Goldlust
4cd6be18d3 Add missing named.conf man page 2020-07-03 09:02:41 +02:00
Suzanne Goldlust
056f12eb34 Final text edits to BIND 9 ARM in this round of updates 2020-07-03 09:02:15 +02:00
Ondřej Surý
494d1246eb Merge branch 'ondrej/dont-fail-system-test-on-missing-pytest' into 'main'
Don't fail the system tests when shutdown test is missing pytest

See merge request isc-projects/bind9!3795
2020-07-02 15:14:57 +00:00
Ondřej Surý
f8b5958d28 Don't fail the system tests when shutdown test is missing pytest 2020-07-02 16:55:55 +02:00
Michał Kępień
78a4ed3132 Merge branch '1627-add-changes-entry' into 'main'
Add CHANGES entry for #1627

Closes #1627

See merge request isc-projects/bind9!3794
2020-07-02 09:20:21 +00:00
Michał Kępień
dee2b3c7c8 Add CHANGES entry for #1627 2020-07-02 11:19:30 +02:00
Ondřej Surý
b72dae7445 Merge branch '1883-text-edits-in-pkcs11-rst' into 'main'
Resolve "Text edits in pkcs11.rst"

Closes #1883

See merge request isc-projects/bind9!3591
2020-07-02 09:06:17 +00:00
Suzanne Goldlust
28be579424 Content and grammar edits to pkcs11.rst 2020-07-02 11:01:29 +02:00
Ondřej Surý
04536dd32e Merge branch 'ondrej/1915-update-input-files-for-manpages' into 'main'
Update the generated files after the source manpages update

See merge request isc-projects/bind9!3793
2020-07-02 08:53:55 +00:00
Ondřej Surý
9ab86d0da2 Update the generated files after the source manpages update 2020-07-02 10:53:16 +02:00
Ondřej Surý
f16152acf4 Merge branch 'sgoldlust-1915-edits-to-man-pages-for-bind-arm-patch-16656' into 'main'
Edits to man pages for BIND 9 ARM

Closes #1915

See merge request isc-projects/bind9!3676
2020-07-02 08:48:17 +00:00
Suzanne Goldlust
78af7e54e6 Text edits to manual paages
This commit updates the wording in following man pages:

* ddns-confgen.rst
* delv.rst
* dig.rst
* dnssec-dsfromkey.rst
* dnssec-importkey.rst
* dnssec-keyfromlabel.rst
* dnssec-keygen.rst
* dnssec-revoke.rst
* dnssec-settime.rst
* dnssec-signzone.rst
* dnssec-verify.rst
* dnstap-read.rst
* filter-aaaa.rst
* host.rst
* mdig.rst
* named-checkconf.rst
* named-checkzone.rst
* named-nzd2nzf.rst
* named.conf.rst
* named.rst
* nsec3hash.rst
* nsupdate.rst
* pkcs11-destroy.rst
* pkcs11-keygen.rst
* pkcs11-list.rst
* pkcs11-tokens.rst
* rndc-confgen.rst
* rndc.rst
2020-07-02 10:35:58 +02:00
Ondřej Surý
a8faf4f7cb Merge branch '1915-edits-to-man-pages-for-bind-arm' into 'main'
Resolve "Edits to man pages for BIND ARM"

Closes #1915

See merge request isc-projects/bind9!3644
2020-07-02 08:19:07 +00:00
Suzanne Goldlust
1efa88cf09 Text and formatting edits to various manual pages.
Follwing manual pages have been updated: rndc.conf.rst, rndc.rst
nsec3hash.rst, dnstap-read.rst, named-nzd2nzf.rst, mdig.rst,
named-rrchecker.rst, dnssec-revoke.rst, dnssec-cds.rst,
dnssec-keyfromlabel.rst, and dnssec-keygen.rst
2020-07-02 10:11:01 +02:00
Ondřej Surý
6008d77359 Merge branch '1951-add-bind-version-number-to-introduction-rst-file' into 'main'
Resolve "Add BIND version number to introduction.rst file"

Closes #1951

See merge request isc-projects/bind9!3710
2020-07-02 08:05:13 +00:00
Suzanne Goldlust
a4549f89bf Add release statement to introduction.rst
(and remove duplicate copyright statement)
2020-07-02 09:57:29 +02:00
Ondřej Surý
c94124cd89 Merge branch '1940-removing-more-references-to-master-and-slave-in-bind-arm' into 'main'
Resolve "Removing more references to "master" and "slave" in BIND ARM"

Closes #1940

See merge request isc-projects/bind9!3692
2020-07-02 07:53:13 +00:00
Suzanne Goldlust
42386f3d9f Updates to .rst files to remove more references to "master" and "slave" 2020-07-02 09:47:27 +02:00
Ondřej Surý
c4fcafe072 Merge branch '1925-additional-text-edits-to-bind-arm' into 'main'
Resolve "Additional text edits to BIND ARM"

Closes #1925

See merge request isc-projects/bind9!3679
2020-07-02 07:37:56 +00:00
Suzanne Goldlust
5aa5ad5abc Various text edits and fixes to the documentation 2020-07-02 09:35:27 +02:00
Evan Hunt
e1d42c5f87 Merge branch 'placeholder' into 'main'
add a placeholder for GL #330 in v9_11_sub

See merge request isc-projects/bind9!3789
2020-07-02 01:39:17 +00:00
Evan Hunt
1dbaaa0d7c add a placeholder for GL #330 in v9_11_sub 2020-07-01 18:37:18 -07:00
Ondřej Surý
0577dffe7c Merge branch '1987-fix-formatting-error-in-man-pages-section-of-bind-arm' into 'main'
Resolve "Fix formatting error in man pages section of BIND ARM"

Closes #1987

See merge request isc-projects/bind9!3785
2020-07-01 21:46:00 +00:00
Suzanne Goldlust
e3e787bc14 Fix formatting of See Also section header 2020-07-01 23:45:04 +02:00
Matthijs Mekking
7b63138de2 Merge branch '1939-rumoured-kasp-intermittent-failures' into 'main'
Fix kasp test set_keytime

Closes #1939

See merge request isc-projects/bind9!3780
2020-07-01 21:17:59 +00:00
Matthijs Mekking
24e07ae98e Fix kasp test set_keytime
While the creation and publication times of the various keys
in this policy are nearly at the same time there is a chance that
one key is created a second later than the other.

The `set_keytimes_algorithm_policy` mistakenly set the keytimes
for KEY3 based of the "published" time from KEY2.
2020-07-01 22:42:29 +02:00
Evan Hunt
529262925e Merge branch '1948-primaries-synonym' into 'main'
Resolve "add synonym for 'masters'"

Closes #1948

See merge request isc-projects/bind9!3703
2020-07-01 20:30:10 +00:00
Evan Hunt
565f99f9e5 CHANGES, release note 2020-07-01 11:13:44 -07:00
Evan Hunt
e43b3c1fa1 further tidying of primary/secondary terminology in system tests
this changes most visble uses of master/slave terminology in tests.sh
and most uses of 'type master' or 'type slave' in named.conf files.
files in the checkconf test were not updated in order to confirm that
the old syntax still works. rpzrecurse was also left mostly unchanged
to avoid interference with DNSRPS.
2020-07-01 11:12:12 -07:00
Evan Hunt
68c384e118 use primary/secondary terminology in 'rndc zonestatus' 2020-07-01 11:11:34 -07:00
Evan Hunt
f619708bbf prevent "primaries" lists from having duplicate names
it is now an error to have two primaries lists with the same
name. this is true regardless of whether the "primaries" or
"masters" keywords were used to define them.
2020-07-01 11:11:34 -07:00
Evan Hunt
424a3cf3cc add "primary-only" as a synonym for "master-only"
update the "notify" option to use RFC 8499 terminology as well.
2020-07-01 11:11:34 -07:00
Evan Hunt
16e14353b1 add "primaries" as a synonym for "masters" in named.conf
as "type primary" is preferred over "type master" now, it makes
sense to make "primaries" available as a synonym too.

added a correctness check to ensure "primaries" and "masters"
cannot both be used in the same zone.
2020-07-01 11:11:34 -07:00
Evan Hunt
4ea6bb7257 Merge branch 'each-rndc-netmgr-pt1.5' into 'main'
Fix socket closing races.

Closes #1660

See merge request isc-projects/bind9!3781
2020-07-01 17:04:51 +00:00
Evan Hunt
233f134a4f Don't destroy a non-closed socket, wait for all the callbacks.
We erroneously tried to destroy a socket after issuing
isc__nm_tcp{,dns}_close. Under some (race) circumstances we could get
nm_socket_cleanup to be called twice for the same socket, causing an
access to a dead memory.
2020-07-01 17:35:10 +02:00
Witold Kręcicki
896db0f419 Fix possible race in isc__nm_tcpconnect.
There's a possibility of race in isc__nm_tcpconnect if the asynchronous
connect operation finishes with all the callbacks before we exit the
isc__nm_tcpconnect itself we might access an already freed memory.
Fix it by creating an additional reference to the socket freed at the
end of isc__nm_tcpconnect.
2020-07-01 13:52:12 +00:00
Witold Kręcicki
25f84ffc68 Add missing libisc.def definitions, netmgr version of isc_sockettype_t. 2020-07-01 13:52:12 +00:00
Ondřej Surý
7500fb9319 Merge branch '1968-cleanup-dead-nodes-fix' into 'main'
rbtdb: cleanup_dead_nodes should ignore alive nodes on the deadlist

Closes #1968

See merge request isc-projects/bind9!3773
2020-07-01 13:34:54 +00:00
Ondřej Surý
4c12709da4 Add CHANGES and release note for #1968 2020-07-01 15:11:44 +02:00
Witold Kręcicki
c8f2d55acf rbtdb: cleanup_dead_nodes should ignore alive nodes on the deadlist 2020-07-01 15:11:07 +02:00
Ondřej Surý
dbd03ce112 Merge branch '1862-insist-in-query-c' into 'main'
Fix assertion failure when server is under load and root zone is not yet loaded.

Closes #1862

See merge request isc-projects/bind9!3572
2020-07-01 10:56:38 +00:00
Ondřej Surý
ee43457811 Add release notes for #1862 2020-07-01 12:26:17 +02:00
Witold Kręcicki
4897c87716 Add CHANGES note for #1862 2020-07-01 12:25:51 +02:00
Witold Kręcicki
b4f3fafcff Fix assertion failure during startup when the server is under load.
When we're coming back from recursion fetch_callback does not accept
DNS_R_NXDOMAIN as an rcode - query_gotanswer calls query_nxdomain in
which an assertion fails on qctx->is_zone. Yet, under some
circumstances, qname minimization will return an DNS_R_NXDOMAIN - when
root zone mirror is not yet loaded. The fix changes the DNS_R_NXDOMAIN
answer to DNS_R_SERVFAIL.
2020-07-01 12:25:36 +02:00
Ondřej Surý
ee7bc2163f Merge branch 'ondrej/update-rndc.conf-manpage' into 'main'
Commit the regenerated rndc.conf.5in manual page

See merge request isc-projects/bind9!3777
2020-07-01 10:18:55 +00:00
Ondřej Surý
c5b63e14bc Commit the regenerated rndc.conf.5in manual page 2020-07-01 12:14:29 +02:00
Ondřej Surý
6b8a548732 Merge branch '1747-fix-race-in-rndc-when-shutting-down' into 'main'
Resolve "BIND 9.16.1 does core dump when stopped"

Closes #1747

See merge request isc-projects/bind9!3740
2020-07-01 10:14:05 +00:00
Ondřej Surý
605209402f Add CHANGES and release not for #1747 2020-07-01 11:59:01 +02:00
Diego Fronza
042e509753 Added test for the fix
This test ensures that named will correctly shutdown
when receiving multiple control connections after processing
of either "rncd stop" or "kill -SIGTERM" commands.

Before the fix, named was crashing due to a race condition happening
between two threads, one running shutdown logic in named/server.c
and other handling control logic in controlconf.c.

This test tries to reproduce the above scenario by issuing multiple
queries to a target named instance, issuing either rndc stop or kill
-SIGTERM command to the same named instance, then starting multiple rndc
status connections to ensure it is not crashing anymore.
2020-07-01 11:59:01 +02:00
Ondřej Surý
be6cc53ec2 Don't continue opening a new rndc connection if we are shutting down
Due to lack of synchronization, whenever named was being requested to
stop using rndc, controlconf.c module could be trying to access an already
released pointer through named_g_server->interfacemgr in a separate
thread.

The race could only be triggered if named was being shutdown and more
rndc connections were ocurring at the same time.

This fix correctly checks if the server is shutting down before opening
a new rndc connection.
2020-07-01 08:44:56 +02:00
Evan Hunt
402e16546d Merge branch '1936-blackhole-fix' into 'main'
Resolve "blackhole ACL broken"

Closes #1936

See merge request isc-projects/bind9!3751
2020-07-01 02:41:02 +00:00
Evan Hunt
08401e38c1 CHANGES, release note 2020-06-30 17:31:29 -07:00
Evan Hunt
23c7373d68 restore "blackhole" functionality
the blackhole ACL was accidentally disabled with respect to client
queries during the netmgr conversion.

in order to make this work for TCP, it was necessary to add a return
code to the accept callback functions passed to isc_nm_listentcp() and
isc_nm_listentcpdns().
2020-06-30 17:29:09 -07:00
Evan Hunt
e3ee138098 update the acl system test to include a blackhole test case
this ACL was previously untested, which allowed a regression to
go undetected.
2020-06-30 17:29:09 -07:00
Matthijs Mekking
3970e6e832 Merge branch '1612-rndc-dnssec-status' into 'main'
Resolve "Get current state of DNSSEC keys (kasp) via rndc"

Closes #1612

See merge request isc-projects/bind9!3717
2020-06-30 09:12:48 +00:00
Matthijs Mekking
e273b95a8b Update notes, changes for #1612 2020-06-30 09:51:22 +02:00
Matthijs Mekking
19ce9ec1d4 Output rndc dnssec -status
Implement the 'rndc dnssec -status' command that will output
some information about the key states, such as which policy is
used for the zone, what keys are in use, and when rollover is
scheduled.

Add loose testing in the kasp system test, the actual times are
already tested via key file inspection.
2020-06-30 09:51:04 +02:00
Matthijs Mekking
e1ba1bea7c Implement dummy 'rndc dnssec -status' command
Add the code and documentation required to provide DNSSEC signing
status through rndc.  This does not yet show any useful information,
just provide the command that will output some dummy string.
2020-06-30 09:51:04 +02:00
Matthijs Mekking
9e03f8e8fe Move dst key printtime in separate function
I'd like to use the same functionality (pretty print the datetime
of keytime metadata) in the 'rndc dnssec -status' command.  So it is
better that this logic is done in a separate function.

Since the stdtime.c code have differernt files for unix and win32,
I think the "#ifdef WIN32" define can be dropped.
2020-06-30 09:51:04 +02:00
Matthijs Mekking
9724b6f68d Merge branch 'matthijs-one-more-rfc4592-test' into 'main'
Add one more RFC 4592 test

See merge request isc-projects/bind9!3764
2020-06-30 07:01:47 +00:00
Matthijs Mekking
f0b5eb03bb Add one more RFC 4592 test
This deals with the SRV example.
2020-06-30 05:22:24 +00:00
Mark Andrews
37213cb994 Merge branch 'marka-fixup-dnstap-test' into 'main'
Fix the dnstap roll test

See merge request isc-projects/bind9!3756
2020-06-29 22:28:46 +00:00
Mark Andrews
b3215125ea Fix the dnstap roll test by:
* fixing the find call.
* checking that we rolled a file.
2020-06-30 08:27:58 +10:00
Evan Hunt
01176a8e7a Merge branch 'placeholder' into 'main'
placeholder

See merge request isc-projects/bind9!3767
2020-06-29 20:23:30 +00:00
Evan Hunt
add6d07921 placeholder 2020-06-29 13:22:42 -07:00
Ondřej Surý
dfe4cbbcca Merge branch 'ondrej/fix-manpages-in-rtd' into 'main'
Fix the manpages TOC in the BIND 9 ARM

See merge request isc-projects/bind9!3765
2020-06-29 17:40:37 +00:00
Ondřej Surý
b51d10608e Fix miscellaneous little bugs in RST formatting 2020-06-29 19:39:03 +02:00
Ondřej Surý
5c56a0ddbc Add missing rndc.conf header that was breaking manpages section
The rndc.conf main header was missing the header markup and that was
breaking the TOC for all manpages in the ARM because sphinx-build
incorrectly remembered the markup for subheader to be ~~~~ instead of
----.
2020-06-29 19:37:18 +02:00
Michał Kępień
ac9de68750 Merge branch 'mnowak/add-new-releases' into 'main'
Add Ubuntu 20.04, Fedora 32, Alpine 3.12, OpenBSD 6.7, and FreeBSD 11.4

See merge request isc-projects/bind9!3503
2020-06-29 10:42:22 +00:00
Michał Kępień
1be15f5900 Fix build-time GSSAPI detection on Tumbleweed
The "krb5-devel" package on openSUSE Tumbleweed installs the
"krb5-config" binary into a custom prefix, which prevents BIND's
"configure" script from autodetecting it.  Fix by specifying the path to
the "krb5-config" binary using --with-gssapi.
2020-06-29 12:08:19 +02:00
Michal Nowak
18f97b9af2 Update FreeBSD 11 to 11.4 2020-06-29 12:08:19 +02:00
Michal Nowak
eff79ab20c Update to Alpine Linux 3.12 2020-06-29 12:08:19 +02:00
Michal Nowak
374660fd37 Update to OpenBSD 6.7 2020-06-29 12:08:19 +02:00
Michal Nowak
27c8bc1750 Drop Bionic 2020-06-29 12:08:19 +02:00
Michal Nowak
c3e259a8c9 Add Ubuntu 20.04 Focal Fossa, update Fedora to 32 2020-06-29 12:08:19 +02:00
Michał Kępień
58f89dfff8 Merge branch 'michal/fix-libdns-cflags' into 'main'
Fix libdns CFLAGS

See merge request isc-projects/bind9!3759
2020-06-29 08:29:19 +00:00
Michał Kępień
0975eeedd7 Fix libdns CFLAGS
Since lib/dns/include/dns/view.h unconditionally defines dnstap-related
fields in struct dns_view (and includes <dns/dnstap.h>), care must be
taken to ensure that any source file which includes <dns/view.h> gets
built with a set of CFLAGS which allows <dns/dnstap.h> to be properly
processed (particularly its <fstrm.h> and <protobuf-c/protobuf-c.h>
conditional dependencies which are only included for dnstap-enabled
builds).  Ensure that by making LIBDNS_CFLAGS include DNSTAP_CFLAGS when
building with dnstap support.

The same reasoning applies for LMDB_CFLAGS.
2020-06-29 10:23:23 +02:00
Michał Kępień
bf0229caad Fix restoring CFLAGS and LIBS in AX_LIB_LMDB()
The AX_LIB_LMDB() macro attempts to test the potential LMDB installation
path provided to it by temporarily updating CFLAGS and LIBS, calling
AC_SEARCH_LIBS(), and then restoring CFLAGS and LIBS to their original
values.  However, including certain statements (e.g. "break") in the
arguments provided to the AX_LIB_LMDB() macro may cause an early exit
from it, in which case CFLAGS and LIBS will be left polluted.  Fix by
resetting CFLAGS and LIBS to their original values before executing the
commands provided as AX_LIB_LMDB() arguments.
2020-06-29 10:23:23 +02:00
Matthijs Mekking
5cc856095b Merge branch '1876-kasp-test-wait-for-reconfig' into 'main'
Resolve "kasp: algnum migration test does not wait long enough."

Closes #1876

See merge request isc-projects/bind9!3588
2020-06-29 06:01:54 +00:00
Matthijs Mekking
a47192ed5b kasp tests: fix wait for reconfig done
The wait until zones are signed after rndc reconfig is broken
because the zones are already signed before the reconfig.  Fix
by having a different way to ensure the signing of the zone is
complete.  This does require a call to the "wait_for_done_signing"
function after each "check_keys" call after the ns6 reconfig.

The "wait_for_done_signing" looks for a (newly added) debug log
message that named will output if it is done signing with a certain
key.
2020-06-26 08:43:45 +00:00
Matthijs Mekking
cf76d839ae kasp tests: Replace while loops with retry_quiet 2020-06-26 08:43:45 +00:00
Evan Hunt
e8e7effc19 Merge branch 'each-changes' into 'main'
add missing CHANGES notes

See merge request isc-projects/bind9!3757
2020-06-26 08:16:03 +00:00
Evan Hunt
4280344d21 add missing CHANGES notes
CHANGES notes were accidentally omitted from the previous merge.
2020-06-26 01:14:30 -07:00
Evan Hunt
d35101e433 Merge branch 'each-netmgr-fix-shutdown-crash' into 'main'
clean up outerhandle when a tcpdns socket is disconnected

See merge request isc-projects/bind9!3726
2020-06-26 07:49:46 +00:00
Evan Hunt
591b79b597 Make netmgr tcpdns send calls asynchronous
isc__nm_tcpdns_send() was not asynchronous and accessed socket
internal fields in an unsafe manner, which could lead to a race
condition and subsequent crash. Fix it by moving tcpdns processing
to a proper netmgr thread.
2020-06-26 00:19:42 -07:00
Witold Kręcicki
1cf65cd882 Fix a shutdown race in netmgr udp
We need to mark the socket as inactive early (and synchronously)
in the stoplistening process; otherwise we might destroy the
callback argument before we actually stop listening, and call
the callback on bad memory.
2020-06-26 00:19:42 -07:00
Evan Hunt
3704c4fff2 clean up outerhandle when a tcpdns socket is disconnected
this prevents a crash when some non-netmgr thread, such as a
recursive lookup, times out after the TCP socket is already
disconnected.
2020-06-26 00:19:42 -07:00
Evan Hunt
bcbc7e2b10 Merge branch '1952-yaml-ipv6' into 'main'
append "0" to IPv6 addresses ending in "::" when printing YAML

Closes #1952

See merge request isc-projects/bind9!3714
2020-06-26 01:56:29 +00:00
Evan Hunt
a8baf79e33 append "0" to IPv6 addresses ending in "::" when printing YAML
such addresses broke some YAML parsers.
2020-06-25 16:42:13 -07:00
Mark Andrews
5d3a7aadb8 Merge branch '1689-bind-stops-dnskey-lookup-in-get_dst_key-when-a-key-with-unsupported-algorithm-is-found-first' into 'main'
Resolve "BIND stops DNSKEY lookup in get_dst_key() when a key with unsupported algorithm is found first"

Closes #1689

See merge request isc-projects/bind9!3736
2020-06-25 12:40:45 +00:00
Matthijs Mekking
c6345fffe9 Add todo in dnssec system test for [GL #1689]
Add a note why we don't have a test case for the issue.

It is tricky to write a good test case for this if our tools are
not allowed to create signatures for unsupported algorithms.
2020-06-25 13:46:36 +02:00
Mark Andrews
e195d4608a Add Release Note for [GL #1689] 2020-06-25 13:46:36 +02:00
Mark Andrews
b733bd6555 Add CHANGES for [GL #1689] 2020-06-25 13:46:36 +02:00
Mark Andrews
d475f3aeed The validator could fail when select_signing_key/get_dst_key failed
to select the signing key because the algorithm was not supported
and the loop was prematurely aborted.
2020-06-25 13:43:45 +02:00
Mark Andrews
30b85fe4a8 Merge branch '1969-silence-cppcheck-warnings' into 'main'
Resolve "Silence CPPCHECK warnings"

Closes #1969

See merge request isc-projects/bind9!3741
2020-06-25 07:01:05 +00:00
Mark Andrews
abe2c84b1d Suppress cppcheck warnings:
cppcheck-suppress objectIndex
cppcheck-suppress nullPointerRedundantCheck
2020-06-25 12:04:36 +10:00
Mark Andrews
0cf25d7f38 Add INSIST's to silence cppcheck warnings 2020-06-25 12:04:36 +10:00
Mark Andrews
ee135d8946 Remove now redundant check for state != NULL 2020-06-25 12:04:36 +10:00
Mark Andrews
51f08d2095 Address potential thread issues:
Assign and then check node for NULL to address another thread
changing radix->head in the meantime.

Move 'node != NULL' check into while loop test to silence cppcheck
false positive.

Fix pointer != NULL style.
2020-06-25 12:04:36 +10:00
Mark Andrews
6d5fde62a3 Merge branch '1965-bin-named-unix-os-c-warning-s-directive-output-may-be-truncated-on-openindiana' into 'main'
Resolve "bin/named/unix/os.c warning: '%s' directive output may be truncated on OpenIndiana"

Closes #1965

See merge request isc-projects/bind9!3737
2020-06-24 23:22:08 +00:00
Mark Andrews
4bc3de070f Resize unamebuf[] to avoid warnings about snprintf() not having
enough buffer space.  Also change named_os_uname() prototype so
that it is now returning (const char *) rather than (char *).  If
uname() is not supported on a UNIX build prepopulate unamebuf[]
with "unknown architecture".
2020-06-24 23:21:36 +00:00
Michał Kępień
1844b47eb3 Merge branch '1970-fix-libtool-initialization' into 'main'
Fix libtool initialization

Closes #1970

See merge request isc-projects/bind9!3742
2020-06-24 09:28:01 +00:00
Michał Kępień
a7982d14dd Fix libtool initialization
The LT_INIT() call in configure.ac is effectively a no-op because it is
preceded by a call to AC_PROG_LIBTOOL(), which is the previous name of
LT_INIT() used in older libtool versions.  Replace AC_PROG_LIBTOOL()
with AC_PATH_PROG() to look for libtool in PATH without initializing it,
which is the originally intended behavior.

Without this change, --enable-static is used by default, which causes a
plain ./configure invocation to fail because static linking is now
disallowed.  Drop --disable-static from the ./configure invocations used
in GitLab CI to test this scenario continuously.
2020-06-24 10:07:57 +02:00
Ondřej Surý
6f9a87fdf6 Merge branch '1933-disable-static-linking' into 'main'
Disable and disallow static linking

Closes #1933

See merge request isc-projects/bind9!3697
2020-06-23 13:28:06 +00:00
Ondřej Surý
7f24d4b476 Add CHANGES and release note for #1933 2020-06-23 15:16:02 +02:00
Ondřej Surý
a7bed56845 Disable and disallow static linking
Linking BIND 9 programs and libraries statically disables several
important features:

  * dlopen() - relied on by dynamic loading of modules, dlz, and dyndb,

  * RELRO (read-only relocations) and ASLR (address space layout
    randomization) - security features which are important for any
    program interacting with the network and/or user input.

Disable and disallow linking BIND 9 binaries statically, thus enforcing
dlopen() support and allowing use of RELRO and ASLR by default.
2020-06-23 15:16:02 +02:00
Mark Andrews
789e5f4a4b Merge branch 'u/fanf2/dnstap-roll' into 'main'
Fix `rndc dnstap -roll N`

See merge request isc-projects/bind9!3728
2020-06-23 10:27:34 +00:00
Mark Andrews
81d15bc967 Add Release Note for [GL !3728] 2020-06-23 20:20:39 +10:00
Mark Andrews
ce776e79ed Add CHANGES for [GL !3728] 2020-06-23 20:20:39 +10:00
Mark Andrews
a289a57c7f Check that 'rndc dnstap -roll <value>' works 2020-06-23 20:20:39 +10:00
Tony Finch
7c07129a51 Fix rndc dnstap -roll N
The `rndc` argument was always overridden by the static configuration,
because the logic for handling the number of dnstap files to retain
was both backwards and a bit redundant.
2020-06-23 20:20:39 +10:00
Michal Nowak
e8fa9986bd Merge branch 'mnowak/do-not-build-gzip-tarball' into 'main'
Do not create gzip tarball

See merge request isc-projects/bind9!3734
2020-06-23 07:48:58 +00:00
Michal Nowak
c76c826fdb Do not create gzip tarball
'make dist' does not need to create gzip tarball as we always ship the
XZ one.
2020-06-22 21:04:18 +02:00
Ondřej Surý
b4221e2595 Merge branch 'ondrej/disable-maintainer-mode-in-ci' into 'main'
Disable rebuilding miscellaneous documentation source files when not in maintainer mode

See merge request isc-projects/bind9!3733
2020-06-22 17:01:41 +00:00
Ondřej Surý
7ff77bb676 Enable maintainer mode by default only when building from git
When maintainer mode is enabled (./configure --enable-maintainer-mode)
it enables rebuild of documentation source files that require extra
tools to be installed or compiled.  For a convenience, those files are
already committed into the repository and their rebuild is not required
to build BIND 9 from sources.
2020-06-22 14:26:07 +02:00
Ondřej Surý
5f530bd1f9 Remove the last bits of '// not configured' from doc/misc/options 2020-06-22 14:08:53 +02:00
Ondřej Surý
36e4090c70 Update pregenerated dig.1in and rndc-confgen.8in 2020-06-22 14:08:53 +02:00
Ondřej Surý
8b18d8f3bc Disable the double configure and build step in docs CI job
The documentation now can be build even when the BIND 9 source tree
hasn't been built yet allowing no-arch builds.
2020-06-22 14:08:53 +02:00
Ondřej Surý
28575abd93 Rebuild the manpages sources only when in maintainer mode
Similarly, the manpage sources will get rebuild only when in maintainer
mode because they require sphinx-build to be available locally and that
might not be always the case.
2020-06-22 14:08:53 +02:00
Ondřej Surý
b1093533ef Rebuild the file in doc/misc only when in maintainer mode
The files in doc/misc requires all the BIND 9 libraries to be built
before the documentation can be built.  One of the extra automake
features is maintainer mode that allows to conditionally build and clean
files that require special tools.  Make use of the automake maintainer
mode to not rebuild the files in doc/misc under normal circumstances.
2020-06-22 14:08:53 +02:00
Ondřej Surý
c9c84af3c9 Merge branch 'each-shorten-tests' into 'main'
reorder system tests to shorten runtime

See merge request isc-projects/bind9!3727
2020-06-22 12:06:10 +00:00
Evan Hunt
a9154f2aab reorder system tests to shorten runtime
if tests that take a particularly long time to complete
(serve-stale, dnssec, rpzrecurse) are run first, a parallel
run of the system tests can finish 1-2 minutes faster.
2020-06-22 12:05:32 +00:00
Ondřej Surý
8e4afd31e9 Merge branch '1898-doc/misc/options-should-be-independent-on-configure' into 'main'
Remove // not configured when generating doc/misc/options

Closes #1898

See merge request isc-projects/bind9!3731
2020-06-22 11:44:39 +00:00
Ondřej Surý
b82ff5b738 Remove // not configured when generating doc/misc/options
The doc/misc/options is used to generate a file describing all
configuration options. Currently, the file contents could differ
based on ./configure option which is kind of suboptimal.

We already removed the "// not configured" from the options.active, and
this time we remove generation of the string altogether.
2020-06-22 11:44:05 +00:00
Ondřej Surý
c3510ca6a3 Merge branch '1949-checknames' into 'main'
"check-names primary" and "check-names secondary" were ignored

Closes #1949

See merge request isc-projects/bind9!3702
2020-06-22 11:14:54 +00:00
Ondřej Surý
eaafae2766 Add CHANGES and release note for #1949 2020-06-22 12:33:54 +02:00
Evan Hunt
ba31b189b4 "check-names primary" and "check-names secondary" were ignored
these keywords were added to the parser as synonyms for "master"
and "slave" but were never hooked in to the configuration of named,
so they were ignored. this has been fixed and the option is now
checked for correctness.
2020-06-22 12:32:32 +02:00
Ondřej Surý
783e3f922a Merge branch '1627-address-race-in-zone-maintenance' into 'main'
address race between zone_maintenance and dns_zone_setview_helper

Closes #1627

See merge request isc-projects/bind9!3669
2020-06-22 10:26:29 +00:00
Mark Andrews
67c8f7329d Address race between zone_maintenance and dns_zone_setview_helper
There was a possible NULL dereference due to data race between accessing
zone->view and zone->view->adb.
2020-06-22 12:20:51 +02:00
Evan Hunt
5238433f78 Merge branch 'each-rndc-netmgr-pt1' into 'main'
client-side TCP

Closes #1958

See merge request isc-projects/bind9!3723
2020-06-19 22:19:10 +00:00
Evan Hunt
8b9e2d33a2 CHANGES 2020-06-19 12:33:26 -07:00
Evan Hunt
75c985c07f change the signature of recv callbacks to include a result code
this will allow recv event handlers to distinguish between cases
in which the region is NULL because of error, shutdown, or cancelation.
2020-06-19 12:33:26 -07:00
Evan Hunt
5191ec8f86 implement isc_nm_cancelread()
The isc_nm_cancelread() function cancels reading on a connected
socket and calls its read callback function with a 'result'
parameter of ISC_R_CANCELED.
2020-06-19 12:33:26 -07:00
Evan Hunt
870204fe47 shorten the sleep in isc_nm_destroy()
when isc_nm_destroy() is called, there's a loop that waits for
other references to be detached, pausing and unpausing the netmgr
to ensure that all the workers' events are run, followed by a
1-second sleep. this caused a delay on shutdown which will be
noticeable when netmgr is used in tools other than named itself,
so the delay has now been reduced to a hundredth of a second.
2020-06-19 12:32:43 -07:00
Evan Hunt
abbb79f9d1 implement isc_nm_tcpconnect()
the isc_nm_tcpconnect() function establishes a client connection via
TCP.  once the connection is esablished, a callback function will be
called with a newly created network manager handle.
2020-06-19 09:41:37 +02:00
Witold Kręcicki
cd79b49538 allow tcpdns sockets to self-reference while connected
A TCPDNS socket creates a handle for each complete DNS message.

Previously, when all the handles were disconnected, the socket
would be closed, but the wrapped TCP socket might still have
more to read.

Now, when a connection is established, the TCPDNS socket creates
a reference to itself by attaching itself to sock->self. This
reference isn't cleared until the connection is closed via
EOF, timeout, or server shutdown. This allows the socket to remain
open even when there are no active handles for it.
2020-06-19 09:39:50 +02:00
Evan Hunt
5ea26ee1f1 modify reference counting within netmgr
- isc__nmhandle_get() now attaches to the sock in the nmhandle object.
  the caller is responsible for dereferencing the original socket
  pointer when necessary.
- tcpdns listener sockets attach sock->outer to the outer tcp listener
  socket. tcpdns connected sockets attach sock->outerhandle to the handle
  for the tcp connected socket.
- only listener sockets need to be attached/detached directly. connected
  sockets should only be accessed and reference-counted via their
  associated handles.
2020-06-19 09:39:50 +02:00
Evan Hunt
9e740cad21 make isc_nmsocket_{attach,detach}{} functions private
there is no need for a caller to reference-count socket objects.
they need tto be able tto close listener sockets (i.e., those
returned by isc_nm_listen{udp,tcp,tcpdns}), and an isc_nmsocket_close()
function has been added for that. other sockets are only accessed via
handles.
2020-06-19 09:39:50 +02:00
Mark Andrews
be032d64ff Merge branch 'marka-placeholder' into 'main'
placeholder for [GL #1955]

See merge request isc-projects/bind9!3720
2020-06-19 02:20:25 +00:00
Mark Andrews
642279dd8f placeholder for [GL #1955] 2020-06-19 12:16:57 +10:00
Michał Kępień
943d9ab85c Merge branch 'michal/fix-abi-check-job-in-gitlab-ci' into 'main'
Fix ABI check job in GitLab CI

See merge request isc-projects/bind9!3715
2020-06-18 08:56:01 +00:00
Michał Kępień
31f73efee5 Fix ABI check job in GitLab CI
Since the reference BIND version for the ABI check job which is run for
the main branch is now 9.17.2, autoreconf needs to be run before
./configure as the latter is no longer present in the Git repository.
2020-06-18 10:52:54 +02:00
Michał Kępień
1f39f593d5 Merge branch 'v9_17_2-release' into 'main'
[CVE-2020-8618] [CVE-2020-8619] Merge 9.17.2 release branch

See merge request isc-projects/bind9!3711
2020-06-18 08:20:56 +00:00
Michał Kępień
a4bb843075 Set up release notes for BIND 9.17.3 2020-06-18 10:10:02 +02:00
Michał Kępień
18560109a2 Bump BIND_BASELINE_VERSION for ABI checks 2020-06-18 10:10:02 +02:00
Evan Hunt
59cbde7df6 Merge branch 'prep-release' into master 2020-06-18 10:03:18 +02:00
Michał Kępień
3c213f96f3 Update BIND version to 9.17.2 2020-06-18 10:03:18 +02:00
Michał Kępień
d6084fde0a Add a CHANGES marker 2020-06-18 10:03:17 +02:00
Michał Kępień
4809a16431 Merge branch 'security-master-docs' into 'security-master'
Prepare documentation for BIND 9.17.2

See merge request isc-private/bind9!172
2020-06-18 10:03:05 +02:00
Michał Kępień
a8bc003d1b Update library API versions 2020-06-18 10:03:05 +02:00
Michał Kępień
12aa6a0308 Tweak and reword release notes 2020-06-18 10:03:05 +02:00
Michał Kępień
861d824f56 Add release note for #1859 2020-06-18 10:03:05 +02:00
Michał Kępień
0d991837a2 Add release note for #1842 2020-06-18 10:03:05 +02:00
Michał Kępień
b932982903 Add release note for #1834 2020-06-18 10:03:05 +02:00
Michał Kępień
4c730f6d49 Add release note for #1812 2020-06-18 10:03:05 +02:00
Michał Kępień
e8a9a9b800 Add release note for #1714 2020-06-18 10:03:05 +02:00
Michał Kępień
9e8a2a8150 Add release note for #83 2020-06-18 10:03:05 +02:00
Michał Kępień
11d8177c99 Reorder release notes 2020-06-18 10:03:00 +02:00
Michał Kępień
06bc27fb0e Merge branch 'security-wildcard-test-marka' into security-master 2020-06-18 09:59:20 +02:00
Michał Kępień
2c90cfdcdd Prepare release notes for BIND 9.17.2 2020-06-18 09:59:20 +02:00
Michał Kępień
4e7f7f99b6 Merge branch 'security-new_reference-insist' into security-master 2020-06-18 09:59:20 +02:00
Mark Andrews
7c7a0fb029 Add CHANGES note 2020-06-18 09:59:20 +02:00
Michał Kępień
4963d557f1 Tweak and reword recent CHANGES entries 2020-06-18 09:59:20 +02:00
Michał Kępień
9924fc106f Merge branch '1850-cleanup-client_allocsendbuf' into security-master 2020-06-18 09:59:20 +02:00
Mark Andrews
7f928f4afb Add CHANGES entry for #1718 2020-06-18 09:59:20 +02:00
Mark Andrews
3632b3c282 Add checking RFC 4592 responses examples to wildcard system test 2020-06-18 09:59:20 +02:00
Mark Andrews
8e88a6f0ad Add release note for #1718 2020-06-18 09:59:20 +02:00
Mark Andrews
0854f63114 Remove INSIST from from new_reference
RBTDB node can now appear on the deadnodes lists following the changes
to decrement_reference in 176b23b6cd to
defer checking of node->down when the tree write lock is not held.  The
node should be unlinked instead.
2020-06-18 09:59:20 +02:00
Mark Andrews
ed4b69abb8 Add release notes for #1850 2020-06-18 09:59:19 +02:00
Mark Andrews
381351fcd4 Add CHANGES entry for #1850 2020-06-18 09:59:19 +02:00
Mark Andrews
924e141a15 Adjust NS_CLIENT_TCP_BUFFER_SIZE and cleanup client_allocsendbuf
NS_CLIENT_TCP_BUFFER_SIZE was 2 byte too large following the
move to netmgr add associated changes to lib/ns/client.c and
as a result an INSIST could be trigger if the DNS message being
constructed had a checkpoint stage that fell in those two extra
bytes.  Adjusted NS_CLIENT_TCP_BUFFER_SIZE and cleaned up
client_allocsendbuf now that the previously reserved 2 bytes
are no longer used.
2020-06-18 09:59:19 +02:00
Ondřej Surý
3a5a508a0b Merge branch 'ondrej/switch-the-default-branch-name-to-main' into 'main'
Adjust the GitLab CI scripts for new default branch name

See merge request isc-projects/bind9!3706
2020-06-17 12:12:07 +00:00
Ondřej Surý
b36cd06a0b Adjust the GitLab CI scripts for new default branch name 2020-06-17 14:10:54 +02:00
Ondřej Surý
4124a1294e Merge branch '1950-placeholder' into 'master'
Add CHANGES placeholder for #1950

Closes #1950

See merge request isc-projects/bind9!3705
2020-06-17 10:40:25 +00:00
Ondřej Surý
a0fbe46216 Add CHANGES placeholder for #1950 2020-06-17 12:39:05 +02:00
Ondřej Surý
2473e3b21e Merge branch '1943-remove-references-to-blacklist-and-whitelist-in-bind-arm' into 'master'
Resolve "Remove references to "blacklist" and "whitelist" in BIND ARM"

Closes #1943

See merge request isc-projects/bind9!3693
2020-06-16 19:57:41 +00:00
Suzanne Goldlust
4a04fb68cd Update logging-categories.rst and reference.rst
Remove references to "blacklist" and "whitelist"
2020-06-16 19:53:36 +00:00
Ondřej Surý
3210a4275c Merge branch '1932-text-corrections-in-readme-md' into 'master'
Resolve "Text corrections in README.md"

Closes #1932

See merge request isc-projects/bind9!3686
2020-06-16 19:35:44 +00:00
Suzanne Goldlust
075ccbd6b5 Various text edits and corrections to README.md 2020-06-16 19:35:44 +00:00
Ondřej Surý
6dfdb148c1 Merge branch '1931-fix-out-of-order-rfcs-in-general-rst-file-of-bind-arm' into 'master'
Resolve "Fix out-of-order RFCs in general.rst file of BIND ARM"

Closes #1931

See merge request isc-projects/bind9!3685
2020-06-16 19:30:44 +00:00
Suzanne Goldlust
acb4742182 Fix two RFCs that were out of numerical order 2020-06-16 19:30:18 +00:00
Ondřej Surý
43cb581a95 Merge branch '1945-system-clang-tsan-has-bad-symbolizer' into 'master'
Set the TSAN symbolizer path directly, the indirection via env doesn't work

Closes #1945

See merge request isc-projects/bind9!3696
2020-06-16 08:49:08 +00:00
Ondřej Surý
39107365a7 Set the TSAN symbolizer path directly, the indirection via env doesn't work 2020-06-16 09:58:49 +02:00
Ondřej Surý
1c79e15f9b Merge branch '1474-threadsanitizer-data-race-lib-dns-message-c' into 'master'
Add missing acquire memory barrier in isc_nmhandle_unref

Closes #1474

See merge request isc-projects/bind9!3689
2020-06-16 06:57:21 +00:00
Ondřej Surý
1013c0930e Add missing acquire memory barrier in isc_nmhandle_unref
The ThreadSanitizer uses system synchronization primitives to check for
data race.  The netmgr handle->references was missing acquire memory
barrier before resetting and reusing the memory occupied by isc_nmhandle_t.
2020-06-11 13:01:26 +02:00
Mark Andrews
50d3344ca5 Merge branch 'marka-dsset-refs' into 'master'
The dsset returned by dns_keynode_dsset() was not thread safe

Closes #1926

See merge request isc-projects/bind9!3687
2020-06-11 06:07:21 +00:00
Mark Andrews
f97889a51a Add release note for [GL #1926] 2020-06-11 16:04:28 +10:00
Mark Andrews
9d89244ba2 Add CHANGES note [GL #1926] 2020-06-11 16:04:28 +10:00
Mark Andrews
ff4fc3f8dc val->keynode is no longer needed 2020-06-11 16:03:11 +10:00
Mark Andrews
e5b2eca1d3 The dsset returned by dns_keynode_dsset needs to be thread safe.
- clone keynode->dsset rather than return a pointer so that thread
  use is independent of each other.
- hold a reference to the dsset (keynode) so it can't be deleted
  while in use.
- create a new keynode when removing DS records so that dangling
  pointers to the deleted records will not occur.
- use a rwlock when accessing the rdatalist to prevent instabilities
  when DS records are added.
2020-06-11 16:02:09 +10:00
Evan Hunt
c24f4eb1c9 Merge branch '1930-tcp-race-quota' into 'master'
Fix a race in TCP accepting.

Closes #1930

See merge request isc-projects/bind9!3683
2020-06-10 18:49:33 +00:00
Witold Kręcicki
85d8e4bf76 Fix a race in TCP accepting.
There's a possibility of a race in TCP accepting code:
T1 accepts a connection C1
T2 accepts a connection C2
T1 tries to accept a connection C3, but we hit a quota,
   isc_quota_cb_init() sets quota_accept_cb for the socket,
   we return from accept_connection
T2 drops C2, but we race in quota_release with accepting C3 so
   we don't see quota->waiting is > 0, we don't launch the callback
T1 accepts a connection C4, we are able to get the quota we clear
   the quota_accept_cb from sock->quotacb
T1 drops C1, tries to call the callback which is zeroed, sigsegv.
2020-06-10 11:37:27 -07:00
Witold Kręcicki
c449cab63a Don't clean quota cb cb_func/data, we don't own it 2020-06-10 17:52:00 +02:00
Michał Kępień
cc2383e0ab Merge branch '1867-fix-system-tests-on-windows' into 'master'
Fix system tests on Windows

Closes #1867

See merge request isc-projects/bind9!3680
2020-06-09 13:38:39 +00:00
Michał Kępień
fef15bc33d Disable temporarily unsupported tests on Windows
Due to the changes introduced by the Automake migration, system tests
requiring Python (chain, pipelined, qmin, tcp), dynamic loading of
shared objects (dlzexternal, dyndb, filter-aaaa), or LMDB (nzd2nzf)
currently do not work on Windows.  Temporarily disable them on that
platform by moving them from the PARALLEL_COMMON list to the
PARALLEL_UNIX list until the situation is rectified.
2020-06-09 15:35:54 +02:00
Michał Kępień
1861866f63 Fix SYSTEMTESTTOP on Windows
Without SYSTEMTESTTOP=.. lines in tests.sh scripts, SYSTEMTESTTOP is
being set to an absolute path.  On Windows, this means that an absolute
Cygwin path gets passed as a command line argument to native Windows
binaries, which cannot work and causes system tests to break.  Fix by
passing SYSTEMTESTTOP through cygpath on Windows, which causes that
variable to be set to an absolute "mixed mode" path (Windows path with
forward slashes).
2020-06-09 15:35:54 +02:00
Michał Kępień
3437a78e39 Merge branch '1921-gitlab-ci-release-process-fixes' into 'master'
GitLab CI release process fixes

Closes #1921

See merge request isc-projects/bind9!3670
2020-06-09 12:51:05 +00:00
Michał Kępień
03c874c292 Restore GitLab CI job building release tarballs
With "make dist" producing usable source tarballs and documentation
building working again, restore the script which allows a release
tarball to be built by a GitLab CI job, only making minimal adjustments
required due to the changes in the documentation building process and
due to dropping the "version" file.
2020-06-09 14:47:06 +02:00
Michał Kępień
4118805348 Make Sphinx output document naming consistent
Ensure the name of the EPUB file produced by Sphinx is consistent with
the name of its PDF counterpart by adjusting Sphinx configuration.
2020-06-09 14:47:06 +02:00
Michał Kępień
b36b7e8674 Fix respdiff job in GitLab CI
As the "configure" script is no longer stored in the Git repository, run
"autoreconf -fi" at the beginning of the respdiff job in GitLab CI in
order to enable that job to work properly.
2020-06-09 14:47:06 +02:00
Michał Kępień
03adbac3c6 Fix source tarball creation job in GitLab CI
For the time being, "make all" needs to be run before "make dist" can
succeed as parts of the documentation are generated by programs compiled
during the regular build process.

As only one source tarball is published for each BIND release, make sure
the tarball creation job in GitLab CI only contains one tarball in the
desired format among its artifacts.

Drop the TARBALL_COMPRESSOR .gitlab-ci.yml variable as it is no longer
used in the source tarball creation process.
2020-06-09 14:47:06 +02:00
Michał Kępień
ed212e9c63 Revise "srcid" file handling
The "srcid" file present in each BIND source tarball contains a
shortened hash of the Git commit corresponding to a given BIND release.
This allows a Git reference to be included in an archive that otherwise
lacks any Git information.

Before the move to Automake, if an "srcid" file was present in the root
source directory at the time ./configure was run, its contents were used
as the value of a compile-time constant which was then baked into BIND
binaries; otherwise, "git rev-parse" was used to determine the value of
that constant.

With Automake, a similar approach was attempted that required the
"srcid" file to be present at autoreconf time in order for it to be
used.  However, note that this means that even if that file is present
in a source tarball created using "make dist", its contents are not
going to influence the value of the aforementioned compile-time constant
because autoreconf hardcodes the output of "git rev-parse" into the
configure script at autoreconf time.

To make things more clear, always use "git rev-parse" for determining
the value of the PACKAGE_SRCID compile-time constant when running
autoreconf.  This causes "srcid" to be an empty string in source
tarballs built from other source tarballs, but that is not deemed to be
much of an issue as "make dist" is expected to be run from Git
repository clones.  Remove stderr redirections to /dev/null to ensure
errors caused e.g. by running "make dist" from outside a Git repository
clone are not hidden.  Trim the Git commit hash to 7 characters for
consistency between Unix and Windows systems.

Despite the above, ensure the "srcid" file is present in source tarballs
created using "make dist" as that file is used by the build process on
Windows.
2020-06-09 14:47:06 +02:00
Ondřej Surý
d959517290 Merge branch '1808-race-in-resolver-fetch-fix-restore-client' into 'master'
ensure fctx->clientstr is null-terminated

Closes #1808

See merge request isc-projects/bind9!3675
2020-06-06 05:02:12 +00:00
Evan Hunt
364b349ad2 ensure clientstr is null-terminated 2020-06-05 18:56:40 -07:00
Ondřej Surý
1540e42449 Merge branch '1842-correct-the-bind-arm-to-say-that-the-default-session-key-for-use-with-update-policy-local-is' into 'master'
Resolve "Correct the BIND ARM to say that the default session-key for use with 'update-policy local;' is generated at startup"

Closes #1842

See merge request isc-projects/bind9!3664
2020-06-05 14:35:05 +00:00
Suzanne Goldlust
79920cea70 Edit reference.rst to indicate that the TSIG
session key is automatically created on startup
2020-06-05 14:31:56 +00:00
Ondřej Surý
60e95f3c3f Merge branch '1808-race-in-resolver-fetch' into 'master'
Fix a data access race in resolver.

Closes #1912 and #1808

See merge request isc-projects/bind9!3575
2020-06-05 14:21:12 +00:00
Ondřej Surý
5a9f594629 Add release note for #1808 2020-06-05 16:06:42 +02:00
Witold Kręcicki
f0f859411f Add CHANGES entry for #1808 2020-06-05 16:06:42 +02:00
Witold Kręcicki
175c4d9055 Fix a data access race in resolver
We were passing client address to dns_resolver_createfetch as a pointer
and it was saved as a pointer. The client (with its address) could be
gone before the fetch is finished, and in a very odd scenario
log_formerr would call isc_sockaddr_format() which first checks if the
address family is valid (and at this point it still is), then the
sockaddr is cleared, and then isc_netaddr_fromsockaddr is called which
fails an assertion as the address family is now invalid.
2020-06-05 16:06:42 +02:00
Michał Kępień
d494543d6e Merge branch 'mnowak/1769-ensure-all-necessary-files-are-included-in-the-tarball-produced-by-make-dist' into 'master'
Fix 'make dist'

Closes #1769

See merge request isc-projects/bind9!3527
2020-06-05 11:48:55 +00:00
Michal Nowak
5bbc6dd7f1 Fix "make dist"
Make various adjustments necessary to enable "make dist" to build a BIND
source tarball whose contents are complete enough to build binaries, run
unit & system tests, and generate documentation on Unix systems.

Known outstanding issues:

  - "make distcheck" does not work yet.
  - Tests do not work for out-of-tree source-tarball-based builds.
  - Source tarballs are not complete enough for building on Windows.

All of the above will be addressed in due course.
2020-06-05 13:19:49 +02:00
Michal Nowak
eaebc26451 Get rid of "helper" *.c files
Merge lib/isc/unix/ifiter_getifaddrs.c into lib/isc/unix/interfaceiter.c
and lib/isc/xoshiro128starstar.c into lib/isc/random.c.  This avoids the
need for extra Automake directives required to process the "helper" *.c
files properly and makes the code more localized.
2020-06-05 13:19:49 +02:00
Michał Kępień
c3cfdb9670 Refactor lib/isc/fsaccess.c
Turn the static check_bad_bits() function used by both Unix and Windows
systems into a "private" function and extract the "private" parts of
lib/isc/fsaccess.c to lib/isc/fsaccess_common_p.h.  Instead of including
lib/isc/fsaccess.c from lib/isc/{unix,win32}/fsaccess.c, make the former
an independent C source file.

Rename lib/isc/fsaccess.c to lib/isc/fsaccess_common.c to prevent build
issues on Windows caused by multiple source files (lib/isc/fsaccess.c,
lib/isc/win32/fsaccess.c) being compiled into the same object file.

These changes improve consistency with the way "private" functions and
macros are treated elsewhere in the source tree.
2020-06-05 13:19:49 +02:00
Mark Andrews
dc6b26abad Merge branch 'marka-placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!3668
2020-06-05 05:02:23 +00:00
Mark Andrews
a7c7f330d7 placeholder 2020-06-05 14:58:51 +10:00
Mark Andrews
210c1dc1cf Merge branch 'marka-placeholder' into 'master'
Add placeholder for [GL #1873]

See merge request isc-projects/bind9!3665
2020-06-05 00:39:36 +00:00
Mark Andrews
69863f3c82 Add placeholder for [GL #1873] 2020-06-05 00:36:47 +00:00
Mark Andrews
b4a1928c84 Merge branch '1835-add-yaml-for-ede' into 'master'
Resolve "Add the ability to parse and display Extended DNS Error code (EDE)."

Closes #1835

See merge request isc-projects/bind9!3531
2020-06-05 00:34:31 +00:00
Mark Andrews
9e72266705 Improve the behaviour of yamlget.py when run with python2 2020-06-05 10:01:08 +10:00
Mark Andrews
0ec77c2b92 Add +yaml support for EDE 2020-06-05 08:34:51 +10:00
Ondřej Surý
e85bb7b85d Merge branch '1683-check-the-question-section-when-transferring-zones' into 'master'
Resolve "Check the question section when transferring zones."

Closes #1683

See merge request isc-projects/bind9!3244
2020-06-04 14:14:36 +00:00
Mark Andrews
3c65ff7deb Add CHANGES entry and release note for #1683 2020-06-04 16:11:05 +02:00
Evan Hunt
be2972438c Add a test with an incorrect question in a continuation message 2020-06-04 16:10:41 +02:00
Mark Andrews
fd96a41868 Verify the question section when transfering in.
There was a case where an primary server sent a response
on the wrong TCP connection and failure to check the question
section resulted in a truncated zone being served.
2020-06-04 16:10:41 +02:00
Ondřej Surý
e2f362c55b Merge branch '1798-reject-master-zones-with-ds-records-at-the-apex' into 'master'
Resolve "Reject master zones with DS records at the apex."

Closes #1798

See merge request isc-projects/bind9!3435
2020-06-04 14:01:14 +00:00
Mark Andrews
8b05e6f710 Add release note for #1798 2020-06-04 16:00:33 +02:00
Mark Andrews
06e714df0d Add CHANGES entry for #1798 2020-06-04 16:00:33 +02:00
Mark Andrews
ae55fbbe9c Ignore attempts to add DS records at zone apex
DS records belong in the parent zone at a zone cut and
are not retrievable with modern recursive servers.
2020-06-04 16:00:33 +02:00
Mark Andrews
35a58d30c9 Reject primary zones with an DS record at the zone apex.
DS records only belong at delegation points and if present
at the zone apex are invariably the result of administrative
errors.  Additionally they can't be queried for with modern
resolvers as the parent servers will be queried.
2020-06-04 16:00:33 +02:00
Ondřej Surý
2d6f379935 Merge branch '1782-ipv6-docs' into 'master'
Documentation update wrt IPv6 listening.

Closes #1782

See merge request isc-projects/bind9!3642
2020-06-04 13:53:17 +00:00
Witold Kręcicki
d3ea1caf5a Add release notes for #1782 2020-06-04 15:50:40 +02:00
Witold Kręcicki
6a2100034b Documentation update wrt IPv6 listening.
With netmgr we're creating separate socket for each IPv6 interface,
just as with IPv4 - update documentation accordingly.
2020-06-04 15:50:29 +02:00
Ondřej Surý
7bf3636160 Merge branch 'marka-pass-path-in-env' into 'master'
Preserve PATH when calling make

See merge request isc-projects/bind9!3605
2020-06-04 13:45:41 +00:00
Mark Andrews
d9b29fcd9d Preserve PATH and LD_LIBRARY_PATH when calling make
When ./run.sh <test> is invoked, it acts as a wrapper around
`env - TESTS="<test>" make -e check` to preserve the ability to build
files defined only in the `check` target.  Unfortunately, cleaning the
full environment had a side-effect of some tests failing due to missing
binaries and libraries.  We now preserve the two most important
variables - PATH and LD_LIBRARY_PATH.
2020-06-04 15:20:08 +02:00
Michal Nowak
8a93a63356 Merge branch '1902-bind-build-problems-on-netbsd-9' into 'master'
Fix "array subscript is of type 'char'"

Closes #1902

See merge request isc-projects/bind9!3626
2020-06-04 12:33:55 +00:00
Michal Nowak
035bbc5f8f Fix "array subscript is of type 'char'" 2020-06-04 14:33:06 +02:00
Michał Kępień
b19fed3c05 Merge branch '1841-test-multiple-softhsm-versions-in-gitlab-ci' into 'master'
Test multiple SoftHSM versions in GitLab CI

Closes #1841

See merge request isc-projects/bind9!3533
2020-06-04 12:12:40 +00:00
Michał Kępień
c7169c4ab0 Embed SoftHSM version in CI job names
To indicate the SoftHSM version used in each CI job while avoiding the
need to add another token to job names, replace "pkcs11" with
"softhsm2.4" and "fedora31:amd64" with "softhsm2.6".
2020-06-04 14:11:46 +02:00
Michał Kępień
3ecb202ba3 Make Fedora CI jobs PKCS#11-enabled
Various SoftHSM versions differ in algorithm support.  Since Fedora
tends to have the latest SoftHSM version available in its stock package
repositories, enable PKCS#11 support in Fedora jobs to test multiple
SoftHSM versions in GitLab CI.
2020-06-04 14:11:46 +02:00
Michał Kępień
8aa864d042 Fix & unify Debian job comments in .gitlab-ci.yml 2020-06-04 14:11:46 +02:00
Ondřej Surý
db12531bb4 Merge branch '1877-reduce-default-for-max-stale-ttl-release-notes-update' into 'master'
Update release note for #1877

Closes #1877

See merge request isc-projects/bind9!3653
2020-06-04 12:07:51 +00:00
Ondřej Surý
bee9ed84f4 Update release note for #1877 2020-06-04 14:06:30 +02:00
Michal Nowak
8569cf4d25 Merge branch 'mnowak/sbindir' into 'master'
Revise installation locations for BIND binaries

Closes #1724

See merge request isc-projects/bind9!3592
2020-06-04 11:49:03 +00:00
Michal Nowak
172392a98a Add release note for #1724 2020-06-04 13:20:14 +02:00
Michal Nowak
f079cb2471 Add CHANGES for #1724 2020-06-04 13:19:23 +02:00
Michal Nowak
4419606c9d Revise installation locations for BIND binaries
Move BIND binaries which are neither daemons nor administrative programs
to $bindir.  This results in only the following binaries being left in
$sbindir:

  - ddns-confgen
  - named
  - rndc
  - rndc-confgen
  - tsig-confgen
2020-06-04 13:19:23 +02:00
Michal Nowak
3eabeab0f8 Merge branch '1726-unit-tests-rename-tests-to-something-more-descriptive' into 'master'
Associate unit test data dir with a more specific variable

Closes #1726

See merge request isc-projects/bind9!3624
2020-06-04 10:58:55 +00:00
Michal Nowak
eddece7841 Associate unit test data dir with a more specific variable
Having 'TESTS', the Automake variable and 'TESTS' the unit test data dir
seems confusing, lets rename the latter to to 'TESTS_DIR'.
2020-06-04 12:56:57 +02:00
Ondřej Surý
1a9141fa3a Merge branch 'nsupdate-late-responses' into 'master'
Delay kserver cleanup until all tasks finish

See merge request isc-projects/bind9!3316
2020-06-04 09:31:25 +00:00
Ondřej Surý
72e78f0a4b Add CHANGES entry for !3316 2020-06-04 09:28:22 +00:00
Petr Mensik
2685e69be8 Delay kserver cleanup until all tasks finishes
It might be possible some pending task would run when kserver is already
cleaned up. Postpone gsstsig structures cleanup after task and timer
managers are destroyed. No pending threads are possible after it.

Make action in maybeshutdown only if doshutdown was not already called.
Might be called from getinput event.
2020-06-04 09:28:22 +00:00
Ondřej Surý
970db5691d Merge branch '83-cleanup-how-we-build-release-notes' into 'master'
Stop building release notes as a separate sphinx-doc document

Closes #83

See merge request isc-projects/bind9!3649
2020-06-04 09:21:23 +00:00
Ondřej Surý
8eb2323ec3 Stop building release notes as a separate sphinx-doc document
The release notes were previously built as a separate document
(including the PDF version).  It was agreed that this doesn't make much
sense, so the release notes are now included only as an appendix to the
BIND 9 ARM.
2020-06-04 11:09:27 +02:00
Ondřej Surý
a027b6f939 Merge branch '1914-remove-libdns-documentation' into 'master'
Remove libdns section in ARM

Closes #1914

See merge request isc-projects/bind9!3646
2020-06-04 08:55:12 +00:00
Ondřej Surý
3637c466c9 Remove libdns section in ARM
When we made BIND 9 libraries private to BIND 9, we forgot to remove the
libdns section on "export" libraries from the ARM.
2020-06-04 09:19:19 +02:00
Ondřej Surý
b0d86b1c48 Merge branch '1910-text-edits-in-general-rst' into 'master'
Resolve "Text edits in general.rst"

Closes #1910

See merge request isc-projects/bind9!3616
2020-06-04 06:44:23 +00:00
Suzanne Goldlust
8ca7f22671 Content, clarity, grammar updates to general.rst
This includes reorganization of the lists of RFCs supported by BIND 9.

I included all the RFCs and notes from the list identified by Vicky in
any DNS-related RFCs written by current ISC engineers, on the assumption
that BIND would comply with them.
2020-06-04 07:57:21 +02:00
Ondřej Surý
0dd5f385d6 Merge branch '1899-fix-tcp-accept-windows' into 'master'
isc_uv_import wrapper must pass UV__IPC_SOCKET_XFER_TCP_CONNECTION, not SERVER

Closes #1899

See merge request isc-projects/bind9!3618
2020-06-03 21:25:48 +00:00
Witold Kręcicki
801f7af6e9 isc_uv_import must pass UV__IPC_SOCKET_XFER_TCP_CONNECTION, not SERVER.
As a leftover from old TCP accept code isc_uv_import passed TCP_SERVER
flag when importing a socket on Windows.
Since now we're importing/exporting accepted connections it needs to
pass TCP_CONNECTION flag.
2020-06-03 20:08:54 +00:00
Michał Kępień
fa62b26a86 Merge branch 'michal/misc-danger-tweaks' into 'master'
Miscellaneous Danger tweaks

Closes isc-private/bind9#27

See merge request isc-projects/bind9!3621
2020-06-03 13:50:41 +00:00
Michał Kępień
2c90438583 Only run Danger if DANGER_GITLAB_API_TOKEN is set
Prevent the Danger GitLab CI job from failing when the GitLab API key to
use is not set.
2020-06-03 15:45:28 +02:00
Michał Kępień
e062812c38 Prevent invalid warnings about missing identifiers
The Danger script inspects differences between the current version of a
given merge request's target branch and the merge request branch.  If
the latter falls behind the former, the Danger script will wrongly warn
about missing GitLab/RT identifiers because it incorrectly treats the
"+++" diff marker as an indication of the merge request adding new lines
to a file.  Tweak the relevant conditional expression to prevent such
invalid warnings from being raised.
2020-06-03 15:45:28 +02:00
Michał Kępień
d558c4cb78 Make fetching target branch reliable
As GitLab Runner Docker executor caches Git repositories between jobs,
prevent the Danger script from attempting to update local refs to ensure
"git fetch" returns with an exit code of 0.  Use the FETCH_HEAD ref for
determining the differences between the merge request branch and its
target branch.
2020-06-03 15:45:28 +02:00
Michał Kępień
c13944ca46 Tweak condition for missing log message warning
Commits adding CHANGES entries and/or release notes do not need a commit
log message.  Do not warn about a missing commit log message for such
commits to make the warning more meaningful.
2020-06-03 15:45:28 +02:00
Ondřej Surý
bbe1cdddd2 Merge branch '1849-placeholder' into 'master'
Add placeholder CHANGES entry for #1849

Closes #1849

See merge request isc-projects/bind9!3638
2020-06-03 13:34:15 +00:00
Ondřej Surý
446d6f275c Add placeholder CHANGES entry for #1849 2020-06-03 15:29:13 +02:00
Ondřej Surý
93e892b077 Merge branch 'wpk/fix-socket-test-teardown' into 'master'
tests: fix isc/socket_test.c teardown

See merge request isc-projects/bind9!3537
2020-06-03 12:11:39 +00:00
Witold Kręcicki
4a8d9250cf tests: fix isc/socket_test.c teardown
In case of a test failure we weren't tearing down sockets and tasks
properly, causing the test to hang instead of failing nicely.
2020-06-03 13:16:28 +02:00
Ondřej Surý
024337c6a4 Merge branch '1911-remove-runtime_check-res-0-for-so_incoming_cpu' into 'master'
Resolve "RUNTIME_CHECK(res == 0) in SO_REUSE and SO_INCOMING_CPU, commit 09ba47b0676"

Closes #1911

See merge request isc-projects/bind9!3629
2020-06-03 10:46:44 +00:00
Ondřej Surý
80a2ef8987 Add CHANGES for #1911 2020-06-03 12:44:44 +02:00
Ondřej Surý
4ec357da0a Don't check the result of setting SO_INCOMING_CPU
The SO_INCOMING_CPU is available since Linux 3.19 for getting the value,
but only since Linux 4.4 for setting the value (see below for a full
description).  BIND 9 should not fail when setting the option on the
socket fails, as this is only an optimization and not hard requirement
to run BIND 9.

    SO_INCOMING_CPU (gettable since Linux 3.19, settable since Linux 4.4)
        Sets or gets the CPU affinity of a socket.  Expects an integer flag.

            int cpu = 1;
            setsockopt(fd, SOL_SOCKET, SO_INCOMING_CPU, &cpu, sizeof(cpu));

        Because all of the packets for a single stream (i.e., all
	packets for the same 4-tuple) arrive on the single RX queue that
	is associated with a particular CPU, the typical use case is to
	employ one listening process per RX queue, with the incoming
	flow being handled by a listener on the same CPU that is
	handling the RX queue.  This provides optimal NUMA behavior and
	keeps CPU caches hot.
2020-06-03 12:44:44 +02:00
Ondřej Surý
0468454c0a Merge branch '1909-text-edits-in-history-rst' into 'master'
Resolve "Text edits in history.rst"

Closes #1909

See merge request isc-projects/bind9!3615
2020-06-03 10:20:17 +00:00
Suzanne Goldlust
f6164e080f Content, clarity, and grammar edits to history.rst 2020-06-03 10:17:51 +00:00
Ondřej Surý
7aa8c6e09b Merge branch '1908-text-edits-in-troubleshooting-rst' into 'master'
Resolve "Text edits in troubleshooting.rst"

Closes #1908

See merge request isc-projects/bind9!3614
2020-06-03 10:15:28 +00:00
Suzanne Goldlust
c6a064a6e9 Content, clarity, and grammar edits to troubleshooting.rst 2020-06-03 10:13:59 +00:00
Ondřej Surý
9ad03a0fa3 Merge branch '1906-more-bind-arm-text-edits' into 'master'
Resolve "More BIND ARM text edits"

Closes #1906

See merge request isc-projects/bind9!3613
2020-06-03 10:13:45 +00:00
Suzanne Goldlust
7c2136766b Content, grammar, and clarity updates to security.rst 2020-06-03 10:12:42 +00:00
Ondřej Surý
50ed136a04 Merge branch '1877-reduce-default-for-max-stale-ttl-to-something-more-reasonable-12-hours-or-similar-fix-release-note' into 'master'
Add GL issue number to release note

Closes #1877

See merge request isc-projects/bind9!3630
2020-06-03 09:26:08 +00:00
Ondřej Surý
3be37fd9ef Add GL issue number to release note 2020-06-03 11:25:13 +02:00
Ondřej Surý
aa71df65e9 Merge branch '1877-reduce-default-for-max-stale-ttl-to-something-more-reasonable-12-hours-or-similar' into 'master'
Resolve "Reduce default for max-stale-ttl to something more reasonable - 12 hours or similar"

Closes #1877

See merge request isc-projects/bind9!3593
2020-06-03 08:18:37 +00:00
Ondřej Surý
e81728289c Add CHANGES for #1877 2020-06-03 09:48:54 +02:00
Ondřej Surý
fc4f3b92ab Add release notes for #1877 2020-06-03 09:48:54 +02:00
Ondřej Surý
13fd3ecfab Reduce the default value for max-stale-ttl from 1 week to 12 hours
Originally, the default value for max-stale-ttl was 1 week, which could
and in some scenarios lead to cache exhaustion on a busy resolvers.
Picking the default value will always be juggling between value that's
useful (e.g. keeping the already cached records after they have already
expired and the upstream name servers are down) and not bloating the
cache too much (e.g. keeping everything for a very long time).  The new
default reflects what we think is a reasonable to time to react on both
sides (upstream authoritative and downstream recursive).
2020-06-03 09:48:54 +02:00
Matthijs Mekking
b1dc79b5d7 Merge branch '1845-1846-keyrollover-bugs' into 'master'
Fix dnssec-policy key rollover bugs

Closes #1846 and #1845

See merge request isc-projects/bind9!3619
2020-06-02 09:31:54 +00:00
Matthijs Mekking
e71d60299f Retire predecessor when creating successor
When creating the successor, the current active key (predecessor)
should change its goal state to HIDDEN.

Also add two useful debug logs in the keymgr_key_rollover function.
2020-06-02 10:01:28 +02:00
Matthijs Mekking
c08d0f7dd6 If prepub > retire, prepub now
Catch a case where if the prepublication time of the successor key
is later than the retire time of the predecessor. If that is the
case we should prepublish as soon as possible, a.k.a. now.
2020-06-02 10:00:53 +02:00
Matthijs Mekking
bcf8192438 Put new key rollover logic in separate function
The `dns_keymgr_run()` function became quite long, put the logic
that looks if a new key needs to be created (start a key rollover)
in a separate function.
2020-06-02 10:00:53 +02:00
Matthijs Mekking
0d578097ef Fix bug in keymgr_key_has_successor
The logic in `keymgr_key_has_successor(key, keyring)` is flawed, it
returns true if there is any key in the keyring that has a successor,
while what we really want here is to make sure that the given key
has a successor in the given keyring.

Rather than relying on `keymgr_key_exists_with_state`, walk the
list of keys in the keyring and check if the key is a successor of
the given predecessor key.
2020-06-02 10:00:51 +02:00
Matthijs Mekking
ab036232f0 Merge branch '1843-print-correct-keytiming-metadata' into 'master'
Resolve "kasp: Set correct keytimings"

Closes #1843

See merge request isc-projects/bind9!3534
2020-06-02 07:56:38 +00:00
Matthijs Mekking
5b3decaf48 Replace date -d with python script
The usage of 'date -d' in the kasp system test is not portable,
replace with a python script.  Also remove some leftover
"set_keytime 'yes'" calls.
2020-06-02 09:14:27 +02:00
Matthijs Mekking
bcf3c9fecf Add change entry 2020-06-02 09:14:25 +02:00
Matthijs Mekking
61c1040ae5 Test keytimes on algorithm rollover
This improves keytime testing on algorithm rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.
2020-06-02 09:14:24 +02:00
Matthijs Mekking
da5e1e3a0f Test keytimes on policy changes
This improves keytime testing on reconfiguration of the
dnssec-policy.
2020-06-02 09:14:22 +02:00
Matthijs Mekking
e233433772 Test keytimes on CSK rollover
This improves keytime testing on CSK rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.

Since an "active key" for ZSK and KSK means something
different, this makes it tricky to decide when a CSK is
active. An "active key" intuitively means the key is signing
so we say a CSK is active when it is creating zone signatures.

This change means a lot of timings for the CSK rollover tests
need to be adjusted.

The keymgr code needs a slight change on calculating the
prepublication time: For a KSK we need to include the parent
registration delay, but for CSK we look at the zone signing
property and stick with the ZSK prepublication calculation.
2020-06-02 09:14:18 +02:00
Matthijs Mekking
649d0833ce Test keytimes on KSK rollover
This improves keytime testing on KSK rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.
2020-06-02 09:14:16 +02:00
Matthijs Mekking
50bbbb76a8 kasp: registration delay adjustments
Registration delay is not part of the Iret retire interval, thus
removed from the calculation when setting the Delete time metadata.

Include the registration delay in prepublication time, because
we need to prepublish the key sooner than just the Ipub
publication interval.
2020-06-02 09:14:15 +02:00
Matthijs Mekking
e01fcbbaf8 Test keytimes on ZSK rollover
This improves keytime testing on ZSK rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.
2020-06-02 09:14:13 +02:00
Matthijs Mekking
cf51c87fad Test keytimes on enable-dnssec case
This improves keytime testing for enabling DNSSEC.  It now
tests for specific times, and also tests for SyncPublish.
2020-06-02 09:14:11 +02:00
Matthijs Mekking
30cb5c97c2 Set SyncPublish on keys
Set the SyncPublish metadata on keys that don't have them yet.
2020-06-02 09:14:09 +02:00
Matthijs Mekking
f8e34b57b4 Start testing keytiming metadata
This commit adds testing keytiming metadata.  In order to facilitate
this, the kasp system test undergoes a few changes:

1. When finding a key file, rather than only saving the key ID,
   also save the base filename and creation date with `key_save`.
   These can be used later to set expected key times.
2. Add a test function `set_addkeytime` that takes a key, which
   keytiming to update, a datetime in keytiming format, and a number
   (seconds) to add, and sets the new time in the given keytime
   parameter of the given key.  This is used to set the expected key
   times.
3. Split `check_keys` in `check_keys` and `check_keytimes`.  First we
   need to find the keyfile before we can check the keytimes.
   We need to retrieve the creation date (and sometimes other
   keytimes) to determine the other expected key times.
4. Add helper functions to set the expected key times per policy.
   This avoids lots of duplication.

Check for keytimes for the first test cases (all that do not cover
rollovers).
2020-06-02 09:13:02 +02:00
Matthijs Mekking
8483f71258 Stop keeping track of key parameter count
Stop tracking in the comments the number of key parameters in the
kasp system test, it adds nothing beneficial.
2020-06-02 09:13:00 +02:00
Matthijs Mekking
8204e31f0e Fix some more test output filenames
After removing dnssec-settime calls that set key rollover
relationship, we can adjust the counts in test output filenames.

Also fix a couple of more wrong counts in output filenames.
2020-06-02 09:12:58 +02:00
Matthijs Mekking
5a590c47a5 Set key rollover relationship without settime
Using dnssec-setttime after dnssec-keygen in the kasp system test
can lead to off by one second failures, so reduce the usage of
dnssec-settime in the setup scripts.  This commit deals with
setting the key rollover relationship (predecessor/successor).
2020-06-02 09:12:55 +02:00
Matthijs Mekking
637d5f9a68 Move setting keytimes from settime to keygen
In the kasp system test, we are going to set the keytimes on
dnssec-keygen so we can test them against the key creation time.
This prevents off by one second in the test, something that can
happen if you set those times with dnssec-settime after
dnssec-keygen.

Also fix some test output filenames.
2020-06-02 09:12:52 +02:00
Matthijs Mekking
18dc27afd3 Set keytimes appropriately when using kasp
While kasp relies on key states to determine when a key needs to
be published or be used for signing, the keytimes are used by
operators to get some expectation of key publication and usage.

Update the code such that these keytimes are set appropriately.
That means:
- Print "PublishCDS" and "DeleteCDS" times in the state files.
- The keymgr sets the "Removed" and "PublishCDS" times and derives
  those from the dnssec-policy.
- Tweak setting of the "Retired" time, when retiring keys, only
  update the time to now when the retire time is not yet set, or is
  in the future.

This also fixes a bug in "keymgr_transition_time" where we may wait
too long before zone signatrues become omnipresent or hidden. Not
only can we skip waiting the sign delay Dsgn if there is no
predecessor, we can also skip it if there is no successor.

Finally, this commit moves setting the lifetime, reducing two calls
to one.
2020-06-02 09:12:47 +02:00
Matthijs Mekking
1c21631730 keygen -k: allow to set times, not genonly
For testing purposes mainly, we want to allow set keytimings on
generated keys, such that we don't have to "keygen/settime" which
can result in one second off times.
2020-06-02 09:12:38 +02:00
Ondřej Surý
31fa72ec2e Merge branch '1164-add-danger-python-to-gitlab-ci' into 'master'
Add Danger Python to GitLab CI

Closes #1164

See merge request isc-projects/bind9!3583
2020-06-01 11:40:58 +00:00
Michał Kępień
36bb45a8b6 Add Danger Python to GitLab CI
Certain rules of the BIND development process are not codified anywhere
and/or are used inconsistently.  In an attempt to improve this
situation, add a GitLab CI job which uses Danger Python to add comments
to merge requests when certain expectations are not met.  Two categories
of feedback are used, only one of which - fail() - causes the GitLab CI
job to fail.  Exclude dangerfile.py from Python QA checks as the way the
contents of that file are evaluated triggers a lot of Flake8 and PyLint
warnings.
2020-06-01 11:13:31 +00:00
Ondřej Surý
a8aa9d4ff8 Merge branch 'ondrej/fix-higlight-typo' into 'master'
Fix typo (higlight -> highlight) in documentation

See merge request isc-projects/bind9!3610
2020-06-01 07:45:39 +00:00
Ondřej Surý
e6c867195d Fix typo (higlight -> highlight) in documentation 2020-06-01 09:41:58 +02:00
Ondřej Surý
3138bdf406 Merge branch 'sgoldlust-1826-various-text-edits-needed-in-bind-arm-patch-99571' into 'master'
Text edits in reference.rst

See merge request isc-projects/bind9!3569
2020-06-01 07:32:40 +00:00
Suzanne Goldlust
1e067c4d0b Grammar, clarity, and content fixes in reference.rst
Also converted logging-categories.rst from a table to text and adjusted
the util/check-categories.sh script.
2020-06-01 09:21:38 +02:00
Suzanne Goldlust
c7264db658 Text, grammar, typo, and clarity edits in multiple ARM chapters
Files requirements.rst, configuration.rs, plugins.rst, and partially
reference.rst has been edited.
2020-06-01 09:09:34 +02:00
Ondřej Surý
b3931bfaa3 Merge branch '1888-text-edits-in-catz-rst' into 'master'
Resolve "Text edits in catz.rst"

Closes #1888

See merge request isc-projects/bind9!3596
2020-06-01 07:02:44 +00:00
Suzanne Goldlust
19ff2e2a79 Content and grammar edits to catz.rst 2020-06-01 07:02:44 +00:00
Ondřej Surý
5337e2e1f7 Merge branch '1894-edits-to-contributing-md' into 'master'
Resolve "Edits to CONTRIBUTING.md"

Closes #1894

See merge request isc-projects/bind9!3603
2020-06-01 07:01:16 +00:00
Suzanne Goldlust
58c61b6e7b Content updates to CONTRIBUTING.md 2020-06-01 07:01:15 +00:00
Mark Andrews
1e08a53932 Merge branch '1898-rst-files-should-be-independent-of-configure-option' into 'master'
Resolve "'.rst' files should be independent of configure option."

Closes #1898

See merge request isc-projects/bind9!3604
2020-06-01 04:51:42 +00:00
Mark Andrews
52dc7fd89d remove ' // not configured' comment when generating options.active 2020-06-01 12:06:42 +10:00
Evan Hunt
4b91732c09 Merge branch '1857-assertion-failure-insist-nlabels-name-labels' into 'master'
Resolve "assertion failure in 9.16.2: name.c:1738: INSIST(nlabels == name->labels)"

Closes #1857

See merge request isc-projects/bind9!3577
2020-05-29 21:50:17 +00:00
Evan Hunt
6ebab27567 CHANGES, release note 2020-05-29 14:22:37 -07:00
Mark Andrews
eded3efb79 Ensure tree lock is always held when dns_rbt_fullnamefromnode is called 2020-05-29 14:17:39 -07:00
Evan Hunt
db9d10e3c1 pass the nodename to add32() instead of calling dns_rbt_fullnamefromnode()
in addition to being more efficient, this prevents a possible crash by
looking up the node name before the tree sructure can be changed when
cleaning up dead nodes in addrdataset().
2020-05-29 14:17:36 -07:00
Ondřej Surý
f027763d3a Merge branch 'wpk/fix-leaking-mutexes-and-conditionals' into 'master'
Add missing isc_mutex_destroy and isc_conditional_destroy calls.

Closes #1893

See merge request isc-projects/bind9!3600
2020-05-29 19:47:26 +00:00
Witold Kręcicki
4ae2a74873 CHANGES and release notes 2020-05-29 19:18:58 +00:00
Witold Kręcicki
7ef756f639 Clear sock->magic to 0 when destroying a netmgr socket 2020-05-29 19:18:58 +00:00
Witold Kręcicki
a8807d9a7b Add missing isc_mutex_destroy and isc_conditional_destroy calls.
While harmless on Linux, missing isc_{mutex,conditional}_destroy
causes a memory leak on *BSD. Missing calls were added.
2020-05-29 19:18:58 +00:00
Ondřej Surý
146748f5c6 Merge branch 'feature/rndc-confgen-quiet' into 'master'
Make possible not printing written path

See merge request isc-projects/bind9!3578
2020-05-29 13:59:42 +00:00
Petr Menšík
4748202fac Make possible not printing written path
Changes written path from stderr to stdout if enabled.
Adds -q parameter to hide written path.
2020-05-29 13:22:13 +00:00
Ondřej Surý
a746166f7a Merge branch '1872-text-edits-in-advanced-rst' into 'master'
Resolve "Text edits in advanced.rst"

Closes #1872

See merge request isc-projects/bind9!3580
2020-05-29 13:21:46 +00:00
Suzanne Goldlust
a0f2dceb02 Oops, missed one text edit. 2020-05-29 13:20:28 +00:00
Suzanne Goldlust
087c4c3b9e Various text edits to advanced.rst 2020-05-29 13:20:28 +00:00
Ondřej Surý
eb13bd8ece Merge branch '1825-improperly-formatted-commands-in-bind-arm' into 'master'
Resolve "Improperly formatted commands in BIND ARM"

Closes #1825

See merge request isc-projects/bind9!3579
2020-05-29 13:20:09 +00:00
Suzanne Goldlust
047680d53b Fix incorrect command formatting 2020-05-29 13:19:41 +00:00
Ondřej Surý
1c7f63b300 Merge branch '1881-text-edits-in-dnssec-rst' into 'master'
Resolve "Text edits in dnssec.rst"

Closes #1881

See merge request isc-projects/bind9!3589
2020-05-29 13:15:24 +00:00
Suzanne Goldlust
5d3ef17ac8 Content and grammar edits to dnssec.rst 2020-05-29 13:14:36 +00:00
Ondřej Surý
45b3afc8d7 Merge branch '1882-text-edits-in-managed-keys-rst' into 'master'
Resolve "Text edits in managed-keys.rst"

Closes #1882

See merge request isc-projects/bind9!3590
2020-05-29 13:11:20 +00:00
Suzanne Goldlust
c269c061ee Content and grammar changes to managed-keys.rst 2020-05-29 13:10:43 +00:00
Ondřej Surý
0999d84f57 Merge branch '1886-text-edits-in-dlz-rst' into 'master'
Resolve "Text edits in dlz.rst"

Closes #1886

See merge request isc-projects/bind9!3594
2020-05-29 13:02:18 +00:00
Suzanne Goldlust
5d6c93aed7 Content and grammar updates to dlz.rst 2020-05-29 13:01:33 +00:00
Ondřej Surý
d57200f2ab Merge branch '1887-text-edits-in-dyndb-rst' into 'master'
Resolve "Text edits in dyndb.rst"

Closes #1887

See merge request isc-projects/bind9!3595
2020-05-29 13:00:10 +00:00
Suzanne Goldlust
18129808f7 Content and grammar updates to dyndb.rst 2020-05-29 12:59:39 +00:00
Ondřej Surý
25c675a9de Merge branch '1774-fix-windows-build' into 'master'
Get Windows builds working again

Closes #1774

See merge request isc-projects/bind9!3571
2020-05-29 12:31:22 +00:00
Ondřej Surý
bf60e445ed Stop using AC_C_FLEXIBLE_ARRAY_MEMBER, support for it is part of C99 2020-05-28 11:28:44 +02:00
Ondřej Surý
fe04426778 Define WIN32_LEAN_AND_MEAN globally instead of anecdotically 2020-05-28 11:28:44 +02:00
Ondřej Surý
7208c94ee3 Use forward slashes instead of backslashes as directory separator on Windows 2020-05-28 11:28:44 +02:00
Ondřej Surý
d179d12686 Cleanup the shell scripts used to run tests on Windows 2020-05-28 11:28:44 +02:00
Ondřej Surý
54a049d94f Add support for replacing {,top_,abs_}{srcdir,builddir} from win32util/Configure 2020-05-28 08:08:38 +02:00
Ondřej Surý
0ce7ded9f9 Add xsl.c generation to vcxproj files for named build 2020-05-28 08:08:38 +02:00
Ondřej Surý
1a870e054d Set the PACKAGE_BUILDER to include _MSC_VER 2020-05-28 08:08:38 +02:00
Ondřej Surý
4c23724c97 Move the dependencies from sln to vcxproj files 2020-05-28 08:08:30 +02:00
Ondřej Surý
5dcef1c53e Fix the makejournal.vcxproj file 2020-05-28 08:07:57 +02:00
Ondřej Surý
bbd54bdfa9 Update how we build bind.keys.h (both POSIX and Windows)
The code in util/bindkeys.pl was overly complicated and it could not be
reused on Windows because redirecting stdin and stdout at the same time
from perl is overly complicated.

Now the util/bindkeys.pl accepts the input file as the first and only
argument and prints the header file to stdout.  This allows the same
utility to be used from automake and win32/Configure script.
2020-05-28 08:07:57 +02:00
Ondřej Surý
4c8765e31d Always save build artifacts on Windows 2020-05-28 08:07:57 +02:00
Ondřej Surý
5bd2037b4e Fix the missing thread_local define on Windows 2020-05-28 08:07:57 +02:00
Ondřej Surý
009bb594a2 Make win32util/Configure aligned with autoconf-style 2020-05-28 08:07:57 +02:00
Ondřej Surý
bfd87e453d Restore the GSSAPI compilation on Windows (but we should really switch to SSPI/Kerberos) 2020-05-28 08:07:57 +02:00
Ondřej Surý
f78b725313 Restore the Windows build and test jobs 2020-05-28 08:07:57 +02:00
Ondřej Surý
8c4ee37dab Add ltdl.h shim for Windows 2020-05-28 08:07:57 +02:00
Mark Andrews
028362d937 Merge branch '1858-silence-tsan-in-bin-nsupdate-nsupdate-c' into 'master'
Resolve "Silence TSAN in bin/nsupdate/nsupdate.c"

Closes #1858

See merge request isc-projects/bind9!3558
2020-05-28 00:43:19 +00:00
Mark Andrews
b3bd8a270b Lock access to 'answer' to silence TSAN 2020-05-28 10:01:03 +10:00
Evan Hunt
de734ae39c Merge branch 'wpk-dirty-query-debuglog' into 'master'
single-query trace logging

Closes #1851

See merge request isc-projects/bind9!3545
2020-05-26 08:47:15 +00:00
Evan Hunt
d09c4ad402 CHANGES, README, release note 2020-05-26 00:55:19 -07:00
Evan Hunt
249184e03e add a quick-and-dirty method of debugging a single query
when built with "configure --enable-singletrace", named will produce
detailed query logging at the highest debug level for any query with
query ID zero.

this enables monitoring of the progress of a single query by specifying
the QID using "dig +qid=0". the "client" logging category should be set
to a low severity level to suppress logging of other queries. (the
chance of another query using QID=0 at the same time is only 1 in 2^16.)

"--enable-singletrace" turns on "--enable-querytrace" as well, so if the
logging severity is not lowered, all other queries will be logged
verbosely as well. compiling with either of these options will impair
query performance; they should only be turned on when testing or
troubleshooting.
2020-05-26 00:47:18 -07:00
Evan Hunt
23f2ab4543 add "dig +qid" option to set QID to desired value 2020-05-26 00:47:18 -07:00
Evan Hunt
0ef6dde124 Merge branch 'each-bool-conditionals' into 'master'
remove unnecessary 'true' and 'false' comparisons in boolean expressions

See merge request isc-projects/bind9!3312
2020-05-26 00:00:05 +00:00
Evan Hunt
57e54c46e4 change "expr == false" to "!expr" in conditionals 2020-05-25 16:09:57 -07:00
Evan Hunt
68a1c9d679 change 'expr == true' to 'expr' in conditionals 2020-05-25 16:09:57 -07:00
Mark Andrews
1093c36648 Merge branch '1860-delv-crashes-processing-deprecated-trusted-keys-clause-in-anchor-file' into 'master'
Resolve "delv crashes processing deprecated "trusted-keys" clause in anchor file"

Closes #1860

See merge request isc-projects/bind9!3568
2020-05-25 22:27:51 +00:00
Mark Andrews
7854b652c3 Add CHANGES 2020-05-26 07:48:54 +10:00
Mark Andrews
d807febd25 Handle deprecated 'trusted-keys' style anchors 2020-05-26 07:48:19 +10:00
Mark Andrews
26b3ca7acf Check that delv supports deprecated trusted-keys 2020-05-26 07:48:19 +10:00
Michał Kępień
8422b23c92 Merge branch '1868-edns-udp-buffer-size-tweaks' into 'master'
EDNS UDP buffer size tweaks

Closes #1868

See merge request isc-projects/bind9!3576
2020-05-25 12:38:28 +00:00
Michał Kępień
862a51d891 Add CHANGES entry
5417.	[cleanup]	The code determining the advertised UDP buffer size in
			outgoing EDNS queries has been refactored to improve its
			clarity. [GL #1868]
2020-05-25 14:34:56 +02:00
Michał Kępień
8ddd5c2f9c Update "edns-udp-size" documentation in the ARM
Update the description of the process for determining the advertised UDP
buffer size in outgoing queries so that it matches the code.
2020-05-25 14:34:56 +02:00
Michał Kępień
fb123df2b2 Improve the "hint" variable comment
Replace an existing comment with a more verbose explanation of when the
"hint" variable is set in resquery_send() and how its value affects the
advertised UDP buffer size in outgoing queries.
2020-05-25 14:34:56 +02:00
Michał Kępień
d27f96cc98 Ensure server-specific "edns-udp-size" is obeyed
If "edns-udp-size" is set in a "server" block matching the queried
server, it is accounted for in the process of determining the advertised
UDP buffer size, but its value may still be overridden before the query
is sent.  This behavior contradicts the ARM which claims that when set,
the server-specific "edns-udp-size" value is used for all EDNS queries
sent to a given server.

Furthermore, calling dns_peer_getudpsize() with the "udpsize" variable
as an argument makes the code hard to follow as that call may either
update the value of "udpsize" or leave it untouched.

Ensure the code matches the documentation by moving the
dns_peer_getudpsize() call below all other blocks of code potentially
affecting the advertised UDP buffer size, which is where it was located
when server-specific "edns-udp-size" support was first implemented [1].
Improve code readability by calling dns_peer_getudpsize() with a helper
variable instead of "udpsize".

[1] see commit 1c153afce5
2020-05-25 14:34:56 +02:00
Michał Kępień
d7583e7926 Restore semantic meaning of DNS_FETCHOPT_EDNS512
When the DNS_FETCHOPT_EDNS512 flag was first introduced [1], it enforced
advertising a 512-byte UDP buffer size in an outgoing query.  Ever since
EDNS processing code got updated [2], that flag has still been set upon
detection of certain query timeout patterns, but it has no longer been
affecting the calculations of the advertised UDP buffer size in outgoing
queries.  Restore original semantic meaning of DNS_FETCHOPT_EDNS512 by
ensuring the advertised UDP buffer size is set to 512 bytes when that
flag is set.  Update existing comments and add new ones to improve code
readability.

[1] see commit 08c9026166
[2] see commit 8e15d5eb3a
2020-05-25 14:34:56 +02:00
Michał Kępień
949d9a3ea4 Remove fctx->reason and a misleading log message
The following message:

    success resolving '<name>' (in '<domain>'?) after reducing the advertised EDNS UDP packet size to 512 octets

can currently be logged even if the EDNS UDP buffer size advertised in
queries sent to a given server had already been set to 512 octets before
the fetch context was created (e.g. due to the server responding
intermittently).  In other words, this log message may be misleading as
lowering the advertised EDNS UDP buffer size may not be the actual cause
of <name> being successfully resolved.  Remove the log message in
question to prevent confusion.

As this log message is the only existing user of the "reason" field in
struct fetchctx, remove that field as well, along with all the code
related to it.
2020-05-25 14:34:56 +02:00
Mark Andrews
bb1ec1f6a1 Merge branch '1861-named_checknames_get-missing-dbc' into 'master'
Resolve "named_checknames_get missing DBC"

Closes #1861

See merge request isc-projects/bind9!3567
2020-05-25 01:46:22 +00:00
Mark Andrews
20c07da49b Add DBC checks to named_checknames_get 2020-05-25 11:09:56 +10:00
Mark Andrews
ac9e266749 Set obj to NULL so INSIST makes sense 2020-05-25 11:09:56 +10:00
Michal Nowak
6f576b2c18 Merge branch 'mnowak/automake-unit-tests' into 'master'
Provide unit test driver

Closes #1722

See merge request isc-projects/bind9!3554
2020-05-21 10:15:18 +00:00
Michal Nowak
bfa6ecb796 Provide unit test driver
This adds a unit test driver for BIND with Automake.  It runs the unit
test program provided as its sole command line argument and then looks
for a core dump generated by that test program.  If one is found, the
driver prints the backtrace into the test log.
2020-05-21 12:13:01 +02:00
Michał Kępień
ea5515d292 Merge branch 'michal/do-not-install-python-packages-in-gitlab-ci-jobs' into 'master'
Do not install Python packages in GitLab CI jobs

See merge request isc-projects/bind9!3555
2020-05-21 09:36:47 +00:00
Michał Kępień
d5562a3e7e Add py.test-3 to the list of tested pytest names
Some operating systems (e.g. CentOS, OpenBSD) install the main pytest
script as "py.test-3".  Add that name to the list of names passed to
AC_PATH_PROGS() in order for pytest to be properly detected on a broader
range of operating systems.
2020-05-21 11:33:11 +02:00
Michał Kępień
5562c38ffb Do not use f-strings in Python system tests
Use str.format() instead of f-strings in Python system tests to enable
them to work on Python 3 versions older than 3.6 as the latter is not
available on some operating systems used in GitLab CI that are still
actively supported (CentOS 6, Debian 9, Ubuntu 16.04).
2020-05-21 11:33:11 +02:00
Michał Kępień
62b8a5e59d Do not install doc build tools in GitLab CI jobs
As documentation building utilities are now all included in operating
system images used in GitLab CI, do not install them in each "docs" CI
job any more.
2020-05-21 11:33:11 +02:00
Michał Kępień
e3c217296d Do not install Python packages in GitLab CI jobs
As Python QA tools, BIND system test prerequisites, and documentation
building utilities are now all included in operating system images used
in GitLab CI, do not use pip for installing them in each CI job any
more.
2020-05-21 11:33:11 +02:00
Michał Kępień
622ec2b240 Merge branch 'michal/update-release-checklist' into 'master'
Update release checklist

See merge request isc-projects/bind9!3566
2020-05-21 07:15:10 +00:00
Michał Kępień
da6a4bec21 Update release checklist
- First merge release branches to maintenance branches, then push
    tags.  If tags are pushed first and a given set of releases contains
    security fixes, the push will be rejected by a server-side Git hook.

  - Update ABI check job name.

  - Add an item for updating QA tools used in GitLab CI after each
    public release.
2020-05-21 09:14:27 +02:00
Mark Andrews
0a87413c2a Merge branch '1854-extend-loop-limit-by-1' into 'master'
Resolve "Extend loop limit by 1."

Closes #1854

See merge request isc-projects/bind9!3548
2020-05-21 00:28:45 +00:00
Mark Andrews
3012e1ad9b Extend loop count by 1 to account for non-exact timing in usleep(). 2020-05-21 10:00:13 +10:00
Witold Krecicki
d003949cdb Merge branch '1859-deadlock-in-socket-c' into 'master'
Fix possible deadlock in unix/socket.c

Closes #1859

See merge request isc-projects/bind9!3561
2020-05-20 08:32:02 +00:00
Witold Kręcicki
0eec2594b9 Fix possible deadlock in unix/socket.c
In process_fd we lock sock->lock and then internal_accept locks mgr->lock,
in isc_sockmgr_render* functions we lock mgr->lock and then lock sock->lock,
that can cause a deadlock when accessing stats. Unlock sock->lock early in
all the internal_{send,recv,connect,accept} functions instead of late
in process_fd.
2020-05-20 09:57:25 +02:00
Michał Kępień
25b4280161 Merge branch 'may-2020-cve-fixes' into 'master'
[CVE-2020-8616] [CVE-2020-8617] May 2020 CVE fixes

Closes #1703 and #1388

See merge request isc-projects/bind9!3562
2020-05-19 11:53:08 +00:00
Mark Andrews
f533a73d99 Merge branch '1388-confidential-issue' into 'security-master'
1388 confidential issue

See merge request isc-private/bind9!135
2020-05-19 12:32:32 +02:00
Mark Andrews
7ea45838a9 Add release notes entry 2020-05-19 12:32:31 +02:00
Mark Andrews
83965f70df Add CHANGES entry 2020-05-19 12:31:29 +02:00
Mark Andrews
9b90a01d75 Update the ARM to reflect that TLD and root servers are no longer exempt
from max-recursion-queries limits.
2020-05-19 12:31:28 +02:00
Mark Andrews
e7abb07030 Merge branch '1703-tsig-verify-failure' into security-master 2020-05-19 12:30:29 +02:00
Mark Andrews
266faa3399 Count queries to the root and TLD servers as well 2020-05-19 12:30:29 +02:00
Stephen Morris
19eda751b4 Add test for reduction in number of fetches
Add a system test that counts how many address fetches are made
for different numbers of NS records and checks that the number
are successfully limited.
2020-05-19 12:30:29 +02:00
Mark Andrews
3ee5ea2fdb Reduce the number of fetches we make when looking up addresses
If there are more that 5 NS record for a zone only perform a
maximum of 4 address lookups for all the name servers.  This
limits the amount of remote lookup performed for server
addresses at each level for a given query.
2020-05-19 12:30:29 +02:00
Mark Andrews
2a020ea970 Add release note entry 2020-05-19 12:30:28 +02:00
Mark Andrews
52b4395a0c Add CHANGES entry 2020-05-19 12:29:21 +02:00
Mark Andrews
2d95c81452 Only look at tsig.error in responses 2020-05-19 12:29:21 +02:00
Mark Andrews
cb61e1dd1d Check that a 'BADTIME' response with 'QR=0' is handled as a request 2020-05-19 12:29:21 +02:00
Mark Andrews
a53bc0b28b Merge branch '1856-race-in-clear-signing-records-in-dnssec-system-test' into 'master'
Resolve "Race in 'clear signing records' in dnssec system test."

Closes #1856

See merge request isc-projects/bind9!3557
2020-05-19 03:33:53 +00:00
Mark Andrews
3405ee9eb2 Add CHANGES 2020-05-19 13:33:09 +10:00
Mark Andrews
353018c0e5 Address race in dnssec system test. 'clear signing records' can fail
as the update triggers by the rndc command to clear the signing records
may not have completed by the time the subsequent rndc command to test
that the records have been removed is commenced.  Loop several times to
prevent false negative.
2020-05-19 10:09:51 +10:00
Mark Andrews
bd0ac6ef75 Merge branch '1855-check-max-journal-size-limits-failed-as-not-enough-time-allowed' into 'master'
Resolve ""check max-journal-size limits" failed as not enough time allowed"

Closes #1855

See merge request isc-projects/bind9!3551
2020-05-18 14:10:56 +00:00
Mark Andrews
aaacf3ef45 Add CHANGES 2020-05-18 23:34:13 +10:00
Mark Andrews
0c2f0e02f2 Wait longer (up to 20 secs) for journal to be truncated 2020-05-18 23:34:13 +10:00
Michał Kępień
cda220fff3 Merge branch 'michal/misc-cppcheck-tweaks' into 'master'
Miscellaneous cppcheck tweaks

See merge request isc-projects/bind9!3541
2020-05-18 08:28:26 +00:00
Michał Kępień
481fa34e50 Work around cppcheck 2.0 uninitvar false positives
cppcheck 2.0 reports false positives about uninitialized variables in a
lot of places throughout BIND source code, e.g.:

    bin/dnssec/dnssec-cds.c:283:6: error: Uninitialized variable: length [uninitvar]
     if (isc_buffer_availablelength(&buf) <= len) {
         ^

Apparently cppcheck 2.0 has issues with processing (&var)->field syntax,
which is what the macros from lib/isc/include/isc/buffer.h are evaluated
to.  This issue was reported upstream [1] and will hopefully be
addressed in a future cppcheck release.

In the meantime, to avoid modifying BIND source code in multiple places
just because of a static checker false positive, work around the issue
by adding intermediate variables to buffer macro definitions using a sed
invocation in the cppcheck job script.

[1] https://sourceforge.net/p/cppcheck/discussion/general/thread/122153e3c1/
2020-05-18 10:23:06 +02:00
Michał Kępień
3b48eec79f Make GCC version extraction work with GCC 10
Add whitespace to the regular expression used for extracting the GCC
version from "gcc --version" output so that it works properly with
multi-digit major version numbers.
2020-05-18 10:23:06 +02:00
Michał Kępień
cb2037ee9d Ensure cppcheck creates a HTML report upon failure
Commit ec72d1100d broke the cppcheck job
in GitLab CI: when cppcheck fails, the script is immediately
interrupted, preventing cppcheck-htmlreport from being run.  To ensure
the HTML report is generated when cppcheck fails, revert to invoking
cppcheck-htmlreport in the "after_script" part of the job.
2020-05-18 10:23:06 +02:00
Mark Andrews
f07a714565 Merge branch '1852-race-in-autosign-system-test' into 'master'
Resolve "race in autosign system test."

Closes #1852

See merge request isc-projects/bind9!3546
2020-05-18 05:56:33 +00:00
Mark Andrews
07e335138b Add CHANGES 2020-05-18 15:17:42 +10:00
Mark Andrews
46c4e5d96f Retry checks that records are present and signed
There a race between when the delta is logged and when the
server returns signed record.  Retry the queries if the
lookups fail to meet expectations.
2020-05-18 12:19:16 +10:00
Evan Hunt
d298aa3bd4 Merge branch 'each-move-wiretest' into 'master'
move wire_test

See merge request isc-projects/bind9!3544
2020-05-18 00:30:17 +00:00
Evan Hunt
93d63cd923 incidental fix: reduce a long timeout in dnstap test
the dnstap test was pausing for 20 seconds to search for a string in
named.run, which only appears if named is built with --enable-developer or
--enable-querytrace.
2020-05-15 13:19:33 -07:00
Evan Hunt
e45be9d134 move wire_test back to bin/tests, no longer dependent on dnstap
wire_test is not only used by the dnstap system test, but also in
fuzz testing. it doesn't need to be installed, but it's useful to have it
built when BIND is.  this commit moves it back from bin/tests/system to
bin/tests, as a noinst_PROGRAM so that it's built by "make all" but
not installed.
2020-05-15 13:19:28 -07:00
Michal Nowak
89d7d9aff7 Merge branch 'mnowak/abi-check-artifacts' into 'master'
Collect TXT and HTML reports produced by ABI checker

See merge request isc-projects/bind9!3501
2020-05-15 09:28:42 +00:00
Michal Nowak
b5ccf95b0a Collect TXT and HTML reports produced by ABI checker
Although in util/api-checker.sh we create textual reports, we don't
preserve them in job artifacts, but we should.

We don't want to keep all HTML pages present in the project root, but
just those produced by ABI checker.
2020-05-15 11:26:27 +02:00
Mark Andrews
582b931032 Merge branch '1714-provide-ixfr-no-should-still-send-up-to-date-responses' into 'master'
Resolve "'provide-ixfr no;' should still send up-to-date responses."

Closes #1714

See merge request isc-projects/bind9!3307
2020-05-15 03:48:21 +00:00
Mark Andrews
11b1cbecb0 Add CHANGES entry 2020-05-14 16:38:11 +10:00
Mark Andrews
c7cdc47cc5 move provide-ixfr testing after the serial has been checked 2020-05-14 16:37:34 +10:00
Witold Krecicki
ee72c3f0d5 Merge branch 'wpk/fix-isc-assertions-c-error' into 'master'
Fix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c

See merge request isc-projects/bind9!3504
2020-05-13 10:19:57 +00:00
Witold Kręcicki
f4260dc0c5 Fix 'error: ‘%s’ directive argument is null [-Werror=format-overflow=]' in assertions.c 2020-05-13 11:02:23 +02:00
Witold Krecicki
9427028b78 Merge branch 'wpk/tcp-accept-refactoring' into 'master'
TCP accept refactoring

See merge request isc-projects/bind9!3320
2020-05-13 07:19:49 +00:00
Witold Kręcicki
813ff015a4 CHANGES note 2020-05-13 08:46:04 +02:00
Witold Kręcicki
2f252a1068 Clean quota callback after calling it 2020-05-13 08:45:27 +02:00
Witold Kręcicki
60629e5b0b Redesigned TCP accepting: one listen/accept loop, passing the connected socket.
Instead of using bind() and passing the listening socket to the children
threads using uv_export/uv_import use one thread that does the accepting,
and then passes the connected socket using uv_export/uv_import to a random
worker. The previous solution had thundering herd problems (all workers
waking up on one connection and trying to accept()), this one avoids this
and is simpler.
The tcp clients quota is simplified with isc_quota_attach_cb - a callback
is issued when the quota is available.
2020-05-13 08:45:27 +02:00
Mark Andrews
6ace801ddf Merge branch 'marka-update-per-type-record-limits' into 'master'
allow per type record counts to be specified in update-policy

Closes #1657

See merge request isc-projects/bind9!2124
2020-05-13 06:06:11 +00:00
Mark Andrews
8f9dc72e63 Add release note entry 2020-05-13 15:42:24 +10:00
Mark Andrews
d4f37dd18d Add CHANGES note 2020-05-13 15:37:20 +10:00
Mark Andrews
0dd6d67fab document type count limits 2020-05-13 15:35:29 +10:00
Mark Andrews
04da28bdff test max records policy 2020-05-13 15:35:29 +10:00
Mark Andrews
919a9ece25 enforce record count maximums 2020-05-13 15:35:28 +10:00
Mark Andrews
79de6edde8 allow grant rules to be retrieved 2020-05-13 15:35:28 +10:00
Mark Andrews
361ec726cb allow per type record counts to be specified 2020-05-13 15:35:28 +10:00
Evan Hunt
61b5395581 Merge branch 'each-nsec3-ixfr' into 'master'
don't bother checking for empty nodes when searching the NSEC3 tree

Closes #1834

See merge request isc-projects/bind9!3512
2020-05-12 20:26:40 +00:00
Evan Hunt
0f901b5f2d CHANGES 2020-05-12 12:37:06 -07:00
Evan Hunt
7192edf9c2 don't bother checking for empty nodes when searching the NSEC3 tree
this avoids a time-wasting search that could occur during an
IXFR that replaced an NSEC3 chain.
2020-05-12 12:35:29 -07:00
Ondřej Surý
fb3a419106 Merge branch 'michal/prepare-release-notes-for-master' into 'master'
Prepare release notes for "master"

See merge request isc-projects/bind9!3517
2020-05-12 13:52:32 +00:00
Michał Kępień
28624cf595 Add table of contents for release notes 2020-05-12 15:20:22 +02:00
Michał Kępień
6e25fd373d Drop custom section identifiers 2020-05-12 15:20:22 +02:00
Michał Kępień
784b13344c Apply release note tweaks lost during rebase 2020-05-12 15:20:22 +02:00
Michał Kępień
08d4983a5f Restore release notes for BIND 9.17.2 2020-05-12 15:20:22 +02:00
Michał Kępień
e7a9fc8a0e Restore release notes for BIND 9.17.1 2020-05-12 15:20:22 +02:00
Michał Kępień
ff1ac20e0f Restore release notes for BIND 9.17.0 2020-05-12 15:20:22 +02:00
Michał Kępień
dcea0791c2 Tweak and reword recent CHANGES entries 2020-05-12 15:20:22 +02:00
Mark Andrews
7f748bb14a Merge branch '1835-add-the-ability-to-parse-and-display-extended-dns-error-code-ede' into 'master'
Resolve "Add the ability to parse and display Extended DNS Error code (EDE)."

Closes #1835

See merge request isc-projects/bind9!3515
2020-05-12 12:26:50 +00:00
Mark Andrews
88615006c5 Add release note entry 2020-05-12 22:01:54 +10:00
Mark Andrews
79729c0e19 Add CHANGES entry 2020-05-12 22:01:54 +10:00
Mark Andrews
e6b0153f8a Check display of EDE option 2020-05-12 22:01:54 +10:00
Mark Andrews
1c8f9d06e2 Also print out valid printable utf8 2020-05-12 22:01:54 +10:00
Mark Andrews
b144ae1bb0 Report Extended DNS Error codes 2020-05-12 22:01:54 +10:00
Ondřej Surý
39eca3dc6e Merge branch 'ondrej/fix-statschannel-setup.sh-failure' into 'master'
Fix statschannel setup.sh failure

See merge request isc-projects/bind9!3522
2020-05-12 11:10:55 +00:00
Ondřej Surý
2dbf68ab30 Fix the rsabigexponent setup.sh script to not fail 2020-05-12 12:35:53 +02:00
Ondřej Surý
e96f5bb3f4 Remove the custom-test-driver status_file 2020-05-12 12:34:29 +02:00
Ondřej Surý
e43893fb0c Add missing manykeys.db.in file that was causing statschannel setup.sh to fail 2020-05-12 10:37:48 +02:00
Ondřej Surý
8b357a35d2 Fail immediatelly when clean.sh or setup.sh fails
The `statschannel/ns2/` was missing `manykeys.db.in`, but the test
succeeded even when `setup.sh` (or `clean.sh`) failed to execute.  This
commit makes run.sh to run in stricter mode and fail the test
immediately when `clean.sh` or `setup.sh` fails.
2020-05-12 10:37:48 +02:00
Ondřej Surý
c2ec4ee19d Merge branch 'marka-silence-flake8-warning' into 'master'
Silence: E741 ambiguous variable name 'l'

See merge request isc-projects/bind9!3521
2020-05-12 08:33:25 +00:00
Mark Andrews
189d21fb96 Silence: E741 ambiguous variable name 'l' 2020-05-12 17:54:32 +10:00
Ondřej Surý
4303fa3880 Merge branch '1232-stats-channel-zone-timers' into 'master'
Resolve "[ISC-support #15166] expose zone timers (reload, refresh, expire)  via stats channel"

Closes #1232

See merge request isc-projects/bind9!3308
2020-05-12 07:21:47 +00:00
Ondřej Surý
ce6cb62862 Add CHANGES 2020-05-12 08:48:02 +02:00
Ondřej Surý
e0aa62bc4c Add release notes 2020-05-12 08:48:02 +02:00
Ondřej Surý
0fe5753315 Use the result of clean.sh and setup.sh command directly 2020-05-12 08:48:01 +02:00
Ondřej Surý
1202fd912a Rewrite the statschannel traffic tests to pytest 2020-05-12 08:48:01 +02:00
Ondřej Surý
6aa6d7be58 Add tests for zone timers using the pytest testing framework 2020-05-12 08:48:01 +02:00
Paul Frieden
72ffa194e2 Add the zone timers to the XSL 2020-05-12 08:48:01 +02:00
Paul Frieden
543bab699d Export zone timers via stats channels 2020-05-12 08:48:01 +02:00
Ondřej Surý
b112bcd6d1 Merge branch 'ondrej/dont-put-copyright-to-named.conf.rst' into 'master'
Remove copyright from generated named.conf.rst

See merge request isc-projects/bind9!3519
2020-05-12 06:46:04 +00:00
Ondřej Surý
b019d12e9a Remove copyright from generated named.conf.rst 2020-05-12 08:42:32 +02:00
Mark Andrews
7b4d07c31d Merge branch '1828-util-check-categories-sh-needs-updating-for-doc-arm-logging-categories-rst' into 'master'
Resolve "util/check-categories.sh needs updating for doc/arm/logging-categories.rst"

Closes #1828

See merge request isc-projects/bind9!3509
2020-05-10 23:44:14 +00:00
Mark Andrews
b92ab5331e Add rpz-passthru category to logging-categories.rst 2020-05-11 09:17:45 +10:00
Mark Andrews
9e100f9196 remove xmllint of .html files 2020-05-11 09:17:45 +10:00
Mark Andrews
e802c8b9dd Update util/check-categories.sh for logging-categories.rst and call from CI 2020-05-11 09:17:45 +10:00
Mark Andrews
434072b075 Merge branch '1817-named-checkzone-s-full-relative-missing-from-usage' into 'master'
Resolve "named-checkzone: [-s (full|relative)] missing from usage."

Closes #1817

See merge request isc-projects/bind9!3508
2020-05-08 06:05:11 +00:00
Mark Andrews
3f93f3ee11 add [-s (full|relative)] to usage 2020-05-08 15:36:00 +10:00
Diego dos Santos Fronza
3262aba423 Merge branch '54-separate-logging-channel-rpz-passthru' into 'master'
Resolve "suppress logging of RPZ passthru"

Closes #54

See merge request isc-projects/bind9!3405
2020-05-07 15:31:59 +00:00
Diego Fronza
bfd720ed70 Add release notes for GL #54 2020-05-07 11:45:45 -03:00
Diego Fronza
42ab3cfc2f Added CHANGES entry 2020-05-07 11:45:43 -03:00
Diego Fronza
142d8d630e Updated copyrights 2020-05-07 11:44:53 -03:00
Diego Fronza
6dffdc5372 Added test for rpz-passthru logging channel
This test ensures that all rpz-passthru activity will be redirected
to a dedicated log file following ns1/named.conf configuration.
2020-05-07 11:44:52 -03:00
Diego Fronza
f2bf7beeb6 Added new logging category rpz-passthru
It is now possible to use the new logging category "rpz-passthru"
to redirect RPZ passthru activity to a dedicate logging channel.
2020-05-07 11:44:48 -03:00
Ondřej Surý
de1414581d Merge branch 'ondrej/fix-custom-test-driver' into 'master'
Fix the custom-test-driver

See merge request isc-projects/bind9!3505
2020-05-07 14:34:05 +00:00
Ondřej Surý
dbe8e31e26 Move custom-test-driver to bin/tests/system where it belongs 2020-05-07 16:32:32 +02:00
Ondřej Surý
5d051f3b27 Fix the status_file in custom-test-driver in non-verbose runs 2020-05-07 16:31:58 +02:00
Ondřej Surý
4600790d31 Merge branch '83-convert-the-documentation-to-sphinx-build' into 'master'
Convert documentation from docbook to sphinx-doc syntax

Closes #83

See merge request isc-projects/bind9!1761
2020-05-07 14:27:30 +00:00
Ondřej Surý
9fb6d11abb Convert the documentation to Sphinx documentation format
The ARM and the manpages have been converted into Sphinx documentation
format.

Sphinx uses reStructuredText as its markup language, and many of its
strengths come from the power and straightforwardness of
reStructuredText and its parsing and translating suite, the Docutils.
2020-05-07 16:02:56 +02:00
Evan Hunt
287f615ae8 Merge branch '1812-uninitialized-dscp' into 'master'
Unexpected output from named-checkconf

Closes #1812

See merge request isc-projects/bind9!3502
2020-05-06 19:40:16 +00:00
Evan Hunt
f8d753d452 initialize sockaddrdscp to prevent spurious output from 'named-checkconf -p' 2020-05-05 12:48:31 -07:00
Ondřej Surý
7072f9db5d Merge branch 'ondrej/fix-get_ports.sh-script' into 'master'
Fix get_ports.sh script

See merge request isc-projects/bind9!3499
2020-05-05 10:52:53 +00:00
Ondřej Surý
b071b23567 Fix get_ports.sh script
There were two errors:

1. get_random() function was returning random number with leading zeros
   that could lead the shell to interpret the number as octal value
   instead of decimal.  The surrounding whitespace was also causing
   problems.

2. The calculation of the port was off, it was adding the whole range
   and not just the min port to the base.
2020-05-05 12:27:47 +02:00
Michał Kępień
b1df584256 Merge branch '1797-add-release-note-discussing-recvmmsg-support' into 'master'
Add release note discussing recvmmsg() support

Closes #1797

See merge request isc-projects/bind9!3492
2020-05-04 10:02:59 +00:00
Michał Kępień
84dc6d86cb Add release note discussing recvmmsg() support 2020-05-04 12:00:40 +02:00
Michał Kępień
92ae41bf40 Merge branch '1723-fputs-fprintf' into 'master'
replace fputs() with fprintf()

Closes #1723

See merge request isc-projects/bind9!3325
2020-05-04 07:45:48 +00:00
Evan Hunt
b89decfcc9 replace fputs() with fprintf() 2020-05-04 09:14:58 +02:00
Evan Hunt
a6e6d0c1d5 Merge branch '1807-checkconf-error' into 'master'
named-checkconf -z could exit with an incorrect status

Closes #1807

See merge request isc-projects/bind9!3468
2020-05-02 00:11:35 +00:00
Evan Hunt
7e73660206 named-checkconf -z could exit with an incorrect staatus
the CHECK() macro resets result, so an error code from an earlier
view could be erased if the last view loaded had no errors.
2020-05-01 16:47:54 -07:00
Ondřej Surý
e051abe515 Merge branch '1713-use-default-buffer-sizes' into 'master'
Don't set recv/send buffer sizes for sockets.

Closes #1713

See merge request isc-projects/bind9!3476
2020-05-01 15:34:19 +00:00
Witold Kręcicki
e7bde11314 CHANGES, release note 2020-05-01 17:04:23 +02:00
Witold Kręcicki
fa02f6438b Don't set UDP recv/send buffer sizes - use system defaults (unless explicitly defined) 2020-05-01 17:04:00 +02:00
Ondřej Surý
eae4134f0c Merge branch 'ondrej/fix-SO_REUSEPORT-usage-on-FreeBSD' into 'master'
Use SO_REUSEPORT only on Linux, use SO_REUSEPORT_LB on FreeBSD

See merge request isc-projects/bind9!3365
2020-05-01 14:47:52 +00:00
Ondřej Surý
23a653dd92 Add CHANGES note for GL !3365 2020-05-01 15:21:10 +02:00
Ondřej Surý
09ba47b067 Use SO_REUSEPORT only on Linux, use SO_REUSEPORT_LB on FreeBSD
The SO_REUSEPORT socket option on Linux means something else on BSD
based systems.  On FreeBSD there's 1:1 option SO_REUSEPORT_LB, so we can
use that.
2020-05-01 15:20:55 +02:00
Ondřej Surý
5110dfd8d7 Merge branch '1795-make-dnstap-work-reliably-with-netmgr' into 'master'
Make dnstap work reliably with netmgr

Closes #1795

See merge request isc-projects/bind9!3431
2020-05-01 13:18:32 +00:00
Michał Kępień
47c769e475 Add CHANGES entry 2020-05-01 14:15:41 +02:00
Michał Kępień
4a5c1c7bfe Add a release note 2020-05-01 14:15:41 +02:00
Michał Kępień
77dc091855 Make dnstap work reliably with netmgr
The introduction of netmgr doubled the number of threads from which
dnstap data may be logged: previously, it could only happen from within
taskmgr worker threads; with netmgr, it can happen both from taskmgr
worker threads and from network threads.  Since the argument passed to
fstrm_iothr_options_set_num_input_queues() was not updated to reflect
this change, some calls to fstrm_iothr_get_input_queue() can now return
NULL, effectively preventing some dnstap data from being logged.
Whether this bug is triggered or not depends on thread scheduling order
and packet distribution between network threads, but will almost
certainly be triggered on any recursive resolver sooner or later.  Fix
by requesting the correct number of dnstap input queues to be allocated.
2020-05-01 14:15:41 +02:00
Ondřej Surý
96959447c3 Merge branch '1763-ossl-eddsa-engine' into 'master'
Add engine support to OpenSSL EdDSA implementation

Closes #1763

See merge request isc-projects/bind9!3479
2020-05-01 12:12:12 +00:00
Ondřej Surý
3c5cdc3f24 Add release notes for #1763 2020-05-01 14:11:08 +02:00
Ondřej Surý
3422c496ae Add CHANGES note for #1763 2020-05-01 14:11:08 +02:00
Aaron Thompson
6a9f20d031 Add engine support to OpenSSL EdDSA implementation. 2020-05-01 14:11:08 +02:00
Aaron Thompson
f9685b29f9 Use OpenSSL raw key functions for EdDSA keys. 2020-05-01 14:11:08 +02:00
Ondřej Surý
d7553b0443 Merge branch 'ondrej/revert---restart-to---restart_server-rename' into 'master'
Revert the --restart -> --restart_server rename

See merge request isc-projects/bind9!3481
2020-05-01 12:03:22 +00:00
Ondřej Surý
3127e7680e Revert the --restart -> --restart_server rename 2020-05-01 14:01:47 +02:00
Ondřej Surý
adb73b1fc0 Merge branch 'ondrej/fix-system-tests-on-openbsd' into 'master'
Fix system tests on openbsd

See merge request isc-projects/bind9!3477
2020-05-01 11:42:36 +00:00
Ondřej Surý
370a335d51 Rename start() and stop() to start_server() and stop_server()
On OpenBSD, there's non-POSIX alias from stop to kill that breaks
the conf.sh.common script.
2020-05-01 13:41:00 +02:00
Ondřej Surý
5b7fccd28d Change the 'date -R' to sort-of iso-8601 emulated time 2020-05-01 13:41:00 +02:00
Ondřej Surý
8072bc599b Merge branch '1534-add-ecdsa-openssl-pkcs11-engine-support-notes' into 'master'
Add CHANGES and Release Notes for OpenSSL engine ECDSA implementation

Closes #1534

See merge request isc-projects/bind9!3480
2020-05-01 10:49:09 +00:00
Ondřej Surý
80d51223c3 Add release note for GL #1534 2020-05-01 12:47:17 +02:00
Ondřej Surý
dde438dac7 Add CHANGES note for GL #1534 2020-05-01 12:47:17 +02:00
Ondřej Surý
91a35a8114 Merge branch '1534-add-ecdsa-openssl-pkcs11-engine-support' into 'master'
Add engine support to OpenSSL ECDSA implementation

Closes #1534

See merge request isc-projects/bind9!3029
2020-05-01 10:47:04 +00:00
Ondřej Surý
064d8b7a6d Simplify error handling 2020-05-01 10:36:45 +02:00
Ondřej Surý
aff61535c2 Add initial support for ECDSA keys via OpenSSL PKCS#11 engine 2020-05-01 10:36:45 +02:00
Mark Andrews
a272dfc3c2 Merge branch 'marka-add-release-note' into 'master'
add release note for [GL #1674]

See merge request isc-projects/bind9!3475
2020-05-01 08:18:12 +00:00
Mark Andrews
f29a875977 add release note for [GL #1674] 2020-05-01 17:21:45 +10:00
Michał Kępień
38cc667db2 Merge branch 'michal/update-release-checklist' into 'master'
Update release checklist (various process tweaks)

See merge request isc-projects/bind9!3446
2020-05-01 06:07:59 +00:00
Michał Kępień
b2a19f174b Update release checklist (various process tweaks)
Ensure the release checklist reflects our current release process:

  - add an additional deadline for introducing code changes ("code
    freeze"); only test and documentation tweaks can be applied to
    pending releases after this deadline passes,

  - notify Support and Marketing about an impending release earlier in
    the process so that they have time to schedule a release note review
    before the tagging deadline,

  - examine current test results on all platforms in advance, to prevent
    diagnosing and addressing test failures in the last minute before
    the tagging deadline,

  - check Perflab results earlier in the process to leave some room for
    addressing any potential problems before code freeze,

  - ensure empty release notes for the next set of releases are prepared
    after public release.
2020-05-01 08:07:09 +02:00
Ondřej Surý
1204ea6866 Merge branch 'ondrej/fix-typo-in-run.sh' into 'master'
Fix another the start_fail -> start_servers_failed typo

See merge request isc-projects/bind9!3473
2020-05-01 06:05:38 +00:00
Ondřej Surý
24e5c7f44b Fix another the start_fail -> start_servers_failed typo 2020-05-01 08:04:20 +02:00
Evan Hunt
168ed0d78f Merge branch 'each-cleanup-config-summary' into 'master'
fix incorrect output from the configuration summary

Closes #1738

See merge request isc-projects/bind9!3426
2020-05-01 02:19:06 +00:00
Evan Hunt
9cd76e1b8d fixed incorrect output from the configuration summary 2020-04-30 17:24:28 -07:00
Mark Andrews
786b5a76f2 Merge branch '1695-addzone-system-tests-failing-in-mac-os-x' into 'master'
Resolve "addzone system tests failing in Mac OS X"

Closes #1695

See merge request isc-projects/bind9!3274
2020-04-30 23:08:35 +00:00
Mark Andrews
d63479a48d Add CHANGES entry 2020-05-01 06:51:42 +10:00
Mark Andrews
a66c6fc883 Mimic nzf_append from bin/named/server.c
nzf_append is conditionally compiled and this is intended to
catch error introduced by changes to the called functions on all
systems before the changes are run through the CI.
2020-05-01 06:51:05 +10:00
Mark Andrews
060b56dc70 Add jobs for 'configure --with{out}-lmdb' to the GitLab CI
We missed a case where LMDB was not installed/used in the build
and that broke system tests on such systems.
2020-05-01 06:51:05 +10:00
Mark Andrews
5ab9b5b1e6 Add more special zones to addzone restart test.
Test zones with various escape sequences and filesystem seperator
characters.
* escaped double quote (\")
* escaped escape (\\)
* escaped decimal byte value (\032)
* slash seperator (/)
2020-05-01 06:51:05 +10:00
Mark Andrews
b02081d423 Escape double quote when printing quoted string.
When we were printing quoted string, the double quotes where unescaped
leading to prematurely ending the quoted string.
2020-05-01 06:51:05 +10:00
Ondřej Surý
beb0be4d41 Merge branch '1648-native-pkcs11-eddsa' into 'master'
Resolve "Fix PKCS#11-based EdDSA support"

Closes #1648

See merge request isc-projects/bind9!3467
2020-04-30 17:53:08 +00:00
Ondřej Surý
0313d2950a Fixup the start_fail -> start_servers_failed typo 2020-04-30 18:41:08 +02:00
Ondřej Surý
e69d34a454 Add release notes 2020-04-30 18:41:08 +02:00
Ondřej Surý
84fffbdb4c Add CHANGES 2020-04-30 18:41:04 +02:00
Ondřej Surý
57c39ddbe3 Fix the check for non-operational algs 15 and 16 in PKCS#11 2020-04-30 18:40:46 +02:00
Ondřej Surý
101672f664 Fail running run.sh when clean.sh or setup.sh fails 2020-04-30 18:40:46 +02:00
Ondřej Surý
a6bdb9639a Refactor the pkcs11 to test for individual algorithms 2020-04-30 18:40:46 +02:00
Aaron Thompson
2e6b7a56cc Update EdDSA implementation to PKCS#11 v3.0.
Per Current Mechanisms 2.3.5, the curve name is DER-encoded in the
EC_PARAMS attribute, and the public key value is DER-encoded in the
EC_POINT attribute.
2020-04-30 18:40:45 +02:00
Aaron Thompson
9b87fe1051 Fix EdDSA key sizes (key_size is in bits). 2020-04-30 18:40:45 +02:00
Aaron Thompson
4969577189 Add EdDSA algorithms back to dnssec-keyfromlabel help text.
Regressed in 45afdb2672.
2020-04-30 18:40:45 +02:00
Ondřej Surý
d2b3c82229 Merge branch '1797-libuv-1-37-requires-uv_init_ex-to-be-used-for-mmsg' into 'master'
Use UV_UDP_RECVMMSG to enable mmsg support in libuv if available

Closes #1797

See merge request isc-projects/bind9!3433
2020-04-30 16:40:06 +00:00
Witold Kręcicki
5d0408db23 CHANGES note 2020-04-30 17:30:37 +02:00
Witold Kręcicki
83049ceabf Don't free udp recv buffer if UV_UDP_MMSG_CHUNK is set 2020-04-30 17:30:37 +02:00
Ondřej Surý
d5356a40ff Use UV_UDP_RECVMMSG to enable mmsg support in libuv if available 2020-04-30 17:30:37 +02:00
Ondřej Surý
5438b35f80 Merge branch 'ondrej/fix-asan-build' into 'master'
As libltdl is convenience library, link it just into libisc

See merge request isc-projects/bind9!3465
2020-04-30 15:29:13 +00:00
Ondřej Surý
c86ebeebd2 As libltdl is convenience library, link it just into libisc 2020-04-30 15:33:44 +02:00
Ondřej Surý
b83ec6fd70 Merge branch 'matthijs-make-check-missing-tests' into 'master'
make check: add missing tests

See merge request isc-projects/bind9!3460
2020-04-30 13:30:07 +00:00
Matthijs Mekking
b3158207ec fixup! Add missing system test in Makefile 2020-04-30 12:09:05 +02:00
Ondřej Surý
345ac0785d Conditionally re-add pkcs11 system test 2020-04-30 10:19:07 +02:00
Matthijs Mekking
ac7644f412 Update run system test doc 2020-04-30 10:19:07 +02:00
Matthijs Mekking
188631fdd9 Add missing system test in Makefile
Add the missing tests in the Makefile (include-multiplecfg kasp
pkcs11 ttl).  Also put them in alphabetical order.
2020-04-30 10:19:07 +02:00
Mark Andrews
e4ceadd59c Merge branch '1806-system-and-unit-clang-asan-have-incorrect-needs' into 'master'
Resolve "system and unit clang:asan have incorrect needs"

Closes #1806

See merge request isc-projects/bind9!3457
2020-04-30 07:41:20 +00:00
Mark Andrews
0adf9562fb Incorrect job in needs, gcc:asan -> clang:asan 2020-04-30 17:31:20 +10:00
Mark Andrews
d9c55945c9 Merge branch '1804-util-parse_tsan-py-is-not-pylint-clean' into 'master'
Resolve "util/parse_tsan.py is not pylint clean"

Closes #1804

See merge request isc-projects/bind9!3456
2020-04-30 07:28:37 +00:00
Mark Andrews
d7618f6954 pylint cleanups 2020-04-30 16:52:03 +10:00
Evan Hunt
bfbe91bf9f Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!3455
2020-04-30 06:25:30 +00:00
Evan Hunt
0cf835e710 placeholder 2020-04-29 23:24:40 -07:00
Mark Andrews
732604f2d4 Merge branch '1777-update-the-build-instructions-for-automake' into 'master'
Resolve "Update the build instructions for automake"

Closes #1777

See merge request isc-projects/bind9!3428
2020-04-30 01:44:07 +00:00
Mark Andrews
e5c920e029 update CHANGES entry 2020-04-30 10:44:25 +10:00
Mark Andrews
98a0f9068a update release note 2020-04-30 10:44:25 +10:00
Mark Andrews
fbbe43fb13 Add requirements to build from the repository 2020-04-30 10:44:25 +10:00
Ondřej Surý
4316f422b5 Merge branch '1783-ax_check_compile_flag-fno-delete-null-pointer-checks-does-not-fail-for-clang' into 'master'
Resolve "AX_CHECK_COMPILE_FLAG -fno-delete-null-pointer-checks does not fail for clang"

Closes #1783

See merge request isc-projects/bind9!3413
2020-04-29 16:16:41 +00:00
Mark Andrews
82ab846f13 Force test for -fno-delete-null-pointer-checks to fail 2020-04-29 17:56:14 +02:00
Ondřej Surý
d70cba39c6 Merge branch 'ondrej/fix-asan-symbolizer' into 'master'
Fix the ASAN symbolizer

See merge request isc-projects/bind9!3450
2020-04-29 15:01:32 +00:00
Ondřej Surý
96805e8c91 Fix the ASAN symbolizer 2020-04-29 16:58:46 +02:00
Ondřej Surý
e33895791c Merge branch '725-prepare-system-tests-for-pytest' into 'master'
Add a pytest runner to run.sh

Closes #725

See merge request isc-projects/bind9!3445
2020-04-29 09:51:30 +00:00
Ondřej Surý
cf5105939c Add a pytest runner to run.sh
The system tests currently uses patchwork of shell scripts which doesn't
offer proper error handling.

This commit introduced option to write new tests in pytest framework
that also allows easier manipulation of DNS traffic (using dnspython),
native XML and JSON manipulation and proper error reporting.
2020-04-29 11:10:47 +02:00
Ondřej Surý
0bb2bda169 Merge branch '1090-fix-unable-to-set-effective-uid-to-0-fixup' into 'master'
Hide setperms when not in use

Closes #1090

See merge request isc-projects/bind9!3443
2020-04-28 16:52:21 +00:00
Ondřej Surý
ee2f3039df Hide setperms when not in use 2020-04-28 17:33:57 +02:00
Ondřej Surý
9a6e011a9f Merge branch '1090-fix-unable-to-set-effective-uid-to-0' into 'master'
Resolve "BIND 9.14: unable to set effective uid to 0"

Closes #1090 and #1042

See merge request isc-projects/bind9!3432
2020-04-28 14:25:55 +00:00
Ondřej Surý
60b608b65b Add release notes for GL #1042, #1090 2020-04-28 15:22:41 +02:00
Ondřej Surý
a0a5eab31c Add CHANGES for #1042, #1090 2020-04-28 15:22:41 +02:00
Mark Andrews
071bc29962 Propagate first_time to named_os_openfile in generate_session_key.
named_os_openfile was being called with switch_user set to true
unconditionally leading to log messages about being unable to
switch user identity from named when regenerating the key.
2020-04-28 15:22:41 +02:00
Ondřej Surý
6c82e2af92 Don't change effective uid when we already dropped privileges
When running on Linux and system capabilities are available, named will
drop the extra capabilities before loading the configuration.  This led
to spurious warnings from `seteuid()` because named already dropped
CAP_SETUID and CAP_GETUID capabilities.

The fix removes setting the effective uid/gid when capabilities are
available, and adds a check that we are running under the user we were
requested to run.
2020-04-28 15:22:41 +02:00
Ondřej Surý
931e00ba4a Merge branch '1780-fix-system-tests-failing-with-automake' into 'master'
Properly fail the GitLab CI system test job when any system test fails

Closes #1780

See merge request isc-projects/bind9!3414
2020-04-27 14:27:25 +00:00
Ondřej Surý
86f322133f Fix the noinst_LTLIBRARIES -> check_LTLIBRARIES in libisc and libdns unit tests 2020-04-27 15:18:31 +02:00
Evan Hunt
17a1bafc08 Restore behaviour of "make test" and "make unit"
Add recursive "test" and "unit" rules, which execute "make check"
in specific directories - "make test" runs the system tests, and
"make unit" runs the unit tests.
2020-04-27 15:02:30 +02:00
Ondřej Surý
7fe5f670b5 Disable pylint: 'Constant name dname doesn't conform to UPPER_CASE naming style (invalid-name)' 2020-04-27 14:15:10 +02:00
Ondřej Surý
968523dd8d Use absolute path to PYTHON and PERL, so test -x works properly in system tests 2020-04-27 12:23:44 +02:00
Ondřej Surý
dd0faa1556 Store the output from yamlget.py into intermediate files for easier debugging 2020-04-27 11:43:30 +02:00
Ondřej Surý
52683934cd Refactor the script that gets/sets the ports for system tests
The current script used ephemeral port range which clashed with the
ports used by the tools (dig, ...), and the range always started with
the first port and there was 100 ports allocated for each system test.

In this commit, the first port has been randomized, the get_ports.sh
script outputs the variables (the output has to be eval'ed from run.sh)
and there's less waste in the port range.
2020-04-27 11:43:30 +02:00
Ondřej Surý
85d0b4bcf0 Run recheck in case some system test fails 2020-04-27 11:43:29 +02:00
Ondřej Surý
7286d4d634 Colorize the test-driver output by default 2020-04-24 17:00:16 +02:00
Ondřej Surý
5813818036 Improve the LOG_DRIVER and LOG_COMPILER for the system tests
There are several improvements over the default/previous behaviour of
the test log driver and log compiler:

 * The system-test-driver.sh was dropped (it was used incorrectly)
 * The run.sh script is now both log compiler and cli script to run
   individual tests
 * The custom-test-driver was added as extended version of the automake
   test-driver with capability to tee the test output to stdout when
   `--verbose yes` is passed to it (you can use LOG_DRIVER_FLAGS to
   add the option by default)
 * Makefile.am has been extended to honor V=1 for the system tests
   test-driver (e.g. V=1 adds `--verbose yes` to AM_LOG_DRIVER_FLAGS)
2020-04-24 16:59:43 +02:00
Ondřej Surý
d10294acb3 Remove the requirement for GNU getopt and parse long options using getopts 2020-04-24 16:11:20 +02:00
Michał Kępień
51188b33f8 Ensure fstrm_capture is looked for
fstrm_capture is not an essential utility, but its corresponding
Makefile token needs to substituted even if it is not found in PATH or
else the "dnstap" system test will consistently fail.
2020-04-24 16:11:20 +02:00
Michał Kępień
32247dc997 Build wire_test
The bin/tests/wire_test helper program is currently not included in any
Makefile.am file.  Move its source code to bin/tests/system and build it
along other helper tools when dnstap support is requested as the
"dnstap" system test needs this tool in order to pass.
2020-04-24 16:11:20 +02:00
Michał Kępień
ba0e9cb56c Silence PyYAML warning
Make yaml.load_all() use yaml.SafeLoader to address a warning currently
emitted when bin/tests/system/dnstap/ydump.py is run:

    ydump.py:28: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
      for l in yaml.load_all(f.stdout):
2020-04-24 16:11:20 +02:00
Ondřej Surý
0bc1b4804e Use $TOP_SRCDIR instead of $TOP of calling prepare-softhsm2 script 2020-04-24 16:11:20 +02:00
Ondřej Surý
e6d2777771 Use $TOP_BUILDDIR instead of $TOP of checking config.h values 2020-04-24 16:11:20 +02:00
Ondřej Surý
626409aac9 Properly fail the GitLab CI system test job when any system test fails 2020-04-24 16:11:20 +02:00
Ondřej Surý
e2dd8f48b1 Merge branch '1758-cleanup-libirs' into 'master'
Cleanup libirs APIs and slim down the library to just irs_resconf

Closes #1758

See merge request isc-projects/bind9!3416
2020-04-24 12:02:11 +00:00
Ondřej Surý
ed13f1b595 Add CHANGES note for GL #1758 2020-04-24 08:33:34 +02:00
Ondřej Surý
5f0efcbb3c Cleanup libirs APIs and slim down the library to just irs_resconf
The libirs contained own re-implementations of the getaddrinfo,
getnameinfo and gai_strerror + irs_context and irs_dnsconf API that was
unused anywhere in the BIND 9.

Keep just the irs_resonf API that is being extensively used to parse
/etc/resolv.conf by several of BIND 9 tools.
2020-04-24 08:33:34 +02:00
Ondřej Surý
19245f3ff4 Merge branch '178-remove-unused-dns-ecdb' into 'master'
Remove 'ephemeral' database implementation

Closes #178

See merge request isc-projects/bind9!3425
2020-04-23 19:40:23 +00:00
Ondřej Surý
6494665f08 Remove 'ephemeral' database implementation
The 'ephemeral' database implementation was used to provide a
lightweight database implemenation that doesn't cache results, and the
only place where it was really use is "samples" because delv is
overriding this to use "rbtdb" instead. Otherwise it was completely
unused.

 * The 'ephemeral' cache DB (ecdb) implementation.  An ecdb just provides
 * temporary storage for ongoing name resolution with the common DB interfaces.
 * It actually doesn't cache anything.  The implementation expects any stored
 * data is released within a short period, and does not care about the
 * scalability in terms of the number of nodes.
2020-04-23 18:05:53 +02:00
Ondřej Surý
bbb3dca443 Merge branch 'ondrej/add-missing-OPENSSL_CFLAGS' into 'master'
Add OPENSSL_CFLAGS to libdns tests that include dst_internal.h

See merge request isc-projects/bind9!3424
2020-04-23 14:22:44 +00:00
Ondřej Surý
6a6a9f7afa Add OPENSSL_CFLAGS to libdns tests that include dst_internal.h
The three libdns tests directly include ../dst_internal.h which
in turn directly include openssl headers, thus there was a missing
path and build failure on systems where OpenSSL is not in the default
include path.
2020-04-23 15:53:03 +02:00
Ondřej Surý
a9c0194009 Merge branch '178-remove-unused-isc_lfsr' into 'master'
Remove unused isc_lfsr API

Closes #178

See merge request isc-projects/bind9!3423
2020-04-23 13:33:00 +00:00
Ondřej Surý
bdca09aa8d Remove unused isc_lfsr API
The isc_lfsr API was used to generate message IDs in the past.
Currently, it's just cruft.
2020-04-23 12:16:22 +02:00
Michal Nowak
f6d15d5af8 Merge branch 'mnowak/1751-abi-check-does-not-know-which-source-is-older-newer' into 'master'
abi-check does not know which source is older, newer

Closes #1751

See merge request isc-projects/bind9!3374
2020-04-23 06:52:05 +00:00
Michal Nowak
8e3e2836b0 Ensure proper comparison order in "abi-check" jobs
Right before the release API version (LIBINTERFACE, LIBREVISION, LIBAGE)
for older and newer libraries tends to be the same. Given that, commit
hash can't be the determining factor here, Unix time of the commit
should suit us better and is placed after the API version. The commit
hash is preserved as it's useful to see it in the actual report.

'-nosymtbl' versions of libraries are not produced in Automake builds.
2020-04-23 08:49:29 +02:00
Ondřej Surý
7a0ebb14f3 Merge branch 'ondrej/make-merge_copyrights-ignore-hidden-files' into 'master'
Make merge_copyrights ignore hidden files

See merge request isc-projects/bind9!3417
2020-04-23 05:58:36 +00:00
Ondřej Surý
6d46082d82 Make merge_copyrights ignore hidden files 2020-04-23 07:57:29 +02:00
Ondřej Surý
a9fb6fa862 Merge branch 'ondrej/update-lgtm.com-configuration' into 'master'
Add configuration for LGTM.com static code analyzer

See merge request isc-projects/bind9!3415
2020-04-22 14:57:40 +00:00
Ondřej Surý
fea3fe9996 Add configuration for LGTM.com static code analyzer 2020-04-22 16:14:43 +02:00
Evan Hunt
8e85ce3d77 Merge branch '1779-lock-rpzs' into 'master'
acquire maintenance lock when running incremental RPZ updates

Closes #1779

See merge request isc-projects/bind9!3411
2020-04-21 23:59:37 +00:00
Evan Hunt
2cf3d4c700 CHANGES 2020-04-21 16:59:02 -07:00
Evan Hunt
286e8cd7ea acquire maintenance lock when running incremental RPZ updates
this addresses a race that could occur during shutdown or when
reconfiguring to remove RPZ zones.

this change should ensure that the rpzs structure and the incremental
updates don't interfere with each other: rpzs->zones entries cannot
be set to NULL while an update quantum is running, and the
task should be destroyed and its queue purged so that no subsequent
quanta will run.
2020-04-21 15:53:58 -07:00
Ondřej Surý
bb4515346a Merge branch '4-add-changes-and-release-notes' into 'master'
Add CHANGES and Release Notes for "Convert to modern autotools (autoconf + automake + libtool)"

See merge request isc-projects/bind9!3410
2020-04-21 13:38:21 +00:00
Ondřej Surý
5d0897ab15 Add release notes for #4 2020-04-21 15:36:47 +02:00
Ondřej Surý
4e9801e68d Add CHANGES for GL #4 2020-04-21 15:25:41 +02:00
Ondřej Surý
01b3495000 Merge branch '4-convert-to-modern-autotools-autoconf-automake-libtool' into 'master'
Convert to modern autotools (autoconf + automake + libtool)

Closes #4

See merge request isc-projects/bind9!985
2020-04-21 13:06:22 +00:00
Ondřej Surý
978c7b2e89 Complete rewrite the BIND 9 build system
The rewrite of BIND 9 build system is a large work and cannot be reasonable
split into separate merge requests.  Addition of the automake has a positive
effect on the readability and maintainability of the build system as it is more
declarative, it allows conditional and we are able to drop all of the custom
make code that BIND 9 developed over the years to overcome the deficiencies of
autoconf + custom Makefile.in files.

This squashed commit contains following changes:

- conversion (or rather fresh rewrite) of all Makefile.in files to Makefile.am
  by using automake

- the libtool is now properly integrated with automake (the way we used it
  was rather hackish as the only official way how to use libtool is via
  automake

- the dynamic module loading was rewritten from a custom patchwork to libtool's
  libltdl (which includes the patchwork to support module loading on different
  systems internally)

- conversion of the unit test executor from kyua to automake parallel driver

- conversion of the system test executor from custom make/shell to automake
  parallel driver

- The GSSAPI has been refactored, the custom SPNEGO on the basis that
  all major KRB5/GSSAPI (mit-krb5, heimdal and Windows) implementations
  support SPNEGO mechanism.

- The various defunct tests from bin/tests have been removed:
  bin/tests/optional and bin/tests/pkcs11

- The text files generated from the MD files have been removed, the
  MarkDown has been designed to be readable by both humans and computers

- The xsl header is now generated by a simple sed command instead of
  perl helper

- The <irs/platform.h> header has been removed

- cleanups of configure.ac script to make it more simpler, addition of multiple
  macros (there's still work to be done though)

- the tarball can now be prepared with `make dist`

- the system tests are partially able to run in oot build

Here's a list of unfinished work that needs to be completed in subsequent merge
requests:

- `make distcheck` doesn't yet work (because of system tests oot run is not yet
  finished)

- documentation is not yet built, there's a different merge request with docbook
  to sphinx-build rst conversion that needs to be rebased and adapted on top of
  the automake

- msvc build is non functional yet and we need to decide whether we will just
  cross-compile bind9 using mingw-w64 or fix the msvc build

- contributed dlz modules are not included neither in the autoconf nor automake
2020-04-21 14:19:48 +02:00
Ondřej Surý
4df5a5832c Remove files generated by autotools 2020-04-21 14:19:30 +02:00
Ondřej Surý
98b3b93791 Remove python based tools (dnssec-keymgr, dnssec-coverage, dnssec-checkds)
With the introduction of dnssec-policy, the aforementioned tools were
either rendered obsolete, or they will be replaced with dnssec-policy
based tools.  Remove the tools and the requirement to have Python
installed.  Python 3 is still being used for tests, so keep the autoconf
test, but make it much simpler.
2020-04-21 14:19:30 +02:00
Ondřej Surý
4b8e599855 Merge branch 'ondrej/enable-quota-test-in-Kyuatest' into 'master'
Enable quota_test in Kyuafile

See merge request isc-projects/bind9!3408
2020-04-21 12:18:07 +00:00
Witold Kręcicki
62f738ba48 Fix detaching the extra quotas in the quota_test 2020-04-21 14:17:20 +02:00
Ondřej Surý
54defc8b78 Enable quota_test in Kyuafile 2020-04-21 12:30:11 +02:00
Mark Andrews
6b98a58c58 Merge branch 'marka-placeholer' into 'master'
Marka placeholer

See merge request isc-projects/bind9!3407
2020-04-20 23:59:50 +00:00
Mark Andrews
4dd73e408f placeholder 2020-04-21 09:57:42 +10:00
Ondřej Surý
cbfd8aae94 Merge branch '1763-pkcs11-code-cleanups' into 'master'
Update to PKCS#11 v3.0 EdDSA macros and cleanup the PKCS#11 code

See merge request isc-projects/bind9!3391
2020-04-20 09:55:51 +00:00
Ondřej Surý
48473d464f Add CHANGES 2020-04-20 11:48:45 +02:00
Ondřej Surý
cf30e7d0d1 Use switch instead of if when evaluating curves
Previously, the code would do:

    REQUIRE(alg == CURVE1 || alg == CURVE2);

    [...]

    if (alg == CURVE1) { /* code for CURVE1 */ }
    else { /* code for CURVE2 */ }

This approach is less extensible and also more prone to errors in case
the initial REQUIRE() is forgotten.  The code has been refactored to
use:

    REQUIRE(alg == CURVE1 || alg == CURVE2);

    [...]

    switch (alg) {
    case CURVE1: /* code for CURVE1 */; break;
    case CURVE2: /* code for CURVE2 */; break;
    default: INSIST(0);
    }
2020-04-20 11:40:42 +02:00
Ondřej Surý
da38bd0e1d Refactor the code using the pk11 ECC constants.
The pk11/constants.h header contained static CK_BYTE arrays and
we had to use #defines to pull only those we need.  This commit
changes the constants to only define byte arrays with the content
and either use them directly or define the CK_BYTE arrays locally
where used.
2020-04-20 11:40:42 +02:00
Ondřej Surý
9d979d7cd6 Only print warning when PKCS#11 dnssec-keygen fails from Edwards curves 2020-04-20 11:40:42 +02:00
Aaron Thompson
541d7bafe6 Fix a segfault when a PKCS#11 token is not found. 2020-04-20 11:40:42 +02:00
Aaron Thompson
46cae09023 Fix bad syntax in pkcs11eddsa_link.c.
Introduced in 994e656977.
2020-04-20 11:40:41 +02:00
Aaron Thompson
3e685fe01a Update to PKCS#11 v3.0 EdDSA macros. 2020-04-20 11:40:41 +02:00
Aaron Thompson
2ef379d911 Fix compiler warnings about unused pk11 constants. 2020-04-20 11:40:41 +02:00
Aaron Thompson
d28c7dadbb Remove remaining PKCS#11 DH references.
Missed in 0a73c9f137 and 8efd394c80.
2020-04-20 11:40:41 +02:00
Aaron Thompson
6a6485a531 Remove unnecessary forward declarations. 2020-04-20 11:40:41 +02:00
Aaron Thompson
7744aece03 Finish refactoring pkcs11eddsa_link.c after isc_buffer_allocate change.
Left over after c73e5866c4.
2020-04-20 11:40:41 +02:00
Aaron Thompson
b4a7bfd55e Remove unreachable label in pkcs11eddsa_link.c.
Missed in ae83801e2b.
2020-04-20 11:40:41 +02:00
Aaron Thompson
7fc4f926fb Finish refactoring after the removal of --with-ecdsa and --with-eddsa.
Missed in c3b8130fe8.
2020-04-20 11:40:41 +02:00
Aaron Thompson
48e0c0bc4a Remove old comment.
Missed in 6aae193ded.
2020-04-20 11:40:41 +02:00
Aaron Thompson
bb158e8a4c Finish replacing OP_EC with OP_ECDSA/OP_EDDSA.
Missed in c3b8130fe8.
2020-04-20 11:40:41 +02:00
Aaron Thompson
b217052081 Fix incorrect PKCS11 macro in dnssec-revoke.
Missed in c3b8130fe8.
2020-04-20 11:40:41 +02:00
Mark Andrews
54eba4fca3 Merge branch '1768-move-dns_peer_t-into-peer-c' into 'master'
Resolve "move dns_peer_t into peer.c"

Closes #1768

See merge request isc-projects/bind9!3400
2020-04-20 09:39:36 +00:00
Mark Andrews
eeeaf9dbd4 Move structure declarations from dns/peer.h into peer.c 2020-04-20 08:59:09 +00:00
Mark Andrews
548ec481fb Merge branch '1674-reject-axfr-streams-with-bad-id' into 'master'
Reject AXFR streams with bad message id

Closes #1674

See merge request isc-projects/bind9!3382
2020-04-20 08:58:27 +00:00
Mark Andrews
ba445afb4f Check that bad message id's are caught by named 2020-04-20 18:24:12 +10:00
Mark Andrews
ac45bde2fa Convert to using retry_quiet and nextpart 2020-04-20 18:24:12 +10:00
Mark Andrews
33eee6572a Reject AXFR streams where the message id is not consistent. 2020-04-20 18:24:12 +10:00
Matthijs Mekking
149296a19c Merge branch '1737-coverity-dst_key_gettime' into 'master'
Address Coverity warnings in keymgr.c

Closes #1737

See merge request isc-projects/bind9!3335
2020-04-20 07:42:27 +00:00
Matthijs Mekking
564f9dca35 Address Coverity warnings in keymgr.c
Coverity showed that the return value of `dst_key_gettime` was
unchecked in INITIALIZE_STATE. If DST_TIME_CREATED was not set we
would set the state to be initialized to a weird last changed time.

This would normally not happen because DST_TIME_CREATED is always
set. However, we would rather set the time to now (as the comment
also indicates) not match the creation time.

The comment on INITIALIZE_STATE also needs updating as we no
longer always initialize to HIDDEN.
2020-04-20 09:21:40 +02:00
Michał Kępień
d177585cb8 Merge branch '1753-make-isc-rwlock-implementation-the-default-again' into 'master'
Make ISC rwlock implementation the default again

Closes #1753

See merge request isc-projects/bind9!3375
2020-04-17 06:39:06 +00:00
Michał Kępień
58daa5af1e Add CHANGES entry
5385.	[func]		Make ISC rwlock implementation the default again.
			[GL #1753]
2020-04-17 08:36:24 +02:00
Michał Kępień
0cf1e2bf62 Add a release note 2020-04-17 08:36:24 +02:00
Michał Kępień
17101fd093 Make ISC rwlock implementation the default again
Revert the change from ad03c22e97 as
further testing has shown that with hyper-threading disabled, named with
ISC rwlocks outperforms named with pthread rwlocks in cold cache testing
scenarios.  Since building named with pthread rwlocks might still be a
better choice for some workloads, keep the compile-time option which
enables that.
2020-04-17 08:36:24 +02:00
Michał Kępień
8471206bac Merge branch '1765-create-empty-release-notes-for-for-9-17-2-9-16-9-11' into 'master'
create empty release notes for 9.17.2

Closes #1765

See merge request isc-projects/bind9!3395
2020-04-17 06:30:36 +00:00
Michał Kępień
63f921a537 Add empty relase notes for 9.17.2 2020-04-17 10:10:06 +10:00
Michał Kępień
bb4a7eeba4 Merge branch 'mnowak/abi-tracker-helper-v9_17_1' into 'master'
abi-check: Update BIND_BASELINE_VERSION to v9_17_1

See merge request isc-projects/bind9!3384
2020-04-16 21:21:51 +00:00
Michal Nowak
2234bbe37e abi-check: Update BIND_BASELINE_VERSION to v9_17_1 2020-04-16 21:21:24 +00:00
Michał Kępień
69c6a26ee3 Merge branch 'v9_17_1-release' into 'master'
Merge 9.17.1 release branch

See merge request isc-projects/bind9!3392
2020-04-16 21:05:31 +00:00
Tinderbox User
7c7c5577f5 regen master 2020-04-16 23:03:55 +02:00
Tinderbox User
bf2020a171 prep 9.17.1 2020-04-16 23:03:54 +02:00
Ondřej Surý
c691f1f27d Merge branch '1763-improve-isc_buffer-API-documentation' into 'master'
Fix/improve some comments in buffer.h.

Closes #1763

See merge request isc-projects/bind9!3388
2020-04-16 13:57:54 +00:00
Aaron Thompson
850d8ae019 Fix/improve some comments in buffer.h.
isc_buffer_dup now cannot fail as a result of c73e5866c4.
2020-04-16 15:57:33 +02:00
Matthijs Mekking
5a26673d49 Merge branch '1709-dnssec-policy-inlinesigning' into 'master'
Resolve "dnssec-policy implicitly enables inline-signing"

Closes #1709

See merge request isc-projects/bind9!3362
2020-04-16 13:01:35 +00:00
Matthijs Mekking
acae6cf438 Update changes 2020-04-16 14:24:25 +02:00
Matthijs Mekking
e3aa12fc0a Add kasp tests dyn update zone
Add two tests that checks that dynamic zones
can be updated and will be signed appropriately.
One zone covers an update with freeze/thaw, the
other covers an update through nsupdate.
2020-04-16 14:22:47 +02:00
Matthijs Mekking
644f0d958a dnssec-policy: to sign inline or not
When dnssec-policy was introduced, it implicitly set inline-signing.
But DNSSEC maintenance required either inline-signing to be enabled,
or a dynamic zone.  In other words, not in all cases you want to
DNSSEC maintain your zone with inline-signing.

Change the behavior and determine whether inline-signing is
required: if the zone is dynamic, don't use inline-signing,
otherwise implicitly set it.

You can also explicitly set inline-signing to yes with dnssec-policy,
the restriction that both inline-signing and dnssec-policy cannot
be set at the same time is now lifted.

However, 'inline-signing no;' on a non-dynamic zone with a
dnssec-policy is not possible.
2020-04-16 14:22:47 +02:00
Matthijs Mekking
1055575cfe Merge branch 'matthijs-fix-digdelv-yamlget' into 'master'
Fix digdelv test

See merge request isc-projects/bind9!3383
2020-04-16 12:16:40 +00:00
Matthijs Mekking
464d0417d1 Fix digdelv test
The yamlget.py file was changed in !3311 as part of making the
python code pylint and flake8 compliant.  This omitted setting
'item' to 'item[key]' which caused the digdelv yaml tests to fail.

Also, the pretty printing is not really necessary, so remove
the "if key not in item; print error" logic.
2020-04-16 11:50:33 +02:00
Matthijs Mekking
2e7bfad2e9 Merge branch 'matthijs-dnssec-keys-trust-anchors-leftovers' into 'master'
Replace dnssec-keys leftovers with trust-anchors

See merge request isc-projects/bind9!3363
2020-04-16 08:49:46 +00:00
Matthijs Mekking
4b5711fd3b Replace leftover DNSSEC-KEYS with TRUST-ANCHORS
Change 5332 renamed "dnssec-keys" configuration statement to the
more descriptive "trust-anchors".  Not all occurrences in the
documentation had been updated.
2020-04-16 08:10:08 +02:00
Ondřej Surý
fd0021061d Merge branch '1755-tune-the-windows-build-so-we-can-use-wx-equivalent-of-werror' into 'master'
Resolve "Tune the Windows build, so we can use /WX (equivalent of -Werror)"

Closes #1755

See merge request isc-projects/bind9!3369
2020-04-16 05:54:34 +00:00
Ondřej Surý
9b0e85cbd5 Don't escape spaces in CONFIGARGS, use double backslash with all whitespace 2020-04-15 14:56:35 +02:00
Ondřej Surý
e3076c4caa Align the irs_getnameinfo() declaration and definition on Windows 2020-04-15 14:03:40 +02:00
Ondřej Surý
b6c2012d93 Disable MSB8028 warning
All our MSVS Project files share the same intermediate directory.  We
know that this doesn't cause any problems, so we can just disable the
detection in the project files.

Example of the warning:

  warning MSB8028: The intermediate directory (.\Release\) contains files shared from another project (dnssectool.vcxproj).  This can lead to incorrect clean and rebuild behavior.
2020-04-15 13:37:12 +02:00
Ondřej Surý
4ffe725585 Fix the discrepancy between cfg_pluginlist_foreach declaration and definition
There was a missing indirection for the pluginlist_cb_t *callback in the
declaration of the cfg_pluginlist_foreach function.  Reported by MSVC as:

  lib\isccfg\parser.c(4057): warning C4028: formal parameter 4 different from declaration
2020-04-15 12:50:28 +02:00
Ondřej Surý
60c632ab91 Workaround MSVC warning C4477
Due to a way the stdatomic.h shim is implemented on Windows, the MSVC
always things that the outside type is the largest - atomic_(u)int_fast64_t.
This can lead to false positives as this one:

  lib\dns\adb.c(3678): warning C4477: 'fprintf' : format string '%u' requires an argument of type 'unsigned int', but variadic argument 2 has type 'unsigned __int64'

We workaround the issue by loading the value in a scoped local variable
with correct type first.
2020-04-15 12:47:42 +02:00
Ondřej Surý
063e05491b Disable C4090 MSVC warning
MSVC documentation states: "This warning can be caused when a pointer to
a const or volatile item is assigned to a pointer not declared as
pointing to const or volatile."

Unfortunately, this happens when we dynamically allocate and deallocate
block of atomic variables using isc_mem_get and isc_mem_put.

Couple of examples:

  lib\isc\hp.c(134): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
  lib\isc\hp.c(144): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
  lib\isc\stats.c(55): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
  lib\isc\stats.c(87): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
2020-04-15 12:47:42 +02:00
Ondřej Surý
54168d55c0 Fix invalid cast in win32 stdatomic.h shim
The InterlockedOr8() and InterlockedAnd8() first argument was cast
to (atomic_int_fast8_t) instead of (atomic_int_fast8_t *), this was
reported by MSVC as:

  warning C4024: '_InterlockedOr8': different types for formal and actual parameter 1
  warning C4024: '_InterlockedAnd8': different types for formal and actual parameter 1
2020-04-15 12:47:42 +02:00
Ondřej Surý
70318943fe Remove the Windows build job dependency on autoreconf job 2020-04-15 12:47:42 +02:00
Ondřej Surý
b1f66d1e13 Disable MSVC C4133 when using stdatomic.h win32 shim 2020-04-15 12:45:05 +02:00
Ondřej Surý
6f3c201ff4 append_file() should return void as it doesn't return anything and we don't check for return value 2020-04-15 12:45:05 +02:00
Ondřej Surý
948a23e6bb Don't return from void function 2020-04-15 12:45:05 +02:00
Ondřej Surý
789d253e3d Set WarningLevel to Level1 for Release, treat warnings as errors
Our vcxproj files set the WarningLevel to Level3, which is too verbose
for a code that needs to be portable.  That basically leads to ignoring
all the errors that MSVC produces.  This commits downgrades the
WarningLevel to Level1 and enables treating warnings as errors for
Release builds.  For the Debug builds the WarningLevel got upgraded to
Level4, and treating warnings as errors is explicitly disabled.

We should eventually make the code clean of all MSVC warnings, but it's
a long way to go for Level4, so it's more reasonable to start at Level1.

For reference[1], these are the warning levels as described by MSVC
documentation:

  * /W0 suppresses all warnings. It's equivalent to /w.
  * /W1 displays level 1 (severe) warnings. /W1 is the default setting
    in the command-line compiler.
  * /W2 displays level 1 and level 2 (significant) warnings.
  * /W3 displays level 1, level 2, and level 3 (production quality)
    warnings. /W3 is the default setting in the IDE.
  * /W4 displays level 1, level 2, and level 3 warnings, and all level 4
    (informational) warnings that aren't off by default. We recommend
    that you use this option to provide lint-like warnings. For a new
    project, it may be best to use /W4 in all compilations. This option
    helps ensure the fewest possible hard-to-find code defects.
  * /Wall displays all warnings displayed by /W4 and all other warnings
    that /W4 doesn't include — for example, warnings that are off by
    default.
  * /WX treats all compiler warnings as errors. For a new project, it
    may be best to use /WX in all compilations; resolving all warnings
    ensures the fewest possible hard-to-find code defects.

1. https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=vs-2019
2020-04-15 12:45:05 +02:00
Michał Kępień
4f2b379967 Merge branch 'michal/fix-srcid-on-windows' into 'master'
Fix "srcid" on Windows

See merge request isc-projects/bind9!3364
2020-04-15 09:41:25 +00:00
Michał Kępień
05e13e7caf Fix "srcid" on Windows
Windows BIND releases produced by GitLab CI are built from Git
repositories, not from release tarballs, which means the "srcid" file is
not present in the top source directory when MSBuild is invoked.  This
causes the Git commit hash for such builds to be set to "unset_id".
Enable win32utils/Configure to try determining the commit hash for a
build by invoking Git on the build host if the "srcid" file is not
present (which is what its Unix counterpart does).
2020-04-15 11:38:40 +02:00
Ondřej Surý
8a24be074a Merge branch 'ondrej/add-missing-time.h-on-win32' into 'master'
Add missing time.h header in windows isc/time.h for missing prototypes

See merge request isc-projects/bind9!3368
2020-04-15 08:17:59 +00:00
Ondřej Surý
b9f68d098b Add missing time.h header in windows isc/time.h for missing prototypes
The win32 isc/time.h was missing <time.h> header leading to:

    lib\isc\win32\include\isc\time.h(29): warning C4013: 'gmtime_s'
    undefined; assuming extern returning int (compiling source file
    ..\app.c) [lib\isc\win32\libisc.vcxproj]

    lib\isc\win32\include\isc\time.h(39): warning C4013: 'localtime_s'
    undefined; assuming extern returning int (compiling source file
    ..\app.c) [lib\isc\win32\libisc.vcxproj]
2020-04-15 09:14:28 +02:00
Ondřej Surý
c87ce5a410 Merge branch 'ondrej/add-python-static-analysis-to-gitlab-ci' into 'master'
Add python static analysis to GitLab CI

See merge request isc-projects/bind9!3311
2020-04-15 05:29:06 +00:00
Ondřej Surý
1e4ff9d485 Make the python code pylint and flake8 compliant 2020-04-14 10:41:34 +02:00
Ondřej Surý
ee534592e3 Add pylint and flake8 tests to GitLab CI
Our python code didn't adhere to any coding standard.  In this commit, we add
flame8 (https://pypi.org/project/flake8/), and pylint (https://www.pylint.org/).

There's couple of exceptions:

- ans.py scripts are not checked, nor fixed as part of this MR
- pylint's missing-*-docstring and duplicate-code checks have
  been disabled via .pylintrc

Both exceptions should be removed in due time.
2020-04-14 10:41:34 +02:00
Michał Kępień
37eb17dd71 Merge branch 'michal/misc-doc-fixes' into 'master'
Miscellaneous documentation fixes

See merge request isc-projects/bind9!3357
2020-04-09 05:49:58 +00:00
Stephen Morris
623b6c94c0 Tweak release notes for BIND 9.17.1 2020-04-08 22:12:57 +02:00
Michał Kępień
dfe4009c30 Tweak CHANGES for BIND 9.17.1 2020-04-08 22:12:57 +02:00
Ondřej Surý
69e3ec9cb1 Merge branch 'bug/master/libisc-link' into 'master'
Link all dependent libraries to libisc

See merge request isc-projects/bind9!3323
2020-04-08 15:02:59 +00:00
Petr Menšík
4cc7d2412f Link all required libraries to libisc
It would fail to link -lisc without additional libraries, which should
not be required.
2020-04-08 14:40:15 +00:00
Ondřej Surý
5686298fd2 Merge branch 'ondrej/changes-notes-v9_16' into 'master'
Add missing CHANGES notes from v9_16 branch

See merge request isc-projects/bind9!3356
2020-04-08 13:10:34 +00:00
Ondřej Surý
2ef1149519 Add missing CHANGES notes from v9_16 branch 2020-04-08 15:07:56 +02:00
Ondřej Surý
78166f9c2d Merge branch 'ondrej/placeholder-it' into 'master'
CHANGES notes 5379. should have been placeholder

See merge request isc-projects/bind9!3355
2020-04-08 12:52:07 +00:00
Ondřej Surý
bb6b3ea468 CHANGES notes 5379. should have been placeholder 2020-04-08 14:48:55 +02:00
Ondřej Surý
9c6533855e Merge branch 'ondrej/missing-changes-v9_11' into 'master'
Add missing CHANGES notes from v9_11 branch

See merge request isc-projects/bind9!3352
2020-04-08 12:44:26 +00:00
Ondřej Surý
434929b53d Add missing CHANGES notes from v9_11 branch 2020-04-08 14:42:46 +02:00
Michał Kępień
2786ef413f Merge branch '1742-work-around-an-msvc-bug' into 'master'
Work around an MSVC bug

Closes #1742

See merge request isc-projects/bind9!3347
2020-04-08 12:29:10 +00:00
Michał Kępień
4c4f5cccaa Work around an MSVC bug
The assembly code generated by MSVC for at least some signed comparisons
involving atomic variables incorrectly uses unsigned conditional jumps
instead of signed ones.  In particular, the checks in isc_log_wouldlog()
are affected in a way which breaks logging on Windows and thus also all
system tests involving a named instance.  Work around the issue by
assigning the values returned by atomic_load_acquire() calls in
isc_log_wouldlog() to local variables before performing comparisons.
2020-04-08 14:27:33 +02:00
Ondřej Surý
43e11807fc Merge branch 'ondrej/arch-ppc64le-v9_11-placeholder-in-master' into 'master'
Add placeholder

See merge request isc-projects/bind9!3348
2020-04-08 12:14:57 +00:00
Ondřej Surý
5c48788abd Add placeholder for !3295 2020-04-08 14:14:07 +02:00
Ondřej Surý
20f70f24ee Merge branch '1574-confidential-issue-rebinding-protection-fail-in-forwarding-mode-master' into 'master'
Resolve "DNS rebinding protection is ineffective when BIND is configured as a forwarding DNS server"

Closes #1574

See merge request isc-projects/bind9!3342
2020-04-08 07:42:13 +00:00
Ondřej Surý
157f2da837 Add release notes 2020-04-08 09:37:58 +02:00
Ondřej Surý
f15653454e Add CHANGES 2020-04-08 09:37:55 +02:00
Diego Fronza
eb7a664274 Add test for the proposed fix
This test asserts that option "deny-answer-aliases" works correctly
when forwarding requests.

As a matter of example, the behavior expected for a forwarder BIND
instance, having an option such as deny-answer-aliases { "domain"; }
is that when forwarding a request for *.anything-but-domain, it is
expected that it will return SERVFAIL if any answer received has a CNAME
for "*.domain".

(cherry picked from commit 9bdb960a16a69997b08746e698b6b02c8dc6c795)
2020-04-08 09:37:33 +02:00
Diego Fronza
cf7b0de1eb Fixed rebinding protection bug when using forwarder setups
BIND wasn't honoring option "deny-answer-aliases" when configured to
forward queries.

Before the fix it was possible for nameservers listed in "forwarders"
option to return CNAME answers pointing to unrelated domains of the
original query, which could be used as a vector for rebinding attacks.

The fix ensures that BIND apply filters even if configured as a forwarder
instance.

(cherry picked from commit af6a4de3d5ad6c1967173facf366e6c86b3ffc28)
2020-04-08 09:37:33 +02:00
Matthijs Mekking
f762ee6621 Merge branch '1669-kasp-test-fails-on-windows' into 'master'
Fix kasp timing issue on Windows

Closes #1669

See merge request isc-projects/bind9!3337
2020-04-08 07:25:56 +00:00
Matthijs Mekking
04e6711029 Increase migrate.kasp DNSKEY TTL
Increate the DNSKEY TTL of the migrate.kasp zone for the following
reason:  The key states are initialized depending on the timing
metadata. If a key is present long enough in the zone it will be
initialized to OMNIPRESENT.  Long enough here is the time when it
was published (when the setup script was run) plus DNSKEY TTL.
Otherwise it is set to RUMOURED, or to HIDDEN if no timing metadata
is set or the time is still in the future.

Since the TTL is "only" 5 minutes, the DNSKEY state may be
initialized to OMNIPRESENT if the test is slow, but we expect it
to be in RUMOURED state.  If we increase the TTL to a couple of
hours it is very unlikely that it will be initialized to something
else than RUMOURED.
2020-04-07 15:51:43 +02:00
Matthijs Mekking
8d3c0156f4 Fix ns6 template zonefile
The template zone file for server ns6 should have the ns6 domain
name, not ns3.
2020-04-07 15:34:13 +02:00
Matthijs Mekking
87c05fa62f Remove kasp Windows prereq check
Now that the timing issue is fixed, we can enable the kasp test
again on Windows.
2020-04-07 13:59:34 +02:00
Matthijs Mekking
62a97570b8 Fix kasp timing issue on Windows
This fixes another intermittent failure in the kasp system test.
It does not happen often, except for in the Windows platform tests
where it takes a long time to run the tests.

In the "kasp" system test, there is an "rndc reconfig" call which
triggers a new rekey event.  check_next_key_event() verifies the time
remaining from the moment "rndc reconfig" is called until the next key
event.  However, the next key event time is calculated from the key
times provided during key creation (i.e. during test setup).  Given
this, if "rndc reconfig" is called a significant amount of time after
the test is started, some check_next_key_event() checks will fail.

Fix by calculating the time passed since the start of the test and
when 'rndc reconfig' happens.  Substract this time from the
calculated next key event.

This only needs to be done after an "rndc reconfig" on zones where
the keymgr needs to wait for a period of time (for example for keys
to become OMNIPRESENT, or HIDDEN). This is on step 2 and step 5 of
the algorithm rollover.  In step 2 there is a waiting period before
the DNSKEY is OMNIPRESENT, in step 5 there is a waiting period
before the DNSKEY is HIDDEN.

In step 1 new keys are created, in step 3 and 4 key states just
entered OMNIPRESENT, and in step 6 we no longer care because the
key lifetime is unlimited and we default to checking once per hour.

Regardless of our indifference about the next key event after step 6,
change some of the key timings in the setup script to better
reflect reality: DNSKEY is in HIDDEN after step 5, DS times have
changed when the new DS became active.
2020-04-07 13:59:34 +02:00
Mark Andrews
58a5e6fba7 Merge branch '1715-kasp-system-test-timing-issue-with-view-zones-2' into 'master'
Resolve "kasp system test timing issue with view zones"

Closes #1715

See merge request isc-projects/bind9!3334
2020-04-06 09:29:05 +00:00
Mark Andrews
78746cfabd Wait for zone to be signed 2020-04-06 08:50:37 +00:00
Mark Andrews
73d426812d Merge branch '1715-kasp-system-test-timing-issue-with-view-zones' into 'master'
Resolve "kasp system test timing issue with view zones"

See merge request isc-projects/bind9!3333
2020-04-06 08:41:36 +00:00
Mark Andrews
5a4ab3360d Wait for DNSKEY records to be signed 2020-04-06 13:51:47 +10:00
Ondřej Surý
bb87613015 Merge branch '1087-fix-the-nonmatching-statcounter-increments-decrements' into 'master'
Fix the some of the underflowing statistics

See merge request isc-projects/bind9!3299
2020-04-03 18:19:17 +00:00
Ondřej Surý
22aaeb5150 Add CHANGES 2020-04-03 19:42:20 +02:00
Ondřej Surý
78886d4bed Fix the statistic counter underflow in ns_client_t
In case of normal fetch, the .recursionquota is attached and
ns_statscounter_recursclients is incremented when the fetch is created.  Then
the .recursionquota is detached and the counter decremented in the
fetch_callback().

In case of prefetch or rpzfetch, the quota is attached, but the counter is not
incremented.  When we reach the soft-quota, the function returns early but don't
detach from the quota, and it gets destroyed during the ns_client_endrequest(),
so no memory was leaked.

But because the ns_statscounter_recursclients is only incremented during the
normal fetch the counter would be incorrectly decremented on two occassions:

1) When we reached the softquota, because the quota was not properly detached
2) When the prefetch or rpzfetch was cancelled mid-flight and the callback
   function was never called.
2020-04-03 19:41:46 +02:00
Ondřej Surý
26842ac25c Remove the extra decstats on STATID_ACTIVE for children sockets 2020-04-03 19:41:46 +02:00
Witold Kręcicki
4ffd4cd4f6 Fix the memory ordering for the isc stats to be acquire-release 2020-04-03 19:41:46 +02:00
Matthijs Mekking
663047ac8b Merge branch '1179-dnssec-stats-oom-kill' into 'master'
Resolve "OOM issue after upgrade from 9.14.3 to 9.14.4"

Closes #1179

See merge request isc-projects/bind9!3304
2020-04-03 07:59:11 +00:00
Matthijs Mekking
386890a161 Update release notes 2020-04-03 09:27:15 +02:00
Matthijs Mekking
c1723b2535 Replace hard coded value with constant 2020-04-03 09:27:15 +02:00
Matthijs Mekking
1596d3b498 Merge if blocks in statschannel.c 2020-04-03 09:27:15 +02:00
Matthijs Mekking
44b49955e1 Replace sign operation bool with enum 2020-04-03 09:27:15 +02:00
Matthijs Mekking
b2028e26da Embed algorithm in key tag counter
Key tags are not unique across algorithms.
2020-04-03 09:27:15 +02:00
Matthijs Mekking
eb6a8b47d7 Group the keyid with the counters
Rather than group key ids together, group key id with its
corresponding counters. This should make growing / shrinking easier
than having keyids then counters.
2020-04-03 09:27:15 +02:00
Matthijs Mekking
31e8b2b13c Add test for many keys
Add a statschannel test case for DNSSEC sign metrics that has more
keys than there are allocated stats counters for.  This will produce
gibberish, but at least it should not crash.
2020-04-03 09:27:15 +02:00
Matthijs Mekking
705810d577 Redesign dnssec sign statistics
The first attempt to add DNSSEC sign statistics was naive: for each
zone we allocated 64K counters, twice.  In reality each zone has at
most four keys, so the new approach only has room for four keys per
zone. If after a rollover more keys have signed the zone, existing
keys are rotated out.

The DNSSEC sign statistics has three counters per key, so twelve
counters per zone. First counter is actually a key id, so it is
clear what key contributed to the metrics.  The second counter
tracks the number of generated signatures, and the third tracks
how many of those are refreshes.

This means that in the zone structure we no longer need two separate
references to DNSSEC sign metrics: both the resign and refresh stats
are kept in a single dns_stats structure.

Incrementing dnssecsignstats:

Whenever a dnssecsignstat is incremented, we look up the key id
to see if we already are counting metrics for this key.  If so,
we update the corresponding operation counter (resign or
refresh).

If the key is new, store the value in a new counter and increment
corresponding counter.

If all slots are full, we rotate the keys and overwrite the last
slot with the new key.

Dumping dnssecsignstats:

Dumping dnssecsignstats is no longer a simple wrapper around
isc_stats_dump, but uses the same principle.  The difference is that
rather than dumping the index (key tag) and counter, we have to look
up the corresponding counter.
2020-04-03 09:27:11 +02:00
Matthijs Mekking
157eb5cd30 Merge branch '1706-dnssec-policy-migration' into 'master'
Resolve "Changing from auto-dnssec maintain to dnssec-policy x immediately deletes existing keys"

Closes #1706

See merge request isc-projects/bind9!3322
2020-04-03 06:54:46 +00:00
Matthijs Mekking
551acb44f4 Test migration to dnssec-policy, change algorithm
Add a test to ensure migration from 'auto-dnssec maintain;' to
dnssec-policy works even if the algorithm is changed.  The existing
keys should not be removed immediately, but their goal should be
changed to become hidden, and the new keys with the different
algorithm should be introduced immediately.
2020-04-03 08:29:22 +02:00
Matthijs Mekking
2389fcb4dc Only initialize goal on active keys
If we initialize goals on all keys, superfluous keys that match
the policy all desire to be active.  For example, there are six
keys available for a policy that needs just two, we only want to
set the goal state to OMNIPRESENT on two keys, not six.
2020-04-03 08:29:22 +02:00
Matthijs Mekking
f47e697da3 Update documentation with !1706 fix 2020-04-03 08:29:22 +02:00
Matthijs Mekking
7f43520893 Test migration to dnssec-policy, retire old keys
Migrating from 'auto-dnssec maintain;' to dnssec-policy did not
work properly, mainly because the legacy keys were initialized
badly.  Earlier commit deals with migration where existing keys
match the policy.  This commit deals with migration where existing
keys do not match the policy.  In that case, named must not
immediately delete the existing keys, but gracefully roll to the
dnssec-policy.

However, named did remove the existing keys immediately.  This is
because the legacy key states were initialized badly.  Because
those keys had their states initialized to HIDDEN or RUMOURED, the
keymgr decides that they can be removed (because only when the key
has its states in OMNIPRESENT it can be used safely).

The original thought to initialize key states to HIDDEN (and
RUMOURED to deal with existing keys) was to ensure that those keys
will go through the required propagation time before the keymgr
decides they can be used safely.  However, those keys are already
in the zone for a long time and making the key states represent
otherwise is dangerous: keys may be pulled out of the zone while
in fact they are required to establish the chain of trust.

Fix initializing key states for existing keys by looking more closely
at the time metadata.  Add TTL and propagation delays to the time
metadata and see if the DNSSEC records have been propagated.
Initialize the state to OMNIPRESENT if so, otherwise initialize to
RUMOURED.  If the time metadata is in the future, or does not exist,
keep initializing the state to HIDDEN.

The added test makes sure that new keys matching the policy are
introduced, but existing keys are kept in the zone until the new
keys have been propagated.
2020-04-03 08:29:22 +02:00
Matthijs Mekking
a224754d59 Tweak kasp system test
A few kasp system test tweaks to improve test failure debugging and
deal with tests related to migration to dnssec-policy.

1. When clearing a key, set lifetime to "none".  If "none", skip
   expect no lifetime set in the state file.  Legacy keys that
   are migrated but don't match the dnssec-policy will not have a
   lifetime.

2. The kasp system test prints which key id and file it is checking.
   Log explicitly if we are checking the id or a file.

3. Add quotes around "ID" when setting the key id, for consistency.

4. Fix a typo (non -> none).

5. Print which key ids are found, this way it is easier to see what
   KEY[1-4] failed to match one of the key files.
2020-04-03 08:29:22 +02:00
Matthijs Mekking
6801899134 Fix and test migration to dnssec-policy
Migrating from 'auto-dnssec maintain;' to dnssec-policy did not
work properly, mainly because the legacy keys were initialized
badly. Several adjustments in the keymgr are required to get it right:

- Set published time on keys when we calculate prepublication time.
  This is not strictly necessary, but it is weird to have an active
  key without the published time set.

- Initalize key states also before matching keys. Determine the
  target state by looking at existing time metadata: If the time
  data is set and is in the past, it is a hint that the key and
  its corresponding records have been published in the zone already,
  and the state is initialized to RUMOURED. Otherwise, initialize it
  as HIDDEN. This fixes migration to dnssec-policy from existing
  keys.

- Initialize key goal on keys that match key policy to OMNIPRESENT.
  These may be existing legacy keys that are being migrated.

- A key that has its goal to OMNIPRESENT *or* an active key can
  match a kasp key.  The code was changed with CHANGE 5354 that
  was a bugfix to prevent creating new KSK keys for zones in the
  initial stage of signing.  However, this caused problems for
  restarts when rollovers are in progress, because an outroducing
  key can still be an active key.

The test for this introduces a new KEY property 'legacy'.  This is
used to skip tests related to .state files.
2020-04-03 08:29:22 +02:00
Ondřej Surý
49b42e7fcc Merge branch '1717-rwlock-contention-in-isc_log_wouldlog-api-performance-impact' into 'master'
Reduce rwlock contention in isc_log_wouldlog()

Closes #1717

See merge request isc-projects/bind9!3321
2020-04-03 05:01:33 +00:00
Ondřej Surý
3a24eacbb6 Reduce rwlock contention in isc_log_wouldlog()
The rwlock introduced to protect the .logconfig member of isc_log_t
structure caused a significant performance drop because of the rwlock
contention.  It was also found, that the debug_level member of said
structure was not protected from concurrent read/writes.

The .dynamic and .highest_level members of isc_logconfig_t structure
were actually just cached values pulled from the assigned channels.

We introduced an even higher cache level for .dynamic and .highest_level
members directly into the isc_log_t structure, so we don't have to
access the .logconfig member in the isc_log_wouldlog() function.
2020-04-02 11:23:16 +02:00
Evan Hunt
8e74974ce1 Merge branch '1447-incremental-rpz-update' into 'master'
incrementally clean up old RPZ records during updates

Closes #1447

See merge request isc-projects/bind9!3318
2020-04-01 03:38:31 +00:00
Evan Hunt
899f9440c0 CHANGES and release note 2020-03-31 19:41:41 -07:00
Evan Hunt
32da119ed8 incrementally clean up old RPZ records during updates
After an RPZ zone is updated via zone transfer, the RPZ summary
database is updated, inserting the newly added names in the policy
zone and deleting the newly removed ones. The first part of this
was quantized so it would not run too long and starve other tasks
during large updates, but the second part was not quantized, so
that an update in which a large number of records were deleted
could cause named to become briefly unresponsive.
2020-03-31 19:41:41 -07:00
Mark Andrews
0c350fbcb7 Merge branch 'marka-empty-release-notes' into 'master'
add empty release notes for 9.17.1

See merge request isc-projects/bind9!3313
2020-03-31 03:31:38 +00:00
Mark Andrews
503e2dff64 add empty release notes for 9.17.1 2020-03-31 14:10:49 +11:00
Witold Krecicki
d02a58adc0 Merge branch '1700-proper-tcp-resuming' into 'master'
Deactivate the handle before sending the async close callback.

Closes #1700

See merge request isc-projects/bind9!3303
2020-03-30 10:27:01 +00:00
Witold Kręcicki
01c4c3301e Deactivate the handle before sending the async close callback.
We could have a race between handle closing and processing async
callback. Deactivate the handle before issuing the callback - we
have the socket referenced anyway so it's not a problem.
2020-03-30 10:26:05 +02:00
Witold Krecicki
2df610a882 Merge branch 'wpk/quota-callback' into 'master'
isc_quota_attach_cb - quota attach function with a callback.

See merge request isc-projects/bind9!3280
2020-03-30 08:17:31 +00:00
Witold Kręcicki
d151a10f30 Add a quota attach function with a callback, some code cleanups.
We introduce a isc_quota_attach_cb function - if ISC_R_QUOTA is returned
at the time the function is called, then a callback will be called when
there's quota available (with quota already attached). The callbacks are
organized as a LIFO queue in the quota structure.
It's needed for TCP client quota -  with old networking code we had one
single place where tcp clients quota was processed so we could resume
accepting when the we had spare slots, but it's gone with netmgr - now
we need to notify the listener/accepter that there's quota available so
that it can resume accepting.

Remove unused isc_quota_force() function.

The isc_quote_reserve and isc_quota_release were used only internally
from the quota.c and the tests.  We should not expose API we are not
using.
2020-03-30 07:43:10 +00:00
Mark Andrews
5826c85a22 Merge branch '1678-bind-fails-to-build-with-mysql-support-against-mysql8-mysql-connector-8' into 'master'
Resolve "BIND fails to build with MYSQL support against mysql8/mysql-connector-8"

Closes #1678

See merge request isc-projects/bind9!3235
2020-03-26 22:03:11 +00:00
Ondřej Surý
715b7a7cec Use compound literals in mysql_options() call
Makes use of compound literals instead of using extra my_bool
variable just to hold "true/1" value.
2020-03-26 20:36:43 +00:00
Mark Andrews
c6d5d5c88f Typedef my_bool if missing.
ORACLE MySQL 8.0 has dropped the my_bool type, so we need to reinstate
it back when compiling with that version or higher.  MariaDB is still
keeping the my_bool type.  The numbering between the two (MariaDB 5.x
jumped to MariaDB 10.x) doesn't make the life of the developer easy.
2020-03-26 20:36:43 +00:00
Mark Andrews
7af9883b48 remove unused variable 2020-03-26 20:36:43 +00:00
Michał Kępień
3377bc4b02 Merge branch 'michal/misc-gitlab-ci-yml-cleanups' into 'master'
Miscellaneous .gitlab-ci.yml cleanups

See merge request isc-projects/bind9!3298
2020-03-26 10:40:13 +00:00
Michał Kępień
3d121ede6c Remove unused YAML anchors
Some YAML anchors defined in .gitlab-ci.yml are not subsequently used.
Remove them to prevent confusion.
2020-03-26 11:03:52 +01:00
Michał Kępień
3d264dbe81 Do not install compiledb in cppcheck job
compiledb is already included in the Docker image used by the cppcheck
job.  Do not attempt installing it again.
2020-03-26 11:03:52 +01:00
Michał Kępień
0c898084cd Include compiler name in all build/test job names
Most build/test job names already contain a "clang", "gcc", or "msvc"
prefix which indicates the compiler used for a given job.  Apply that
naming convention to all build/test job names.
2020-03-26 11:03:52 +01:00
Michał Kępień
84463f33bf Refactor TSAN unit test job definitions
Multiple YAML keys have identical values for both TSAN unit test job
definitions.  Extract these common keys to a YAML anchor and use it in
TSAN unit test job definitions to reduce code duplication.
2020-03-26 11:03:52 +01:00
Michał Kępień
6ebce9425e Run "kyua report-html" for TSAN unit test jobs
Definitions of jobs running unit tests under TSAN contain an
"after_script" YAML key.  Since the "unit_test_job" anchor is included
in those job definitions before "after_script" is defined, the
job-specific value of that key overrides the one defined in the included
anchor.  This prevents "kyua report-html" from being run for TSAN unit
test jobs.  Moving the invocation of "kyua report-html" to the "script"
key in the "unit_test_job" anchor is not acceptable as it would cause
the exit code of that command to determine the result of all unit test
jobs and we need that to be the exit code of "make unit".  Instead, add
"kyua report-html" invocations to the "after_script" key of TSAN unit
test job definitions to address the problem without affecting other job
definitions.
2020-03-26 11:03:52 +01:00
Michał Kępień
a9aa295f1f Refactor TSAN system test job definitions
Multiple YAML keys have identical values for both TSAN system test job
definitions.  Extract these common keys to a YAML anchor and use it in
TSAN system test job definitions to reduce code duplication.
2020-03-26 11:03:52 +01:00
Michał Kępień
8ef01c7b50 Drop "before_script" key from TSAN job definitions
Both "system_test_job" and "unit_test_job" YAML anchors contain a
"before_script" key.  TSAN job definitions first specify their own value
of the "before_script" key and then include the aforementioned YAML
anchors, which results in the value of the "before_script" key being
overridden with the value specified by the included anchor.  Given this,
remove "before_script" definitions specific to TSAN jobs as they serve
no practical purpose.
2020-03-26 11:03:52 +01:00
Michał Kępień
6325c0993a Define TSAN options in a global variable
All assignments for the TSAN_OPTIONS variable are identical across the
entire .gitlab-ci.yml file.  Define a global TSAN_OPTIONS_COMMON
variable and use it in job definitions to reduce code duplication.
2020-03-26 11:03:52 +01:00
Ondřej Surý
4167eba3c3 Merge branch '1679-fix-the-typecase-to-isc_stdtime_get' into 'master'
Correct the typecast of .tv_sec in isc_stdtime_get()

Closes #1679

See merge request isc-projects/bind9!3294
2020-03-25 21:31:34 +00:00
Ondřej Surý
7c8179c503 Correct the typecast of .tv_sec in isc_stdtime_get() 2020-03-25 22:08:50 +01:00
Ondřej Surý
03727c1462 Merge branch '1679-fix-the-tv_nsec_check' into 'master'
Fix the tv_nsec check in isc_stdtime_get()

Closes #1679

See merge request isc-projects/bind9!3292
2020-03-25 19:28:59 +00:00
Ondřej Surý
0d06a62dd1 Fix the tv_nsec check in isc_stdtime_get() 2020-03-25 19:06:50 +01:00
Ondřej Surý
4154677f2e Merge branch 'ondrej/no-clang-on-debian-sid' into 'master'
Rewrite .gitlab-ci.yml to have 'base_image' and other GitLab CI improvements

See merge request isc-projects/bind9!3279
2020-03-25 17:05:27 +00:00
Ondřej Surý
281531d82b Replace clang:stretch:amd64 build with clang:buster:amd64 build (+ add missing system test) 2020-03-25 18:04:24 +01:00
Ondřej Surý
ec72d1100d Replace bear with compiledb and drop MAKE_COMMAND because we don't need it 2020-03-25 18:04:24 +01:00
Ondřej Surý
5f5721aa11 Adjust the GitLab CI jobs to match the new images
The custom builds (oot, asan, tsan) were mostly built using Debian sid
amd64 image.  The problem was that this image broke too easily, because
it's Debian "unstable" after all.

This commit introduces "base_image" that should be most stable with
extra bits on top (clang, coccinelle, cppcheck, ...).  Currently, that
would be Debian buster amd64.

Other changes introduced by this commit:

* Change the default clang version to 10
* Run both ASAN and TSAN with both gcc and clang compilers
* Remove Clang Debian stretch i386 job
2020-03-25 18:04:24 +01:00
Ondřej Surý
d07c3d6c8c Merge branch 'ondrej/scan-build-10-fixes' into 'master'
Fix new warnings reported by scan-build from LLVM/Clang 10

See merge request isc-projects/bind9!3285
2020-03-25 17:02:55 +00:00
Ondřej Surý
ddd0d356e5 Fix 'Dereference of null pointer' from scan-build-10
These are mostly false positives, the clang-analyzer FAQ[1] specifies
why and how to fix it:

> The reason the analyzer often thinks that a pointer can be null is
> because the preceding code checked compared it against null. So if you
> are absolutely sure that it cannot be null, remove the preceding check
> and, preferably, add an assertion as well.

The 4 warnings reported are:

dnssec-cds.c:781:4: warning: Access to field 'base' results in a dereference of a null pointer (loaded from variable 'buf')
                        isc_buffer_availableregion(buf, &r);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:996:36: note: expanded from macro 'isc_buffer_availableregion'
                                   ^
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:821:16: note: expanded from macro 'ISC__BUFFER_AVAILABLEREGION'
                (_r)->base = isc_buffer_used(_b);              \
                             ^~~~~~~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:152:29: note: expanded from macro 'isc_buffer_used'
        ((void *)((unsigned char *)(b)->base + (b)->used)) /*d*/
                                   ^~~~~~~~~
1 warning generated.

--

byname_test.c:308:34: warning: Access to field 'fwdtable' results in a dereference of a null pointer (loaded from variable 'view')
                RUNTIME_CHECK(dns_fwdtable_add(view->fwdtable, dns_rootname,
                                               ^~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/util.h:318:52: note: expanded from macro 'RUNTIME_CHECK'
                                                   ^~~~
/builds/isc-projects/bind9/lib/isc/include/isc/error.h:50:21: note: expanded from macro 'ISC_ERROR_RUNTIMECHECK'
        ((void)(ISC_LIKELY(cond) ||  \
                           ^~~~
/builds/isc-projects/bind9/lib/isc/include/isc/likely.h:23:43: note: expanded from macro 'ISC_LIKELY'
                                            ^
1 warning generated.

--

./rndc.c:255:6: warning: Dereference of null pointer (loaded from variable 'host')
        if (*host == '/') {
            ^~~~~
1 warning generated.

--

./main.c:1254:9: warning: Access to field 'sctx' results in a dereference of a null pointer (loaded from variable 'named_g_server')
        sctx = named_g_server->sctx;
               ^~~~~~~~~~~~~~~~~~~~
1 warning generated.

References:
1. https://clang-analyzer.llvm.org/faq.html#null_pointer
2020-03-25 17:33:22 +01:00
Ondřej Surý
262f087bcf Fix 'Dead nested assignment's from scan-build-10
The 3 warnings reported are:

os.c:872:7: warning: Although the value stored to 'ptr' is used in the enclosing expression, the value is never actually read from 'ptr'
        if ((ptr = strtok_r(command, " \t", &last)) == NULL) {
             ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

--

rpz.c:1117:10: warning: Although the value stored to 'zbits' is used in the enclosing expression, the value is never actually read from 'zbits'
        return (zbits &= x);
                ^        ~
1 warning generated.

--

openssleddsa_link.c:532:10: warning: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
        while ((err = ERR_get_error()) != 0) {
                ^     ~~~~~~~~~~~~~~~
1 warning generated.
2020-03-25 17:33:07 +01:00
Witold Krecicki
ec9f80cabc Merge branch 'wpk/tcpdns-refactoring' into 'master'
netmgr refactoring: use generic functions when operating on sockets.

See merge request isc-projects/bind9!3269
2020-03-24 20:57:21 +00:00
Witold Kręcicki
5fedd21e16 netmgr refactoring: use generic functions when operating on sockets.
tcpdns used transport-specific functions to operate on the outer socket.
Use generic ones instead, and select the proper call in netmgr.c.
Make the missing functions (e.g. isc_nm_read) generic and add type-specific
calls (isc__nm_tcp_read). This is the preparation for netmgr TLS layer.
2020-03-24 20:31:43 +00:00
Ondřej Surý
aed3927592 Merge branch 'ondrej/remove-debian-jessie-from-gitlab-ci' into 'master'
Remove Debian 8 ("jessie") from the GitLab CI

See merge request isc-projects/bind9!3281
2020-03-24 13:50:41 +00:00
Ondřej Surý
75f46cc3d1 Remove Debian 8 ("Jessie") from the GitLab CI
There are several reason why remove Debian 8 from the CI:

* Debian 8 ("jessie") has been superseded by Debian 9 ("stretch").
* Regular security support updates have been discontinued as of
  June 17th, 2018.
* Jessie LTS is supported from 17th June 2018 to June 30, 2020.

In other words, it's no longer officially supported by Debian security
team, but by the volunteer/paid contributor composed LTS team.  And the
release will be discontinued in three months from now.  We can use the
freed CI resources to bring new platforms or just to make the jobs run a
bit faster.
2020-03-24 14:24:47 +01:00
Michał Kępień
84a2ed67a1 Merge branch 'michal/update-release-checklist' into 'master'
Update release checklist (BIND_BASELINE_VERSION)

See merge request isc-projects/bind9!3278
2020-03-24 08:56:20 +00:00
Michał Kępień
b145071260 Update release checklist (BIND_BASELINE_VERSION)
The reference BIND version used in the ABI check CI job is not
determined automatically - it needs to be updated after each BIND
release.  Reflect that fact in the release checklist to make sure the
ABI check CI job is always comparing current code with the latest BIND
release on a given branch.
2020-03-24 07:36:24 +01:00
Mark Andrews
7da215f38b Merge branch '1698-converting-isc_log-to-rwlock-broke-windows' into 'master'
Resolve "Converting isc_log to RWLOCK broke Windows"

Closes #1698

See merge request isc-projects/bind9!3276
2020-03-24 04:22:43 +00:00
Mark Andrews
b7dbfd14d8 Used to the correct unlock type (read) 2020-03-24 14:50:31 +11:00
Michal Nowak
2d74d88b47 Merge branch 'mnowak/abi-tracker-helper-v9.17.0' into 'master'
Bump BIND baseline version for abi-check

See merge request isc-projects/bind9!3202
2020-03-20 12:08:23 +00:00
Michal Nowak
3730d59bf9 Bump BIND baseline version for abi-check 2020-03-20 13:06:57 +01:00
Matthijs Mekking
5efc35f517 Merge branch 'v9_17_0-release' into 'master'
Apply 9.17.0 release branch

See merge request isc-projects/bind9!3262
2020-03-20 10:22:12 +00:00
Tinderbox User
4b3b2e5dc7 Fix README related to --with-tuning 2020-03-20 10:51:32 +01:00
Tinderbox User
a972cf4360 regen master 2020-03-20 10:51:32 +01:00
Tinderbox User
50cf0e6ef8 Fix resonse typo in release notes 2020-03-20 10:51:32 +01:00
Tinderbox User
e73565ae0a regen master 2020-03-20 10:51:32 +01:00
Tinderbox User
678b8d27d6 prep 9.17.0
The files configure.ac and version are already up to date.

Updated CHANGES with 9.17.0 release line.

Fixed CHANGES by adding GitLab reference to entry 5357 and fix
grammar mistakes.

Add missing /util/check-make-install.in to .gitattributes.

The lib/*/api are already updated to match the new ranges.

I listed two new features under BIND 9.17 features that to me
seemed noteworthy.

The release notes look good to me.
2020-03-20 10:51:32 +01:00
Michal Nowak
2fafcc2c2d Merge branch 'mnowak/unit-test-debugging-enhancements' into 'master'
Enhance unit test debugging

See merge request isc-projects/bind9!2990
2020-03-20 09:40:16 +00:00
Michal Nowak
8fad74e0e5 Enhance unit test debugging
When unit test fails, core file is created. Kyua's 'debug' command can
run GDB on it and provide backtrace. Unfortunately Kyua is picky about
location of these core files we opt to use custom Kyua fork and copy
core files from Kyua working directory to source tree and make it
available in GitLab.
2020-03-20 10:37:59 +01:00
Ondřej Surý
eb26fdf701 Merge branch '4-fix-the-last-three-system-tests-parallel-run' into 'master'
Convert the last three system tests (ecdsa, eddsa and tkey) to use dynamic ports

See merge request isc-projects/bind9!3257
2020-03-19 17:23:53 +00:00
Ondřej Surý
cfbb46201f Fix the tkey system test to allow parallel run
The tkey test was not adapted to dynamic ports, so we had to run it in
sequence.  This commit adds support for dynamic ports, and also makes
all the scripts shellcheck clean.
2020-03-19 17:31:31 +01:00
Ondřej Surý
4124a89972 Fix the eddsa system test to allow parallel run
The eddsa test was not adapted to dynamic ports, so we had to run it in
sequence.  This commit adds support for dynamic ports, and also makes
all the scripts shellcheck clean.
2020-03-19 17:31:31 +01:00
Ondřej Surý
1f1ecdecc9 Fix the ecdsa system test to allow parallel run
The ecdsa test was not adapted to dynamic ports, so we had to run it in
sequence.  This commit adds support for dynamic ports, and also makes
all the scripts shellcheck clean.
2020-03-19 17:31:31 +01:00
Ondřej Surý
bde35220cd Merge branch '1679-remove-workaround-for-systems-with-broken-gettimeofday-system-calls' into 'master'
Remove Solaris 2.8 broken gettimeofday() workaround

Closes #1679

See merge request isc-projects/bind9!3238
2020-03-19 08:34:49 +00:00
Ondřej Surý
e691b89a9a Use clock_gettime() instead of gettimeofday() for isc_stdtime function
This also removes Solaris 2.8 broken gettimeofday() workaround
2020-03-18 16:02:24 +01:00
Ondřej Surý
af26de6370 Merge branch '4-gitlab-ci.yml-improvement' into 'master'
Improve GitLab CI configuration

See merge request isc-projects/bind9!3254
2020-03-18 11:51:59 +00:00
Ondřej Surý
de1a637a69 Rename MAKE environment variable to MAKE_COMMAND
The environment variable MAKE has been replaced with MAKE_COMMAND,
because overriding MAKE variable also changed the definition of the MAKE
inside the Makefiles, and we want only a single wrapper around the whole
build process.

Previously, setting `MAKE` to `bear make` meant that `bear make` would
be run at every nested make invocation, which messed up the upcoming
automake transition as compile_commands.json would be generated in every
subdirectory instead of just having one central file at the top of the
build tree.
2020-03-18 12:51:08 +01:00
Ondřej Surý
99f9e2c53e Remove cppcheck arm64 job
All *:sid:amd64 jobs were errorneously copied to *:sid:arm64 including
the extra cppcheck run.  Remove the extra definitions from arm64 jobs.
2020-03-18 12:51:08 +01:00
Ondřej Surý
66ba808c1b Replace dependencies+needs with needs+artifacts in GitLabCI config
All jobs now use solely the newer needs configuration to declare
dependencies between jobs:

    needs:
      - job: <foo>
        artifacts: true

instead of combination of dependencies and needs which is deprecated.
This change completely unbundles the stages (alas the stages still needs
to stay because the job graph has to stay acyclic between the stages).
2020-03-18 12:51:08 +01:00
Ondřej Surý
d7348a2b96 Merge branch '1675-logfileconfig-system-test-crashes-occasionally-rwlock' into 'master'
Use isc_rwlock to lock .logconfig member of isc_log_t

Closes #1675

See merge request isc-projects/bind9!3229
2020-03-18 11:50:39 +00:00
Ondřej Surý
4d58856ff7 Use isc_rwlock to lock .logconfig member of isc_log_t
In isc_log_woudlog() the .logconfig member of isc_log_t structure was
accessed unlocked on the merit that there could be just a race when
.logconfig would be NULL, so the message would not be logged.  This
turned not to be true, as there's also data race deeper.  The accessed
isc_logconfig_t object could be in the middle of destruction, so the
pointer would be still non-NULL, but the structure members could point
to a chunk of memory no longer belonging to the object.  Since we are
only accessing integer types (the log level), this would never lead to
a crash, it leads to memory access to memory area no longer belonging to
the object and this a) wrong, b) raises a red flag in thread-safety tools.
2020-03-18 11:52:14 +01:00
Ondřej Surý
ed2ee2dffa Merge branch 'marka-memget-cannot-fail-logging' into 'master'
Cleanup logging API now that isc_mem_get cannot fail.

See merge request isc-projects/bind9!3252
2020-03-18 10:34:28 +00:00
Mark Andrews
0b793166d0 Refactor the isc_log API so it cannot fail on memory failures
The isc_mem API now crashes on memory allocation failure, and this is
the next commit in series to cleanup the code that could fail before,
but cannot fail now, e.g. isc_result_t return type has been changed to
void for the isc_log API functions that could only return ISC_R_SUCCESS.
2020-03-18 09:05:59 +01:00
Evan Hunt
e6deefd03f Merge branch 'each-lgtm-fixes' into 'master'
fix LGTM warnings

See merge request isc-projects/bind9!3200
2020-03-17 22:18:10 +00:00
Ondřej Surý
08f4c7d6c0 Add C11 localtime_r and gmtime_r shims for Windows
On Windows, C11 localtime_r() and gmtime_r() functions are not
available.  While localtime() and gmtime() functions are already thread
safe because they use Thread Local Storage, it's quite ugly to #ifdef
around every localtime_r() and gmtime_r() usage to make the usage also
thread-safe on POSIX platforms.

The commit adds wrappers around Windows localtime_s() and gmtime_s()
functions.

NOTE: The implementation of localtime_s and gmtime_s in Microsoft CRT
are incompatible with the C standard since it has reversed parameter
order and errno_t return type.
2020-03-17 13:28:15 -07:00
Evan Hunt
ec95b84e8d silence a warning about unsafe snprintf() call 2020-03-17 13:28:15 -07:00
Evan Hunt
fc5ae3192b clean up dead code
removed an if statement that always evaluated to false
2020-03-17 13:28:15 -07:00
Evan Hunt
5703f70427 replace unsafe ctime() and gmtime() function calls
This silences LGTM warnings that these functions are not thread-safe.
2020-03-17 13:28:15 -07:00
Evan Hunt
735be3b816 remove or comment empty conditional branches
some empty conditional branches which contained a semicolon were
"fixed" by clang-format to contain nothing. add comments to prevent this.
2020-03-17 13:28:15 -07:00
Evan Hunt
8915e4722d Merge branch '1684-timer-test-build' into 'master'
fix a pointer-to-int cast error

Closes #1684

See merge request isc-projects/bind9!3246
2020-03-17 20:10:02 +00:00
Evan Hunt
6b76646037 fix a pointer-to-int cast error 2020-03-17 13:00:29 -07:00
Ondřej Surý
58cc273b19 Merge branch '1672-stop-leaking-external-headers-and-symbols-to-the-public-api-isc/md.h' into 'master'
Make isc_md API to not leak OpenSSL symbols

Closes #1672

See merge request isc-projects/bind9!3218
2020-03-17 15:00:56 +00:00
Ondřej Surý
4e114f8ed6 Stop leaking OpenSSL types and defines in the isc/md.h
The <isc/md.h> header directly included <openssl/evp.h> header which
enforced all users of the libisc library to explicitly list the include
path to OpenSSL and link with -lcrypto.  By hiding the specific
implementation into the private namespace, we no longer enforce this.
In the long run, this might also allow us to switch cryptographic
library implementation without affecting the downstream users.

While making the isc_md_type_t type opaque, the API using the data type
was changed to use the pointer to isc_md_type_t instead of using the
type directly.
2020-03-17 09:11:13 +01:00
Mark Andrews
6052e254b9 Merge branch '1682-dighost-c-idn_output_filter-has-off-by-one-error' into 'master'
Resolve "dighost.c: idn_output_filter has off by one error"

Closes #1682

See merge request isc-projects/bind9!3243
2020-03-17 04:43:46 +00:00
Mark Andrews
af67acc0d0 address off by one error in idn_output_filter 2020-03-17 13:56:30 +11:00
Diego dos Santos Fronza
da64d42cd6 Merge branch '1138-from-bugs-43718-extend-nsip-wait-recurse-or-add-nsdname-wait-recurse' into 'master'
Resolve "From Bugs (#43718) : extend nsip-wait-recurse or add nsdname-wait-recurse"

Closes #1138

See merge request isc-projects/bind9!3134
2020-03-16 18:50:53 +00:00
Diego Fronza
267e2c4772 Add CHANGES and release note 2020-03-16 15:20:12 -03:00
Diego Fronza
4e8f8da661 Added nsdname-wait-recurse documentation to ARM 2020-03-16 15:18:46 -03:00
Evan Hunt
2822b01636 incidental fix: dnsrps test was failing
the test for logging of invalid prefixes doesn't work when running
with dnsrps; disable it in that case.
2020-03-16 15:18:46 -03:00
Diego Fronza
fe10111521 Added test for nsdname-wait-recurse option 2020-03-16 15:18:46 -03:00
Diego Fronza
c786c578d7 Added RPZ configuration option "nsdname-wait-recurse"
This new option was added to fill a gap in RPZ configuration
options.

It was possible to instruct BIND wheter NSIP rewritting rules would
apply or not, as long as the required data was already in cache or not,
respectively, by means of the option nsip-wait-recurse.

A value of yes (default) could incur a little processing cost, since
BIND would need to recurse to find NS addresses in case they were not in
the cache.

This behavior could be changed by setting nsip-wait-recurse value to no,
in which case BIND would promptly return some error code if the NS IP addresses
data were not in cache, then BIND would start a recursive query
in background, so future similar requests would have the required data
(NS IPs) in cache, allowing BIND to apply NSIP rules accordingly.

A similar feature wasn't available for NSDNAME triggers, so this commit
adds the option nsdname-wait-recurse to fill this gap, as it was
expected by couple BIND users.
2020-03-16 15:18:46 -03:00
Michał Kępień
be0dc3db3f Merge branch 'michal/update-gitlab-ci-to-freebsd-12.1' into 'master'
Update GitLab CI to FreeBSD 12.1

See merge request isc-projects/bind9!3180
2020-03-16 10:33:31 +00:00
Michał Kępień
80618b5378 Move FreeBSD CI jobs to libvirt-based executors
To get rid of the currently used FreeBSD-specific executor, move FreeBSD
CI jobs to libvirt-based executors.  Make the necessary tag and variable
adjustments.
2020-03-16 11:32:46 +01:00
Michał Kępień
4c68b56246 Update GitLab CI to FreeBSD 12.1
Since FreeBSD 12.1 is the current FreeBSD 12.x release, replace FreeBSD
12.0 GitLab CI jobs with their up-to-date counterparts.
2020-03-16 11:32:46 +01:00
Ondřej Surý
a3b89e7547 Merge branch '4-convert-lmdb-check-to-macro' into 'master'
Add AX_LIB_LMDB macro

See merge request isc-projects/bind9!3205
2020-03-16 09:44:49 +00:00
Ondřej Surý
6a475340cf Link with LMDB only where needed 2020-03-16 09:38:15 +01:00
Ondřej Surý
fe85568604 Convert lmdb check to m4 macro 2020-03-16 09:38:15 +01:00
Mark Andrews
020b9f7a73 Merge branch '1681-compile-error-geoip_test-c-maxminddb-h-file-not-found' into 'master'
Resolve "compile error: geoip_test.c - maxminddb.h file not found"

Closes #1681

See merge request isc-projects/bind9!3233
2020-03-16 07:50:16 +00:00
Mark Andrews
81a80274bd Add MAXMINDDB_CFLAGS to CINCLUDES 2020-03-16 16:15:03 +11:00
Mark Andrews
402c0b26f7 Merge branch '1676-address-timing-issue-in-forward-system-test' into 'master'
Resolve "Address timing issue in forward system test."

Closes #1676

See merge request isc-projects/bind9!3221
2020-03-15 23:30:46 +00:00
Mark Andrews
a38a324442 wait for the reply message before checking to avoid false negative.
Waiting for the reply message will ensure that all messages being
looked for exist in the logs at the time of checking.  When the
test was only waiting for the send message there was a race between
grep and the ns1 instance of named logging that it had seen the
request.
2020-03-16 09:50:45 +11:00
Mark Andrews
9660ec80df Merge branch '1655-bind-9-11-5-writes-syntax-errors-to-its-zone-cache' into 'master'
Resolve "BIND 9.11.5 writes syntax errors to its zone cache"

Closes #1655

See merge request isc-projects/bind9!3150
2020-03-13 04:00:26 +00:00
Mark Andrews
c9c59db5b3 Add CHANGES note 2020-03-13 13:40:15 +11:00
Mark Andrews
59498ce17f Quote zone name so that specials are handled 2020-03-13 13:38:56 +11:00
Mark Andrews
91efc587b2 Pass NUL terminated buffer name to cfg_parse_buffer 2020-03-13 13:38:56 +11:00
Mark Andrews
ad030332bd Test reloading of zones with special 2020-03-13 13:38:56 +11:00
Mark Andrews
fed5992b31 Merge branch 'marka-maybe-silence-missing-unlock' into 'master'
Silence missing unlock from Coverity.

See merge request isc-projects/bind9!3185
2020-03-13 02:14:14 +00:00
Mark Andrews
8dd8d48c9f Silence missing unlock from Coverity.
Save 'i' to 'locknum' and use that rather than using
'header->node->locknum' when performing the deferred
unlock as 'header->node->locknum' can theoretically be
different to 'i'.
2020-03-13 12:42:52 +11:00
Mark Andrews
462a46cf50 Merge branch '1652-nslookup-assertion-at-soa_6-c-302-require-rdata-length-0-failed-back-trace' into 'master'
Resolve "nslookup: assertion at soa_6.c:302: REQUIRE(rdata->length != 0) failed, back trace"

Closes #1652

See merge request isc-projects/bind9!3136
2020-03-13 00:44:24 +00:00
Mark Andrews
6593cf0b5a Check that dig/host/nslookup handle a UPDATE response.
Additionally check that "delete $qname SOA" in the update
reponse doesn't trigger a insertion in nslookup.
2020-03-13 10:29:43 +11:00
Mark Andrews
bb7576cc9b Report opcode mismatch 2020-03-13 10:28:18 +11:00
Mark Andrews
4a7b9dba61 turn off best effort processing in host and add the ability to specify the port 2020-03-13 10:28:18 +11:00
Mark Andrews
d1cb30e747 turn off best effort processing in nslookup 2020-03-13 10:28:18 +11:00
Ondřej Surý
386ceaac7b Merge branch '1672-stop-leaking-external-headers-and-symbols-to-the-public-api-isc/hmac.h' into 'master'
Make isc_hmac API to not leak OpenSSL symbols

See merge request isc-projects/bind9!3216
2020-03-12 21:22:46 +00:00
Ondřej Surý
70100c664a Stop leaking OpenSSL types and defines in the isc/hmac.h
The <isc/md.h> header directly included <openssl/hmac.h> header which
enforced all users of the libisc library to explicitly list the include
path to OpenSSL and link with -lcrypto.  By hiding the specific
implementation into the private namespace, we no longer enforce this.
In the long run, this might also allow us to switch cryptographic
library implementation without affecting the downstream users.
2020-03-12 22:22:03 +01:00
Ondřej Surý
b04eda7212 Merge branch '1672-stop-leaking-external-headers-and-symbols-to-the-public-api-isc/safe.h' into 'master'
Make isc_safe API to not leak OpenSSL symbols

See merge request isc-projects/bind9!3215
2020-03-12 19:07:51 +00:00
Ondřej Surý
ab827ab5bf Stop leaking OpenSSL types and defines in the isc/safe.h
The two "functions" that isc/safe.h declared before were actually simple
defines to matching OpenSSL functions.  The downside of the approach was
enforcing all users of the libisc library to explicitly list the include
path to OpenSSL and link with -lcrypto.  By hiding the specific
implementation into the private namespace changing the defines into
simple functions, we no longer enforce this.  In the long run, this
might also allow us to switch cryptographic library implementation
without affecting the downstream users.
2020-03-12 20:07:16 +01:00
Ondřej Surý
c34b9364c0 Merge branch '1673-lib-isc-pk11-c-depend-on-libdns-headers' into 'master'
Use ISC_R_CRYPTOFAILURE instead DST_R_CRYPTOFAILURE in libisc

Closes #1673

See merge request isc-projects/bind9!3220
2020-03-12 19:05:29 +00:00
Ondřej Surý
e67ce7e966 Use ISC_R_CRYPTOFAILURE instead DST_R_CRYPTOFAILURE in libisc
There was a circular libisc dependency on libdns headers for
DST_R_CRYPTOFAILURE return code.  Replace it with ISC_R_CRYPTOFAILURE to
break the loop.
2020-03-12 17:50:29 +01:00
Evan Hunt
bc10d88c25 Merge branch '864-zone-type-table-in-arm-needs-improvement' into 'master'
Resolve "zone type table in ARM needs improvement"

Closes #864

See merge request isc-projects/bind9!1544
2020-03-12 08:48:23 +00:00
Evan Hunt
b10bdb57ac build doc 2020-03-12 01:14:07 -07:00
Evan Hunt
6fb568caae improve readability of bibliogrpahy
Change <biblioentry> and <citetitle> sections to improve the readability
of the bibliography sections. Thanks to Sun Guonian.
2020-03-12 01:14:07 -07:00
Evan Hunt
d9a6fef020 shorten text for mirror zones to prevent overspill 2020-03-12 01:14:07 -07:00
Mark Andrews
9e4a153f3b use relative widths for zone table 2020-03-12 01:14:07 -07:00
Evan Hunt
bf38b4af11 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!3214
2020-03-12 07:37:05 +00:00
Evan Hunt
9a8865d674 placeholder 2020-03-12 00:36:23 -07:00
Ondřej Surý
7db8b25b63 Merge branch '4-make-libtool-mandatory' into 'master'
Remove no-libtool and internal symtable configure options

See merge request isc-projects/bind9!3207
2020-03-11 23:07:53 +00:00
Ondřej Surý
e847591867 Improve the backtrace to print symbols when backtrace_symbols() is available
The previous commit removed the code related to the internal symbol
table.  On platforms where available, we can now use backtrace_symbols()
to print more verbose symbols table to the output.

As there's now general availability of backtrace() and
backtrace_symbols() functions (see below), the commit also removes the
usage of glibc internals and the custom stack tracing.

* backtrace(), backtrace_symbols(), and backtrace_symbols_fd() are
  provided in glibc since version 2.1.
* backtrace(), backtrace_symbols(), and backtrace_symbols_fd() first
  appeared in Mac OS X 10.5.
* The backtrace() library of functions first appeared in NetBSD 7.0 and
  FreeBSD 10.0.
2020-03-11 20:32:21 +01:00
Evan Hunt
ad5250ff9c Remove support for internal symbol table
Since we can no longer generate an internal symbol table, there
doesn't seem to be much reason to retain the code that reads it.
2020-03-11 11:13:52 +01:00
Ondřej Surý
1628f5865a Remove configure option to compile without libtool
libtool is a requirement to use automake (see GL #4), so this commit
removes the ability to compile BIND 9 without libtool.
2020-03-11 10:31:51 +01:00
Ondřej Surý
c463808992 Remove the ability to generate internal symbol table
The internal symbol table cannot be generated when libtool is in use,
which is going to be a mandatory in the next commit.
2020-03-11 10:31:42 +01:00
Ondřej Surý
e19117b5a9 Merge branch 'ondrej/fix-clang-format-headers-symlinks' into 'master'
Fix .clang-format.headers symlinks

See merge request isc-projects/bind9!3212
2020-03-11 09:21:07 +00:00
Ondřej Surý
584fd98a0c Fixup the headers formatting 2020-03-11 10:19:32 +01:00
Ondřej Surý
1ca73f606e Fix the deeper symlinks to .clang-format.headers 2020-03-11 10:16:45 +01:00
Michał Kępień
f137baf6be Merge branch 'michal/minor-release-note-tweaks' into 'master'
Minor release note tweaks

See merge request isc-projects/bind9!3210
2020-03-11 08:52:35 +00:00
Michał Kępień
6537aaffdc Reorder release note sections 2020-03-11 09:45:31 +01:00
Michał Kępień
3e6ef80706 Add GitLab identifier to rwlock release note 2020-03-11 09:45:31 +01:00
Michał Kępień
02260826cf Merge branch '1636-add-release-note-about-controlling-source-ports' into 'master'
Add release note about controlling source ports

Closes #1636

See merge request isc-projects/bind9!3192
2020-03-11 08:22:53 +00:00
Michał Kępień
384b413dc5 Add release note about controlling source ports 2020-03-11 09:06:40 +01:00
Michał Kępień
2283d38ac2 Release note wording tweaks 2020-03-11 09:06:40 +01:00
Michał Kępień
f8a8eaba8b Move pthread rwlocks release note to a section 2020-03-11 09:06:40 +01:00
Michał Kępień
182e4a67bc Merge branch 'matthijs-disable-mscv-kasp-system-test' into 'master'
Disable kasp test on Windows

See merge request isc-projects/bind9!3206
2020-03-11 07:18:49 +00:00
Matthijs Mekking
2094e5ed4d Remove leftover set_keydir 2020-03-10 16:04:13 +01:00
Matthijs Mekking
4e610b7f6b Disable kasp test on Windows
The kasp system test is timing critical.  The test passes on all
Linux based machines, but fails frequently on Windows.  The test
takes a lot more time on Windows and at the final checks fail
because the expected next key event is too far off.  For example:

I:kasp:check next key event for zone step2.algorithm-roll.kasp (570)
I:kasp:error: bad next key event time 20909 for zone \
  step2.algorithm-roll.kasp (expect 21600)
I:kasp:failed

This is because the kasp system test calculates the time when the
next key event should occur based on the policy.  This assumes that
named is able to do key management within a minute.  But starting,
named, doing key management for other zones, and reconfiguring takes
much more time on Windows and thus the next key event on Windows is
much shorter than anticipated.

That this happens is a good thing because this means that the
correct next key event is used, but is not so nice for testing, as
it is hard to determine how much time named needed before finishing
the current key event.

Disable the kasp test on Windows now because it is blocking the
release.  We know the cause of these test failures, and it is clear
that this is a fault in the test, not the code.  Therefore we feel
comfortable disabling the test right now and work on a fix while
unblocking the release.
2020-03-10 16:04:13 +01:00
Matthijs Mekking
546acaad0e Merge branch '1476-threadsanitizer-data-race-lib-isc-log-multiple-issues' into 'master'
Resolve "ThreadSanitizer: data race lib/isc/log.c - multiple issues"

Closes #1476

See merge request isc-projects/bind9!2791
2020-03-10 12:11:19 +00:00
Diego Fronza
a200852001 Fixed data race in log.c
A data race was happening while BIND was starting due to
isc_log_wouldlog function accessing lctx->logconfig without a lock.

To prevent that without incurring much costs, that variable was made
atomic.
2020-03-10 11:49:53 +01:00
Michal Nowak
6d252220b0 Merge branch 'mnowak/abi-tracker-helper' into 'master'
Add API Checker

See merge request isc-projects/bind9!3120
2020-03-10 08:47:04 +00:00
Michal Nowak
49bc08e612 Add API Checker
ABI checker tools generate HTML and TXT API compatibility reports of
BIND libraries. Comparison is being done between two bind source trees
which hold built BIND.

In the CI one version is the reference version defined by
BIND_BASELINE_VERSION variable, the latter one is the HEAD of branch
under test.
2020-03-10 09:44:26 +01:00
Evan Hunt
e0430d74ef Merge branch '1664-double-unlock' into 'master'
remove redundant ZONEDB_UNLOCK

Closes #1664

See merge request isc-projects/bind9!3197
2020-03-09 23:47:11 +00:00
Evan Hunt
b54454b7c6 remove redundant ZONEDB_UNLOCK 2020-03-09 14:05:14 -07:00
Ondřej Surý
8de25592ba Merge branch 'ondrej/clang-format-improve-includes' into 'master'
Improve #include block sorting and grouping in clang-format

See merge request isc-projects/bind9!3193
2020-03-09 15:42:24 +00:00
Ondřej Surý
3178974f0c Use the new sorting rules to regroup #include headers 2020-03-09 16:19:22 +01:00
Ondřej Surý
5071c47fbd Improve the #include block sorting
The IncludeCategories was incomplete, it missed pk11/ and dst/ headers
and the rule that put "" header after all <> headers was broken.
2020-03-09 16:19:22 +01:00
Matthijs Mekking
fd18da8cac Merge branch '1653-dnssec-policy-view-race' into 'master'
Resolve "Race condition with dnssec-policy, same zone in different views"

Closes #1653

See merge request isc-projects/bind9!3142
2020-03-09 14:40:59 +00:00
Matthijs Mekking
47e42d5750 Update changes, documentation 2020-03-09 14:48:17 +01:00
Matthijs Mekking
e0bdff7ecd Fix race condition dnssec-policy with views
When configuring the same dnssec-policy for two zones with the same
name but in different views, there is a race condition for who will
run the keymgr first. If running sequential only one set of keys will
be created, if running parallel two set of keys will be created.

Lock the kasp when running looking for keys and running the key
manager. This way, for the same zone in different views only one
keyset will be created.

The dnssec-policy does not implement sharing keys between different
zones.
2020-03-09 14:48:17 +01:00
Michał Kępień
5979032512 Merge branch 'michal/do-not-run-openbsd-system-test-jobs-for-tags' into 'master'
Do not run OpenBSD system test jobs for tags

See merge request isc-projects/bind9!3183
2020-03-09 13:33:59 +00:00
Michał Kępień
7b002cea83 Do not run OpenBSD system test jobs for tags
OpenBSD virtual machines seem to affected particularly badly by other
activity happening on the host.  This causes trouble around release
time: when multiple tags are pushed to the repository, a large number of
jobs is started concurrently on all CI runners.  In extreme cases, this
causes the system test suite to run for about an hour (!) on OpenBSD
VMs, with multiple tests failing.  We investigated the test artifacts
for all such cases in the past and the outcome was always the same: test
failures were caused by extremely slow I/O on the guest.  We tried
various tricks to work around this problem, but nothing helped.

Given the above, stop running OpenBSD system test jobs for pending BIND
releases to prevent the results of these jobs from affecting the
assessment of a given release's readiness for publication.  This change
does not affect OpenBSD build jobs.  OpenBSD system test jobs will still
be run for scheduled and web-requested pipelines, to make sure we catch
any severe issues with test code on that platform sooner or later.
2020-03-09 14:33:04 +01:00
Matthijs Mekking
35b911de93 Merge branch 'matthijs-refactor-kasp-test' into 'master'
Refactor kasp system test

See merge request isc-projects/bind9!3141
2020-03-09 12:22:56 +00:00
Matthijs Mekking
2e4b55de85 Add check calls to kasp zsk-retired test
The test case for zsk-retired was missing the actual checks.  Add
them and fix the set_policy call to expect three keys.
2020-03-09 13:02:23 +01:00
Matthijs Mekking
7e54dd74f9 More consistent spacing and comments
Some comments started with a lowercased letter. Capitalized them to
be more consistent with the rest of the comments.

Add some newlines between `set_*` calls and check calls, also to be
more consistent with the other test cases.
2020-03-09 13:02:23 +01:00
Matthijs Mekking
f500b16f83 Replace key_states 2020-03-09 13:02:23 +01:00
Matthijs Mekking
32e4916c59 Replace key_timings 2020-03-09 13:02:22 +01:00
Matthijs Mekking
628e09a423 Replace key_properties 2020-03-09 13:02:22 +01:00
Matthijs Mekking
8a4787d585 Replace zone_properties 2020-03-09 13:02:22 +01:00
Matthijs Mekking
9aa23bd42a Merge branch '1413-fix-dnssec-test' into 'master'
Fix dnssec test

Closes #1413

See merge request isc-projects/bind9!2956
2020-03-09 11:02:10 +00:00
Matthijs Mekking
aebb2aaa0f Fix dnssec test
There is a failure mode which gets triggered on heavily loaded
systems. A key change is scheduled in 5 seconds to make ZSK2 inactive
and ZSK3 active, but `named` takes more than 5 seconds to progress
from `rndc loadkeys` to the query check. At this time the SOA RRset
is already signed by the new ZSK which is not expected to be active
at that point yet.

Split up the checks to test the case where RRsets are signed
correctly with the offline KSK (maintained the signature) and
the active ZSK.  First run, RRsets should be signed with the still
active ZSK2, second run RRsets should be signed with the new active
ZSK3.
2020-03-09 10:16:55 +01:00
Diego dos Santos Fronza
74e5889537 Merge branch 'fix-glob-windows' into 'master'
Fixed missing list initialization

See merge request isc-projects/bind9!3184
2020-03-06 21:09:58 +00:00
Diego Fronza
6e5b4f7ec8 Fixed missing list initialization
This commit fixes isc_glob function on windows environments.

The file_list_t * object pointed to by pglob->reserved was missing
ISC_LIST_INIT intialization macro.
2020-03-06 16:53:20 -03:00
Matthijs Mekking
a1849cea53 Merge branch 'kasp-test-algoroll' into 'master'
Test dnssec-policy algorithm rollover, fix some bugs

Closes #1626, #1625, and #1624

See merge request isc-projects/bind9!3086
2020-03-06 15:16:19 +00:00
Matthijs Mekking
d16520532f Add additional wait period for algorithm rollover
We may be checking the algorithm steps too fast: the reconfig
command may still be in progress. Make sure the zones are signed
and loaded by digging the NSEC records for these zones.
2020-03-06 15:57:48 +01:00
Matthijs Mekking
53bd81ad19 Make clang-format happy 2020-03-06 15:57:48 +01:00
Matthijs Mekking
6ddfed3de0 update CHANGES 2020-03-06 15:57:48 +01:00
Matthijs Mekking
917cf5f86f Add CSK algorithm rollover test 2020-03-06 15:53:57 +01:00
Matthijs Mekking
3905a03205 [#1624] dnssec-policy change retire unwanted keys
When changing a dnssec-policy, existing keys with properties that no
longer match were not being retired.
2020-03-06 15:53:57 +01:00
Matthijs Mekking
28506159f0 [#1625] Algorithm rollover waited too long
Algorithm rollover waited too long before introducing zone
signatures.  It waited to make sure all signatures were resigned,
but when introducing a new algorithm, all signatures are resigned
immediately.  Only add the sign delay if there is a predecessor key.
2020-03-06 15:53:57 +01:00
Matthijs Mekking
a8542b8cab [#1626] Fix stuck algorithm rollover
Algorithm rollover was stuck on submitting DS because keymgr thought
it would move to an invalid state.  It did not match the current
key because it checked it against the current key in the next state.
Fixed by when checking the current key, check it against the desired
state, not the existing state.
2020-03-06 15:53:57 +01:00
Matthijs Mekking
88ebe9581b Add algorithm rollover test case
Add a test case for algorithm rollover.  This is triggered by
changing the dnssec-policy.  A new nameserver ns6 is introduced
for tests related to dnssec-policy changes.

This requires a slight change in check_next_key_event to only
check the last occurrence.  Also, change the debug log message in
lib/dns/zone.c to deal with checks when no next scheduled key event
exists (and default to loadkeys interval 3600).
2020-03-06 15:53:57 +01:00
Matthijs Mekking
cc2afe853b Remove unneeded step6 zone
The zone 'step6.ksk-doubleksk.autosign' is configured but is not
set up nor tested.  Remove the unneeded configured zone.
2020-03-06 15:53:57 +01:00
Matthijs Mekking
fdb3f6f400 Introduce enable dnssec test case 2020-03-06 15:53:57 +01:00
Matthijs Mekking
00ced2d2e7 Prepare kasp for algorithm rollover test
Algorithm rollover will require four keys so introduce KEY4.
Also it requires to look at key files for multiple algorithms so
change getting key ids to be algorithm rollover agnostic (adjusting
count checks).  The algorithm will be verified in check_key so
relaxing 'get_keyids' is fine.

Replace '${_alg_num}' with '$(key_get KEY[1-4] ALG_NUM)' in checks
to deal with multiple algorithms.
2020-03-06 15:53:57 +01:00
Michał Kępień
526907dc13 Merge branch 'michal/fix-using-sibling-root-libuv-for-windows-builds' into 'master'
Fix using sibling-root libuv for Windows builds

See merge request isc-projects/bind9!3181
2020-03-06 12:36:55 +00:00
Michał Kępień
57b430b8ca Fix using sibling-root libuv for Windows builds
HAVE_UV_IMPORT and other config.h macros must not be set unconditionally
because no existing libuv release exposes uv_import() and/or uv_export()
yet.  Windows builds not passing an explicit path to libuv to
win32utils/Configure are currently broken because of this, so comment
out the offending lines and describe when the aforementioned config.h
macros should be set.
2020-03-06 13:25:45 +01:00
Evan Hunt
078d937ff8 Merge branch '1515-ixfr-size-limit' into 'master'
Send AXFR instead of requested IXFR if the size of the incremental transfer is too large to sensibly IXFR

Closes #1375 and #1515

See merge request isc-projects/bind9!3113
2020-03-06 02:51:18 +00:00
Evan Hunt
0a39181092 CHANGES and release note 2020-03-05 17:20:16 -08:00
Evan Hunt
89615c2ab5 add serial number to "transfer ended" log messages 2020-03-05 17:20:16 -08:00
Evan Hunt
db177d4e7e add a system test for AXFR fallback when max-ixfr-ratio is exceeded
also cleaned up the ixfr system test:

- use retry_quiet when applicable
- use scripts to generate test zones
- improve consistency
2020-03-05 17:20:16 -08:00
Evan Hunt
cb02219b6c check size ratio when responding to IXFR requests 2020-03-05 17:20:16 -08:00
Evan Hunt
98b55eb442 improve calculation of database transfer size
- change name of 'bytes' to 'xfrsize' in dns_db_getsize() parameter list
  and related variables; this is a more accurate representation of what
  the function is doing
- change the size calculations in dns_db_getsize() to more accurately
  represent the space needed for a *XFR message or journal file to contain
  the data in the database. previously we returned the sizes of all
  rdataslabs, including header overhead and offset tables, which
  resulted in the database size being reported as much larger than the
  equivalent *XFR or journal.
- map files caused a particular problem here: the fullname can't be
  determined from the node while a file is being deserialized, because
  the uppernode pointers aren't set yet. so we store "full name length"
  in the dns_rbtnode structure while serializing, and clear it after
  deserialization is complete.
2020-03-05 17:20:16 -08:00
Evan Hunt
52a31a9883 dns_journal_iter_init() can now return the size of the delta
the call initailizing a journal iterator can now optionally return
to the caller the size in bytes of an IXFR message (not including
DNS header overhead, signatures etc) containing the differences from
the beginning to the ending serial number.

this is calculated by scanning the journal transaction headers to
calculate the transfer size. since journal file records contain a length
field that is not included in IXFR messages, we subtract out the length
of those fields from the overall transaction length.

this necessitated adding an "RR count" field to the journal transaction
header, so we know how many length fields to subract. NOTE: this will
make existing journal files stop working!
2020-03-05 17:20:16 -08:00
Evan Hunt
aeef4719e9 add syntax and setter/getter functions to configure max-ixfr-ratio 2020-03-05 17:20:16 -08:00
Evan Hunt
5a23e7abd1 document max-ixfr-ratio 2020-03-05 17:20:16 -08:00
Mark Andrews
e2f521e772 Merge branch '1628-release-process-failed-to-detect-that-header-file-was-not-installed' into 'master'
Resolve "Release process failed to detect that header file was not installed."

Closes #1628

See merge request isc-projects/bind9!3089
2020-03-06 01:04:07 +00:00
Mark Andrews
a278b6bd84 test installed header files 2020-03-06 12:02:57 +11:00
Mark Andrews
5a95f9b0ec Merge branch 'marka-install-missing-header-files' into 'master'
Fix lists of installed header files

See merge request isc-projects/bind9!3173
2020-03-05 23:10:53 +00:00
Michał Kępień
b675d30f09 Fix lists of installed header files 2020-03-05 23:09:51 +00:00
Witold Krecicki
a5e8479153 Merge branch 'wpk/only-use-timer-if-initialized' into 'master'
Only use tcpdns timer if it's initialized.

See merge request isc-projects/bind9!3171
2020-03-05 23:08:02 +00:00
Witold Kręcicki
4b9962d4a3 Only use tcpdns timer if it's initialized. 2020-03-05 23:13:39 +01:00
Mark Andrews
a249bb5b10 Merge branch 'marka-sort-AC_CONFIG_FILES' into 'master'
sort AC_CONFIG_FILES

See merge request isc-projects/bind9!3167
2020-03-05 21:47:02 +00:00
Mark Andrews
fd0d4ba948 sort AC_CONFIG_FILES 2020-03-06 08:17:06 +11:00
Witold Krecicki
5c723402f4 Merge branch '1643-tcp-connections-accounting' into 'master'
Resolve "Problems reported in BIND 9.16.0 after hitting tcp-clients limit"

Closes #1643

See merge request isc-projects/bind9!3163
2020-03-05 20:31:04 +00:00
Witold Kręcicki
d2445310e2 CHANGES note 2020-03-05 18:02:27 +00:00
Witold Kręcicki
ae1499ca19 Fix TCPDNS socket closing issues 2020-03-05 18:02:27 +00:00
Evan Hunt
1383804597 add a test of normal TCP query behavior before and after high-water test 2020-03-05 18:02:27 +00:00
Witold Kręcicki
fc9792eae8 Limit TCP connection quota logging to 1/s 2020-03-05 18:02:27 +00:00
Witold Kręcicki
fc9e2276ca Proper accounting of active TCP connections 2020-03-05 18:02:27 +00:00
Michal Nowak
71b05e3e0f Merge branch 'mnowak/respdiff' into 'master'
Add respdiff test

See merge request isc-projects/bind9!3078
2020-03-05 14:45:46 +00:00
Michal Nowak
04f8b65a8f Add respdiff job
This job leverages respdiff test from the private bind-qa repo.
2020-03-05 10:32:45 +01:00
Witold Krecicki
22f0b633e5 Merge branch '1650-fix-race-in-killoldestclient' into 'master'
Destroy query in killoldestclient under a lock

Closes #1650

See merge request isc-projects/bind9!3146
2020-03-05 09:02:11 +00:00
Witold Kręcicki
df3dbdff81 Destroy query in killoldestquery under a lock.
Fixes a race between ns_client_killoldestquery and ns_client_endrequest -
killoldestquery takes a client from `recursing` list while endrequest
destroys client object, then killoldestquery works on a destroyed client
object. Prevent it by holding reclist lock while cancelling query.
2020-03-05 08:13:50 +00:00
Evan Hunt
4c0591574f Merge branch '1647-addtrustedkey-dnskey' into 'master'
Resolve "delv 9.16.0, failed to add trusted key '.': ran out of space"

Closes #1647

See merge request isc-projects/bind9!3158
2020-03-04 23:41:11 +00:00
Evan Hunt
d805fe821e CHANGES 2020-03-04 09:28:37 -08:00
Evan Hunt
a81ae32d8a add a system test to check that delv loads trust anchors correctly 2020-03-04 08:59:29 -08:00
Tony Finch
689ef89b67 Fix dns_client_addtrustedkey(dns_rdatatype_dnskey)
Use a buffer that is big enough for DNSKEY records as well as DS
records.
2020-03-04 08:59:29 -08:00
Michal Nowak
239e1c5309 Merge branch 'mnowak/pkcs11-test-fix' into 'master'
Fix pkcs11 test

Closes #1496

See merge request isc-projects/bind9!3116
2020-03-04 16:06:31 +00:00
Michal Nowak
85cb3a214f Fix "pkcs11" system test
- Define the SLOT environment variable before starting the test.  This
    variable defaults to 0 and that does not work with SoftHSM 2.

  - The system test expects the PIN environment variable to be set to
    "1234" while bin/tests/prepare-softhsm2.sh sets it to "0000".
    Update bin/tests/prepare-softhsm2.sh so that it sets the PIN to
    "1234".

  - Move contents of bin/tests/system/pkcs11/prereq.sh to
    bin/tests/system/pkcs11/setup.sh as the former was creating a file
    called "supported" that was getting removed by the latter before
    bin/tests/system/pkcs11/tests.sh could access it.

  - Fix typo in "have_ecx".
2020-03-04 16:06:31 +00:00
Witold Krecicki
7509e22725 Merge branch 'wpk-use-pthread-rwlock-by-default' into 'master'
Use pthread rwlocks by default

See merge request isc-projects/bind9!3125
2020-03-04 09:50:56 +00:00
Witold Kręcicki
4ca5c02d0e Add release notes for pthread rwlocks change 2020-03-04 10:28:22 +01:00
Witold Kręcicki
ad03c22e97 Use pthread rwlocks by default 2020-03-04 10:28:22 +01:00
Evan Hunt
bae860d20a Merge branch '1532-nta-validate-except' into 'master'
list "validate-except" entries in "rndc nta -d" and "rndc secroots"

Closes #1532

See merge request isc-projects/bind9!3152
2020-03-04 09:09:53 +00:00
Evan Hunt
7a3fa9f593 list "validate-except" entries in "rndc nta -d" and "rndc secroots"
- no longer exclude these entries when dumping the NTA table
- indicate "validate-except" entries with the keyword "permanent" in
  place of an expiry date
- add a test for this feature, and update other tests to account for
  the presence of extra lines in some rndc outputs
- incidentally removed the unused function dns_ntatable_dump()
- CHANGES, release note
2020-03-04 00:44:32 -08:00
Mark Andrews
13073c95d3 Merge branch '1656-masterformat-system-test-failed-missing-sleep-1' into 'master'
Resolve "masterformat system test failed - missing "sleep 1""

Closes #1656

See merge request isc-projects/bind9!3151
2020-03-04 07:14:48 +00:00
Mark Andrews
0abcface49 properly wait for zone to be loaded 2020-03-04 15:39:08 +11:00
Mark Andrews
5cc912b031 Merge branch 'marka-check-touched' into 'master'
Check that inline master zones that are only touched are correctly reloaded.

Closes #1627

See merge request isc-projects/bind9!3135
2020-03-03 22:06:39 +00:00
Mark Andrews
64474db14e Add CHANGES entry 2020-03-04 08:46:33 +11:00
Mark Andrews
f171347b5f Restart zone maintenance if it had been stalled. 2020-03-04 08:45:34 +11:00
Mark Andrews
50e079d6c3 Check inline master zones that are touched reload correctly. 2020-03-04 08:45:34 +11:00
Ondřej Surý
bb74fdcaf0 Merge branch 'ondrej/fix-notes-9.17.0-xml' into 'master'
fixup the version number in 9.17.0 release notes

See merge request isc-projects/bind9!3145
2020-03-03 14:24:17 +00:00
Ondřej Surý
3357574843 fixup the version number in 9.17.0 release notes 2020-03-03 09:31:34 +01:00
Witold Krecicki
3a21933586 Merge branch 'wpk/socket-destroy-race' into 'master'
Fix a race in isc_socket destruction.

Closes #1651

See merge request isc-projects/bind9!3004
2020-03-03 08:20:44 +00:00
Witold Kręcicki
81ba0fe0e6 Fix a race in isc_socket destruction.
There was a very slim chance of a race between isc_socket_detach and
process_fd: isc_socket_detach decrements references to 0, and before it
calls destroy gets preempted. Second thread calls process_fd, increments
socket references temporarily to 1, and then gets preempted, first thread
then hits assertion in destroy() as the reference counter is now 1 and
not 0.
2020-03-03 08:34:19 +01:00
Mark Andrews
3c15372c2b Merge branch '1627-call-set_resigntime-and-zone_settimer' into 'master'
Call set resigntime and zone settimer

Closes #1627

See merge request isc-projects/bind9!3137
2020-03-03 05:07:58 +00:00
Mark Andrews
23ce0f32e5 add release note entry 2020-03-03 15:37:42 +11:00
Mark Andrews
905549f061 Add CHANGES note 2020-03-03 15:30:52 +11:00
Ondřej Surý
aaaa7e67fa Adjust lock/unlock in zone_rekey() 2020-03-03 15:26:31 +11:00
Mark Andrews
a6626594aa Ensure that resigintime and the zone timer are set 2020-03-03 15:26:27 +11:00
Matthijs Mekking
143d1c9767 Add more zone locks
Add more zone locks around code that touches zone timer setting
in failure modes.
2020-03-03 15:26:27 +11:00
Mark Andrews
7212961849 Always call set_resigntime with the zone lock held 2020-03-03 15:26:27 +11:00
Mark Andrews
5ec57f31b0 Always call zone_settimer()
zone_needdump() could potentially not call zone_settimer() so
explitly call zone_settimer() as zone->resigntime could have
gone backward.
2020-03-03 15:26:27 +11:00
Mark Andrews
5d1611afdc Call set_resigntime() in receive_secure_serial()
With RRSIG records no longer being signed with the full
sig-validity-interval we need to ensure the zone->resigntime
as it may need to be set to a earlier time.
2020-03-03 15:26:27 +11:00
Witold Krecicki
9aa84dabf9 Merge branch 'wpk/perfwork-7-multilocked-badcache' into 'master'
Badcache with multiple locks.

See merge request isc-projects/bind9!3076
2020-03-02 17:18:35 +00:00
Witold Kręcicki
6c8f309745 Workaround for clang static analyzer bug. 2020-03-02 14:12:05 +01:00
Witold Kręcicki
47e5f5564c Badcache with multiple locks.
Previously badcache used one single mutex for everything, which
was causing performance issues. Use one global rwlock for the whole
hashtable and per-bucket mutexes.
2020-03-02 12:13:09 +01:00
Michał Kępień
c309fcabec Merge branch '1640-add-ZLIB_LIBS-to-ISCLIBS' into 'master'
Add ZLIB_LIBS to ISCLIBS

Closes #1640

See merge request isc-projects/bind9!3117
2020-02-28 14:30:04 +00:00
Michał Kępień
fc967ba092 Add ZLIB_LIBS to ISCLIBS
When --with-zlib is passed to ./configure (or when the latter
autodetects zlib's presence), libisc uses certain zlib functions and
thus libisc's users should be linked against zlib in that case.  Adjust
Makefile variables appropriately to prevent shared build failures caused
by underlinking.
2020-02-28 15:22:29 +01:00
Witold Krecicki
74030a590f Merge branch 'wpk/perfwork-3-small-nits' into 'master'
Perfwork 3/6 - Various small nits and tunables

See merge request isc-projects/bind9!3067
2020-02-28 08:28:31 +00:00
Evan Hunt
0b76d8a490 comments 2020-02-28 08:46:16 +01:00
Witold Kręcicki
4b6a064972 Don't define NS_CLIENT_TRACE by default 2020-02-28 08:46:16 +01:00
Witold Kręcicki
4791263def Increase inactivehandles and inactivereqs size for better reuse. 2020-02-28 08:46:16 +01:00
Witold Kręcicki
0344684385 Increase nodelock count for both cache and regular db. 2020-02-28 08:46:16 +01:00
Witold Kręcicki
0d80266f7e Use RESOLVER_NTASKS_PERCPU - 32 for regular tuning, 8 for small 2020-02-28 08:46:16 +01:00
Witold Kręcicki
517e6eccdf use SO_INCOMING_CPU for UDP sockets 2020-02-28 08:46:16 +01:00
Witold Kręcicki
8c6c07286f Remove some stale fields from ns_client_t; make sendbuf allocated on heap 2020-02-28 08:46:16 +01:00
Witold Kręcicki
fe584c01cc Don't update LRU if the node was recently used.
Updating LRU requires write-locking the node, which causes contention.
Update LRU only if time difference is large enough.
2020-02-28 08:46:16 +01:00
Witold Kręcicki
a658f7976c We don't need to fill udp local address every time since we are bound to it. 2020-02-28 08:46:16 +01:00
Witold Kręcicki
938b61405b Don't check if the client is on recursing list (requires locking) if it's not RECURSING 2020-02-28 08:46:16 +01:00
Witold Kręcicki
eb874608c1 Use the original threadid when sending a UDP packet to decrease probability of context switching 2020-02-28 08:46:16 +01:00
Mark Andrews
c324230c6f Merge branch '1638-rrsig-soa-and-re-signing' into 'master'
Resolve "RRSIG(SOA) and re-signing."

Closes #1638

See merge request isc-projects/bind9!3114
2020-02-27 22:48:48 +00:00
Mark Andrews
88c828cb9f capture named-journalprint output 2020-02-27 22:30:14 +00:00
Mark Andrews
a24fd55836 sort RRSIG(SOA) to be last of RRSIGs with a common re-resign time 2020-02-27 22:30:14 +00:00
Mark Andrews
660dc3eba7 use the full sig-validity-interval for RRSIG(SOA) 2020-02-27 22:30:14 +00:00
Mark Andrews
563aff110e Merge branch 'marka-coverity-stop-taint' into 'master'
Simplify hash computation to prevent pointer being classed as tainted.

See merge request isc-projects/bind9!3081
2020-02-27 20:01:04 +00:00
Mark Andrews
8c983a7ebd Simplify hash computation to prevent pointer being classed as tainted.
mem.c:add_trace_entry() -> isc_hash_function() -> isc_siphash24()

129        for (; in != end; in += 8) {

	6. byte_swapping: Performing a byte swapping operation on
	in implies that it came from an external source, and is
	therefore tainted.

130                uint64_t m = U8TO64_LE(in);
2020-02-27 19:41:36 +00:00
Witold Krecicki
ebfb0f7392 Merge branch 'wpk/perfwork-5-isc-result-rwlock' into 'master'
Perfwork 5/6 - Use isc_rwlock for isc_result tables

See merge request isc-projects/bind9!3069
2020-02-27 09:48:11 +00:00
Witold Kręcicki
00f2146265 Use isc_rwlock for isc_result tables 2020-02-27 07:58:48 +00:00
Evan Hunt
d434ec89ce Merge branch 'each-speedup-serve-stale-test' into 'master'
Speed up serve-stale test

See merge request isc-projects/bind9!3090
2020-02-27 06:57:56 +00:00
Evan Hunt
195d25b222 send bursts of queries in parallel to reduce test runtime
sending each group of queries simultaneously, and then checking the
output after the last one finishes, reduces the runtime of the
serve-stale test by about six minutes.
2020-02-26 22:28:33 -08:00
Evan Hunt
027601cd3e stop testing 'serve-stale yes' and 'serve-fail no' alternate syntax
"yes" and "no" are permissible synonyms for "on" and "off", which
use exactly the same code paths. making sure they work isn't a good
use of 80 seconds of test time.
2020-02-26 22:28:33 -08:00
Evan Hunt
770bf4980f use "on|off" in rndc -h output to match the man page 2020-02-26 22:28:33 -08:00
Witold Krecicki
027f445c66 Merge branch '1623-assertion-failure-ns-client-endrequest' into 'master'
Don't issue ns_client_endrequest on a NS_CLIENTSTATE_READY client.

Closes #1623

See merge request isc-projects/bind9!3077
2020-02-26 12:35:19 +00:00
Witold Kręcicki
b0888ff039 Don't issue ns_client_endrequest on a NS_CLIENTSTATE_READY client.
Fix a potential assertion failure on shutdown in ns__client_endrequest.
Scenario:
1. We are shutting down, interface->clientmgr is gone.
2. We receive a packet, it gets through ns__client_request
3. mgr == NULL, return
4. isc_nmhandle_detach calls ns_client_reset_cb
5. ns_client_reset_cb calls ns_client_endrequest
6. INSIST(client->state == NS_CLIENTSTATE_WORKING ||
          client->state == NS_CLIENTSTATE_RECURSING) is not met
   - we haven't started processing this packet so
   client->state == NS_CLIENTSTATE_READY.
As a solution - don't do anything in ns_client_reset_cb if the client
is still in READY state.
2020-02-26 12:15:01 +00:00
Witold Krecicki
6d67e06665 Merge branch 'wpk/perfwork-4-compressctx-arena' into 'master'
Perfwork 4/6 - add an arena to compressctx

See merge request isc-projects/bind9!3068
2020-02-26 08:17:28 +00:00
Witold Kręcicki
3a3b5f557a Add an arena to compressctx 2020-02-26 07:57:44 +00:00
Evan Hunt
9e7c37ba13 Merge branch 'each-cosmetic-fixes' into 'master'
minor cosmetic fixes

See merge request isc-projects/bind9!3085
2020-02-25 19:05:53 +00:00
Evan Hunt
beda680f90 minor cosmetic fixes
- the configuration summary reported zlib compression was not
  supported even when it was.
- when bind.keys.h was regenerated it violated clang-format style.
2020-02-25 18:24:41 +00:00
Matthijs Mekking
9a53720502 Merge branch '103-include-multiple-files' into 'master'
Resolve "[RT#43439 'include' a whole directory when creating BIND zone file"

Closes #103

See merge request isc-projects/bind9!2296
2020-02-25 12:17:33 +00:00
Matthijs Mekking
5cc33084af Make clang-format happy 2020-02-25 09:07:45 +01:00
Diego Fronza
3275e7844b Update copyrights 2020-02-24 13:53:32 -03:00
Matthijs Mekking
44caa64f39 Add test for checkconf glob include 2020-02-24 13:48:48 -03:00
Diego Fronza
f67ef86048 Update configure to handle glob.h 2020-02-24 13:46:42 -03:00
Diego Fronza
9b4e28e155 Added a isc_glob() function that wraps glob() calls for POSIX systems
and implement a custom glob() function on Windows systems.
2020-02-24 13:46:39 -03:00
Diego Fronza
f97ba7a7c2 Added test to verify that both include glob-expression and include
non-glob-expression works.
2020-02-24 13:37:55 -03:00
Diego dos Santos Fronza
a50ab3df86 Added tests for include directive + glob expressions. 2020-02-24 13:37:51 -03:00
Diego dos Santos Fronza
fa3fbf62e8 Allowing include directive to use glob expressions, e.g. include
"/opt/named.conf/*.conf".
2020-02-24 13:35:20 -03:00
Michał Kępień
e5eac7f117 Merge branch 'michal/misc-9.17-preparations' into 'master'
Miscellaneous BIND 9.17 preparations

See merge request isc-projects/bind9!3108
2020-02-24 10:03:07 +00:00
Evan Hunt
89ff6cabf9 Rebuild documentation 2020-02-23 20:48:55 -08:00
Michał Kępień
b273ed8a63 Bump version to 9.17.0 2020-02-24 10:56:47 +01:00
Michał Kępień
9f34e0d5af Bump library API versions for BIND 9.17 2020-02-24 10:56:47 +01:00
Michał Kępień
5b7a34803f Add libuv information to win32utils/build.txt 2020-02-24 10:56:47 +01:00
Michał Kępień
9ad9c98021 Fix broken link in configure.ac 2020-02-24 10:56:47 +01:00
Michał Kępień
ca9e0113e7 Update PLATFORMS for BIND 9.17 2020-02-24 10:56:47 +01:00
Michał Kępień
ad8d44ed67 Update README and HISTORY for BIND 9.17 2020-02-24 10:56:47 +01:00
Michał Kępień
9ab9f0dde7 Update release notes for BIND 9.17.0 2020-02-24 10:56:47 +01:00
Evan Hunt
dafa8a3309 Merge branch '1632-spelling-take2' into 'master'
some Fossies-reported spelling errors were accidentally left unfixed

Closes #1632

See merge request isc-projects/bind9!3110
2020-02-21 22:14:32 +00:00
Evan Hunt
a2aa29ed4f some Fossies-reported spelling errors were accidentally left unfixed 2020-02-21 14:12:42 -08:00
Evan Hunt
2296df45d5 Merge branch 'each-dlz-build' into 'master'
fix build errors in DLZ modules

See merge request isc-projects/bind9!3092
2020-02-21 17:19:56 +00:00
Evan Hunt
a06620fe59 fix build errors in DLZ modules 2020-02-21 09:18:58 -08:00
Michał Kępień
bfa193ed97 Merge branch 'michal/clean-up-with-tuning-large-remnants' into 'master'
Clean up --with-tuning=large remnants

See merge request isc-projects/bind9!3071
2020-02-21 12:43:01 +00:00
Michał Kępień
a5fc3a6364 Clean up --with-tuning=large remnants
The change introduced by commit be159f5565
was not fully complete.  Adjust ./configure summary so that it reflects
the new way the --with-tuning switch works, fixing the Autoconf variable
used for determining the value of that switch.  Fix win32utils/Configure
so that it behaves the same way as its Unix counterpart.
2020-02-21 12:51:49 +01:00
Mark Andrews
86405d3bc1 Merge branch 'marka-fix-signature-test' into 'master'
Fix code to generate the test signatues.

See merge request isc-projects/bind9!3102
2020-02-21 06:36:34 +00:00
Mark Andrews
3a8c8a2a31 Fix code to generate the test signatues.
* ctx needs to be destroyed before it is regenerated.
* emit the name of the signature to be replaced.
* cleanup memory before asserting so post longjump doesn't detect a
  memory leak.
* comment code.
2020-02-20 22:28:58 -08:00
Evan Hunt
4ff87af38c Merge branch '1632-spelling' into 'master'
fix spelling errors reported by Fossies.

Closes #1632

See merge request isc-projects/bind9!3101
2020-02-21 06:28:09 +00:00
Mark Andrews
40fc5809cd update signatures 2020-02-21 15:05:08 +11:00
Evan Hunt
ba0313e649 fix spelling errors reported by Fossies. 2020-02-21 15:05:08 +11:00
Diego dos Santos Fronza
c13adf225e Merge branch '1279-named-compilezone-should-be-able-to-take-input-from-stdin' into 'master'
Resolve "named-compilezone should be able to take input from STDIN"

Closes #1279

See merge request isc-projects/bind9!2552
2020-02-20 15:26:51 +00:00
Diego Fronza
a3453c257b Added system test
Added a system test which ensures that named-checkzone works when
taking input data from stdin.
2020-02-20 11:19:13 -03:00
Diego Fronza
63c88f4a04 Enable named-checkzone and named-compilezone to take input from stdin
If a filename (the last argument) is not provided for named-checkzone or
named-compilezone, or if it is a single dash "-" character,
zone data will be read from stdin.

Example of invocation:
cat /etc/zone_name.db | named-compilezone -f text -F raw \
    -o zone_name.raw zone_name
2020-02-20 11:19:13 -03:00
Michał Kępień
121e9ddf97 Merge branch 'michal/make-a-sed-script-in-doc-arm-makefile.in-portable' into 'master'
Make a sed script in doc/arm/Makefile.in portable

See merge request isc-projects/bind9!3058
2020-02-20 11:26:33 +00:00
Michał Kępień
b25e6b51f6 Make a sed script in doc/arm/Makefile.in portable
BSD sed does not recognize \s as a whitespace matching token.  Make the
sed script in doc/arm/Makefile.in which ensures GitLab identifiers are
not split across lines portable by replacing \s with [[:space:]].
2020-02-20 12:23:36 +01:00
Michał Kępień
cc62ae9aaa Merge branch 'michal/increase-lifetime-of-docs-sid-amd64-artifacts' into 'master'
Increase lifetime of docs:sid:amd64 artifacts

See merge request isc-projects/bind9!3088
2020-02-20 10:55:19 +00:00
Michał Kępień
9751ba5a75 Increase lifetime of docs:sid:amd64 artifacts
Artifacts generated by the docs:sid:amd64 job need to be retained longer
than for other jobs as they are used for building bind.isc.org contents.
If these artifacts are removed too quickly, pipelines in the pages/bind
GitLab project start failing, preventing content updates from being
published.  Increase lifetime of the relevant job artifacts to prevent
this from happening.
2020-02-20 11:51:58 +01:00
Michał Kępień
192c7c29f9 Merge branch 'michal/fix-lib-isc-tests-socket_test-hangs' into 'master'
Fix lib/isc/tests/socket_test hangs

See merge request isc-projects/bind9!3072
2020-02-20 10:47:25 +00:00
Witold Krecicki
0fe149b2fa Fix lib/isc/tests/socket_test hangs 2020-02-20 11:39:15 +01:00
Witold Krecicki
dcb38db695 Merge branch 'wpk/perfork-2-libuv-tuning' into 'master'
Perfwork 2/6 - libuv tuning - support for uv_{recv/send}mmsg, use of libuv-provided uv_export/import

See merge request isc-projects/bind9!3066
2020-02-18 12:08:16 +00:00
Witold Kręcicki
093af1a609 Use libuv-provided uv_{export,import} if available.
We were using our own versions of isc_uv_{export,import} functions
for multithreaded TCP listeners. Upcoming libuv version will
contain proper uv_{export,import} functions - use them if they're
available.
2020-02-18 12:17:55 +01:00
Witold Kręcicki
a0d36d7601 Make nm->recvbuf larger and heap allocated, to allow uv_recvmmsg usage.
Upcoming version of libuv will suport uv_recvmmsg and uv_sendmmsg. To
use uv_recvmmsg we need to provide a larger buffer and be able to
properly free it.
2020-02-18 12:17:55 +01:00
Witold Krecicki
b9c660a023 Merge branch 'wpk/perfwork-1-client-mctxpool-taskpool' into 'master'
Perfwork 1/6 - Use thread-sharded mctxpool and taskpool in ns_client

See merge request isc-projects/bind9!3065
2020-02-18 11:13:07 +00:00
Witold Kręcicki
952f7b503d Use thread-friendly mctxpool and taskpool in ns_client.
Make ns_client mctxpool more thread-friendly by sharding it by
netmgr threadid, use task pool also sharded by thread id to avoid
lock contention.
2020-02-18 10:31:13 +01:00
Witold Kręcicki
23bd04d2f1 Make isc_task_pause/isc_task_unpause thread safe.
isc_task_pause/unpause were inherently thread-unsafe - a task
could be paused only once by one thread, if the task was running
while we paused it it led to races. Fix it by making sure that
the task will pause if requested to, and by using a 'pause reference
counter' to count task pause requests - a task will be unpaused
iff all threads unpause it.

Don't remove from queue when pausing task - we lock the queue lock
(expensive), while it's unlikely that the task will be running -
and we'll remove it anyway in dispatcher
2020-02-18 09:22:04 +00:00
Evan Hunt
b9a2b4cb74 Merge branch 'each-tweak-penalty' into 'master'
adjust the clang-format penalties to reduce string breaking

See merge request isc-projects/bind9!3079
2020-02-17 22:41:54 +00:00
Evan Hunt
0002377dca adjust the clang-format penalties to reduce string breaking
this corrects some style glitches such as:
```
        long_function_call(arg, arg2, arg3, arg4, arg5, "str"
                                                        "ing");
```
...by adjusting the penalties for breaking strings and call
parameter lists.
2020-02-17 14:23:58 -08:00
Ondřej Surý
e4671ef2fa Merge branch 'ondrej/fix-crash-on-arm64-from-weak-cmpxchg' into 'master'
Fix crash on arm64 from using atomic_compare_exchange_weak outside of the loop

See merge request isc-projects/bind9!3042
2020-02-16 17:41:30 +00:00
Ondřej Surý
4ff887db2c Add arm64 to GitLab CI 2020-02-16 18:09:19 +01:00
Ondřej Surý
4cf275ba8a Replace non-loop usage of atomic_compare_exchange_weak with strong variant
While testing BIND 9 on arm64 8+ core machine, it was discovered that
the weak variants in fact does spuriously fail, we haven't observed that
on other architectures.

This commit replaces all non-loop usage of atomic_compare_exchange_weak
with atomic_compare_exchange_strong.
2020-02-16 18:09:19 +01:00
Diego Fronza
fa68a0d869 Added atomic_compare_exchange_strong_acq_rel macro
It is much better to read than:
atomic_compare_exchange_strong_explicit() with 5 arguments.
2020-02-16 18:09:19 +01:00
Ondřej Surý
5e1202d1c9 Merge branch 'ondrej/clang-format-fixups' into 'master'
clang-format fixups

See merge request isc-projects/bind9!3073
2020-02-16 16:45:34 +00:00
Ondřej Surý
3832e3ecc9 Fixup the missing clang-format bits 2020-02-16 17:34:24 +01:00
Ondřej Surý
cbb127eb43 Switch to clang-format-10 that's more accessible on more platforms 2020-02-16 17:34:05 +01:00
Diego dos Santos Fronza
718ec80ed3 Merge branch '1472-threadsanitizer-lock-order-inversion-potential-deadlock-dns_resolver_createfetch-vs' into 'master'
Resolve "ThreadSanitizer: lock-order-inversion (potential deadlock) - dns_resolver_createfetch vs. dns_resolver_prime"

Closes #1472

See merge request isc-projects/bind9!3020
2020-02-14 18:21:12 +00:00
Diego Fronza
45543da802 Fixed disposing of resolver->references in destroy() function 2020-02-14 14:28:31 -03:00
Diego Fronza
e7b36924e2 Fixed potential-lock-inversion
This commit simplifies a bit the lock management within dns_resolver_prime()
and prime_done() functions by means of turning resolver's attribute
"priming" into an atomic_bool and by creating only one dependent object on the
lock "primelock", namely the "primefetch" attribute.

By having the attribute "priming" as an atomic type, it save us from having to
use a lock just to test if priming is on or off for the given resolver context
object, within "dns_resolver_prime" function.

The "primelock" lock is still necessary, since dns_resolver_prime() function
internally calls dns_resolver_createfetch(), and whenever this function
succeeds it registers an event in the task manager which could be called by
another thread, namely the "prime_done" function, and this function is
responsible for disposing the "primefetch" attribute in the resolver object,
also for resetting "priming" attribute to false.

It is important that the invariant "priming == false AND primefetch == NULL"
remains constant, so that any thread calling "dns_resolver_prime" knows for sure
that if the "priming" attribute is false, "primefetch" attribute should also be
NULL, so a new fetch context could be created to fulfill this purpose, and
assigned to "primefetch" attribute under the lock protection.

To honor the explanation above, dns_resolver_prime is implemented as follow:
	1. Atomically checks the attribute "priming" for the given resolver context.
	2. If "priming" is false, assumes that "primefetch" is NULL (this is
           ensured by the "prime_done" implementation), acquire "primelock"
	   lock and create a new fetch context, update "primefetch" pointer to
	   point to the newly allocated fetch context.
	3. If "priming" is true, assumes that the job is already in progress,
	   no locks are acquired, nothing else to do.

To keep the previous invariant consistent, "prime_done" is implemented as follow:
	1. Acquire "primefetch" lock.
	2. Keep a reference to the current "primefetch" object;
	3. Reset "primefetch" attribute to NULL.
	4. Release "primefetch" lock.
	5. Atomically update "priming" attribute to false.
	6. Destroy the "primefetch" object by using the temporary reference.

This ensures that if "priming" is false, "primefetch" was already reset to NULL.

It doesn't make any difference in having the "priming" attribute not protected
by a lock, since the visible state of this variable would depend on the calling
order of the functions "dns_resolver_prime" and "prime_done".

As an example, suppose that instead of using an atomic for the "priming" attribute
we employed a lock to protect it.
Now suppose that "prime_done" function is called by Thread A, it is then preempted
before acquiring the lock, thus not reseting "priming" to false.
In parallel to that suppose that a Thread B is scheduled and that it calls
"dns_resolver_prime()", it then acquires the lock and check that "priming" is true,
thus it will consider that this resolver object is already priming and it won't do
any more job.
Conversely if the lock order was acquired in the other direction, Thread B would check
that "priming" is false (since prime_done acquired the lock first and set "priming" to false)
and it would initiate a priming fetch for this resolver.

An atomic variable wouldn't change this behavior, since it would behave exactly the
same, depending on the function call order, with the exception that it would avoid
having to use a lock.

There should be no side effects resulting from this change, since the previous
implementation employed use of the more general resolver's "lock" mutex, which
is used in far more contexts, but in the specifics of the "dns_resolver_prime"
and "prime_done" it was only used to protect "primefetch" and "priming" attributes,
which are not used in any of the other critical sections protected by the same lock,
thus having zero dependency on those variables.
2020-02-14 14:28:31 -03:00
Diego Fronza
c210413a8a Added atomic_compare_exchange_strong_acq_rel macro
It is much better to read than:
atomic_compare_exchange_strong_explicit() with 5 arguments.
2020-02-14 11:41:36 -03:00
Ondřej Surý
a04cdde45d Merge branch '46-enforce-clang-format-rules' into 'master'
Start enforcing the clang-format rules on changed files

Closes #46

See merge request isc-projects/bind9!3063
2020-02-14 08:45:45 +00:00
Ondřej Surý
60d29f695b Don't enforce copyrights on .clang-format 2020-02-14 09:43:13 +01:00
Ondřej Surý
5777c44ad0 Reformat using the new rules 2020-02-14 09:31:05 +01:00
Ondřej Surý
654927c871 Add separate .clang-format files for headers 2020-02-14 09:31:05 +01:00
Ondřej Surý
618947c63b Switch AlwaysBreakAfterReturnType from TopLevelDefinitions to All
The AlwaysBreakAfterReturnType: TopLevelDefinitions was unwrapping
the declarations of the functions in the header files.
2020-02-14 09:07:46 +01:00
Ondřej Surý
d2b5853b8e Start enforcing the clang-format rules on changed files 2020-02-14 09:07:46 +01:00
Ondřej Surý
d3b49b6675 Merge branch 'each-style-tweak' into 'master'
adjust clang-format options to get closer to ISC style

See merge request isc-projects/bind9!3061
2020-02-14 05:35:17 +00:00
Evan Hunt
e851ed0bb5 apply the modified style 2020-02-13 15:05:06 -08:00
Evan Hunt
0255a97473 revise .clang-format and add a C formatting script in util
- add util/cformat.sh, which runs clang-format on all C files with
  the default .clang-format, and on all header files with a slightly
  modified version.
- use correct bracing after multi-line control statements
- stop aligning variable declarations to avoid problems with pointer
  alignment, but retain aligned declarations in header files so that
  struct definitions look cleaner.
- static function prototypes in C files can skip the line break after
  the return type, but function prototypes in header files still have
  the line break.
- don't break-before-brace in function definitions. ISC style calls
  for braces on the same line when function parameters fit on a single
  line, and a line break if they don't, but clang-format doesn't yet
  support that distinction. one-line function definitions are about
  four times more common than multi-line, so let's use the option that
  deviates less.
2020-02-13 15:04:36 -08:00
Ondřej Surý
67b68e06ad Merge branch '46-add-curly-braces' into 'master'
Add curly braces using uncrustify and then reformat with clang-format back

Closes #46

See merge request isc-projects/bind9!3057
2020-02-13 21:28:07 +00:00
Ondřej Surý
056e133c4c Use clang-tidy to add curly braces around one-line statements
The command used to reformat the files in this commit was:

./util/run-clang-tidy \
	-clang-tidy-binary clang-tidy-11
	-clang-apply-replacements-binary clang-apply-replacements-11 \
	-checks=-*,readability-braces-around-statements \
	-j 9 \
	-fix \
	-format \
	-style=file \
	-quiet
clang-format -i --style=format $(git ls-files '*.c' '*.h')
uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h')
clang-format -i --style=format $(git ls-files '*.c' '*.h')
2020-02-13 22:07:21 +01:00
Ondřej Surý
d14bb71319 Add copy of run-clang-tidy that can fixup the filepaths 2020-02-13 22:06:05 +01:00
Ondřej Surý
36c6105e4f Use coccinelle to add braces to nested single line statement
Both clang-tidy and uncrustify chokes on statement like this:

for (...)
	if (...)
		break;

This commit uses a very simple semantic patch (below) to add braces around such
statements.

Semantic patch used:

@@
statement S;
expression E;
@@

while (...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

for (...;...;...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

if (...)
- if (E) S
+ { if (E) { S } }
2020-02-13 21:58:55 +01:00
Michal Nowak
c823ed4f07 Merge branch 'mnowak/coverity-disable-web-tag' into 'master'
Run Coverity Scan only when specific variables are present

See merge request isc-projects/bind9!3050
2020-02-12 14:44:56 +00:00
Michal Nowak
eec29e3477 Run Coverity Scan only when specific variables are present
Submissions to Coverity Scan should be limited to those originated from
release branches and only from a specific schedule which holds
COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN variables.
2020-02-12 14:44:55 +00:00
Ondřej Surý
7099e79a9b Merge branch '46-just-use-clang-format-to-reformat-sources' into 'master'
Reformat source code with clang-format

Closes #46

See merge request isc-projects/bind9!2156
2020-02-12 14:33:32 +00:00
Ondřej Surý
df6c1f76ad Remove tkey_test (which is no-op anyway) 2020-02-12 15:04:17 +01:00
Ondřej Surý
11341c7688 Update the definition files for Windows 2020-02-12 15:04:17 +01:00
Ondřej Surý
f50b1e0685 Use clang-format to reformat the source files 2020-02-12 15:04:17 +01:00
Ondřej Surý
4c3b063ef8 Import Linux kernel .clang-format with small modifications 2020-02-12 14:01:08 +01:00
Michał Kępień
118692e949 Merge branch 'michal/minor-README-tweaks' into 'master'
Minor README tweaks

See merge request isc-projects/bind9!3036
2020-02-12 10:37:53 +00:00
Michał Kępień
a0349b18e0 Minor CHANGES tweaks 2020-02-12 11:23:48 +01:00
Mark Andrews
677aa65aad Merge branch '1616-autosign-not-waiting-long-enough-for-zone-to-be-signed-v9_11-and-maybe-others-master' into 'master'
wait for apex NSEC3 to be generated

Closes #1616

See merge request isc-projects/bind9!3043
2020-02-12 10:07:27 +00:00
Mark Andrews
dd2830eb97 wait for apex NSEC3 to be generated
(cherry picked from commit c99ad5c8c7)
2020-02-12 10:02:14 +00:00
Michal Nowak
c380e32e9a Merge branch 'mnowak/coverity2' into 'master'
Add Coverity Scan to CI

See merge request isc-projects/bind9!2979
2020-02-12 09:45:27 +00:00
Michal Nowak
c209ec90f3 Add Coverity Scan to CI
This job requires two CI variables to be set:

  - COVERITY_SCAN_PROJECT_NAME: project name, which is associated with
    the BIND branch for which this job is executed, e.g. "bind-master",

  - COVERITY_SCAN_TOKEN: project token.
2020-02-12 09:45:27 +00:00
Mark Andrews
f16738bae2 Merge branch '1602-rpz-system-test-failed-because-protoype-responses-timed-out' into 'master'
Resolve "rpz system test failed because protoype responses timed out."

Closes #1602

See merge request isc-projects/bind9!3040
2020-02-12 08:32:54 +00:00
Mark Andrews
c38752b07c spin waiting for prototype dig responses 2020-02-12 08:12:02 +00:00
Witold Krecicki
de16ce0581 Merge branch 'wpk/netmgr-pools-unlimited' into 'master'
Don't limit the size of uvreq/nmhandle pool artificially.

See merge request isc-projects/bind9!3031
2020-02-12 08:10:31 +00:00
Stephen Morris
bc539d48e7 Minor README tweaks 2020-02-11 15:14:50 +01:00
Witold Kręcicki
a133239698 Don't limit the size of uvreq/nmhandle pool artificially.
There was a hard limit set on number of uvreq and nmhandles
that can be allocated by a pool, but we don't handle a situation
where we can't get an uvreq. Don't limit the number at all,
let the OS deal with it.
2020-02-11 12:10:57 +00:00
Ondřej Surý
d3843161ab Merge branch '1428-possible-data-race-in-rbtdb-happens-occasionally-on-ppc64le' into 'master'
Convert all atomic operations in isc_rwlock to release-acquire memory ordering

Closes #1428

See merge request isc-projects/bind9!2985
2020-02-11 10:42:52 +00:00
Ondřej Surý
b43f5e0238 Convert all atomic operations in isc_rwlock to release-acquire memory ordering
The memory ordering in the rwlock was all wrong, I am copying excerpts
from the https://en.cppreference.com/w/c/atomic/memory_order#Relaxed_ordering
for the convenience of the reader:

  Relaxed ordering

  Atomic operations tagged memory_order_relaxed are not synchronization
  operations; they do not impose an order among concurrent memory
  accesses. They only guarantee atomicity and modification order
  consistency.

  Release-Acquire ordering

  If an atomic store in thread A is tagged memory_order_release and an
  atomic load in thread B from the same variable is tagged
  memory_order_acquire, all memory writes (non-atomic and relaxed atomic)
  that happened-before the atomic store from the point of view of thread
  A, become visible side-effects in thread B. That is, once the atomic
  load is completed, thread B is guaranteed to see everything thread A
  wrote to memory.

  The synchronization is established only between the threads releasing
  and acquiring the same atomic variable. Other threads can see different
  order of memory accesses than either or both of the synchronized
  threads.

Which basically means that we had no or weak synchronization between
threads using the same variables in the rwlock structure.  There should
not be a significant performance drop because the critical sections were
already protected by:

  while(1) {
    if (relaxed_atomic_operation) {
      break;
    }
    LOCK(lock);
    if (!relaxed_atomic_operation) {
      WAIT(sem, lock);
    }
    UNLOCK(lock)l
  }

I would add one more thing to "Don't do your own crypto, folks.":

  - Also don't do your own locking, folks.
2020-02-11 11:10:55 +01:00
Evan Hunt
3116a1c2f1 Merge branch '1598-dnssec-policy-doc' into 'master'
Resolve "Improve dnssec-policy documentation"

Closes #1598

See merge request isc-projects/bind9!3023
2020-02-11 09:01:36 +00:00
Evan Hunt
c7866acbf7 revise dnssec-policy documentation 2020-02-11 01:00:17 -08:00
Ondřej Surý
c72d37f3d5 Merge branch 'ondrej/remove-OpenSSL-engine-specification-in-label' into 'master'
Cleanup support for specifying PKCS#11 engine as part of the label

See merge request isc-projects/bind9!2943
2020-02-10 16:02:23 +00:00
Ondřej Surý
33fa3d5eb1 Remove reference to prepending label with engine in manpage 2020-02-10 07:30:19 -08:00
Ondřej Surý
a5c87d9d18 Cleanup support for specifying PKCS#11 engine as part of the label
The code for specifying OpenSSL PKCS#11 engine as part of the label
(e.g. -l "pkcs11:token=..." instead of -E pkcs11 -l "token=...")
was non-functional.  This commit just cleans the related code.
2020-02-10 07:30:19 -08:00
Ondřej Surý
497c797762 Merge branch 'ondrej/null-the-destroyed-pointer-early' into 'master'
NULL the destroyed pointer early

See merge request isc-projects/bind9!3026
2020-02-10 05:23:38 +00:00
Ondřej Surý
bc1d4c9cb4 Clear the pointer to destroyed object early using the semantic patch
Also disable the semantic patch as the code needs tweaks here and there because
some destroy functions might not destroy the object and return early if the
object is still in use.
2020-02-09 18:00:17 -08:00
Ondřej Surý
b97d003033 Add semantic patch to NULL the destroyed pointer early
Our destroy functions usually look like this:

    void
    foo_destroy(foo_t **foop) {
        foo_t foo = *foop;
        ...destroy the contents of foo...
        *foop = NULL;
    }

nulling the pointer should be done as soon as possible which is
not always the case.  This commit adds simple semantic patch that
changes the example function to:

    void
    foo_destroy(foo_t **foop) {
        foo_t foo = *foop;
        *foop = NULL;
        ...destroy the contents of foo...
    }
2020-02-09 18:00:16 -08:00
Evan Hunt
d4f7603af2 Merge branch '932-doc-query-error-logging' into 'master'
improve documentation of query logging

Closes #932

See merge request isc-projects/bind9!2976
2020-02-09 00:06:24 +00:00
Evan Hunt
21bb9fa77f improve documentation of query logging 2020-02-08 16:05:46 -08:00
Ondřej Surý
e557894717 Merge branch 'michal/fix-the-pipelined-system-test-on-openbsd' into 'master'
Fix the "pipelined" system test on OpenBSD

See merge request isc-projects/bind9!3011
2020-02-08 22:46:26 +00:00
Michał Kępień
a5e90f2aa7 Fix the "pipelined" system test on OpenBSD
On OpenBSD, the bin/tests/system/pipelined/ans5/ans.py script does not
shut down when it is sent the SIGTERM signal.  What seems to be
happening is that starting the UDP listening thread somehow makes the
accept() calls in the script's main thread uninterruptible and thus the
SIGTERM signal sent to the main thread does not get processed until a
TCP connection is established with the script's TCP socket.  Work around
the issue by setting a timeout for operations performed on the script's
TCP socket, so that each accept() call in the main thread's infinite
loop returns after at most 1 second, allowing termination signals sent
to the script to be processed.
2020-02-08 14:01:21 -08:00
Ondřej Surý
95483951ce Merge branch 'wpk/fix-atomics-usage' into 'master'
Fix atomics usage for mutexatomics

See merge request isc-projects/bind9!2967
2020-02-08 21:46:37 +00:00
Witold Kręcicki
e9bc2c865a Add mutexatomics system and unit test jobs 2020-02-08 12:34:19 -08:00
Witold Kręcicki
d708370db4 Fix atomics usage for mutexatomics 2020-02-08 12:34:19 -08:00
Ondřej Surý
d72845f01c Merge branch 'ondrej/coccinelle-improvements' into 'master'
Variaous little coccinelle improvements

See merge request isc-projects/bind9!3025
2020-02-08 11:47:42 +00:00
Ondřej Surý
41fe9b7a14 Formatting issues found by local coccinelle run 2020-02-08 03:12:09 -08:00
Ondřej Surý
de92c24b56 Replace isc_mem_put()+isc_mem_detach() with isc_mem_putanddetach() in contrib/ 2020-02-08 03:12:09 -08:00
Ondřej Surý
341840c026 Run the check-cocci on the whole tree, allow passing extra arguments 2020-02-08 03:12:09 -08:00
Ondřej Surý
0dfec4eef7 Remove #include <config.h> from netmgr.h 2020-02-08 03:12:09 -08:00
Mark Andrews
fea8b5eae6 Merge branch '1596-echo_ic-should-be-used-for-continuations' into 'master'
Resolve "echo_ic should be used for continuations."

Closes #1596

See merge request isc-projects/bind9!2991
2020-02-07 21:35:28 +00:00
Mark Andrews
1e4773f121 indent failed: descriptions 2020-02-07 21:12:21 +00:00
Mark Andrews
ec95bc6f2c indent some test descriptions/continuation 2020-02-07 21:12:21 +00:00
Mark Andrews
0d5ec0c7dc remove space before 'failed' 2020-02-07 21:12:21 +00:00
Mark Andrews
059b16b991 ident continuation of test descriptions 2020-02-07 21:12:21 +00:00
Mark Andrews
879c63b573 remove space from before 'failed'; count errors 2020-02-07 21:12:21 +00:00
Matthijs Mekking
5db8ae931c Merge branch 'each-max-zone-ttl' into 'master'
dnssec-policy neater configuration

See merge request isc-projects/bind9!3006
2020-02-07 19:28:41 +00:00
Matthijs Mekking
a8a2c06cf2 update CHANGES 2020-02-07 19:17:05 +01:00
Evan Hunt
09e061aef7 make ISO8601 duration parsing case-insensitive for robustness 2020-02-07 19:17:05 +01:00
Evan Hunt
6504e7da95 various style cleanups 2020-02-07 19:17:05 +01:00
Evan Hunt
58aa084edc add support for key algorithm mnemonics in dnssec-policy 2020-02-07 19:17:05 +01:00
Matthijs Mekking
8c0db909ee Warn if key lengths are out of range/predefined 2020-02-07 09:30:26 -08:00
Matthijs Mekking
ae6bf1979d Make key-directory optional
The key-directory keyword actually does nothing right now but may
be useful in the future if we want to differentiate between key
directories or HSM keys, or if we want to speficy different
directories for different keys or policies.  Make it optional for
the time being.
2020-02-07 09:30:26 -08:00
Matthijs Mekking
2733edb2a6 Allow for key lifetime unlimited
The keyword 'unlimited' can be used instead of PT0S which means the
same but is more comprehensible for users.

Also fix some redundant "none" parameters in the kasp test.
2020-02-07 09:30:26 -08:00
Evan Hunt
9dc630016e rename 'zone-max-ttl' to 'max-zone-ttl' for consistency 2020-02-07 09:24:06 -08:00
Matthijs Mekking
f862b974b1 Merge branch '1589-intermittent-kasp-failure-keyid-0' into 'master'
kasp test: Fix key id 0000 lookup

Closes #1589

See merge request isc-projects/bind9!2968
2020-02-07 15:09:58 +00:00
Matthijs Mekking
e97313b44d whitespace: line out settime calls nicely 2020-02-07 15:42:31 +01:00
Matthijs Mekking
b6eb28f629 kasp test: Fix key id 0000 lookup
When checking keys we search for keys by key id. The kasp test used key id
0 as an indicator that a key was not yet found. Use "no" instead.
2020-02-07 15:42:31 +01:00
Mark Andrews
b9862397ca Merge branch '1599-autosign-conversion-from-nsec3-to-nsec-can-take-more-than-2-seconds' into 'master'
Resolve "autosign conversion from NSEC3 to NSEC can take more than 2 seconds."

Closes #1599

See merge request isc-projects/bind9!3000
2020-02-07 12:37:35 +00:00
Mark Andrews
e378241324 wait a short while for no NSEC3PARAM 2020-02-07 12:16:13 +00:00
Witold Krecicki
64c7bb3552 Merge branch 'wpk/disable-openssl-siphash' into 'master'
Disable OpenSSL siphash.

See merge request isc-projects/bind9!2965
2020-02-07 12:15:51 +00:00
Witold Kręcicki
9371bad268 Disable OpenSSL siphash.
Creation of EVP_MD_CTX and EVP_PKEY is quite expensive, until
we fix the code to reuse the context and key we'll use our own
implementation of siphash.
2020-02-07 11:55:17 +00:00
Mark Andrews
8ea60d63c7 Merge branch 'marka-coverity-dns-db-find' into 'master'
Silence unchecked return reported by coverity.

See merge request isc-projects/bind9!3005
2020-02-07 09:43:50 +00:00
Mark Andrews
e8bf82efc6 Silence unchecked return of dns_db_find()
190        dns_rdataset_init(&rdataset);
   	3. Condition r == 0, taking true branch.
   	4. Condition result, taking false branch.

	CID 1452691 (#1 of 1): Unchecked return value (CHECKED_RETURN)
	5. check_return: Calling dns_db_find without checking return
	value (as is done elsewhere 39 out of 45 times).

191        check_assertion(dns_db_find(db1, dns_rootname, v2,
192                                    dns_rdatatype_soa, 0, 0, NULL,
193                                    name, &rdataset, NULL));
2020-02-07 08:56:52 +00:00
Mark Andrews
98d5109e82 Fix indenting. 2020-02-07 08:56:52 +00:00
Mark Andrews
550bbee427 Correct logged function name. 2020-02-07 08:56:52 +00:00
Witold Krecicki
5ab80ff7ca Merge branch 'wpk/tuning-small' into 'master'
Set --with-tuning=large as a default, add --with-tuning=small.

See merge request isc-projects/bind9!2989
2020-02-07 08:56:39 +00:00
Witold Kręcicki
d77cad8a41 CHANGES note, update README.md an manpage. 2020-02-07 09:01:50 +01:00
Witold Kręcicki
737501b0d3 Allow --enable-pthread-rwlock even without developer mode 2020-02-07 08:54:54 +01:00
Witold Kręcicki
be159f5565 Set --with-tuning=large as a default, add --with-tuning=small. 2020-02-07 08:54:12 +01:00
Michał Kępień
7fae1ef12b Merge branch 'michal/fix-the-dnssec-system-test-on-windows' into 'master'
Fix the "dnssec" system test on Windows

See merge request isc-projects/bind9!3010
2020-02-06 14:20:53 +00:00
Michał Kępień
2f694f0b77 Fix the "dnssec" system test on Windows
Make sure carriage return characters are stripped from awk input to
enable the "dnssec" system test to pass on Windows.
2020-02-06 15:17:38 +01:00
Matthijs Mekking
67d245d965 Merge branch '1545-dnssec-policy-cdnskey-test' into 'master'
Update kasp test with CDNSKEY checks

Closes #1545

See merge request isc-projects/bind9!2808
2020-02-06 10:31:16 +00:00
Matthijs Mekking
e6c5ecd698 Update kasp test with CDNSKEY checks
Add checks to the kasp system test to verify CDNSKEY publication.
This test is not entirely complete, because when there is a CDNSKEY
available but there should not be one for KEY N, it is hard to tell
whether the existing CDNSKEY actually belongs to KEY N or another
key.

The check works if we expect a CDNSKEY although we cannot guarantee
that the CDNSKEY is correct: The test verifies existence, not
correctness of the record.
2020-02-06 11:02:22 +01:00
Matthijs Mekking
aea824f16e Merge branch '1593-dnssec-policy-new-key-on-restart-bug' into 'master'
Fix kasp bug new KSK on restart [#1593]

Closes #1593

See merge request isc-projects/bind9!3007
2020-02-06 09:50:51 +00:00
Matthijs Mekking
a9a9aa7fd8 Add parentheses around return values 2020-02-06 10:17:22 +01:00
Matthijs Mekking
b378d0371f Fix kasp bug new KSK on restart [#1593]
When you do a restart or reconfig of named, or rndc loadkeys, this
triggers the key manager to run.  The key manager will check if new
keys need to be created. If there is an active key, and key rollover
is scheduled far enough away, no new key needs to be created.

However, there was a bug that when you just start to sign your zone,
it takes a while before the KSK becomes an active key. An active KSK
has its DS submitted or published, but before the key manager allows
that, the DNSKEY needs to be omnipresent. If you restart named
or rndc loadkeys in quick succession when you just started to sign
your zone, new keys will be created because the KSK is not yet
considered active.

Fix is to check for introducing as well as active keys. These keys
all have in common that their goal is to become omnipresent.
2020-02-06 10:17:22 +01:00
Matthijs Mekking
a787bc0b14 Merge branch '914-forwarders-port-documentation' into 'master'
Document forwarders config port and dscp param

Closes #914

See merge request isc-projects/bind9!2869
2020-02-06 09:00:55 +00:00
Matthijs Mekking
be3a11029a Document forwarders config port and dscp param 2020-02-06 09:23:50 +01:00
Michal Nowak
5214f24d7b Merge branch 'mnowak/windows-raise-port-range' into 'master'
Windows: Prevent tools from clashing with named in system tests

Closes #1566

See merge request isc-projects/bind9!2998
2020-02-05 10:03:10 +00:00
Michal Nowak
7f0fcb8a3e Windows: Prevent tools from clashing with named in system tests
In system tests on Windows tool's local port can sometimes clash with
'named'. On Unix the system is poked for the minimal local port,
otherwise is set to 32768 as a sane minimum. For Windows we don't
poke but set a hardcoded limit; this change aligns the limit with
Unix and changes it to 32768.
2020-02-05 10:03:09 +00:00
Mark Andrews
dd6598f391 Merge branch 'marka-coverity-master' into 'master'
Address various minor issues identified by coverity on master

See merge request isc-projects/bind9!2999
2020-02-05 08:13:16 +00:00
Mark Andrews
891f24fa57 'dispatch' must be non NULL, remove test.
10067 cleanup:

	CID 1452683 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking dispatch suggests that it
	may be null, but it has already been dereferenced on all
	paths leading to the check.

10068        if (dispatch != NULL)
10069                isc_mem_put(server->mctx, dispatch, sizeof(*dispatch));
2020-02-05 18:37:17 +11:00
Mark Andrews
fccf65a585 'dctx' must be non NULL, remove test.
1549 cleanup:
1550        if (dctx->dbiter != NULL)
1551                dns_dbiterator_destroy(&dctx->dbiter);
1552        if (dctx->db != NULL)
1553                dns_db_detach(&dctx->db);

	CID 1452686 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking dctx suggests that it may
	be null, but it has already been dereferenced on all paths
	leading to the check.

1554        if (dctx != NULL)
1555                isc_mem_put(mctx, dctx, sizeof(*dctx));
2020-02-05 18:37:17 +11:00
Mark Andrews
bf7a99a3c1 'dir_list' must be non NULL, remove test.
707 complete_allnds:

	CID 1452689 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking dir_list suggests that it
	may be null, but it has already been dereferenced on all
	paths leading to the check.

708        if (dir_list != NULL) {
709                /* clean up entries from list. */
2020-02-05 18:37:17 +11:00
Mark Andrews
7ba1af0280 'lcfg' must be non NULL, remove test.
389        else

	CID 1452695 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking lcfg suggests that it may
	be null, but it has already been dereferenced on all paths
	leading to the check.

390                if (lcfg != NULL)
391                        isc_logconfig_destroy(&lcfg);
2020-02-05 18:37:17 +11:00
Mark Andrews
714594d468 's' must be non NULL, remove test.
122 cleanup:

	CID 1452696 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking s suggests that it may be
	null, but it has already been dereferenced on all paths
	leading to the check.

123        if (s != NULL)
124                isc_mem_free(mctx, s);
2020-02-05 18:37:17 +11:00
Mark Andrews
44b08521ef 'tql' must be non NULL, remove test.
255 flag_fail:
256        /* get rid of what was build of the query list */

	CID 1452697 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking tql suggests that it may
	be null, but it has already been dereferenced on all paths
	leading to the check.

257        if (tql != NULL)
258                destroy_querylist(mctx, &tql);
2020-02-05 18:37:17 +11:00
Mark Andrews
0312e73e16 'closest' must be non NULL, remove test.
6412 cleanup:
6413        dns_rdataset_disassociate(&neg);
6414        dns_rdataset_disassociate(&negsig);

	CID 1452700 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking closest suggests that it
	may be null, but it has already been dereferenced on all
	paths leading to the check.

6415        if (closest != NULL)
6416                free_noqname(mctx, &closest);
2020-02-05 18:37:17 +11:00
Mark Andrews
d64921848d cleanup error handling.
336 cleanup_mem:
337        /* cleanup memory */
338
339        /* free tmpPath memory */

	CID 1452701 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking tmpPath suggests that it
	may be null, but it has already been dereferenced on all
	paths leading to the check.

340        if (tmpPath != NULL && result != ISC_R_SUCCESS)
341                isc_mem_free(named_g_mctx, tmpPath);
342
343        /* free tmpPath memory */
344        return (result);
2020-02-05 18:37:17 +11:00
Mark Andrews
2e189bb053 'stub' cannot be non NULL, remove test.
13429 cleanup:
13430        cancel_refresh(zone);

	CID 1452702 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking stub suggests that it may
	be null, but it has already been dereferenced on all paths
	leading to the check.

13431        if (stub != NULL) {
13432                stub->magic = 0;
2020-02-05 18:37:17 +11:00
Mark Andrews
1b1a94ea6d 'noqname' must be non NULL, remove test.
6367cleanup:
6368        dns_rdataset_disassociate(&neg);
6369        dns_rdataset_disassociate(&negsig);

	CID 1452704 (#1 of 1): Dereference before null check
	(REVERSE_INULL) check_after_deref: Null-checking noqname
	suggests that it may be null, but it has already been
	dereferenced on all paths leading to the check.

6370        if (noqname != NULL)
6371                free_noqname(mctx, &noqname);
2020-02-05 18:37:17 +11:00
Mark Andrews
8456b5627d 'dctx' must be non NULL, remove test.
11030 cleanup:

	CID 1452705 (#1 of 1): Dereference before null check
	(REVERSE_INULL) check_after_deref: Null-checking dctx
	suggests that it may be null, but it has already been
	dereferenced on all paths leading to the check.

11031        if (dctx != NULL)
11032                dumpcontext_destroy(dctx);
11033        return (result);
2020-02-05 18:37:17 +11:00
Mark Andrews
e4d08c0232 'event' must be non NULL, remove test.
1401        }

	CID 1453455 (#1 of 1): Dereference before null check (REVERSE_INULL)
	check_after_deref: Null-checking event suggests that it may be null,
	but it has already been dereferenced on all paths leading to the check.

1402        if (event != NULL)
1403                isc_event_free(ISC_EVENT_PTR(&event));
2020-02-05 18:37:17 +11:00
Mark Andrews
b6c3a2f172 remove dead cleanup code.
13836        if (zone != NULL)
13837                dns_zone_detach(&zone);

     	null: At condition dz != NULL, the value of dz must be NULL.
     	dead_error_condition: The condition dz != NULL cannot be true.

13838        if (dz != NULL) {

	CID 1453456 (#1 of 1): Logically dead code (DEADCODE)
	dead_error_begin: Execution cannot reach this statement:
	dns_zone_detach(&dz->zone);.

13839                dns_zone_detach(&dz->zone);
13840                isc_mem_put(named_g_mctx, dz, sizeof(*dz));
13841        }
2020-02-05 18:37:17 +11:00
Mark Andrews
1efc7550a3 keymgr_keyrole couldn't emit "NOSIGN".
92        } else {
 93                return ("ZSK");
 94        }

	CID 1455900 (#1 of 1): Structurally dead code (UNREACHABLE)
	unreachable: This code cannot be reached: return "NOSIGN";.

 95        return ("NOSIGN");
2020-02-05 18:37:17 +11:00
Mark Andrews
5fc9efba30 Remove dead error code.
128        return (ISC_R_SUCCESS);
129

	CID 1456146 (#1 of 1): Structurally dead code (UNREACHABLE)
	unreachable: This code cannot be reached: {
	   if (dst->labels[i] != N....

130        do {
2020-02-05 18:37:17 +11:00
Mark Andrews
aa101260d9 'indentctx' is always defined. Just use it.
402        ctx->serve_stale_ttl = 0;

	notnull: At condition indentctx, the value of indentctx
	cannot be NULL.  dead_error_condition: The condition indentctx
	must be true.

	CID 1456147 (#1 of 1): Logically dead code (DEADCODE)
	dead_error_line: Execution cannot reach the expression
	default_indent inside this statement: ctx->indent = (indentctx
	? ....

403        ctx->indent = indentctx ? *indentctx : default_indent;
2020-02-05 18:37:17 +11:00
Mark Andrews
0be2dc9f22 break was on wrong line.
959                break;

	CID 1457872 (#1 of 1): Structurally dead code (UNREACHABLE)
	unreachable: This code cannot be reached:
	isc__nm_incstats(sock->mgr,....

 960                isc__nm_incstats(sock->mgr, sock->statsindex[STATID_ACTIVE]);
 961        default:
2020-02-05 18:37:17 +11:00
Mark Andrews
331b74d6bf dstkey is no longer used 2020-02-05 18:37:17 +11:00
Mark Andrews
a038f77d92 'buffer' must be non-NULL as isc_buffer_allocate can no longer fail.
1636 cleanup:

CID 1458130 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking buffer suggests that it may be
null, but it has already been dereferenced on all paths leading to
the check.

1637        if (buffer != NULL)
1638                isc_buffer_free(&buffer);
2020-02-05 18:37:17 +11:00
Ondřej Surý
d162bbcceb Merge branch 'ondrej/lgtm-narrow-vs-wider-type-comparison-in-a-loop' into 'master'
Fix comparison between type uint16_t and  wider type size_t in a loop

See merge request isc-projects/bind9!2986
2020-02-05 05:12:01 +00:00
Ondřej Surý
a9bd6f6ea6 Fix comparison between type uint16_t and wider type size_t in a loop
Found by LGTM.com (see below for description), and while it should not
happen as EDNS OPT RDLEN is uint16_t, the fix is easy.  A little bit
of cleanup is included too.

> In a loop condition, comparison of a value of a narrow type with a value
> of a wide type may result in unexpected behavior if the wider value is
> sufficiently large (or small). This is because the narrower value may
> overflow. This can lead to an infinite loop.
2020-02-05 01:41:13 +00:00
Matthijs Mekking
9943c5dce5 Merge branch '1192-fix-serve-stale-test' into 'master'
Resolve "Fix unreliable serve-stale test"

Closes #1192

See merge request isc-projects/bind9!2955
2020-02-04 13:15:42 +00:00
Matthijs Mekking
2c0c333d16 Increase TTL in serve-stale test
Increase the short lived record TTL and negative SOA TTL to make
this test less vulnerable to timing issues. The drawback is that we
also have to sleep longer in this test.
2020-02-04 13:35:06 +01:00
Matthijs Mekking
830d40b36e Merge branch '1183-simplify-cachedb-rrset-stats-counters' into 'master'
Simplify cachedb rrset statistic counters

Closes #1183

See merge request isc-projects/bind9!2897
2020-02-04 11:19:24 +00:00
Matthijs Mekking
7135ef78ee Add test for "Others" rrtype stat counter
Add queries and checks for CAA RRtype in the serve-stale test.
Ensure that the "Others" rrtype stat counter is incremented and
decremented properly if the RRset becomes stale/ancient.

The low max-stale-ttl config option needs to be increased in order
to match the timing when things expire (aka become ancient).
2020-02-04 11:58:34 +01:00
Matthijs Mekking
37b41ff693 Simplify cachedb rrset statistic counters
This commit simplifies the cachedb rrset statistics in two ways:
- Introduce new rdtypecounter arithmetics, allowing bitwise
  operations.
- Remove the special DLV statistic counter.

New rdtypecounter arithmetics
-----------------------------
"The rdtypecounter arithmetics is a brain twister".  Replace the
enum counters with some defines.  A rdtypecounter is now 8 bits for
RRtypes and 3 bits for flags:

      0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    |  |  |  |  |  |  S  |NX|         RRType        |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

If the 8 bits for RRtype are all zero, this is an Other RRtype.

Bit 7 is the NXRRSET (NX) flag and indicates whether this is a
positive (0) or a negative (1) RRset.

Then bit 5 and 6 mostly tell you if this counter is for an active,
stale, or ancient RRtype:

    S = 0x00 means Active
    S = 0x01 means Stale
    S = 0x10 means Ancient

Since a counter cannot be stale and ancient at the same time, we
treat S = 0x11 as a special case to deal with NXDOMAIN counters.

S = 0x11 indicates an NXDOMAIN counter and in this case the RRtype
field signals the expiry of this cached item:

    RRType = 0 means Active
    RRType = 1 means Stale
    RRType = 2 means Ancient
2020-02-04 11:58:34 +01:00
Matthijs Mekking
3079956ff7 Remove the DLV statistics counter
This also removes counting the DLV RRtype separately.  Since we have
deprecated the lookaside validation it makes no sense to keep this
special statistic counter.
2020-02-04 11:58:34 +01:00
Michał Kępień
59a1e5564d Merge branch '1305-update-gitlab-ci-to-openbsd-6.6' into 'master'
Update GitLab CI to OpenBSD 6.6

Closes #1305

See merge request isc-projects/bind9!2973
2020-02-04 10:46:17 +00:00
Michał Kępień
99ed3a0e13 Update GitLab CI to OpenBSD 6.6
Since OpenBSD 6.6 is the current OpenBSD release, replace OpenBSD 6.5
GitLab CI jobs with their up-to-date counterparts.

As CI jobs for OpenBSD 6.6 will be run by a generalized libvirt executor
rather than an OpenBSD-specific one, make the necessary tag and variable
adjustments as well.
2020-02-04 11:39:27 +01:00
Ondřej Surý
a9c1fffba0 Merge branch 'cppcheck-1.90-warnings' into 'master'
Fix cppcheck 1.90 warnings

Closes #1590

See merge request isc-projects/bind9!2969
2020-02-04 10:10:48 +00:00
Matthijs Mekking
b8be29fee6 Add a note on memory allocation
isc__memalloc_t must deal with memory allocation failure
and must never return NULL.
2020-02-04 11:09:22 +01:00
Ondřej Surý
2868eafc46 Suppress unknownMacro directive which is currently broken with OpenSSL 2020-02-04 11:09:22 +01:00
Ondřej Surý
c00def343f Suppress cppcheck false positive nullPointerArithmeticRedundantCheck 2020-02-04 11:09:22 +01:00
Ondřej Surý
05ae2e48ab Change pk11_mem_get() so it cannot soft-fail 2020-02-04 11:09:22 +01:00
Ondřej Surý
478e4ac201 Make the DbC checks to be consistent and cppcheck clean 2020-02-04 11:09:22 +01:00
Mark Andrews
bb65e57297 isc_mem_get cannot fail 2020-02-04 11:09:22 +01:00
Mark Andrews
d6de520bd1 delay assignment until after REQUIRE 2020-02-04 11:09:22 +01:00
Mark Andrews
704b9ee9d0 skip if first is NULL 2020-02-04 11:09:22 +01:00
Mark Andrews
c65c06301c delay assignment until after REQUIRE 2020-02-04 11:09:22 +01:00
Mark Andrews
f17b9b8dd1 make expression logical for cppcheck 2020-02-04 11:09:22 +01:00
Mark Andrews
7b948c7335 remove brackets 2020-02-04 11:09:22 +01:00
Mark Andrews
6c2e138d7a simplify ISC_LIKELY/ISC_UNLIKELY for CPPCHECK 2020-02-04 11:09:22 +01:00
Mark Andrews
668a972d1e simplify RUNTIME_CHECK for cppcheck 2020-02-04 11:09:22 +01:00
Evan Hunt
dfd96e1aa5 Merge branch '1592-catz-filename' into 'master'
Resolve "catalog zones fail if a zone name contains a slash"

Closes #1592

See merge request isc-projects/bind9!2980
2020-02-04 03:18:51 +00:00
Evan Hunt
7a002c7ece CHANGES 2020-02-03 18:58:39 -08:00
Mark Andrews
fc4e44bd37 don't swallow backslash characters in test output 2020-02-03 18:58:27 -08:00
Mark Andrews
8745043a86 test all the scenarios for hashed filenames together 2020-02-03 18:58:27 -08:00
Evan Hunt
dba0163dac Correctly handle catalog zone entries containing slashes
- Add quotes before and after zone name when generating "addzone"
  input so avoid "unexpected token" errors.
- Use a hex digest for zone filenames when the zone or view name
  contains a slash.
- Test with a domain name containing a slash.
- Incidentally added 'catzhash.py' to contrib/scripts to generate
  hash labels for catalog zones, as it was needed to write the test.
2020-02-03 16:08:20 -08:00
Ondřej Surý
9f6e0dc945 Merge branch 'ondrej/isc_buffer_allocate_cannot_fail' into 'master'
isc_buffer_allocate() cannot fail

See merge request isc-projects/bind9!2987
2020-02-03 07:47:05 +00:00
Ondřej Surý
c73e5866c4 Refactor the isc_buffer_allocate() usage using the semantic patch
The isc_buffer_allocate() function now cannot fail with ISC_R_MEMORY.
This commit removes all the checks on the return code using the semantic
patch from previous commit, as isc_buffer_allocate() now returns void.
2020-02-03 08:29:00 +01:00
Ondřej Surý
d5f682a00b Add semantic patch to fix isc_buffer_allocate usage, it cannot fail now 2020-02-03 08:29:00 +01:00
Ondřej Surý
4459745ff2 isc_buffer_allocate() can't fail now, change the return type to void 2020-02-03 08:29:00 +01:00
Ondřej Surý
9286548c7e Merge branch 'ondrej/isc_mempool_create_cannot_fail' into 'master'
isc_mempool_create() cannot fail

See merge request isc-projects/bind9!2988
2020-02-03 07:27:57 +00:00
Ondřej Surý
5eb3f71a3e Refactor the isc_mempool_create() usage using the semantic patch
The isc_mempool_create() function now cannot fail with ISC_R_MEMORY.
This commit removes all the checks on the return code using the semantic
patch from previous commit, as isc_mempool_create() now returns void.
2020-02-03 08:27:16 +01:00
Ondřej Surý
33328871a7 Add semantic patch to refactor isc_mempool_create() usage 2020-02-03 08:27:12 +01:00
Ondřej Surý
de123a67d6 isc_mempool_create cannot fail, change the return type to void 2020-02-02 08:39:45 +01:00
Michal Nowak
1248f05ae8 Merge branch 'mnowak/drop-kyua-report-verbose-option' into 'master'
Drop kyua report's --verbose option

See merge request isc-projects/bind9!2981
2020-01-31 09:06:19 +00:00
Michal Nowak
8ceaf28442 Drop kyua report's --verbose option
It prints far more than needed.
2020-01-31 09:06:19 +00:00
Mark Andrews
2ec5b852df Merge branch '1554-cds-cdnskey-consistency-checks-don-t-work-with-deletion-records' into 'master'
Resolve "CDS / CDNSKEY consistency checks don't work with deletion records"

Closes #1554

See merge request isc-projects/bind9!2865
2020-01-30 12:04:40 +00:00
Mark Andrews
02c2fc5ad3 use anonomous constants 2020-01-30 11:29:27 +11:00
Mark Andrews
7c0d9dac9f use enum 2020-01-30 11:29:27 +11:00
Mark Andrews
d159fdf25d add more CDS / CDNSKEY deletion record tests 2020-01-30 11:29:27 +11:00
Mark Andrews
68a360772f check CDS and CDNSKEY content 2020-01-30 11:29:27 +11:00
Mark Andrews
379949cce4 check kskonly key ids 2020-01-30 11:29:27 +11:00
Mark Andrews
272a31f758 add CHANGES 2020-01-30 11:29:27 +11:00
Mark Andrews
279f6b01de style 2020-01-30 11:18:16 +11:00
Mark Andrews
a09c464a20 return the correct error code for the type being checked 2020-01-30 11:18:16 +11:00
Mark Andrews
f91b3a69ce check that a CDNSKEY deletion record is accepted 2020-01-30 11:18:16 +11:00
Mark Andrews
0adb4b25d3 handle CDS deletion record in consistancy checks 2020-01-30 11:18:16 +11:00
Michał Kępień
77332eb2c8 Merge branch 'michal/list-atypical-failures-in-system-test-summary' into 'master'
List atypical failures in system test summary

See merge request isc-projects/bind9!2964
2020-01-29 14:42:19 +00:00
Michał Kępień
a8836b381f List atypical failures in system test summary
Each system test can be marked as failed not only due to some tested
component(s) not behaving as expected, but also because of core dumps,
assertion failures, and/or ThreadSanitizer reports being found among its
artifacts.  Make the system test summary list the tests which exhibit
such atypical symptoms to more clearly present the nature of problems
found.
2020-01-29 14:50:26 +01:00
Mark Andrews
4f9bfe1460 Merge branch '1508-case-system-test-failed' into 'master'
Resolve "case system test failed."

Closes #1508

See merge request isc-projects/bind9!2774
2020-01-28 21:21:45 +00:00
Mark Andrews
7b0ba6eb10 wait longer for dynamic zone to be transfered 2020-01-28 04:38:38 +00:00
Evan Hunt
6adcd739ca Merge branch 'each-history-typo' into 'master'
fixed a typo

See merge request isc-projects/bind9!2960
2020-01-24 17:55:29 +00:00
Evan Hunt
0147acd7b6 fixed a typo 2020-01-24 09:54:22 -08:00
Mark Andrews
e48b2424aa Merge branch '1559-dnssec-system-test-failed-reload-of-root-server-not-completed-in-time' into 'master'
Resolve "dnssec system test failed: reload of root server not completed in time."

Closes #1559

See merge request isc-projects/bind9!2877
2020-01-23 22:01:11 +00:00
Mark Andrews
784e64f238 wait for root server to complete reloading 2020-01-23 21:39:18 +00:00
Mark Andrews
ed52ffba38 Merge branch '1579-dnstap-system-test-appears-to-be-timing-sensitive' into 'master'
Resolve "dnstap system test appears to be timing sensitive"

Closes #1579

See merge request isc-projects/bind9!2950
2020-01-23 21:13:18 +00:00
Mark Andrews
9b6df37303 wait for the ./NS lookup to complete 2020-01-23 19:16:05 +00:00
Mark Andrews
4a992c7a18 check that all servers have finished loading before beginging tests 2020-01-23 19:16:05 +00:00
Mark Andrews
a1a5559a8a Merge branch 'marka-signing-clear-notify' into 'master'
Send NOTIFY messages after deleting private-type records.

See merge request isc-projects/bind9!2942
2020-01-23 09:46:31 +00:00
Tony Finch
f3f7b7df5d Send NOFITY messages after deleting private-type records.
The `rndc signing -clear` command cleans up the private-type records
that keep track of zone signing activity, but before this change it
did not tell the secondary servers that the zone has changed.
2020-01-23 07:36:03 +00:00
Mark Andrews
7443bd5cc7 Merge branch '1572-wait-for-mirror-zone-to-be-deleted' into 'master'
Resolve "Wait for mirror zone to be deleted"

Closes #1572

See merge request isc-projects/bind9!2941
2020-01-23 05:09:19 +00:00
Mark Andrews
c6ba51cfc4 wait for log message before testing that mirror zone is correctly removed 2020-01-23 04:00:53 +00:00
Mark Andrews
82c418abfa Merge branch '1522-pad-system-test-is-timing-sensitive' into 'master'
Resolve "padding system test is timing sensitive"

Closes #907 and #1522

See merge request isc-projects/bind9!2782
2020-01-23 03:15:07 +00:00
Mark Andrews
b3f06729e5 address timing issues in padding system test
'rndc stats' is not instantaneous. Wait for the dump to complete
before looking at the content.
2020-01-23 12:43:03 +11:00
Evan Hunt
a2254f01c4 Merge branch '1540-bind-aborts-when-queried-for-non-existing-domain-in-chaos-class' into 'master'
Resolve "bind 9.14.8 and 9.14.9 aborts when queried for non-existing domain in chaos class"

Closes #1569 and #1540

See merge request isc-projects/bind9!2843
2020-01-22 20:24:38 +00:00
Evan Hunt
42e1fb8322 CHANGES 2020-01-22 16:15:52 -03:00
Diego Fronza
7417b79c7a Added test for the proposed fix
Added test to ensure that NXDOMAIN is returned when BIND is queried for a
non existing domain in CH class (if a view of CHAOS class is configured)
and that it also doesn't crash anymore in those cases.
2020-01-22 16:15:51 -03:00
Diego Fronza
85555f29d7 Fixed crash when querying for non existing domain in chaos class
Function dns_view_findzonecut in view.c wasn't correctly handling
classes other than IN (chaos, hesiod, etc) whenever the name being
looked up wasn't in cache or in any of the configured zone views' database.

That resulted in a NULL fname being used in resolver.c:4900, which
in turn was triggering abort.
2020-01-22 16:15:51 -03:00
Michal Nowak
754f7588c6 Merge branch 'mnowak/prevent-failing-grep-invocations-from-interrupting-mkeys' into 'master'
mkeys: Prevent failing grep invocations

Closes #1567

See merge request isc-projects/bind9!2933
2020-01-22 14:53:02 +00:00
Michal Nowak
20b446cdc3 mkeys: Prevent failing grep invocations
Some 'grep' invocations were not guarded from interrupting the test
prematurely, e.g. when no text was matched.
2020-01-22 14:53:01 +00:00
Witold Krecicki
1f3502f564 Merge branch 'wpk/pipelined-test-fix' into 'master'
Fix pipelined test

See merge request isc-projects/bind9!2927
2020-01-22 13:07:19 +00:00
Witold Kręcicki
b5cfc1c056 Get rid of the remains of -Tdelay option 2020-01-22 12:16:59 +01:00
Witold Kręcicki
43279de8e6 pipelined test: we no longer have -Tdelay option, use a python proxy that delays packets as a workaround 2020-01-22 12:16:59 +01:00
Mark Andrews
7a605b4d05 Merge branch '1560-isc_httpd-and-isc_httpdmgr-structures-are-not-reference-counted-and-magic' into 'master'
Resolve "isc_httpd and isc_httpdmgr structures are not reference counted and magic"

Closes #1560

See merge request isc-projects/bind9!2913
2020-01-22 01:33:02 +00:00
Ondřej Surý
5b448996e5 Clean the ENTER/EXIT/NOTICE debugging from production code 2020-01-22 11:13:53 +11:00
Ondřej Surý
9643a62dd5 Refactor parts of isc_httpd and isc_httpd for better readability and safety 2020-01-22 11:13:53 +11:00
Mark Andrews
7c3f419d66 add ISC_MAGIC and reference counting to httpd and httpdmgr 2020-01-22 11:13:53 +11:00
Michal Nowak
8b159c33ac Merge branch 'mnowak/enhance_unit_test_debugging' into 'master'
Omit spurious string from unit test debugging efforts

See merge request isc-projects/bind9!2829
2020-01-21 17:41:22 +00:00
Michal Nowak
9e6f6156f7 Omit spurious string from unit test debugging efforts
When both 'broken' and 'failed' test cases appear in unit test output

...
===> Broken tests
lib/isc/tests/socket_test:main  ->  broken: Test case timed out  [300.022s]
===> Failed tests
lib/isc/tests/time_test:main  ->  failed: 2 of 6 tests failed  [0.006s]
===> Summary
...

spurious '===>' string gets matched, that results in the following
error:

  Usage error for command debug: '===>' is not a test case identifier (missing ':'?).

Following change makes sure the string is omitted.

I checked on FreeBSD and OpenBSD that the AWK construct is supported.
2020-01-21 18:14:44 +01:00
Witold Krecicki
8648b7cdb2 Merge branch 'wpk/fix-inline-test' into 'master'
tests: add a missing log nextpart in inline test

Closes #1568

See merge request isc-projects/bind9!2928
2020-01-21 14:23:41 +00:00
Witold Kręcicki
796b38fe0c tests: add a missing log nextpart in inline test 2020-01-21 14:03:09 +00:00
Witold Krecicki
78a6b2689b Merge branch 'wpk/dnssec-test-fixes' into 'master'
dnssec: use less-or-equal when looking at SyncPublish time

See merge request isc-projects/bind9!2929
2020-01-21 14:00:51 +00:00
Witold Kręcicki
741bc11bdb dnssec: use less-or-equal when looking at SyncPublish time
If we created a key, mark its SyncPublish time as 'now' and started
bind the key might not be published if the SyncPublish time is in
the same second as the time the zone is loaded. This is mostly
for dnssec system test, as this kind of scenario is very unlikely
in a real world environment.
2020-01-21 14:37:53 +01:00
Ondřej Surý
4a26f7d149 Merge branch 'ondrej/lower-the-artifact-expiration-time-to-just-12-hours' into 'master'
Lower the artifact expiration time to just 1 day

See merge request isc-projects/bind9!2930
2020-01-21 12:06:24 +00:00
Ondřej Surý
27a9be3034 Lower the artifact expiration time to just 1 day 2020-01-21 12:55:34 +01:00
Witold Krecicki
bb061abbb9 Merge branch 'wpk/fix-taskmgr-pause-unpause-detach-race' into 'master'
Fix a race in taskmgr between worker and task pausing/unpausing.

Closes #1571

See merge request isc-projects/bind9!2918
2020-01-21 10:04:07 +00:00
Witold Kręcicki
63b702d0d0 CHANGES note 2020-01-21 10:06:19 +01:00
Witold Kręcicki
1beba0fa59 Unit test for the taskmgr pause/unpause race 2020-01-21 10:06:19 +01:00
Witold Kręcicki
e1c4a69197 Fix a race in taskmgr between worker and task pausing/unpausing.
To reproduce the race - create a task, send two events to it, first one
must take some time. Then, from the outside, pause(), unpause() and detach()
the task.
When the long-running event is processed by the task it is in
task_state_running state. When we called pause() the state changed to
task_state_paused, on unpause we checked that there are events in the task
queue, changed the state to task_state_ready and enqueued the task on the
workers readyq. We then detach the task.
The dispatch() is done with processing the event, it processes the second
event in the queue, and then shuts down the task and frees it (as it's not
referenced anymore). Dispatcher then takes the, already freed, task from
the queue where it was wrongly put, causing an use-after free and,
subsequently, either an assertion failure or a segmentation fault.
The probability of this happening is very slim, yet it might happen under a
very high load, more probably on a recursive resolver than on an
authoritative.
The fix introduces a new 'task_state_pausing' state - to which tasks
are moved if they're being paused while still running. They are moved
to task_state_paused state when dispatcher is done with them, and
if we unpause a task in paused state it's moved back to task_state_running
and not requeued.
2020-01-21 10:06:19 +01:00
Mark Andrews
684a44b469 Merge branch 'marka-Psync-future' into 'master'
dnssec: do not publish CDS records when -Psync is in the future

See merge request isc-projects/bind9!2925
2020-01-21 06:11:15 +00:00
Mark Andrews
0cd10c7763 add CHANGES 2020-01-21 16:42:51 +11:00
Tony Finch
4227b7969b dnssec: do not publish CDS records when -Psync is in the future
This is a bug I encountered when trying to schedule an algorithm
rollover. My plan, for a zone whose maximum TTL is 48h, was to sign
with the new algorithm and schedule a change of CDS records for more
than 48 hours in the future, roughly like this:

    $ dnssec-keygen -a 13 -fk -Psync now+50h $zone
    $ dnssec-keygen -a 13 $zone
    $ dnssec-settime -Dsync now+50h $zone_ksk_old

However the algorithm 13 CDS was published immediately, which could
have made the zone bogus.

To reveal the bug using the `smartsign` test, this change just adds a
KSK with all its times in the future, so it should not affect the
existing checks at all. But the final check (that there are no CDS or
CDSNSKEY records after -Dsync) fails with the old `syncpublish()`
logic, because the future key's sync records appear early. With the
new `syncpublish()` logic the future key does not affect the test, as
expected, and it now passes.
2020-01-21 16:39:31 +11:00
Mark Andrews
ccf7bbab5d Merge branch 'marka-omit-spurious-newlines' into 'master'
Omit spurious newlines when reporting DNSKEY changes

See merge request isc-projects/bind9!2922
2020-01-21 05:16:25 +00:00
Tony Finch
3b1bd3f48b Omit spurious newlines when reporting DNSKEY changes
These caused blank lines to appear in the logs.
2020-01-21 15:55:24 +11:00
Mark Andrews
aafb804eb8 Merge branch 'marka-document-authors-bind' into 'master'
document that version also controls authors.bind

See merge request isc-projects/bind9!2919
2020-01-21 03:54:51 +00:00
Mark Andrews
05c6a29c87 document that version also controls authors.bind 2020-01-21 14:36:06 +11:00
Witold Krecicki
6d8d06e82e Merge branch 'fix-shutdown-issues' into 'master'
Fix shutdown issues

See merge request isc-projects/bind9!2907
2020-01-20 22:01:44 +00:00
Witold Kręcicki
fd8788eb94 Fix possible race in socket destruction.
When two threads unreferenced handles coming from one socket while
the socket was being destructed we could get a use-after-free:
Having handle H1 coming from socket S1, H2 coming from socket S2,
S0 being a parent socket to S1 and S2:

Thread A                             Thread B
Unref handle H1                      Unref handle H2
Remove H1 from S1 active handles     Remove H2 from S2 active handles
nmsocket_maybe_destroy(S1)           nmsocket_maybe_destroy(S2)
nmsocket_maybe_destroy(S0)           nmsocket_maybe_destroy(S0)
LOCK(S0->lock)
Go through all children, figure
out that we have no more active
handles:
sum of S0->children[i]->ah == 0
UNLOCK(S0->lock)
destroy(S0)
                                     LOCK(S0->lock)
                                      - but S0 is already gone
2020-01-20 22:28:36 +01:00
Witold Kręcicki
42f0e25a4c calling isc__nm_udp_send() on a non-udp socket is not 'unexpected', it's a critical failure 2020-01-20 22:28:36 +01:00
Witold Kręcicki
8d6dc8613a clean up some handle/client reference counting errors in error cases.
We weren't consistent about who should unreference the handle in
case of network error. Make it consistent so that it's always the
client code responsibility to unreference the handle - either
in the callback or right away if send function failed and the callback
will never be called.
2020-01-20 22:28:36 +01:00
Witold Kręcicki
dcc0835a3a cleanup properly if we fail to initialize ns_client structure
If taskmgr is shutting down ns_client_setup will fail to create
a task for the newly created client, we weren't cleaning up already
created/attached things (memory context, server, clientmgr).
2020-01-20 22:28:36 +01:00
Witold Kręcicki
f75a9e32be netmgr: fix a non-thread-safe access to libuv structures
In tcp and udp stoplistening code we accessed libuv structures
from a different thread, which caused a shutdown crash when named
was under load. Also added additional DbC checks making sure we're
in a proper thread when accessing uv_ functions.
2020-01-20 22:28:36 +01:00
Witold Kręcicki
16908ec3d9 netmgr: don't send to an inactive (closing) udp socket
We had a race in which n UDP socket could have been already closing
by libuv but we still sent data to it. Mark socket as not-active
when stopping listening and verify that socket is not active when
trying to send data to it.
2020-01-20 22:28:36 +01:00
Mark Andrews
402f067fc0 Merge branch '1537-nslookup-manual-page-needs-update-for-default-querytype-a-and-aaaa' into 'master'
Resolve "nslookup manual page needs update for default querytype (A and AAAA)"

Closes #1537

See merge request isc-projects/bind9!2894
2020-01-19 23:43:47 +00:00
Mark Andrews
938fc81493 document that nslookup defaults to A + AAAA lookups 2020-01-19 23:14:07 +00:00
Mark Andrews
df709dcf8a Merge branch 'marka-check-CHANGES-SE-in-CI' into 'master'
Check CHANGES.SE in CI

See merge request isc-projects/bind9!2912
2020-01-17 21:09:16 +00:00
Mark Andrews
05f2ba973f check that CHANGES.SE entries are correctly ordered and that whitespace is correct 2020-01-17 09:31:10 +11:00
Michał Kępień
9c5547b118 Merge branch 'michal/fix-the-dnssec-system-test-on-windows' into 'master'
Fix the "dnssec" system test on Windows

See merge request isc-projects/bind9!2902
2020-01-16 08:49:13 +00:00
Michał Kępień
451484b870 Fix the "dnssec" system test on Windows
Make sure carriage return characters are stripped from awk input to
enable the "dnssec" system test to pass on Windows.
2020-01-16 09:48:01 +01:00
Evan Hunt
aac8736998 Merge branch 'prep-v9_15_8' into 'master'
prep 9.15.8

See merge request isc-projects/bind9!2901
2020-01-16 08:21:28 +00:00
Tinderbox User
05f2241fcb prep 9.15.8 2020-01-16 08:01:20 +00:00
Evan Hunt
48989e9426 Merge branch 'each-add-relnotes-v9_15_8' into 'master'
add release notes for  9.15.8

See merge request isc-projects/bind9!2900
2020-01-16 07:41:10 +00:00
Evan Hunt
1af6de6b62 add release notes for 9.15.8 bugs and changes, and fix CHANGES errors 2020-01-16 08:33:31 +01:00
Evan Hunt
95c76e537f Add empty release notes section for BIND 9.15.8 2020-01-16 08:32:34 +01:00
Evan Hunt
e19819457b Merge branch '1561-ncache-validation-crash' into 'master'
fix a bug when validating negative cache entries

Closes #1561

See merge request isc-projects/bind9!2899
2020-01-15 22:15:36 +00:00
Evan Hunt
8b9a3314b1 CHANGES 2020-01-15 13:55:33 -08:00
Evan Hunt
fa04c87578 add system test of insecurity proof from negative cache 2020-01-15 13:55:33 -08:00
Evan Hunt
6a1c41143f fix a bug when validating negative cache entries
if validator_start() is called with validator->event->message set to
NULL, we can't use message->rcode to decide which negative proofs are
needed, so we use the rdataset attributes instead to determine whether
the rdataset was cached as NXDOMAIN or NODATA.
2020-01-15 13:55:33 -08:00
Witold Krecicki
4c1adf96de Merge branch 'wpk/fix-interface-reconfig-crashes' into 'master'
Fix interface reconfig crashes

See merge request isc-projects/bind9!2898
2020-01-15 16:56:55 +00:00
Witold Kręcicki
eda4300bbb netmgr: have a single source of truth for tcpdns callback
We pass interface as an opaque argument to tcpdns listening socket.
If we stop listening on an interface but still have in-flight connections
the opaque 'interface' is not properly reference counted, and we might
hit a dead memory. We put just a single source of truth in a listening
socket and make the child sockets use that instead of copying the
value from listening socket. We clean the callback when we stop listening.
2020-01-15 17:22:13 +01:00
Witold Kręcicki
0d637b5985 netmgr: we can't uv_close(sock->timer) when in sock->timer close callback 2020-01-15 14:56:40 +01:00
Ondřej Surý
1bee87a364 Merge branch 'wpk/fix-uvtransfers-on-windows' into 'master'
Fixes for netmgr on Windows after recent TCP changes

See merge request isc-projects/bind9!2896
2020-01-15 13:50:10 +00:00
Witold Kręcicki
525c583145 netmgr:
- isc__netievent_storage_t was to small to contain
   isc__netievent__socket_streaminfo_t on Windows
 - handle isc_uv_export and isc_uv_import errors properly
 - rewrite isc_uv_export and isc_uv_import on Windows
2020-01-15 14:08:44 +01:00
Michał Kępień
0cf47ed363 Merge branch '1493-make-hazard-pointers-dynamic' into 'master'
Make hazard pointers max_threads configurable at runtime.

Closes #1493

See merge request isc-projects/bind9!2885
2020-01-15 07:56:58 +00:00
Witold Kręcicki
ea7cc30f7c CHANGES 2020-01-15 08:55:39 +01:00
Witold Kręcicki
493b6a9f33 Make hazard pointers max_threads configurable at runtime.
hp implementation requires an object for each thread accessing
a hazard pointer. previous implementation had a hardcoded
HP_MAX_THREAD value of 128, which failed on machines with lots of
CPU cores (named uses 3n threads). We make isc__hp_max_threads
configurable at startup, with the value set to 4*named_g_cpus.
It's also important for this value not to be too big as we do
linear searches on a list.
2020-01-14 21:26:57 +01:00
Evan Hunt
1639dc8dca Merge branch 'each-allow-ds-with-key' into 'master'
allow DS with key trust anchors

See merge request isc-projects/bind9!2892
2020-01-14 19:56:16 +00:00
Evan Hunt
fc36798a81 allow both key and DS trust anchors to be used for the same name. 2020-01-14 11:17:30 -08:00
Evan Hunt
72b3b458d3 Merge branch '1237-keytable-refactoring' into 'master'
Resolve "refactor dns_keytable"

Closes #1237

See merge request isc-projects/bind9!2798
2020-01-14 18:10:16 +00:00
Evan Hunt
6799a222d1 keep the keynode attached as long as dsset is in use
when using the trust anchor dsset as val->dsset, keep a reference
to the keynode so dsset can't be freed.
2020-01-14 09:26:19 -08:00
Evan Hunt
2d249ebeae make dns_keytable_deletekey() work correctly
it now removes matching trust anchors from from the dslist while leaving
the other trust anchors in place.

also cleaned up the API to remove functions that were never being used.
2020-01-14 09:26:13 -08:00
Evan Hunt
678e2d3cfa fix a bug with the insertion of DS records into existing keynodes
NOTE: the keytable test is still failing because dns_keytable_deletekey()
is looking for exact matches in keynodes containing dst_key objects,
which no keynode has anymore.
2020-01-14 09:24:23 -08:00
Evan Hunt
b984a4b647 disable adding keys to keytable; only DS trust anchors can now be added
the internal keytable structure has not yet been changed, but
insertion of DS anchors is the only method now available.

NOTE: the keytable unit test is currently failing because of tests
that expect individual keynode objects to contain single DST key
objects.
2020-01-14 09:24:22 -08:00
Evan Hunt
7fdf40770f remove all code that uses non-DS trust anchors
as initial-key and static-key trust anchors will now be stored as a
DS rrset, code referencing keynodes storing DNSKEY trust anchors will
no longer be reached.
2020-01-14 09:24:13 -08:00
Evan Hunt
21d3f66f1c rename dns_keytable_deletekeynode to dns_keytable_deletekey
this function is used by dns_view_untrust() to handle revoked keys, so
it will still be needed after the keytable/validator refactoring is
complete, even though the keytable will be storing DS trust anchors
instead of keys. to simplify the way it's called, it now takes a DNSKEY
rdata struct instead of a DST key.
2020-01-14 09:23:21 -08:00
Ondřej Surý
8f902a72ff Merge branch '1396-document-bind-9-15-x-need-for-pkg-config' into 'master'
Fail the autoconf script early if pkg-config is not present.

Closes #1396

See merge request isc-projects/bind9!2889
2020-01-14 13:31:17 +00:00
Ondřej Surý
fc9c7025bc Fail the autoconf script early if pkg-config is not present. 2020-01-14 14:07:36 +01:00
Ondřej Surý
4f74e75632 Merge branch 'ondrej/more-conversions-to-isc_refcount-API' into 'master'
Convert more reference counting to isc_refcount API

See merge request isc-projects/bind9!2153
2020-01-14 12:16:17 +00:00
Ondřej Surý
3000f14eba Use isc_refcount_increment0() when reusing handle or socket; remove extra DbC checks 2020-01-14 13:12:13 +01:00
Ondřej Surý
4d1e3b1e10 Move the NO_SANITIZE attribute to a correct place (gcc is picky) 2020-01-14 13:12:13 +01:00
Ondřej Surý
ede2208d96 ATOMIC_VAR_INIT() must be used only for static variables (C17) 2020-01-14 13:12:13 +01:00
Ondřej Surý
c4aec79079 When compiling with MSVC, use inline functions for isc_refcount_increment/decrement 2020-01-14 13:12:13 +01:00
Ondřej Surý
49976947ab Restore DbC checks in isc_refcount API
The isc_refcount API that provides reference counting lost DbC checks for
overflows and underflows in the isc_refcount_{increment,decrement} functions.

The commit restores the overflow check in the isc_refcount_increment and
underflows check in the isc_refcount_decrement by checking for the previous
value to not be on the boundary.
2020-01-14 13:12:13 +01:00
Ondřej Surý
a910b0a839 Protect globally accessed variables in rndc.c by making them C11 atomic 2020-01-14 13:12:13 +01:00
Ondřej Surý
64e2331843 Convert global responses variable in dispatch_test to C11 atomics 2020-01-14 13:12:13 +01:00
Ondřej Surý
6afa99362a Remove duplicate INSIST checks for isc_refcount API
This commits removes superfluous checks when using the isc_refcount API.

Examples of superfluous checks:

1. The isc_refcount_decrement function ensures there was not underflow,
   so this check is superfluous:

    INSIST(isc_refcount_decrement(&r) > 0);

2 .The isc_refcount_destroy() includes check whether the counter
   is zero, therefore this is superfluous:

    INSIST(isc_refcount_decrement(&r) == 1 && isc_refcount_destroy(&r));
2020-01-14 13:12:13 +01:00
Ondřej Surý
e711b0304f Convert more reference counting to isc_refcount API 2020-01-14 13:12:13 +01:00
Ondřej Surý
7c3e342935 Use isc_refcount_increment0() where appropriate 2020-01-14 13:12:13 +01:00
Ondřej Surý
9ce3254a1b Improve code style when checking old references values 2020-01-14 13:12:13 +01:00
Ondřej Surý
7dfc092f06 Use C11 atomics for nfctx, kill unused dns_resolver_nrunning() 2020-01-14 13:12:13 +01:00
Ondřej Surý
5208505f03 Use dns_keytable_attachkeynode() and switch to C11 atomics for .active_nodes 2020-01-14 13:12:13 +01:00
Ondřej Surý
fbf9856f43 Add isc_refcount_destroy() as appropriate 2020-01-14 13:12:13 +01:00
Witold Krecicki
4643ee04bd Merge branch 'wpk-netmgr-tcp-error-handling' into 'master'
netmgr: handle errors properly in accept_connection.

See merge request isc-projects/bind9!2880
2020-01-14 12:05:25 +00:00
Witold Krecicki
b665ce2a96 CHANGES 2020-01-14 11:06:02 +01:00
Witold Krecicki
6ee1461cc3 netmgr: handle errors properly in accept_connection.
If a connection was closed early (right after accept()) an assertion
that assumed that the connection was still alive could be triggered
in accept_connection. Handle those errors properly and not with
assertions, free all the resources afterwards.
2020-01-14 11:03:06 +01:00
Mark Andrews
0d4d65e7f2 Merge branch '1531-add-calls-to-dns_rdata_additionaldata-to-lib-dns-tests-rdata_test-c' into 'master'
Resolve "Add calls to dns_rdata_additionaldata to lib/dns/tests/rdata_test.c"

Closes #1531

See merge request isc-projects/bind9!2795
2020-01-14 04:44:58 +00:00
Mark Andrews
b3c1b2a869 exercise dns_rdata_checknames 2020-01-14 15:01:09 +11:00
Mark Andrews
649a34d628 exercise dns_rdata_additionaldata 2020-01-14 03:49:11 +00:00
Mark Andrews
5e74550740 call dns_rdata_towire on valid output from dns_rdata_fromtext and dns_rdata_fromwire 2020-01-14 03:49:11 +00:00
Evan Hunt
6ad0133156 Merge branch '1311-netmgr-stats' into 'master'
Resolve "netmgr doesn't count networking statistics"

Closes #1311

See merge request isc-projects/bind9!2844
2020-01-14 00:10:06 +00:00
Evan Hunt
c3ed086cf0 CHANGES 2020-01-13 14:09:42 -08:00
Evan Hunt
5234a8e00a count statistics in netmgr TCP code 2020-01-13 14:09:42 -08:00
Evan Hunt
90a1dabe74 count statistics in netmgr UDP code
- also restored a test in the statistics test which was changed when
  the netmgr was introduced because active sockets were not being
  counted.
2020-01-13 14:09:37 -08:00
Evan Hunt
80a5c9f5c8 associate socket stats counters with netmgr socket objects
- the socket stat counters have been moved from socket.h to stats.h.
- isc_nm_t now attaches to the same stats counter group as
  isc_socketmgr_t, so that both managers can increment the same
  set of statistics
- isc__nmsocket_init() now takes an interface as a paramter so that
  the address family can be determined when initializing the socket.
- based on the address family and socket type, a group of statistics
  counters will be associated with the socket - for example, UDP4Active
  with IPv4 UDP sockets and TCP6Active with IPv6 TCP sockets.  note
  that no counters are currently associated with TCPDNS sockets; those
  stats will be handled by the underlying TCP socket.
- the counters are not actually used by netmgr sockets yet; counter
  increment and decrement calls will be added in a later commit.
2020-01-13 14:05:02 -08:00
Witold Krecicki
a4ec0ccb91 Merge branch 'wpk-no-ipc-tcp-passing' into 'master'
Pass TCP listening sockets using async channel, not IPC

Closes #1433, #1499, and #1500

See merge request isc-projects/bind9!2825
2020-01-13 21:50:33 +00:00
Witold Kręcicki
7a7b09fee6 CHANGES note 2020-01-13 22:00:31 +01:00
Witold Kręcicki
20c077afc5 Disable pktinfo for ipv6 on all unices
If pktinfo were supported then we could listen on :: for ipv6 and get
the information about the destination address from pktinfo structure passed
in recvmsg but this method is not portable and libuv doesn't support it - so
we need to listen on all interfaces.
We should verify that this doesn't impact performance (we already do it for
ipv4) and either remove all the ipv6pktinfo detection code or think of fixing
libuv.
2020-01-13 22:00:20 +01:00
Evan Hunt
e38004457c netmgr fixes:
- use UV_{TC,UD}P_IPV6ONLY for IPv6 sockets, keeping the pre-netmgr
   behaviour.
 - add a new listening_error bool flag which is set if the child
   listener fails to start listening. This fixes a bug where named would
   hang if, e.g.,  we failed to bind to a TCP socket.
2020-01-13 10:54:17 -08:00
Witold Kręcicki
67c1ca9a79 Use isc_uv_export() to pass bound TCP listening socket to child listeners.
For multithreaded TCP listening we need to pass a bound socket to all
listening threads. Instead of using uv_pipe handle passing method which
is quite complex (lots of callbacks, each of them with its own error
handling) we now use isc_uv_export() to export the socket, pass it as a
member of the isc__netievent_tcpchildlisten_t structure, and then
isc_uv_import() it in the child thread, simplifying the process
significantly.
2020-01-13 10:53:44 -08:00
Witold Kręcicki
c6c0a9fdba Add isc_uv_export()/isc_uv_import() functions to libuv compatibility layer.
These functions can be used to pass a uv handle between threads in a
safe manner. The other option is to use uv_pipe and pass the uv_handle
via IPC, which is way more complex.  uv_export() and uv_import() functions
existed in libuv at some point but were removed later. This code is
based on the original removed code.

The Windows version of the code uses two functions internal to libuv;
a patch for libuv is attached for exporting these functions.
2020-01-13 10:52:07 -08:00
Michal Nowak
ab1adcca98 Merge branch 'mnowak/add-openSUSE-Tumblewed-image' into 'master'
Add openSUSE Tumbleweed image to the CI

Closes #1303

See merge request isc-projects/bind9!2826
2020-01-13 16:26:06 +00:00
Michal Nowak
3526c73062 Add openSUSE Tumbleweed image to the CI
Ensure BIND is continuously tested on Tumbleweed, a pure rolling release
version of openSUSE.  This will allow BIND incompatibilities with latest
upstream versions of its dependencies to be caught more quickly.
2020-01-13 16:26:05 +00:00
Michał Kępień
7787de80ca Merge branch '1552-properly-detect-mmdb-lookup-failures' into 'master'
Properly detect MMDB lookup failures

Closes #1552

See merge request isc-projects/bind9!2864
2020-01-13 13:55:54 +00:00
Michał Kępień
aa96ec25c8 Add CHANGES entry
5339.	[bug]		With some libmaxminddb versions, named could erroneously
			match an IP address not belonging to any subnet defined
			in a given GeoIP2 database to one of the existing
			entries in that database. [GL #1552]
2020-01-13 14:32:19 +01:00
Michał Kępień
ec8334fb74 Properly detect MMDB lookup failures
Only comparing the value of the integer passed as the last argument to
MMDB_lookup_sockaddr() against MMDB_SUCCESS is not enough to ensure that
an MMDB lookup was successful - the 'found_entry' field of the
MMDB_lookup_result_s structure returned by that function also needs to
be true or else the remaining contents of that structure should be
ignored as the lookup failed.  Extend the relevant logical condition in
get_entry_for() to ensure the latter does not return incorrect MMDB
entries for IP addresses which do not belong to any subnet defined in a
given GeoIP2 database.
2020-01-13 14:32:19 +01:00
Ondřej Surý
8797d8ad08 Merge branch '1507-warning-threadsanitizer-data-race-lib-isc-tests-socket_test-simple' into 'master'
Address dns_zt_asyncload races by properly using isc_reference_*.

Closes #1507

See merge request isc-projects/bind9!2870
2020-01-13 11:11:11 +00:00
Mark Andrews
72f0e01f5d Address dns_zt_asyncload races by properly using isc_reference_*. 2020-01-13 11:33:31 +01:00
Ondřej Surý
423a627946 Merge branch 'doc-binaryflesh' into 'master'
Update documentation pertaining to platform support

See merge request isc-projects/bind9!2786
2020-01-13 10:32:51 +00:00
Logan Campos
42384f367a update windows versions supported 2020-01-13 11:08:18 +01:00
Logan Campos
6056efc3ce make commit-arm executable 2020-01-13 11:08:18 +01:00
Ondřej Surý
2eaab4042b Update copyrights 2020-01-13 11:08:18 +01:00
Logan Campos
c17783b99e make git aware XML docbooks are only asset ARM needs to track 2020-01-13 11:08:18 +01:00
Logan Campos
343c6d357c update platform compatiblity documentation 2020-01-13 11:08:18 +01:00
Logan Campos
933df7b31c change context of WWW to HTTP 2020-01-13 11:08:17 +01:00
Logan Campos
136dcfd692 Update dated platform compatibility documentation. 2020-01-13 11:08:17 +01:00
Ondřej Surý
98136164aa Merge branch '1555-code-with-pthread-specific-semantics-is-not-portable' into 'master'
Resolve "Code with pthread specific semantics is not portable"

Closes #1555

See merge request isc-projects/bind9!2868
2020-01-13 08:54:54 +00:00
Ondřej Surý
afc4867e99 Remove use of PTHREAD_MUTEX_INITIALIZER in tests
Remove the pthread specific static initializer in favor of dynamic
initialization.
2020-01-13 09:09:03 +01:00
Ondřej Surý
4f7d1298a8 Use isc_threadresult_t instead of pthread specific void * return type
The ISC thread API already defines isc_threadresult_t type,
but we are using a pthread specific return type (void *).
2020-01-13 09:08:48 +01:00
Mark Andrews
84b557e7cb Merge branch 'u/fanf2/rndc-secroots-newlines' into 'master'
Fix line spacing in `rndc secroots`

See merge request isc-projects/bind9!2478
2020-01-13 05:48:09 +00:00
Tony Finch
5b600c2cd8 Fix line spacing in rndc secroots
Before this change, there was a missing blank line between the
negative trust anchors for one view, and the heading line for the next
view. This is because dns_ntatable_totext() omits the last newline.
There is an example of the incorrect output below; the fixed output
has a blank line before "Start view auth".

secure roots as of 21-Oct-2019 12:03:23.500:

 Start view rec
   Secure roots:

./RSASHA256/20326 ; managed

   Negative trust anchors:

example.com: expiry 21-Oct-2019 13:03:15.000
 Start view auth
   Secure roots:

./RSASHA256/20326 ; managed

   Negative trust anchors:

example.com: expiry 21-Oct-2019 13:03:07.000
2020-01-13 05:48:09 +00:00
Michał Kępień
b1b1bae9c1 Merge branch 'michal/update-gitlab-ci-to-alpine-linux-3.11' into 'master'
Update GitLab CI to Alpine Linux 3.11

See merge request isc-projects/bind9!2799
2020-01-10 11:42:55 +00:00
Michał Kępień
bebf353eb5 Update GitLab CI to Alpine Linux 3.11
Since Alpine Linux 3.11 is the current Alpine Linux release, replace
Alpine Linux 3.10 GitLab CI jobs with their up-to-date counterparts.
2020-01-10 11:23:56 +01:00
Michał Kępień
6acbd31bd4 Merge branch 'michal/bind-to-random-port-numbers-in-unit-tests' into 'master'
Bind to random port numbers in unit tests

See merge request isc-projects/bind9!2831
2020-01-09 09:32:36 +00:00
Michał Kępień
ea7bddb4ca Bind to random port numbers in unit tests
Some unit tests need various managers to be created before they are run.
The interface manager spawned during libns tests listens on a fixed port
number, which causes intermittent issues when multiple tests using an
interface manager are run concurrently.  Make the interface manager
listen on a randomized port number to greatly reduce the risk of
multiple unit tests using the same port concurrently.
2020-01-09 09:32:25 +00:00
Michal Nowak
423eee834a Merge branch 'mnowak/1546-Add-out-of-tree-build-to-CI' into 'master'
Out-of-tree build: build job and a fix

Closes #1547 and #1546

See merge request isc-projects/bind9!2810
2020-01-09 09:24:38 +00:00
Michal Nowak
640dd566e9 Add out-of-tree build to the CI
Fixes #1546.
2020-01-09 10:16:06 +01:00
Ondřej Surý
fb2f98a9a1 Merge branch '1476-threadsanitizer-data-race-lib-isc-log-multiple-issues-lock' into 'master'
Resolve "ThreadSanitizer: data race lib/isc/log.c - multiple issues"

Closes #1476

See merge request isc-projects/bind9!2823
2020-01-08 11:50:41 +00:00
Ondřej Surý
17deac8b8e Remove unused isc_log_get() function 2020-01-08 11:53:04 +01:00
Ondřej Surý
91e1981988 Add missing locks to isc_logconfig_get and disable thread sanitizer for isc_log_wouldlog 2020-01-08 11:53:04 +01:00
Ondřej Surý
255134166c Add conditional ISC_NO_SANITIZE macro to disable TSAN for function 2020-01-08 11:53:04 +01:00
Ondřej Surý
3bce0c2c20 Merge branch '1525-inline-system-test-failed-need-to-wait-for-zone-to-be-loaded' into 'master'
Resolve "inline system test failed, need to wait for zone to be loaded."

Closes #1525

See merge request isc-projects/bind9!2796
2020-01-08 07:23:42 +00:00
Mark Andrews
2dc4d72fa9 address some timing issues in inline system test 2020-01-08 08:23:03 +01:00
Ondřej Surý
cd17b773b1 Merge branch '1513-inline-system-test-failed' into 'master'
Resolve "inline system test failed"

Closes #1513

See merge request isc-projects/bind9!2777
2020-01-08 07:17:47 +00:00
Mark Andrews
13fa80ede8 Address timing issues in 'inline' system test.
"rndc signing -serial <value>" could take longer than a second to
complete.  Loop waiting for update to succeed.

For tests where "rndc signing -serial <value>" is supposed to not
succeed, repeatedly test that we don't get the new serial, then
test that we have the old value.  This should prevent false negatives.
2020-01-07 16:14:12 +01:00
Ondřej Surý
e3d8732548 Merge branch '1467-xfer-test-suppress-zone-transfer-when-we-are-going-to-retry' into 'master'
Resolve "xfer test: suppress zone transfer when we are going to retry."

Closes #1467

See merge request isc-projects/bind9!2735
2020-01-07 13:56:35 +00:00
Mark Andrews
05aa45c602 improve forensic logs
improve forensic logs by directing output to per sub-test named
files and reporting the sub-subtest number.
2020-01-07 14:23:48 +01:00
Mark Andrews
9bd6720f58 suppress unnecessary zone transfer
suppressed unnecessary zone transfer in "test mapped zone with
out of zone data" sub-test.
2020-01-07 14:23:17 +01:00
Mark Andrews
46982b414b Improve forensic logging in "testing basic zone transfer functionality"
Split the "testing basic zone transfer functionality" into primary and
secondary parts to improve forensic logging.
2020-01-07 14:23:08 +01:00
Matthijs Mekking
2c38dd5474 Merge branch 'copyrights-2020' into 'master'
Update copyrights 2020

See merge request isc-projects/bind9!2809
2020-01-06 17:53:09 +00:00
Matthijs Mekking
935a2ae33f Update copyrights 2020
Happy New Year!
2020-01-06 15:05:03 +01:00
Michal Nowak
db9ad43294 Merge branch 'mnowak/get-the-backtraces-out-of-unit-test-coredumps' into 'master'
Gather debug info on broken unit tests

See merge request isc-projects/bind9!2699
2020-01-06 11:25:09 +00:00
Michal Nowak
6a94e6ba73 Gather debug info on broken unit tests 2020-01-06 11:25:09 +00:00
Michał Kępień
fc0fe4c5a7 Merge branch 'michal/misc-doc-fixes' into 'master'
Miscellaneous documentation fixes

See merge request isc-projects/bind9!2800
2020-01-03 08:24:18 +00:00
Michał Kępień
56f388cae1 Fix minor CHANGES issues 2020-01-03 09:08:09 +01:00
Michał Kępień
b2f3eaf188 Fix whitespace and punctuation in release notes 2020-01-03 09:08:09 +01:00
Michał Kępień
2d00143ab1 Prevent splitting GitLab identifiers across lines
GitLab issue and merge request numbers placed in release notes (in the
form of "#1234" for issues and "!5678" for merge requests) should not be
split across two lines.  Extend the shell pipeline generating
doc/arm/notes.txt with a sed invocation which prevents such splitting.
2020-01-03 09:08:09 +01:00
Evan Hunt
996c1d3727 Merge branch 'each-copyrights' into 'master'
update copyright year to 2020

See merge request isc-projects/bind9!2801
2020-01-03 05:53:01 +00:00
Evan Hunt
2df13f79ef update copyright year to 2020 2020-01-02 21:45:30 -08:00
Mark Andrews
993633ad96 Merge branch '1530-lib-dns-gen-c-29-26-fatal-error-isc-platform-h-no-such-file-or-directory' into 'master'
Resolve "lib/dns/gen.c:29:26: fatal error: isc/platform.h: No such file or directory"

Closes #1530

See merge request isc-projects/bind9!2792
2019-12-22 21:18:09 +00:00
Mark Andrews
848c1c8b8b remove duplicate #includes 2019-12-23 07:47:36 +11:00
Mark Andrews
7278f2529a revert d10fbdec for lib/dns/gen.c as it is a build platform executable 2019-12-23 07:37:13 +11:00
Mark Andrews
39780ae54f Merge branch '1501-summary-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_rwlock_wrlock' into 'master'
Resolve "SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock - zone_postload"

See merge request isc-projects/bind9!2776
2019-12-20 10:57:43 +00:00
Mark Andrews
d26e125438 Refactor loop body as copy_non_dnssec_records. 2019-12-20 21:31:23 +11:00
Ondřej Surý
bff83b9480 Add failure handling when iterators don't end with ISC_R_NOMORE 2019-12-20 21:31:23 +11:00
Ondřej Surý
6012479419 Refactor receive_secure_db to make the variables and code flow around the iterator more local 2019-12-20 21:31:23 +11:00
Mark Andrews
9d8f9cc8f2 Call dns_dbiterator_destroy earlier to prevent potential deadlock. 2019-12-20 21:31:23 +11:00
Mark Andrews
dafb1eb8bb Merge branch '1523-pkcs11-destroy-s-usage-message-is-misleading' into 'master'
Resolve "pkcs11-destroy's usage message is misleading"

Closes #1523

See merge request isc-projects/bind9!2785
2019-12-20 08:56:11 +00:00
Mark Andrews
41d827893e update usage message 2019-12-20 08:28:37 +00:00
Mark Andrews
3352a38da4 Merge branch '1418-threadsanitizer-data-race-dig-c-2542-in-main' into 'master'
Resolve "ThreadSanitizer: data race dig.c:2542 in main"

Closes #1418

See merge request isc-projects/bind9!2647
2019-12-20 05:57:50 +00:00
Ondřej Surý
b218bf5227 Fix the concurrent access to batchname in dig.c 2019-12-20 03:43:04 +00:00
Mark Andrews
f8ec2140be Merge branch 'feature/master/maxminddb-version' into 'master'
Include maxminddb and protobuf version in named -V

See merge request isc-projects/bind9!2686
2019-12-17 23:58:31 +00:00
Mark Andrews
2f2bc03b2d add CHANGES 2019-12-18 10:57:25 +11:00
Petr Menšík
85f3476894 Include protobuf-c version
Include used version of protobuf-c in version info, both link time and
runtime version is available.
2019-12-17 23:46:52 +00:00
Petr Menšík
e6d7384c0d Provide GeoIP2 library version in version
Libmaxmind does not provide any version macro for link time version.
Print at least runtime version library used, if linked.
2019-12-17 23:46:52 +00:00
Mark Andrews
0b7339ac6e Merge branch '1482-autosign-system-test-failed' into 'master'
Resolve "autosign system test failed"

Closes #1461 and #1482

See merge request isc-projects/bind9!2773
2019-12-13 08:58:14 +00:00
Mark Andrews
17d25dbf47 Fix autosign system test issues.
* report when NSEC3PARAM is not yet present
* allow more time for NSEC3PARAM to become present
* adjust frequency failure message
2019-12-13 08:31:56 +00:00
Ondřej Surý
c2421a1ec3 Merge branch '1414-threadsanitizer-data-race-task-c-367-in-task_shutdown-v9_14+' into 'master'
Convert task->flags to C11 atomics

Closes #1414

See merge request isc-projects/bind9!2768
2019-12-13 07:41:53 +00:00
Ondřej Surý
5746172da3 Convert task flags to C11 atomics 2019-12-13 07:10:25 +01:00
Evan Hunt
de42a7aa9f Merge branch 'prep-release-v9_15_7' into 'master'
Prep 9.15.7

See merge request isc-projects/bind9!2771
2019-12-13 00:00:45 +00:00
Tinderbox User
67bac2bcd9 Merge branch 'prep-release' 2019-12-12 23:59:51 +00:00
Tinderbox User
e088272172 prep 9.15.7 2019-12-12 23:59:39 +00:00
Evan Hunt
a3dc02103a Merge branch '1392-initial-tcp-highwater-wrong' into 'master'
Resolve "Initial TCP high-water value is wrong"

Closes #1392

See merge request isc-projects/bind9!2610
2019-12-12 19:52:36 +00:00
Evan Hunt
8c48c4f738 CHANGES 2019-12-12 11:24:26 -08:00
Diego Fronza
114520425c Added tcp-highwater test on initial statistics verification
The initial tcp statistics test was not testing tcp-highwater counter,
but only initial number of current TCP clients, so this missing test was
added to ensure initial tcp-highwater value is correct.
2019-12-12 11:23:11 -08:00
Diego Fronza
ed9853e739 Fix tcp-highwater stats updating
After the network manager rewrite, tcp-higwater stats was only being
updated when a valid DNS query was received over tcp.

It turns out tcp-quota is updated right after a tcp connection is
accepted, before any data is read, so in the event that some client
connect but don't send a valid query, it wouldn't be taken into
account to update tcp-highwater stats, that is wrong.

This commit fix tcp-highwater to update its stats whenever a tcp connection
is established, independent of what happens after (timeout/invalid
request, etc).
2019-12-12 11:23:10 -08:00
Diego Fronza
ead7b3dc53 Fix tcp-highwater initial value
During BIND startup it scans for network interfaces available, in this
process it ensures that for every interface it will bind and listen to,
at least one socket will be always available accepting connections on
that interface, this way avoiding some DOS attacks that could exploit
tcp quota on some interface and make others unavailable.

In the previous network implementation this initial "reserved" tcp-quota
used by BIND was already been added to the tcp-highwater stats, but with
the new network code it was necesary to add this workaround to ensure
tcp-highwater stats reflect the tcp-quota used by BIND after startup.
2019-12-12 11:23:10 -08:00
Ondřej Surý
74082abba0 Merge branch '1497-threadsanitizer-data-race-lib-isc-unix-socket-c-1839-2-in-destroy' into 'master'
Add missing isc_refcount_destroy and lock the socket ISC_LISTS in destroy()

Closes #1497

See merge request isc-projects/bind9!2767
2019-12-12 14:14:45 +00:00
Ondřej Surý
d5b6db3b09 Additionally lock accessing the ISC_LISTs in free_socket() 2019-12-12 13:08:34 +01:00
Ondřej Surý
d35739d516 Add missing isc_refcount_destroy and lock the socket ISC_LISTS in destroy() 2019-12-12 12:59:39 +01:00
Mark Andrews
6f3fdf36b4 Merge branch '1486-threadsanitizer-lock-order-inversion-potential-deadlock-dns_resolver_createfetch-vs' into 'master'
Resolve "ThreadSanitizer: lock-order-inversion (potential deadlock) - dns_resolver_createfetch vs dns_resolver_shutdown"

Closes #1471 and #1486

See merge request isc-projects/bind9!2760
2019-12-12 09:04:32 +00:00
Mark Andrews
62abb6aa82 make resolver->zspill atomic to prevent potential deadlock 2019-12-12 08:26:59 +00:00
Mark Andrews
a6f2d6191e Merge branch '1494-lock-order-inversion-potential-deadlock-nm_thread-vs-nm_destroy' into 'master'
Resolve "lock-order-inversion (potential deadlock) - nm_thread vs nm_destroy"

Closes #1494

See merge request isc-projects/bind9!2763
2019-12-12 08:26:24 +00:00
Mark Andrews
ad12c2f3b0 address lock order inversion 2019-12-12 17:43:03 +11:00
Ondřej Surý
80c476721c Merge branch '1423-threadsanitizer-data-race-time-c-170-in-isc_time_nowplusinterval' into 'master'
Ensure all zone_settimer() calls are done on locked zone

Closes #1423

See merge request isc-projects/bind9!2738
2019-12-12 06:15:20 +00:00
Ondřej Surý
cf48e8eb32 Ensure all zone_settimer() calls are done on locked zone 2019-12-11 22:58:59 +00:00
Evan Hunt
8536d740f1 Merge branch 'michal/prepare-release-notes-for-bind-9.15.7' into 'master'
Prepare release notes for BIND 9.15.7

See merge request isc-projects/bind9!2753
2019-12-11 22:15:04 +00:00
Michał Kępień
c428479d6d Prepare release notes for BIND 9.15.7
- Add a GitLab merge request number to the "trust-anchors" release
    note and slightly rephrase its second half.

  - Replace tabs with spaces in doc/arm/notes-9.15.7.xml to retain
    consistency with other XML files containing release notes.

  - Move the "Security Fixes" section for BIND 9.15.6 higher up, for
    consistency with release notes for other versions.
2019-12-11 22:14:22 +00:00
Ondřej Surý
448ada561d Merge branch '1119-enable-thread-sanitizer-in-the-gitlab-ci' into 'master'
Enable ThreadSanitizer enabled build and unit tests

See merge request isc-projects/bind9!2367
2019-12-11 17:03:58 +00:00
Ondřej Surý
b6960da6c8 Enable ThreadSanitizer enabled build, system and unit tests 2019-12-11 17:24:05 +01:00
Michal Nowak
7ee4ff6182 Merge branch 'mnowak/fedora31' into 'master'
Update GitLab CI to Fedora 31

See merge request isc-projects/bind9!2662
2019-12-11 15:25:17 +00:00
Michal Nowak
7aa77038bd Update GitLab CI to Fedora 31
Since Fedora 31 is the current Fedora release, replace Fedora 30 GitLab
CI jobs with their up-to-date counterparts.
2019-12-11 15:25:17 +00:00
Michał Kępień
94bddd2ce3 Merge branch 'michal/update-release-checklist' into 'master'
Update release checklist

See merge request isc-projects/bind9!2751
2019-12-11 14:47:55 +00:00
Michał Kępień
e792d01e00 Update release checklist
Apply tweaks necessary to make the release checklist consistent with the
security incident handling checklist.
2019-12-11 15:45:22 +01:00
Michał Kępień
53858d4afd Merge branch 'michal/fix-release-notes-for-bind-9.15.6' into 'master'
Fix release notes for BIND 9.15.6

See merge request isc-projects/bind9!2607
2019-12-11 12:12:13 +00:00
Michał Kępień
88497a59cc Fix release notes for BIND 9.15.6
- Add a missing release note for TCP high-water.  That feature was not
    yet merged when the initial version of !2524 was prepared and its
    release note was missed when that merge request was later rebased.

  - Rephrase the release note for CVE-2019-6477 so that it uses the same
    text as its corresponding notes in all other releases.

  - Unify whitespace in doc/arm/notes-9.15.6.xml.
2019-12-11 13:11:22 +01:00
Michał Kępień
b0f7351820 Merge branch 'michal/create-release-tarballs-in-gitlab-ci' into 'master'
Create release tarballs in GitLab CI

See merge request isc-projects/bind9!2745
2019-12-11 11:04:45 +00:00
Michał Kępień
922a2ae44a Drop Jenkins mentions from release issue template
Update the release issue template to account for the fact that Jenkins
is no longer needed for creating BIND release tarballs.
2019-12-11 12:04:29 +01:00
Michał Kępień
5a4a6b5e91 Add a job creating a release tarball to GitLab CI
Add a GitLab CI job (which is run only if all other jobs in a pipeline
succeed) that builds a BIND release tarball, i.e. fetches the source
tarball from the tarball building job, creates Windows zips, puts
certain parts of BIND documentation into the appropriate places, and
packs it all up into a single tarball whose contents can be subsequently
signed and published.
2019-12-11 12:04:29 +01:00
Michał Kępień
2b1c8c54d1 Add a Windows debug system test job to GitLab CI
Add a system test job for binaries created by Visual Studio in the
"Debug" build configuration to GitLab CI so that they can be tested
along their "Release" counterparts when necessary.
2019-12-11 12:04:29 +01:00
Michał Kępień
12564928a7 Add a Windows debug build job to GitLab CI
Add a Visual Studio build job using the "Debug" build configuration to
GitLab CI without enabling it for every pipeline as it takes about twice
as long to complete as its "Release" counterpart.
2019-12-11 12:04:29 +01:00
Michał Kępień
8d56749046 Create and test BIND source tarballs in GitLab CI
Add a set of jobs to GitLab CI that create a BIND source tarball and
then build and test its contents.  Run those extra jobs only when a tag
is pushed to the Git repository as they are only meant to be sanity
checks of BIND source tarball contents.
2019-12-11 12:04:29 +01:00
Michał Kępień
c0be772ebc Include prepare-softhsm2.sh in source tarballs
The util/prepare-softhsm2.sh script is useful for initializing a working
SoftHSM environment which can be used by unit tests and system tests.
However, since it is a test-specific script, it does not really belong
in the util/ subdirectory which is mostly pruned during the BIND source
tarball creation process.  Move the prepare-softhsm2.sh script to
bin/tests/ so that its location is more appropriate for its purpose and
also so that it does not get removed during the BIND source tarball
creation process, allowing it to be used for setting up test
environments for tarball-based builds.
2019-12-11 12:04:29 +01:00
Michał Kępień
925ecb0aae List paths which should be excluded from tarballs
Convert the logic (currently present in the form of "rm -rf" calls in
util/kit.sh) for removing files and directories which are tracked by Git
but redundant in release tarballs into a set of .gitattributes rules
which allow the same effect to be achieved using "git archive".
2019-12-11 12:04:29 +01:00
Michał Kępień
eee162257c Merge branch 'michal/fix-the-forward-system-test-on-windows' into 'master'
Fix the "forward" system test on Windows

See merge request isc-projects/bind9!2750
2019-12-11 09:37:35 +00:00
Michał Kępień
075613aea4 Fix the "forward" system test on Windows
Make sure carriage return characters are stripped from sed input to
enable the "forward" system test to pass on Windows.
2019-12-11 09:44:20 +01:00
Mark Andrews
48ece3bb9d Merge branch '1479-_wait_for_rcode-adds-extraneous-query' into 'master'
Resolve "_wait_for_rcode adds extraneous query"

Closes #1479

See merge request isc-projects/bind9!2747
2019-12-11 00:25:07 +00:00
Mark Andrews
0ee0580fc9 consume all arguments we have processed in shift 2019-12-11 00:01:08 +00:00
Mark Andrews
37fe7c5269 Merge branch '1411-threadsanitizer-data-race-resolver-c-2153-in-fctx_query' into 'master'
Resolve "ThreadSanitizer: data race resolver.c:2153 in fctx_query"

Closes #1411

See merge request isc-projects/bind9!2675
2019-12-10 23:53:13 +00:00
Mark Andrews
13aaeaa06f Note bucket lock requirements and move REQUIRE inside locked section. 2019-12-10 22:16:15 +00:00
Mark Andrews
5589748eca lock access to fctx->nqueries 2019-12-10 22:16:15 +00:00
Ondřej Surý
03ed64c251 Merge branch '1473-threadsanitizer-data-race-home-ondrej-projects-bind9-lib-isc-netmgr-netmgr-c-1027-in' into 'master'
Resolve "ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1027 in nmhandle_free"

Closes #1473

See merge request isc-projects/bind9!2739
2019-12-10 13:00:17 +00:00
Ondřej Surý
1fa0deb4ea Add isc_refcount_destroy() call to nm_handle_free() 2019-12-10 13:43:18 +01:00
Ondřej Surý
71fe7d3c25 Add isc_refcount_destroy() call to nm_destroy() 2019-12-10 13:43:18 +01:00
Ondřej Surý
3248de7785 Correct the DbC check order in isc__nm_async_tcpchildstop() 2019-12-10 13:43:18 +01:00
Mark Andrews
977f334648 Merge branch '1441-threadsanitizer-lock-order-inversion-potential-deadlock-usr-lib-x86_64-linux-gnu-libtsan-so-0' into 'master'
Resolve "ThreadSanitizer: lock-order-inversion (potential deadlock) (/usr/lib/x86_64-linux-gnu/libtsan.so.0+0x2cf99) in pthread_rwlock_rdlock"

Closes #1441

See merge request isc-projects/bind9!2734
2019-12-10 12:35:20 +00:00
Mark Andrews
fd52417f71 address deadlock introduced in cd2469d3cd 2019-12-10 12:08:57 +00:00
Michał Kępień
ac564683cf Merge branch '1465-fix-idna-system-test' into 'master'
Fix the "idna" system test

See merge request isc-projects/bind9!2740
2019-12-10 10:57:02 +00:00
Michał Kępień
2ee7ff23ce Only use LC_ALL=C where intended
The LC_ALL=C assignments in the "idna" system test, which were only
meant to affect a certain subset of checks, in fact persist throughout
all the subsequent checks in that system test.  That affects the test's
behavior and is misleading.

When the "VARIABLE=value command ..." syntax is used in a shell script,
in order for the variable assignment to only apply to "command", the
latter must be an external binary; otherwise, the VARIABLE=value
assignment persists for all subsequent commands in a script:

    $ cat foo.sh
    #!/bin/sh

    foo() {
        /bin/sh bar.sh
    }

    BAR="baz0"
    BAR="baz1" /bin/sh bar.sh
    echo "foo: BAR=${BAR}"
    BAR="baz2" foo
    echo "foo: BAR=${BAR}"

    $ cat bar.sh
    #!/bin/sh

    echo "bar: BAR=${BAR}"

    $ /bin/sh foo.sh
    bar: BAR=baz1
    foo: BAR=baz0
    bar: BAR=baz2
    foo: BAR=baz2
    $

Fix by saving the value of LC_ALL before the relevant set of checks in
the "idna" system test, restoring it afterwards, and dropping the
"LC_ALL=C command ..." syntax.
2019-12-10 10:56:19 +01:00
Ondřej Surý
dbbfcdc1f7 Merge branch 'ondrej/run-full-pipeline-on-schedule' into 'master'
Run all jobs on scheduled builds (including OpenBSD and Windows)

See merge request isc-projects/bind9!2736
2019-12-10 09:30:26 +00:00
Ondřej Surý
52773e226a Run all jobs on scheduled builds (including OpenBSD and Windows) 2019-12-10 09:29:12 +00:00
Witold Krecicki
ec80c7b576 Merge branch '1469-lock-order-inversion-tcp-listening' into 'master'
Fix a potential lock-order-inversion in tcp listening code

Closes #1469

See merge request isc-projects/bind9!2737
2019-12-10 09:21:03 +00:00
Witold Kręcicki
ccd44b69e5 Fix a potential lock-order-inversion in tcp listening code 2019-12-10 10:05:15 +01:00
Witold Krecicki
01481dee1c Merge branch 'wpk/tcp-multithreaded' into 'master'
netmgr: make tcp listening multithreaded.

See merge request isc-projects/bind9!2659
2019-12-09 21:20:40 +00:00
Witold Kręcicki
83e54f906d CHANGES entry 2019-12-09 21:44:04 +01:00
Evan Hunt
31b3980ef0 shorten some names
reduce line breaks and general unwieldiness by changing some
function, type, and parameter names.
2019-12-09 21:44:04 +01:00
Evan Hunt
8c0792723d style nits 2019-12-09 21:44:04 +01:00
Witold Kręcicki
35679aef9b unittest: Allow for 32 (not 16) mock nmhandles in ns tests 2019-12-09 21:44:04 +01:00
Witold Kręcicki
a34ced776e Remove read callback before detaching from inner socket in tcpdns 2019-12-09 21:44:04 +01:00
Witold Kręcicki
86a847314a Fix a race in socket destruction - we need to remove handle from socket in async close callback or we might race between destruction in the callback and in the original nmhandle_unref 2019-12-09 21:44:04 +01:00
Witold Kręcicki
b804d3a395 always return true in ns_interfacemgr_listeningon if interfacemgr is shutting down
to avoid deadlocks on shutdown.
2019-12-09 21:44:04 +01:00
Witold Kręcicki
b0779cc429 netmgr: Add more DbC checks for asynchronous calls. 2019-12-09 21:44:04 +01:00
Witold Kręcicki
ef2dff5c7a pause and unpause netmgr in isc_nm_destroy to flush all events from worker queues 2019-12-09 21:44:04 +01:00
Evan Hunt
c7b86d1cac Style fixes 2019-12-09 21:44:03 +01:00
Witold Kręcicki
3e66b7ba1c Fix a race in tcpdns close with uv_close on timer
stop timers before closing

netmgr: tcpdns_close needs to be asynchronous, it manipulates sock->timer
2019-12-09 21:43:45 +01:00
Witold Kręcicki
23ab349bbd netmgr: fix a race in socket destruction, happening if we close the socket
externally and, at the same time, a timeout timer callback was called.
2019-12-09 21:43:45 +01:00
Witold Kręcicki
0bf74ac792 netmgr:
- make tcp listening IPC pipe name saner
 - put the pipe in /tmp on unices
 - add pid to the pipe name to avoid conflicts between processes
 - fsync directory in which the pipe resides to make sure that the
   child threads will see it and be able to open it
2019-12-09 21:43:45 +01:00
Evan Hunt
b05194160b style, comments 2019-12-09 11:15:27 -08:00
Witold Kręcicki
8c5aaacbef - Add separate priority event queue for events that must be processed
even when worker is paused (e.g. interface reconfiguration). This is
  needed to prevent deadlocks when reconfiguring interfaces - as network
  manager is paused then, but we still need to stop/start listening.

- Proper handling of TCP listen errors in netmgr - bind to the socket first,
  then return the error code.
2019-12-09 11:15:27 -08:00
Witold Kręcicki
5a65ec0aff Add uv_handle_{get,set}_data functions that's absent in pre-1.19 libuv to make code clearer.
This might be removed when we stop supporting older libuv versions.
2019-12-09 11:15:27 -08:00
Witold Kręcicki
bc5aae1579 netmgr: make tcp listening multithreaded.
When listening for TCP connections we create a socket, bind it
and then pass it over IPC to all threads - which then listen on
in and accept connections. This sounds broken, but it's the
official way of dealing with multithreaded TCP listeners in libuv,
and works on all platforms supported by libuv.
2019-12-09 11:15:27 -08:00
Ondřej Surý
09c2dbffb5 Merge branch '1443-threadsanitizer-data-race-lib-dns-rbtdb-c-1960-in-decrement_reference-2' into 'master'
Resolve "ThreadSanitizer: data race lib/dns/rbtdb.c:1960 in decrement_reference"

Closes #1443

See merge request isc-projects/bind9!2703
2019-12-09 18:48:35 +00:00
Mark Andrews
c6efc0e50f Add is_leaf and send_to_prune_tree.
Add is_leaf and send_to_prune_tree to make the logic easier
to understand in cleanup_dead_nodes and decrement_reference.
2019-12-09 17:43:54 +00:00
Mark Andrews
176b23b6cd Testing node->down requires the tree lock to be held.
In decrement_reference only test node->down if the tree lock
is held.  As node->down is not always tested in
decrement_reference we need to test that it is non NULL in
cleanup_dead_nodes prior to removing the node from the rbt
tree.  Additionally it is not always possible to aquire the
node lock and reactivate a node when adding parent nodes.
Reactivate such nodes in cleanup_dead_nodes if required.
2019-12-09 17:43:54 +00:00
Ondřej Surý
23e29b17db Merge branch '1453-the-zero-system-test-timeouts-intermittently' into 'master'
Bail-out early if dig fails to finish successfully or takes too long

Closes #1453

See merge request isc-projects/bind9!2712
2019-12-09 17:41:25 +00:00
Ondřej Surý
eb8007a5ba Merge branch '1458-intermittent-failure-in-the-forward-system-test' into 'master'
Resolve "Intermittent failure in the forward system test"

Closes #1458

See merge request isc-projects/bind9!2716
2019-12-09 17:15:53 +00:00
Ondřej Surý
2a65a47f39 Bail-out early if dig fails to finish successfully or takes too long
Before, the zero system test could get stuck almost infinitely, because
the first test sends > 300 queries with 5 seconds timeout on each in
each pass.  If named crashed early, it would took the test more than 4
hours to properly timeout.

This commit introduces a "watchdog" on the dig commands running in the
background and failing the test on timeout, failing any test if any dig
command fails to return successfully, and making the tests.sh script
shellcheck clean.
2019-12-09 18:15:18 +01:00
Ondřej Surý
fb03edacd8 Wait for named to forward the question before testing the validity 2019-12-09 17:30:37 +01:00
Ondřej Surý
0e15cbb092 Make forward system test shellcheck clean 2019-12-09 17:30:37 +01:00
Ondřej Surý
10f4cd066f Use $n to keep diagnostic output of every individual test separate 2019-12-09 17:30:37 +01:00
Ondřej Surý
64df488e1e Add the standard $n to each test 2019-12-09 17:30:37 +01:00
Ondřej Surý
12578b9e96 Merge branch '1425-intermittent-failure-in-the-addzone-system-test' into 'master'
Resolve "Intermittent failure in the addzone system test"

Closes #1425

See merge request isc-projects/bind9!2714
2019-12-09 16:27:31 +00:00
Witold Kręcicki
8885fd6966 tests: addzone: retry when checking for things, to allow for timing problems 2019-12-09 16:02:03 +00:00
Mark Andrews
9e8cd3ccc5 loop waiting for the redirect zone to load 2019-12-09 16:02:03 +00:00
Matthijs Mekking
6ff780db5b Merge branch '1466-kasp-test-keyid-0' into 'master'
Fix get key id from key_idpad

Closes #1466

See merge request isc-projects/bind9!2731
2019-12-09 14:42:08 +00:00
Matthijs Mekking
2e7cb4978f Fix get key id from key_idpad
The kasp system test has a call to sed to retrieve the key identifier
without leading zeros.  The sed call could not handle key id 0.
Update the kasp test to also correctly deal with this case.
2019-12-09 14:54:04 +01:00
Matthijs Mekking
910a7a56bc Merge branch '1457-intermittent-failure-autosign' into 'master'
Resolve "Intermittent failure in the autosign system test"

Closes #1457

See merge request isc-projects/bind9!2729
2019-12-09 13:29:36 +00:00
Matthijs Mekking
bd4035900a Better error handling in autosign system test 2019-12-09 13:38:54 +01:00
Matthijs Mekking
2e4273b55a Fix race in autosign test
The autosign test has a test case where a DNSSEC maintaiend zone
has a set of DNSSEC keys without any timing metadata set.  It
tests if named picks up the key for publication and signing if a
delayed dnssec-settime/loadkeys event has occured.

The test failed intermittently despite the fact it sleeps for 5
seconds but the triggered key reconfigure action should happen after
3 seconds.

However, the test output showed that the test query came in before
the key reconfigure action was complete (see excerpts below).

The loadkeys command is received:

15:38:36 received control channel command 'loadkeys delay.example.'

The reconfiguring zone keys action is triggered after 3 seconds:

15:38:39 zone delay.example/IN: reconfiguring zone keys
15:38:39 DNSKEY delay.example/NSEC3RSASHA1/7484 (ZSK) is now published
15:38:39 DNSKEY delay.example/NSEC3RSASHA1/7455 (KSK) is now published
15:38:39 writing to journal

Two seconds later the test query comes in:

15:38:41 client @0x7f1b8c0562b0 10.53.0.1#44177: query
15:38:41 client @0x7f1b8c0562b0 10.53.0.1#44177: endrequest

And 6 more seconds later the reconfigure keys action is complete:

15:38:47 zone delay.example/IN: next key event: 05-Dec-2019 15:48:39

This commit fixes the test by checking the "next key event" log has
been seen before executing the test query, making sure that the
reconfigure keys action has been complete.

This commit however does not fix, nor explain why it took such a long
time (8 seconds) to reconfigure the keys.
2019-12-09 13:38:54 +01:00
Matthijs Mekking
cfaa631f65 Move wait_for_log to conf.sh.common 2019-12-09 13:38:54 +01:00
Matthijs Mekking
6b4a17ef7c Save settime output 2019-12-09 13:38:54 +01:00
Matthijs Mekking
edd6a084f0 Merge branch 'misc-fixes-kasp' into 'master'
Miscellaneous fixes kasp

See merge request isc-projects/bind9!2711
2019-12-09 08:22:56 +00:00
Matthijs Mekking
4b66c0ebf4 Change some dnssec-policy defaults
Suggested by Tony Finch, these seem to be more reasonable defaults.
2019-12-09 07:25:20 +00:00
Matthijs Mekking
0f9d45a5b8 Default key size 2048
The default size for RSA keys is 2048 bits, for both ZSKs and KSKs.
2019-12-09 07:25:20 +00:00
Matthijs Mekking
a339a6df48 Update docs with durations, built-in dnssec-policy
Clarify in the ARM that TTL-style options can also now take ISO
8601 durations.

Mention the built-in dnssec policies "default" and "none".  Mention
that "none" is the default.

Add a file documenting the default dnssec-policy configuration options.

Fix dnssec-policy syntax in ARM (dnssec-policy.grammar.xml).
2019-12-09 07:25:20 +00:00
Ondřej Surý
6f096f5245 Merge branch 'ondrej/remove-too-generic-node_count-macro-from-dns_acl' into 'master'
Change the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the global namespace

See merge request isc-projects/bind9!2725
2019-12-09 06:49:00 +00:00
Ondřej Surý
8120088ec7 Change the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the global namespace 2019-12-06 15:47:39 +01:00
Mark Andrews
fe31fedc31 Merge branch '1401-intermittent-failures-in-the-catz-system-test' into 'master'
Debug "Intermittent failures in the catz system test"

See merge request isc-projects/bind9!2715
2019-12-06 14:16:03 +00:00
Mark Andrews
4dd9ec8919 Increase wait_for_message attempts to 20. 2019-12-06 13:40:46 +00:00
Mark Andrews
1334daaec0 save wait_for_message contents 2019-12-06 13:40:46 +00:00
Michał Kępień
dd6f9391c3 Merge branch '1452-system-test-framework-cleanup-tweaks' into 'master'
System test framework: cleanup tweaks

Closes #1452

See merge request isc-projects/bind9!2717
2019-12-06 13:32:07 +00:00
Michał Kępień
34fb70b17c Merge branch '1452-detect-missing-system-test-results' into 'master'
Detect missing system test results

See merge request isc-projects/bind9!2708
2019-12-06 13:24:26 +00:00
Michał Kępień
d8905b7a9c Automatically run clean.sh from run.sh
The first step in all existing setup.sh scripts is to call clean.sh.  To
reduce code duplication and ensure all system tests added in the future
behave consistently with existing ones, invoke clean.sh from run.sh
before calling setup.sh.
2019-12-06 14:11:01 +01:00
Michał Kępień
3c3085be3c Detect missing system test results
At the end of each system test suite run, the system test framework
collects all existing test.output files from system test subdirectories
and produces bin/tests/system/systests.output from those files.
However, it does not check whether a test.output file was found for
every executed test.  Thus, if the test.output file is accidentally
deleted by the system test itself (e.g. due to an overly broad file
removal wildcard present in clean.sh), its output will not be included
in bin/tests/system/systests.output.  Since the result of each system
test suite run is determined by bin/tests/system/testsummary.sh, which
only operates on the contents of bin/tests/system/systests.output, this
can lead to test failures being ignored.  Fix by ensuring the number of
test results found in bin/tests/system/systests.output is equal to the
number of tests run and triggering a system test suite failure in case
of a discrepancy between these two values.
2019-12-06 14:11:01 +01:00
Michał Kępień
bf3eeac067 Remove bin/tests/system/clean.sh
Since the role of the bin/tests/system/clean.sh script has now been
reduced to calling a given system test's clean.sh script, remove the
former altogether and replace its only use with a direct invocation of
the latter.
2019-12-06 14:11:01 +01:00
Michał Kępień
b4d37878f6 Remove the -r switch from system test scripts
Since files containing system test output are no longer stored in test
subdirectories, bin/tests/system/clean.sh no longer needs to take care
of removing the test.output file for a given test as testsummary.sh
already takes care of that and even if a test suite terminates
abnormally and another one is started, tee invoked without the -a
command line switch overwrites the destination file if it exists, so
leftover test.output.* files from previous test suite runs are not a
concern.  Remove the -r command line switch and the code associated with
it from the relevant scripts.
2019-12-06 14:11:01 +01:00
Michał Kępień
b0916bba41 Store system test output in bin/tests/system/
Some clean.sh scripts contain overly broad file deletion wildcards which
cause the test.output file (used by the system test framework for
collecting output) in a given system test's directory to be erroneously
removed immediately after the test is started (due to setup.sh scripts
calling clean.sh at the beginning).  This prevents the test's output
from being placed in bin/tests/system/systests.output at the end of a
test suite run and thus can lead to test failures being ignored.  Fix by
storing each test's output in a test.output.<test-name> file in
bin/tests/system/, which prevents clean.sh scripts from removing it (as
they should only ever affect files contained in a given system test's
directory).
2019-12-06 14:11:01 +01:00
Matthijs Mekking
26ee43da1b Merge branch '1460-duration-ttlval-print-bug' into 'master'
Resolve "checkconf test failure on Solaris"

Closes #1460

See merge request isc-projects/bind9!2718
2019-12-06 13:03:14 +00:00
Ondřej Surý
9dfa33050b Add semantic patch to find void f() { ... return ((void)g())); ... }
When a function returns void, it can be used as an argument to return in
function returning also void, e.g.:

void in(void) {
  return;
}

void out(void) {
  return (in());
}

while this is legal, it should be rewritten as:

void out(void) {
  in();
  return;
}

The semantic patch just find the occurrences, and they need to be fixed
by hand.
2019-12-06 13:42:18 +01:00
Matthijs Mekking
60fa5fc760 Fix duration printing on Solaris 2019-12-06 13:12:06 +01:00
Matthijs Mekking
8fd8404e16 Replace two leftover ttlval with duration
Since the introduction of durations, all ttlval configuration types
are replaced with durations.  Duration is an ISO 8601 duration, a
TTL-style value, or a number.  These two references were missed and
are now also replaced.
2019-12-06 12:28:40 +01:00
Matthijs Mekking
4597ebc91b Merge branch 'trust-anchors-minor-fixes' into 'master'
Minor fixes in trust anchor code

See merge request isc-projects/bind9!2676
2019-12-06 08:12:55 +00:00
Matthijs Mekking
eddac8575d Minor fixes in trust anchor code
This commit makes some minor changes to the trust anchor code:

1. Replace the undescriptive n1, n2 and n3 identifiers with slightly
   better rdata1, rdata2, and rdata3.
2. Fix an occurrence where in the error log message a static number
   32 was printed, rather than the rdata3 length.
3. Add a default case to the switch statement checking DS digest
   algorithms to catch unknown algorithms.
2019-12-06 07:12:24 +00:00
Mark Andrews
564707023c Merge branch '1455-job-failed-453300' into 'master'
Resolve "Job Failed #453300"

Closes #1455

See merge request isc-projects/bind9!2706
2019-12-05 22:05:24 +00:00
Mark Andrews
e4b1d0b686 loop waiting for the redirect zone to load 2019-12-05 21:31:32 +00:00
Ondřej Surý
3fb215c952 Merge branch '1427-intermittent-failure-in-fetchlimit-system-test' into 'master'
Test for the hard fetchlimit instead of soft fetchlimit

Closes #1427

See merge request isc-projects/bind9!2705
2019-12-05 15:55:24 +00:00
Ondřej Surý
c35a4e05fa Test for the hard fetchlimit instead of soft fetchlimit
Previously, the fetchlimit tested the recursive-clients soft limit
that's defined as 90% of the hard limit (the actual configured value).
This worked previously because the reaping of the oldest recursive
client was put on the same event queue as the current TCP client, thus
the cleaning has happened before the new TCP client established a new
connection.

With the change in BIND 9.14 that added a multiple event queues the
cleaning of the oldests clients is no longer synchronous and could
happen stochastically making the soft limit testing fail often.  The
situation became even worse with the new networking manager, thus we
change the system test to fail only if the hard limit bound is not
honored.

Changing the accounting of the already reaped TCP clients so the soft
limit testing is possible again is out of the scope for this change.
2019-12-05 16:33:12 +01:00
Ondřej Surý
a07f9b71e9 Merge branch '1407-intermittent-failure-in-the-mkeys-system-test' into 'master'
Improve the error handling in mkeys test and use retry_quiet()

Closes #1407

See merge request isc-projects/bind9!2704
2019-12-05 14:24:29 +00:00
Ondřej Surý
b0ad689e16 Wait for 'all zones loaded' message instead of zoneless 'loaded serial' message 2019-12-05 15:22:28 +01:00
Ondřej Surý
3b63c51a64 Save all rndc diagnostic output 2019-12-05 15:22:28 +01:00
Ondřej Surý
4ff25c06c1 Make mkeys system test shellcheck clean and run under set -e 2019-12-05 15:22:28 +01:00
Ondřej Surý
f239d67c1a Improve the error handling in mkeys test and use retry_quiet() 2019-12-05 15:22:28 +01:00
Matthijs Mekking
ec80d61ab0 Merge branch 'dnssec-keys-rename-to-trust-anchors' into 'master'
Rename 'dnssec-keys' to 'trust-anchors'

See merge request isc-projects/bind9!2702
2019-12-05 13:57:11 +00:00
Matthijs Mekking
8c37d3d320 Rename 'dnssec-keys' to 'trust-anchors' 2019-12-05 12:19:17 +01:00
Diego dos Santos Fronza
e2129fb103 Merge branch '1410-intermittent-failure-in-the-resolver-test' into 'master'
Resolve "Intermittent failure in the resolver test"

Closes #1410

See merge request isc-projects/bind9!2671
2019-12-04 22:58:21 +00:00
Diego Fronza
994fc2e822 Improved prefetch disabled test code
Using retry_quiet to test that prefetch is disabled instead of a
standard loop with sleep 1 between each iteration.
2019-12-04 19:29:55 -03:00
Diego Fronza
a711d6f8c0 Fix resolver tests: prefetch 40/41
These two tests were failing basically because in order for prefetching to
happen, the TTL for a given DNS record must be greater than or equal to
the prefetch config value + 9.

The previous TTL for both records was 10, while prefetch value in
configuration was 3, thus making only records with TTL >= 12 elligible
for prefetching.

TTL value for both records was adjusted to the value 13, and prefetch
value was set to 4 (inc by 1), so records with TTL (4 + 9) >= 13 are
elligible for prefetching.

Adjusting prefetch value to 4 gives the test 1 second more to avoid time
problems when sharing resources on a heavy loaded PC.

Also prefetch value in settings is now read by the script and used
by it to corrrectly calculate the amount of time needed to delay before
sending a request to trigger prefetch, adding a bit of flexibility to
fine tune the test in the future.
2019-12-04 19:29:55 -03:00
Diego Fronza
dd524cc893 Fix resolver test: prefetch disabled
The previous test had two problems:
1. It wasn't written specifically for testing what it was supposed to:
prefetch disabled.
2. It could fail in some circunstances if the computer's load is too
high, due to sleeps not taking parallel tests and cpu load into account.

The new test is testing prefetch disabled as follows:
1. It asks for a txt record for a given domain and takes note of the
record's TTL (which is 10).
2. It sleeps for (TTL - 5) = 5 seconds, having a window of 5 seconds to
issue new queries before the record expires from cache.
3. Three(3) queries are executed in a row, with a interval of 1 second
between them, and for each query we verify that the TTL in response is
less than the previous one, thus ensuring that prefetch is disabled (if
it were enabled this record would have been refreshed already and TTL
would be >= the first TTL).

Having a window of 5 seconds to perform 3 queries with a interval of 1
second between them gives the test a reasonable amount of time
to not suffer from a machine with heavy load.
2019-12-04 19:29:54 -03:00
Ondřej Surý
da94ed13b8 Merge branch '1444-deprecate-isc_thread_key-API' into 'master'
Use native compiler Thread Local Storage instead of isc_thread_key API

Closes #1444

See merge request isc-projects/bind9!2680
2019-12-04 22:07:54 +00:00
Ondřej Surý
04e901a86c Add CHANGES 2019-12-04 22:25:57 +01:00
Ondřej Surý
c62748c9e3 Update PLATFORMS.md to explicitly list Thread Local Storage as requirement for BIND 9 2019-12-04 14:17:19 +01:00
Ondřej Surý
b1a7ec7481 Remove isc_thread_key API in favor of ISC_THREAD_LOCAL variables
For BIND 9.16+, TLS aware compiler is required, and using
ISC_THREAD_LOCAL is preferred way of using Thread Local Storage.  The
isc_thread_key API is no longer used anywhere and hence was removed from
BIND 9.
2019-12-04 14:17:19 +01:00
Ondřej Surý
5d43b7126c Refactor the irs_context API to use ISC_THREAD_LOCAL
Previously, the irs_context API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables.
2019-12-04 14:17:19 +01:00
Ondřej Surý
a4ffb64073 Refactor the dns_geoip API to use ISC_THREAD_LOCAL
Previously, the dns_geoip API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables, and
creating the local memory context was moved to named and stored in the
named_g_geoip global context.
2019-12-04 14:17:19 +01:00
Ondřej Surý
4a3d589403 Refactor the dns_dt API to use ISC_THREAD_LOCAL
Previously, the dns_dt API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables.
2019-12-03 16:27:30 +01:00
Ondřej Surý
1a66aabd22 Refactor the dns_name API to use ISC_THREAD_LOCAL
Previously, the dns_name API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables.
2019-12-03 16:27:24 +01:00
Ondřej Surý
01731d4b1b Add and use ISC_THREAD_LOCAL macro
The new ISC_THREAD_LOCAL macro unifies usage of platform dependent
Thread Local Storage definition thread_local vs __thread vs
__declspec(thread) to a single macro.

The commit also unifies the required level of support for TLS as for
some parts of the code it was mandatory and for some parts of the code
it wasn't.
2019-12-03 16:27:24 +01:00
Mark Andrews
96475e7eb4 Merge branch '1434-explicitly-set-python-to-a-empty-string-with-without-python' into 'master'
Resolve "explicitly set PYTHON to a empty string with --without-python"

Closes #1434

See merge request isc-projects/bind9!2672
2019-12-03 12:48:42 +00:00
Mark Andrews
eed2aabc40 add AC_ARG_VAR([PYTHON], [path to python executable]) 2019-12-03 23:42:08 +11:00
Mark Andrews
8cd3cf90b2 add CHANGES 2019-12-03 23:42:08 +11:00
Mark Andrews
d8fc544569 unset PYTHON on --without-python to prevent python still being used 2019-12-03 23:41:28 +11:00
Mark Andrews
e4fcbba86e Merge branch '1419-threadsanitizer-data-race-rbtdb-c-7568-in-issecure' into 'master'
Resolve "ThreadSanitizer: data race rbtdb.c:7568 in issecure"

Closes #1419

See merge request isc-projects/bind9!2656
2019-12-03 01:14:27 +00:00
Mark Andrews
cd2469d3cd r/w of rbtdb->current_version requires that rbtdb->lock be held 2019-12-02 23:48:41 +00:00
Mark Andrews
e121c3e179 Merge branch '1412-threadsanitizer-data-race-resolver-c-7030-in-fctx_decreference-2' into 'master'
Resolve "ThreadSanitizer: data race resolver.c:7030 in fctx_decreference"

Closes #1412

See merge request isc-projects/bind9!2673
2019-12-02 23:46:16 +00:00
Mark Andrews
912ce87479 Make fctx->attributes atomic.
FCTX_ATTR_SHUTTINGDOWN needs to be set and tested while holding the node
lock but the rest of the attributes don't as they are task locked. Making
fctx->attributes atomic allows both behaviours without races.
2019-12-03 08:58:53 +11:00
Michał Kępień
29c83f5922 Merge branch 'michal/address-asan-memory-leak-reports' into 'master'
Address ASAN memory leak reports

See merge request isc-projects/bind9!2679
2019-12-02 15:07:45 +00:00
Michał Kępień
6ee04f8458 Do not define ASAN_OPTIONS at build time
Disabling ASAN memory leak detection for a build job is pointless
because ASAN is only used in test jobs.  (Also, memory leak detection
should not be disabled globally - explicit suppressions should be used
in case of issues with external code.)
2019-12-02 16:03:23 +01:00
Michał Kępień
b425b5d56e Move xmlInitThreads()/xmlCleanupThreads() calls
xmlInitThreads() and xmlCleanupThreads() are called from within
named_statschannels_configure() and named_statschannels_shutdown(),
respectively.  Both of these functions are executed by worker threads,
not the main named thread.  This causes ASAN to report memory leaks like
the following one upon shutdown (as long as named is asked to produce
any XML output over its configured statistics channels during its
lifetime):

    Direct leak of 968 byte(s) in 1 object(s) allocated from:
        #0 0x7f677c249cd8 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:153
        #1 0x7f677bc1838f in xmlGetGlobalState (/usr/lib/libxml2.so.2+0xa838f)

The data mentioned in the above report is a libxml2 state structure
stored as thread-specific data.  Such chunks of memory are automatically
released (by a destructor passed to pthread_key_create() by libxml2)
whenever a thread that allocated a given chunk exits.  However, if
xmlCleanupThreads() is called by a given thread before it exits, the
destructor will not be invoked (due to xmlCleanupThreads() calling
pthread_key_delete()) and ASAN will report a memory leak.  Thus,
xmlInitThreads() and xmlCleanupThreads() must not be called from worker
threads.  Since xmlInitThreads() must be called on Windows in order for
libxml2 to work at all, move xmlInitThreads() and xmlCleanupThreads()
calls to the main named thread (which does not produce any XML output
itself) in order to prevent the memory leak from being reported by ASAN.
2019-12-02 16:03:23 +01:00
Michał Kępień
3f96af1ae6 Merge branch '1445-fix-geoip2-memory-leak-upon-reconfiguration' into 'master'
Fix GeoIP2 memory leak upon reconfiguration

Closes #1445

See merge request isc-projects/bind9!2678
2019-12-02 14:54:42 +00:00
Michał Kępień
628b1837d2 Add CHANGES entry
5329.	[bug]		Reconfiguring named caused memory to be leaked when any
			GeoIP2 database was in use. [GL #1445]
2019-12-02 15:15:06 +01:00
Michał Kępień
670afbe84a Fix GeoIP2 memory leak upon reconfiguration
Loaded GeoIP2 databases are only released when named is shut down, but
not during server reconfiguration.  This causes memory to be leaked
every time "rndc reconfig" or "rndc reload" is used, as long as any
GeoIP2 database is in use.  Fix by releasing any loaded GeoIP2 databases
before reloading them.  Do not call dns_geoip_shutdown() until server
shutdown as that function releases the memory context used for caching
GeoIP2 lookup results.
2019-12-02 15:15:06 +01:00
Ondřej Surý
289f143d8a Merge branch '1416-threadsanitizer-data-race-resolver-c-3384-in-findname' into 'master'
Resolve "ThreadSanitizer: data race resolver.c:3384 in findname"

Closes #1416

See merge request isc-projects/bind9!2668
2019-12-02 08:49:15 +00:00
Mark Andrews
9ca6ad6311 Assign fctx->client when fctx is created rather when the join happens.
This prevents races on fctx->client whenever a new fetch joins a existing
fetch (by calling fctx_join) as it is now invariant for the active life of
fctx.
2019-12-02 06:01:46 +00:00
Ondřej Surý
cf8e034b75 Merge branch '1293-change-the-return-value-for-dns_name_dup-to-void-and-cleanup-the-code' into 'master'
Change the return value for dns_name_dup() to void and cleanup the code

Closes #1293

See merge request isc-projects/bind9!2518
2019-11-29 13:40:54 +00:00
Ondřej Surý
7a69ac32c9 Disable no longer useful semantic patches
Some semantic patches are meant to be run just once, as they work on
functions with changed prototypes. We keep them for reference, but
disabled them from the CI to save time.
2019-11-29 14:26:14 +01:00
Ondřej Surý
edd97cddc1 Refactor dns_name_dup() usage using the semantic patch 2019-11-29 14:00:37 +01:00
Ondřej Surý
21902d0ac7 cocci: Add semantic patch to refactor dns_name_dup() usage 2019-11-29 13:59:40 +01:00
Ondřej Surý
a35b19f80e libdns: dns_name_dup() can't fail, change return type to void 2019-11-29 13:59:40 +01:00
Michał Kępień
b1413ccf8d Merge branch '1430-fix-logging-long-named-command-lines' into 'master'
Fix logging long named command lines

Closes #1430

See merge request isc-projects/bind9!2667
2019-11-29 08:07:47 +00:00
Michał Kępień
009df30f3a Fix logging long named command lines
The saved_command_line buffer in bin/named/main.c is 8192 bytes long.
The size of libisc's internal logging buffer (defined by the value of
the LOG_BUFFER_SIZE constant in lib/isc/log.c) is also 8192 bytes.
Since the buffer containing the ellipsis is passed as the last argument
to isc_log_write() and the buffer containing the potentially trimmed
named command line (saved_command_line) is passed as the second argument
in the same isc_log_write() call, it may happen that saved_command_line
will exhaust all available space in libisc's internal logging buffer, in
which case the ellipsis will be elided from the output.

Make saved_command_line 4096 bytes long as that value is arguably also
large enough for any reasonable use case and at the same time it ensures
ellipsis will always be printed for excessively long named command
lines.
2019-11-29 09:06:41 +01:00
Michał Kępień
c6811ed052 Merge branch '1310-improve-portability-of-the-runtime-system-test' into 'master'
Improve portability of the "runtime" system test

Closes #1310

See merge request isc-projects/bind9!2666
2019-11-29 07:48:08 +00:00
Michał Kępień
58121f5f6d Improve portability of the "runtime" system test
The "runtime" system test currently fails on Windows because it waits
for named to log a message indicating successful startup ("running"),
but that never happens since named on Windows fails to open the
configuration file as its path includes control characters.

Instead of putting control characters in directory names, put them in
the value of the -D command line switch passed to named, which is used
for identifying an instance of named in a process listing and whose
value is completely ignored by named, but still logged.

While a similar check using special characters appears to be working
fine on Windows for the time being, modify it in the same way to avoid
potential future problems on other platforms and make the test cleaner.
2019-11-29 08:47:33 +01:00
Ondřej Surý
b6c96f05f3 Merge branch '1431-summary-sanitizer-grep-is-dangerous' into 'master'
Resolve ""SUMMARY: .*Sanitizer" grep is dangerous"

Closes #1431

See merge request isc-projects/bind9!2669
2019-11-29 07:02:30 +00:00
Mark Andrews
36ce99d8a4 replace grep -r with 'find -type f | xargs' 2019-11-29 10:58:28 +11:00
Ondřej Surý
1e7e0d2465 Merge branch 'ondrej/keep-sanitizer-tainted-system-tests-files' into 'master'
Don't clean the system test temporary files if sanitizer reports were found inside

See merge request isc-projects/bind9!2657
2019-11-28 21:39:28 +00:00
Ondřej Surý
7489e6e6f9 Don't clean the system test temporary files if sanitizer reports were found inside 2019-11-28 21:39:20 +00:00
Mark Andrews
ef2825f1b8 Merge branch '1417-threadsanitizer-data-race-rbtdb-c-1535-in-add32' into 'master'
Resolve "ThreadSanitizer: data race rbtdb.c:1535 in add32"

Closes #1417

See merge request isc-projects/bind9!2655
2019-11-28 20:10:33 +00:00
Mark Andrews
68693f8279 add CHANGES 2019-11-28 13:37:56 +01:00
Mark Andrews
637b2c4e51 rdataset_setownercase and rdataset_getownercase need to obtain a node lock 2019-11-28 13:37:56 +01:00
Ondřej Surý
6be1e9b565 Merge branch 'ondrej/stop-retrying-system-tests' into 'master'
Stop retrying the system tests; we should fix the tests instead

See merge request isc-projects/bind9!2649
2019-11-28 12:22:59 +00:00
Ondřej Surý
caa5cd947d Merge branch 'wpk/clock-realtime-fast' into 'master'
Use clock_realtime_fast where available

See merge request isc-projects/bind9!2661
2019-11-28 12:07:37 +00:00
Ondřej Surý
8ad67f8b9f Stop retrying the system tests; we should fix the tests instead 2019-11-28 13:06:38 +01:00
Witold Kręcicki
f01d739968 Use clock_realtime_fast where available 2019-11-28 12:36:55 +01:00
Ondřej Surý
1ca1dda266 Merge branch 'ondrej/use_ATOMIC_VAR_INIT_to_initialize_tid_base_in_isc_hp_API' into 'master'
Use ATOMIC_VAR_INIT to initialize tid_v_base to 0

See merge request isc-projects/bind9!2660
2019-11-28 11:30:37 +00:00
Ondřej Surý
4d021be52e Merge branch 'ondrej/lib_isc_counter_improvements' into 'master'
Improve the atomics usage in isc_counter API

See merge request isc-projects/bind9!2658
2019-11-28 11:07:42 +00:00
Ondřej Surý
c5b18d3dcb Use ATOMIC_VAR_INIT to initialize tid_v_base to 0 2019-11-28 12:06:10 +01:00
Ondřej Surý
9e8feec7d3 Improve the atomics usage in isc_counter API 2019-11-28 11:21:52 +01:00
Ondřej Surý
1a575d0f90 Merge branch '1401-intermittent-failures-in-the-catz-system-test' into 'master'
Resolve "Intermittent failures in the catz system test"

Closes #1401

See merge request isc-projects/bind9!2633
2019-11-28 08:37:29 +00:00
Ondřej Surý
51b05189f7 Use retry() and nextpart*() to simplify catz test 2019-11-28 08:02:33 +00:00
Witold Kręcicki
9b43e65c01 Fix timing issues in catz test
Make the log checks more precise and use the retry() function for
repeating the checks.
2019-11-28 08:02:33 +00:00
Evan Hunt
e25611457d Merge branch '1376-supported-platforms' into 'master'
update "supported platforms" in release notes

Closes #1376

See merge request isc-projects/bind9!2654
2019-11-28 05:42:28 +00:00
Evan Hunt
07f727ba01 update "supported platforms" in release notes
also added more information about library dependencies in PLATFORMS.md,
and cleaned up the grammar.
2019-11-27 13:06:13 -08:00
Ondřej Surý
f29dfb45d6 Merge branch 'mnowak/runtime-forward-port-softhsm2-setup' into 'master'
Fix the UID switch test to work with PKCS#11 build

See merge request isc-projects/bind9!2652
2019-11-27 17:19:10 +00:00
Michal Nowak
e00d650328 Fix the UID switch test to work with PKCS#11 build
Forward port of 32fe9a0051fc76be4657fc2742e71d2be6193011 by Ondřej Surý.
2019-11-27 17:19:10 +00:00
Ondřej Surý
e41b2999be Merge branch '1402-multiple-issues-in-the-runtime-system-test' into 'master'
Resolve "Multiple issues in the runtime system test"

Closes #1402

See merge request isc-projects/bind9!2636
2019-11-27 12:02:55 +00:00
Ondřej Surý
cd804158b4 Fix multiple issues in named setuid check 2019-11-27 11:50:29 +01:00
Evan Hunt
7a8269207d fixed a test failure, some other shell cleanup 2019-11-27 11:50:29 +01:00
Ondřej Surý
f020199925 Instead of sleeping for a fixed time, wait for named to log specific message in a loop 2019-11-27 11:50:29 +01:00
Ondřej Surý
d9b3909a21 Use pre-prepared long command line for better portability 2019-11-27 11:50:29 +01:00
Ondřej Surý
340b1d2b6b Make runtime/tests.sh shellcheck and set -e clean
This mostly comprises of:

* using $(...) instead of `...`
* changing the directories in subshell and not ignoring `cd` return code
* handling every error gracefully instead of ignoring the return code
2019-11-27 11:50:29 +01:00
Ondřej Surý
8f539a8886 Further improve the runtime tests to look for a specific instead of generic error 2019-11-27 11:50:29 +01:00
Ondřej Surý
c48d8e0d42 The PATH_MAX on macOS is 1024, we can't override conffile path to test for ellipsis 2019-11-27 11:50:29 +01:00
Ondřej Surý
b5a18ac439 Fix couple of no-op tests to actually test something (configuration files were missing) 2019-11-27 11:50:29 +01:00
Ondřej Surý
00114e07ef Skip the runtime ellipsis test 2019-11-27 11:50:29 +01:00
Ondřej Surý
ce86721bc3 runtime test: make the pidfiles match the names of configuration files 2019-11-27 11:50:29 +01:00
Ondřej Surý
e9fa7b831b runtime test: use helper function that kills named and waits for the finish 2019-11-27 11:50:29 +01:00
Mark Andrews
2c0710d5e6 Merge branch '1350-threadsanitizer-data-race-rbt-c-1312-in-dns_rbt_addnode' into 'master'
Resolve "ThreadSanitizer: data race rbt.c:1312 in dns_rbt_addnode"

Closes #1350

See merge request isc-projects/bind9!2648
2019-11-27 10:47:04 +00:00
Mark Andrews
8f6aaa7230 add comments 'tree_lock(write) must be held' 2019-11-27 09:58:15 +00:00
Mark Andrews
7cad3b2e91 rbtnode->nsec needs to be read while holding the tree lock 2019-11-27 09:58:15 +00:00
Evan Hunt
d744a6fc23 Merge branch '1399-recursive-limit-stat' into 'master'
Resolve "recursive-client limit should have a stat counter"

Closes #1399

See merge request isc-projects/bind9!2629
2019-11-26 19:15:18 +00:00
Evan Hunt
715afa9c57 add a stats counter for clients dropped due to recursive-clients limit 2019-11-26 17:55:06 +00:00
Ondřej Surý
0d7b3b9d73 Merge branch '1336-1404-netmgr-destroy-tsan-fixes' into 'master'
Fix minor shutdown issues detected by TSAN

Closes #1404 and #1336

See merge request isc-projects/bind9!2639
2019-11-26 17:32:31 +00:00
Witold Kręcicki
bf2cc19b04 - Access netmgr worker->finished under worker lock only
- Join network worker thread to silence tsan
2019-11-26 15:21:25 +01:00
Ondřej Surý
d0bc45be17 Merge branch '1354-threadsanitizer-data-race-message-c-3283-in-dns_message_sectiontotext' into 'master'
Resolve "ThreadSanitizer: data race message.c:3283 in dns_message_sectiontotext"

Closes #1354

See merge request isc-projects/bind9!2578
2019-11-26 13:00:01 +00:00
Mark Andrews
f269585de3 provide default yaml indent 2019-11-26 13:52:30 +01:00
Mark Andrews
9936462f31 dns_master_indent and dns_master_indentstr must not be global
The indentation for dumping the master zone was driven by two
global variables dns_master_indent and dns_master_indentstr.  In
threaded mode, this becomes prone to data access races, so this commit
converts the global variables into a local per-context tuple that
consist of count and string.
2019-11-26 13:52:18 +01:00
Ondřej Surý
caf18da7f6 Merge branch '1360-threadsanitizer-data-race-adb-c-2790-in-dns_adb_detach' into 'master'
Resolve "ThreadSanitizer: data race adb.c:2790 in dns_adb_detach"

Closes #1360

See merge request isc-projects/bind9!2595
2019-11-26 12:16:59 +00:00
Ondřej Surý
21eab267df Fix missing adb->{e,i}refcnt locking 2019-11-26 13:07:12 +01:00
Witold Kręcicki
bad5a523c2 lib/dns/adb.c: Use atomics for adb quota values and reference counting 2019-11-26 13:07:12 +01:00
Ondřej Surý
b9f4ba19a6 Use integer fast type for mutexatomic shim type 2019-11-26 13:07:12 +01:00
Ondřej Surý
70e9068432 Merge branch '1383-kasp-test-fails-with-unexpected-cds-record' into 'master'
kasp: Fix the reading of CDS keys to use stricter awk

Closes #1383

See merge request isc-projects/bind9!2608
2019-11-26 11:59:32 +00:00
Ondřej Surý
d4163e2e97 kasp: Employ awk to make CDS checks stricter 2019-11-26 12:54:27 +01:00
Ondřej Surý
ac1f0d9d61 Merge branch '1403-when-configuration-loading-fails-named-could-assert' into 'master'
Request exclusive access when crashing via fatal()

Closes #1403

See merge request isc-projects/bind9!2635
2019-11-26 11:51:02 +00:00
Ondřej Surý
952d7fde63 Request exclusive access when crashing via fatal()
When loading the configuration fails, there might be already other tasks
running and calling OpenSSL library functions.  The OpenSSL on_exit
handler is called when exiting the main process and there's a timing
race between the on_exit function that destroys OpenSSL allocated
resources (threads, locks, ...) and other tasks accessing the very same
resources leading to a crash in the system threading library. Therefore,
the fatal() function needs to request exlusive access to the task
manager to finish the already running tasks and exit only when no other
tasks are running.
2019-11-26 12:47:01 +01:00
Ondřej Surý
bfc041def1 Merge branch 'ondrej/detect-cores-in-system-tests-on-FreeBSD' into 'master'
Detect cores on FreeBSD

See merge request isc-projects/bind9!2634
2019-11-26 11:44:22 +00:00
Ondřej Surý
38277ddb0b Detect cores on FreeBSD 2019-11-26 12:42:16 +01:00
Ondřej Surý
eb524d27d9 Merge branch '1380-autosign-jitter-test-fails-with-no-nsec3param-found-in-axfr' into 'master'
Tune the performance of the autosign test

Closes #1385, #1384, and #1380

See merge request isc-projects/bind9!2601
2019-11-26 11:41:48 +00:00
Ondřej Surý
4b2911a45a Reduce the minimal numbers of days in jitter test to 5 2019-11-26 12:07:01 +01:00
Ondřej Surý
76eac9a691 Tune the performance of CDS/CDNSKEY deletion test 2019-11-26 12:07:01 +01:00
Ondřej Surý
519b047362 Tune the performance of oldsigs test
The oldsigs test was checking only for the validity of the A
a.oldsigs.example. resource record and associated DNSSEC signature while
the zone might not have been fully signed yet leading to validation
failures because of bogus signatures on the validation path.

This commit changes the test to test that all old signatures in the
oldsigs.example. zone were replaced and the zone is fully resigned
before running the main check.
2019-11-26 12:07:01 +01:00
Ondřej Surý
ffb7ae8beb Tune the performance of the jitter test 2019-11-26 12:07:01 +01:00
Ondřej Surý
434c4e99f3 Merge branch 'ondrej/add-retry_quiet-function-to-conf.sh.common' into 'master'
Add retry_quiet() function to retry quietly for an event to occur

See merge request isc-projects/bind9!2630
2019-11-26 08:19:07 +00:00
Ondřej Surý
31264a7e00 Add retry_quiet() function to retry quietly for an event to occur 2019-11-26 09:17:32 +01:00
Mark Andrews
3e912d9aa7 Merge branch '1367-threadsanitizer-data-race-dispatch-c-901-in-free_buffer' into 'master'
Resolve "ThreadSanitizer: data race dispatch.c:901 in free_buffer"

Closes #1367

See merge request isc-projects/bind9!2613
2019-11-26 00:48:31 +00:00
Mark Andrews
26a93d77aa move maxbuffers test to allocate_udp_buffer 2019-11-25 23:39:45 +00:00
Mark Andrews
011af4de71 Lock dispatch manager buffer_lock before accessing buffers;
Only test buffers for UDP dispatches.
2019-11-25 23:39:45 +00:00
Mark Andrews
afc7389ce8 lock disp->mgr before reading disp->mgr->buffers 2019-11-25 23:39:45 +00:00
Mark Andrews
545e1391fa Merge branch '1397-install-isc-python-module' into 'master'
Resolve "Install ISC python module"

Closes #1397

See merge request isc-projects/bind9!2620
2019-11-25 23:00:47 +00:00
Mark Andrews
8bbafeb5ef add CHANGES and note in README.md 2019-11-26 09:55:05 +11:00
Mark Andrews
50e1bf3800 check for 'distutils.core setup' 2019-11-25 22:46:48 +00:00
Evan Hunt
909dc1a1ab Merge branch 'each-notes' into 'master'
cleanup release notes text

See merge request isc-projects/bind9!2622
2019-11-25 21:18:51 +00:00
Evan Hunt
fa70fc8731 cleanup release notes text 2019-11-25 13:17:35 -08:00
Ondřej Surý
3b2850f4d9 Merge branch 'ondrej/add-missing-header-guards' into 'master'
Add missing header guard to new header files

See merge request isc-projects/bind9!2621
2019-11-25 08:13:31 +00:00
Ondřej Surý
3ce6708be2 Add missing header guard to new header files 2019-11-25 09:10:29 +01:00
Mark Andrews
6eed126051 Merge branch '1373-threadsanitizer-data-race-rbtdb-c-5193-in-detachnode' into 'master'
Resolve "ThreadSanitizer: data race rbtdb.c:5193 in detachnode"

Closes #1373

See merge request isc-projects/bind9!2598
2019-11-25 05:46:55 +00:00
Mark Andrews
6ce39f64d9 remove DNS_RBT_REFLENGTH as it is no longer needed 2019-11-25 16:21:52 +11:00
Mark Andrews
b8bb1e02ad Split access to wild and dirty from locknum to silence TSAN warnings. 2019-11-25 16:21:52 +11:00
Evan Hunt
2515825a2b Merge branch '1312-netmgr-tcp-fixes' into 'master'
Resolve "netmgr hangs on shutdown when TCP connections are still active"

Closes #1312

See merge request isc-projects/bind9!2617
2019-11-23 01:47:18 +00:00
Evan Hunt
8bdb5f586a CHANGES 2019-11-22 16:46:32 -08:00
Evan Hunt
d484b66ae1 improve system tests
- increase prefetch test timing tolerance.
- remove five-second pause and explicit connection closing in tcp test
  as they are no longer necessary.
2019-11-22 16:46:32 -08:00
Evan Hunt
00333a5c97 netmgr: add shutdown function
- new function isc_nm_shutdown() shuts down all active TCP connections,
  but does not destroy the netmgr.
2019-11-22 16:46:32 -08:00
Witold Kręcicki
d6c5052f7e netmgr: actively close all sockets when shutting down server
without this change, named could sometimes lag for a while on shutdown
while it waited for open TCP connections to time out.
2019-11-22 16:46:32 -08:00
Witold Kręcicki
37354ee225 netmgr: fix TCP backlog and client quota count
- add support for TCP backlog, using the value provided by config.
 - don't attach to TCP client quota for listening sockets, only
   connected sockets.
2019-11-22 16:46:32 -08:00
Evan Hunt
c4ad0466d6 netmgr: log TCP connection errors 2019-11-22 16:46:32 -08:00
Evan Hunt
0260d31d26 netmgr: performance improvement
- use memory pools for ievent and uvreq objects.
2019-11-22 16:46:31 -08:00
Evan Hunt
199bd6b623 netmgr: make TCP timeouts configurable
- restore support for tcp-initial-timeout, tcp-idle-timeout,
  tcp-keepalive-timeout and tcp-advertised-timeout configuration
  options, which were ineffective previously.
2019-11-22 16:46:31 -08:00
Witold Kręcicki
b7a72b1667 netmgr: TCP improvements
- add timeout support for TCP and TCPDNS connections to protect against
  slowloris style attacks. currently, all timeouts are hard-coded.
- rework and simplify the TCPDNS state machine.
2019-11-22 16:46:31 -08:00
Mark Andrews
751ad12dea Merge branch '1334-threadsanitizer-data-race-dispatch-c-1339-in-tcp_recv' into 'master'
Resolve "ThreadSanitizer: data race dispatch.c:1339 in tcp_recv"

Closes #1334

See merge request isc-projects/bind9!2612
2019-11-22 21:23:10 +00:00
Mark Andrews
3075445ed6 lock dispatch before reporting state 2019-11-22 19:52:14 +00:00
Mark Andrews
caf073dbe7 Merge branch '1394-incoming-zone-transfer-messages-logged-to-wrong-category' into 'master'
Resolve "Incoming zone transfer messages logged to wrong category"

Closes #1394

See merge request isc-projects/bind9!2611
2019-11-22 19:37:51 +00:00
Mark Andrews
ab71b29098 add CHANGES 2019-11-22 13:14:54 +00:00
Mark Andrews
444d742a94 change log category of some messages to DNS_LOGCATEGORY_XFER_IN 2019-11-22 13:14:54 +00:00
Mark Andrews
eb21ecf55c Merge branch '1315-yaml-is-not-listed-in-the-man-page-or-the-h-listing-for-either-dig-or-delv' into 'master'
Resolve "+yaml is not listed in the man page or the -h listing for either dig or delv"

Closes #1315

See merge request isc-projects/bind9!2560
2019-11-22 13:13:05 +00:00
Mark Andrews
e98157b7fe add +[no]yaml to usage() 2019-11-23 00:02:52 +11:00
Mark Andrews
fdcd58d404 Merge branch '1317-alphabetise-delv-s-usage' into 'master'
Resolve "alphabetise delv's usage."

Closes #1317

See merge request isc-projects/bind9!2561
2019-11-22 13:00:14 +00:00
Mark Andrews
78685ed173 alphabetise delv's usage. 2019-11-22 12:38:20 +00:00
Witold Krecicki
9113ed840c Merge branch 'wpk/fix-mkeys-bug' into 'master'
Fix a bug in trust anchors verification.

See merge request isc-projects/bind9!2609
2019-11-21 19:13:55 +00:00
Witold Kręcicki
6030cadef0 CHANGES note 2019-11-21 18:43:47 +01:00
Witold Kręcicki
58db2d1d18 Fix a bug in trust anchors verification.
We were not reseting the keynode value when iterating over DNSKEYs in
RRSET, so we weren't checking all DNSKEYs against all trust anchors. This
commit fixes the issue by resetting keynode with every loop.
2019-11-21 18:18:56 +01:00
Evan Hunt
cadbc158f0 Merge branch 'merge-v9_15_6' into 'master'
merge 9.15.6 into master branch

See merge request isc-projects/bind9!2604
2019-11-20 21:37:26 +00:00
Evan Hunt
7bd3205c61 Merge tag 'v9_15_6' into merge-v9_15_6 2019-11-20 13:34:25 -08:00
Ondřej Surý
cd3e34de8f Merge branch 'ondrej/get-the-backtraces-out-of-system-test-coredumps' into 'master'
Get the backtraces out of system test coredumps

See merge request isc-projects/bind9!2602
2019-11-20 19:04:02 +00:00
Ondřej Surý
d0a0c22433 Get better stack traces 2019-11-21 02:05:47 +08:00
Ondřej Surý
512dadc8d1 Dump the backtrace to stdout when core is found in systest directory 2019-11-21 02:05:47 +08:00
Michal Nowak
081326929f Merge branch 'mnowak/537_Add_CI_step_to_test_named_-u' into 'master'
Verifying that named switches UID

Closes #537

See merge request isc-projects/bind9!2374
2019-11-20 10:37:24 +00:00
Michal Nowak
b00360537e Verifying that named switches UID
This test runs only under root, which is required for the user-switch
`-u` option to work.

Closes #537.
2019-11-20 10:56:21 +01:00
Mark Andrews
584c1da066 Merge branch 'marka-placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!2597
2019-11-20 01:03:37 +00:00
Mark Andrews
c727c59663 placeholder 2019-11-20 11:57:54 +11:00
Ondřej Surý
097328db7a Merge branch '1341-threadsanitizer-data-race-rbtdb-c-5756-in-add32' into 'master'
Resolve "ThreadSanitizer: data race rbtdb.c:5756 in add32"

Closes #1341

See merge request isc-projects/bind9!2577
2019-11-19 16:54:50 +00:00
Mark Andrews
4534fb5ec1 add CHANGES 2019-11-20 00:17:51 +08:00
Mark Andrews
7d4d64340e use update_recordsandbytes in rbt_datafixer 2019-11-20 00:17:51 +08:00
Mark Andrews
0cda448248 always obtain write lock when updating version->{records,bytes} 2019-11-20 00:17:51 +08:00
Michał Kępień
7e6d76e7db Merge branch '1308-fail-the-tcp-system-test-when-ans6-fails' into 'master'
Fail the "tcp" system test when ans6 fails

Closes #1308

See merge request isc-projects/bind9!2566
2019-11-19 14:51:01 +00:00
Michał Kępień
b50ced528d Fail the "tcp" system test when ans6 fails
Make the "tcp" system test fail if the Python tool used for establishing
TCP connections (ans6) logs a result different than "OK" after
processing a command sent to it (as that means the tool was unable to
successfully perform the requested action), with the exception of
cleanup errors at the end of the test which can be safely ignored.  Note
that the tool not returning any result at all in 10 seconds is still a
fatal error in all cases.
2019-11-19 15:26:56 +01:00
Ondřej Surý
304c1b6439 Merge branch '1377-threadsanitizer-data-race-astack-c-64-in-isc_astack_pop' into 'master'
Fix missing lock around pos and destroy mutex in isc_astack_destroy

Closes #1377

See merge request isc-projects/bind9!2588
2019-11-19 10:03:09 +00:00
Mark Andrews
9b6e023f84 Merge branch '1299-parse-commandline-code-should-be-done-in-alphabetical-order' into 'master'
Resolve "Parse commandline code should be done in alphabetical order"

Closes #1299

See merge request isc-projects/bind9!2559
2019-11-19 09:31:52 +00:00
Ondřej Surý
bcfc07e3d3 Fix missing lock around pos and destroy mutex in isc_astack_destroy 2019-11-19 10:31:07 +01:00
Mark Andrews
ca83a66618 alphabetize command line switch 2019-11-19 08:21:26 +00:00
Mark Andrews
6fe28d92c4 Merge branch '1344-threadsanitizer-data-race-rbtdb-c-2987-in-bind_rdataset' into 'master'
Resolve "ThreadSanitizer: data race rbtdb.c:2987 in bind_rdataset"

Closes #1344

See merge request isc-projects/bind9!2587
2019-11-19 08:20:08 +00:00
Mark Andrews
419aa15cd1 add CHANGES 2019-11-19 17:38:35 +11:00
Mark Andrews
fcb6dbcdd7 make header->count atomic 2019-11-19 17:29:20 +11:00
Ondřej Surý
eba576dddf Merge branch 'ondrej/dont-call-dns_adb_endupdfetch-for-TCP-queries' into 'master'
lib/dns/resolver.c: Call dns_adb_endudpfetch() only for UDP queries

See merge request isc-projects/bind9!2580
2019-11-18 19:47:53 +00:00
Ondřej Surý
a5189eefa5 lib/dns/resolver.c: Call dns_adb_endudpfetch() only for UDP queries
The dns_adb_beginudpfetch() is called only for UDP queries, but
the dns_adb_endudpfetch() is called for all queries, including
TCP.  This messages the quota counting in adb.c.
2019-11-19 02:53:56 +08:00
Ondřej Surý
55d82ced78 Merge branch 'ondrej/switch-coccinelle-job-to-buster' into 'master'
Switch coccinelle job to buster

See merge request isc-projects/bind9!2582
2019-11-18 17:58:54 +00:00
Ondřej Surý
0946db13de Installing coccinelle on Debian sid is broken, switch to Debian buster 2019-11-19 01:54:20 +08:00
Ondřej Surý
c17bc7387c Merge branch '1368-threadsanitizer-can-t-handle-more-than-64-mutexes' into 'master'
lib/dns/adb.c:

Closes #1368

See merge request isc-projects/bind9!2579
2019-11-18 07:30:35 +00:00
Witold Kręcicki
7d93371581 lib/dns/adb.c: don't use more than 64 lock simultaneously when run under TSAN
- TSAN can't handle more than 64 locks in one thread, lock ADB bucket-by-bucket
   in TSAN mode. This means that the dump won't be consistent but it's good
   enough for testing

 - Use proper order when unlocking adb->namelocks and adb->entrylocks when
   dumping ADB.
2019-11-18 06:51:30 +01:00
Tinderbox User
fa2f16db89 Merge branch 'prep-release' into security-master 2019-11-17 18:59:41 -08:00
Evan Hunt
a48814906f Merge branch 'security-client-connection-limit' into security-master 2019-11-17 18:59:41 -08:00
Tinderbox User
767a2aef43 prep 9.15.6 2019-11-17 18:59:41 -08:00
Evan Hunt
7c54199fe1 CHANGES, release note. 2019-11-17 18:59:40 -08:00
Evan Hunt
73cafd9d57 clean up comments 2019-11-17 18:59:40 -08:00
Witold Kręcicki
70f80a3ec7 fix a problem with the mem_test unit test
isc_mem_traceflag_test messes with stdout/stderr, which can cause
problems with subsequent tests (no output, libuv problems).  Moving that
test case to the end ensures there are no side effects.
2019-11-17 18:59:40 -08:00
Witold Kręcicki
62a8405fa2 netmgr: close uv_loop properly
close the uv_handle for the worker async channel, and call
uv_loop_close() on shutdown to ensure that the event loop's
internal resources are properly freed.
2019-11-17 18:59:40 -08:00
Witold Kręcicki
6718a4ef8b ensure isc_queue_t is aligned to double-cacheline size 2019-11-17 18:59:40 -08:00
Evan Hunt
123ee350dc place a limit on pipelined queries that can be processed simultaneously
when the TCPDNS_CLIENTS_PER_CONN limit has been exceeded for a TCP
DNS connection, switch to sequential mode to ensure that memory cannot
be exhausted by too many simultaneous queries.
2019-11-17 18:59:39 -08:00
Evan Hunt
20bb812148 Merge branch 'each-ds-anchor-mirror-zones' into 'master'
add support for DS trust anchors in mirror zone verification

See merge request isc-projects/bind9!2576
2019-11-18 02:59:08 +00:00
Evan Hunt
0f9d8eb7b5 add support for DS trust anchors in mirror zone verification 2019-11-17 17:44:17 -08:00
Evan Hunt
c5b6f21515 Merge branch '1119-make-lib/ns-thread-sanitizer-clean' into 'master'
Make lib/ns Thread Sanitizer clean

See merge request isc-projects/bind9!2366
2019-11-18 01:43:06 +00:00
Ondřej Surý
e95af30b23 Make lib/ns Thread Sanitizer clean 2019-11-17 17:42:41 -08:00
Evan Hunt
dad10c0fd0 Merge branch '1119-tsan-lib/dns/tests/zt_test.c' into 'master'
Use atomic_bool for variables shared among threads to make zt_test.c thread-safe

See merge request isc-projects/bind9!2361
2019-11-18 01:40:59 +00:00
Ondřej Surý
7b9084d45d Use atomic_bool for variables shared among threads to make zt_test.c thread-safe 2019-11-18 08:39:12 +08:00
Ondřej Surý
6858ef9adc Merge branch '1119-tsan-lib/isc/tests/socket_test.c' into 'master'
Change the shared completion->done variable to atomic_bool in socket_test.c

See merge request isc-projects/bind9!2362
2019-11-17 14:55:24 +00:00
Ondřej Surý
23964dbbbc Change the shared completion->done variable to atomic_bool in socket_test.c 2019-11-17 09:38:36 +08:00
Ondřej Surý
76d1e95f4e Merge branch '1313-master-failing-to-build-on-macos-high-sierra' into 'master'
Resolve "master failing to build on MacOS High Sierra"

Closes #1313

See merge request isc-projects/bind9!2562
2019-11-16 05:22:05 +00:00
Mark Andrews
00605058b4 conditionally test based on USE_LIBTOOL or LD_WRAP 2019-11-16 11:46:06 +08:00
Mark Andrews
c7b20f3c40 specify the install name when building libwrap 2019-11-16 11:21:41 +08:00
Mark Andrews
b88faee181 MacOS portability
-Wl,-z,interpose is not supported.
-Wl,rpath=<path> is not supported use -Wl,rpath,<path> instead.
Use @SO@ for loadable extension.
Use -L <path> -l libwrap instead of libwrap.sa.
2019-11-16 11:21:41 +08:00
Evan Hunt
ac65f56774 Merge branch '622-ds-anchor' into 'master'
support "initial-ds" in managed-keys

Closes #622

See merge request isc-projects/bind9!1762
2019-11-16 02:32:12 +00:00
Evan Hunt
d97e628f81 CHANGES, release notes 2019-11-15 15:47:57 -08:00
Evan Hunt
c29ccae2a6 Document initial-ds and static-ds keywords 2019-11-15 15:47:57 -08:00
Evan Hunt
54a682ea50 use DS style trust anchors in all system tests
this adds functions in conf.sh.common to create DS-style trust anchor
files. those functions are then used to create nearly all of the trust
anchors in the system tests.

there are a few exceptions:
 - some tests in dnssec and mkeys rely on detection of unsupported
   algorithms, which only works with key-style trust anchors, so those
   are used for those tests in particular.
 - the mirror test had a problem with the use of a CSK without a
   SEP bit, which still needs addressing

in the future, some of these tests should be changed back to using
traditional trust anchors, so that both types will be exercised going
forward.
2019-11-15 15:47:57 -08:00
Evan Hunt
342cc9b168 add support for DS trust anchors in delv 2019-11-15 15:47:57 -08:00
Evan Hunt
edafbf1c0f fix root key sentinel code to send the correct key ID for DS trust anchors 2019-11-15 15:47:57 -08:00
Evan Hunt
8aaee26548 add validator support for static DS-style trust anchors 2019-11-15 15:47:56 -08:00
Evan Hunt
4d3ed3f4ea refactor create_keydata
use empty placeholder KEYDATA records for all trust anchors, not just
DS-style trust anchors.

this revealed a pre-existing bug: keyfetch_done() skips keys without
the SEP bit when populating the managed-keys zone. consequently, if a
zone only has a single ZSK which is configured as trust anchor and no
KSKs, then no KEYDATA record is ever written to the managed-keys zone
when keys are refreshed.

that was how the root server in the dnssec system test was configured.
however, previously, the KEYDATA was created when the key was
initialized; this prevented us from noticing the bug until now.

configuring a ZSK as an RFC 5011 trust anchor is not forbidden by the
spec, but it is highly unusual and not well defined.  so for the time
being, I have modified the system test to generate both a KSK and ZSK
for the root zone, enabling the test to pass.

we should consider adding code to detect this condition and allow keys
without the SEP bit to be used as trust anchors if no key with the SEP
bit is available, or at minimum, log a warning.
2019-11-15 15:47:56 -08:00
Evan Hunt
a8f89e9a9f use DS-style trust anchor to verify 5011 key refresh query
note: this also needs further refactoring.

- when initializing RFC 5011 for a name, we populate the managed-keys
  zone with KEYDATA records derived from the initial-key trust anchors.

  however, with initial-ds trust anchors, there is no key. but the
  managed-keys zone still must have a KEYDATA record for the name,
  otherwise zone_refreshkeys() won't refresh that key. so, for
  initial-ds trust anchors, we now add an empty KEYDATA record and set
  the key refresh timer so that the real keys will be looked up as soon
  as possible.

- when a key refresh query is done, we verify it against the
  trust anchor; this is done in two ways, one with the DS RRset
  set up during configuration if present, or with the keys linked
  from each keynode in the list if not.  because there are two different
  verification methods, the loop structure is overly complex and should
  be simplified.

- the keyfetch_done() and sync_keyzone() functions are both too long
  and should be broken into smaller functions.
2019-11-15 15:47:56 -08:00
Evan Hunt
854af5a353 allow DS trust anchors to be set in keytable
note: this is a frankensteinian kluge which needs further refactoring.

the keytable started as an RBT where the node->data points to a list of
dns_keynode structures, each of which points to a single dst_key.
later it was modified so that the list could instead point to a single
"null" keynode structure, which does not reference a key; this means
a trust anchor has been configured but the RFC 5011 refresh failed.

in this branch it is further updated to allow the first keynode in
the list to point to an rdatalist of DS-style trust anchors.  these will
be used by the validator to populate 'val->dsset' when validating a zone
key.

a DS style trust anchor can be updated as a result of RFC 5011
processing to contain DST keys instead; this results in the DS list
being freed.  the reverse is not possible; attempting to add a DS-style
trust anchor if a key-style trust anchor is already in place results
in an error.

later, this should be refactored to use rdatalists for both DS-style
and key-style trust anchors, but we're keeping the existing code for
old-style trust anchors for now.
2019-11-15 15:47:56 -08:00
Evan Hunt
1a8348e2b4 disallow use of DS- and key-style trust anchors for the same name 2019-11-15 15:47:41 -08:00
Evan Hunt
feba480527 read DS trust anchors in named.conf
(but they aren't used for anything yet)
2019-11-15 15:47:17 -08:00
Evan Hunt
3fede8a7e9 add "static-ds" and "initial-ds" keywords to config parser 2019-11-15 15:47:17 -08:00
Evan Hunt
ac0d3c21c6 add a global function to match a DS rdata to a DNSKEY 2019-11-15 15:47:17 -08:00
Evan Hunt
f75328b178 Merge branch '622-validator-refactoring' into 'master'
preliminary validator refactoring

See merge request isc-projects/bind9!2346
2019-11-15 23:46:36 +00:00
Evan Hunt
11cd9d86e4 CHANGES, release note 2019-11-15 14:26:08 -08:00
Evan Hunt
692c879e3c remove unneeded members from dns_validator
- val->keynode and val->seensig were set but never used.
- val->nearest, val->soaset, val->soaname, val->nsecset and val->nsec3set
  were never used at all.
2019-11-15 14:26:08 -08:00
Evan Hunt
3a4334636b simplify validate_dnskey and seek_ds
- pull out the code that checks whether a key was signed by a trust
  anchor into a separate function, anchor_signed().
- pull out the code that looks up a DS while validating a zone key
  into a separate function, get_dsset().
- check in create_validator() whether the sigrdataset is bound, so that
  we can always pass in &val->fsigrdataset during an insecurity proof;
  this will allow a reduction of code duplication.
2019-11-15 14:26:08 -08:00
Evan Hunt
9119dc25fe continue renaming functions for clarity
- also simplified some calls: don't pass siginfo where val->siginfo
  is sufficient, don't INSIST where returning false is sufficient.
- also added header comments to several local functions.
2019-11-15 14:26:07 -08:00
Evan Hunt
22aa668b7d convert if to switch in get_key 2019-11-15 14:26:07 -08:00
Evan Hunt
9150688efd rename fetch/validator callback functions for consistency and clarity 2019-11-15 14:26:07 -08:00
Evan Hunt
edc9c79c9c reorder switch in validatezonekey to similar order as seek_ds 2019-11-15 14:26:07 -08:00
Evan Hunt
d0f8c50618 convert if statement to switch 2019-11-15 14:26:07 -08:00
Evan Hunt
ea1d4d11fc refactor dsfetched/dsfetched2 into a common function 2019-11-15 14:26:06 -08:00
Evan Hunt
3659cca624 rename some functions for better clarity 2019-11-15 14:26:06 -08:00
Evan Hunt
54710873a7 move some duplicate code into validate_neg_rrset() 2019-11-15 14:26:06 -08:00
Evan Hunt
6dc5343d6d move the 'mustbesecure' checks into markanswer() 2019-11-15 14:26:06 -08:00
Evan Hunt
61456d886e split proveunsecure() 2019-11-15 14:26:06 -08:00
Evan Hunt
34d7776f14 reduce redundant code 2019-11-15 14:10:56 -08:00
Evan Hunt
32d1cc1562 style, braces, whitespace 2019-11-15 14:10:56 -08:00
Mark Andrews
95817d8bbb Merge branch '1323-reenable-lib-ns-unittests' into 'master'
Properly disable lib/ns tests when run under ASAN

Closes #1323

See merge request isc-projects/bind9!2568
2019-11-15 05:50:14 +00:00
Ondřej Surý
d50322ed95 Properly disable lib/ns tests when run under ASAN 2019-11-15 05:09:52 +00:00
Mark Andrews
abe8fa5253 Merge branch '1327-update-solution-dependencies-host-and-nslookup-depend-on-libirs' into 'master'
Resolve "Update solution dependencies: 'dig', 'host' and 'nslookup' depend on libirs."

Closes #1327

See merge request isc-projects/bind9!2573
2019-11-15 01:09:16 +00:00
Mark Andrews
72ca05c966 Add dependancy on libirs to dig, host, and nslookup. 2019-11-15 11:22:35 +11:00
Ondřej Surý
7101eae6f4 Merge branch 'ondrej/fix-timer-test' into 'master'
Fix the crash in the timer test

See merge request isc-projects/bind9!2557
2019-11-13 14:29:49 +00:00
Evan Hunt
bd9f5c3c19 fix netmgr setup/teardown issues; setup and teardown only once in timer_test
- the netmgr was not correctly being specified when creating the task
  manager, and was cleaned up in the wrong order when shutting down.
- on freebsd, timer_test appears to be prone to failure if the
  netmgr is set up and torn down before and after ever test case, but
  less so if it's only set up once at the beginning and once at the
  end.
2019-11-13 14:47:47 +01:00
Ondřej Surý
aca0f88750 Remove the assertions from subthreads and use global errcnt to record errors 2019-11-13 14:47:47 +01:00
Ondřej Surý
2c3589e22a Lock the lasttime variable that's concurrently accessed between threads 2019-11-13 14:47:47 +01:00
Ondřej Surý
b9cb4c94fa Directly embed ../timer.c in timer_test.c for better assertion testing 2019-11-13 14:47:47 +01:00
Ondřej Surý
8de64964a3 Refactor the way we use memory context from isctest.c
This commit renames isctest {mctx,lctx} to test_{mctx,lctx} and cleans
up their usage in the individual unit tests.  This allows embedding
library .c files directly into the unit tests.
2019-11-13 14:47:47 +01:00
Witold Krecicki
229b7d85e8 Merge branch 'wpk/fix-accidental-task-unpause' into 'master'
Fix implicit task unpause when going from 'running' to 'idle'.

See merge request isc-projects/bind9!2571
2019-11-13 13:45:09 +00:00
Witold Kręcicki
5ce4b04b50 If a task is running and we call isc_task_pause it can
be implicitly unpaused when we switch from 'running' to
'idle' state. Fix it by not switching to 'idle' when paused.
2019-11-13 12:32:17 +00:00
Michał Kępień
3d92f5e95a Merge branch 'fix-url-in-readme' into 'master'
updated a broken link for newer release notes.

See merge request isc-projects/bind9!2567
2019-11-13 11:59:11 +00:00
Vicky Risk
c830a9116d Update broken release notes link 2019-11-13 12:56:05 +01:00
Michał Kępień
b4a015ebcd Merge branch 'michal/fix-libuv.dll-handling' into 'master'
Fix libuv.dll handling

See merge request isc-projects/bind9!2556
2019-11-12 11:24:41 +00:00
Michał Kępień
d8768bd143 Fix libuv.dll handling
Make sure libuv.dll gets copied to the proper directory in the Release
build configuration and that the BIND installer on Windows installs
libuv.dll.
2019-11-12 09:14:59 +00:00
Ondřej Surý
fadd39dc83 Merge branch 'ondrej/cleanup-PATH_MAX-and-NAME_MAX-ifdefs' into 'master'
Cleanup the {PATH,NAME}_MAX stray #ifdefs

See merge request isc-projects/bind9!2565
2019-11-12 09:13:25 +00:00
Ondřej Surý
bd80969b11 Cleanup the {PATH,NAME}_MAX stray #ifdefs 2019-11-12 09:36:08 +01:00
Ondřej Surý
e879490f10 Merge branch 'hurd' into 'master'
hurd: Fix build

See merge request isc-projects/bind9!2558
2019-11-12 08:09:03 +00:00
Samuel Thibault
d10fbdec84 hurd: Fix build
Move PATH_MAX, NAME_MAX, IOV_MAX default definitions to the common
<isc/platform.h>.
2019-11-10 20:14:17 +00:00
Michał Kępień
9e2da86ab9 Merge branch '1134-add-missing-dnssec-keygen-dependency-on-libisccfg' into 'master'
Add missing dnssec-keygen dependency on libisccfg

Closes #1134

See merge request isc-projects/bind9!2555
2019-11-08 12:42:50 +00:00
Michał Kępień
47e14c4d17 Add missing dnssec-keygen dependency on libisccfg
Commit 09ac224c5c made dnssec-keygen
depend on libisccfg but the Visual Studio solution file was not updated
to reflect that change.  Make sure the dnssec-keygen Visual Studio
project depends on the libisccfg project to prevent compilation issues
during parallel builds.
2019-11-08 12:56:09 +01:00
Michał Kępień
7df491e819 Merge branch 'michal/split-release-notes-into-per-version-sections' into 'master'
Split release notes into per-version sections

See merge request isc-projects/bind9!2524
2019-11-08 11:16:02 +00:00
Michał Kępień
8729c56cd8 Rebuild output files 2019-11-08 12:06:31 +01:00
Michał Kępień
dfc312ac56 Update URLs used in release notes
Some URLs used in release notes became outdated.  Make sure they point
to currently available resources.
2019-11-08 12:05:54 +01:00
Michał Kępień
2f37ab1dac Split release notes into per-version sections
Intertwining release notes from different BIND releases in a single XML
file has caused confusion in the past due to different (and often
arbitrary) approaches to keeping/removing release notes from older
releases on different BIND branches.  Divide doc/arm/notes.xml into
per-version sections to simplify determining the set of changes
introduced by a given release and to make adding/reviewing release notes
less error-prone.
2019-11-08 12:05:52 +01:00
Ondřej Surý
86b10eff81 Merge branch '1256-fix-the-jitter-test-2' into 'master'
Wait a little bit longer for autosign, bail out on not enough categories

See merge request isc-projects/bind9!2554
2019-11-08 07:43:50 +00:00
Ondřej Surý
f1cbdc5498 Wait a little bit longer for autosign, bail out on not enough categories 2019-11-08 07:43:33 +01:00
Ondřej Surý
d6f68fc4f0 Adjust the jitter range to +-3*stddev 2019-11-08 07:05:02 +01:00
Ondřej Surý
46eaa854d2 Merge branch '1256-fix-the-jitter-test' into 'master'
Check if the RRSIG jitter falls <mean-2.5*stddev;mean+2.5*stddev>

Closes #1309

See merge request isc-projects/bind9!2553
2019-11-08 06:01:47 +00:00
Ondřej Surý
02050bc506 Revert "temporarily disable jitter tests in the 'autosign' system test"
This reverts commit e17b7ee05a.
2019-11-08 07:00:08 +01:00
Ondřej Surý
0480a95ddf Check if the RRSIG jitter falls into mean+-2.5*stddev range 2019-11-08 06:59:40 +01:00
Witold Krecicki
25800c892f Merge branch '29-libuv-network-manager' into 'master'
libuv-based network manager

Closes #29

See merge request isc-projects/bind9!2528
2019-11-07 21:32:28 +00:00
Evan Hunt
129fb63db6 CHANGES, README, release note 2019-11-07 12:42:14 -08:00
Evan Hunt
24510a1fda adjust system tests to deal with possible timing issues
With the netmgr in use, named may start answering queries before zones
are loaded. This can cause transient failures in system tests after
servers are restarted or reconfigured. This commit adds retry loops
and sleep statements where needed to address this problem.

Also incidentally silenced a clang warning.
2019-11-07 12:42:14 -08:00
Evan Hunt
b9a5508e52 remove ISC_QUEUE as it is no longer used 2019-11-07 11:55:37 -08:00
Evan Hunt
53f0b6c34d convert ns_client and related objects to use netmgr
- ns__client_request() is now called by netmgr with an isc_nmhandle_t
  parameter. The handle can then be permanently associated with an
  ns_client object.
- The task manager is paused so that isc_task events that may be
  triggred during client processing will not fire until after the netmgr is
  finished with it. Before any asynchronous event, the client MUST
  call isc_nmhandle_ref(client->handle), to prevent the client from
  being reset and reused while waiting for an event to process. When
  the asynchronous event is complete, isc_nmhandle_unref(client->handle)
  must be called to ensure the handle can be reused later.
- reference counting of client objects is now handled in the nmhandle
  object.  when the handle references drop to zero, the client's "reset"
  callback is used to free temporary resources and reiniialize it,
  whereupon the handle (and associated client) is placed in the
  "inactive handles" queue.  when the sysstem is shutdown and the
  handles are cleaned up, the client's "put" callback is called to free
  all remaining resources.
- because client allocation is no longer handled in the same way,
  the '-T clienttest' option has now been removed and is no longer
  used by any system tests.
- the unit tests require wrapping the isc_nmhandle_unref() function;
  when LD_WRAP is supported, that is used. otherwise we link a
  libwrap.so interposer library and use that.
2019-11-07 11:55:37 -08:00
Witold Kręcicki
33bf90331b use clock_gettime() instead of gettimeofday() for isc_itme functions 2019-11-07 11:55:37 -08:00
Witold Kręcicki
a85a65f96e add atomic_exchange operations to mutexatomic.h and win32 stdatomic.h 2019-11-07 11:55:37 -08:00
Evan Hunt
59c64fa4bd add isc_task_pause() and isc_task_unpause() functions
This allows a task to be temporary disabled so that objects won't be
processed simultaneously by libuv events and isc_task events. When a
task is paused, currently running events may complete, but no further
event will added to the run queue will be executed until the task is
unpaused.
2019-11-07 11:55:37 -08:00
Evan Hunt
36ee430327 optionally associate a netmgr with a task manager when creating
When a task manager is created, we can now specify an `isc_nm`
object to associate with it; thereafter when the task manager is
placed into exclusive mode, the network manager will be paused.
2019-11-07 11:55:37 -08:00
Witold Kręcicki
f188d00227 disable leak detection in ASAN; libuv has some problems with that 2019-11-07 11:55:37 -08:00
Evan Hunt
48d003edf7 use netmgr in libisc unit tests 2019-11-07 11:55:37 -08:00
Witold Kręcicki
70397f9d92 netmgr: libuv-based network manager
This is a replacement for the existing isc_socket and isc_socketmgr
implementation. It uses libuv for asynchronous network communication;
"networker" objects will be distributed across worker threads reading
incoming packets and sending them for processing.

UDP listener sockets automatically create an array of "child" sockets
so each worker can listen separately.

TCP sockets are shared amongst worker threads.

A TCPDNS socket is a wrapper around a TCP socket, which handles the
the two-byte length field at the beginning of DNS messages over TCP.

(Other wrapper socket types can be implemented in the future to handle
DNS over TLS, DNS over HTTPS, etc.)
2019-11-07 11:55:37 -08:00
Evan Hunt
a8c814cb2f implement fixed-size array stack data structure 2019-11-07 11:55:37 -08:00
Witold Kręcicki
402969bf95 implement fetch-and-add array queue data structure
this is a lockless queue based on hazard pointers.
2019-11-07 11:55:37 -08:00
Evan Hunt
64e1a4a398 temporarily move ISC_QUEUE to list.h
The double-locked queue implementation is still currently in use
in ns_client, but will be replaced by a fetch-and-add array queue.
This commit moves it from queue.h to list.h so that queue.h can be
used for the new data structure, and clean up dependencies between
list.h and types.h. Later, when the ISC_QUEUE is no longer is use,
it will be removed completely.
2019-11-07 11:55:37 -08:00
Witold Kręcicki
aa57fa7090 implement hazard pointer data structure
this is a mechanism to allow safe lock-free data structures.
2019-11-07 11:55:37 -08:00
Witold Kręcicki
ae202e0e7c Preliminary netmgr design documentation 2019-11-07 11:55:37 -08:00
Witold Kręcicki
a5f8374400 add isc_sockaddr_fromsockaddr function
This converts from struct sockaddr to isc_sockaddr_t
2019-11-07 11:55:37 -08:00
Evan Hunt
949103c14f Merge branch '1308-fix-tcp-system-test' into 'master'
Fix "tcp" system test

Closes #1308

See merge request isc-projects/bind9!2549
2019-11-07 19:55:04 +00:00
Evan Hunt
18c9a20f32 make send_command wait for any result, rather than specifically result=OK 2019-11-07 11:32:59 -08:00
Michał Kępień
23ca0ec55b Address ShellCheck warnings
Address all outstanding warnings that ShellCheck reports for
bin/tests/system/tcp/tests.sh.
2019-11-07 11:31:57 -08:00
Michał Kępień
9841635b7f Use "set -e" in the "tcp" system test
Ensure any unexpected failure in the "tcp" system test causes it to be
immediately interrupted with an error to make the aforementioned test
more reliable.  Since the exit code for "expr 0 + 0" is 1, the status
variable needs to be updated using arithmetic expansion.
2019-11-07 11:31:57 -08:00
Michał Kępień
46df363a0d Ensure all "tcp" system test errors are caught
Ensure any "rndc stats" failure causes the "tcp" system test to fail.
Do not hide "rndc stats" output.
2019-11-07 11:31:57 -08:00
Michał Kępień
2f4877d11c Make all "tcp" system test checks numbered
Ensure all checks in the "tcp" system test are numbered, so that
forensic data is preserved in case of any failure.
2019-11-07 11:31:57 -08:00
Michał Kępień
6bd1f68bef Fix argument order in assert_int_equal()
assert_int_equal() calls in bin/tests/system/tcp/tests.sh pass the found
value as the first argument and the expected value as the second
argument, while the function interprets its arguments the other way
round.  Fix argument handling in assert_int_equal() to make sure the
error messages printed by that function are correct.
2019-11-07 11:31:57 -08:00
Michał Kępień
1e22e052d0 Allow retries when checking TCP high-water stats
In the TCP high-water checks, "rndc stats" is run after ans6 reports
that it opened the requested number of TCP connections.  However, we
fail to account for the fact that ns5 might not yet have called accept()
for these connections, in which case the counts output by "rndc stats"
will be off.  To prevent intermittent "tcp" system test failures, allow
the relevant connection count checks to be retried (just once, after one
second, as that should be enough for any system to accept() a dozen TCP
connections under any circumstances).
2019-11-07 11:31:57 -08:00
Evan Hunt
69f8f65323 Merge branch 'each-disable-jitter-test' into 'master'
temporarily disable jitter tests in the 'autosign' system test

See merge request isc-projects/bind9!2551
2019-11-07 18:25:36 +00:00
Evan Hunt
e17b7ee05a temporarily disable jitter tests in the 'autosign' system test
the current method used for testing distribution of signatures
is failure-prone. we need to replace it with something both
effective and portable, but in the meantime we're commenting
out the jitter test.
2019-11-07 10:01:58 -08:00
Ondřej Surý
65860c8000 Merge branch '1134-fix-bashisms-in-kasp-test' into 'master'
Fix the bashisms in kasp/tests.sh and make the script shellcheck clean

See merge request isc-projects/bind9!2548
2019-11-07 12:52:14 +00:00
Ondřej Surý
d5f00f8303 Use better '\#' quoting in ns3/setup.sh 2019-11-07 12:12:24 +01:00
Ondřej Surý
e9df8f4e8e Relax the requirement for check_next_key_event() to <-60;60>
The original requirement for the check to pass was <-10;10> interval and
the first test was failing by 1 second.  As the minimum interval for
checking is 7200 seconds, the commit relaxes the requirement to <-60;60>
interval, which is still sane, but not that draconic.
2019-11-07 12:08:20 +01:00
Ondřej Surý
88bfce0993 Fix the get_keyids() usage as it could return multiple key ids
The get_keyids() function can return multiple keyids, when the
return value was not quoted, only the first keyid would be checked
with check_key() function.  This MR fixes both the error that came
with quoting the "$id" with value "12345 54321", and the code now
checks all returned keyids.
2019-11-07 12:08:20 +01:00
Ondřej Surý
91498f8b9b Clean the rest of the shellcheck errors 2019-11-07 12:08:20 +01:00
Ondřej Surý
ec9d6ab64c Use the shellcheck -f diff to autofix certain classes of sh errors 2019-11-07 12:08:20 +01:00
Ondřej Surý
3a9de38eb6 Replace bash array with concatenated evaluated shell variables 2019-11-07 10:44:30 +01:00
Evan Hunt
8afcffaa86 Merge branch 'each-kasp-relnotes' into 'master'
KASP release notes

See merge request isc-projects/bind9!2547
2019-11-07 04:12:36 +00:00
Evan Hunt
45d6239829 CHANGES, REAMDE, release note 2019-11-06 20:06:36 -08:00
Evan Hunt
18454a0b9d add 'kasp' to test list 2019-11-06 19:54:02 -08:00
Matthijs Mekking
e7a9f52f50 Merge branch '1134-dnssec-made-easy' into 'master'
DNSSEC Made Easy

Closes #1134

See merge request isc-projects/bind9!2458
2019-11-06 22:40:53 +00:00
Matthijs Mekking
bae0edbf02 Fix checkconf test 2019-11-06 22:36:21 +01:00
Matthijs Mekking
5f464d15a0 dnssec-policy inheritance from options/view
'dnssec-policy' can now also be set on the options and view level and
a zone that does not set 'dnssec-policy' explicitly will inherit it
from the view or options level.

This requires a new keyword to be introduced: 'none'.  If set to
'none' the zone will not be DNSSEC maintained, in other words it will
stay unsigned.  You can use this to break the inheritance.  Of course
you can also break the inheritance by referring to a different
policy.

The keywords 'default' and 'none' are not allowed when configuring
your own dnssec-policy statement.

Add appropriate tests for checking the configuration (checkconf)
and add tests to the kasp system test to verify the inheritance
works.

Edit the kasp system test such that it can deal with unsigned zones
and views (so setting a TSIG on the query).
2019-11-06 22:36:21 +01:00
Mark Andrews
ce1c1631b3 move appending kasp to the list until we can't fail; document why we don't detach 2019-11-06 22:36:21 +01:00
Mark Andrews
5eedd365d4 Insist that kasp is not linked. 2019-11-06 22:36:21 +01:00
Matthijs Mekking
f11ce44818 Make kasp opaque 2019-11-06 22:36:21 +01:00
Matthijs Mekking
70da58c871 kasp.c: return parenthesis (style) and REQUIRE
This code was missing a lot of return parenthesis (violating our
style guide) and a missing REQUIRE in 'dns_kasplist_find()'.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
c3e0ac865f Add tests for CDS/CDNSKEY publication
The kasp system tests are updated with 'check_cds' calls that will
verify that the correct CDS and CDNSKEY records are published during
a rollover and that they are signed with the correct KSK.

This requires a change in 'dnssec.c' to check the kasp key states
whether the CDS/CDNSKEY of a key should be published or not.  If no
kasp state exist, fall back to key timings.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
2e46dcbbce sign_apex() should also consider CDS/CDNSKEY
The 'sign_apex()' function has special processing for signing the
DNSKEY RRset such that it will always be signed with the active
KSK.  Since CDS and CDNSKEY are also signed with the KSK, it
should have the same special processing.  The special processing is
moved into a new function 'tickle_apex_rrset()' and is applied to
all three RR types (DNSKEY, CDS, CDNSKEY).

In addition, when kasp is involved, update the DNSKEY TTL accordingly
to what is in the policy.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
1211c348bb Add dst_key_copy_metadata function.
When updating DNSSEC keys we would like to be able to copy the
metadata from one key to another.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
29e6ec3181 KASP timings all uint32_t
Get rid of the warnings in the Windows build.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
9fbc869108 Test CSK rollover
Test two CSK rollover scenarios, one where the DS is swapped before the zone
signatures are all replaced, and one where the signatures are replaced sooner
than the DS is swapped.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
67033bfd3d Code changes for CSK
Update dns_dnssec_keyactive to differentiate between the roles ZSK
and KSK.  A key is active if it is signing but that differs per role.
A ZSK is signing if its ZRRSIG state is in RUMOURED or OMNIPRESENT,
a KSK is signing if its KRRSIG state is in RUMOURED or OMNIPRESENT.

This means that a key can be actively signing for one role but not
the other.  Add checks in inline signing (zone.c and update.c) to
cover the case where a CSK is active in its KSK role but not the ZSK
role.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
6468ffc336 Use keywords in dnssec-policy keys configuration
Add keywords 'lifetime' and 'algorithm' to make the key configuration
more clear.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
36c72bf3c3 Test ZSK and KSK rollover
Add tests for ZSK Pre-Publication and KSK Double-KSK rollover.

Includes tests for next key event is scheduled at the right time.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
c9f1ec8380 Add kasp tests
Add more tests for kasp:

- Add tests for different algorithms.

- Add a test to ensure that an edit in an unsigned zone is
  picked up and properly signed.

- Add two tests that ensures that a zone gets signed when it is
  configured as so-called 'inline-signing'.  In other words, a
  secondary zone that is configured with a 'dnssec-policy'.  A zone
  that is transferred over AXFR or IXFR will get signed.

- Add a test to ensure signatures are reused if they are still
  fresh enough.

- Adds two more tests to verify that expired and unfresh signatures
  will be regenerated.

- Add tests for various cases with keys already available in the
  key-directory.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
7c783ab909 Refactor kasp system test
A significant refactor of the kasp system test in an attempt to
make the test script somewhat brief.  When writing a test case,
you can/should use the functions 'zone_properties',
'key_properties', and 'key_timings' to set the expected values
when checking a key with 'check_key'. All these four functions
can be used to set environment variables that come in handy when
testing output.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
c125b721ef Adjust signing code to use kasp
Update the signing code in lib/dns/zone.c and lib/dns/update.c to
use kasp logic if a dnssec-policy is enabled.

This means zones with dnssec-policy should no longer follow
'update-check-ksk' and 'dnssec-dnskey-kskonly' logic, instead the
KASP keys configured dictate which RRset gets signed with what key.

Also use the next rekey event from the key manager rather than
setting it to one hour.

Mark the zone dynamic, as otherwise a zone with dnssec-policy is
not eligble for automatic DNSSEC maintenance.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
fcf14b2b47 DNSSEC hints use dst_key functions and key states
Update dns_dnssec_get_hints and dns_dnssec_keyactive to use dst_key
functions and thus if dnssec-policy/KASP is used the key states are
being considered.

Add a new variable to 'struct dns_dnsseckey' to signal whether this
key is a zone-signing key (it is no longer true that ksk == !zsk).

Also introduce a hint for revoke.

Update 'dns_dnssec_findzonekeys' and 'dns_dnssec_findmatchingkeys'
to also read the key state file, if available.

Remove 'allzsk' from 'dns_dnssec_updatekeys' as this was only a
hint for logging.

Also make get_hints() (now dns_dnssec_get_hints()) public so that
we can use it in the key manager.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
09990672d9 Update zoneconf to use kasp config
If a zone has a dnssec-policy set, use signature validity,
dnskey signature validity, and signature refresh from
dnssec-policy.

Zones configured with 'dnssec-policy' will allow 'named' to create
DNSSEC keys (similar to dnssec-keymgr) if not available.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
7e7aa5387c Introduce keymgr in named
Add a key manager to named.  If a 'dnssec-policy' is set, 'named'
will run a key manager on the matching keys.  This will do a couple
of things:

1. Create keys when needed (in case of rollover for example)
   according to the set policy.

2. Retire keys that are in excess of the policy.

3. Maintain key states according to "Flexible and Robust Key
   Rollover" [1]. After key manager ran, key files will be saved to
   disk.

   [1] https://matthijsmekking.nl/static/pdf/satin2012-Schaeffer.pdf

KEY GENERATION

Create keys according to DNSSEC policy.  Zones configured with
'dnssec-policy' will allow 'named' to create DNSSEC keys (similar
to dnssec-keymgr) if not available.

KEY ROLLOVER

Rather than determining the desired state from timing metadata,
add a key state goal.  Any keys that are created or picked from the
key ring and selected to be a successor has its key state goal set
to OMNIPRESENT (this key wants to be signing!). At the same time,
a key that is being retired has its key state goal set to HIDDEN.

The keymgr state machine with the three rules will make sure no
introduction or withdrawal of DNSSEC records happens too soon.

KEY TIMINGS

All timings are based on RFC 7583.

The keymgr will return when the next action is happening so
that the zone can set the proper rekey event. Prior to this change
the rekey event will run every hour by default (configurable),
but with kasp we can determine exactly when we need to run again.

The prepublication time is derived from policy.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
314b90dfdd Useful dst_key functions
Add a couple of dst_key functions for determining hints that
consider key states if they are available.
- dst_key_is_unused:
  A key has no timing metadata set other than Created.
- dst_key_is_published:
  A key has publish timing metadata <= now, DNSKEY state in
  RUMOURED or OMNIPRESENT.
- dst_key_is_active:
  A key has active timing metadata <= now, RRSIG state in
  RUMOURED or OMNIPRESENT.
- dst_key_is_signing:
  KSK is_signing and is_active means different things than
  for a ZSK. A ZSK is active means it is also signing, but
  a KSK always signs its DNSKEY RRset but is considered
  active if its DS is present (rumoured or omnipresent).
- dst_key_is_revoked:
  A key has revoke timing metadata <= now.
- dst_key_is_removed:
  A key has delete timing metadata <= now, DNSKEY state in
  UNRETENTIVE or HIDDEN.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
1f0d6296a1 kasp: Expose more key timings
When doing rollover in a timely manner we need to have access to the
relevant kasp configured durations.

Most of these are simple get functions, but 'dns_kasp_signdelay'
will calculate the maximum time that is needed with this policy to
resign the complete zone (taking into account the refresh interval
and signature validity).

Introduce parent-propagation-delay, parent-registration-delay,
parent-ds-ttl, zone-max-ttl, zone-propagation-delay.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
dcf79ce61f keygen/settime: Write out successor/predecessor
When creating a successor key, or calculating time for a successor
key, write out the successor and predecessor metadata to the
related files.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
da0ae5299f arm: Update DNSSEC documentation 2019-11-06 22:36:21 +01:00
Matthijs Mekking
53e76f888b Allow DNSSEC records in kasp enabled zone
When signing a zone with dnssec-policy, we don't mind DNSSEC records.
This is useful for testing purposes, and perhaps it is better to
signal this behavior with a different configuration option.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
72042a06d6 dnssec-settime: Allow manipulating state files
Introduce a new option '-s' for dnssec-settime that when manipulating
timing metadata, it also updates the key state file.

For testing purposes, add options to dnssec-settime to set key
states and when they last changed.

The dst code adds ways to write and read the new key states and
timing metadata. It updates the parsing code for private key files
to not parse the newly introduced metadata (these are for state
files only).

Introduce key goal (the state the key wants to be in).
2019-11-06 22:31:45 +01:00
Matthijs Mekking
c55625b035 Add functionality to read key state from disk
When reading a key from file, you can set the DST_TYPE_STATE option
to also read the key state.

This expects the Algorithm and Length fields go above the metadata,
so update the write functionality to do so accordingly.

Introduce new DST metadata types for KSK, ZSK, Lifetime and the
timing metadata used in state files.
2019-11-06 22:31:45 +01:00
Matthijs Mekking
2924b19a9d Parse dnssec-policy config into kasp
Add code that actually stores the configuration into the kasp
structure and attach it to the appropriate zone.
2019-11-06 22:31:45 +01:00
Matthijs Mekking
09ac224c5c dnssec-keygen can create keys given dnssec-policy
This commit adds code for generating keys with dnssec-keygen given
a specific dnssec-policy.

The dnssec-policy can be set with a new option '-k'. The '-l'
option can be used to set a configuration file that contains a
specific dnssec-policy.

Because the dnssec-policy dictates how the keys should look like,
many of the existing dnssec-keygen options cannot be used together
with '-k'.

If the dnssec-policy lists multiple keys, dnssec-keygen has now the
possibility to generate multiple keys at one run.

Add two tests for creating keys with '-k': One with the default
policy, one with multiple keys from the configuration.
2019-11-06 22:31:45 +01:00
Matthijs Mekking
97a5698e06 Add various get functions for kasp
Write functions to access various elements of the kasp structure,
and the kasp keys. This in preparation of code in dnssec-keygen,
dnssec-settime, named...
2019-11-06 22:31:45 +01:00
Matthijs Mekking
77d2895a5a Update dst key code to maintain key state
Add a number of metadata variables (lifetime, ksk and zsk role).

For the roles we add a new type of metadata (booleans).

Add a function to write the state of the key to a separate file.

Only write out known metadata to private file.  With the
introduction of the numeric metadata "Lifetime", adjust the write
private key file functionality to only write out metadata it knows
about.
2019-11-06 22:31:45 +01:00
Matthijs Mekking
7f4d1dbddf Nit: fix typo in documentation dst_key_getnum 2019-11-06 22:31:44 +01:00
Matthijs Mekking
68e8741c98 Fix: nums type in dst_keys
This was isc_stdtime_t but should be uint32_t.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
e6ee5486ca Nit: fix typo (dnsssec-signzone) 2019-11-06 22:31:44 +01:00
Matthijs Mekking
7bfac50336 Add code for creating kasp from config
Add code for creating, configuring, and destroying KASP keys.  When
using the default policy, create one CSK, no rollover.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
1a9692f5c8 dnssec-keygen: Move keygen function above main
This is done in a separate commit to make diff easier.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
2829e29410 dnssec-keygen: Move key gen code in own function
In preparation for key generation with dnssec-policy, where multiple
keys may be created.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
48ce026dc9 Sync options in dnssec-keygen
Code and documentation were not in line:
- Remove -z option from code
- Remove -k option from docbook
- Add -d option to docbook
- Add -T option to docbook
2019-11-06 22:31:44 +01:00
Matthijs Mekking
e9ccebd94e Introduce kasp structure
This stores the dnssec-policy configuration and adds methods to
create, destroy, and attach/detach, as well as find a policy with
the same name in a list.

Also, add structures and functions for creating and destroying
kasp keys.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
a50d707fdc Introduce dnssec-policy configuration
This commit introduces the initial `dnssec-policy` configuration
statement. It has an initial set of options to deal with signature
and key maintenance.

Add some checks to ensure that dnssec-policy is configured at the
right locations, and that policies referenced to in zone statements
actually exist.

Add some checks that when a user adds the new `dnssec-policy`
configuration, it will no longer contain existing DNSSEC
configuration options.  Specifically: `inline-signing`,
`auto-dnssec`, `dnssec-dnskey-kskonly`, `dnssec-secure-to-insecure`,
`update-check-ksk`, `dnssec-update-mode`, `dnskey-sig-validity`,
and `sig-validity-interval`.

Test a good kasp configuration, and some bad configurations.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
1fbd8bb1b3 Design documentation 'dnssec-policy'
Initial design document.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
b7c5bfb203 Extend ttlval to accept ISO 8601 durations
The ttlval configuration types are replaced by duration configuration
types. The duration is an ISO 8601 duration that is going to be used
for DNSSEC key timings such as key lifetimes, signature resign
intervals and refresh periods, etc. But it is also still allowed to
use the BIND ttlval ways of configuring intervals (number plus
optional unit).

A duration is stored as an array of 7 different time parts.
A duration can either be expressed in weeks, or in a combination of
the other datetime indicators.

Add several unit tests to ensure the correct value is parsed given
different string values.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
c67379fb92 Change indentation in doc/arm/dnssec.xml
This commit does not change anything significant, it just makes
the file more readable in preparation for upcoming changes related
to the `dnssec-policy` configuration option.
2019-11-06 22:31:44 +01:00
Michał Kępień
799e95b132 Merge branch '1206-fix-tcp-high-water-release-note' into 'master'
Fix TCP high-water release note

Closes #1206

See merge request isc-projects/bind9!2541
2019-11-06 15:28:55 +00:00
Michał Kępień
d0a3273d4d Fix TCP high-water release note
Add missing GitLab issue number to the TCP high-water release note.
2019-11-06 16:25:55 +01:00
Michał Kępień
db670fcdc8 Merge branch '1298-do-not-use-sys-sysctl.h-on-linux' into 'master'
Do not use <sys/sysctl.h> on Linux

Closes #1298

See merge request isc-projects/bind9!2525
2019-11-06 14:49:42 +00:00
Michał Kępień
65a8b53bd0 Do not use <sys/sysctl.h> on Linux
glibc 2.30 deprecated the <sys/sysctl.h> header [1].  However, that
header is still used on other Unix-like systems, so only prevent it from
being used on Linux, in order to prevent compiler warnings from being
triggered.

[1] https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html
2019-11-06 15:32:04 +01:00
Michał Kępień
89f874e6ee Merge branch '1206-add-assert_int_equal-shell-function' into 'master'
Add assert_int_equal() shell function

Closes #1206

See merge request isc-projects/bind9!2535
2019-11-06 14:31:02 +00:00
Michał Kępień
8bb7f1f2a1 Add assert_int_equal() shell function
Add a shell function which is used in the "tcp" system test, but has
been accidentally omitted from !2425.  Make sure the function does not
change the value of "ret" itself, so that the caller can decide what to
do with the function's return value.
2019-11-06 15:24:15 +01:00
Ondřej Surý
54b92a04b1 Merge branch '1256-jitter-dynamically-updated-signatures' into 'master'
Resolve "Signature Expiration Jitter not working for dynamic NSEC3 zones"

Closes #1256

See merge request isc-projects/bind9!2451
2019-11-06 14:01:19 +00:00
Ondřej Surý
00569e0dfa Add CHANGES 2019-11-06 13:31:25 +01:00
Matthijs Mekking
540b90fd6c Test jitter distribution
Test jitter distribution in NSEC3 dynamic zone and for a zone that has old
signatures.  In both cases the generated signatures should be spread nicely.
2019-11-06 13:31:25 +01:00
Witold Kręcicki
6b2fd40269 Jitter signatures times when adding dynamic records.
When doing regular signing expiry time is jittered to make sure
that the re-signing times are not clumped together. This expands
this behaviour to expiry times of dynamically added records.

When incrementally re-signing a zone use the full jitter range if
the server appears to have been offline for greater than 5 minutes
otherwise use a small jitter range of 3600 seconds.  This will stop
the signatures becoming more clustered if the server has been off
line for a significant period of time (> 5 minutes).
2019-11-06 13:31:25 +01:00
Ondřej Surý
7c7f5884e5 Merge branch '1206-tcp-high-water-stats-fix-type' into 'master'
Avoid an extra atomic_load call when doing atomic_compare_exchange_loop

See merge request isc-projects/bind9!2531
2019-11-06 11:31:31 +00:00
Ondřej Surý
b4df5a6ecb Avoid an extra atomic_load() call 2019-11-06 11:30:36 +01:00
Ondřej Surý
3361247519 Merge branch '1285-documentation-update-to-sortlist-feature-bugs-42615' into 'master'
arm: Add a sentence about overlaping selectors in sortlist statement

Closes #1285

See merge request isc-projects/bind9!2517
2019-11-06 10:05:27 +00:00
Ondřej Surý
ebc61946b2 arm: Add a sentence about overlaping selectors in sortlist statement 2019-11-06 11:04:20 +01:00
Ondřej Surý
9abcff9ce3 Merge branch '1206-tcp-high-water-stats' into 'master'
Added tcp-high-water statistics variable.

Closes #1206

See merge request isc-projects/bind9!2425
2019-11-06 08:47:19 +00:00
Diego Fronza
ba3fe75e65 Added TCP high-water entry to CHANGES 2019-11-06 09:18:27 +01:00
Diego Fronza
dd492b64d9 Added TCP high-water entry to release notes 2019-11-06 09:18:27 +01:00
Diego Fronza
29be224a04 Added TCP high-water system tests
Note: ans6/ans6.py is a helper script that allows tests.sh to open/close
TCP connections to some BIND instance.
2019-11-06 09:18:27 +01:00
Diego Fronza
66fe8627de Added TCP high-water statistics variable
This variable will report the maximum number of simultaneous tcp clients
that BIND has served while running.

It can be verified by running rndc status, then inspect "tcp high-water:
count", or by generating statistics file, rndc stats, then inspect the
line with "TCP connection high-water" text.

The tcp-highwater variable is atomically updated based on an existing
tcp-quota system handled in ns/client.c.
2019-11-06 09:18:27 +01:00
Diego Fronza
a544e2e300 Add functions for collecting high-water counters
Add {isc,ns}_stats_{update_if_greater,get_counter}() functions that
are used to set and collect high-water type of statistics.
2019-11-06 09:11:20 +01:00
Diego Fronza
eb5611a770 Change the isc_stat_t type to isc__atomic_statcounter_t
The isc_stat_t type was too similar to isc_stats_t type, so the name was
changed to something more distinguishable.
2019-11-06 09:09:45 +01:00
Diego Fronza
0fc98ef2d5 Change the isc_statscounter_t type from int to C99 int_fast64_t type
For TCP high-water work, we need to keep the used integer types widths
in sync.

Note: int_fast32_t is used on WIN32 platform
2019-11-06 08:43:46 +01:00
Mark Andrews
5d4182c945 Merge branch '1301-geoip2-default-data-path' into 'master'
Resolve "geoip2 default data path"

Closes #1301

See merge request isc-projects/bind9!2520
2019-11-05 23:50:12 +00:00
Mark Andrews
7b10faf108 Add CHANGES note 2019-11-06 10:23:33 +11:00
Mark Andrews
51fb42edcb Regenerate configure. 2019-11-06 10:23:29 +11:00
Mark Andrews
2eaa75c380 Have 'named -V' report geoip-directory 2019-11-06 10:20:16 +11:00
Mark Andrews
fcd765a59d The default geoip-directory should be <MAXMINDDB_PREFIX>/share/GeoIP 2019-11-06 10:20:16 +11:00
Mark Andrews
e0fe33506c MAXMINDDB_LIBS should end with '/lib' not '/libs' 2019-11-06 10:20:16 +11:00
Ondřej Surý
ae33c75d06 Merge branch '664-fetches-per-server-quota-docs' into 'master'
Describe the polynomial backoff curve used in the quota adjustment

Closes #664

See merge request isc-projects/bind9!2519
2019-11-05 08:50:01 +00:00
Ondřej Surý
56ef09c3a1 Describe the polynomial backoff curve used in the quota adjustment 2019-11-05 09:48:15 +01:00
Ondřej Surý
5fc8130822 Merge branch '45-integrate-llvm-scan-build-to-gitlab-ci-workflow' into 'master'
Add LLVM/Clang scan-build checks into the GitLab CI

Closes #45

See merge request isc-projects/bind9!2452
2019-11-04 16:00:56 +00:00
Ondřej Surý
e9acad638e libdns: add missing checks for return values in dnstap unit test
Related scan-build report:

dnstap_test.c:169:2: warning: Value stored to 'result' is never read
        result = dns_test_makeview("test", &view);
        ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dnstap_test.c:193:2: warning: Value stored to 'result' is never read
        result = dns_compress_init(&cctx, -1, dt_mctx);
        ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
2019-11-04 16:15:22 +01:00
Ondřej Surý
6decd14592 named: remove named_g_defaultdnstap global variable
The named_g_defaultdnstap was never used as the dnstap requires
explicit configuration of the output file.

Related scan-build report:

./server.c:3476:14: warning: Value stored to 'dpath' during its initialization is never read
        const char *dpath = named_g_defaultdnstap;
                    ^~~~~   ~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
2019-11-04 16:15:22 +01:00
Ondřej Surý
64cf5144a6 libdns: Change check_dnskey_sigs() return type to void to match the reality how the function is used 2019-11-04 16:15:22 +01:00
Ondřej Surý
309dca417c tests: Resolve scan-build false positive by adding extra assertion 2019-11-04 16:15:22 +01:00
Ondřej Surý
6bbb0b8e42 dnssec: don't qsort() empty hashlist 2019-11-04 16:15:22 +01:00
Ondřej Surý
6bf364aec8 named: Add INSIST() after bindkeysfile configuration load to silence scan-build FP 2019-11-04 16:15:22 +01:00
Ondřej Surý
7aa7f8592c tests: Workaround scan-build false positive with FD_ZERO/FD_SET 2019-11-04 16:15:22 +01:00
Ondřej Surý
80b55d25de libdns: Remove useless checks for ISC_R_MEMORY, which cannot happen now 2019-11-04 16:15:22 +01:00
Ondřej Surý
5f584310bc ci: Add LLVM/Clang scan-build checks into the GitLab CI 2019-11-04 16:15:22 +01:00
Ondřej Surý
d2fdebe02e Merge branch 'u/fanf2/rndc-validation-status-noflush' into 'master'
Do not flush the cache for `rndc validation status`

See merge request isc-projects/bind9!2462
2019-10-31 15:19:57 -04:00
Ondřej Surý
9de062ae76 Add CHANGES 2019-10-31 13:32:00 -05:00
Tony Finch
b612e38af1 Do not flush the cache for rndc validation status
And add a note to the man page that `rndc validation` flushes the
cache when the validation state is changed. (It is necessary to flush
the cache when turning on validation, to avoid continuing to use
cryptographically invalid data. It is probably wise to flush the cache
when turning off validation to recover from lameness problems.)
2019-10-31 13:31:41 -05:00
Ondřej Surý
de368cdf1c Merge branch 'u/fanf2/rndc-validation-status-views' into 'master'
Include all views in output of `rndc validation status`

See merge request isc-projects/bind9!2461
2019-10-31 14:29:43 -04:00
Tony Finch
a7bcca50c1 Add CHANGES 2019-10-31 11:28:00 -05:00
Tony Finch
bebeadc8e6 Include all views in output of rndc validation status
The implementation of `rndc validation status` iterates over all the
views to print their validation status. It takes care to print newlines
in between, but it also used put a nul byte at the end of the first view
which truncated the output.

After this change, the nul byte is added at the end so that it prints
the validation status in all views. The `_bind` view is skipped
because its validation status is irrelevant.
2019-10-31 11:28:00 -05:00
Michal Nowak
ebbe199715 Merge branch 'mnowak/1244-extra-quotes-around-TESTSOCK6/master' into 'master'
digdelv: Extra quotes prevent IPv6 runs

See merge request isc-projects/bind9!2390
2019-10-31 12:26:46 -04:00
Michal Nowak
1b6419f8a7 digdelv: Extra quotes prevent IPv6 runs
Portion of the digdelv test are skipped on IPv6 due to extra quotes
around $TESTSOCK6: "I:digdelv:IPv6 unavailable; skipping".

Researched by @michal.

Regressed with 351efd8812.
2019-10-31 16:52:28 +01:00
Ondřej Surý
b7ed939659 Merge branch 'ondrej/update-git-replay-merge' into 'master'
Update the git-replay-merge to use the latest GitLab -o options

See merge request isc-projects/bind9!2503
2019-10-31 10:18:44 -04:00
Ondřej Surý
0d61b73958 Update the git-replay-merge to use the latest GitLab -o options 2019-10-31 09:18:01 -05:00
Ondřej Surý
ecdbc14035 Merge branch '876-documentation-feedback' into 'master'
Minor documentation updates

Closes #876

See merge request isc-projects/bind9!2483
2019-10-31 10:05:49 -04:00
Ondřej Surý
e0618174b6 arm: add more text describing interaction between automatic-interface-scan and interface-interval 2019-10-31 09:04:01 -05:00
Ondřej Surý
f7eea400a8 arm: Fix the default for the lock-file command, it's 'none' 2019-10-31 09:04:01 -05:00
Brian Conry
c6f91f8bd0 arm: Add an explanation on the effect of 'require-server-cookie yes;' 2019-10-31 09:04:01 -05:00
Mark Andrews
c5453ea328 arm: add why when to set 'require-server-cookie yes;' 2019-10-31 09:04:01 -05:00
Mark Andrews
1ea6aadf6f arm: document resolver-nonbackoff-tries and resolver-retry-interval 2019-10-31 09:04:01 -05:00
Mark Andrews
d8abf4f5b6 arm: add default values for require-server-cookie and send-cookie options 2019-10-31 09:04:01 -05:00
Michał Kępień
18dff8e031 Merge branch '1059-prevent-tcp-failures-from-affecting-edns-stats' into 'master'
Prevent TCP failures from affecting EDNS stats

See merge request isc-projects/bind9!2501
2019-10-31 05:36:50 -04:00
Michał Kępień
36d3c66e4e Add CHANGES entry
5310.	[bug]		TCP failures were affecting EDNS statistics. [GL #1059]
2019-10-31 09:54:07 +01:00
Michał Kępień
fce3c93ea2 Prevent TCP failures from affecting EDNS stats
EDNS mechanisms only apply to DNS over UDP.  Thus, errors encountered
while sending DNS queries over TCP must not influence EDNS timeout
statistics.
2019-10-31 09:54:05 +01:00
Michał Kępień
7346e6d3b5 Merge branch '1059-prevent-query-loops-for-misbehaving-servers' into 'master'
Prevent query loops for misbehaving servers

See merge request isc-projects/bind9!2500
2019-10-31 04:45:50 -04:00
Michał Kępień
6cd115994e Prevent query loops for misbehaving servers
If a TCP connection fails while attempting to send a query to a server,
the fetch context will be restarted without marking the target server as
a bad one.  If this happens for a server which:

  - was already marked with the DNS_FETCHOPT_EDNS512 flag,
  - responds to EDNS queries with the UDP payload size set to 512 bytes,
  - does not send response packets larger than 512 bytes,

and the response for the query being sent is larger than 512 byes, then
named will pointlessly alternate between sending UDP queries with EDNS
UDP payload size set to 512 bytes (which are responded to with truncated
answers) and TCP connections until the fetch context retry limit is
reached.  Prevent such query loops by marking the server as bad for a
given fetch context if the advertised EDNS UDP payload size for that
server gets reduced to 512 bytes and it is impossible to reach it using
TCP.
2019-10-31 08:48:35 +01:00
Michał Kępień
9fd89c0587 Merge branch 'michal/placeholder-2476' into 'master'
Add a CHANGES placeholder

See merge request isc-projects/bind9!2502
2019-10-30 11:12:37 -04:00
Michał Kępień
3c29291842 Add a CHANGES placeholder
See [GL !2476].
2019-10-30 16:10:39 +01:00
Mark Andrews
cea2b533fe Merge branch '1288-log-dns_r_unchanged-from-sync_secure_journal-at-info-level-in-receive_secure_serial' into 'master'
Resolve "Log DNS_R_UNCHANGED from sync_secure_journal at info level in receive_secure_serial."

Closes #1288

See merge request isc-projects/bind9!2490
2019-10-29 20:58:44 -04:00
Mark Andrews
e6ef7858c3 add CHANGES 2019-10-30 11:19:34 +11:00
Mark Andrews
8eb09f3232 Log DNS_R_UNCHANGED from sync_secure_journal() at info level in receive_secure_serial() 2019-10-30 11:15:46 +11:00
Mark Andrews
c79077894a Merge branch 'u/fanf2/compilezone-hang' into 'master'
Fix hang in `named-compilezone | head`

See merge request isc-projects/bind9!2481
2019-10-29 19:42:08 -04:00
Tony Finch
548f29a4d9 CHANGES 2019-10-29 10:57:48 -05:00
Tony Finch
a87ccea032 Fix hang in named-compilezone | head
I was truncating zone files for experimental purposes when I found
that `named-compilezone | head` got stuck. The full command line that
exhibited the problem was:

	dig axfr dotat.at |
	named-compilezone -o /dev/stdout dotat.at /dev/stdin |
	head

This requires a large enough zone to exhibit the problem, more than
about 70000 bytes of plain text output from named-compilezone.
I was running the command on Debian Stretch amd64.

This was puzzling since it looked like something was suppressing the
SIGPIPE. I used `strace` to examine what was happening at the hang.
The program was just calling write() a lot to print the zone file, and
the last write() hanged until I sent it a SIGINT.

During some discussion with friends, Ian Jackson guessed that opening
/dev/stdout O_RDRW might be the problem, and after some tests we found
that this does in fact suppress SIGPIPE.

Since `named-compilezone` only needs to write to its output file, the
fix is to omit the stdio "+" update flag.
2019-10-29 10:56:56 -05:00
Ondřej Surý
89ee56e1c0 Merge branch 'placeholder-tcp-highwater' into 'master'
placeholder.

See merge request isc-projects/bind9!2495
2019-10-29 10:34:01 -04:00
Diego Fronza
478831964e placeholder. 2019-10-29 11:19:32 -03:00
Ondřej Surý
d091772279 Merge branch 'ondrej/update-list-of-supported-platforms-for-9.16' into 'master'
Update the list of supported and unsupported PLATFORMS for BIND 9.15

See merge request isc-projects/bind9!2486
2019-10-29 08:28:30 -04:00
Ondřej Surý
cb9553d9e5 Add 'Community Maintained' section to PLATFORMS.md 2019-10-29 06:41:55 -05:00
Ondřej Surý
67166b7ddd Update the list of supported and unsupported PLATFORMS for BIND 9.15 2019-10-29 06:41:55 -05:00
Ondřej Surý
82f07b2c6d Merge branch '1265-disable-synth-from-dnssec-by-default-workaround' into 'master'
Disable synth-from-dnssec by default

See merge request isc-projects/bind9!2491
2019-10-29 05:55:08 -04:00
Ondřej Surý
4a778cfa45 Add CHANGES note 2019-10-29 04:10:12 -05:00
Ondřej Surý
fce5a01a63 Add release notes. 2019-10-29 04:10:12 -05:00
Ondřej Surý
800d7843af Adjust synthfromdnssec system test to the changed defaults 2019-10-29 04:10:12 -05:00
Ondřej Surý
a20c42dca6 Disable NSEC Aggressive Cache (synth-from-dnssec) by default
It was found that NSEC Aggressive Caching has a significant performance impact
on BIND 9 when used as recursor.  This commit disables the synth-from-dnssec
configuration option by default to provide immediate remedy for people running
BIND 9.12+.  The NSEC Aggressive Cache will be enabled again after a proper fix
will be prepared.
2019-10-29 04:10:12 -05:00
Michał Kępień
7abd918d73 Merge branch 'michal/revamp-the-release-checklist' into 'master'
Revamp the release checklist

See merge request isc-projects/bind9!2488
2019-10-29 04:30:12 -04:00
Michał Kępień
a8910de835 Revamp the release checklist
Make the release checklist match the current release process better by
adding missing steps, rearranging existing ones, reassigning
responsibilities, and dividing the list into sections (by due date).
2019-10-29 09:29:05 +01:00
Michał Kępień
35169151d3 Merge branch 'michal/add-centos-8-to-gitlab-ci' into 'master'
Add CentOS 8 to GitLab CI

See merge request isc-projects/bind9!2489
2019-10-29 04:22:34 -04:00
Michał Kępień
dce1c05042 Add CentOS 8 to GitLab CI
Ensure BIND can be tested on CentOS 8 in GitLab CI to more quickly catch
build and test errors on that operating system.
2019-10-25 16:56:32 +02:00
Mark Andrews
765312b655 Merge branch '876-documentation-feedback-2' into 'master'
"dnskey-sig-validity 0;" was not accepted

Closes #876

See merge request isc-projects/bind9!2484
2019-10-24 16:08:28 -04:00
Mark Andrews
918f020f9f add named-checkconf tests for dnskey-sig-validity at range limits 2019-10-24 23:16:21 +11:00
Mark Andrews
20647657f9 accept 0 for dnskey-sig-validity (indicates off) 2019-10-24 23:15:09 +11:00
Mark Andrews
e33f345c4b Merge branch 'marka-placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!2485
2019-10-24 04:19:45 -04:00
Mark Andrews
0706e626e0 placeholder 2019-10-24 19:14:43 +11:00
Ondřej Surý
c77037943d Merge branch '5-update-coding-style' into 'master'
Update the coding style to reflect the year 2019 and C99/C11 standard

Closes #5

See merge request isc-projects/bind9!2148
2019-10-22 06:19:36 -04:00
Ondřej Surý
212e267b05 Update the coding style to reflect the year 2019 and C11 standard 2019-10-22 12:19:14 +02:00
Mark Andrews
5fbab0071a Merge branch '1281-dnstap-per-view-configuration' into 'master'
Resolve "dnstap per view configuration"

Closes #1281

See merge request isc-projects/bind9!2477
2019-10-21 17:20:48 -04:00
Mark Andrews
6ce1e2e731 add CHANGES 2019-10-22 08:03:15 +11:00
Mark Andrews
c2fcc9f16f check for relationship between dnstap and dnstap-output seperately 2019-10-21 11:08:06 +11:00
Mark Andrews
f3d53630c3 add more dnstap/dnstap-output combinations 2019-10-21 11:06:21 +11:00
Tinderbox User
8c573fc3fd Merge branch 'security-master' 2019-10-19 23:30:23 +00:00
Michał Kępień
2bda78425b Merge branch 'michal/address-cppcheck-1.89-warnings' into 'master'
Address cppcheck 1.89 warnings

See merge request isc-projects/bind9!2472
2019-10-17 05:50:06 -04:00
Michał Kępień
db7fd16346 Suppress cppcheck 1.89 false positive
cppcheck 1.89 emits a false positive for lib/dns/spnego_asn1.c:

    lib/dns/spnego_asn1.c:698:9: error: Uninitialized variable: data [uninitvar]
     memset(data, 0, sizeof(*data));
            ^
    lib/dns/spnego.c:1707:47: note: Calling function 'decode_NegTokenResp', 3rd argument '&resp' value is <Uninit>
     ret = decode_NegTokenResp(buf + taglen, len, &resp, NULL);
                                                  ^
    lib/dns/spnego_asn1.c:698:9: note: Uninitialized variable: data
     memset(data, 0, sizeof(*data));
            ^

This message started appearing with cppcheck 1.89 [1], but it will be
gone in the next release [2], so just suppress it for the time being.

[1] af214e8212

[2] 2595b82634
2019-10-16 22:23:41 +02:00
Michał Kępień
abfde3d543 Fix cppcheck 1.89 warnings
cppcheck 1.89 enabled certain value flow analysis mechanisms [1] which
trigger null pointer dereference false positives in lib/dns/rpz.c:

    lib/dns/rpz.c:582:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1419:44: note: Calling function 'adj_trigger_cnt', 4th argument 'NULL' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:582:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:596:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1419:44: note: Calling function 'adj_trigger_cnt', 4th argument 'NULL' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:596:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:610:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1419:44: note: Calling function 'adj_trigger_cnt', 4th argument 'NULL' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:610:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^

It seems that cppcheck no longer treats at least some REQUIRE()
assertion failures as fatal, so add extra assertion macro definitions to
lib/isc/include/isc/util.h that are only used when the CPPCHECK
preprocessor macro is defined; these definitions make cppcheck 1.89
behave as expected.

There is an important requirement for these custom definitions to work:
cppcheck must properly treat abort() as a function which does not
return.  In order for that to happen, the __GNUC__ macro must be set to
a high enough number (because system include directories are used and
system headers compile attributes away if __GNUC__ is not high enough).
__GNUC__ is thus set to the major version number of the GCC compiler
used, which is what that latter does itself during compilation.

[1] aaeec462e6
2019-10-16 22:23:36 +02:00
Michał Kępień
15b8f92a5a Merge branch 'michal/cleanup-with-cc-alg-remnants' into 'master'
Remove remnants of the --with-cc-alg option

See merge request isc-projects/bind9!2436
2019-10-15 16:35:11 -04:00
Michał Kępień
428dcf3b49 Remove remnants of the --with-cc-alg option
Commit afa81ee4e4 omitted some spots in
the source tree which are still referencing the removed --with-cc-alg
"configure" option.  Make sure the latter is removed completely.
2019-10-15 21:57:58 +02:00
Michał Kępień
2007a7d2db Merge branch 'michal/limit-triggers-for-openbsd-system-test-jobs' into 'master'
Limit triggers for OpenBSD system test jobs

See merge request isc-projects/bind9!2468
2019-10-15 15:52:33 -04:00
Michał Kępień
603e04563b Limit triggers for OpenBSD system test jobs
When a GitLab CI runner is not under load, a single OpenBSD system test
job completes in about 12 minutes, which is considered decent.  However,
such jobs are usually multiplexed with other system test jobs on the
same host, which causes each of them to take even 40 minutes to
complete.  Taking retries into account, this is completely unacceptable
for everyday use, so only start OpenBSD system test jobs for pipelines
created through GitLab's web interface and for pipelines created for Git
tags.
2019-10-15 21:47:47 +02:00
Michał Kępień
818d2bed31 Merge branch 'michal/minor-gitlab-ci-tweaks' into 'master'
Minor GitLab CI tweaks

See merge request isc-projects/bind9!2435
2019-10-15 15:45:54 -04:00
Michał Kępień
dd97dfdc14 Tweak dependencies for the Windows build job
Since the Windows build job does not use the files created as a result
of running "autoreconf -fi" in the "autoreconf:sid:amd64" job, set its
dependencies to an empty list.

Since it is currently not possible to use "needs: []" for jobs which do
not belong to the first stage of a pipeline, set the "needs" key for the
Windows build job to the "autoreconf:sid:amd64" job so that all build
jobs are started at the same time (without this change, the Windows
build job does not start until all jobs in the "precheck" stage are
finished).

As a side note, these changes also attempt to eliminate intermittent,
bogus GitLab error messages ("There has been a missing dependency
failure").
2019-10-15 20:49:08 +02:00
Michał Kępień
e83b322f7f Fix artifacts created by the "autoreconf" CI job
The intended purpose of the "autoreconf:sid:amd64" GitLab CI job is to
run "autoreconf -fi" and then pass the updated files on to subsequent
non-Windows build jobs.  However, the artifacts currently created by
that job only include files which are not tracked by Git.  Since we
currently do track e.g. "configure" with Git, the aforementioned job is
essentially a no-op.  Fix by manually specifying the files generated by
the "autoreconf:sid:amd64" job that should be passed on to subsequent
build jobs.
2019-10-15 20:49:08 +02:00
Michał Kępień
175d096e1e Merge branch 'michal/add-openbsd-to-gitlab-ci' into 'master'
Add OpenBSD to GitLab CI

Closes #148

See merge request isc-projects/bind9!2434
2019-10-15 14:44:40 -04:00
Michał Kępień
07d2fcb544 Add OpenBSD to GitLab CI
Ensure BIND can be tested on OpenBSD in GitLab CI to more quickly catch
build and test errors on that operating system.

Some notes:

  - While GCC is packaged for OpenBSD, only old versions (4.2.1, 4.9.4)
    are readily available and none of them is the default system
    compiler, so we are only doing Clang builds in GitLab CI.

  - Unit tests are currently not run on OpenBSD because it ships with an
    old version of kyua which does not handle skipped tests properly.
    These jobs will be added when we move away from using kyua in the
    future as the test code itself works fine.

  - All OpenBSD jobs are run inside QEMU virtual machines, using GitLab
    Runner Custom executor.
2019-10-15 16:38:04 +02:00
Michał Kępień
6b5426e1a7 Work around an OpenBSD "make" quirk
Consider the following Makefile:

    foo:
    	false

On OpenBSD, the following happens for this Makefile:

  - "make foo" returns 1,
  - "make -k foo" returns 0,
  - "make -k -j6 foo" returns 1.

However, if the .NOTPARALLEL pseudo-target is added to this Makefile,
"make -k -j6 foo" will return 0 as well.

Since bin/tests/Makefile contains the .NOTPARALLEL pseudo-target,
running "make -k -j6 test" from bin/tests/ on OpenBSD prevents any
errors from being reported through that command's exit code.

Work around the issue by running "make -k -j6 test" in the
bin/tests/system/ directory instead as bin/tests/system/Makefile does
not contain the .NOTPARALLEL pseudo-target and thus things work as
expected there.
2019-10-15 16:38:04 +02:00
Mark Andrews
69b023e862 Merge branch '1143-a-minor-documentation-issue-consideration-of-parsing-inconsistencies-in-ipv4s-in-address-match-lists-and-in-a-controls-inet-statement' into 'master'
Resolve "A minor documentation issue & consideration of parsing inconsistencies in IPv4s in address match lists and in a controls/inet statement"

Closes #1143

See merge request isc-projects/bind9!2152
2019-10-13 10:27:38 -04:00
Mark Andrews
fb87e669fb Detect partial prefixes / incomplete IPv4 address in acls. 2019-10-14 00:28:07 +11:00
Ondřej Surý
67cb24b9ce Merge branch 'u/fanf2/dsdigest-abbr' into 'master'
cleanup: more consistent abbreviated DS digest type mnemonics

See merge request isc-projects/bind9!2440
2019-10-10 15:58:17 -04:00
Tony Finch
b770ea976d cleanup: more consistent abbreviated DS digest type mnemonics
BIND supports the non-standard DNSKEY algorithm mnemonic ECDSA256
everywhere ECDSAP256SHA256 is allowed, and allows algorithm numbers
interchangeably with mnemonics. This is all done in one place by the
dns_secalg_fromtext() function.

DS digest types were less consistent: the rdata parser does not allow
abbreviations like SHA1, but the dnssec-* command line tools do; and
the command line tools do not alow numeric types though that is the
norm in rdata.

The command line tools now use the dns_dsdigest_fromtext() function
instead of rolling their own variant, and dns_dsdigest_fromtext() now
knows about abbreviated digest type mnemonics.
2019-10-10 12:31:39 -04:00
Ondřej Surý
8c33b12741 Merge branch 'ondrej/1-week-artifact-expiration' into 'master'
Synchronize the lifetime of artifact to 1 week

See merge request isc-projects/bind9!2448
2019-10-10 01:44:33 -04:00
Tinderbox User
e59212e54b Merge branch 'fix-doc' into security-master 2019-10-09 20:46:01 +00:00
Tinderbox User
59a245077d regenerate doc 2019-10-09 20:45:13 +00:00
Ondřej Surý
85c0bede78 Synchronize the lifetime of artifact to 1 week 2019-10-09 21:46:48 +02:00
Ondřej Surý
5309987df7 Merge branch '1119-tsan-lib/dns/view.c-attributes' into 'master'
Convert struct dns_view->attributes to atomic_uint to prevent some locking

See merge request isc-projects/bind9!2368
2019-10-09 02:51:24 -04:00
Ondřej Surý
8b8826f403 Merge branch 'security-master-issue-numbers' into 'security-master'
Fix the GitLab issue numbers in CHANGES and notes.xml

See merge request isc-private/bind9!121
2019-10-09 02:38:48 -04:00
Ondřej Surý
db63c2a700 Convert struct dns_view->attributes to atomic_uint to prevent some locking 2019-10-09 08:09:44 +02:00
Ondřej Surý
4bd5d76beb Fix the GitLab issue numbers in CHANGES and notes.xml 2019-10-09 08:03:07 +02:00
Tinderbox User
38270b7900 regen master 2019-10-06 03:16:14 +00:00
Ondřej Surý
f2eeff0342 Merge branch 'ondrej/cleanup-copyrights' into 'master'
Cleanup the COPYRIGHTS file

See merge request isc-projects/bind9!2377
2019-10-04 02:40:56 -04:00
Ondřej Surý
fc997e571d Remove The OpenSSL Project from COPYRIGHT, the OpenSSL patches were removed 2019-10-04 08:39:20 +02:00
Ondřej Surý
f761a80842 Cleanup the last bits copyrighted to RSA Security and remove them from COPYRIGHT file 2019-10-04 08:39:20 +02:00
Ondřej Surý
52c10b78f1 Remove Doug Rabson and Jake Burkholder from COPYRIGHT, the code was removed 2019-10-04 08:36:45 +02:00
Ondřej Surý
e179d083d4 Remove Aaron D. Gifford from COPYRIGHT, the code was removed 2019-10-04 08:36:45 +02:00
Ondřej Surý
acf1cfe15d Remove Rice University from COPYRIGHT, the code was removed 2019-10-04 08:36:45 +02:00
Ondřej Surý
37b677ca59 Remove Japan Network Information Center from COPYRIGHT, the code was removed 2019-10-04 08:36:45 +02:00
Ondřej Surý
86f4191405 Merge branch 'ondrej/remove-rsa-pkcs11-header-remnants' into 'master'
Remove unused RSA Security copyrighted cryptoki.h header

See merge request isc-projects/bind9!2445
2019-10-04 02:35:58 -04:00
Ondřej Surý
635e5293b2 Remove unused RSA Security copyrighted cryptoki.h header 2019-10-04 08:35:45 +02:00
Evan Hunt
841d1b6ab5 Merge branch '1226-yaml-empty-edns-options' into 'master'
Resolve "dig: EDNS options in requests cause bad YAML output"

Closes #1226

See merge request isc-projects/bind9!2345
2019-10-04 02:16:14 -04:00
Evan Hunt
bba7855e68 CHANGES 2019-10-03 22:52:17 -07:00
Evan Hunt
877b463bcc fix digdelv KEY-TAG test
also incidentally added several missing ret=0 statements,
and removed some duplicates.
2019-10-03 22:52:16 -07:00
Evan Hunt
8e9a58eaa7 TCP KEEPALIVE was missing from yaml output 2019-10-03 22:52:16 -07:00
Evan Hunt
69322c7357 always print a colon after EDNS option names in text output
make the same change as in the previous commit to non-YAML text output,
for better readability and consistency between formats.
2019-10-03 22:52:16 -07:00
Evan Hunt
ed1b328186 always print a colon after EDNS option names in YAML output
previously, if the option was empty, then it was printed without a
colon, which could not be parsed as YAML. adding a colon in all cases
addresses this problem.
2019-10-03 22:52:16 -07:00
Mark Andrews
b22bb64c31 Merge branch 'marka-silence-clang' into 'master'
silence clang warning by using local variable.

See merge request isc-projects/bind9!2419
2019-10-03 21:31:11 -04:00
Mark Andrews
1b27ab8642 silence clang warning by using local variable.
'isc_commandline_index' is a global variable so it can theoretically
change result between if expressions.  Save 'argv[isc_commandline_index]'
to local variable 'arg1' and use 'arg1 == NULL' in if expressions
instead of 'argc < isc_commandline_index + 1'.  This allows clang
to correctly determine what code is reachable.
2019-10-03 15:02:59 -07:00
Ondřej Surý
52f0009be6 Merge branch 'ondrej/cppcheck-suppressions-list' into 'master'
Use util/suppressions.txt for Cppcheck suppressions list

See merge request isc-projects/bind9!2437
2019-10-03 10:10:14 -04:00
Ondřej Surý
4926099490 Use util/suppressions.txt for Cppcheck suppressions list 2019-10-03 15:28:38 +02:00
Ondřej Surý
fb14852ede Merge branch 'ondrej/enable-cppcheck' into 'master'
Add Cppcheck job to the CI

See merge request isc-projects/bind9!2403
2019-10-03 03:32:28 -04:00
Ondřej Surý
a0d3614a60 Remove randomly scattered additional style check suppressions that caused unmatchedSuppression 2019-10-03 09:04:27 +02:00
Ondřej Surý
d1f035bbba lib/ns/query.c: Fix invalid order of DbC checks that could cause dereference before NULL check 2019-10-03 09:04:27 +02:00
Ondřej Surý
033f3eb580 lib/ns/interfacemgr.c: Fix invalid order of DbC checks that could cause dereference before NULL check 2019-10-03 09:04:27 +02:00
Ondřej Surý
b4a42a286f lib/ns/client.c: Fix invalid order of DbC checks that could cause dereference before NULL check 2019-10-03 09:04:27 +02:00
Ondřej Surý
f855f09a55 lib/isccfg/parser.c: Fix invalid order of DbC checks that could cause dereference before NULL check 2019-10-03 09:04:27 +02:00
Ondřej Surý
09232213d7 lib/isccfg/aclconf.c: Suppress nullPointerRedundantCheck false positive 2019-10-03 09:04:27 +02:00
Ondřej Surý
026cf2ff4f lib/isc/unix/socket.c: Suppress preprocessorErrorDirective error from Cppcheck 2019-10-03 09:04:27 +02:00
Ondřej Surý
c662969da1 lib/isc/task.c: Fix invalid order of DbC checks that could cause dereference before NULL check 2019-10-03 09:04:27 +02:00
Ondřej Surý
e8948fd9b4 lib/isc/pkc11.c: Fix possible NULL pointer dereference in push_attribute() 2019-10-03 09:04:27 +02:00
Ondřej Surý
e9f30fc211 lib/isc/buffer.c: Fix invalid order of DbC checks that could cause dereference before NULL check 2019-10-03 09:04:27 +02:00
Ondřej Surý
8f2ad12d0a lib/dns/tsig.c: Suppress Cppcheck false positive error uninitStructMember 2019-10-03 09:04:27 +02:00
Ondřej Surý
14c174d921 lib/dns/tests/rbt_serialize_test.c: Fix dereference before DbC check 2019-10-03 09:04:27 +02:00
Ondřej Surý
269d507ccc Instead of declaring unused va_list, just don't declare it at all 2019-10-03 09:04:27 +02:00
Ondřej Surý
5fc7e98d29 lib/dns/rdatalist.c: Fix dereference before DbC check 2019-10-03 09:04:26 +02:00
Ondřej Surý
66af8713d8 lib/dns/rdata/*/*.c: Silence false positive nullPointerRedundantCheck warning from Cppcheck
Cppcheck gets confused by:

void bar(void *arg) {
    foo *data = arg;
    REQUIRE(source != NULL);
    REQUIRE(data->member != NULL);
}

and for consistency the DbC check needs to be changed to

void bar(void *arg) {
    foo *data = arg;
    REQUIRE(data != NULL);
    REQUIRE(data->member != NULL);
}
2019-10-03 09:04:26 +02:00
Ondřej Surý
e68333aa67 lib/dns/rdata.c: Silence false positive nullPointerRedundantCheck warning from Cppcheck 2019-10-03 09:04:26 +02:00
Ondřej Surý
d508ce4036 lib/dns/rbtdb.c: Add DbC check to safely dereference rbtdb in rbt_datafixer() 2019-10-03 09:04:26 +02:00
Ondřej Surý
8be5c3fcfc lib/dns/rbt.c: Suppress nullPointerRedundantCheck warnings from Cppcheck 2019-10-03 09:04:26 +02:00
Ondřej Surý
0f5860aad3 lib/dns/name.c: Fix dereference before DbC check reported by Cppcheck 2019-10-03 09:04:26 +02:00
Ondřej Surý
cea871464f lib/dns/gssapi_link.c: Fix %d -> %u formatting when printing unsigned integers 2019-10-03 09:04:26 +02:00
Ondřej Surý
d8879af877 Fix passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
From Cppcheck:

Passing NULL after the last typed argument to a variadic function leads to
undefined behaviour.  The C99 standard, in section 7.15.1.1, states that if the
type used by va_arg() is not compatible with the type of the actual next
argument (as promoted according to the default argument promotions), the
behavior is undefined.  The value of the NULL macro is an implementation-defined
null pointer constant (7.17), which can be any integer constant expression with
the value 0, or such an expression casted to (void*) (6.3.2.3). This includes
values like 0, 0L, or even 0LL.In practice on common architectures, this will
cause real crashes if sizeof(int) != sizeof(void*), and NULL is defined to 0 or
any other null pointer constant that promotes to int.  To reproduce you might be
able to use this little code example on 64bit platforms. If the output includes
"ERROR", the sentinel had only 4 out of 8 bytes initialized to zero and was not
detected as the final argument to stop argument processing via
va_arg(). Changing the 0 to (void*)0 or 0L will make the "ERROR" output go away.

void f(char *s, ...) {
    va_list ap;
    va_start(ap,s);
    for (;;) {
        char *p = va_arg(ap,char*);
        printf("%018p, %s\n", p, (long)p & 255 ? p : "");
        if(!p) break;
    }
    va_end(ap);
}

void g() {
    char *s2 = "x";
    char *s3 = "ERROR";

    // changing 0 to 0L for the 7th argument (which is intended to act as
    // sentinel) makes the error go away on x86_64
    f("first", s2, s2, s2, s2, s2, 0, s3, (char*)0);
}

void h() {
    int i;
    volatile unsigned char a[1000];
    for (i = 0; i<sizeof(a); i++)
        a[i] = -1;
}

int main() {
    h();
    g();
    return 0;
}
2019-10-03 09:04:26 +02:00
Ondřej Surý
91cc6b9eb9 lib/dns/ecdb.c: Fix couple of DbC conditions reported by Cppcheck 2019-10-03 09:04:26 +02:00
Ondřej Surý
fa7475b77a Fix the constification of the dns_name_t * result variable for dns_tsig_identity() 2019-10-03 09:04:26 +02:00
Ondřej Surý
43925b2a8b bin/named/zoneconf.c: Reset dns_name_t *tsig on every view iteration 2019-10-03 09:04:26 +02:00
Ondřej Surý
2e304b0b7f Change dns_tsigkey_identity from macro to a function and const argument and result 2019-10-03 09:04:26 +02:00
Ondřej Surý
4d2697b31c Constify dns_name_t *signer argument to dns_acl_allowed() 2019-10-03 09:04:26 +02:00
Ondřej Surý
476277a6e6 bin/named/server.c: Fix couple of DbC conditions reported by Cppcheck 2019-10-03 09:04:26 +02:00
Ondřej Surý
9366ca769f bin/dig/dighost.c: Fix REQUIRE(!= NULL) condition after the variable has been dereferenced 2019-10-03 09:04:26 +02:00
Ondřej Surý
9ab16d10d4 bin/delv/delv.c: Fix invalid logic operation in REQUIRE() condition 2019-10-03 09:04:26 +02:00
Ondřej Surý
f55dc51f42 Add Cppcheck job to the CI
This MR changes the default Debian sid build to wrap make with bear
that creates compilation database and use the compilation database
to run Cppcheck on the source files systematically.

The job is currently set to be allowed to fail as it will take some
time to fix all the Cppcheck detected issues.
2019-10-03 09:04:26 +02:00
Ondřej Surý
5be620bd35 Merge branch '1119-disable-time-consuming-tests-benchmarks-when-tsan-is-enabled' into 'master'
Disable time consuming tests when compiling with Thread Sanitizer

See merge request isc-projects/bind9!2365
2019-10-02 08:49:00 -04:00
Ondřej Surý
2230b9d55d Disable benchmark tests when Thread Sanitizer is enabled 2019-10-02 14:09:33 +02:00
Ondřej Surý
8828a41077 Declare __SANITIZE_THREAD__ in isc/util.h when clang ThreadSanitizer is used 2019-10-02 14:09:33 +02:00
Ondřej Surý
86983405f2 Merge branch '1119-tsan-lib/isc/tests/timer_test.c' into 'master'
Convert all variables accessed between multiple threads to atomic

See merge request isc-projects/bind9!2364
2019-10-02 08:06:13 -04:00
Ondřej Surý
e06a34674a Convert all variables accessed between multiple threads to atomic 2019-10-02 13:41:45 +02:00
Ondřej Surý
3a0a69a9cd Merge branch '1119-tsan-lib/isc/tests/task_test.c' into 'master'
Convert all variables accessed between multiple threads to atomic

See merge request isc-projects/bind9!2363
2019-10-02 07:38:10 -04:00
Ondřej Surý
07879f354c Properly initialize atomic variables 2019-10-02 13:09:33 +02:00
Ondřej Surý
76e954124a lib/isc/tests/task_test.c: Convert all variables accessed between multiple threads to atomic 2019-10-02 13:09:28 +02:00
Ondřej Surý
91e2deede6 Merge branch '1119-tsan-lib/dns/zone.c-flags' into 'master'
Convert the dns_zone_t flags, options and keyopts to stdatomic

See merge request isc-projects/bind9!2359
2019-10-02 07:08:35 -04:00
Ondřej Surý
9b0d4f520e Convert DNS_ZONEKEY_, DNS_ZONEFLG_ and DNS_ZONELOADFLAG_ #defines to enums 2019-10-02 12:41:12 +02:00
Ondřej Surý
679ef8bb95 Fix miscelaneous zone object validity checking errors (missing REQUIRE(), out of order REQUIRE()) 2019-10-02 12:41:12 +02:00
Ondřej Surý
2638337826 Convert the flags, options, and keyopts of dns_zone_t structure to 64-bit stdatomic types
...and use atomic_fetch_or and atomic_fetch_and to set and clear the flags
2019-10-02 12:41:12 +02:00
Ondřej Surý
e1b24a4dfe Merge branch '1119-tsan-dispatch_test.c' into 'master'
lib/dns/tests/dispatch_test.c: Convert global responses variable to atomic to prevent data race

See merge request isc-projects/bind9!2355
2019-10-02 06:39:28 -04:00
Ondřej Surý
55a3217fe7 Convert global variables to atomic to prevent possible data race 2019-10-02 12:09:44 +02:00
Stephen Morris
2aec2e6425 Merge branch 'stephen/update-release-template' into 'master'
Update release checklist template

See merge request isc-projects/bind9!2428
2019-10-02 05:15:26 -04:00
Stephen Morris
27b98a1e78 Update release template
Include a step stating that tags for the published releases must
be created in the public repository.
2019-10-02 09:28:21 +01:00
Tinderbox User
87676a6ac0 Merge branch 'prep-release' into security-master 2019-10-02 06:09:11 +00:00
Tinderbox User
0729d194c9 prep 9.15.5 2019-10-02 06:08:59 +00:00
Evan Hunt
b1e2902228 Merge branch '16-security-mirror-key-check' into security-master 2019-10-01 22:38:16 -07:00
Evan Hunt
03278d6062 CHANGES, release note 2019-10-01 22:37:58 -07:00
Evan Hunt
bc727e5ccc fix mirror zone trust anchor check
- compare key data when checking for a trust anchor match.
- allow for the possibility of multiple trust anchors with the same key ID
  so we don't overlook possible matches.
2019-10-01 22:36:44 -07:00
Evan Hunt
6923a80357 Merge branch 'marka-forward-to-non-recursive' into security-master 2019-10-01 22:13:05 -07:00
Mark Andrews
b7442e4389 add release note entry 2019-10-01 22:09:40 -07:00
Mark Andrews
21553af7cc add CHANGES 2019-10-01 22:09:40 -07:00
Mark Andrews
622bef6aec reset fctx->qmindcname and fctx->qminname after processing a delegation 2019-10-01 22:09:04 -07:00
Mark Andrews
47d285a7d6 check recovery from forwarding to a non-recursive server 2019-10-01 22:09:04 -07:00
Evan Hunt
9c0262f1c9 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!2427
2019-10-02 01:08:05 -04:00
Evan Hunt
0d65990741 placeholder 2019-10-01 22:07:31 -07:00
Evan Hunt
3520d62b07 Merge branch '1191-qmin-fetch-failure' into 'master'
SERVFAIL if a prior qmin fetch has not been canceled when a new one starts

See merge request isc-projects/bind9!2416
2019-10-02 00:13:07 -04:00
Evan Hunt
1d741c5c0f CHANGES 2019-10-01 20:47:45 -07:00
Evan Hunt
488cb4da10 SERVFAIL if a prior qmin fetch has not been canceled when a new one starts 2019-10-01 20:41:53 -07:00
Ondřej Surý
879c0f4cf6 Merge branch 'ondrej/fix-coccinelle-detected-issues' into 'master'
Various little fixes found by coccinelle

See merge request isc-projects/bind9!2325
2019-10-01 11:17:45 -04:00
Ondřej Surý
288f5a4b52 Various little fixes found by coccinelle
The coccinellery repository provides many little semantic patches to fix common
problems in the code.  The number of semantic patches in the coccinellery
repository is high and most of the semantic patches apply only for Linux, so it
doesn't make sense to run them on regular basis as the processing takes a lot of
time.

The list of issue found in BIND 9, by no means complete, includes:

- double assignment to a variable
- `continue` at the end of the loop
- double checks for `NULL`
- useless checks for `NULL` (cannot be `NULL`, because of earlier return)
- using `0` instead of `NULL`
- useless extra condition (`if (foo) return; if (!foo) { ...; }`)
- removing & in front of static functions passed as arguments
2019-10-01 16:48:55 +02:00
Ondřej Surý
c2e8a111f5 Merge branch 'ondrej/fix-gitlab-ci-for-master-branch-v2' into 'master'
Fix the triggering rule for autoreconf job (take 2)

See merge request isc-projects/bind9!2424
2019-10-01 10:43:56 -04:00
Ondřej Surý
afa6d88e21 Fix the triggering rule for autoreconf job (take 2) 2019-10-01 16:42:33 +02:00
Ondřej Surý
7b33f048b0 Merge branch 'ondrej/fix-gitlab-ci-for-master-branch' into 'master'
Fix docs -> autoreconf dependencies in the .gitlab-ci.yml

See merge request isc-projects/bind9!2423
2019-10-01 10:32:27 -04:00
Ondřej Surý
978476934c Fix docs -> autoreconf dependencies in the .gitlab-ci.yml 2019-10-01 16:29:33 +02:00
Ondřej Surý
7b554b0e46 Merge branch 'ondrej/use-%zu-for-sizeof-formatting' into 'master'
lib/dns/ssu_external.c: Use %zu for formatting sizeof() output

See merge request isc-projects/bind9!2415
2019-10-01 10:25:22 -04:00
Ondřej Surý
395741f9ad lib/dns/ssu_external.c: Use %zu for formatting sizeof() output 2019-10-01 16:24:29 +02:00
Mark Andrews
e7f0a252a1 Merge branch 'marka-placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!2422
2019-10-01 09:12:09 -04:00
Mark Andrews
738e4cb0fe placeholder 2019-10-01 22:56:53 +10:00
Mark Andrews
cca33260f2 Merge branch 'marka-remove-unused-variable' into 'master'
remove unused variable

See merge request isc-projects/bind9!2418
2019-09-30 23:11:52 -04:00
Mark Andrews
dfcc9e18cb remove unused variable 2019-10-01 12:47:26 +10:00
Mark Andrews
066e860f8f Merge branch 'marka-missing-runtime-check' into 'master'
missing RUNTIME_CHECK

See merge request isc-projects/bind9!2265
2019-09-30 21:10:28 -04:00
Mark Andrews
346624fe38 add CHANGES 2019-10-01 10:44:06 +10:00
Ondřej Surý
69ecc711ac Move the failure handling block closer to the only place where it could fail 2019-10-01 10:43:26 +10:00
Ondřej Surý
c2dad0dcb2 Replace RUNTIME_CHECK(dns_name_copy(..., NULL)) with dns_name_copynf()
Use the semantic patch from the previous commit to replace all the calls to
dns_name_copy() with NULL as third argument with dns_name_copynf().
2019-10-01 10:43:26 +10:00
Ondřej Surý
ac26ecf540 Add semantic patch to replace RUNTIME_CHECK(dns_name_copy(..., NULL)) with dns_name_copynf 2019-10-01 10:43:26 +10:00
Ondřej Surý
f7aef3738a Split dns_name_copy() into dns_name_copy() and dns_name_copynf()
The dns_name_copy() function followed two different semanitcs that was driven
whether the last argument was or wasn't NULL.  This commit splits the function
in two where now third argument to dns_name_copy() can't be NULL and
dns_name_copynf() doesn't have third argument.
2019-10-01 10:43:26 +10:00
Ondřej Surý
5efa29e03a The final round of adding RUNTIME_CHECK() around dns_name_copy() calls
This commit was done by hand to add the RUNTIME_CHECK() around stray
dns_name_copy() calls with NULL as third argument.  This covers the edge cases
that doesn't make sense to write a semantic patch since the usage pattern was
unique or almost unique.
2019-10-01 10:43:26 +10:00
Ondřej Surý
89b269b0d2 Add RUNTIME_CHECK() around result = dns_name_copy(..., NULL) calls
This second commit uses second semantic patch to replace the calls to
dns_name_copy() with NULL as third argument where the result was stored in a
isc_result_t variable.  As the dns_name_copy(..., NULL) cannot fail gracefully
when the third argument is NULL, it was just a bunch of dead code.

Couple of manual tweaks (removing dead labels and unused variables) were
manually applied on top of the semantic patch.
2019-10-01 10:43:26 +10:00
Ondřej Surý
35bd7e4da0 Add RUNTIME_CHECK() around plain dns_name_copy(..., NULL) calls using spatch
This commit add RUNTIME_CHECK() around all simple dns_name_copy() calls where
the third argument is NULL using the semantic patch from the previous commit.
2019-10-01 10:43:26 +10:00
Ondřej Surý
406eba0c41 Add semantic patches to correctly check dns_name_copy(..., NULL) return code
The dns_name_copy() function cannot fail gracefully when the last argument
(target) is NULL.  Add RUNTIME_CHECK()s around such calls.

The first semantic patch adds RUNTIME_CHECK() around any call that ignores the
return value and is very safe to apply.

The second semantic patch attempts to properly add RUNTIME_CHECK() to places
where the return value from `dns_name_copy()` is recorded into `result`
variable.  The result of this semantic patch needs to be reviewed by hand.

Both patches misses couple places where the code surrounding the
`dns_name_copy(..., NULL)` usage is more complicated and is better suited to be
fixed by a human being that understands the surrounding code.
2019-10-01 10:43:26 +10:00
Ondřej Surý
98886bab43 Merge branch '846-dig-idn-alabel-fallback' into 'master'
Resolve "dig cannot display ACE query if locale is not unicode"

Closes #846

See merge request isc-projects/bind9!1418
2019-09-30 05:49:01 -04:00
Ondřej Surý
dccec984c0 Add CHANGES for GL #846 2019-09-30 11:47:39 +02:00
Ondřej Surý
c42e3583f9 Test of valid A-label in locale that cannot display it only with non-broken idn2
The libidn2 library on Ubuntu Bionic is broken and idn2_to_unicode_8zlz() does't
fail when it should.  This commit ensures that we don't run the system test for
valid A-label in locale that cannot display with the buggy libidn2 as it would
break the tests.
2019-09-30 11:47:39 +02:00
Petr Menšík
21371abd72 Emit warning on IDN output failure
Warning is emitted before any dig headers.
2019-09-30 08:52:13 +02:00
Petr Menšík
ac0cf85f09 Modify idna test to fallback to ACE
Test valid A-label on input would be displayed as A-label on output if
locale does not allow U-label.
2019-09-30 08:52:13 +02:00
Petr Menšík
c8a871e908 Fallback to ASCII on output IDN conversion error
It is possible dig used ACE encoded name in locale, which does not
support converting it to unicode. Instead of fatal error, fallback to
ACE name on output.
2019-09-30 08:52:13 +02:00
Mark Andrews
06b1af798f Merge branch 'marka-correct-list' into 'master'
use correct list

See merge request isc-projects/bind9!2410
2019-09-28 20:50:55 -04:00
Mark Andrews
9cd308ac5e Address cut-and-paste error where list name was not changed in one instance for change 5292. 2019-09-29 10:48:59 +10:00
Michał Kępień
c8925fe4d6 Merge branch '147-add-windows-to-gitlab-ci' into 'master'
Add Windows to GitLab CI

Closes #327 and #147

See merge request isc-projects/bind9!2383
2019-09-27 06:59:49 -04:00
Michał Kępień
646fcb733e Update Windows-specific documentation
Bring the files describing Windows-specific aspects of building and
installing BIND up to date.  Remove the parts which are either outdated
(e.g. 32-bit build instructions), already included elsewhere (e.g. the
list of Windows systems BIND is known to run on), or inconvenient to
keep up to date in the long run (e.g. ARM chapter numbers).
2019-09-26 15:11:15 +02:00
Michał Kępień
ca36405a3d Add Windows to GitLab CI
Ensure BIND can be tested on Windows in GitLab to more quickly catch
build and test errors on that operating system.

Some notes:

  - While build jobs are triggered for all pipelines, system test jobs
    are not - due to the time it takes to run the complete system test
    suite on Windows (about 20 minutes), the latter are only run for
    pipelines created through GitLab's web interface and for pipelines
    created for Git tags.

  - Only the "Release" build configuration is currently used.  Adding
    "Debug" builds is a matter of extending .gitlab-ci.yml, but it was
    not done for the time being due to questionable usefulness of
    performing such builds in GitLab CI.

  - Only a 64-bit build is performed.  Adding support for 32-bit builds
    is not planned to be implemented.

  - Unit tests are still not run on Windows, but adding support for that
    is on the roadmap.

  - All Windows GitLab CI jobs are run inside Windows Server containers,
    using the Custom executor feature of GitLab Runner as Windows Server
    2016 is not supported by GitLab Runner's native Docker on Windows
    executor and Windows Server 2019 is not yet widely available from
    hosting providers.

  - The Windows Docker image used by GitLab CI is not stored in the
    GitLab Container Registry as it is over 27 GB in size and thus
    passing it between GitLab and its runners is impractical.

  - There is no vcvarsall.bat variant written in PowerShell and batch
    scripts are no longer supported by GitLab Runner Custom executor, so
    the environment variables set by vcvarsall.bat are injected back
    into the PowerShell environment by processing the output of "set".

  - Visual Studio parallel builds are a bit different than "make -jX"
    builds as parallelization happens in two tiers: project parallelism
    (controlled by the "/maxCpuCount" msbuild.exe switch) and compiler
    parallelism (controlled by the "/MP" cl.exe switch).  To limit the
    total number of compiler processes spawned concurrently to a value
    similar to the one used for Unix builds, msbuild.exe is allowed to
    build at most 2 projects at once, each of which can spawn up to half
    of BUILD_PARALLEL_JOBS worth of compiler processes.  Using such
    parameters is a fairly arbitrary decision taken to solve the
    trade-off between compilation speed and runner load.

  - Configuring network addresses in Windows Server containers is
    tricky.  Adding 10.53.0.1/24 and similar addresses to the vEthernet
    interface created by Docker never causes ifconfig.bat to fail, but
    in fact only one container can have any given IP address configured
    at any given time (the request to add the same address in another
    container is silently ignored).  Thus, in order to allow multiple
    system test jobs to be run in parallel, the addresses used in system
    tests are configured on the loopback interfaces.  Interestingly
    enough, the addresses set on the loopback interfaces... persist
    between containers.  Fortunately, this is acceptable for the time
    being and only requires ifconfig.bat failures to be ignored (as
    ifconfig.bat will fail if it attempts to configure an already
    existing address on an interface).  We also need to wait for a brief
    moment after calling ifconfig.bat as the addresses the latter
    attempts to configure may not be immediately available after it
    returns (and that causes runall.sh to error out).  Finally, for some
    reason we also need to signal that the DNS servers on each loopback
    interface are to be configured using DHCP or else ifconfig.bat will
    fail to add the requested addresses.

  - Since named.pid files created by named instances used in system
    tests contain Windows PIDs instead of Cygwin PIDs and various
    versions of Cygwin "kill" react differently when passed Windows PIDs
    without the -W switch, all "kill" invocations in GitLab CI need to
    use that switch (otherwise they would print error messages which
    would cause stop.pl to assume the process being killed died
    prematurely).  However, to preserve compatibility with older Cygwin
    versions used in our other Windows test environments, we alter the
    relevant scripts "on the fly" rather than in the Git repository.

  - In the containers used for running system tests, Windows Error
    Reporting is configured to automatically create crash dumps in
    C:\CrashDumps.  This directory is examined after the test suite is
    run to ensure no crashes went under stop.pl's radar.
2019-09-26 15:11:15 +02:00
Michał Kępień
4deb2a48d9 Fix the "statschannel" system test on Windows
The SYSTEMTESTTOP variable is set by bin/tests/system/run.sh.  When
system tests are run on Windows, that variable will contain an absolute
Cygwin path.  In the case of the "statschannel" system test, using the
unmodified SYSTEMTESTTOP variable in tests.sh causes the RNDCCMD
variable to contain an invocation of a native Windows application with
an absolute Cygwin path passed as a parameter, which prevents rndc from
working in that system test.  Until we have a cleaner solution, override
SYSTEMTESTTOP with a relative path to work around the issue and thus fix
the "statschannel" system test on Windows.
2019-09-26 15:11:15 +02:00
Michał Kępień
fed397c04b Fix system test error reporting on Windows
Make sure the CYGWIN environment variable is set whenever system tests
are run on Windows to prevent stop.pl from making incorrect assumptions
about the environment it is running in, which triggers e.g. false
reports about named instances crashing on shutdown when system tests are
run on Windows.  This issue has not been caught earlier because the
CYGWIN environment variable was incidentally being set on a higher level
in our Windows test environments.

Error reporting for parallel system tests on Windows has been broken all
along: since all parallel.mk targets generated by parallel.sh pipe their
output through "tee", the return code from run.sh is lost and thus
running "make -f parallel.mk check" will not yield a non-zero return
code if some system tests fail.  The same applies to runsequential.sh.
Yet, runall.sh on Windows only sets its return code to a non-zero value
if either "make -f parallel.mk check" or runsequential.sh returns a
non-zero return code.  Fix by making runall.sh yield a non-zero return
code when testsummary.sh fails, which is the same approach as the one
used in the "test" target in bin/tests/system/Makefile.
2019-09-26 15:11:15 +02:00
Michał Kępień
0476e8f1ac Make VS solution upgrading unnecessary
Until now, the build process for BIND on Windows involved upgrading the
solution file to the version of Visual Studio used on the build host.
Unfortunately, the executable used for that (devenv.exe) is not part of
Visual Studio Build Tools and thus there is no clean way to make that
executable part of a Windows Server container.

Luckily, the solution upgrade process boils down to just adding XML tags
to Visual Studio project files and modifying certain XML attributes - in
files which we pregenerate anyway using win32utils/Configure.  Thus,
extend win32utils/Configure with three new command line parameters that
enable it to mimic what "devenv.exe bind9.sln /upgrade" does.  This
makes the devenv.exe build step redundant and thus facilitates building
BIND in Windows Server containers.
2019-09-26 15:11:15 +02:00
Michał Kępień
1d5259b0a0 Enable building dnssec-cds.exe
Build configuration for the dnssec-cds Visual Studio project is absent
from the solution file template, which means the solution needs to be
upgraded using "devenv bind9.sln /upgrade" in order for the dnssec-cds
project to be built.  Add the build configuration for dnssec-cds to the
solution file template so that upgrading the solution is not necessary
for building that project.
2019-09-26 15:11:15 +02:00
Michał Kępień
918ebd9830 Drop named-checkzone dependency on libbind9
named-checkzone does not use libbind9.  Update the Visual Studio project
file template for named-checkzone to reflect that, thus preventing
compilation issues during parallel builds.
2019-09-26 15:11:15 +02:00
Michał Kępień
de1859422e Add missing nsupdate dependency on libirs
When commit 8eb88aafee removed liblwres,
it also modified nsupdate to use libirs instead of liblwres, but the
Visual Studio project files were not updated to reflect that change.
Make sure the nsupdate Visual Studio project depends on the libirs
project to prevent compilation issues during parallel builds.
2019-09-26 15:11:15 +02:00
Ondřej Surý
22e487a584 Merge branch 'ondrej/fix-clang-10-error' into 'master'
Silence false positive warning from Clang 10 in random_test.c

See merge request isc-projects/bind9!2404
2019-09-26 09:06:14 -04:00
Ondřej Surý
9ff02c8170 Silence false positive warning from Clang 10 in random_test.c 2019-09-26 14:58:18 +02:00
Michał Kępień
c313c9f33b Merge branch 'michal/prevent-unbuffered-stderr-io-on-windows' into 'master'
Prevent unbuffered stderr I/O on Windows

See merge request isc-projects/bind9!2398
2019-09-26 08:00:51 -04:00
Michał Kępień
c72da3497d Prevent unbuffered stderr I/O on Windows
Make stderr fully buffered on Windows to improve named performance when
it is logging to stderr, which happens e.g. in system tests.  Note that:

  - line buffering (_IOLBF) is unavailable on Windows,

  - fflush() is called anyway after each log message gets written to the
    default stderr logging channels created by libisc.
2019-09-26 13:53:03 +02:00
Ondřej Surý
27cd2c7c23 Merge branch '1246-tsan-add-atomic_fetch_and+or_to_isc/stdatomic.h' into 'master'
Add atomic_fetch_add and atomic_fetch_or convenience macros and unix and win32 shims

Closes #1246

See merge request isc-projects/bind9!2397
2019-09-26 06:59:54 -04:00
Ondřej Surý
5a788adb1c Add ATOMIC_VAR_INIT initializer to mutexatomics.h 2019-09-26 11:37:35 +02:00
Ondřej Surý
728fc0ca25 Add atomic_fetch_add and atomic_fetch_or convenience macros and unix and win32 shims 2019-09-26 11:37:35 +02:00
Ondřej Surý
52064809b4 Fix the wrong function for the atomic_fetch_add_explicit64 shim on non-WIN64 build 2019-09-26 11:36:48 +02:00
Michał Kępień
6b3cf36032 Merge branch 'michal/prevent-cygwin-from-concealing-non-abort-crashes' into 'master'
Prevent Cygwin from concealing non-abort() crashes

See merge request isc-projects/bind9!2387
2019-09-26 04:38:04 -04:00
Michał Kępień
3d4b17806f Prevent Cygwin from concealing non-abort() crashes
BIND system tests are run in a Cygwin environment.  Apparently Cygwin
shell sets the SEM_NOGPFAULTERRORBOX bit in its process error mode which
is then inherited by all spawned child processes.  This bit prevents the
Windows Error Reporting dialog from being displayed, which I assume is
part of an effort to contain memory handling errors triggered by Cygwin
binaries in the Cygwin environment.  Unfortunately, this also prevents
automatic crash dump creation by Windows Error Reporting and Cygwin
itself does not handle memory errors in native Windows processes spawned
from a Cygwin shell.

Fix by clearing the SEM_NOGPFAULTERRORBOX bit inside named if it is
started in a Cygwin environment, thus overriding the Cygwin-set process
error mode in order to enable Windows Error Reporting to handle all
named crashes.
2019-09-26 10:34:01 +02:00
Michał Kępień
5a55e95b05 Merge branch '1245-properly-initialize-libxml2' into 'master'
Properly initialize libxml2

Closes #1245

See merge request isc-projects/bind9!2391
2019-09-26 04:31:48 -04:00
Michał Kępień
b5bcd4b8d6 Add CHANGES entry
5293.	[bug]		On Windows, named crashed upon any attempt to fetch XML
			statistics from it. [GL #1245]
2019-09-26 10:20:26 +02:00
Michał Kępień
a3c0b00ef6 Properly initialize libxml2
When libxml2 is to be used in a multi-threaded application, the
xmlInitThreads() function must be called before any other libxml2
function.  This function does different things on various platforms and
thus one can get away without calling it on Unix systems, but not on
Windows, where it initializes critical section objects used for
synchronizing access to data structures shared between threads.  Add the
missing xmlInitThreads() call to prevent crashes on affected systems.

Also add a matching xmlCleanupThreads() call to properly release the
resources set up by xmlInitThreads().
2019-09-26 10:20:26 +02:00
Mark Andrews
7102250d15 Merge branch 'marka-resolver-fix' into 'master'
use test specific shell variables

See merge request isc-projects/bind9!2382
2019-09-26 03:54:29 -04:00
Mark Andrews
4a5400c1b7 use test specific shell variables 2019-09-26 03:30:43 -04:00
Ondřej Surý
83a2db79fb Merge branch '1119-tsan-lib/dns/rbt.c' into 'master'
Prevent TSAN being trigged when DNS_RBTFIND_EMPTYDATA is set

See merge request isc-projects/bind9!2369
2019-09-25 14:30:26 -04:00
Mark Andrews
7f30540727 prevent TSAN being trigged when DNS_RBTFIND_EMPTYDATA is set 2019-09-25 14:05:12 -04:00
Ondřej Surý
9b5969eab0 Merge branch '1119-tsan-bin/rndc/rndc.c' into 'master'
Protect globally accessed variables in rndc.c by making them atomic

See merge request isc-projects/bind9!2370
2019-09-25 08:05:10 -04:00
Ondřej Surý
0aa8c078e4 Protect globally accessed variables in rndc.c by making them atomic 2019-09-25 13:39:04 +02:00
Ondřej Surý
16fbd0f204 Merge branch '1119-tsan-lib/dns/rbtdb.c' into 'master'
Fix unprotected access to rbtnode in lib/dns/rbtdb.c:add32()

See merge request isc-projects/bind9!2371
2019-09-25 07:10:22 -04:00
Ondřej Surý
e307273307 Fix unprotected access to rbtnode in lib/dns/rbtdb.c:add32() 2019-09-25 12:29:13 +02:00
Ondřej Surý
6a39627355 Merge branch '1119-tsan-lib/isc/unix/socket.c' into 'master'
lib/isc/unix/socket.c: Convert couple isc__socket_t members to atomic to prevent data race

See merge request isc-projects/bind9!2356
2019-09-24 15:32:38 -04:00
Ondřej Surý
718a317dc7 Fix unprotected access to thread->epoll_events[fd] in unwatch_fd() 2019-09-24 08:11:50 -04:00
Ondřej Surý
9808d7360e Move the lock from internal_{accept,connect,recv,send} to global level to protect more socket variables 2019-09-24 08:11:50 -04:00
Ondřej Surý
43f3b3211f Convert couple isc__socket_t members to atomic to prevent data race (from TSAN) 2019-09-24 08:11:50 -04:00
Mark Andrews
8f2dd1ac71 Merge branch '1205-named-crashes-when-setting-nsec3param' into 'master'
Resolve "named crashes when setting nsec3param"

Closes #1205

See merge request isc-projects/bind9!2300
2019-09-23 21:21:15 -04:00
Mark Andrews
31c8f66f25 add CHANGES 2019-09-24 10:48:59 +10:00
Mark Andrews
456888c00f Queue nsec3param setting until receive_secure_serial has completed. 2019-09-24 10:45:49 +10:00
Mark Andrews
4e686f40e0 Move dns_zone_setdb() to after the db is created.
Addresses the database changing w/o the changes being done under task lock.
Fix: build the database before assigning it to the zone.
2019-09-24 10:45:24 +10:00
Michał Kępień
6aec894c4c Merge branch 'michal/run-freebsd-jobs-automatically-for-all-pipelines' into 'master'
Run FreeBSD jobs automatically for all pipelines

See merge request isc-projects/bind9!2350
2019-09-17 14:26:12 -04:00
Michał Kępień
f7bc95409d Run FreeBSD jobs automatically for all pipelines
No problems have been observed on the FreeBSD GitLab CI runner during
the burn-in period, when FreeBSD jobs needed to be triggered manually.
Thus, make the FreeBSD jobs run automatically along other GitLab CI
jobs.
2019-09-17 20:24:12 +02:00
Michal Nowak
90835966dc Merge branch 'mnowak/Red_Hat_find_docbook-xsl' into 'master'
Find docbook-xsl and dblatex templates on Red Hat/Fedora

See merge request isc-projects/bind9!2324
2019-09-17 10:45:42 -04:00
Michal Nowak
c871dda0aa Remove unused configure checks for dblatex 2019-09-17 16:42:16 +02:00
Michal Nowak
0055b9616e Find docbook-xsl and dblatex templates on Red Hat/Fedora
`/usr/share/sgml/docbook/xsl-stylesheets` and `/usr/share/dblatex` are
places where docbook-style-xsl and, respectively, dblatex packages on
Red Hat systems put their XSL templates. Unless we hint this place it
has to be added to `./configure` manually (`--with-docbook-xsl=...`):
https://src.fedoraproject.org/rpms/bind/blob/master/f/bind.spec#_691.

On Fedora 30:

Before
```
./configure
...
checking for Docbook-XSL path... auto
checking for html/docbook.xsl... "not found"
checking for xhtml/docbook.xsl... "not found"
checking for manpages/docbook.xsl... "not found"
checking for html/chunk.xsl... "not found"
checking for xhtml/chunk.xsl... "not found"
checking for html/chunktoc.xsl... "not found"
checking for xhtml/chunktoc.xsl... "not found"
checking for html/maketoc.xsl... "not found"
checking for xhtml/maketoc.xsl... "not found"
checking for xsl/docbook.xsl... "not found"
checking for xsl/latex_book_fast.xsl... "not found"
```

After:
```
./configure
...
checking for Docbook-XSL path... auto
checking for html/docbook.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl
checking for xhtml/docbook.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl
checking for manpages/docbook.xsl... /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl
checking for html/chunk.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl
checking for xhtml/chunk.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/chunk.xsl
checking for html/chunktoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/chunktoc.xsl
checking for xhtml/chunktoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/chunktoc.xsl
checking for html/maketoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/maketoc.xsl
checking for xhtml/maketoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/maketoc.xsl
checking for xsl/docbook.xsl... /usr/share/dblatex/xsl/docbook.xsl
checking for xsl/latex_book_fast.xsl... /usr/share/dblatex/xsl/latex_book_fast.xsl
```
2019-09-17 16:42:15 +02:00
Ondřej Surý
12142cbeb6 Merge branch 'ondrej/improve-flycheck-configuration' into 'master'
Remove the current directory from the flycheck configuration

See merge request isc-projects/bind9!2347
2019-09-17 07:30:59 -04:00
Ondřej Surý
265039effc Remove the current directory from the flycheck configuration 2019-09-17 13:05:10 +02:00
Ondřej Surý
c3d684cf9e Merge branch '414-use-p11-kit-headers' into 'master'
Resolve "Legal issue with pkcs11 headers"

Closes #414

See merge request isc-projects/bind9!2251
2019-09-16 09:22:33 -04:00
Ondřej Surý
f6922d6e78 Use standard PKCS#11 standard error codes instead of custom error codes
* CKR_CRYPTOKI_ALREADY_INITIALIZED: This value can only be returned by
  `C_Initialize`. It means that the Cryptoki library has already been
  initialized (by a previous call to `C_Initialize` which did not have a
  matching `C_Finalize` call).

* CKR_FUNCTION_NOT_SUPPORTED: The requested function is not supported by this
  Cryptoki library. Even unsupported functions in the Cryptoki API should have a
  “stub” in the library; this stub should simply return the value
  CKR_FUNCTION_NOT_SUPPORTED.

* CKR_LIBRARY_LOAD_FAILED: The Cryptoki library could not load a dependent
  shared library.
2019-09-16 04:47:50 -04:00
Ondřej Surý
c47fad2431 Replace the OASIS PKCS#11 header file with one from p11-kit
The OASIS pkcs11.h header has a restrictive license.  Replace the
pkcs11.h pkcs11f.h and pkcs11t.h headers with pkcs11.h from p11-kit.

For source distribution, the license for the OASIS headers itself
doesn't pose any licensing problem when combined with MPL license, but
it possibly creates problem for downstream distributors of BIND 9.
2019-09-16 04:47:50 -04:00
Ondřej Surý
3699545dac Merge branch 'ondrej/check-for-return-values-in-mutexatomics.h' into 'master'
Check isc_mutex_{lock,unlock}() return values in mutexatomic.h shim

See merge request isc-projects/bind9!2343
2019-09-13 04:55:55 -04:00
Ondřej Surý
aea3631fd5 Check isc_mutex_{lock,unlock}() return values in mutexatomic.h shim 2019-09-13 10:55:14 +02:00
Mark Andrews
7300866778 Merge branch '1184-invalid-reference-counting' into 'master'
Resolve "Invalid reference counting"

Closes #1184

See merge request isc-projects/bind9!2266
2019-09-12 23:40:11 -04:00
Mark Andrews
9edcaa0832 Convert cache->live_tasks to reference counter. 2019-09-13 12:45:06 +10:00
Ondřej Surý
ed494fe29d Unify how we use isc_refcount_decrement() to destroy object
The isc_refcount_decrement() was either used as:

    if (isc_refcount_decrement() == 1) { destroy(); }

or

    if (isc_refcount_decrement() != 1) { return; } destroy();

This commits eradicates the last usage of the later, so the code is unified to
use the former.
2019-09-13 12:44:49 +10:00
Mark Andrews
c3bcb4d47a Remove potential use after free (fctx) in rctx_resend. 2019-09-13 12:44:12 +10:00
Mark Andrews
b125b7031c Use reference counts instead of ISC_LIST_EMPTY to determine when to destroy ecdb. 2019-09-13 12:43:52 +10:00
Michal Nowak
6ba5a08c8a Merge branch 'mnowak_README_fixes' into 'master'
Various README.md and README fixes

See merge request isc-projects/bind9!2323
2019-09-12 12:15:41 -04:00
Michal Nowak
4e2fdd7ee9 Various README.md and README fixes
Fixing typos, typographical glitches. Added backticks around binaries,
modules, and libraries so it's more consistent. Added a paragraph with
ISC Security Policy.
2019-09-12 16:11:01 +02:00
Michał Kępień
7a3896ef1a Merge branch 'michal/add-freebsd-to-ci' into 'master'
Add FreeBSD to CI

See merge request isc-projects/bind9!2242
2019-09-12 08:58:24 -04:00
Michał Kępień
51af91d007 Add FreeBSD to GitLab CI
Ensure BIND can be tested on FreeBSD in GitLab to more quickly catch
build and test errors on that operating system.  Make the relevant jobs
optional until the CI environment supporting them is deemed stable
enough for continuous use.

FreeBSD jobs are run using the Custom executor feature of GitLab Runner.
Unlike the Docker executor, the Custom executor does not support the
"image" option and thus some way of informing the runner about the OS
version to use for a given job is necessary.  Arguably the simplest way
of doing that without a lot of code duplication in .gitlab-ci.yml would
be to use a YAML template with a "variables" block specifying the
desired FreeBSD release to use, but including such a template in a job
definition would cause issues in case other variables also needed to be
set for that job (e.g. CFLAGS or EXTRA_CONFIGURE for build jobs).  Thus,
only one FreeBSD YAML template is defined instead and the Custom
executor scripts on FreeBSD runners extract the OS version to use from
the CI job name.  This allows .gitlab-ci.yml variables to be defined for
FreeBSD jobs in the same way as for Docker-based jobs.
2019-09-12 14:25:57 +02:00
Michał Kępień
154f2ca6f6 Tweak lib/dns/tests/tkey_test requirements
Currently, the lib/dns/tests/tkey_test unit test is only run when the
linker supports the --wrap option.  However, linker support for that
option is only needed for static builds.  As a result, the unit test
mentioned before is not being run everywhere it can be run as even for
builds done using --with-libtool, the test is not run unless the linker
supports the --wrap option.

Tweak preprocessor directives in lib/dns/tests/tkey_test.c so that this
test is run:

  - for all builds using --with-libtool,
  - for static builds done using a linker supporting the --wrap option.
2019-09-12 14:25:57 +02:00
Michał Kępień
119f3e0c2e Make lib/dns/tests/tkey_test.c more portable
Weak symbols are handled differently by different dynamic linkers.  With
glibc, lib/dns/tests/tkey_test works as expected no matter whether
--with-libtool is used or not: __attribute__((weak)) prevents a static
build from failing and it just so happens that the desired symbols are
picked at runtime for dynamic builds.  However, with BSD libc, the
libdns functions called from lib/dns/tests/tkey_test.c use the "real"
memory allocation functions from libisc, thus breaking that unit test.
(Note: similar behavior can be reproduced with glibc by setting the
LD_DYNAMIC_WEAK environment variable.)

The simplest way to make lib/dns/tests/tkey_test work reliably is to
drop all uses of __attribute__((weak)) in it - this way, the memory
functions inside lib/dns/tests/tkey_test.c will always be used instead
of the "real" libisc ones for dynamic builds.  However, this would not
work with static builds as it would result in multiple strong symbols
with the same name being present in a single binary.

Work around the problem by only compiling in the overriding definitions
of memory functions when building using --with-libtool.  For static
builds, keep relying on the --wrap linker option for replacing calls to
the functions we are interested in.
2019-09-12 14:25:57 +02:00
Michał Kępień
1bffa602ba Set --logfile for all kyua invocations
When kyua is called without the --logfile command line option, the log
file is created at a default location which is derived from the HOME
environment variable.  On FreeBSD GitLab CI runners, /home is a
read-only directory and thus kyua invocations not using the --logfile
option fail when HOME is set to something beneath /home.  Set --logfile
to /dev/null for all kyua invocations whose logs are irrelevant in order
to prevent kyua failures caused by HOME being non-writable.
2019-09-12 14:25:57 +02:00
Michał Kępień
87018ce225 Merge branch 'michal/misc-doc-fixes' into 'master'
Miscellaneous documentation fixes

See merge request isc-projects/bind9!2329
2019-09-12 08:01:31 -04:00
Michał Kępień
995d6b7417 Fix latest BIND version number in CHANGES
BIND version number in CHANGES was not updated when the 9.15.4 release
was prepared.  Make sure the correct version number is used.
2019-09-12 13:57:24 +02:00
Michał Kępień
b0ee065e65 Fix <command> XML tag
Restore proper spelling of the <command> XML tag to prevent release note
text from getting mangled.
2019-09-12 13:57:24 +02:00
Michał Kępień
5af0b1d1d3 README: do not mention /usr/include on macOS
For newer versions of Xcode, "xcode-select --install" no longer installs
system headers into /usr/include (instead, they are installed in the
Xcode directory tree), so do not mention that path in the macOS section
of README to prevent confusion.
2019-09-12 13:57:24 +02:00
Mark Andrews
0023060dc0 Merge branch 'marka-split-notes-master' into 'master'
split notes.xml into sections

See merge request isc-projects/bind9!2326
2019-09-12 05:53:41 -04:00
Mark Andrews
0d51dec350 split notes.xml into sections 2019-09-12 05:53:09 -04:00
Mark Andrews
44fa4d20dd Merge branch '1043-cppcheck-detected-code-issues' into 'master'
Resolve "cppcheck-detected code issues"

Closes #1043

See merge request isc-projects/bind9!2239
2019-09-12 04:29:02 -04:00
Mark Andrews
b59fe46e76 address or suppress cppcheck warnings 2019-09-12 17:59:28 +10:00
Ondřej Surý
30b6e93a70 Merge branch 'ondrej/refactor-and-cleanup-isc_mem_create' into 'master'
Refactor and cleanup isc_mem_create()

See merge request isc-projects/bind9!2315
2019-09-12 03:50:22 -04:00
Ondřej Surý
aeea5ece97 Remove now useless ISC_MEMFLAG_NOLOCK memflag
Previously the libisc allocator had ability to run unlocked when threading was
disabled.  As the threading is now always on, remove the ISC_MEMFLAG_NOLOCK
memory flag as it serves no purpose.
2019-09-12 09:26:09 +02:00
Ondřej Surý
19fbdef31e Remove unused isc_mem_createx() function
The isc_mem_createx() function was only used in the tests to eliminate using the
default flags (which as of writing this commit message was ISC_MEMFLAG_INTERNAL
and ISC_MEMFLAG_FILL).  This commit removes the isc_mem_createx() function from
the public API.
2019-09-12 09:26:09 +02:00
Ondřej Surý
4957255d13 Use the semantic patch to change the usage isc_mem_create() to new API 2019-09-12 09:26:09 +02:00
Ondřej Surý
6bd2eb06cb Add a semantic patch to make refactor the isc_mem_create() 2019-09-12 09:26:09 +02:00
Ondřej Surý
1b716a39f5 Simplify isc_mem_create() to always use defaults and never fail
Previously, the isc_mem_create() and isc_mem_createx() functions took `max_size`
and `target_size` as first two arguments.  Those values were never used in the
BIND 9 code.  The refactoring removes those arguments and let BIND 9 always use
the default values.

Previously, the isc_mem_create() and isc_mem_createx() functions could have
failed because of failed memory allocation.  As this was no longer true and the
functions have always returned ISC_R_SUCCESS, the have been refactored to return
void.
2019-09-12 09:26:09 +02:00
Tinderbox User
3be71081bf Merge branch 'prep-release' 2019-09-09 14:52:45 +00:00
Tinderbox User
badb8a474e prep for 9.15.4 2019-09-09 13:13:39 +00:00
Tinderbox User
1e896fbec6 prep for 9.15.4 2019-09-09 13:02:15 +00:00
Tinderbox User
efdb4f0856 prep for 9.15.4 2019-09-09 12:52:35 +00:00
Tinderbox User
3a1dbc13c9 prep for 9.15.4 2019-09-09 12:34:47 +00:00
Mark Andrews
7dcee3d44b Merge branch 'marka-placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!2322
2019-09-09 02:50:07 -04:00
Mark Andrews
1d133457d6 placeholder 2019-09-09 16:41:40 +10:00
Mark Andrews
dc7f168a82 Merge branch 'marka-fix-insist' into 'master'
Address "Value stored to 'dscpcount' is never read"

See merge request isc-projects/bind9!2317
2019-09-06 02:42:19 -04:00
Mark Andrews
dbdd19853e also insist that keycount == dscpcount 2019-09-06 16:30:24 +10:00
Mark Andrews
b36c7a99ab Merge branch 'marka-add-missing-check' into 'master'
Address "Value stored to 'result' is never read" mdig.c

See merge request isc-projects/bind9!2318
2019-09-06 02:24:55 -04:00
Mark Andrews
b32feaf623 check the result from dns_message_headertotext 2019-09-06 16:12:47 +10:00
Mark Andrews
db085caf7f Merge branch '1203-bug-in-new-yaml-output-when-truncation-is-retried' into 'master'
Resolve "Bug in new +yaml output when truncation is retried"

Closes #1203

See merge request isc-projects/bind9!2288
2019-09-06 02:04:22 -04:00
Mark Andrews
4906fe975c Don't print ';;' comments in yaml mode. 2019-09-06 14:14:20 +10:00
Mark Andrews
2e18e83131 Merge branch '1212-edns-udp-size-docs-not-updated-for-flag-day-changes' into 'master'
Resolve "edns-udp-size docs not updated for Flag Day changes"

Closes #1212

See merge request isc-projects/bind9!2312
2019-09-05 19:35:09 -04:00
Mark Andrews
aca78add3a remove discussion about falling back to plain DNS on timeout 2019-09-05 19:13:36 -04:00
Mark Andrews
160236a780 Merge branch 'marka-win32-vsconf' into 'master'
allow VSCONF to be overridden at runtime

See merge request isc-projects/bind9!2314
2019-09-05 00:34:40 -04:00
Mark Andrews
2433e3e808 allow VSCONF to be overridden at runtime 2019-09-05 14:31:04 +10:00
Mark Andrews
dae7ffc802 Merge branch 'marka-placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!2311
2019-09-04 19:19:49 -04:00
Mark Andrews
142a96acfb placeholder 2019-09-05 09:12:53 +10:00
Mark Andrews
fac49b7ba9 Merge branch '1210-address-potential-null-pointer-dereference-in-rpz-c' into 'master'
Resolve "Address potential NULL pointer dereference in rpz.c"

Closes #1210

See merge request isc-projects/bind9!2308
2019-09-04 17:07:13 -04:00
Mark Andrews
924f9b9e1d add CHANGES 2019-09-05 06:47:56 +10:00
Mark Andrews
3e82a2ea9a use rpzs->updater as rpz->rpzs is NULL 2019-09-05 06:47:26 +10:00
Mark Andrews
6639288d9c Merge branch '1209-dns_r_mustbesecure-failures' into 'master'
Resolve "DNS_R_MUSTBESECURE failures"

Closes #1209

See merge request isc-projects/bind9!2307
2019-09-04 16:39:04 -04:00
Mark Andrews
9528bac556 add CHANGES 2019-09-04 21:30:46 +10:00
Mark Andrews
06d9e93a57 address DNS_R_MUSTBESECURE failures 2019-09-04 21:28:34 +10:00
Mark Andrews
353d0cd8f0 Merge branch 'marka-placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!2304
2019-09-04 01:13:30 -04:00
Mark Andrews
4ef24818b2 placeholder 2019-09-04 15:12:26 +10:00
Mark Andrews
769664a13f Merge branch '1207-bind-potential-for-null-pointer-de-references-plus-memory-leaks-cwe-476-in-file-dlz_mysqldyn_mod-c' into 'master'
Resolve "BIND | Potential for NULL pointer de-references plus memory leaks (CWE-476) in file 'dlz_mysqldyn_mod.c'"

Closes #1207

See merge request isc-projects/bind9!2299
2019-09-04 00:31:39 -04:00
Mark Andrews
8b65ac9128 add CHANGES 2019-09-04 11:31:28 +10:00
Mark Andrews
2de94dd4c4 address NULL pointer dereferences 2019-09-04 11:27:16 +10:00
Mark Andrews
a48a612d25 Merge branch '837-win32-legacy-system-test-failure' into 'master'
Resolve "win32 legacy system test failure"

Closes #837

See merge request isc-projects/bind9!2252
2019-09-03 20:43:27 -04:00
Mark Andrews
f0fd713f17 add CHANGES 2019-09-04 10:09:54 +10:00
Mark Andrews
2390d16955 silence dos2unix messages 2019-09-04 10:04:14 +10:00
Mark Andrews
2f558854b7 implement maxudp under windows 2019-09-04 10:04:14 +10:00
Diego dos Santos Fronza
ac50b0180b Merge branch '106-print-unexpected-reply-messages' into 'master'
Added +unexpected option so dig will print replies from unexpected sources.

Closes #106

See merge request isc-projects/bind9!2199
2019-09-03 12:45:27 -04:00
Diego dos Santos Fronza
bc53d68ae6 Added documentation for dig's +unexpected command line option. 2019-09-03 10:15:25 -03:00
Evan Hunt
3ef91562f1 add a toy name server that replies from the wrong address 2019-09-03 10:14:15 -03:00
Diego dos Santos Fronza
460d4d63ee Added +unexpected option so dig will print replies from unexpected
sources.
2019-09-03 10:14:15 -03:00
Ondřej Surý
582ba39bb6 Merge branch '1196-misaligned-address-in-siphash-c-fix' into 'master'
lib/isc/siphash.c: Get rid of duplicate block caused by bad rebase

Closes #1196

See merge request isc-projects/bind9!2295
2019-09-03 08:52:13 -04:00
Ondřej Surý
32eee57875 lib/isc/siphash.c: Get rid of duplicate block caused by bad rebase 2019-09-03 14:20:53 +02:00
Ondřej Surý
0d795ed907 Merge branch '1196-misaligned-address-in-siphash-c' into 'master'
Resolve "Misaligned address in siphash.c"

Closes #1196

See merge request isc-projects/bind9!2279
2019-09-03 05:00:29 -04:00
Ondřej Surý
30b716d220 Add OpenSSL based isc_siphash24() implementation
This commits adds an OpenSSL based isc_siphash24() implementation, which is
preferred when available.

The siphash_test has been modified to test both implementation with a trick that
renames the isc_siphash24() to openssl_ or native_ prefixed name and includes
the ../siphash.c two times (when the OpenSSL implementation is available).
2019-09-03 09:19:55 +02:00
Ondřej Surý
9b6c6f57d8 configure.ac: Add OpenSSL SipHash support detection
Add check for creating new EVP_PKEY with EVP_PKEY_SIPHASH, but disable SipHash
on OpenSSL 1.1.1 as the hash length initialization is broken before OpenSSL
1.1.1a release.
2019-09-03 09:19:55 +02:00
Ondřej Surý
6fd3259560 Fix alignment issues in the native implementation of isc_siphash24()
The native implementation's conversion from the uint8_t buffers to uint64_t now
follows the reference implementation that doesn't require aligned buffers.
2019-09-02 13:21:07 +02:00
Evan Hunt
2367d61016 Merge branch '1146-rpz-expiry' into 'master'
remove policies from RPZ summary database when policy zones expire

Closes #1146

See merge request isc-projects/bind9!2285
2019-08-30 15:08:30 -04:00
Evan Hunt
38523ac4a8 CHANGES, release note 2019-08-30 11:47:38 -07:00
Evan Hunt
7ba6d592ec when a response-policy zone expires, unload its polices from RPZ summary 2019-08-30 11:47:38 -07:00
Matthijs Mekking
ccee7907e4 Merge branch 'matthijs-fix-checkconf-n' into 'master'
Add missing n increments in checkconf test

See merge request isc-projects/bind9!2289
2019-08-30 06:56:33 -04:00
Matthijs Mekking
d0dc720d7d Add missing n increments in checkconf test 2019-08-30 12:27:24 +02:00
Ondřej Surý
c76ac546de Merge branch 'ondrej/cleanup-isc_event_allocate-failure-mode' into 'master'
Cleanup isc_event_allocate() failure mode handling

See merge request isc-projects/bind9!2277
2019-08-30 03:57:50 -04:00
Ondřej Surý
50e109d659 isc_event_allocate() cannot fail, remove the fail handling blocks
isc_event_allocate() calls isc_mem_get() to allocate the event structure.  As
isc_mem_get() cannot fail softly (e.g. it never returns NULL), the
isc_event_allocate() cannot return NULL, hence we remove the (ret == NULL)
handling blocks using the semantic patch from the previous commit.
2019-08-30 08:55:34 +02:00
Ondřej Surý
2d12def6ee isc_event_allocate() can't fail now, add spatch to remove the checks 2019-08-30 01:04:28 -04:00
Evan Hunt
767de9fe30 Merge branch '1146-rpz-search' into 'master'
use an rbtnodechain for wildcard matching in RPZ summary db

See merge request isc-projects/bind9!2276
2019-08-29 22:54:12 -04:00
Evan Hunt
22349d919c CHANGES 2019-08-29 19:37:21 -07:00
Evan Hunt
6e9be9a952 use an rbtnodechain to walk up labels
when looking for a possible wildcard match in the RPZ summary database,
use an rbtnodechain to walk up label by label, rather than using the
node's parent pointer.
2019-08-29 19:37:21 -07:00
Mark Andrews
305c7f2847 Merge branch '1189-don-t-escape-commas-when-reporting-named-s-command-line' into 'master'
Resolve "Don't escape commas when reporting named's command line."

Closes #1189

See merge request isc-projects/bind9!2253
2019-08-29 20:36:04 -04:00
Mark Andrews
ecba23bc24 add CHANGES 2019-08-29 20:16:33 -04:00
Mark Andrews
70dd93bf8a don't escape commas when saving named's command line 2019-08-29 20:16:33 -04:00
Ondřej Surý
3b8a52264c Merge branch 'ondrej/vicky/add-coc' into 'master'
Add Code of Conduct

See merge request isc-projects/bind9!2219
2019-08-29 15:04:44 -04:00
Ondřej Surý
db00eb2fa9 Add Code of Conduct adapted from Django Code of Conduct 2019-08-29 21:01:29 +02:00
Evan Hunt
8b5aa19ed9 Merge branch 'each-simplify-rbtnodechain' into 'master'
simplify dns_rbtnodechain_init() by removing unnecessary 'mctx' parameter

See merge request isc-projects/bind9!2273
2019-08-29 13:29:45 -04:00
Evan Hunt
a8595262f7 add a semantic patch for the API change 2019-08-29 10:07:41 -07:00
Evan Hunt
c48979e6c5 simplify dns_rbtnodechain_init() by removing unnecessary 'mctx' parameter 2019-08-29 10:03:36 -07:00
Ondřej Surý
ca52242661 Merge branch 'ondrej/use-needs-kw-in-gitlab-ci' into 'master'
Ondrej/use needs kw in gitlab ci

See merge request isc-projects/bind9!2280
2019-08-29 08:58:37 -04:00
Ondřej Surý
3f2de6d39c Swap unit and system stages 2019-08-29 14:39:08 +02:00
Ondřej Surý
fc834aa4bc Further improve the CI by starting the build and docs right after autoreconf 2019-08-29 14:37:33 +02:00
Ondřej Surý
008b73fb41 Split the system and unit tests into separate stages 2019-08-29 14:32:27 +02:00
Ondřej Surý
04ce124279 Make use of DAG for GitLab Pipelines
GitLab 12.2 has introduced Directed Acyclic Graphs in the GitLab CI[1] that
allow jobs to run out-of-order and not wait for the whole previous stage to
complete.

1. https://docs.gitlab.com/ee/ci/directed_acyclic_graph/
2019-08-29 14:31:37 +02:00
Ondřej Surý
057e9fdb51 Merge branch 'ondrej/missing-extern-in-dighost_error-declaration' into 'master'
dighost_error declaration in dig/dig.h was missing extern

See merge request isc-projects/bind9!2278
2019-08-29 07:05:26 -04:00
Ondřej Surý
f1a887a0b9 dighost_error declaration in dig/dig.h was missing extern 2019-08-29 11:24:16 +02:00
Mark Andrews
d9e96809ac Merge branch '1199-return-value-from-open-not-checked' into 'master'
Resolve "Return value from open() not checked."

Closes #1199

See merge request isc-projects/bind9!2264
2019-08-28 20:17:01 -04:00
Mark Andrews
510306c654 check that open() succeeded 2019-08-28 19:50:44 -04:00
Mark Andrews
9d3205e894 Merge branch '1201-add-llq-option' into 'master'
Resolve "Add LLQ option"

Closes #1201

See merge request isc-projects/bind9!2267
2019-08-28 02:41:43 -04:00
Mark Andrews
d98f446d3f Add support for displaying EDNS option LLQ. 2019-08-28 16:13:43 +10:00
Mark Andrews
c8ed70a108 Merge branch '1187-ddns-rejected-if-zone-contains-cds-cdnskey' into 'master'
Resolve "DDNS rejected if zone contains CDS/CDNSKEY"

Closes #1187

See merge request isc-projects/bind9!2254
2019-08-28 02:09:39 -04:00
Mark Andrews
ba26c6eb48 add CHANGES 2019-08-28 15:47:16 +10:00
Mark Andrews
30610eb9a5 add good and bad CDS / CDNSKEY test zones 2019-08-28 15:46:41 +10:00
Mark Andrews
3705605e0b fix dnssec system tests that fail now that we call dns_zone_cdscheck 2019-08-28 15:46:41 +10:00
Mark Andrews
cd40c9fe61 add dns_zone_cdscheck to integrity checks 2019-08-28 15:46:41 +10:00
Mark Andrews
2ebc4776ca implement getoriginnode for sdb 2019-08-28 15:46:41 +10:00
Evan Hunt
ddd871bbea Merge branch 'each-tidy-glue-test' into 'master'
remove unneeded files and options from glue test

See merge request isc-projects/bind9!2238
2019-08-27 13:00:47 -04:00
Evan Hunt
7b65ea4c11 remove unneeded files and options from glue test
- the cache-file and check-itegrity options were not needed
- some zones and files were not used
2019-08-27 09:41:33 -07:00
Evan Hunt
417df8cfbc Merge branch 'each-dig-yaml' into 'master'
dig/delv/mdig +yaml output

Closes #1145

See merge request isc-projects/bind9!2168
2019-08-25 20:02:33 -04:00
Evan Hunt
2627287dbc CHANGES, README, relnotes 2019-08-25 16:41:39 -07:00
Evan Hunt
33887dd941 add digdelv +yaml system tests 2019-08-25 16:41:38 -07:00
Evan Hunt
617696fbfc document the +yaml option in dig, mdig and delv 2019-08-25 16:41:38 -07:00
Evan Hunt
241cf78fee add "delv +yaml" output format 2019-08-25 16:41:34 -07:00
Evan Hunt
5aa375f0d8 add "mdig +yaml" output format 2019-08-25 16:41:29 -07:00
Evan Hunt
71325852f1 add "dig +yaml" output format 2019-08-25 16:41:14 -07:00
Evan Hunt
89d5ecb04d Merge branch '1031-multiple-rate-limit-clauses-are-unsupported-master' into 'master'
Resolve "Multiple rate-limit clauses are unsupported"

See merge request isc-projects/bind9!2262
2019-08-21 11:04:14 -04:00
Mark Andrews
9fc4be226d remove reference to rate-limit { domain ...; }
(cherry picked from commit 2275630bc9)
2019-08-21 08:40:09 -06:00
Tinderbox User
e1792341ac Merge branch 'prep-release' 2019-08-12 14:08:48 +00:00
Tinderbox User
1b9b826518 prep 9.15.3 2019-08-12 14:08:12 +00:00
Tinderbox User
d6a9407908 prep 9.15.3 2019-08-12 13:59:41 +00:00
Matthijs Mekking
d60557be82 Merge branch '1074-matthijs-underflow-cachedb-statistics' into 'master'
Resolve "underflow in stats channel stale cached RRSIG gauge [ISC-support #14769]"

Closes #1074 and #602

See merge request isc-projects/bind9!2237
2019-08-12 04:39:30 -04:00
Matthijs Mekking
4c0b0fa6a5 Simplify do_stats logic in rbtdb.c 2019-08-12 10:16:08 +02:00
Evan Hunt
2ceb4b6a98 improve ARM text about cache DB statistics 2019-08-12 10:16:08 +02:00
Matthijs Mekking
98b460e604 Add serve-stale test for ancient RRsets counters 2019-08-12 10:16:08 +02:00
Matthijs Mekking
1cd3516d54 Move dnssec_keyid_max out rrsettype counters enum 2019-08-12 10:16:08 +02:00
Matthijs Mekking
6e48abc503 Update CHANGES, notes 2019-08-12 10:16:08 +02:00
Matthijs Mekking
a3af2c57e7 Make rbtdb maintain stale counters
When updating the statistics for RRset types, if a header is marked
stale or ancient, the appropriate statistic counters are decremented,
then incremented.

Also fix some out of date comments.
2019-08-12 10:16:08 +02:00
Matthijs Mekking
48332d4478 No longer have stale tracking in stats module
Having the decrement/increment logic in stats makes the code hard
to follow. Remove it here and adjust the unit test. The caller
will be responsible for maintaining the correct increments and
decrements for statistics counters (in the following commit).
2019-08-12 10:16:08 +02:00
Matthijs Mekking
c9d56a8185 Print out ancient type stats with '~' prefix.
The stale RR types are now printed with '#'.  This used to be the
prefix for RR types that were marked ancient, but commit
df50751585 changed the meaning.  It is
probably better to keep '#' for stale RR types and introduce a new
prefix for reintroducing ancient type stat counters.
2019-08-12 10:16:08 +02:00
Michał Kępień
403cc1fa12 Merge branch '1110-clarify-relationship-between-acls-and-rpz' into 'master'
Clarify relationship between ACLs and RPZ

Closes #1110

See merge request isc-projects/bind9!2255
2019-08-12 03:50:18 -04:00
Michał Kępień
33bddbb5d1 Clarify relationship between ACLs and RPZ
In the ARM section about RPZ, add text explicitly stating that ACLs take
precedence over RPZ to prevent users from expecting RPZ actions to be
applied to queries coming from clients which are not permitted access to
the resolver by ACLs.
2019-08-12 09:46:34 +02:00
Evan Hunt
ed10608663 Merge branch '7-remove-dlv-validation' into 'master'
Remove DLV validation code

Closes #7

See merge request isc-projects/bind9!2233
2019-08-09 12:40:52 -04:00
Evan Hunt
d7461772bb CHANGES, release note 2019-08-09 09:22:05 -07:00
Matthijs Mekking
5ed13fe426 remove DLV from ARM 2019-08-09 09:22:05 -07:00
Evan Hunt
efa5f7ed54 remove remaining DLV-related configuration checks 2019-08-09 09:22:05 -07:00
Evan Hunt
02d95d0b62 update docbook grammar, removing dnssec-looksaide
- this required modification to the code that generates grammar text for
  the documentation, because the "dnssec-lookaside" option spanned more
  than one line in doc/misc/options, so grepping out only the lines
  marked "// obsolete" didn't remove the whole option.  this commit adds
  an option to cfg_test to print named.conf clauses only if they don't
  have the obsolete, ancient, test-only, or not-yet-implemented flags
  set.
2019-08-09 09:18:46 -07:00
Evan Hunt
54de054dd5 mark 'dnssec-lookaside' obsolete in parser 2019-08-09 09:18:02 -07:00
Evan Hunt
2c87ab1cca remove DLV system tests 2019-08-09 09:18:02 -07:00
Evan Hunt
f9c07c78bc remove DLV support from dnssec-signzone 2019-08-09 09:18:02 -07:00
Evan Hunt
3a19e9ea19 remove DLV support from dnssec-dsfromkey 2019-08-09 09:18:02 -07:00
Evan Hunt
0b2b6b2ed1 remove DLV support from dnssec-checkds 2019-08-09 09:18:02 -07:00
Evan Hunt
a73350a210 remove DLV from dns_client API and lib/samples 2019-08-09 09:18:02 -07:00
Evan Hunt
a00f1df736 remove DLV from delv 2019-08-09 09:15:10 -07:00
Evan Hunt
1d86b202ad remove DLV-related library code 2019-08-09 09:15:10 -07:00
Evan Hunt
6a51b66197 remove DLV from validator 2019-08-08 08:46:13 -07:00
Ondřej Surý
053a716ae0 Merge branch '1182-add-older-autoconf-pkg-config-compat-macros' into 'master'
Add PKG_CHECK_VAR and AS_VAR_COPY compat macros (Courtesy of ycflash)

Closes #1182

See merge request isc-projects/bind9!2246
2019-08-08 08:46:52 -04:00
Ondřej Surý
d80b6ec879 Add PKG_CHECK_VAR and AS_VAR_COPY compat macros (Courtesy of ycflash) 2019-08-08 14:46:31 +02:00
Michał Kępień
0d20df220e Merge branch 'michal/implement-a-convenience-function-for-rndc-dumpdb' into 'master'
Implement a convenience function for "rndc dumpdb"

See merge request isc-projects/bind9!1967
2019-08-08 08:42:49 -04:00
Michał Kępień
4a8b3a8ac0 Use rndc_dumpdb() in the "sfcache" system test 2019-08-08 14:27:55 +02:00
Michał Kępień
52beeed444 Use rndc_dumpdb() in the "serve-stale" system test 2019-08-08 14:27:55 +02:00
Michał Kępień
443449863b Use rndc_dumpdb() in the "rndc" system test 2019-08-08 14:27:55 +02:00
Michał Kępień
44c0cc881f Use rndc_dumpdb() in the "dnssec" system test 2019-08-08 14:27:55 +02:00
Michał Kępień
cbf32b901b Use rndc_dumpdb() in the "cookie" system test 2019-08-08 14:27:55 +02:00
Michał Kępień
22d5355782 Use rndc_dumpdb() in the "cacheclean" system test 2019-08-08 14:27:55 +02:00
Michał Kępień
ab78e350dd Implement a convenience function for "rndc dumpdb"
Add a helper shell function, rndc_dumpdb(), which provides a convenient
way to call "rndc dumpdb" for a given server with optional additional
arguments.  Since database dumping is an asynchronous process, the
function waits until the dump is complete before returning, which
prevents false positives in system tests caused by inspecting the dump
before its preparation is finished.  The function also renames the dump
file before returning so that it does not get overwritten by subsequent
calls; this retains forensic data in case of an unexpected test failure.
2019-08-08 14:27:55 +02:00
Ondřej Surý
7fac94f589 Merge branch 'sparc-pause' into 'master'
configure.ac: autodetect 'pause' instruction presence on sparc

See merge request isc-projects/bind9!2243
2019-08-08 07:31:29 -04:00
Sergei Trofimovich
a5ad6b16c5 configure.ac: autodetect 'pause' instruction presence on sparc
The change fixes the following build failure on sparc T3 and older CPUs:

```
sparc-unknown-linux-gnu-gcc ... -O2 -mcpu=niagara2 ... -c rwlock.c
{standard input}: Assembler messages:
{standard input}:398: Error: Architecture mismatch on "pause ".
{standard input}:398: (Requires v9e|v9v|v9m|m8; requested architecture is v9b.)
make[1]: *** [Makefile:280: rwlock.o] Error 1
```

`pause` insutruction exists only on `-mcpu=niagara4` (`T4`) and upper.

The change adds `pause` configure-time autodetection and uses it if available.
config.h.in got new `HAVE_SPARC_PAUSE` knob. Fallback is a fall-through no-op.

Build-tested on:

- sparc-unknown-linux-gnu-gcc (no `pause`, build succeeds)
- sparc-unknown-linux-gnu-gcc -mcpu=niagara4 (`pause`, build succeeds)

Reported-by: Rolf Eike Beer
Bug: https://bugs.gentoo.org/691708
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2019-08-08 07:15:04 -04:00
Evan Hunt
d3506c9728 Merge branch 'each-mdig-multi-norrcomments' into 'master'
minor bugfix in mdig: when using +multi, +norrcomments was ignored

See merge request isc-projects/bind9!2208
2019-08-07 23:15:13 -04:00
Evan Hunt
93ad3eea90 added "mdig +multi +norrcomment" test; also fixed the flawed dig test 2019-08-07 19:55:20 -07:00
Evan Hunt
edab51b420 minor bugfix in mdig: when using +multi, +norrcomments was ignored 2019-08-07 19:47:56 -07:00
Ondřej Surý
5d5cf12a85 Merge branch '1148-deadlock-hangs-named-v9_11-v9_14-master' into 'master'
Resolve "deadlock hangs named"

Closes #1148

See merge request isc-projects/bind9!2236
2019-08-07 07:02:16 -04:00
Ondřej Surý
4db3189de2 Have the dns_client hold a .references until all external references are removed
so that cleanup can all be done in dns_client_destroy().

(cherry picked from commit e80c4c3431)
(cherry picked from commit ebc48cda26)
2019-08-07 12:43:13 +02:00
Mark Andrews
b3cd04b95a Have the view hold a weakref until all external references are removed
so that cleanup can all be done in dns_view_weakattach().

(cherry picked from commit be8af3afb7)
(cherry picked from commit e394632703)
2019-08-07 12:43:12 +02:00
Ondřej Surý
cd9bbe6dea lib/dns/resolver.c: Convert (dns_view_t *)->weakrefs to isc_refcount_t
There's a deadlock in BIND 9 code where (dns_view_t){ .lock } and
(dns_resolver_t){ .buckets[i].lock } gets locked in different order.  When
view->weakrefs gets converted to a reference counting we can reduce the locking
in dns_view_weakdetach only to cases where it's the last instance of the
dns_view_t object.

(cherry picked from commit a7c9a52c89)
(cherry picked from commit 232140edae)
2019-08-07 12:43:12 +02:00
Ondřej Surý
f03aaaa6b5 Merge branch 'ondrej/flycheck-configuration-update' into 'master'
Update the flycheck configuration for gcc and cppcheck

See merge request isc-projects/bind9!2234
2019-08-07 04:13:18 -04:00
Ondřej Surý
d883aab05f Update the flycheck configuration for gcc and cppcheck 2019-08-07 10:12:25 +02:00
Evan Hunt
48213633ce Merge branch '1170-dig-comments' into 'master'
Resolve "dig +nocomment still comments"

Closes #1170

See merge request isc-projects/bind9!2207
2019-08-06 00:55:46 -04:00
Evan Hunt
9679c8c20a clarify descriptions of comment-related options in dig usage and man page 2019-08-05 21:30:34 -07:00
Evan Hunt
6d50f7d924 always check 'printcmd' before printing cmdline message 2019-08-05 21:26:32 -07:00
Mark Andrews
451113b4a9 Merge branch '964-use-referral-ds-record-when-validating' into 'master'
Resolve "Use referral DS record when validating"

Closes #964

See merge request isc-projects/bind9!1755
2019-08-02 01:31:16 -04:00
Mark Andrews
ac28cc14e1 add CHANGES 2019-08-02 15:09:42 +10:00
Mark Andrews
4293a2f4bf check that example/DS is not fetched when validating a.example 2019-08-02 15:09:42 +10:00
Mark Andrews
57a328d67e Store the DS and RRSIG(DS) with trust dns_trust_pending_answer
so that the validator can validate the records as part of validating
the current request.
2019-08-02 15:09:42 +10:00
Mark Andrews
954782d78a Merge branch '1175-a-race-in-ht-c-can-cause-require-failures' into 'master'
Resolve "a race in ht.c can cause REQUIRE failures"

Closes #1175

See merge request isc-projects/bind9!2225
2019-08-01 02:04:32 -04:00
Mark Andrews
49c31702bd add CHANGES 2019-08-01 16:03:55 +10:00
Mark Andrews
9cfd0ecccf remove invalid comment 2019-08-01 11:32:28 +10:00
Mark Andrews
9b10cfef56 keep rpzs around until everything referencing it has gone 2019-08-01 11:15:05 +10:00
Mark Andrews
53800281fe maintain a reference to 'rpz' when calling rpz.c:update_quantum 2019-08-01 09:30:49 +10:00
Ondřej Surý
fefb2d2662 Merge branch 'michal/do-not-use-target-specific-variables-in-makefiles' into 'master'
Do not use target-specific variables in Makefiles and fix LD_WRAP for non-libtool builds

Closes #1174

See merge request isc-projects/bind9!2224
2019-07-31 10:48:46 -04:00
Ondřej Surý
37cccbab8d Fix the ${WRAP} -> $${WRAP} to allow static non-libtool linking again 2019-07-31 16:18:58 +02:00
Ondřej Surý
4302b4f3c4 Revert the target specific variable to fix building with BSD make 2019-07-31 16:05:02 +02:00
Ondřej Surý
ae76cd086e Merge branch '4-remove-etags' into 'master'
Remove the autoconf checks for etags/ctags and `make tags` target

Closes #4

See merge request isc-projects/bind9!2223
2019-07-31 09:43:42 -04:00
Ondřej Surý
1d3ba54d6c Remove the autoconf checks for etags/ctags and make tags target
There's no strong reason to keep `make tags` in our build system.  The previous
functionality of `make tags` could be simply retained by aliasing variant of:

    etags $(git ls-files '*.c' '*.h')

which would be universal for all C-code projects.
2019-07-31 15:27:27 +02:00
Ondřej Surý
72bd0db6cf Merge branch '4-configure.ac-use-pkg-config-for-zlib' into 'master'
Convert the configure.ac rules for zlib library to use pkg-config

Closes #4

See merge request isc-projects/bind9!2222
2019-07-31 09:15:12 -04:00
Ondřej Surý
2b632a232f Convert the configure.ac rules for zlib library to use pkg-config 2019-07-31 14:54:40 +02:00
Mark Andrews
aed7eb0c74 Merge branch '1159-bits-65-72-of-the-dns64-prefix-are-supposed-to-be-zero' into 'master'
Resolve "Bits 64..71 of the dns64 prefix are supposed to be zero"

Closes #1159

See merge request isc-projects/bind9!2193
2019-07-31 08:11:45 -04:00
Mark Andrews
d95ae93dd3 add CHANGES 2019-07-31 21:51:11 +10:00
Mark Andrews
a7ec7eb6ed check that bits 64..71 in a dns64 prefix are zero 2019-07-31 21:51:11 +10:00
Ondřej Surý
06d8b1071d Merge branch 'ondrej/cleanup-isc_thread-api' into 'master'
Cleanup the isc_thread API

See merge request isc-projects/bind9!2159
2019-07-31 06:09:45 -04:00
Ondřej Surý
46919579bb Make isc_thread_join() assert internally on failure
Previously isc_thread_join() would return ISC_R_UNEXPECTED on a failure to
create new thread.  All such occurences were caught and wrapped into assert
function at higher level.  The function was simplified to assert directly in the
isc_thread_join() function and all caller level assertions were removed.
2019-07-31 11:56:58 +02:00
Ondřej Surý
d6a60f2905 Make isc_thread_create() assert internally on failure
Previously isc_thread_create() would return ISC_R_UNEXPECTED on a failure to
create new thread.  All such occurences were caught and wrapped into assert
function at higher level.  The function was simplified to assert directly in the
isc_thread_create() function and all caller level assertions were removed.
2019-07-31 11:56:58 +02:00
Michał Kępień
e6de6deec9 Merge branch 'michal/wildcard-system-test-make-root-hints-consistent-with-authoritative-data' into 'master'
"wildcard" system test: make root hints consistent with authoritative data

See merge request isc-projects/bind9!2190
2019-07-31 05:43:17 -04:00
Michał Kępień
dd430c3093 Make root hints consistent with authoritative data
Multiple resolvers in the "wildcard" system test are configured with a
single root hint: "ns.root-servers.nil", pointing to 10.53.0.1, which is
inconsistent with authoritative data served by ns1.  This may cause
intermittent resolution failures, triggering false positives for the
"wildcard" system test.  Prevent this from happening by making ns2, ns3,
and ns5 use root hints corresponding to the contents of ns1/root.db.in.
2019-07-31 11:06:34 +02:00
Ondřej Surý
6d069edb59 Merge branch '1123-remove-isc-config.sh' into 'master'
The BIND 9 libraries are now internal-only, so remove isc-config.sh

Closes #1123

See merge request isc-projects/bind9!2115
2019-07-31 05:04:00 -04:00
Ondřej Surý
4b44351e65 The BIND 9 libraries are now internal-only, so remove isc-config.sh
The isc-config.sh script was introduced before pkg-config as is a purely
historical thing.  There are two reason for removal of isc-config.sh scripts:

a) The BIND 9 libraries are now meant to be used only from BIND 9, so there's no
   reason to provide convenience script to link with the libraries.

b) Even if that was not the case, we should and would replace the isc-config.sh
   with respective pkg-config (.pc) file for every library.
2019-07-31 10:45:18 +02:00
Ondřej Surý
7c3430a24e Merge branch '1160-properly-use-isc_mem_putanddetach' into 'master'
Resolve "Replace the isc_mem_put(mctx, ...)+isc_mem_detach(&mctx) usage with isc_mem_putanddetach(&mctx)"

Closes #1160

See merge request isc-projects/bind9!2195
2019-07-31 04:39:40 -04:00
Ondřej Surý
44381929e2 We need to wrap isc__mem_putanddetach in tkey_test.c unit too now 2019-07-31 10:26:41 +02:00
Ondřej Surý
a6dcdc535c Replace usage of isc_mem_put+isc_mem_detach with isc_mem_putanddetach
Using isc_mem_put(mctx, ...) + isc_mem_detach(mctx) required juggling with the
local variables when mctx was part of the freed object. The isc_mem_putanddetach
function can handle this case internally, but it wasn't used everywhere.  This
commit apply the semantic patching plus bit of manual work to replace all such
occurrences with proper usage of isc_mem_putanddetach().
2019-07-31 10:26:40 +02:00
Ondřej Surý
d502569902 Add spatch to replace isc_mem_put+isc_mem_detach with isc_mem_putanddetach 2019-07-31 10:26:40 +02:00
Ondřej Surý
b23c8aa5e8 Merge branch '1151-inconsistent-usage-of-stdout-vs-stderr-in-signing-tools' into 'master'
Resolve "Inconsistent usage of stdout vs stderr in signing tools"

Closes #1151

See merge request isc-projects/bind9!2165
2019-07-31 04:24:50 -04:00
Ondřej Surý
e4144fb9cf Add CHANGES and release note 2019-07-31 10:05:52 +02:00
Evan Hunt
664b8f04f5 add -q to getopt flags, and use newlines consistently with report() 2019-07-31 10:05:52 +02:00
Evan Hunt
022649abc3 document -q option in dnssec-signzone and dnssec-verify man pages 2019-07-31 10:05:52 +02:00
Ondřej Surý
fd00bac736 Add -q (quiet) option to dnssec-signzone and dnssec-verify tool
With the move of the normal output to stdout, we need a way how to silence the
extra output, so the signed file name can be captured in a simple way.  This
commit adds `-q` command line option that will silence all the normal output
that get's printed from both tools.
2019-07-31 10:05:52 +02:00
Ondřej Surý
94354d4655 Remove 2>&1 from the dnssec-signzone invocation in tests 2019-07-31 10:05:52 +02:00
Ondřej Surý
ced15edea1 Change the zoneverify.c to print the information to user supplied function
The lib/dns/zoneverify.c output was hardwired to stderr, which was inconsistent
with lib/dns/dnssec.c.  This commit changes zoneverify.c to print the normal run
information to caller supplied function - same model as in the lib/dns/dnssec.c.
2019-07-31 10:05:52 +02:00
Ondřej Surý
90f4c1c5a2 Use stdout to print information about signing
Previously, the default output from the libdns library went to stderr by
default.  This was inconsistent with the rest of the output.  This commit
changes the default logging to go to stdout, with notable exception - when the
output of the signing process goes to stdout, the messages are printed to the
stderr.  This is consistent with other functions that output information about
the signing process - e.g. print_stats().
2019-07-31 10:05:51 +02:00
Michał Kępień
36ee99c5ee Merge branch 'michal/staticstub-system-test-make-root-hints-consistent-with-authoritative-data' into 'master'
"staticstub" system test: make root hints consistent with authoritative data

See merge request isc-projects/bind9!2161
2019-07-31 03:42:41 -04:00
Michał Kępień
4b5e1da0e3 Make root hints consistent with authoritative data
The ns2 named instance in the "staticstub" system test is configured
with a single root hint commonly used in BIND system tests
(a.root-servers.nil with an address of 10.53.0.1), which is inconsistent
with authoritative data served by ns1.  This may cause intermittent
resolution failures, triggering false positives for the "staticstub"
system test.  Prevent this from happening by making ns1 serve data
corresponding to the contents of bin/tests/system/common/root.hint.
2019-07-31 09:18:02 +02:00
Michał Kępień
51ec36c826 Merge branch 'michal/update-gitlab-ci-to-fedora-30' into 'master'
Update GitLab CI to Fedora 30

See merge request isc-projects/bind9!2196
2019-07-31 03:14:25 -04:00
Michał Kępień
fac23cf939 Update GitLab CI to Fedora 30
Since Fedora 30 is the current Fedora release, replace Fedora 29 GitLab
CI jobs with their up-to-date counterparts.
2019-07-31 08:47:02 +02:00
Mark Andrews
7c210a2b3b Merge branch '1152-dig-expandaaaa-doesn-t-work-with-short' into 'master'
Resolve "dig +expandaaaa doesn't work with +short"

Closes #1152

See merge request isc-projects/bind9!2169
2019-07-30 21:40:49 -04:00
Mark Andrews
b791ab542b add CHANGES 2019-07-31 11:09:32 +10:00
Mark Andrews
9836d5bc17 check that dig +short +expandaaaa works 2019-07-30 21:05:56 -04:00
Mark Andrews
2a047af31e set DNS_STYLEFLAG_EXPANDAAAA flag in say_message if appropriate 2019-07-30 21:05:56 -04:00
Mark Andrews
6f8d363514 Merge branch '1133-your-problem-or-cygwin-s' into 'master'
Resolve "Your problem or Cygwin's ?????"

Closes #1133

See merge request isc-projects/bind9!2137
2019-07-30 20:58:36 -04:00
Mark Andrews
12d9681442 add CHANGES 2019-07-30 16:21:49 -07:00
Mark Andrews
91a0cb5da3 handle connect() returning ETIMEDOUT on a non-blocking socket 2019-07-30 16:21:49 -07:00
Michał Kępień
f30bdd1aac Merge branch '1171-alpine-linux-tweaks' into 'master'
Alpine Linux tweaks

Closes #1171

See merge request isc-projects/bind9!2204
2019-07-30 16:49:15 -04:00
Michał Kępień
326a334b49 Add Alpine Linux to GitLab CI
Ensure BIND is continuously tested on Alpine Linux as it is commonly
used as a base for Docker containers and employs a less popular libc
implementation, musl libc.
2019-07-30 21:25:18 +02:00
Michał Kępień
f4daf6e0e7 Do not use legacy time zone names
"PST8PDT" is a legacy time zone name whose use in modern code is
discouraged.  It so happens that using this time zone with musl libc
time functions results in different output than for other libc
implementations, which breaks the lib/isc/tests/time_test unit test.
Use the "America/Los_Angeles" time zone instead in order to get
consistent output across all tested libc implementations.
2019-07-30 21:25:18 +02:00
Michał Kępień
bb9c1654e2 Fix awk invocation in the "verify" system test
Appending output of a command to the same file as the one that command
is reading from is a dangerous practice.  It seems to have accidentally
worked with all the awk implementations we have tested against so far,
but for BusyBox awk, doing this may result in the input/output file
being written to in an infinite loop.  Prevent this from happening by
redirect awk output to a temporary file and appending its contents to
the original file in a separate shell pipeline.
2019-07-30 21:25:18 +02:00
Michał Kępień
b10d28d1e0 Extend prerequisites for the "xfer" system test
The Net::DNS Perl module needs the Digest::HMAC module to support TSIG.
However, since the latter is not a hard requirement for the former, some
packagers do not make Net::DNS depend on Digest::HMAC.  If Net::DNS is
installed on a host but Digest::HMAC is not, the "xfer" system test
breaks in a very hard-to-debug way (ans5 returns TSIG RRs with empty
RDATA, which prevents TSIG-signed SOA queries and transfers from
working).  Prevent this from happening by making the "xfer" system test
explicitly require Digest::HMAC apart from Net::DNS.
2019-07-30 21:25:18 +02:00
Michał Kępień
266e3ed52a Make "digdelv" system test work with BusyBox sed
The BusyBox version of sed treats leading '\+' in a regular expression
to be matched as a syntax error ("Repetition not preceded by valid
expression"), which triggers false positives for the "digdelv" system
test.  Make the relevant sed invocations work portably across all sed
implementations by removing the leading backslash.
2019-07-30 21:25:18 +02:00
Michał Kępień
ad008f7dbf Make "autosign" system test work with BusyBox awk
The BusyBox version of awk treats some variables which other awk
implementations consider to be decimal values as octal values.  This
intermittently breaks key event interval calculations in the "autosign"
system test, trigger false positives for it.  Prevent the problem from
happening by stripping leading zeros from the affected awk variables.
2019-07-30 21:25:18 +02:00
Michał Kępień
3384455659 Tweak buffer sizes to prevent compilation warnings
For some libc implementations, BUFSIZ is small enough (e.g. 1024 for
musl libc) to trigger compilation warnings about insufficient size of
certain buffers.  Since the relevant buffers are used for printing DNS
names, increase their size to '(n + 1) * DNS_NAME_FORMATSIZE', where 'n'
is the number of DNS names which are printed to a given buffer.  This
results in somewhat arbitrary, albeit nicely-aligned and large enough
buffer sizes.
2019-07-30 21:25:18 +02:00
Michał Kępień
b5cd146033 Always include <errno.h> instead of <sys/errno.h>
Including <sys/errno.h> instead of <errno.h> raises a compiler warning
when building against musl libc.  Always include <errno.h> instead of
<sys/errno.h> to prevent that compilation warning from being triggered
and to achieve consistency in this regard across the entire source tree.
2019-07-30 21:25:18 +02:00
Michał Kępień
5381ac0fcc Unify header ordering in unit tests
Make sure all unit tests include headers in a similar order:

 1. Three headers which must be included before <cmocka.h>.
 2. System headers.
 3. UNIT_TESTING definition, followed by the <cmocka.h> header.
 4. libisc headers.
 5. Headers from other BIND libraries.
 6. Local headers.

Also make sure header file names are sorted alphabetically within each
block of #include directives.
2019-07-30 21:25:15 +02:00
Michał Kępień
59528d0e9d Include <sched.h> where necessary for musl libc
All unit tests define the UNIT_TESTING macro, which causes <cmocka.h> to
replace malloc(), calloc(), realloc(), and free() with its own functions
tracking memory allocations.  In order for this not to break
compilation, the system header declaring the prototypes for these
standard functions must be included before <cmocka.h>.

Normally, these prototypes are only present in <stdlib.h>, so we make
sure it is included before <cmocka.h>.  However, musl libc also defines
the prototypes for calloc() and free() in <sched.h>, which is included
by <pthread.h>, which is included e.g. by <isc/mutex.h>.  Thus, unit
tests including "dnstest.h" (which includes <isc/mem.h>, which includes
<isc/mutex.h>) after <cmocka.h> will not compile with musl libc as for
these programs, <sched.h> will be included after <cmocka.h>.

Always including <cmocka.h> after all other header files is not a
feasible solution as that causes the mock assertion macros defined in
<isc/util.h> to mangle the contents of <cmocka.h>, thus breaking
compilation.  We cannot really use the __noreturn__ or analyzer_noreturn
attributes with cmocka assertion functions because they do return if the
tested condition is true.  The problem is that what BIND unit tests do
is incompatible with Clang Static Analyzer's assumptions: since we use
cmocka, our custom assertion handlers are present in a shared library
(i.e. it is the cmocka library that checks the assertion condition, not
a macro in unit test code).  Redefining cmocka's assertion macros in
<isc/util.h> is an ugly hack to overcome that problem - unfortunately,
this is the only way we can think of to make Clang Static Analyzer
properly process unit test code.  Giving up on Clang Static Analyzer
being able to properly process unit test code is not a satisfactory
solution.

Undefining _GNU_SOURCE for unit test code could work around the problem
(musl libc's <sched.h> only defines the prototypes for calloc() and
free() when _GNU_SOURCE is defined), but doing that could introduce
discrepancies for unit tests including entire *.c files, so it is also
not a good solution.

All in all, including <sched.h> before <cmocka.h> for all affected unit
tests seems to be the most benign way of working around this musl libc
quirk.  While quite an ugly solution, it achieves our goals here, which
are to keep the benefit of proper static analysis of unit test code and
to fix compilation against musl libc.
2019-07-30 21:08:40 +02:00
Michał Kępień
03de34194d Merge branch 'michal/filter-aaaa-system-test-make-root-hints-consistent-with-authoritative-data' into 'master'
"filter-aaaa" system test: make root hints consistent with authoritative data

See merge request isc-projects/bind9!2057
2019-07-29 16:10:44 -04:00
Michał Kępień
c19ebde14b Make root hints consistent with authoritative data
Resolvers in the "filter-aaaa" system test are configured with a single
root hint: "ns.rootservers.net", pointing to 10.53.0.1.  However,
querying ns1 for "ns.rootservers.net" results in NXDOMAIN answers.
Since the TTL for the root hint is set to 0, it may happen that a
resolver's ADB will be asked to return any known addresses for
"ns.rootservers.net", but it will only have access to a cached NXDOMAIN
answer for that name and an expired root hint, which will result in a
resolution failure, triggering a false positive for the "filter-aaaa"
system test.  Prevent this from happening by making all the root hints
consistent with authoritative data served by ns1.
2019-07-29 21:44:31 +02:00
Evan Hunt
c14dc46319 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!2202
2019-07-25 22:05:03 -04:00
Evan Hunt
78da483941 placeholder 2019-07-25 22:04:29 -04:00
Ondřej Surý
73e615fcfa Merge branch '1030-statistics-channel-improvements-generated-files' into 'master'
Regenerate bind9.xsl.h

Closes #1030

See merge request isc-projects/bind9!2201
2019-07-25 21:43:52 -04:00
Ondřej Surý
36bc018275 Regenerate bind9.xsl.h 2019-07-25 21:31:47 -04:00
Matthijs Mekking
e976db255f Merge branch 'matthijs-addzone-ignored-some-test-results' into 'master'
The 'addzone' test ignored some test results

See merge request isc-projects/bind9!2198
2019-07-25 11:03:40 -04:00
Matthijs Mekking
4b40266a1d The 'addzone' test ignored some test results 2019-07-25 16:30:20 +02:00
Ondřej Surý
8751585841 Merge branch '1030-statistics-channel-improvements' into 'master'
Statistics Channel Improvements

Closes #1030

See merge request isc-projects/bind9!1944
2019-07-25 08:22:32 -04:00
Mark Andrews
b8a96bfa78 add CHANGES 2019-07-25 08:03:10 -04:00
Mark Andrews
570d1cf0bb use h?+script selectors 2019-07-25 08:03:10 -04:00
Mark Andrews
e6c13ebb26 toggle graph/counter pairs 2019-07-25 08:03:10 -04:00
Mark Andrews
34ce90565c toggle graph/counter pairs 2019-07-25 08:03:10 -04:00
Timothe Litt
86595ed8cb Make statistics tables (in HTML view) togglable
The HTML view of the statistics channel creates
pages with many long tables.  These can be difficult
to navigate.

This commit adds a "show/hide" toggle to each
heading, which makes it easy to compress/expand
the view.
2019-07-25 08:03:10 -04:00
Ondřej Surý
d807ecde24 Merge branch 'ondrej/cleanup_isc_mem_get_failure_handling_blocks' into 'master'
Cleanup isc_mem_get() failure handling blocks

See merge request isc-projects/bind9!2155
2019-07-23 16:25:14 -04:00
Evan Hunt
a1871e7f1d further cleanup
- removed some dead code
- dns_zone_setdbtype is now void as it could no longer return
  anything but ISC_R_SUCCESS; calls to it no longer check for a result
- controlkeylist_fromconfig() is also now void
- fixed a whitespace error
2019-07-23 15:32:36 -04:00
Ondřej Surý
19eb5d0e83 Cleanup the failure handling in isc_mem_allocate 2019-07-23 15:32:36 -04:00
Ondřej Surý
9123da5362 Adjust tkey_test.c test to mock_assert() when there's no memory 2019-07-23 15:32:36 -04:00
Ondřej Surý
f0c6aef542 Cleanup stray goto labels from removing isc_mem_allocate/strdup checking blocks 2019-07-23 15:32:36 -04:00
Ondřej Surý
9bdc24a9fd Use coccinelle to cleanup the failure handling blocks from isc_mem_strdup 2019-07-23 15:32:36 -04:00
Ondřej Surý
601cb4e4cc Use coccinelle to cleanup the failure handling blocks from isc_mem_allocate 2019-07-23 15:32:35 -04:00
Ondřej Surý
3c1d4298af Add spatch for isc_mem_allocate; it also cannot fail gracefully 2019-07-23 15:32:35 -04:00
Ondřej Surý
49f244406c Add spatch for isc_mem_strdup; it also cannot fail gracefully 2019-07-23 15:32:35 -04:00
Ondřej Surý
ae83801e2b Remove blocks checking whether isc_mem_get() failed using the coccinelle 2019-07-23 15:32:35 -04:00
Ondřej Surý
f63e696967 Add semantic patch to remove checking for isc_mem_get() return value
The isc_mem_get() cannot fail gracefully now, it either gets memory of
assert()s.  The added semantic patch cleans all the blocks checking whether
the return value of isc_mem_get() was NULL.
2019-07-23 15:32:35 -04:00
Ondřej Surý
7f828a213c Revert to patch generating check-cocci script
The coccinelle and util/update_copyright script have different
idea about how the whitespace should look like.  Revert the script
to the previous version, so it doesn't mangle the files in place,
and deal with just whitespace changes.
2019-07-23 15:32:35 -04:00
Ondřej Surý
3bcd05f081 Merge branch 'ondrej/disable-LD_WRAP-without-libtool' into 'master'
Disable LD_WRAP tests when libtool is disabled

See merge request isc-projects/bind9!2192
2019-07-23 12:02:03 -04:00
Ondřej Surý
0cd1e5ed28 Disable LD_WRAP tests when libtool is disabled 2019-07-23 11:49:21 -04:00
Ondřej Surý
14a4a799c0 Merge branch 'ondrej/fix-LD_WRAP-Makefile' into 'master'
Fix the lib/dns/tests/Makefile.in to work without LD_WRAP

See merge request isc-projects/bind9!2188
2019-07-23 09:05:36 -04:00
Ondřej Surý
b558346437 Fix the lib/dns/tests/Makefile.in to work without LD_WRAP 2019-07-23 08:59:36 -04:00
Ondřej Surý
14d10521ba Merge branch '1149-restore-locking-in-resume_dslookup' into 'master'
Restore locking in resume_dslookup()

Closes #1149

See merge request isc-projects/bind9!2184
2019-07-23 07:02:44 -04:00
Michał Kępień
ca528766d6 Restore locking in resume_dslookup()
Commit 9da902a201 removed locking around
the fctx_decreference() call inside resume_dslookup().  This allows
fctx_unlink() to be called without the bucket lock being held, which
must never happen.  Ensure the bucket lock is held by resume_dslookup()
before it calls fctx_decreference().
2019-07-23 11:43:46 +02:00
Ondřej Surý
dd358e6a21 Merge branch 'u/fanf2/arm-rrset-order-random' into 'master'
doc/arm: correct default for rrset-order

See merge request isc-projects/bind9!2146
2019-07-22 18:24:32 -04:00
Tony Finch
bded8af7b8 doc/arm: correct default for rrset-order 2019-07-22 18:12:29 -04:00
Ondřej Surý
07b4859dec Merge branch '195-add-dnstap-builds-to-ci' into 'master'
Add dnstap builds to CI

Closes #195

See merge request isc-projects/bind9!2160
2019-07-22 17:48:27 -04:00
Michał Kępień
2bf44c6cd4 Add dnstap builds to CI
Ensure BIND with dnstap support enabled is being continuously tested by
adding --enable-dnstap to the ./configure invocation used for CentOS 7
and Debian sid builds in GitLab CI.
2019-07-22 17:35:46 -04:00
Ondřej Surý
673aa9f626 Merge branch 'each-fix-ld-wrap-test' into 'master'
Fix LD_WRAP test in configure

See merge request isc-projects/bind9!1806
2019-07-22 17:18:02 -04:00
Evan Hunt
839ed7894b Make the symbol wrapping work with dynamic linking
When the unit test is linked with dynamic libraries, the wrapping
doesn't occur, probably because it's different translation unit.

To workaround the issue, we provide thin wrappers with *real* symbol
names that just call the mocked functions.
2019-07-22 17:16:51 -04:00
Ondřej Surý
135519e59a Fix the configure.ac and Makefile.in to correctly test for --wrap 2019-07-22 23:00:37 +02:00
Mark Andrews
c808255682 Merge branch '1136-named-checkconf-should-report-missing-dnstap-output-option-when-dnstap-option-is-set' into 'master'
Resolve "named-checkconf should report missing dnstap-output option when dnstap option is set"

Closes #1136

See merge request isc-projects/bind9!2147
2019-07-22 15:28:08 -04:00
Mark Andrews
a4f38bec6a named-checkconf failed to report dnstap-output missing
from named.conf when dnstap was specified
2019-07-23 05:09:01 +10:00
Mark Andrews
b786171423 Merge branch '1106-interaction-between-dns64-and-rpz-can-cause-unexpected-results' into 'master'
Resolve "Interaction between dns64 and RPZ can cause unexpected results"

Closes #1106

See merge request isc-projects/bind9!2111
2019-07-22 14:33:52 -04:00
Mark Andrews
b9a1c31df1 add CHANGES 2019-07-23 04:21:13 +10:00
Mark Andrews
1eb640049c Do not attempt to perform a DNS64 rewrite if RPZ returns NODATA. 2019-07-23 04:19:28 +10:00
Mark Andrews
b9dc9b68cd Check that RPZ 'CNAME *.' (NODATA) works with DNS64. 2019-07-23 04:14:20 +10:00
Ondřej Surý
59a7f75b7e Merge branch 'michal/add-debian-buster-to-ci' into 'master'
Add Debian buster to CI

See merge request isc-projects/bind9!2162
2019-07-22 11:18:47 -04:00
Michał Kępień
5f71d9c6ac Add Debian buster to CI
Ensure BIND is continuously tested on Debian 10 (buster) as it is the
current stable Debian release.
2019-07-22 11:00:32 -04:00
Ondřej Surý
fb40bc061f Merge branch '1149-fix-crashes-during-resolver-shutdown' into 'master'
Restore locking in dns_resolver_shutdown and dns_resolver_attach

Closes #1149

See merge request isc-projects/bind9!2164
2019-07-22 10:02:57 -04:00
Ondřej Surý
a4141fcf98 Restore more locking in the lib/dns/resolver.c code
1. Restore locking in the fctx_decreference() code, because the insides of the
   function needs to be protected when fctx->references drops to 0.

2. Restore locking in the dns_resolver_attach() code, because two variables are
   accessed at the same time and there's slight chance of data race.
2019-07-22 09:03:27 -04:00
Ondřej Surý
317e36d47e Restore locking in dns_resolver_shutdown and dns_resolver_attach
Although the struct dns_resolver.exiting member is protected by stdatomics, we
actually need to wait for whole dns_resolver_shutdown() to finish before
destroying the resolver object.  Otherwise, there would be a data race and some
fctx objects might not be destroyed yet at the time we tear down the
dns_resolver object.
2019-07-22 08:17:36 -04:00
Ondřej Surý
0b8632e662 Merge branch '605-fixes' into 'master'
Fix missing siphash_test from Kyuafile and missing endian.h from MSVC build files

Closes #605

See merge request isc-projects/bind9!2173
2019-07-22 08:15:34 -04:00
Ondřej Surý
779aa2c9d9 Add siphash_test to lib/isc/tests/Kyuafile 2019-07-22 08:06:14 -04:00
Ondřej Surý
926f2dedbd Add endian.h to libisc.vcxproj.* files 2019-07-22 08:06:14 -04:00
Ondřej Surý
03b8e7ccb7 Merge branch '1153-fix-broken-atomics-on-windows' into 'master'
Fixup the increment vs decrement typo in lib/isc/win32/socket.c

Closes #1153

See merge request isc-projects/bind9!2172
2019-07-21 22:18:48 -04:00
Ondřej Surý
69e84ab9c1 Fixup the increment vs decrement typo in lib/isc/win32/socket.c 2019-07-21 22:05:24 -04:00
Ondřej Surý
51ec6f6500 Merge branch '605-add-siphash24-wpk' into 'master'
Synchronize the Cookie algorithm to SipHash-2-4 with other open-source DNS vendors

Closes #605

See merge request isc-projects/bind9!1788
2019-07-21 15:30:30 -04:00
Ondřej Surý
1711e61549 Add CHANGES note 2019-07-21 15:16:28 -04:00
Ondřej Surý
eee6f51d05 Add release notes 2019-07-21 15:16:28 -04:00
Ondřej Surý
a912f31398 Add new default siphash24 cookie algorithm, but keep AES as legacy
This commit changes the BIND cookie algorithms to match
draft-sury-toorop-dnsop-server-cookies-00.  Namely, it changes the Client Cookie
algorithm to use SipHash 2-4, adds the new Server Cookie algorithm using SipHash
2-4, and changes the default for the Server Cookie algorithm to be siphash24.

Add siphash24 cookie algorithm, and make it keep legacy aes as
2019-07-21 15:16:28 -04:00
Witold Kręcicki
afa81ee4e4 Remove all cookie algorithms but AES, which was used as a default, for legacy purposes. 2019-07-21 10:08:14 -04:00
Ondřej Surý
4e33942742 Merge branch 'ondrej/fix-leaked-memory-in-geoip_test.c' into 'master'
Fix leaked memory in geoip_test.c

See merge request isc-projects/bind9!2154
2019-07-16 12:55:01 -04:00
Ondřej Surý
d1c7b79183 Fix the memory leaks in GeoIP unit test
Each individual test opened GeoIP databased but the database handles were never
closed.  This commit moves the open/close from the individual unit tests into
the _setup and _teardown methods where they really belong.
2019-07-16 15:35:34 +02:00
Ondřej Surý
4084ba1085 Merge branch 'ondrej/remove-mutexatomics-tests' into 'master'
Disable the mutexatomics tests from the regular CI (we could enable them on...

See merge request isc-projects/bind9!2150
2019-07-12 10:07:20 -04:00
Ondřej Surý
257b0456f1 Disable the mutexatomics tests from the regular CI (we could enable them on trigger or schedule in the future) 2019-07-12 16:01:01 +02:00
Ondřej Surý
00f9ed8f8b Merge branch 'ondrej/add-memcpy.spatch-and-fix-check-cocci-script' into 'master'
Add memcpy.spatch and fixup check-cocci script

See merge request isc-projects/bind9!2149
2019-07-12 09:59:25 -04:00
Ondřej Surý
f3bcd1485f Don't cover the .spatch files with copyright 2019-07-12 15:45:07 +02:00
Ondřej Surý
9f916b000e Make util/check-cocci modify the files in place and be more verbose 2019-07-12 15:38:48 +02:00
Ondřej Surý
5b5930dca1 Remove #include <config.h> usage from siphash.c and siphash_test.c 2019-07-12 15:28:58 +02:00
Ondřej Surý
dc234e3819 Replace the only memcpy usage with memmove 2019-07-12 15:28:00 +02:00
Ondřej Surý
7615e86fae Add spatch to replace memcpy usage with memmove 2019-07-12 15:27:06 +02:00
Ondřej Surý
5efc32ebae Fix the check-cocci script to scan bin lib fuzz dirs individually, as it was using only the last one 2019-07-12 15:26:48 +02:00
Tinderbox User
98eda76eb6 Merge branch 'prep-release' 2019-07-10 15:00:29 +00:00
Tinderbox User
2e637325ed prep 9.15.2 2019-07-10 14:59:47 +00:00
Witold Krecicki
4b4f33e676 Merge branch '1139-1952-breaks-windows-build' into 'master'
Resolve "!1952 Breaks Windows Build"

Closes #1139

See merge request isc-projects/bind9!2145
2019-07-10 09:18:23 -04:00
Witold Kręcicki
895eabd376 Fix Windows compilation issues with !1952, contributed by Thomas Jach 2019-07-10 12:31:39 +02:00
Witold Krecicki
3cf11418b5 Merge branch 'wpk-fix-compilation-error-statschannel' into 'master'
statschannel.c: declare dnssecsignstat_dump only if it's used (LIBXML2 or LIBJSON is available)

See merge request isc-projects/bind9!2143
2019-07-09 13:19:56 -04:00
Witold Kręcicki
111d08a6ad statschannel.c: declare dnssecsignstat_dump only if it's used (LIBXML2 or LIBJSON is available) 2019-07-09 18:08:49 +02:00
Witold Krecicki
fcabb55942 Merge branch '1038-proper-atomics-use' into 'master'
Resolve "Make proper use of the atomics"

Closes #1038

See merge request isc-projects/bind9!1952
2019-07-09 11:14:49 -04:00
Witold Kręcicki
db8acb4898 CHANGES 2019-07-09 16:11:14 +02:00
Witold Kręcicki
dd7bd1c23f Add --enable-mutex-atomics build to CI 2019-07-09 16:11:14 +02:00
Witold Kręcicki
e56cc07f50 Fix a few broken atomics initializations 2019-07-09 16:11:14 +02:00
Ondřej Surý
81faafd508 lib/ns/stats.c: use isc_refcount_t 2019-07-09 16:11:14 +02:00
Ondřej Surý
0471d1c1ce lib/isc/win32/socket.c: use isc_refcount_t 2019-07-09 16:11:14 +02:00
Ondřej Surý
c0511688b5 lib/isc/task.c: use isc_refcount_t 2019-07-09 16:11:14 +02:00
Ondřej Surý
f1471bc2e1 lib/isc/stats.c: Use ->references instead of ->refs 2019-07-09 16:11:14 +02:00
Ondřej Surý
cbe8034dc8 lib/isc/quota.c: use proper acquire/release/relaxed memory order semantics 2019-07-09 16:11:14 +02:00
Ondřej Surý
244ac0601f lib/isc/counter.c: use isc_refcount_t 2019-07-09 16:11:14 +02:00
Ondřej Surý
81550c67da lib/dns/zt.c: use isc_refcount_t and atomics 2019-07-09 16:11:14 +02:00
Ondřej Surý
3c30d095c4 lib/dns/tsig.c: use isc_refcount_t 2019-07-09 16:11:14 +02:00
Ondřej Surý
2a57d0b00c lib/dns/ssu.c: use isc_refcount_t 2019-07-09 16:11:14 +02:00
Ondřej Surý
38a973a33f lib/dns/sdlz.c:
- use isc_refcount_t
- properly detach from nodes so that we don't destroy objects
  that have non-zero references count
2019-07-09 16:10:53 +02:00
Ondřej Surý
f3577e4635 lib/dns/sdb.c: use isc_refcount_t 2019-07-09 16:09:36 +02:00
Ondřej Surý
9da902a201 lib/dns/resolver.c: use isc_refcount_t and atomics 2019-07-09 16:09:36 +02:00
Ondřej Surý
6622c7a70a lib/dns/masterdump.c: use isc_refcount_t and atomics 2019-07-09 16:09:36 +02:00
Ondřej Surý
1097a209e1 lib/dns/master.c: use isc_refcount_t and atomics 2019-07-09 16:09:36 +02:00
Ondřej Surý
8a128151f9 lib/dns/lib.c: use isc_refcount_t 2019-07-09 16:09:36 +02:00
Ondřej Surý
3dece71b91 lib/dns/nta.c: use isc_refcount_t 2019-07-09 16:09:36 +02:00
Ondřej Surý
f5d3250d90 lib/dns/ecdb.c: use isc_refcount_t 2019-07-09 16:09:36 +02:00
Ondřej Surý
d108e86cc8 lib/dns/dbtable.c: use isc_refcount_t 2019-07-09 16:09:36 +02:00
Witold Kręcicki
757cff6644 lib/dns/cache.c: use isc_refcount_t 2019-07-09 16:09:36 +02:00
Witold Kręcicki
44e2088449 dns/stats.c: use isc_refcount_t 2019-07-09 16:09:36 +02:00
Witold Kręcicki
de73904d03 lib/ns/client: use refcount_t for reference counting 2019-07-09 16:09:36 +02:00
Witold Kręcicki
fc19182e97 lib/ns/lib.c: use isc_refcount_t for reference counting 2019-07-09 16:09:36 +02:00
Witold Kręcicki
92424e23fa Special, for-tests-only, mode with atomics emulated by a mutex-locked variable - useful for finding atomics congestions 2019-07-09 16:09:36 +02:00
Witold Kręcicki
5aeb99786e Properly initialize all atomic variables 2019-07-09 16:09:36 +02:00
Witold Kręcicki
3fcf98c8d3 isc/stats: use isc_refcount_t 2019-07-09 16:09:36 +02:00
Witold Kręcicki
420f84f3f5 isc/timer: use isc_refcount_t 2019-07-09 16:09:36 +02:00
Witold Kręcicki
b56948743a lib/isc/task: use isc_refcount_t 2019-07-09 16:09:36 +02:00
Witold Kręcicki
5d49f0ac39 dns/zt.c: use isc_refcount_t for reference counting 2019-07-09 16:09:36 +02:00
Witold Kręcicki
c434cc69d7 interfacemgr: use isc_refcount_t for reference counting 2019-07-09 16:09:36 +02:00
Witold Kręcicki
5686c33068 Make portentry->refs an isc_refcount_t 2019-07-09 16:09:36 +02:00
Ondřej Surý
8a83592e6a Merge branch 'ondrej/missing-ax_restore_flags-geoip2' into 'master'
Add missing AX_RESTORE_FLAGS([geoip2]) to configure.ac

See merge request isc-projects/bind9!2140
2019-07-09 08:20:45 -04:00
Ondřej Surý
5c0cc1ee8b Add missing AX_RESTORE_FLAGS([geoip2]) to configure.ac 2019-07-09 13:38:56 +02:00
Ondřej Surý
5570f6bbdc Merge branch 'ondrej-disable-freebsd-again' into 'master'
Disable FreeBSD Runner in the CI

See merge request isc-projects/bind9!2138
2019-07-08 09:36:28 -04:00
Ondřej Surý
747736d361 Disable FreeBSD Runner in the CI; it's broken again. 2019-07-08 15:28:28 +02:00
Evan Hunt
2f9ae94296 Merge branch '1112-remove-legacy-geoip' into 'master'
Resolve "Remove legacy GeoIP support in 9.15 after GeoIP2 is merged"

Closes #1112

See merge request isc-projects/bind9!2102
2019-07-04 12:38:26 -04:00
Ondřej Surý
a2e89ff0c1 Get rid of DNS_GEOIP_DATABASE_INIT explicit initializer for geoip dbs
Instead of the explicit struct initializer with all member, rely on the fact
that static variables are explicitly initialized to 0 if not explicitly
initialized.
2019-07-04 08:58:26 -07:00
Evan Hunt
1957bcaa99 remove --with-geoip and change --without-geoip2 to --disable-geoip in CI 2019-07-04 08:58:26 -07:00
Thomas Jach
9ba3e3f1b5 convert geoip to geoip2 in win32utils/Configure 2019-07-04 08:58:26 -07:00
Evan Hunt
3781448c89 use configure --enable-geoip to turn on GeoIP2
- instead of --with-geoip2, use --enable-geoip to turn on the GeoIP
  feature
- --with-maxminddb can be used to set the prefix for maxminddb
2019-07-04 08:58:25 -07:00
Evan Hunt
55cca87d8a add CHANGES note; remove references to legacy GeoIP from documentation 2019-07-04 08:58:20 -07:00
Evan Hunt
787f2a7e03 remove all support for legacy GeoIP 2019-07-04 08:56:45 -07:00
Matthijs Mekking
c01679142a Merge branch '7-matthijs-deprecate-dnssec-lookaside' into 'master'
Deprecate dnssec-lookaside option

Closes #7

See merge request isc-projects/bind9!2104
2019-07-04 08:51:32 -04:00
Evan Hunt
77c2a8bcbd remove spurious commas from docbook 2019-07-04 14:15:07 +02:00
Matthijs Mekking
d1503cbfa2 Deprecate dnssec-lookaside option
Add the CFG_CLAUSEFLAG_DEPRECATED flag to the option so that people are
discouraged from using DLV.
2019-07-04 14:14:28 +02:00
Ondřej Surý
4cacdcc15b Merge branch 'ondrej/kyua.result-location' into 'master'
Use $KYUA_RESULT in kyua report-html invocation for unified file location

See merge request isc-projects/bind9!2127
2019-07-03 13:17:25 -04:00
Ondřej Surý
f56b88f72e Set number of parallel jobs in .gitlab-ci.yml 2019-07-03 19:16:55 +02:00
Ondřej Surý
a2a69725ef Use $KYUA_RESULT in kyua report-html invocation for unified file location 2019-07-03 19:16:55 +02:00
Evan Hunt
ab7036488e Merge branch '1114-windows-build-broken' into 'master'
fix broken windows build

Closes #1114

See merge request isc-projects/bind9!2110
2019-07-03 12:53:18 -04:00
Evan Hunt
81fcde5953 fix broken windows build
The MSVS C compiler requires every struct to have at least one member.
The dns_geoip_databases_t structure had one set of members for
HAVE_GEOIP and a different set for HAVE_GEOIP2, and none when neither
API is in use.

This commit silences the compiler error by moving the declaration of
dns_geoip_databases_t to types.h as an opaque reference, and commenting
out the contents of geoip.h when neither version of GeoIP is enabled.
2019-07-03 12:17:27 -04:00
Ondřej Surý
f7f4eef5c5 Merge branch 'michal/define-ATOMIC_VAR_INIT-on-windows' into 'master'
Define ATOMIC_VAR_INIT() on Windows

See merge request isc-projects/bind9!2125
2019-07-03 11:58:34 -04:00
Michał Kępień
df42771a54 Define ATOMIC_VAR_INIT() on Windows
Commit b104a9bc50 introduced unconditional
use of the ATOMIC_VAR_INIT() macro in bin/dnssec/dnssec-signzone.c even
though that macro is only defined on Unix platforms.  Define it on
Windows systems as well in order to prevent build failures.
2019-07-03 14:27:53 +02:00
Ondřej Surý
590362fa48 Merge branch '1026-make-dnssec-signzone-thread-sanitizer-clean' into 'master'
Resolve "Make dnssec-signzone ThreadSanitizer clean"

Closes #1026

See merge request isc-projects/bind9!1938
2019-07-03 00:20:57 -04:00
Ondřej Surý
00807c03af Protect global init_count variable in rbtdb.c by making it atomic 2019-07-03 00:05:34 -04:00
Ondřej Surý
b104a9bc50 bin/dnssec/dnssec-signzone.c: Protect global variables by making them atomic
Both global shuttingdown and finished bool variables were prone to data race
(as reported by ThreadSanitizer).  The commit makes them both atomic.
2019-07-03 00:05:34 -04:00
Ondřej Surý
49462cf974 Make isc_rwlock.c thread-safe
The ThreadSanitizer found several possible data races in our rwlock
implementation.  This commit changes all the unprotected variables to atomic and
also changes the explicit memory ordering (atomic_<foo>_explicit(..., <order>)
functions to use our convenience macros (atomic_<foo>_<order>).
2019-07-03 00:05:34 -04:00
Mark Andrews
7c95192691 Define ATOMIC_VAR_INIT in isc/stdatomic.h shim 2019-07-03 00:05:34 -04:00
Ondřej Surý
570f358252 Add atomic_compare_exchange_strong_relaxed convenience macro 2019-07-03 00:05:34 -04:00
Ondřej Surý
99d4339093 Merge branch 'ondrej/with-or-without-geoip' into 'master'
Enable GeoIP2 for all builds and enable old GeoIP only for Debian amd64 stretch build

See merge request isc-projects/bind9!2120
2019-07-02 15:08:47 -04:00
Ondřej Surý
9c509c2684 Enable GeoIP2 for all builds and enable old GeoIP only for Debian jessie and Ubuntu xenial builds 2019-07-02 14:53:21 -04:00
Ondřej Surý
f55e4c878b Merge branch 'ondrej/missing-dot-in-job' into 'master'
Add missing dot in .autoconf job template that caused duplicate job

See merge request isc-projects/bind9!2121
2019-07-02 14:22:55 -04:00
Ondřej Surý
3128bd96f7 Add missing dot in .autoconf job template that caused duplicate job 2019-07-02 20:07:02 +02:00
Ondřej Surý
6dad6b57c0 Merge branch 'ondrej/restore-freebsd-runner' into 'master'
Restore the FreeBSD Runner

See merge request isc-projects/bind9!2117
2019-07-02 13:39:49 -04:00
Ondřej Surý
e957825eee Use $(pwd) instead of $CI_PROJECT_DIR to always get absolute path 2019-07-02 15:41:08 +02:00
Ondřej Surý
4d3e7d0b7d Use sudo to setup the interfaces when CI job is not running as root 2019-07-02 15:41:08 +02:00
Evan Hunt
646bb64246 Add FreeBSD 11 GitLab CI Runner 2019-07-02 14:23:37 +02:00
Ondřej Surý
4ae2713640 Merge branch 'ondrej/fix-freebsd-make' into 'master'
Add rules to make sure subdirs are always built before testdirs

See merge request isc-projects/bind9!2116
2019-07-02 06:58:27 -04:00
Ondřej Surý
723433cbc6 Add rules to make sure subdirs are always built before testdirs 2019-07-02 12:32:22 +02:00
Ondřej Surý
1fe0c51f9b Merge branch '1120-remove-so_bsdcompat-usage' into 'master'
Resolve "Remove SO_BSDCOMPAT usage"

Closes #1120

See merge request isc-projects/bind9!2113
2019-07-01 11:12:47 -04:00
Ondřej Surý
9dd11ee258 Add CHANGES note:
5261.  [cleanup]       Remove SO_BSDCOMPAT socket option usage.
2019-07-01 16:19:01 +02:00
Ondřej Surý
209b2e53d1 Remove SO_BSDCOMPAT usage, it's ignore since Linux 2.4
The SO_BSDCOMPAT socket option is no-op since Linux 2.4, see the manpage:

SO_BSDCOMPAT
	Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol
	module in Linux 2.0 and 2.2.  If enabled, ICMP errors received for a UDP
	socket will not be passed to the user program.  In later kernel
	versions, support for this option has been phased out: Linux 2.4
	silently ignores it, and Linux 2.6 generates a kernel warning (printk())
	if a program uses this option.  Linux 2.0 also enabled BSD bug-to-bug
	compatibility options (random header changing, skipping of the broadcast
	flag) for raw sockets with this option, but that was removed in Linux
	2.2.
2019-07-01 16:16:40 +02:00
Matthijs Mekking
1eeda8cd23 Merge branch 'managed-keys-is-deprecated' into 'master'
Mark some managed-keys instances deprecated

See merge request isc-projects/bind9!2105
2019-07-01 04:53:16 -04:00
Matthijs Mekking
a5dc24b25a Mark some managed-keys instances deprecated
The 'managed-keys' (and 'trusted-keys') options have been deprecated
by 'dnssec-keys'.  Some documentation references to 'managed-keys'
had not yet been marked or noted as such.
2019-07-01 10:31:33 +02:00
Michał Kępień
4c0e9d0bdf Merge branch 'michal/add-and-use-keyfile_to_key_id-helper-function' into 'master'
Add and use keyfile_to_key_id() helper function

See merge request isc-projects/bind9!2087
2019-06-28 08:33:29 -04:00
Michał Kępień
7d6eaad1bd Add and use keyfile_to_key_id() helper function
When trying to extract the key ID from a key file name, some test code
incorrectly attempts to strip all leading zeros.  This breaks tests when
keys with ID 0 are generated.  Add a new helper shell function,
keyfile_to_key_id(), which properly handles keys with ID 0 and use it in
test code whenever a key ID needs to be extracted from a key file name.
2019-06-28 14:05:04 +02:00
Michał Kępień
f895e4aaf2 Merge branch '1093-dnstap-read-clear-buffer-before-expanding-it' into 'master'
dnstap-read: clear buffer before expanding it

Closes #1093

See merge request isc-projects/bind9!2049
2019-06-28 07:08:35 -04:00
Michał Kępień
7354207e1b Add CHANGES entry
5260.	[bug]		dnstap-read was producing malformed output for large
			packets. [GL #1093]
2019-06-28 12:43:59 +02:00
Michał Kępień
3549abe81d dnstap-read: clear buffer before expanding it
When printing a packet, dnstap-read checks whether its text form takes
up more than the 2048 bytes allocated for the output buffer by default.
If that is the case, the output buffer is automatically expanded, but
the truncated output is left in the buffer, resulting in malformed data
being printed.  Clear the output buffer before expanding it to prevent
this issue from occurring.
2019-06-28 12:43:51 +02:00
Matthijs Mekking
1dfdedf137 Merge branch '1101-matthijs-checkconf-i' into 'master'
named-checkconf -i: ignore deprecate warnings

Closes #1101

See merge request isc-projects/bind9!2079
2019-06-28 05:50:40 -04:00
Matthijs Mekking
0b8790967e named-checkconf -i: ignore deprecate warnings
Adds a new option to named-checkconf, -i.  If set, named-checkconf
will not warn you about deprecated options.  This allows people
to use named-checkconf in automated deployment precoesses where an
operator only cares if their conf is valid, even if it is not optimal.

This was added as a request as part of introducing a policy on
removing named.conf options.
2019-06-28 11:02:59 +02:00
Evan Hunt
2890c98d4e Merge branch 'each-missing-dbtype' into 'master'
accidentally omitted region from valid dbtypes

See merge request isc-projects/bind9!2100
2019-06-27 23:41:05 -04:00
Evan Hunt
363e6319b7 accidentally omitted region from valid dbtypes 2019-06-27 16:38:21 -07:00
Evan Hunt
11aedb1fae Merge branch '182-geoip2-api' into 'master'
Resolve "Update GeoIP support to new API (GeoLite2 from Maxmind)"

Closes #182

See merge request isc-projects/bind9!2031
2019-06-27 18:12:04 -04:00
Evan Hunt
8854e284fd CHANGES, release note, README 2019-06-27 14:59:14 -07:00
Evan Hunt
c9945d6148 update ARM documentation 2019-06-27 14:59:13 -07:00
Evan Hunt
9a1caf99ef add geoip2 system test 2019-06-27 14:59:13 -07:00
Evan Hunt
6399a70cb4 add GeoIP2 lookups to unit test 2019-06-27 14:59:09 -07:00
Evan Hunt
6e0b93e5a0 implement searching of geoip2 database
- revise mapping of search terms to database types to match the
  GeoIP2 schemas.
- open GeoIP2 databases when starting up; close when shutting down.
- clarify the logged error message when an unknown database type
  is configured.
- add new geoip ACL subtypes to support searching for continent in
  country databases.
- map geoip ACL subtypes to specific MMDB database queries.
- perform MMDB lookups based on subtype, saving state between
  queries so repeated lookups for the same address aren't necessary.
2019-06-27 14:59:03 -07:00
Evan Hunt
fe46d5bc34 add HAVE_GEOIP2 #ifdef branches, without implementing yet 2019-06-27 14:58:14 -07:00
Evan Hunt
fea6b5bf10 add a search for GeoIP2 libraries in configure
- "--with-geoip" is used to enable the legacy GeoIP library.
- "--with-geoip2" is used to enable the new GeoIP2 library
  (libmaxminddb), and is on by default if the library is found.
- using both "--with-geoip" and "--with-geoip2" at the same time
  is an error.
- an attempt is made to determine the default GeoIP2 database path at
  compile time if pkg-config is able to report the module prefix. if
  this fails, it will be necessary to set the path in named.conf with
  geoip-directory
- Makefiles have been updated, and a stub lib/dns/geoip2.c has been
  added for the eventual GeoIP2 search implementation.
2019-06-27 14:58:13 -07:00
Ondřej Surý
cc1292d694 Merge branch '1095-when-gnu-c-compiler-is-used-on-solaris-gnu-ld-must-be-used' into 'master'
Enforce usage -zrelax=transtls when GNU C Compiler is used on Solaris

Closes #1095

See merge request isc-projects/bind9!2053
2019-06-27 07:29:13 -04:00
Ondřej Surý
d584223653 Enforce usage -zrelax=transtls when GNU C Compiler is used on Solaris
When GNU C Compiler is used on Solaris (11), the Thread Local Storage
is completely broken.  The behaviour doesn't manifest when GNU ld is
used.  Thus, we need to enforce usage of GNU ld when GNU C Compiler is
the compiler of choice.

For more background for this change, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90912
2019-06-27 04:18:44 -04:00
Mark Andrews
95a8e42e57 Merge branch '1030-statistics-channel-fixes' into 'master'
Statistics Channel Fixes

Closes #1030

See merge request isc-projects/bind9!1945
2019-06-26 23:20:16 -04:00
Mark Andrews
f8b3aa97df add CHANGES 2019-06-26 14:03:53 -07:00
Mark Andrews
d5c795942f check xsl vs xml 2019-06-26 14:03:53 -07:00
Evan Hunt
ce3907e9fe add odd/even shading to the remaining tables 2019-06-26 14:01:41 -07:00
Mark Andrews
eaba8dd799 remove 'Configured Zones'; add even/odd to zone list 2019-06-26 13:31:58 -07:00
Timothe Litt
96f0bbd4d5 Fix ISC-Bugs 45340: Statschannel XSL for zones, Traffic
In ISC-Bugs 45340, I wrote:

The Statistics channel offers links to Zones and Traffic.
Both produce valid data, but display as blank pages with
a web browser.

Zones never had XSL (I provided the original
implementation, but punted on the XSL).

Traffic has XSL, but it wasn't updated to reflect the
split between IPv4 and IPv6 data.

I've picked up enough XSL to fix my original omission,
and as penance for my sloth, fixed the Traffic bug as well.
2019-06-26 13:31:58 -07:00
Ondřej Surý
d02f807a24 Merge branch '1068-make-libxml2-library-usage-opaque-fixup' into 'master'
Fix printing whether libxml2 is used in the report part of configure.ac

Closes #1068

See merge request isc-projects/bind9!2088
2019-06-26 12:41:48 -04:00
Ondřej Surý
cdace7cac1 Fix printing whether libxml2 is used in the report part of configure.ac 2019-06-26 18:21:24 +02:00
Evan Hunt
e6ef64c385 Merge branch '1092-allow-priming-glue' into 'master'
allow glue in authoritative responses to root priming queries

Closes #1092

See merge request isc-projects/bind9!2045
2019-06-26 12:15:00 -04:00
Evan Hunt
03a6a78b55 CHANGES, release note 2019-06-26 08:54:07 -07:00
Evan Hunt
9a1f0ea873 add system test to confirm glue is returned in priming queries 2019-06-26 08:53:42 -07:00
Evan Hunt
e7684c7b64 allow glue in authoritative responses to root priming queries
- when processing authoritative queries for ./NS, set 'gluedb' so
  that glue will be included in the response, regardless of how
  'minimal-responses' has been configured.
2019-06-26 08:53:42 -07:00
Evan Hunt
2c370d93b4 Merge branch '1109-inline-reload-error' into 'master'
don't overwrite the dns_master_loadfile() result before calling zone_postload()

Closes #1109

See merge request isc-projects/bind9!2084
2019-06-26 11:45:13 -04:00
Evan Hunt
c29e344f07 CHANGES 2019-06-26 08:26:32 -07:00
Evan Hunt
e48b3f1a00 add a test that reloading errors are not ignored 2019-06-26 08:26:32 -07:00
Evan Hunt
0b792bd37b don't overwrite the dns_master_loadfile() result before calling zone_postload()
if "rndc reload" fails, the result code is supposed to be passed to
zone_postload, but for inline-signing zones, the result can be
overwritten first by a call to the ZONE_TRYLOCK macro. this can lead
to the partially-loaded unsigned zone being synced over to the signed
zone instead of being rejected.
2019-06-26 08:26:32 -07:00
Michał Kępień
be492cf28d Merge branch 'michal/prevent-idna-test-failures-with-libidn2-2.2.0' into 'master'
Prevent "idna" test failures with libidn2 2.2.0+

See merge request isc-projects/bind9!2089
2019-06-26 09:00:52 -04:00
Michał Kępień
60ce0ed411 Prevent "idna" test failures with libidn2 2.2.0+
libidn2 2.2.0+ parses Punycode more strictly than older versions and
thus "dig +idnin +noidnout xn--19g" fails with libidn2 2.2.0+ but
succeeds with older versions.

We could preserve the old behavior by using the IDN2_NO_ALABEL_ROUNDTRIP
flag available in libidn2 2.2.0+, but:

  - this change in behavior is considered a libidn2 bug fix [1],
  - we want to make sure dig behaves as expected, not libidn2,
  - implementing that would require additional configure.ac cruft.

Removing the problematic check appears to be the simplest solution as it
does not prevent the relevant block of checks in the "idna" system test
from achieving its purpose, i.e. ensuring dig properly handles invalid
U-labels.

[1] see upstream commit 241e8f486134793cb0f4a5b0e5817a97883401f5
2019-06-26 14:20:17 +02:00
Michał Kępień
8ab398a90d Merge branch '1108-include-stdlib.h-in-lib-dns-dnsrps.c' into 'master'
Include <stdlib.h> in lib/dns/dnsrps.c

Closes #1108

See merge request isc-projects/bind9!2085
2019-06-26 05:06:54 -04:00
Michał Kępień
6cfcc6e8a2 Include <stdlib.h> in lib/dns/dnsrps.c
Since commit 0771dd3be8, <isc/mem.h> no
longer includes <isc/xml.h>.  On some systems (e.g. FreeBSD), this means
that no header included by lib/dns/dnsrps.c (and no header included by
those headers) contains a definition of free() any more, which triggers
a compiler warning as lib/dns/dnsrps.c calls that function.  Add the
missing #include directive to prevent that warning from being triggered.
2019-06-26 08:45:23 +02:00
Michał Kępień
42013c43f3 Merge branch 'michal/remove-nonexistent-function-from-libdns.def.in' into 'master'
Remove nonexistent function from libdns.def.in

See merge request isc-projects/bind9!2083
2019-06-26 01:53:10 -04:00
Michał Kępień
f1c236d95d Remove nonexistent function from libdns.def.in
No function called dns_dnssecsignstats_decrement() actually exists.
Putting it into lib/dns/win32/libdns.def.in breaks at least some Windows
builds.  Remove the nonexistent function from that file.
2019-06-25 22:27:01 +02:00
Michał Kępień
97543354d2 Merge branch 'michal/wait-for-outgoing-transfer-statistics-to-be-logged' into 'master'
Wait for outgoing transfer statistics to be logged

See merge request isc-projects/bind9!2081
2019-06-25 16:15:19 -04:00
Michał Kępień
9fc5e48b14 Wait for outgoing transfer statistics to be logged
Since the message confirming outgoing transfer completion is logged
asynchronously, it may happen that transfer statistics may not yet be
logged by the time the dig command triggering a given transfer returns.
This causes false positives for the "ixfr" and "xfer" system tests.
Prevent this from happening by checking outgoing transfer statistics up
to 10 times, in 1-second intervals.
2019-06-25 21:41:42 +02:00
Ondřej Surý
955732d29c Merge branch '4-rename-OPENSSL_INCLUDES-to-OPENSSL_CFLAGS' into 'master'
Rename OPENSSL_INCLUDES to OPENSSL_CFLAGS in AX_CHECK_OPENSSL() macro

See merge request isc-projects/bind9!2073
2019-06-25 07:10:08 -04:00
Ondřej Surý
5d1e7be582 Rename OPENSSL_INCLUDES to OPENSSL_CFLAGS in AX_CHECK_OPENSSL() macro
The ax_check_openssl m4 macro used OPENSSL_INCLUDES.  Rename the
subst variable to OPENSSL_CFLAGS and wrap AX_CHECK_OPENSSL() in
action-if-not-found part of PKG_CHECK_MODULE check for libcrypto.
2019-06-25 12:36:01 +02:00
Ondřej Surý
32fc6c85f4 Merge branch '1068-make-libxml2-library-usage-opaque' into 'master'
Make the usage of json-c and libxml2 libraries opaque to the caller

Closes #1104 and #1068

See merge request isc-projects/bind9!2074
2019-06-25 06:23:15 -04:00
Ondřej Surý
9badc4dc90 Explicitly enable --with-libxml2 and --with-json-c to test whether pkg-config way works 2019-06-25 12:04:20 +02:00
Ondřej Surý
e3e6888946 Make the usage of json-c objects opaque to the caller
The json-c have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:04:20 +02:00
Ondřej Surý
0771dd3be8 Make the usage of libxml2 opaque to the caller
The libxml2 have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:01:32 +02:00
Matthijs Mekking
11db639945 Merge branch '513-matthijs-dnssec-sign-stats' into 'master'
Resolve "New metrics to report DNSSEC signing operations and IXFRs [ISC-support #13431]"

Closes #513

See merge request isc-projects/bind9!2067
2019-06-25 05:59:28 -04:00
Matthijs Mekking
3a3f40e372 DNSSEC sign metrics: CHANGES, doc, release note
Add some information about the new statistic-channel DNS sign
metrics. Also add a CHANGES and release note entry.
2019-06-25 11:40:36 +02:00
Matthijs Mekking
6f67546cd6 Also collect DNSSEC refresh signature statistics
In addition to gather how many times signatures are created per
key in a zone, also count how many of those signature creations are
because of DNSSEC maintenance.  These maintenance counters are
incremented if a signature is refreshed (but the RRset did not
changed), when the DNSKEY RRset is changed, and when that leads
to additional RRset / RRSIG updates (for example SOA, NSEC).
2019-06-25 11:40:01 +02:00
Matthijs Mekking
a8750a8805 Add tests for DNSSEC sign statistics
This adds tests to the statschannel system test for testing if
the dnskey sign operation counters are incremented correctly.

It tests three cases:

1. A zone maintenance event where all the signatures that are about
   to expire are resigned.
2. A dynamic update event where the new RR and other relevant records
   (SOA, NSEC) are resigned.
3. Adding a standby key, that means the DNSKEY and SOA RRset are
   resigned.
2019-06-25 11:40:01 +02:00
Matthijs Mekking
312fa7f65e Update dnskey sign operations statistics
Update per key tag the stats counter when it creates a new signature.
This can happen upon a dynamic update, or when doing DNSSEC
maintenance.
2019-06-25 11:40:01 +02:00
Matthijs Mekking
d8cf7aedfa Add DNSSEC sign operations statistics channel
Add a new statistics structure to record how many sign operations
a key has made within a zone.
2019-06-25 11:40:01 +02:00
Mark Andrews
e317a675a1 Merge branch 'marka-silence-unchecked-return' into 'master'
silence unchecked return

See merge request isc-projects/bind9!2039
2019-06-24 20:13:24 -04:00
Mark Andrews
134248531c silence unchecked return 2019-06-24 19:50:43 -04:00
Mark Andrews
2b5615b9d7 Merge branch '1098-compile-failure-on-9-11-8-master' into 'master'
Resolve "Compile failure on 9.11.8"

See merge request isc-projects/bind9!2075
2019-06-24 19:48:34 -04:00
Mark Andrews
f77d5599ec add CHANGES
(cherry picked from commit 5c23623094)
2019-06-25 09:48:05 +10:00
Mark Andrews
79eed4e5c6 define ULLONG_MAX if not already defined
(cherry picked from commit 4110b9184d)
2019-06-25 09:47:24 +10:00
Evan Hunt
7d499f8fb8 Merge branch 'u/fanf2/rndc-missing-newline' into 'master'
When a server reload fails, print a note in `rndc status`.

See merge request isc-projects/bind9!2040
2019-06-24 15:35:00 -04:00
Mark Andrews
42173037ee add CHANGES 2019-06-24 11:50:30 -07:00
Tony Finch
8e05e2e9d5 When a server reload fails, print a note in rndc status.
After a failed reload I noticed two problems:

* There was a missing newline in the output of `rndc status` so it
  finished "reload/reconfig in progressserver is up and running"
* The "reconfig in progress" note should have said "reconfig failed"
2019-06-24 11:49:48 -07:00
Mark Andrews
e0dd3757cb Merge branch 'marka-wait-for-zones-to-load' into 'master'
wait for zones to load

See merge request isc-projects/bind9!2027
2019-06-23 21:54:57 -04:00
Mark Andrews
b62e6418b5 wait for zones to load 2019-06-23 21:37:37 -04:00
Ondřej Surý
41915e88cd Merge branch '4-remove-libbind-from-configure' into 'master'
Remove the noop warning when using --with-libbind from configure.ac

See merge request isc-projects/bind9!2069
2019-06-21 13:16:59 -04:00
Ondřej Surý
77db0cb929 Remove the noop warning when using --with-libbind from configure.ac
The configure option --with-libbind was already obsolete, this MR
just removes the warning from configure.ac.
2019-06-21 19:03:01 +02:00
Ondřej Surý
f6ccd59e8b Merge branch '658-dont-override-default-sysconfdir' into 'master'
Get rid of overriding default --sysconfdir and --localstatedir autoconf options

Closes #658

See merge request isc-projects/bind9!1455
2019-06-21 13:01:03 -04:00
Ondřej Surý
a8dd98fbac Get rid of overriding default --sysconfdir and --localstatedir autoconf options
Previously the autoconf script set sysconfdir to /etc and localstatedir to /var
if they were not explicitly set in the ./configure invocation.  This MR reverts
the override and make it more in line with default and generally expected
autoconf behavior.
2019-06-21 18:42:50 +02:00
Ondřej Surý
5aaee26ed0 Merge branch '4-autoreconf-and-maintainer-mode' into 'master'
Add AM_MAINTAINER_MODE to autoconf.ac and re-generate configure in precheck CI step

See merge request isc-projects/bind9!2056
2019-06-21 04:55:49 -04:00
Ondřej Surý
0bdc3df5a0 Run autoreconf -fi in precheck phase and disable maintainer mode in build jobs 2019-06-21 10:37:39 +02:00
Ondřej Surý
2b1131cb28 Add AM_MAINTAINER_MODE macro to configure.ac and enable it by default
AM_MAINTAINER_MODE macro adds ability to disable rebuilding build file
(Makefile.in, configure, ...) when the source file changes.  This is
important in the CI where the timestamps could get skewed and that
triggers the rebuild on every ./configure run.
2019-06-21 10:37:39 +02:00
Ondřej Surý
bc235cf477 Merge branch 'ondrej/unify-unix-and-win32-app.c' into 'master'
Merge unix/app.c and win32/app.c

See merge request isc-projects/bind9!1970
2019-06-21 04:36:45 -04:00
Ondřej Surý
0f9f1ece14 Stop requiring same memory ordering in win32 atomic_compare_exchange functions 2019-06-20 18:52:27 +02:00
Ondřej Surý
28af0de764 isc_app_reload doesn't return value, don't use return() there 2019-06-20 18:52:27 +02:00
Ondřej Surý
5098c95452 Merge unix/app.c and win32/app.c
The differences between two files are very minimal and most of the
code is common.  Merge those two files and use #ifdef WIN32 to include
the right bits on Windows.
2019-06-20 18:52:27 +02:00
Ondřej Surý
00b57b0120 Merge branch '1081-fix-statistics-in-x86-windows-builds' into 'master'
Fix statistics in x86 Windows builds

Closes #1081

See merge request isc-projects/bind9!2025
2019-06-20 12:07:28 -04:00
Michał Kępień
cbb2edb8d3 Add CHANGES entry
5249.	[bug]		Statistics were broken in x86 Windows builds.
			[GL #1081]
2019-06-20 17:49:25 +02:00
Michał Kępień
e21103f2d3 Fix statistics for x86 Windows builds
Using atomic_int_fast64_t variables with atomic functions on x86 does
not cause Visual Studio to report build errors, but such operations
yield useless results.  Since the isc_stat_t type is unconditionally
typedef'd to atomic_int_fast64_t, any code performing atomic operations
on isc_stat_t variables is broken in x86 Windows builds.  Fix by using
the atomic_int_fast32_t type for isc_stat_t in x86 Windows builds.
2019-06-20 17:49:25 +02:00
Ondřej Surý
9e499ddbf6 Merge branch '1094-bump-clientinfomethods-version' into 'master'
Bump DNS_CLIENTINFOMETHODS VERSION and AGE

Closes #1094

See merge request isc-projects/bind9!2051
2019-06-20 07:12:59 -04:00
Brian Conry
39344dfb3e Bump DNS_CLIENTINFOMETHODS_VERSION/_AGE to 2/1 in clientinfo.h
BIND 9.11.0 has bumped DNS_CLIENTINFOMETHODS_VERSION and _AGE to
version 2 and 1 in the dlz_minimal.h because a member was addet to the
dnsclientinfo struct.  It was found out that the new member is not
used anywhere and there are no accessor functions therefore the change
was reverted.

Later on, it was found out that the revert caused some problems to the
users of BIND 9, and thus this changes takes a different approach by
syncing the values other way around.
2019-06-20 12:46:21 +02:00
Ondřej Surý
04961a7e6b Revert "Downgrade the dns_clientinfomethod structure to the version in lib/dns/clientinfo.c"
This reverts commit a6f09b2255.
2019-06-20 12:46:21 +02:00
Evan Hunt
62fd8827c7 Merge branch 'u/fanf2/rsa-1024-delenda-est' into 'master'
Use 2048 bits as the default ZSK RSA key size in dnssec-keygen

Closes #1097

See merge request isc-projects/bind9!2055
2019-06-19 23:31:48 -04:00
Evan Hunt
ac04d7b348 CHANGES 2019-06-19 19:45:06 -07:00
Tony Finch
24f23e7fad Use 2048 bits as the default ZSK RSA key size in dnssec-keygen 2019-06-19 19:39:21 -07:00
Evan Hunt
af7b462b30 Merge branch 'security-master' into 'master'
merge security-master

See merge request isc-projects/bind9!2061
2019-06-19 19:14:43 -04:00
Tinderbox User
14ea08c759 Merge branch 'prep-release' into security-master 2019-06-19 15:36:30 -07:00
Tinderbox User
9bb0b30bc2 prep 9.15.1 2019-06-19 15:36:28 -07:00
Evan Hunt
7dfef18b05 Merge branch '942-security-move-test-inside-lock' into security-master 2019-06-19 15:35:58 -07:00
Evan Hunt
f1b9bd6f07 CHANGES, release note 2019-06-19 15:35:57 -07:00
Mark Andrews
a78a9d37a8 move item_out test inside lock in dns_dispatch_getnext() 2019-06-19 15:35:57 -07:00
Ondřej Surý
95ecdcd762 Merge branch '161-fix-symbol-ordering-in-dns-update_test.c' into 'master'
Fix lib/dns/tests/update_test spurious errors on macOS

Closes #161

See merge request isc-projects/bind9!2050
2019-06-19 08:13:27 -04:00
Ondřej Surý
52f98c5734 Rename mctx in dnstest.c to dt_mctx to prevent any global/local name clashes
The common construct seen in the BIND 9 source is func(isc_mem_t *mctx, ...).
Unfortunately, the dnstest.{h,c} has been using mctx as a global symbol, which
in turn generated a lot of errors when update.c got included in update_test.c.

As a rule of thumb, we should avoid naming global symbols with generic names
(like mctx) and we should prefix them with "namespace" (like dt_mctx).
2019-06-19 13:52:19 +02:00
Ondřej Surý
6a1f24a863 Make CHECK() macro local by moving it from dnstest.h to respective .c files
The CHECK() macro has been defined both in dnstest.h and update.c
files.  This has created a conflict between macro definitions when
including both of the files in update_test.c.  While the CHECK() macro
is convenient for the tests, it has been really used in just two
files, so the MR moves them into those respective .c files.
2019-06-19 13:51:01 +02:00
Ondřej Surý
6713c6703e Fix spurious lib/dns/tests/update_test errors on macOS
lib/dns/tests/update_test was failing on macOS on random occasions.  It
turned out this was a linker problem - it preferred isc_stdtime_get()
from libisc instead of the local version in lib/dns/tests/update_test.c.

Fix by including the original .c file in the unit test.  This has two
benefits:

 a) linking order may no longer cause issues as symbols found in the
    same compilation unit are always preferred,

 b) it allows writing tests for static functions in lib/dns/update.c.
2019-06-19 13:31:43 +02:00
Ondřej Surý
695c997e6f Merge branch 'ondrej/autoconf-use-more-convenience-macros-from-autoconf-archive' into 'master'
Use couple more autoconf convenience macros to cleanup configure.ac

See merge request isc-projects/bind9!2054
2019-06-19 07:21:10 -04:00
Ondřej Surý
a654756c3e Use couple more autoconf convenience macros to cleanup configure.ac
Pull and use several autoconf archive convenience macros to simplify
configure.ac.

* AX_CHECK_COMPILE_FLAG(FLAG, ...) - check whether given CFLAG works
* AX_CHECK_LINK_FLAG(FLAG, ...) - check whether given LDFLAG works
* AX_CHECK_PREPROC_FLAG(FLAG, ...) - check whether give CPPFLAG works
* AX_SAVE_FLAGS/AX_RESTORE_FLAGS - save and restore *FLAGS
2019-06-19 11:35:18 +02:00
Michał Kępień
5a941fbd88 Merge branch '1088-always-fail-a-system-test-if-crashes-are-detected' into 'master'
Always fail a system test if crashes are detected

Closes #1088

See merge request isc-projects/bind9!2041
2019-06-18 03:55:20 -04:00
Michał Kępień
7706f22924 Always fail a system test if crashes are detected
In certain situations (e.g. a named instance crashing upon shutdown in a
system test which involves shutting down a server and restarting it
afterwards), a system test may succeed despite a named crash being
triggered.  This must never be the case.  Extend run.sh to mark a test
as failed if core dumps or log lines indicating assertion failures are
detected (the latter is only an extra measure aimed at test environments
in which core dumps are not generated; note that some types of crashes,
e.g. segmentation faults, will not be detected using this method alone).
2019-06-18 09:14:07 +02:00
Michał Kępień
42cc7f5456 Merge branch 'michal/fix-transfer-statistics-extraction' into 'master'
Fix transfer statistics extraction

See merge request isc-projects/bind9!2038
2019-06-18 03:12:53 -04:00
Michał Kępień
fab67c074a Fix transfer statistics extraction
Make the get_named_xfer_stats() helper shell function more precise in
order to prevent it from matching the wrong lines as that may trigger
false positives for the "ixfr" and "xfer" system tests.  As an example,
the regular expression responsible for extracting the number of bytes
transmitted throughout an entire zone transfer could also match a line
containing the following string:

    transfer of '<zone-name>/IN': sending TCP message of <integer> bytes

However, such a line is not one summarizing a zone transfer.

Also simplify both get_dig_xfer_stats() and get_named_xfer_stats() by
eliminating the need for "echo" statements in them.
2019-06-18 08:51:50 +02:00
Mark Andrews
ea054d024a Merge branch 'marka-cleanup-builtin-config' into 'master'
remove geoip-use-ecs from default config

See merge request isc-projects/bind9!2032
2019-06-17 09:35:58 -04:00
Mark Andrews
b2026bd9e8 remove geoip-use-ecs from default config 2019-06-17 09:24:46 -04:00
Michał Kępień
47c8deee52 Merge branch 'michal/tkey-system-test-fix-key-id-processing' into 'master'
"tkey" system test: fix key ID processing

See merge request isc-projects/bind9!2033
2019-06-17 08:43:18 -04:00
Michał Kępień
0b7b1161c2 Fix key ID processing
If ns1/setup.sh generates a key with ID 0, the "KEYID" token in
ns1/named.conf.in will be replaced with an empty string, causing the
following broken statement to appear in ns1/named.conf:

    tkey-dhkey "server" ;

Such a statement triggers false positives for the "tkey" system test due
to ns1 being unable to start with a broken configuration file.  Fix by
tweaking the regular expression used for removing leading zeros from the
key ID, so that it removes at most 4 leading zeros.
2019-06-17 14:15:18 +02:00
Witold Krecicki
fd8adb1282 Merge branch '1067-underflow-recursing-clients-stats' into 'master'
Resolve "Underflow in Stats Channel RecursClients value?"

Closes #1067

See merge request isc-projects/bind9!2030
2019-06-13 08:19:32 -04:00
Witold Kręcicki
c62a7c88b8 CHANGES note 2019-06-13 13:35:44 +10:00
Witold Kręcicki
24cfee942f Make sure that recursclient gauge is calculated correctly.
We increase recursclients when we attach to recursion quota,
decrease when we detach. In some cases, when we hit soft
quota, we might attach to quota without increasing recursclients
gauge. We then decrease the gauge when we detach from quota,
and it causes the statistics to underflow.
Fix makes sure that we increase recursclients always when we
succesfully attach to recursion quota.
2019-06-13 13:35:44 +10:00
Michał Kępień
cd3b656001 Merge branch 'michal/address-compilation-warnings-for-O3-builds' into 'master'
Address compilation warnings for -O3 builds

See merge request isc-projects/bind9!1994
2019-06-11 04:49:01 -04:00
Michał Kępień
ce796ac1f4 Address GCC 9.1 -O3 compilation warnings
Compiling with -O3 triggers the following warnings with GCC 9.1:

    task.c: In function ‘isc_taskmgr_create’:
    task.c:1384:43: warning: ‘%04u’ directive output may be truncated writing between 4 and 10 bytes into a region of size 6 [-Wformat-truncation=]
     1384 |   snprintf(name, sizeof(name), "isc-worker%04u", i);
          |                                           ^~~~
    task.c:1384:32: note: directive argument in the range [0, 4294967294]
     1384 |   snprintf(name, sizeof(name), "isc-worker%04u", i);
          |                                ^~~~~~~~~~~~~~~~
    task.c:1384:3: note: ‘snprintf’ output between 15 and 21 bytes into a destination of size 16
     1384 |   snprintf(name, sizeof(name), "isc-worker%04u", i);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    private_test.c: In function ‘private_nsec3_totext_test’:
    private_test.c:110:9: warning: array subscript 4 is outside array bounds of ‘uint32_t[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds]
      110 |  while (*sp == '\0' && slen > 0) {
          |         ^~~
    private_test.c:103:11: note: while referencing ‘salt’
      103 |  uint32_t salt;
          |           ^~~~

Prevent these warnings from being triggered by increasing the size of
the relevant array (task.c) and reordering conditions (private_test.c).
2019-06-11 10:18:23 +02:00
Witold Kręcicki
44e6bb8b93 Address GCC 8.3 -O3 compilation warning
Compiling with -O3 triggers the following warning with GCC 8.3:

    driver.c: In function ‘dlz_findzonedb’:
    driver.c:191:29: warning: ‘%u’ directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 99 [-Wformat-truncation=]
      snprintf(buffer, size, "%s#%u", addr_buf, port);
                                 ^~
    driver.c:191:25: note: directive argument in the range [0, 65535]
      snprintf(buffer, size, "%s#%u", addr_buf, port);
                             ^~~~~~~
    driver.c:191:2: note: ‘snprintf’ output between 3 and 106 bytes into a destination of size 100
      snprintf(buffer, size, "%s#%u", addr_buf, port);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Increase the size of the relevant array to prevent this warning from
being triggered.
2019-06-11 10:18:23 +02:00
Michał Kępień
3569487875 Make some build jobs use -O3 optimizations
Change the compiler optimization level for Debian sid build jobs from
-O2 to -O3 in order to enable triggering compilation warnings which are
not raised when -O2 is used.
2019-06-11 10:18:23 +02:00
Witold Krecicki
1eb7a9e10b Merge branch '1070-fix-zonemgr-unreachablecache' into 'master'
Resolve "Use zonemgr unreachable cache more effectively"

Closes #1070

See merge request isc-projects/bind9!2017
2019-06-11 03:58:22 -04:00
Ondřej Surý
3dcf121064 Put the items into unreachable LRU cache from first to last, not last to first 2019-06-11 09:38:59 +02:00
Witold Kręcicki
5adc0baaca Add Gitlab CI job with pthread_rwlock 2019-06-11 09:38:59 +02:00
Witold Kręcicki
68eb9a7c6a In dns_zonemgr_unreachable use atomics to avoid unnecessary
write locking.

Unreachable cache in zonemgr is realized as an static LRU list.
When we 'use' an entry we need to update the last-used time, we
can use atomics to do so without the necessity to upgrading
read-lock to write-lock.
2019-06-11 09:38:59 +02:00
Evan Hunt
34db730ee3 Merge branch '1082-fix-symtab-error' into 'master'
allocate memory for symtab keys

Closes #1082

See merge request isc-projects/bind9!2026
2019-06-10 21:56:54 -04:00
Evan Hunt
8136b09fa8 allocate memory for symtab keys
this prevents an intermittent failure when conflicts between
static and initializing keys are not detected by named-checkconf.
2019-06-10 18:39:53 -07:00
Witold Krecicki
90ff5a551a Merge branch 'wpk/git-replay-merge-worktrees' into 'master'
util/git-replay-merge.sh: make the tool compatible with git worktrees

See merge request isc-projects/bind9!1985
2019-06-10 10:51:01 -04:00
Witold Kręcicki
db87352742 util/git-replay-merge.sh: make the tool compatible with git worktrees 2019-06-10 16:32:13 +02:00
Evan Hunt
32c86e29e2 Merge branch 'each-pandoc-args' into 'master'
specify title metadata and markdown format when calling pandoc

See merge request isc-projects/bind9!2022
2019-06-10 00:29:24 -04:00
Evan Hunt
3663f61e0e specify title metadata and markdown format when calling pandoc
this change silences a warning message and prevents the unwanted
use of smart quotes when using pandoc 2.7.1 to generate human-readable
versions of README and other markdown files.
2019-06-09 21:26:55 -07:00
Evan Hunt
8975a0830b Merge branch 'michal/minor-doc-fixes' into 'master'
Minor doc fixes

See merge request isc-projects/bind9!2018
2019-06-10 00:21:21 -04:00
Stephen Morris
d47c1d5dd0 Tweak paragraph style in release notes PDF 2019-06-07 08:37:22 +02:00
Stephen Morris
644a2197f4 Fix typos in README and release notes 2019-06-07 08:37:22 +02:00
Mark Andrews
8ceaa19698 Merge branch 'marka-capture-checkconf-output' into 'master'
capture named-checkconf output

See merge request isc-projects/bind9!2014
2019-06-06 04:13:56 -04:00
Mark Andrews
36dd373ab4 capture named-checkconf output 2019-06-06 13:04:34 +10:00
Mark Andrews
0a8c47bae5 Merge branch 'marka-rndc-manpage-fix' into 'master'
add missing word 'includes'

See merge request isc-projects/bind9!2011
2019-06-05 19:20:28 -04:00
Mark Andrews
c6553eb3fc add missing word 'includes' 2019-06-06 09:07:18 +10:00
Evan Hunt
fd4e3a650d Merge branch '1064-fix-pthread-rwlock' into 'master'
Resolve "Adding --enable-pthread-rwlock broke Windows build"

Closes #1064

See merge request isc-projects/bind9!2009
2019-06-05 14:29:40 -04:00
Ondřej Surý
d45f9e413f Enforce pthread rwlock to be only enabled in developer mode 2019-06-05 11:17:19 -07:00
Ondřej Surý
ac3d9b97a3 Fix Windows build by moving #include <pthread.h> to correct #ifdef block 2019-06-05 11:17:19 -07:00
Ondřej Surý
1e2f40d01b Fixup the atomic code in pthread_rwlock branch of lib/isc/rwlock.c 2019-06-05 11:17:19 -07:00
Evan Hunt
48f16f223c Merge branch '6-deprecate-trusted-keys' into 'master'
Resolve "Merge trusted-key and managed-keys"

Closes #6

See merge request isc-projects/bind9!659
2019-06-05 11:15:43 -04:00
Evan Hunt
a363455b58 CHANGES, release notes 2019-06-05 07:54:27 -07:00
Evan Hunt
3853b3cf6d update documentation
- change references to trusted-keys to dnssec-keys with static-key
- rebuild doc/misc/options and other generated grammar doc
- add a "see MANAGED-KEYS" note when building named.conf.docbook
2019-06-05 07:49:57 -07:00
Evan Hunt
d07053c8f6 fail if using both dnssec-keys and managed-keys in the same config 2019-06-05 07:49:57 -07:00
Evan Hunt
0ef5b8edb7 rename keyfile_to_*_keys system test shell functions
- keyfile_to_trusted_keys -> keyfile_to_static_keys
- keyfile_to_managed_keys -> keyfile_to_initial_keys
2019-06-05 07:49:57 -07:00
Evan Hunt
821f041d8c "dnssec-keys" is now a synonym for "managed-keys"
- managed-keys is now deprecated as well as trusted-keys, though
  it continues to work as a synonym for dnssec-keys
- references to managed-keys have been updated throughout the code.
- tests have been updated to use dnssec-keys format
- also the trusted-keys entries have been removed from the generated
  bind.keys.h file and are no longer generated by bindkeys.pl.
2019-06-05 07:49:57 -07:00
Evan Hunt
fec032588b update irs_dnsconf_load() to read managed-keys statements
- this allows the use of both trusted-keys and managed-keys in files
  loaded by libirs, but managed-keys are always treated as static.
2019-06-05 07:49:57 -07:00
Evan Hunt
82f5bce1bb update key checks in lib/bind9/check.c and fix checkconf test
- any use of trusted or static keys for the root zone will now
  elicit a warning, regardless of what the keys may be
- ditto for any use of a key for dlv.isc.org, static or managed
2019-06-05 07:49:57 -07:00
Evan Hunt
a00e54cf0e revise system tests to use "static-key" syntax instead of "trusted-keys" 2019-06-05 07:49:57 -07:00
Evan Hunt
5ab252183b deprecate "trusted-keys"
- trusted-keys is now flagged as deprecated, but still works
- managed-keys can be used to configure permanent trust anchors by
  using the "static-key" keyword in place of "initial-key"
- parser now uses an enum for static-key and initial-key keywords
2019-06-05 07:49:23 -07:00
Mark Andrews
977dc54ef6 Merge branch 'u/fanf2/cleanup-cleaning-interval' into 'master'
Remove `cleaning-interval` remnants.

See merge request isc-projects/bind9!1731
2019-06-04 23:54:57 -04:00
Tony Finch
a9dca5831b Remove cleaning-interval remnants.
Since 2008, the cleaning-interval timer has been documented as
"effectively obsolete" and disabled in the default configuration with
a comment saying "now meaningless".

This change deletes all the code that implements the cleaning-interval
timer, except for the config parser in whcih it is now explicitly
marked as obsolete.

I have verified (using the deletelru and deletettl cache stats) that
named still cleans the cache after this change.
2019-06-05 13:08:12 +10:00
Mark Andrews
e43925f284 Merge branch '1058-also-log-the-tsig-name-when-sending-notify' into 'master'
Resolve "Also log the TSIG name when sending notify"

Closes #1058

See merge request isc-projects/bind9!1963
2019-06-04 20:34:58 -04:00
Mark Andrews
e1e800dd40 add CHANGES 2019-06-05 10:18:36 +10:00
Mark Andrews
0dd6c2be70 check that TSIG is logged in sending notify message 2019-06-05 10:18:36 +10:00
Mark Andrews
bb51694d03 log TSIG key name when sending notify 2019-06-05 10:18:36 +10:00
Mark Andrews
9aac7f52f8 Merge branch '884-patches-to-review-6' into 'master'
Check all RSA algorithms for weak keys.

Closes #884

See merge request isc-projects/bind9!1535
2019-06-04 19:19:22 -04:00
Mark Andrews
30a50f9be4 check all RSA algorithms for weak keys 2019-06-05 09:00:05 +10:00
Mark Andrews
56106437b0 Merge branch '1066-macports-uses-opt-local-as-its-openssl-location' into 'master'
Resolve "MacPorts uses /opt/local as its OpenSSL location"

Closes #1066

See merge request isc-projects/bind9!2005
2019-06-04 04:13:29 -04:00
Mark Andrews
8973d4bd16 add /opt/local to list of locations for OpenSSL 2019-06-04 03:58:25 -04:00
Mark Andrews
9279641496 Merge branch '1063-pkcs11_test-is-not-being-expanded' into 'master'
Resolve "@PKCS11_TEST@ is not being expanded"

Closes #1063

See merge request isc-projects/bind9!2000
2019-06-04 03:57:43 -04:00
Mark Andrews
fbd9c5c97f make PKCS11_TEST unix only 2019-06-04 03:45:41 -04:00
Mark Andrews
56e1b76a88 Merge branch '1017-remove-dead-stores' into 'master'
Resolve "remove dead stores"

Closes #1017

See merge request isc-projects/bind9!1926
2019-06-04 01:39:24 -04:00
Mark Andrews
4e97f7dccc POST(optlen) 2019-06-04 01:23:01 -04:00
Mark Andrews
1bbba52750 Merge branch 'cppcheck-and-cmocka-false-positive' into 'master'
teach clang analyser that _assert_int_equal and _assert_int_not_equal don't return on failure

See merge request isc-projects/bind9!1807
2019-06-03 23:24:23 -04:00
Mark Andrews
5d5d751c7f teach cppcheck that _assert_int_equal and _assert_int_not_equal don't return on failure 2019-06-03 23:04:10 -04:00
Michał Kępień
ce52ac1178 Merge branch '1048-make-isc-endian.h-more-portable' into 'master'
Make <isc/endian.h> more portable

Closes #1049, #1048, and #856

See merge request isc-projects/bind9!2001
2019-06-03 08:27:06 -04:00
Michał Kępień
c0e0643fc5 Make ifconfig.sh work on DragonFly BSD
On DragonFly BSD, use the same commands for configuring network
interfaces used during system tests as on NetBSD and OpenBSD.
2019-06-03 14:13:23 +02:00
Ondřej Surý
14ecd7d79e Revise the Windows section of <isc/endian.h>
Add a comment and remove redundant definitions.
2019-06-03 14:13:23 +02:00
Ondřej Surý
7e05848870 Revise the macOS section of <isc/endian.h>
Move the macOS section of <isc/endian.h> to a lower spot as it is
believed not to be the most popular platform for running BIND.  Add a
comment and remove redundant definitions.
2019-06-03 14:13:23 +02:00
Ondřej Surý
2e54b1be29 Make <isc/endian.h> detect GNU rather than Linux
Instead of only supporting Linux, try making <isc/endian.h> support
other GNU platforms as well.  Since some compilers define __GNUC__ on
BSDs (e.g. Clang on FreeBSD), move the relevant section to the bottom of
the platform-specific part of <isc/endian.h>, so that it only gets
evaluated when more specific platform determination criteria are not
met.  Also include <byteswap.h> so that any byte-swapping macros which
may be defined in that file on older platforms are used in the fallback
definitions of the nonstandard hto[bl]e{16,32,64}() and
[bl]e{16,32,64}toh() conversion functions.
2019-06-03 14:13:23 +02:00
Ondřej Surý
387cc00121 Add Solaris support for <isc/endian.h>
While Solaris does not support the nonstandard hto[bl]e{16,32,64}() and
[bl]e{16,32,64}toh() conversion functions, it does have some
byte-swapping macros available in <sys/byteorder.h>.  Ensure these
macros are used in the fallback definitions of the aforementioned
nonstandard functions.
2019-06-03 14:13:23 +02:00
Ondřej Surý
85059c2937 Add fallback definitions to <isc/endian.h>
Since the hto[bl]e{16,32,64}() and [bl]e{16,32,64}toh() conversion
functions are nonstandard, add fallback definitions of these functions
to <isc/endian.h>, so that their unavailability does not prevent
compilation from succeeding.
2019-06-03 14:13:23 +02:00
Michał Kępień
7ab1fb2a8d Fix <isc/endian.h> on BSD systems
Current versions of DragonFly BSD, FreeBSD, NetBSD, and OpenBSD all
support the modern variants of functions converting values between host
and big-endian/little-endian byte order while older ones might not.
Ensure <isc/endian.h> works properly in both cases.
2019-06-03 14:13:23 +02:00
Michał Kępień
b675ace6c9 Merge branch 'michal/smartsign-system-test-properly-detect-presence-of-cds-cdnskey-records' into 'master'
"smartsign" system test: properly detect presence of CDS/CDNSKEY records

See merge request isc-projects/bind9!1988
2019-06-03 07:59:08 -04:00
Michał Kępień
d0a73c7da6 Properly detect presence of CDS/CDNSKEY records
Replace grep calls with awk scripts to more precisely detect presence of
CDS and CDNSKEY records in a signed zone file, in order to prevent rare
false positives for the "smartsign" system test triggered by the strings
"CDS" and/or "CDNSKEY" being accidentally present in the Base64 form of
DNSSEC-related data in the zone file being checked.
2019-06-03 13:43:29 +02:00
Mark Andrews
bae12f569d Merge branch '1009-isc-support-13911-ixfr-requests-sometimes-have-ending-logged-but-not-start' into 'master'
Resolve "[ISC-support #13911] IXFR requests sometimes have ending logged but not start"

Closes #1009

See merge request isc-projects/bind9!1887
2019-06-03 01:32:29 -04:00
Evan Hunt
aca283919d CHANGES 2019-06-03 15:15:16 +10:00
Mark Andrews
915af3c950 change mnemonic for IXFR poll response 2019-06-03 15:14:45 +10:00
Mark Andrews
043df1be12 lower ixfr stop messages log level to debug(1) for poll style responses 2019-06-03 15:14:45 +10:00
Evan Hunt
62bc30e08f Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1999
2019-06-01 03:50:27 -04:00
Evan Hunt
9a2c4bf11e placeholder 2019-06-01 00:49:41 -07:00
Evan Hunt
86f60c0807 Merge branch 'each-fix-typo' into 'master'
fix typo

See merge request isc-projects/bind9!1997
2019-05-31 19:26:48 -04:00
Evan Hunt
1a980e8124 fix typo 2019-05-31 16:26:03 -07:00
Evan Hunt
ab85681c11 Merge branch '1061-update-supported-rfc-list' into 'master'
Resolve "update supported RFC list"

Closes #1061

See merge request isc-projects/bind9!1972
2019-05-31 19:18:48 -04:00
Mark Andrews
2846465719 add RFC6944 2019-05-31 16:17:30 -07:00
Mark Andrews
af356955e2 update RFC compliance document 2019-05-31 16:17:30 -07:00
Evan Hunt
28323f5ebf Merge branch '943-race-in-dispatcher-socket' into 'master'
Fix a possible race between udp dispatch and socket code

Closes #943

See merge request isc-projects/bind9!1992
2019-05-31 15:31:58 -04:00
Witold Kręcicki
e56d95847b CHANGES 2019-05-31 11:22:08 -07:00
Witold Kręcicki
e517c18d98 Fix a possible race between udp dispatch and socket code
There's a small possibility of race between udp dispatcher and
socket code - socket code can still hold internal reference to a
socket while dispatcher calls isc_socket_open, which can cause
an assertion failure. Fix it by relaxing the assertion test, and
instead simply locking the socket in isc_socket_open.
2019-05-31 11:21:28 -07:00
Witold Krecicki
126b3e0bd7 Merge branch '1055-qname-minimization-relaxed-lame' into 'master'
Don't SERVFAIL on lame delegations when doing qname minimization in relaxed mode

Closes #1055

See merge request isc-projects/bind9!1962
2019-05-31 03:11:27 -04:00
Evan Hunt
6d6e94bee7 fixup! Use experimental "_ A" minimization in relaxed mode. 2019-05-30 14:06:56 -07:00
Evan Hunt
8783735f89 CHANGES 2019-05-30 14:06:55 -07:00
Witold Kręcicki
ae52c2117e Use experimental "_ A" minimization in relaxed mode.
qname minimization, even in relaxed mode, can fail on
some very broken domains. In relaxed mode, instead of
asking for "foo.bar NS" ask for "_.foo.bar A" to either
get a delegation or NXDOMAIN. It will require more queries
than regular mode for proper NXDOMAINs.
2019-05-30 14:06:55 -07:00
Witold Kręcicki
2691e729f0 Don't SERVFAIL on lame delegations when doing minimization in relaxed mode.
qname minimization in relaxed mode should fall back to regular
resolution in case of failure.
2019-05-30 12:38:18 -07:00
Ondřej Surý
6c6d93b29d Merge branch 'wpk-pthread-rwlock-optional' into 'master'
configure option to use pthread_rwlock instead of internal implementation

See merge request isc-projects/bind9!1397
2019-05-30 10:28:43 -04:00
Witold Kręcicki
02bbf1e2b9 Add --enable-pthread-rwlock option 2019-05-30 16:10:16 +02:00
Ondřej Surý
4501f646ee Implement isc_rwlock_downgrade using pthreads and single atomic_bool 2019-05-30 16:10:16 +02:00
Ondřej Surý
64fbffbbaa Use simple pthread_rwlock in place of our custom adaptive rwlock 2019-05-30 16:10:16 +02:00
Ondřej Surý
158ab9afd4 Merge branch 'ondrej/enable-nolibtool-build-in-CI' into 'master'
Enable nolibtool build in CI

See merge request isc-projects/bind9!1953
2019-05-30 09:12:27 -04:00
Ondřej Surý
22fda5c719 bin/named/main.c: clean possibly uninitalized variable in save_command_line() 2019-05-30 14:42:37 +02:00
Ondřej Surý
a25aa889e1 Fix uninitialized variable warning in restore_nsec3param() 2019-05-30 14:42:37 +02:00
Ondřej Surý
5bc68d16e2 Add nolibtool CI job 2019-05-30 14:42:37 +02:00
Mark Andrews
4cd01cd7c5 Merge branch '225-ed448-broken-with-openssl-1-1-1-pre6' into 'master'
Fix ASN.1 length values in Ed448 public and private key prefix blobs.

Closes #225

See merge request isc-projects/bind9!1971
2019-05-30 08:39:39 -04:00
Mark Andrews
6c499a0c08 add CHANGES note 2019-05-30 18:03:10 +10:00
Mark Andrews
20f2d9b41b test Ed448 against test vectors 2019-05-30 18:00:31 +10:00
Mark Andrews
5da97eeea6 fix Ed448 length values for precomputed ASN.1 prefix blobs 2019-05-30 18:00:31 +10:00
Mark Andrews
4157e6ab73 Merge branch '1011-use-proper-linker-config-on-hp-ux' into 'master'
Resolve "Use proper linker (config) on HP-UX"

Closes #1011

See merge request isc-projects/bind9!1940
2019-05-29 20:30:00 -04:00
Mark Andrews
92325d3150 regen 2019-05-29 20:11:21 -04:00
Mark Andrews
61752bf8ac add link flags for ia64-hp-hpux 2019-05-29 20:11:21 -04:00
Ondřej Surý
ebbedd6c03 Merge branch '996-revert-wrong-key-id-is-displayed-for-rsamd5-keys' into 'master'
Revert "Merge branch '996-wrong-key-id-is-displayed-for-rsamd5-keys' into 'master'"

Closes #996

See merge request isc-projects/bind9!1981
2019-05-29 10:14:21 -04:00
Ondřej Surý
52a8fb31c7 Revert "Merge branch '996-wrong-key-id-is-displayed-for-rsamd5-keys' into 'master'"
This reverts commit ea131d2e6a, reversing
changes made to e79dd268b6.
2019-05-29 15:34:08 +02:00
Ondřej Surý
bdde335cca Merge branch '855-json-c-library-detection-in-autoconf' into 'master'
Cleanup the way we detect json-c library to use only pkg-config

Closes #855

See merge request isc-projects/bind9!1473
2019-05-29 09:23:29 -04:00
Ondřej Surý
9c47bad86a Add CHANGES and release notes 2019-05-29 15:08:52 +02:00
Ondřej Surý
4d2d3b49ce Cleanup the way we detect json-c library to use only pkg-config 2019-05-29 15:08:52 +02:00
Ondřej Surý
d54f3f8b8c Merge branch '1044-fix-LFS-flags-on-BSDs' into 'master'
Pull the values for LFS_{CFLAGS,LDFLAGS,LIBS} from autoconf instead using them directly in make

Closes #1044

See merge request isc-projects/bind9!1978
2019-05-29 06:03:34 -04:00
Ondřej Surý
d4596baed4 Pull the values for LFS_{CFLAGS,LDFLAGS,LIBS} from autoconf instead using them directly in make 2019-05-29 11:50:24 +02:00
Michał Kępień
4419d7bf6b Merge branch 'michal/legacy-system-test-fixes' into 'master'
"legacy" system test fixes

See merge request isc-projects/bind9!1968
2019-05-29 05:33:50 -04:00
Michał Kępień
47b850348c Optimize dig parameters to decrease test run time
Performing server setup checks using "+tries=3 +time=5" is redundant as
a single query is arguably good enough for determining whether a given
named instance was set up properly.  Only use multiple queries with a
long timeout for resolution checks in the "legacy" system test, in order
to significantly reduce its run time (on a contemporary machine, from
about 1m45s to 0m40s).
2019-05-29 11:05:01 +02:00
Michał Kępień
bb939a03ff Make "plain" server setup checks more similar
Send a test TCP query to the "plain" server during its setup check to
improve its consistency with the setup check for the "plain + no TCP"
server.
2019-05-29 11:05:01 +02:00
Michał Kępień
56ed1275c6 Add more EDNS checks for dig output files
In the "legacy" system test, in order to make server setup checks more
consistent with each other, add further checks for either presence or
absence of the EDNS OPT pseudo-RR in the responses returned by the
tested named instances.
2019-05-29 11:05:01 +02:00
Michał Kępień
4dea5cb799 Do not ignore dig exit codes
Make sure the "legacy" system test fails if any exit code returned by
dig does not match the expected one.
2019-05-29 11:05:01 +02:00
Michał Kępień
effd16ab25 Use helper functions for checking resolution
Extract repeated dig and grep calls into two helper shell functions,
resolution_succeeds() and resolution_fails(), in order to reduce code
duplication in the "legacy" system test, emphasize the similarity
between all the resolution checks in that test, and make the conditions
for success and failure uniform for all resolution checks in that test.
2019-05-29 11:05:01 +02:00
Michał Kępień
aaf81ca6ef Use +dnssec instead of separate TXT records
When testing named instances which are configured to drop outgoing UDP
responses larger than 512 bytes, querying with DO=1 may be used instead
of querying for large TXT records as the effect achieved will be
identical: an unsigned response for a SOA query will be below 512 bytes
in size while a signed response for the same query will be over 512
bytes in size.  Doing this makes all resolution checks in the "legacy"
system test more similar.  Add checks for the TC flag being set in UDP
responses which are expected to be truncated to further make sure that
tested named instances behave as expected.
2019-05-29 11:05:01 +02:00
Michał Kępień
3e7fa15ca3 Fix the name of the file to inspect
One of the checks in the "legacy" system test inspects dig.out.1.test$n
instead of dig.out.2.test$n.  Fix the file name used in that check.
2019-05-29 11:05:01 +02:00
Michał Kępień
6283c1cc7e Ensure queries expected to time out really do
Make sure that the "legacy" system test fails if queries which are
expected to time out do not really time out.
2019-05-29 11:05:01 +02:00
Michał Kępień
9491616e5c Properly test servers with TCP support disabled
Sending TCP queries to test named instances with TCP support disabled
should cause dig output to contain the phrase "connection refused", not
"connection timed out", as such instances never open the relevant
sockets.  Make sure that the "legacy" system test fails if the expected
phrase is not found in any of the relevant files containing dig output.
2019-05-29 11:05:01 +02:00
Ondřej Surý
db9cfde1ab Merge branch '1044-include-config.h-in-gen.c' into 'master'
Resolve "gen fails to generate headers on Debian buster"

Closes #1044

See merge request isc-projects/bind9!1954
2019-05-29 04:30:11 -04:00
Ondřej Surý
4c7345bcb6 Use getconf LFS_{CFLAGS,LDFLAGS,LIBS} to get flags to compile lib/dns/gen
On some systems (namely Debian buster armhf) the readdir() call fails
with `Value too large for defined data type` unless the
_FILE_OFFSET_BITS=64 is defined.  The correct way to fix this is to
get the appropriate compilation parameters from getconf system
interface.
2019-05-29 06:58:41 +02:00
Ondřej Surý
05b7c08a16 Exit the ./gen program on failed readdir() call 2019-05-27 16:13:16 +02:00
Mark Andrews
fa806cc7b3 Merge branch '1056-misleading-error-message-when-trying-to-build-without-python-support' into 'master'
Resolve "Misleading error message when trying to build without Python support"

Closes #1056

See merge request isc-projects/bind9!1964
2019-05-26 23:35:46 -04:00
Mark Andrews
d70bf76d80 fix configire error message to say --without-python 2019-05-27 13:19:25 +10:00
Witold Krecicki
571f0beee0 Merge branch '1046-deadlock-in-tcp-code' into 'master'
Fix a possible deadlock in TCP accepting

Closes #1046

See merge request isc-projects/bind9!1958
2019-05-24 03:29:44 -04:00
Witold Kręcicki
75815c1581 Fix a possible deadlock in TCP accepting
Each network thread holds an array of locks, indexed by a hash
of fd. When we accept a connection we hold a lock in accepting thread.
We then generate the thread number and lock bucket for the new
connection socket - if we hit the same thread and lock bucket as
accepting socket we get a deadlock. Avoid this by checking if we're
in the same thread/lock bucket and not locking in this case.
2019-05-24 03:18:41 -04:00
Mark Andrews
4d498b3dac Merge branch '1050-build-failure-on-windows' into 'master'
Resolve "Build failure on Windows"

Closes #1050

See merge request isc-projects/bind9!1959
2019-05-24 02:39:13 -04:00
Mark Andrews
505ec918d7 include <isc/string.h> for isc_string_strerror_r prototype 2019-05-24 16:27:40 +10:00
Mark Andrews
978a37c827 use atomics in lib/isc/win32/app.c 2019-05-24 16:27:40 +10:00
Mark Andrews
8ddc54e200 Merge branch '1028-dig-trace-should-not-set-rd-0-norecurse-for-the-initial-root-hints-query' into 'master'
Resolve "dig +trace should not set RD=0 (+norecurse) for the initial root hints query"

Closes #1028

See merge request isc-projects/bind9!1939
2019-05-21 23:13:18 -04:00
Mark Andrews
e65d4989a1 Recurse to find the root server list with 'dig +trace'. 2019-05-22 13:02:15 +10:00
Ondřej Surý
00ff786384 Merge branch '605-add-siphash24' into 'master'
Add SipHash24 algorithm and use it in isc_hash function

Closes #360

See merge request isc-projects/bind9!1462
2019-05-21 07:50:25 -04:00
Ondřej Surý
dc9543abb3 Add CHANGES entry:
5236.   [func]          Add SipHash 2-4 implementation in lib/isc/siphash.c
                        and switch isc_hash_function() to use SipHash 2-4.
                        [GL #605]
2019-05-21 10:23:20 +00:00
Ondřej Surý
d5055665ca Remove isc_hash_reverse function 2019-05-21 10:23:17 +00:00
Ondřej Surý
2e7d82443f Convert isc_hash functions to use isc_siphash24 2019-05-21 10:23:13 +00:00
Ondřej Surý
2cbf633192 Add tests for the isc_siphash24 function 2019-05-20 19:01:31 +02:00
Ondřej Surý
a197df137a Add reference SipHash 2-4 implementation 2019-05-20 19:01:31 +02:00
Ondřej Surý
0efc36c19a Add portable <isc/endian.h> header 2019-05-20 19:01:31 +02:00
Ondřej Surý
efff347f96 Merge branch '1023-make-app.c-TSAN-clean' into 'master'
Make isc_app_t opaque and thread-safe

Closes #1023

See merge request isc-projects/bind9!1936
2019-05-20 13:00:19 -04:00
Ondřej Surý
93aa9766e5 Add CHANGES entry:
5235.   [cleanup]       Refactor lib/isc/app.c to be thread-safe, unused
                        parts of the API has been removed and the
                        isc_appctx_t data type has been changed to be
                        fully opaque. [GL #1023]
2019-05-20 18:39:28 +02:00
Ondřej Surý
eb8c9bdd55 Make lib/isc/app.c opaque and thread-safe
This work cleans up the API which includes couple of things:

1. Make the isc_appctx_t type fully opaque

2. Protect all access to the isc_app_t members via stdatomics

3. sigwait() is part of POSIX.1, remove dead non-sigwait code

4. Remove unused code: isc_appctx_set{taskmgr,sockmgr,timermgr}
2019-05-20 18:13:02 +02:00
Evan Hunt
4d30aee3e2 Merge branch 'each-document-bug-ids' into 'master'
update README to explain gitlab numbers

See merge request isc-projects/bind9!1946
2019-05-17 02:43:38 -04:00
Evan Hunt
45d76498d9 update README to explain gitlab numbers 2019-05-17 02:28:47 -04:00
Ondřej Surý
316b399f95 Merge branch '1003-SO_REUSEPORT-tweaks' into 'master'
Resolve "socket.c error 'SO_REUSEPORT' undeclared"

Closes #1003

See merge request isc-projects/bind9!1884
2019-05-17 01:37:48 -04:00
Ondřej Surý
94cb73d96c Use SO_REUSEPORT_LB on FreeBSD if available 2019-05-15 07:30:23 +02:00
Ondřej Surý
1c672367a0 Add safeguard against the other usage of SO_REUSEPORT 2019-05-15 07:30:23 +02:00
Ondřej Surý
e02228125e Merge branch 'ondrej/add-all-isc-atomic-defines' into 'master'
Add most useful relaxed and acquire-relase stdatomic convenience macros

See merge request isc-projects/bind9!1935
2019-05-13 03:03:17 -04:00
Ondřej Surý
ab389695b0 Add most useful relaxed and acquire-relase stdatomic convenience macros
The header file <isc/atomic.h> now contains convenience macros for
most useful explicit memory ordering for C11 stdatomics, only relaxed
and acquire-release semantics is being used.  These macros SHOULD be
used instead of atomic_<func>_explicit functions.
2019-05-13 12:17:21 +07:00
Ondřej Surý
976d62aa23 Merge branch '899-remove-unspec' into 'master'
Remove UNSPEC rrtype

Closes #899

See merge request isc-projects/bind9!1931
2019-05-12 23:51:14 -04:00
Witold Kręcicki
a8e2ca6f7d Remove UNSPEC rrtype 2019-05-13 10:05:03 +07:00
Mark Andrews
de49b26eb0 Merge branch '981-armv5-build-is-broken' into 'master'
Resolve "armv5 build is broken"

Closes #981

See merge request isc-projects/bind9!1892
2019-05-12 21:51:21 -04:00
Mark Andrews
f546769b8b arm: just use the compiler's default yield support 2019-05-12 21:39:43 -04:00
Mark Andrews
9150e432aa Merge branch '984-remove-dead-code-in-pkcs11-keygen-c' into 'master'
Resolve "Remove dead code in pkcs11-keygen.c"

Closes #984

See merge request isc-projects/bind9!1814
2019-05-12 21:38:58 -04:00
Mark Andrews
2e4986e2c4 remove dead code and unnecessary call to pkcs_C_GetAttributeValue 2019-05-13 11:21:09 +10:00
Ondřej Surý
3ee94d7845 Merge branch '713-mem-benchmark' into 'master'
Add benchmark for isc_{mem,mempool}_{get,put} operations

Closes #713

See merge request isc-projects/bind9!1928
2019-05-10 17:20:26 -04:00
Ondřej Surý
7ec9502ec5 Add benchmark for isc_{mem,mempool}_{get,put} operations 2019-05-11 04:02:35 +07:00
Tinderbox User
031bca512d Merge branch 'prep-release' 2019-05-10 04:39:56 +00:00
Tinderbox User
25e416fb67 prep 9.15.0 2019-05-10 04:39:43 +00:00
Evan Hunt
07218e08ce Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1923
2019-05-09 23:59:54 -04:00
Evan Hunt
6e236fbaf1 add a placeholder that was missed earlier; update subsequent change numbers 2019-05-09 20:58:27 -07:00
Evan Hunt
2f17238f94 Merge branch '997-make-ntas-work-with-validating-forwarders' into 'master'
Make NTAs work with validating forwarders

Closes #997

See merge request isc-projects/bind9!1859
2019-05-09 23:12:10 -04:00
Michał Kępień
5be7c6f4b3 Add CHANGES entry
5219.	[bug]		Negative trust anchors did not work with "forward only;"
			to validating resolvers. [GL #997]
2019-05-09 19:55:36 -07:00
Michał Kępień
5e80488270 Make NTAs work with validating forwarders
If named is configured to perform DNSSEC validation and also forwards
all queries ("forward only;") to validating resolvers, negative trust
anchors do not work properly because the CD bit is not set in queries
sent to the forwarders.  As a result, instead of retrieving bogus DNSSEC
material and making validation decisions based on its configuration,
named is only receiving SERVFAIL responses to queries for bogus data.
Fix by ensuring the CD bit is always set in queries sent to forwarders
if the query name is covered by an NTA.
2019-05-09 19:55:35 -07:00
Evan Hunt
7d1a7c46f5 Merge branch '958-improve-message-about-python-ply' into 'master'
Improve the error message about missing PLY Python package

Closes #958

See merge request isc-projects/bind9!1918
2019-05-09 22:50:54 -04:00
Ondřej Surý
55b48700da Improve the error message about missing PLY Python package
Previously, only a message about missing Python was printed, which was
misleading to many users.  The new message clearly states that Python
AND PLY is required and prints basic instructions how to install PLY
package.
2019-05-09 19:40:13 -07:00
Ondřej Surý
913f246307 Merge branch 'ondrej/reproducible-build' into 'master'
Make lib/dns/gen.c compatible with reproducible builds.

See merge request isc-projects/bind9!1758
2019-05-09 04:24:35 -04:00
Ondřej Surý
c8cb612d39 Make lib/dns/gen.c compatible with reproducible builds.
The gen.c will now use SOURCE_DATE_EPOCH[1] if found in environment
to make the build more reproducible build friendly.

1. https://reproducible-builds.org/specs/source-date-epoch/
2019-05-09 15:10:01 +07:00
Mark Andrews
f23fa0a3e5 Merge branch '960-add-edns-client-tag-and-edns-server-tag' into 'master'
Resolve "Add EDNS Client Tag and EDNS Server Tag"

Closes #960

See merge request isc-projects/bind9!1754
2019-05-09 03:55:38 -04:00
Mark Andrews
ee7cf180b3 Recognise EDNS Client Tag and EDNS Server Tag 2019-05-09 17:29:23 +10:00
Evan Hunt
a157e0ac04 Merge branch '1015-ds-sha-1-deprecation' into 'master'
Deprecate SHA-1 hash in DS/CDS

Closes #1015

See merge request isc-projects/bind9!1908
2019-05-08 21:32:27 -04:00
Tony Finch
793d358cd6 add CHANGES and release note 2019-05-08 18:18:07 -07:00
Tony Finch
8785f6fa34 Deprecate SHA-1 CDS records
This affects CDS records generated by `named` and `dnssec-signzone`
based on `-P sync` and `-D sync` key timing instructions.

This is for conformance with the DS/CDS algorithm requirements in
https://tools.ietf.org/html/draft-ietf-dnsop-algorithm-update
2019-05-08 18:17:55 -07:00
Tony Finch
d8f2eb249a Deprecate SHA-1 DS digests in dnssec-signzone
This affects two cases:

  * When writing a `dsset` file for this zone, to be used by its
    parent, only write a SHA-256 DS record.

  * When reading a `keyset` file for a child, to generate DS records
    to include in this zone, generate SHA-256 DS records only.

This change does not affect digests used in CDS records.

This is for conformance with the DS/CDS algorithm requirements in
https://tools.ietf.org/html/draft-ietf-dnsop-algorithm-update
2019-05-08 18:17:55 -07:00
Tony Finch
129b731273 Deprecate SHA-1 in dnssec-checkds
This changes the behaviour so that it explicitly lists DS records that
are present in the parent but do not have keys in the child. Any
inconsistency is reported as an error, which is somewhat stricter than
before.

This is for conformance with the DS/CDS algorithm requirements in
https://tools.ietf.org/html/draft-ietf-dnsop-algorithm-update
2019-05-08 18:17:55 -07:00
Tony Finch
796a6c4e4e Deprecate SHA-1 in dnssec-dsfromkey
This makes the `-12a` options to `dnssec-dsfromkey` work more like
`dnssec-cds`, in that you can specify more than one digest and you
will get multiple records. (Previously you could only get one
non-default digest type at a time.)

The default is now `-2`. You can get the old behaviour with `-12`.

Tests and tools that use `dnssec-dsfromkey` have been updated to use
`-12` where necessary.

This is for conformance with the DS/CDS algorithm requirements in
https://tools.ietf.org/html/draft-ietf-dnsop-algorithm-update
2019-05-08 18:17:55 -07:00
Tony Finch
a177b07da1 bin/dnssec: move a little boilerplate into shared code 2019-05-08 18:17:55 -07:00
Mark Andrews
42ed7e43dc tests/resolver: look for hash algorithm 2 (SHA-256) now 2019-05-08 18:17:55 -07:00
Mark Andrews
ce6ecde3f3 Merge branch '899-totext-fromtext-fuzz' into 'master'
fuzz dns_rdata_fromwire

See merge request isc-projects/bind9!1582
2019-05-08 20:41:57 -04:00
Mark Andrews
8ffdf6759e dns_rdata_fromwire_text fuzzer
Fuzz input to dns_rdata_fromwire(). Then convert the result
to text, back to wire format, to multiline text, and back to wire
format again, checking for consistency throughout the sequence.
2019-05-08 20:30:40 -04:00
Mark Andrews
8fd8b9fd26 Merge branch '852-bind-returning-malformed-packet-error-when-sshfp-record-has-fingerprint-value-less-than-4-characters' into 'master'
Resolve "Bind returning malformed packet error when sshfp record has fingerprint value less than 4 characters"

Closes #852

See merge request isc-projects/bind9!1445
2019-05-08 18:42:56 -04:00
Mark Andrews
1722728c80 enforce known SSHFP finger print lengths 2019-05-09 08:11:43 +10:00
Evan Hunt
be5d4cadfc Merge branch '868-fix-trusted-keys-handling-with-dnssec-validation-auto' into 'master'
fix incorrect behavior mixing trusted-keys with validation auto

Closes #868

See merge request isc-projects/bind9!1483
2019-05-08 14:38:52 -04:00
Evan Hunt
cdc4388ac3 CHANGES, release notes 2019-05-07 22:06:31 -07:00
Evan Hunt
37e79bd79c reject the use of trusted-keys and managed-keys for the same name 2019-05-07 22:02:37 -07:00
Evan Hunt
8a8cd19eb0 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1903
2019-05-07 22:40:34 -04:00
Evan Hunt
2163a59d0d placeholder 2019-05-07 19:39:39 -07:00
Evan Hunt
cfee8b1492 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1902
2019-05-07 01:20:50 -04:00
Evan Hunt
bd14aa6d8e placeholder 2019-05-06 22:19:48 -07:00
Mark Andrews
f4bb54befb Merge branch '765-allow-dig-to-print-aaaa-records-fully-expanded' into 'master'
Resolve "Allow dig to print AAAA records fully expanded."

Closes #765

See merge request isc-projects/bind9!1188
2019-05-07 01:06:18 -04:00
Mark Andrews
fb0b8f9bd7 add CHANGES 2019-05-06 21:50:56 -07:00
Mark Andrews
d8798098e8 support printing AAAA in expanded form 2019-05-06 21:50:38 -07:00
Mark Andrews
6bb57c776e Merge branch '991-provide-ixfr-should-only-be-tests-on-tcp-clients' into 'master'
Resolve "provide-ixfr should only be tested on TCP clients."

Closes #991

See merge request isc-projects/bind9!1846
2019-05-06 23:23:37 -04:00
Mark Andrews
ba1d7f3a07 add CHANGES 2019-05-07 13:00:55 +10:00
Mark Andrews
d547465af5 add test for 'provide-ixfr no;' ; add forensics support 2019-05-07 12:59:35 +10:00
Mark Andrews
18c49853e3 only test provideixfr if the transport is TCP 2019-05-07 12:59:35 +10:00
Mark Andrews
b958a13c37 Merge branch '1005-filter-aaaa-crash-in-9-14-1' into 'master'
Resolve "filter-aaaa crash in 9.14.1"

Closes #1005

See merge request isc-projects/bind9!1886
2019-05-06 20:57:51 -04:00
Mark Andrews
bdc66eb5d9 add CHANGES 2019-05-07 10:39:49 +10:00
Mark Andrews
2483a8c76d lock accesses to hash table 2019-05-07 10:37:37 +10:00
Mark Andrews
4886701c03 clear pointer before hash table 2019-05-07 10:37:37 +10:00
Mark Andrews
161fec84c7 Merge branch '983-delv-www-isc-org-any-rtrace-multiline-leaks-memory' into 'master'
Resolve "'delv www.isc.org ANY +rtrace +multiline' leaks memory"

Closes #983

See merge request isc-projects/bind9!1812
2019-05-06 20:18:43 -04:00
Mark Andrews
ce5520b695 add CHANGES note 2019-05-07 10:07:02 +10:00
Mark Andrews
6999bee7ef check that delv -t any works 2019-05-07 10:05:25 +10:00
Mark Andrews
32ba5a0494 fix whitespace 2019-05-07 10:05:25 +10:00
Mark Andrews
127333c71f return rdatasets when processing ANY queries in client_resfind 2019-05-07 10:05:25 +10:00
Evan Hunt
cbddd8a0a9 Merge branch 'each-win32-parallel-tests' into 'master'
enable parallel system tests on windows

See merge request isc-projects/bind9!1401
2019-05-06 18:53:32 -04:00
Evan Hunt
d3cd0729c9 CHANGES 2019-05-06 14:20:25 -07:00
Evan Hunt
a33237f070 move the test lists into conf.sh.common
there is now a common list of tests in conf.sh.common, with the
tests that are either unique to windows or to unix, or which are
enabled or disabled by configure or Configure, being listed in
separate variables in conf.sh.in and conf.sh.win32.
2019-05-06 14:07:47 -07:00
Evan Hunt
bbae24c140 enable parallel system tests on windows
this moves the creation of "parallel.mk" into a separate shell script
instead of bin/tests/system/Makefile. that shell script can now be
executed by runall.sh, allowing us to make use of the cygwin "make"
command, which supports parallel execution.
2019-05-06 14:07:47 -07:00
Evan Hunt
7416045f38 Merge branch 'each-simplify-stats' into 'master'
simplify the isc_stat structure to take avantage of atomics

See merge request isc-projects/bind9!1493
2019-05-06 16:08:34 -04:00
Evan Hunt
f1aaf45085 CHANGES 2019-05-06 12:57:38 -07:00
Evan Hunt
4e5edb35e4 simplify the isc_stat structure to take avantage of atomics 2019-05-06 12:53:45 -07:00
Mark Andrews
8aac8358ec Merge branch '1000-arm-doc-rpz-nodata-policy-says-ancount-1' into 'master'
Resolve "ARM doc RPZ NODATA policy says ANCOUNT=1"

Closes #1000

See merge request isc-projects/bind9!1889
2019-05-06 03:35:15 -04:00
Mark Andrews
4889e06c3a A NODATA response has ANCOUNT of 0 assuming no CNAME/DNAMES 2019-05-06 17:13:18 +10:00
Ondřej Surý
f53b9ca88f Merge branch 'ondrej/update-dir-locals.el-for-config.h' into 'master'
Adjust .dir-locals.el to make clang always include config.h

See merge request isc-projects/bind9!1888
2019-05-02 04:55:42 -04:00
Ondřej Surý
7d05ae8b1d Adjust .dir-locals.el to make clang always include config.h 2019-05-02 10:54:37 +02:00
Evan Hunt
cc32080278 Merge branch '956-fix-dnstap-test' into 'master'
attach memory context sooner so that cleanup will work correctly

Closes #956

See merge request isc-projects/bind9!1882
2019-04-26 18:53:11 -04:00
Evan Hunt
0fd344e77a attach memory context sooner so that cleanup will work correctly 2019-04-26 18:27:37 -04:00
Ondřej Surý
f3a242d71d Merge branch '999-tcp-client-crash-v9_11-locks-v9_14-master' into 'master'
Replace atomic operations in bin/named/client.c with isc_refcount reference counting

Closes #999

See merge request isc-projects/bind9!1881
2019-04-26 16:25:49 -04:00
Ondřej Surý
8965a0ba98 Replace atomic operations in bin/named/client.c with isc_refcount reference counting
(cherry picked from commit ef49780d30)
(cherry picked from commit e203d4d65a)
2019-04-26 22:14:26 +02:00
Michał Kępień
b0fd3a2fd1 Merge branch 'michal/simplify-trailing-period-handling-in-system-tests' into 'master'
Simplify trailing period handling in system tests

See merge request isc-projects/bind9!1860
2019-04-26 15:12:08 -04:00
Michał Kępień
da2c1b74ad Simplify trailing period handling in system tests
Windows systems do not allow a trailing period in file names while Unix
systems do.  When BIND system tests are run, the $TP environment
variable is set to an empty string on Windows systems and to "." on Unix
systems.  This environment variable is then used by system test scripts
for handling this discrepancy properly.

In multiple system test scripts, a variable holding a zone name is set
to a string with a trailing period while the names of the zone's
corresponding dlvset-* and/or dsset-* files are determined using
numerous sed invocations like the following one:

    dlvsets="$dlvsets dlvset-`echo $zone |sed -e "s/.$//g"`$TP"

In order to improve code readability, use zone names without trailing
periods and replace sed invocations with variable substitutions.

To retain local consistency, also remove the trailing period from
certain other zone names used in system tests that are not subsequently
processed using sed.
2019-04-26 20:38:02 +02:00
Michał Kępień
79357f93c0 Merge branch 'michal/fix-rare-allow-query-system-test-failures' into 'master'
Fix rare "allow-query" system test failures

See merge request isc-projects/bind9!1857
2019-04-26 05:31:25 -04:00
Michał Kępień
978a0d2555 Make root zone data match root hints
In the "allow-query" system test, ns3 uses a root hints file which
contains a single entry for a.root-servers.nil (10.53.0.1).  This name
is not present in the root zone served by ns1, which means querying it
for that name and any type will yield an NXDOMAIN response.  When
combined with unfavorable thread scheduling, this can lead to ns3
caching an NXDOMAIN response for the only root server it is aware of and
thus to false positives for the "allow-query" system test caused by ns3
returning unexpected SERVFAIL responses.  Fix by modifying the root zone
served by ns1 so that authoritative responses to a.root-servers.nil
queries match the root hints file used by ns3.
2019-04-26 11:05:56 +02:00
Evan Hunt
1766a5d9e0 Merge branch '982-filter-aaaa-race' into 'master'
Resolve "filter-aaaa crash in 9.14.0"

Closes #982

See merge request isc-projects/bind9!1861
2019-04-26 03:05:39 -04:00
Evan Hunt
ce8ad08a45 CHANGES 2019-04-26 02:52:39 -04:00
Evan Hunt
4f4c18d643 associate a lock with the memory pool in the filter-aaaa plugin 2019-04-26 02:52:39 -04:00
Ondřej Surý
2c85466c67 Merge branch '615-tcp-client-crash-v9_14-master' into 'master'
Resolve "tcp-clients mostly ineffective"

Closes #615

See merge request isc-projects/bind9!1871
2019-04-25 11:14:50 -04:00
Evan Hunt
4551c58e30 CHANGES, release note
(cherry picked from commit 244e44af432121a05e0a308b7ccce96a8ecd28ab)
(cherry picked from commit 79fad84bf6)
2019-04-25 16:32:32 +02:00
Evan Hunt
d809ec6c14 restore allowance for tcp-clients < interfaces
in the "refactor tcpquota and pipeline refs" commit, the counting
of active interfaces was tightened in such a way that named could
fail to listen on an interface if there were more interfaces than
tcp-clients. when checking the quota to start accepting on an
interface, if the number of active clients was above zero, then
it was presumed that some other client was able to handle accepting
new connections. this, however, ignored the fact that the current client
could be included in that count, so if the quota was already exceeded
before all the interfaces were listening, some interfaces would never
listen.

we now check whether the current client has been marked active; if so,
then the number of active clients on the interface must be greater
than 1, not 0.

(cherry picked from commit 02365b87ea0b1ea5ea8b17376f6734c811c95e61)
(cherry picked from commit cae79e1bab)
2019-04-25 16:32:05 +02:00
Evan Hunt
2f3876d187 refactor tcpquota and pipeline refs; allow special-case overrun in isc_quota
- if the TCP quota has been exceeded but there are no clients listening
  for new connections on the interface, we can now force attachment to the
  quota using isc_quota_force(), instead of carrying on with the quota not
  attached.
- the TCP client quota is now referenced via a reference-counted
  'ns_tcpconn' object, one of which is created whenever a client begins
  listening for new connections, and attached to by members of that
  client's pipeline group. when the last reference to the tcpconn
  object is detached, it is freed and the TCP quota slot is released.
- reduce code duplication by adding mark_tcp_active() function
- convert counters to stdatomic

(cherry picked from commit a8dd133d270873b736c1be9bf50ebaa074f5b38f)
(cherry picked from commit 4a8fc979c4)
2019-04-25 16:32:05 +02:00
Evan Hunt
a0f4a3fa65 better tcpquota accounting and client mortality checks
- ensure that tcpactive is cleaned up correctly when accept() fails.
- set 'client->tcpattached' when the client is attached to the tcpquota.
  carry this value on to new clients sharing the same pipeline group.
  don't call isc_quota_detach() on the tcpquota unless tcpattached is
  set.  this way clients that were allowed to accept TCP connections
  despite being over quota (and therefore, were never attached to the
  quota) will not inadvertently detach from it and mess up the
  accounting.
- simplify the code for tcpquota disconnection by using a new function
  tcpquota_disconnect().
- before deciding whether to reject a new connection due to quota
  exhaustion, check to see whether there are at least two active
  clients. previously, this was "at least one", but that could be
  insufficient if there was one other client in READING state (waiting
  for messages on an open connection) but none in READY (listening
  for new connections).
- before deciding whether a TCP client object can to go inactive, we
  must ensure there are enough other clients to maintain service
  afterward -- both accepting new connections and reading/processing new
  queries.  A TCP client can't shut down unless at least one
  client is accepting new connections and (in the case of pipelined
  clients) at least one additional client is waiting to read.

(cherry picked from commit 427a2fb4d17bc04ca3262f58a9dcf5c93fc6d33e)
(cherry picked from commit 0896841272)
2019-04-25 16:32:05 +02:00
Michał Kępień
3c0f8d9146 use reference counter for pipeline groups (v3)
Track pipeline groups using a shared reference counter
instead of a linked list.

(cherry picked from commit 31f392db20207a1b05d6286c3c56f76c8d69e574)
(cherry picked from commit 2211120222)
2019-04-25 16:32:05 +02:00
Witold Kręcicki
d989a8b38e tcp-clients could still be exceeded (v2)
the TCP client quota could still be ineffective under some
circumstances.  this change:

- improves quota accounting to ensure that TCP clients are
  properly limited, while still guaranteeing that at least one client
  is always available to serve TCP connections on each interface.
- uses more descriptive names and removes one (ntcptarget) that
  was no longer needed
- adds comments

(cherry picked from commit 9e74969f85329fe26df2fad390468715215e2edd)
(cherry picked from commit d7e84cee0b)
2019-04-25 16:32:05 +02:00
Witold Kręcicki
07c3365b0b fix enforcement of tcp-clients (v1)
tcp-clients settings could be exceeded in some cases by
creating more and more active TCP clients that are over
the set quota limit, which in the end could lead to a
DoS attack by e.g. exhaustion of file descriptors.

If TCP client we're closing went over the quota (so it's
not attached to a quota) mark it as mortal - so that it
will be destroyed and not set up to listen for new
connections - unless it's the last client for a specific
interface.

(cherry picked from commit eafcff07c25bdbe038ae1e4b6660602a080b9395)
(cherry picked from commit 9e7617cc84)
2019-04-25 16:32:04 +02:00
Ondřej Surý
7ef3953085 Merge branch '880-secure-asdfasdfasdf-abacadabra-crash-v9_14-master' into 'master'
Resolve "CVE-2019-6467: lib/ns/query.c:9176: INSIST(!qctx->is_zone) failed, back trace"

Closes #880

See merge request isc-projects/bind9!1868
2019-04-25 10:27:33 -04:00
Evan Hunt
38c29c1b5b CHANGES, release note
(cherry picked from commit ab5473007e91f011d003ff0ba5ab32fa0d56360c)
(cherry picked from commit 404be59527)
2019-04-25 16:02:22 +02:00
Matthijs Mekking
f3d3703fe3 Fix nxdomain-redirect assertion failure
- Always set is_zonep in query_getdb; previously it was only set if
  result was ISC_R_SUCCESS or ISC_R_NOTFOUND.
- Don't reset is_zone for redirect.
- Style cleanup.

(cherry picked from commit a85cc641d7a4c66cbde03cc4e31edc038a24df46)
(cherry picked from commit 486a201149)
2019-04-25 16:01:02 +02:00
Matthijs Mekking
2fbadaeec6 Add test for nxdomain-redirect ncachenxdomain
(cherry picked from commit 2d65626630c19bb8159a025accb18e5179da5dc3)
(cherry picked from commit 05d29443eb)
2019-04-25 16:01:02 +02:00
Mark Andrews
9b67f3d34b Merge branch '995-dlz_open_driver-fix-build-failure-without-dlfcn-h' into 'master'
Resolve "dlz_open_driver: fix build failure without dlfcn.h"

Closes #995

See merge request isc-projects/bind9!1854
2019-04-23 19:18:19 -04:00
Mark Andrews
19e4098139 add CHANGES 2019-04-24 09:07:19 +10:00
Mark Andrews
eee8084734 conditionally include <dlfcn.h> 2019-04-24 09:06:08 +10:00
Mark Andrews
ea131d2e6a Merge branch '996-wrong-key-id-is-displayed-for-rsamd5-keys' into 'master'
Resolve "Wrong key id is displayed for RSAMD5 keys."

Closes #996

See merge request isc-projects/bind9!1852
2019-04-23 18:36:57 -04:00
Mark Andrews
11cddb689f add CHANGES 2019-04-24 08:19:08 +10:00
Mark Andrews
ffaa5a07dd compute the RSAMD5 key id 2019-04-24 08:05:27 +10:00
Matthijs Mekking
e79dd268b6 Merge branch 'matthijs-fix-dnssec-test-intermittent-failure-kskonly' into 'master'
Fix dnssec test intermittent failure related to kskonly bugfix

See merge request isc-projects/bind9!1836
2019-04-23 11:11:19 -04:00
Matthijs Mekking
83473b9758 Harden grep key ID calls
Key IDs may accidentally match dig output that is not the key ID (for
example the RRSIG inception or expiration time, the query ID, ...).
Search for key ID + signer name should prevent that, as that is what
only should occur in the RRSIG record, and signer name always follows
the key ID.
2019-04-23 16:49:38 +02:00
Matthijs Mekking
67f0635f3c Remove sleeps
Remove sleep calls from test, rely on wait_for_log().  Make
wait_for_log() and dnssec_loadkeys_on() fail the test if the
appropriate log line is not found.

Slightly adjust the echo_i() lines to print only the key ID (not the
key name).
2019-04-23 16:49:38 +02:00
Witold Krecicki
671505feb8 Merge branch '992-fetchcount-increment-in-resume-qmin' into 'master'
When resuming from qname-minimization increase fetches-per-zone counters for the 'new' zone

Closes #992

See merge request isc-projects/bind9!1847
2019-04-23 10:27:12 -04:00
Witold Kręcicki
7043c6eaf5 When resuming from qname-minimization increase fetches-per-zone counters for the 'new' zone 2019-04-23 10:16:09 -04:00
Michał Kępień
774b07785c Merge branch 'michal/minor-nsupdate-system-test-tweaks' into 'master'
Minor "nsupdate" system test tweaks

See merge request isc-projects/bind9!1837
2019-04-23 09:20:06 -04:00
Michał Kępień
f8746cddbc Wait more than 1 second for NSEC3 chain changes
One second may not be enough for an NSEC3 chain change triggered by an
UPDATE message to complete.  Wait up to 10 seconds when checking whether
a given NSEC3 chain change is complete in the "nsupdate" system test.
2019-04-23 14:59:05 +02:00
Michał Kępień
1c8e5ea333 Remove redundant sleeps
In the "nsupdate" system test, do not sleep before checking results of
changes which are expected to be processed synchronously, i.e. before
nsupdate returns.
2019-04-23 14:59:05 +02:00
Mark Andrews
fd7f2c8f9d Merge branch 'cleanup-socket-references' into 'master'
use isc_refcount_decrement to decrement NEWCONNSOCK(dev)->references; use...

See merge request isc-projects/bind9!1821
2019-04-23 00:29:30 -04:00
Mark Andrews
265554f895 use isc_refcount_decrement to decrement NEWCONNSOCK(dev)->references; use isc_refcount_increment instead of isc_refcount_init in socket_create 2019-04-23 00:12:17 -04:00
Mark Andrews
3b9d451902 Merge branch 'clang-false-positive' into 'master'
add assertions to silence clang false positive

See merge request isc-projects/bind9!1808
2019-04-22 23:19:28 -04:00
Mark Andrews
bed9ad79ba add assertions to silence clang false positive 2019-04-22 23:03:46 -04:00
Mark Andrews
9482d8470b Merge branch '962-bind-just-disables-gssapi-support-if-no-gssapi-krb5-headers-found' into 'master'
Resolve "Bind just disables GSSAPI support if no GSSAPI/KRB5 headers found"

Closes #962

See merge request isc-projects/bind9!1815
2019-04-22 22:33:42 -04:00
Mark Andrews
e420078c63 make 'configure --with-gssapi=yes' fatal if support is not found 2019-04-22 22:16:59 -04:00
Evan Hunt
c9cb567f17 Merge branch '990-return-servfail' into 'master'
force SERVFAIL response in the gotanswer failure case

Closes #990

See merge request isc-projects/bind9!1838
2019-04-22 22:07:50 -04:00
Evan Hunt
4d358c9bce CHANGES 2019-04-22 18:48:19 -07:00
Evan Hunt
7402615697 force SERVFAIL response in the gotanswer failure case
- named could return FORMERR if parsing iterative responses
  ended with a result code such as DNS_R_OPTERR. instead of
  computing a response code based on the result, in this case
  we now just force the response to be SERVFAIL.
2019-04-22 18:48:19 -07:00
Mark Andrews
f3e2780dc8 Merge branch 'incorrect-use-of-bool' into 'master'
using 0 instead of false

See merge request isc-projects/bind9!1820
2019-04-22 21:25:33 -04:00
Mark Andrews
da7f683abf using 0 instead of false 2019-04-23 11:08:06 +10:00
Michał Kępień
e47754d7bf Merge branch 'michal/win32-system-test-fixes' into 'master'
Miscellaneous Windows system test fixes

See merge request isc-projects/bind9!1794
2019-04-19 05:52:14 -04:00
Michał Kępień
b6c1cdfffe Update interface lists in ifconfig scripts
Make bin/tests/system/ifconfig.bat also configure addresses ending with
9 and 10, so that the script is in sync with its Unix counterpart.

Update comments listing the interfaces created by ifconfig.{bat,sh} so
that they do not include addresses whose last octet is zero (since an
address like 10.53.1.0/24 is not a valid host address and thus the
aforementioned scripts do not even attempt configuring them).
2019-04-19 11:27:06 +02:00
Michał Kępień
e4280ed9f5 Fix the "dnssec" system test on Windows
On Windows, the bin/tests/system/dnssec/signer/example.db.signed file
contains carriage return characters at the end of each line.  Remove
them before passing the aforementioned file to the awk script extracting
key IDs so that the latter can work properly.
2019-04-19 11:21:43 +02:00
Michał Kępień
761ba4514f Do not wait for lock file cleanup on Windows
As signals are currently not handled by named on Windows, instances
terminated using signals are not able to perform a clean shutdown, which
involves e.g. removing the lock file.  Thus, waiting for a given
instance's lock file to be removed beforing assuming it is shut down
is pointless on Windows, so do not even attempt it.
2019-04-19 11:21:43 +02:00
Michał Kępień
28f5400d0d Merge branch '979-win32-remove-lock-file-upon-shutdown' into 'master'
win32: remove lock file upon shutdown

Closes #979

See merge request isc-projects/bind9!1793
2019-04-19 05:20:30 -04:00
Michał Kępień
e048436805 Add CHANGES entry
5214.	[bug]		win32: named now removes its lock file upon shutdown.
			[GL #979]
2019-04-19 10:59:41 +02:00
Michał Kępień
c506077da5 win32: remove lock file upon shutdown
Upon named shutdown, the lock file should not just be unlocked but also
removed.
2019-04-19 10:59:41 +02:00
Michał Kępień
9fceb376c6 Merge branch '978-win32-fix-service-state-reported-during-shutdown' into 'master'
win32: fix service state reported during shutdown

Closes #978

See merge request isc-projects/bind9!1792
2019-04-19 04:19:34 -04:00
Michał Kępień
e7332343ed Add CHANGES entry
5213.	[bug]		win32: Eliminated a race which allowed named.exe running
			as a service to be killed prematurely during shutdown.
			[GL #978]
2019-04-19 09:37:51 +02:00
Michał Kępień
964749dfdb win32: fix service state reported during shutdown
When a Windows service receives a request to stop, it should not set its
state to SERVICE_STOPPED until it is completely shut down as doing that
allows the operating system to kill that service prematurely, which in
the case of named may e.g. prevent the PID file and/or the lock file
from being cleaned up.

Set service state to SERVICE_STOP_PENDING when named begins its shutdown
and only report the SERVICE_STOPPED state immediately before exiting.
2019-04-19 09:37:51 +02:00
Ondřej Surý
1a9be94f83 Merge branch '989-check-for-typeof-extension' into 'master'
Use uintmax_t instead of typeof(x) in the ISC_ALIGN macro on non-GNUC systems

Closes #989

See merge request isc-projects/bind9!1826
2019-04-18 07:16:04 -04:00
Ondřej Surý
2e40cc94dc On non-GNUC systems, use uintmax_t in the ISC_ALIGN macro 2019-04-18 12:55:25 +02:00
Ondřej Surý
9d329a5e74 Merge branch 'ondrej/text-files-dont-need-copyright' into 'master'
Simple text files don't need copyright header

See merge request isc-projects/bind9!1809
2019-04-18 02:53:51 -04:00
Ondřej Surý
1877139a32 Simple text files with docs on build or design don't really need copyright on their own 2019-04-18 08:52:00 +02:00
Ondřej Surý
abce724ad9 Merge branch 'ondrej/refactor-DNS_RDATASET_FIXED-code-flow' into 'master'
Refactor the DNS_RDATASET_FIXED code to use macros instead of ifdefs

See merge request isc-projects/bind9!1811
2019-04-17 04:46:37 -04:00
Ondřej Surý
4edbb773a1 Refactor the DNS_RDATASET_FIXED code to use constants instead of ifdefs 2019-04-17 10:35:11 +02:00
Evan Hunt
87daa5471d Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1813
2019-04-16 15:57:26 -04:00
Evan Hunt
591e37a7e2 placeholder 2019-04-16 12:56:59 -07:00
Evan Hunt
fad7b2a6f8 Merge branch '817-out-of-zone-additional' into 'master'
out of zone additional data

Closes #817

See merge request isc-projects/bind9!1366
2019-04-15 14:23:16 -04:00
Evan Hunt
5071e43c19 CHANGES 2019-04-15 11:05:18 -07:00
Evan Hunt
b7e9115793 revise "minimal-responses" documentation in the ARM 2019-04-15 11:05:18 -07:00
Evan Hunt
7fff3295f5 if recursion is allowed and minimal-responses is no, search other databases
this restores functionality that was removed in commit 03be5a6b4e,
allowing named to search in authoritative zone databases outside the
current zone for additional data, if and only if recursion is allowed
and minimal-responses is disabled.
2019-04-15 11:05:04 -07:00
Mark Andrews
d134dd9c8c Merge branch '980-util-update_copyrights-now-needs-to-handle-files-with-cr-lf-endings' into 'master'
Resolve "util/update_copyrights now needs to handle files with CR LF endings."

Closes #980

See merge request isc-projects/bind9!1801
2019-04-12 00:28:06 -04:00
Mark Andrews
e76936fd85 support files which have CR LF ending like those in win32utils 2019-04-12 14:09:01 +10:00
Evan Hunt
a3fd41157d Merge branch '963-dnstap-check-ra' into 'master'
dnstap: if recursion is not available, log queries as AQ instead of CQ

Closes #963

See merge request isc-projects/bind9!1756
2019-04-11 18:43:14 -04:00
Evan Hunt
3b9dee0baa CHANGES 2019-04-11 15:21:57 -07:00
Evan Hunt
1f578cdb12 dnstap: if recursion is not available, log queries as AQ instead of CQ 2019-04-11 15:13:13 -07:00
Evan Hunt
9b1304be36 Merge branch '972-auto-validation-summary' into 'master'
configure summary failed to report --disable-auto-validation correctly

Closes #972

See merge request isc-projects/bind9!1768
2019-04-11 11:42:27 -04:00
Evan Hunt
4b63853aa1 configure summary failed to report --disable-auto-validation correctly 2019-04-11 08:31:40 -07:00
Matthijs Mekking
8184e5097c Merge branch '763-matthijs-active-zsk-but-ksk-only-2' into 'master'
Don't sign DNSKEY RRset with ZSK if the KSK is offline and dnskey-kskonly

Closes #763

See merge request isc-projects/bind9!1747
2019-04-11 09:41:30 -04:00
Matthijs Mekking
3cb8c49c73 With update-check-ksk also consider offline keys
The option `update-check-ksk` will look if both KSK and ZSK are
available before signing records.  It will make sure the keys are
active and available.  However, for operational practices keys may
be offline.  This commit relaxes the update-check-ksk check and will
mark a key that is offline to be available when adding signature
tasks.
2019-04-11 15:22:30 +02:00
Matthijs Mekking
2e83e3255a Style: some curly brackets 2019-04-11 15:22:30 +02:00
Matthijs Mekking
d330986374 Add detail on echo message in autosign test 2019-04-11 15:22:30 +02:00
Matthijs Mekking
8bc10bcf59 Add test for ZSK rollover while KSK offline
This commit adds a lengthy test where the ZSK is rolled but the
KSK is offline (except for when the DNSKEY RRset is changed).  The
specific scenario has the `dnskey-kskonly` configuration option set
meaning the DNSKEY RRset should only be signed with the KSK.

A new zone `updatecheck-kskonly.secure` is added to test against,
that can be dynamically updated, and that can be controlled with rndc
to load the DNSSEC keys.

There are some pre-checks for this test to make sure everything is
fine before the ZSK roll, after the new ZSK is published, and after
the old ZSK is deleted.  Note there are actually two ZSK rolls in
quick succession.

When the latest added ZSK becomes active and its predecessor becomes
inactive, the KSK is offline.  However, the DNSKEY RRset did not
change and it has a good signature that is valid for long enough.
The expected behavior is that the DNSKEY RRset stays signed with
the KSK only (signature does not need to change).  However, the
test will fail because after reconfiguring the keys for the zone,
it wants to add re-sign tasks for the new active keys (in sign_apex).
Because the KSK is offline, named determines that the only other
active key, the latest ZSK, will be used to resign the DNSKEY RRset,
in addition to keeping the RRSIG of the KSK.

The question is: Why do we need to resign the DNSKEY RRset
immediately when a new key becomes active?  This is not required,
only once the next resign task is triggered the new active key
should replace signatures that are in need of refreshing.
2019-04-11 15:22:30 +02:00
Mark Andrews
67d75732b6 Merge branch '899-add-totext-fromtext-to-wirechecks' into 'master'
Run wire check through "totext" and "fromtext" methods including multi-line.

See merge request isc-projects/bind9!1572
2019-04-11 05:37:58 -04:00
Mark Andrews
307a1b563b Add CHANGES 2019-04-11 19:19:46 +10:00
Mark Andrews
b78e128a2f Add debug printfs 2019-04-11 19:19:46 +10:00
Mark Andrews
e73a5b0ce3 Prevent WIRE_INVALID() being called without a argument 2019-04-11 19:19:46 +10:00
Mark Andrews
b089f43b7a Check multi-line output from dns_rdata_tofmttext()
Check that multi-line output from dns_rdata_tofmttext() can be read
back in by dns_rdata_fromtext().
2019-04-11 19:19:46 +10:00
Mark Andrews
1a75a5cee6 Process master file comments and make input invalid again 2019-04-11 19:19:10 +10:00
Mark Andrews
7941a9554f Set 'specials' to match 'specials' in 'lib/dns/master.c' 2019-04-11 18:13:39 +10:00
Mark Andrews
cc5e16e4d3 Fix whitespace so that the names align 2019-04-11 18:13:39 +10:00
Mark Andrews
36f30f5731 Add dns_rdata_totext() and dns_rdata_fromtext() to fromwire
Add dns_rdata_totext() and dns_rdata_fromtext() to fromwire for
valid inputs to ensure that what we accept in dns_rdata_fromwire()
can be written out and read back in.
2019-04-11 18:13:39 +10:00
Mark Andrews
961d256d73 Merge branch '965-delv-prints-weird-ttl-values-2' into 'master'
Test that dig and delve print correct TTL values.

Closes #965

See merge request isc-projects/bind9!1782
2019-04-10 01:24:44 -04:00
Mark Andrews
dfc485b02e add CHANGES 2019-04-10 15:06:54 +10:00
Matthijs Mekking
195277ca6d Check dig TTLs.
This also fixes a bug in the tests ($n was not incremented in one
place).
2019-04-10 15:06:13 +10:00
Mark Andrews
146202d6a8 Check delv TTLs. 2019-04-10 15:06:13 +10:00
Mark Andrews
68851ddb76 Merge branch '965-delv-prints-weird-ttl-values' into 'master'
Initialise view->mincachettl and view->minncachettl to zero in dns_view_create.

Closes #965

See merge request isc-projects/bind9!1760
2019-04-10 01:04:24 -04:00
Mark Andrews
538da8c80d Add CHANGES. 2019-04-10 14:49:28 +10:00
Mark Andrews
8fd4308bda Initialise mincachettl and minncachettl to zero in dns_view_create. 2019-04-10 14:48:49 +10:00
Mark Andrews
0fb2cf1e44 Merge branch '899-enforce-hash-in-ds' into 'master'
enforce DS hash exists

See merge request isc-projects/bind9!1575
2019-04-10 00:40:14 -04:00
Mark Andrews
97b7360ce1 add CHANGES 2019-04-10 13:39:51 +10:00
Mark Andrews
6eb28eda1e add ds unit test 2019-04-10 13:37:03 +10:00
Mark Andrews
b274f3fad7 enforce DS hash exists 2019-04-10 13:36:08 +10:00
Mark Andrews
a32a4ed945 Merge branch '852-run-fromtext-through-fromwire' into 'master'
check that from fromtext produces valid towire input

Closes #852

See merge request isc-projects/bind9!1738
2019-04-09 21:27:48 -04:00
Mark Andrews
d712b88048 add CHANGES 2019-04-10 11:16:55 +10:00
Mark Andrews
7b0a653858 check that from fromtext produces valid towire input 2019-04-10 11:13:52 +10:00
Ondřej Surý
cd68cfffbf Merge branch '971-downgrade-DLZ_DBCLIENTINFO_VERSION-in-dlz_minimal.h' into 'master'
Downgrade the dns_clientinfo_t structure to not contain dbversion

Closes #971

See merge request isc-projects/bind9!1773
2019-04-09 15:24:37 -04:00
Ondřej Surý
a6f09b2255 Downgrade the dns_clientinfomethod structure to the version in lib/dns/clientinfo.c 2019-04-09 10:06:12 +01:00
Mark Andrews
43828818a4 Merge branch '899-fromwire-check-flags-for-nokey' into 'master'
Check KEY flags for empty key in fromwire method

See merge request isc-projects/bind9!1574
2019-04-09 00:16:00 -04:00
Mark Andrews
f78c688c4f add CHANGES 2019-04-09 13:56:05 +10:00
Mark Andrews
82d4931440 for rkey flags MUST be zero 2019-04-09 13:55:30 +10:00
Mark Andrews
2592e91516 check flags for no key in fromwire for *KEY 2019-04-09 13:55:30 +10:00
Mark Andrews
629b978fd8 Merge branch '976-dns-ecs-h-missing-isc_lang_enddecls' into 'master'
Resolve "dns/ecs.h missing ISC_LANG_ENDDECLS"

Closes #976

See merge request isc-projects/bind9!1774
2019-04-08 21:59:30 -04:00
Mark Andrews
698a6f955e <dns/ecs.h> was missing ISC_LANG_ENDDECLS. 2019-04-09 11:47:26 +10:00
Evan Hunt
27d788cff3 Merge branch '973-pause-dbiterator-in-rpz' into 'master'
Fix deadlock in RPZ update code.

Closes #973

See merge request isc-projects/bind9!1770
2019-04-06 15:23:37 -04:00
Witold Kręcicki
06021b3529 Fix deadlock in RPZ update code.
In dns_rpz_update_from_db we call setup_update which creates the db
iterator and calls dns_dbiterator_first. This unpauses the iterator and
might cause db->tree_lock to be acquired. We then do isc_task_send(...)
on an event to do quantum_update, which (correctly) after each iteration
calls dns_dbiterator_pause, and re-isc_task_sends itself.

That's an obvious bug, as we're holding a lock over an async task send -
if a task requesting write (e.g. prune_tree) is scheduled on the same
workers queue as update_quantum but before it, it will wait for the
write lock indefinitely, resulting in a deadlock.

To fix it we have to pause dbiterator in setup_update.
2019-04-06 12:22:49 -07:00
Evan Hunt
b22a5b6fac Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1771
2019-04-06 15:20:51 -04:00
Evan Hunt
610d13b456 placeholder 2019-04-06 12:20:16 -07:00
Michał Kępień
23e6a908df Merge branch '893-do-not-rely-on-default-dig-options-in-system-tests' into 'master'
Do not rely on default dig options in system tests

Closes #893

See merge request isc-projects/bind9!1556
2019-04-03 07:21:56 -04:00
Michał Kępień
b6cce0fb8b Do not rely on default dig options in system tests
Some system tests assume dig's default setings are in effect.  While
these defaults may only be silently overridden (because of specific
options set in /etc/resolv.conf) for BIND releases using liblwres for
parsing /etc/resolv.conf (i.e. BIND 9.11 and older), it is arguably
prudent to make sure that tests relying on specific +timeout and +tries
settings specify these explicitly in their dig invocations, in order to
prevent test failures from being triggered by any potential changes to
current defaults.
2019-04-03 12:57:33 +02:00
Witold Krecicki
7e069cb16a Merge branch '966-resume-qmin-shuttingdown' into 'master'
Fix high load race crash in resolver code

Closes #966

See merge request isc-projects/bind9!1757
2019-03-29 11:22:57 -04:00
Witold Kręcicki
d11791e24c CHANGES 2019-03-29 15:53:17 +01:00
Witold Kręcicki
7c960e89ea In resume_qmin check if the fetch context is already shutting down - if so, try to destroy it, don't continue 2019-03-29 14:30:40 +01:00
Mark Andrews
e9771830b8 Merge branch '920-see-problem-when-multiple-sigs-with-besteffort-parsing' into 'master'
Address problems with best effort parsing.

Closes #920

See merge request isc-projects/bind9!1606
2019-03-26 06:30:12 -04:00
Mark Andrews
b779342017 add CHANGES 2019-03-26 21:18:19 +11:00
Witold Kręcicki
51a55ddbb7 Fix assertion failure in nslookup/dig/mdig when message has multiple SIG(0) options.
When parsing message with DNS_MESSAGE_BESTEFFORT (used exclusively in
tools, never in named itself) if we hit an invalid SIG(0) in wrong
place we continue parsing the message, and put the sig0 in msg->sig0.
If we then hit another sig0 in a proper place we see that msg->sig0
is already 'taken' and we don't free name and rdataset, and we don't
set seen_problem. This causes an assertion failure.
This fixes that issue by setting seen_problem if we hit second sig0,
tsig or opt, which causes name and rdataset to be always freed.
2019-03-26 21:15:00 +11:00
Mark Andrews
b01ed54bad Merge branch '955-make-install-fails-after-configure-with-dlopen-no' into 'master'
Resolve "`make install` fails after ./configure --with-dlopen=no"

Closes #955

See merge request isc-projects/bind9!1742
2019-03-26 04:52:40 -04:00
Mark Andrews
bd670d4a04 add CHANGES 2019-03-26 19:38:56 +11:00
Mark Andrews
cd3593c38d fix plugin installation 2019-03-26 19:38:13 +11:00
Ondřej Surý
d089387d7f Merge branch '4-make-dnstap.pb-c.h-private' into 'master'
Make lib/dns/dnstap.pb-c.h header a private to lib/dns

See merge request isc-projects/bind9!1744
2019-03-22 06:58:02 -04:00
Ondřej Surý
8ccce7e24b Make lib/dns/dnstap.pb-c.h private header
This changes dns_dtdata struct to not expose data types from dnstap.pb-c.h to
prevent the need for including this header where not really needed.
2019-03-22 11:38:45 +01:00
Evan Hunt
d0cda3dc83 Merge branch '913-allow-update' into 'master'
restore inheritance of 'allow-update' and 'allow-update-forwarding'

Closes #913

See merge request isc-projects/bind9!1720
2019-03-22 03:10:17 -04:00
Evan Hunt
55a7961cf3 CHANGES, release notes 2019-03-21 21:17:50 -07:00
Evan Hunt
91dca0f8da don't fail when allow-update{,-forwarding} is used globally 2019-03-21 21:17:49 -07:00
Mark Andrews
11c862efff Merge branch '899-zonemd-check-for-hash-existence' into 'master'
zonemd require non empty hash

Closes #899

See merge request isc-projects/bind9!1739
2019-03-21 15:50:29 -04:00
Mark Andrews
e1db1b8dcb add CHANGES 2019-03-22 06:49:09 +11:00
Mark Andrews
473987d8d9 Disallow empty ZONEMD hashes
This change is the result of discussions with the authors of
draft-wessels-dns-zone-digest.
2019-03-22 06:49:01 +11:00
Mark Andrews
ffba2eb60d Merge branch '899-eid-totext-is-broken' into 'master'
EID and NIMLOC totext is broken.

See merge request isc-projects/bind9!1571
2019-03-21 05:09:50 -04:00
Mark Andrews
c20b89fcf8 add CHANGES 2019-03-21 19:52:27 +11:00
Mark Andrews
40a770b932 add brackets for multi-line output 2019-03-21 19:52:27 +11:00
Michał Kępień
69468e5417 Merge branch 'michal/fix-key-id-extraction-in-the-dnssec-system-test' into 'master'
Fix key ID extraction in the "dnssec" system test

See merge request isc-projects/bind9!1732
2019-03-21 03:35:52 -04:00
Michał Kępień
a40c60e4c1 Fix key ID extraction in the "dnssec" system test
Simply looking for the key ID surrounded by spaces in the tested
dnssec-signzone output file is not a precise enough method of checking
for signatures prepared using a given key ID: it can be tripped up by
cross-algorithm key ID collisions and certain low key IDs (e.g. 60, the
TTL specified in bin/tests/system/dnssec/signer/example.db.in), which
triggers false positives for the "dnssec" system test.  Make key ID
extraction precise by using an awk script which operates on specific
fields.
2019-03-20 22:21:30 +01:00
Michał Kępień
a17aff7421 Merge branch 'michal/minor-mirror-system-test-tweaks' into 'master'
Minor "mirror" system test tweaks

See merge request isc-projects/bind9!1713
2019-03-20 05:09:21 -04:00
Michał Kępień
73afbdc552 Increase dig query timeout to 2 seconds
The "mirror" system test expects all dig queries (including recursive
ones) to be responded to within 1 second, which turns out to be overly
optimistic in certain cases and leads to false positives being
triggered.  Increase dig query timeout used throughout the "mirror"
system test to 2 seconds in order to alleviate the issue.
2019-03-20 09:50:35 +01:00
Michał Kępień
6847a29b54 Increase TAT query interval
Currently, ns3 in the "mirror" system test sends trust anchor telemetry
queries every second as it is started with "-T tat=1".  Given the number
of trust anchors configured on ns3 (9), TAT-related traffic clutters up
log files, hindering troubleshooting efforts.  Increase TAT query
interval to 3 seconds in order to alleviate the issue.

Note that the interval chosen cannot be much higher if intermittent test
failures are to be avoided: TAT queries are only sent after the
configured number of seconds passes since resolver startup.  Quick
experiments show that even on contemporary hardware, ns3 should be
running for at least 5 seconds before it is first shut down, so a
3-second TAT query interval seems to be a reasonable, future-proof
compromise.  Ensure the relevant check is performed before ns3 is first
shut down to emphasize this trade-off and make it more clear by what
time TAT queries are expected to be sent.
2019-03-20 09:50:35 +01:00
Ondřej Surý
c6b0384138 Merge branch '4-update-gitignore-for-future-automake' into 'master'
Update and sort the top level .gitignore to ignore automake files

See merge request isc-projects/bind9!1727
2019-03-20 04:24:41 -04:00
Ondřej Surý
b9d524ed7e Sort the top level .gitignore file 2019-03-20 09:22:22 +01:00
Ondřej Surý
5c67d1d120 Update top level .gitignore to ignore automake files 2019-03-20 09:20:14 +01:00
Michał Kępień
abbdf3d77e Merge branch 'michal/serve-stale-system-test-wait-for-dump-completion' into 'master'
"serve-stale" system test: wait until "rndc dumpdb" completes

See merge request isc-projects/bind9!1712
2019-03-20 04:08:04 -04:00
Michał Kępień
6e3f812afc Wait until "rndc dumpdb" completes
"rndc dumpdb" works asynchronously, i.e. the requested dump may not yet
be fully written to disk by the time "rndc" returns.  Prevent false
positives for the "serve-stale" system test by only checking dump
contents after the line indicating that it is complete is written.
2019-03-20 08:46:58 +01:00
Mark Andrews
cde8df8be4 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1724
2019-03-19 21:43:27 -04:00
Mark Andrews
2bddb0e2af placeholder 2019-03-20 12:24:32 +11:00
Mark Andrews
8bbb9ac3e9 Merge branch 'regen-configure' into 'master'
Regen configure

See merge request isc-projects/bind9!1721
2019-03-19 18:43:00 -04:00
Mark Andrews
db2912b099 clean up virtual-time removal 2019-03-20 09:26:10 +11:00
Ondřej Surý
394848b053 Merge branch '4-remove-unused-virtual-time-tests-copyrights' into 'master'
Cleanup util/copyrights after virtual-time removal

See merge request isc-projects/bind9!1719
2019-03-19 16:38:13 -04:00
Ondřej Surý
66e58dc37e Cleanup util/copyrights after virtual-time removal 2019-03-19 21:37:04 +01:00
Ondřej Surý
6b8414db37 Merge branch '4-make-builtin-test-use-named--V-to-get-version' into 'master'
Make builtin test use dynamic version from named -V

See merge request isc-projects/bind9!1717
2019-03-19 16:35:12 -04:00
Ondřej Surý
e3aa835a8f Make builtin test use dynamic version from named -V 2019-03-19 21:34:31 +01:00
Ondřej Surý
8dde994d24 Merge branch '4-remove-unused-virtual-time-tests' into 'master'
Reduce the software entropy in the BIND source code by removing unused...

See merge request isc-projects/bind9!1718
2019-03-19 16:31:49 -04:00
Ondřej Surý
4286409d6b Reduce the software entropy in the BIND source code by removing unused bin/tests/virtual-time/ directory. 2019-03-19 21:24:12 +01:00
Ondřej Surý
6abf541f9a Merge branch '4-limit-spatch-to-bin-and-lib' into 'master'
Limit spatch to bin, lib and fuzz directories

See merge request isc-projects/bind9!1716
2019-03-19 15:16:19 -04:00
Ondřej Surý
51b9a8960a Limit spatch to bin, lib and fuzz directories 2019-03-19 20:15:27 +01:00
Matthijs Mekking
624bb177c4 Merge branch '757-unsupported-algorithms' into 'master'
Resolve "Investigate and fix what happens when managed-key algorithm is not supported"

Closes #806 and #757

See merge request isc-projects/bind9!1350
2019-03-19 12:31:07 -04:00
Matthijs Mekking
768ded1102 Update CHANGES 2019-03-19 17:14:18 +01:00
Matthijs Mekking
a67dac5d21 Add documentation 2019-03-19 17:14:18 +01:00
Matthijs Mekking
3b7c849a3f DLV tests unsupported/disabled algorithms
This tests both the cases when the DLV trust anchor is of an
unsupported or disabled algorithm, as well as if the DLV zone
contains a key with an unsupported or disabled algorithm.
2019-03-19 17:14:18 +01:00
Michał Kępień
b85007e0a6 Move code handling key loading errors into a common function
Some values returned by dstkey_fromconfig() indicate that key loading
should be interrupted, others do not.  There are also certain subsequent
checks to be made after parsing a key from configuration and the results
of these checks also affect the key loading process.  All of this
complicates the key loading logic.

In order to make the relevant parts of the code easier to follow, reduce
the body of the inner for loop in load_view_keys() to a single call to a
new function, process_key().  Move dstkey_fromconfig() error handling to
process_key() as well and add comments to clearly describe the effects
of various key loading errors.
2019-03-19 17:14:18 +01:00
Matthijs Mekking
4d1ed1283a Also ignore configured revoked trusted anchors 2019-03-19 17:14:18 +01:00
Matthijs Mekking
1d45ad8f39 Ignore trust anchors using disabled algorithm
More specifically: ignore configured trusted and managed keys that
match a disabled algorithm.  The behavioral change is that
associated responses no longer SERVFAIL, but return insecure.
2019-03-19 17:14:18 +01:00
Matthijs Mekking
07c35f32f9 Move algorithm variables, add disabled algorithms
Move from conf.sh.in to conf.sh.common as they will also need to be
added to conf.sh.win32.  Add variables for testing disabled
algorithms.
2019-03-19 17:14:18 +01:00
Matthijs Mekking
924fdad0e5 Add inline test related to unsupported algorithms 2019-03-19 17:14:18 +01:00
Matthijs Mekking
dfcf9bb0ed System tests for tools and unsupported algorithms 2019-03-19 17:14:18 +01:00
Ondřej Surý
8981a07311 Merge branch '4-use-TOP-from-conf.sh-in-ifconfig.sh' into 'master'
Make ifconfig.sh resilient to the directory where it is run

See merge request isc-projects/bind9!1715
2019-03-19 10:39:41 -04:00
Ondřej Surý
f86c15f649 Make ifconfig.sh more resilient to the directory where it is run 2019-03-19 15:26:23 +01:00
Ondřej Surý
f2642f4fb8 Merge branch '4-add-shell-system-test-driver' into 'master'
Add automake-compatible test driver for system tests

See merge request isc-projects/bind9!1714
2019-03-19 10:13:19 -04:00
Ondřej Surý
25a689ec7b Add shell system test driver 2019-03-19 15:09:59 +01:00
Michał Kępień
85ea0edf2f Merge branch '944-make-stop.pl-wait-for-lock-file-cleanup' into 'master'
Make stop.pl wait for lock file cleanup

Closes #944

See merge request isc-projects/bind9!1704
2019-03-19 06:18:35 -04:00
Michał Kępień
c787a539d2 Make stop.pl wait for lock file cleanup
bin/tests/system/stop.pl only waits for the PID file to be cleaned up
while named cleans up the lock file after the PID file.  Thus, the
aforementioned script may consider a named instance to be fully shut
down when in fact it is not.

Fix by also checking whether the lock file exists when determining a
given instance's shutdown status.  This change assumes that if a named
instance uses a lock file, it is called "named.lock".

Also rename clean_pid_file() to pid_file_exists(), so that it is called
more appropriately (it does not clean up the PID file itself, it only
returns the server's identifier if its PID file is not yet cleaned up).
2019-03-19 10:26:36 +01:00
Michał Kępień
4afad2a047 Correctly invoke stop.pl when start.pl fails
MR !1141 broke the way stop.pl is invoked when start.pl fails:

  - start.pl changes the working directory to $testdir/$server before
    attempting to start $server,

  - commit 27ee629e6b causes the $testdir
    variable in stop.pl to be determined using the $SYSTEMTESTTOP
    environment variable, which is set to ".." by all tests.sh scripts,

  - commit e227815af5 makes start.pl pass
    $test (the test's name) rather than $testdir (the path to the test's
    directory) to stop.pl when a given server fails to start.

Thus, when a server is restarted from within a tests.sh script and such
a restart fails, stop.pl attempts to look for the server directory in a
nonexistent location ($testdir/$server/../$test, i.e. $testdir/$test,
instead of $testdir/../$test).  Fix the issue by changing the working
directory before stop.pl is invoked in the scenario described above.
2019-03-19 10:26:36 +01:00
Evan Hunt
bd55366bef Merge branch 'each-bindkeys-comments' into 'master'
update bind.keys comments

See merge request isc-projects/bind9!1707
2019-03-19 00:20:21 -04:00
Evan Hunt
01e7ecfea6 update bind.keys comments 2019-03-18 21:19:40 -07:00
Evan Hunt
ab2d411996 Merge branch '945-remove-revoked-root-key-from-bind-keys' into 'master'
Resolve "Remove revoked root key from bind.keys."

Closes #945

See merge request isc-projects/bind9!1705
2019-03-19 00:12:36 -04:00
Mark Andrews
0e805b58e8 Remove revoked root DNSKEY from bind.keys. 2019-03-19 10:32:42 +11:00
Matthijs Mekking
c3fb2c4c77 Merge branch 'revert-0d379587' into 'master'
Revert "Merge branch 'placeholder-5889' into 'master'"

See merge request isc-projects/bind9!1703
2019-03-18 06:46:01 -04:00
Matthijs Mekking
65d63eda34 Revert "Merge branch 'placeholder-5889' into 'master'"
This reverts merge request !1702
2019-03-18 06:11:26 -04:00
Matthijs Mekking
0d37958723 Merge branch 'placeholder-5889' into 'master'
placeholder

See merge request isc-projects/bind9!1702
2019-03-15 09:03:47 -04:00
Matthijs Mekking
1e1c223a0a placeholder 2019-03-15 13:43:19 +01:00
Evan Hunt
1fbb76ef4d Merge branch '866-deprecate-dnssec-enable' into 'master'
deprecate "dnssec-enable"

Closes #866

See merge request isc-projects/bind9!1666
2019-03-15 02:44:09 -04:00
Evan Hunt
89eed3d0b2 CHANGES, release note 2019-03-14 23:30:13 -07:00
Evan Hunt
885a3d208e remove "dnssec-enable" from all system tests 2019-03-14 23:30:13 -07:00
Evan Hunt
b3ff3bf2e4 remove configuration, syntax checking and implementation of dnssec-enable 2019-03-14 23:29:07 -07:00
Evan Hunt
d069658626 remove references to dnssec-enable in the documentation 2019-03-14 23:29:07 -07:00
Evan Hunt
fd298a2da8 mark "dnssec-enable" as obsolete in the parser 2019-03-14 23:29:07 -07:00
Mark Andrews
92c9d052a2 Merge branch '940-unit-dnstap-pkcs11-tz' into 'master'
Fix regression in dnstap_test with native pkcs11

Closes #940

See merge request isc-projects/bind9!1688
2019-03-15 01:14:24 -04:00
Mark Andrews
788f784191 add CHANGES 2019-03-15 16:08:03 +11:00
Petr Menšík
71c4fad592 Fix regression in dnstap_test with native pkcs11
Change to cmocka broken initialization of TZ environment. This time,
commit 1cf1254051 is not soon enough. Has
to be moved more forward, before any other tests. It library is not full
reinitialized on each test.
2019-03-15 01:03:53 -04:00
Mark Andrews
e4b4361284 Merge branch 'rename-shadowed-variable' into 'master'
rename-shadowed-variable

See merge request isc-projects/bind9!1698
2019-03-14 21:18:57 -04:00
Mark Andrews
15bfe4f2e1 rename-shadowed-variable 2019-03-15 11:13:05 +11:00
Evan Hunt
ef12cdc653 Merge branch 'ondrej/improve-cmdline-printing-to-handle-special-characters' into 'master'
Improve printing of the cmdline to also correctly print the control characters…

See merge request isc-projects/bind9!1280
2019-03-14 17:58:19 -04:00
Joey Salazar
6acc306b10 Test named logs cmd line as expected
Test named logs control characters, special characters and large cmd line respectively as octal escaped, special escaped and elipsis
2019-03-14 14:43:45 -07:00
Ondřej Surý
6335043890 Improve printing of the cmdline
- Print control characters in octal
- Shorten using an ellipsis when necessary
2019-03-14 14:42:50 -07:00
Evan Hunt
31df6789d8 Merge branch '938-cppcheck-format-issues' into 'master'
Resolve "Cppcheck format issues."

Closes #938

See merge request isc-projects/bind9!1685
2019-03-14 16:46:12 -04:00
Mark Andrews
1eba2c5b06 force promotion to unsigned int 2019-03-14 13:34:59 -07:00
Mark Andrews
a43d648b95 isc_quota_* return unsigned int 2019-03-14 13:34:59 -07:00
Evan Hunt
e08e800387 Merge branch '890-assert-the-hevent-rdataset-is-non-null' into 'master'
Resolve "Assert the hevent->rdataset is non-NULL."

Closes #890

See merge request isc-projects/bind9!1543
2019-03-14 16:06:51 -04:00
Mark Andrews
d8d04edfba assert hevent->rdataset is non NULL 2019-03-14 12:47:53 -07:00
Evan Hunt
d27a061fa2 Merge branch '937-potential-null-pointer-dereference-in-bin-tests-system-dlzexternal-driver-c' into 'master'
Resolve "potential null pointer dereference in bin/tests/system/dlzexternal/driver.c"

Closes #937

See merge request isc-projects/bind9!1683
2019-03-14 15:43:15 -04:00
Mark Andrews
7bf6750330 check that state and state->log are non NULL before calling state->log 2019-03-14 15:28:58 -04:00
Evan Hunt
f881c7b4b8 Merge branch 'missing-isc-lang-h' into 'master'
missing #include <isc/lang.h>

See merge request isc-projects/bind9!1687
2019-03-14 15:23:21 -04:00
Mark Andrews
719b1d7fdc missing #include <isc/lang.h> 2019-03-15 00:24:33 +11:00
Mark Andrews
ef978c9279 Merge branch 'u/fanf2/man-dnssec-keygen-again' into 'master'
A bit more cleanup in the dnssec-keygen manual

See merge request isc-projects/bind9!1678
2019-03-13 23:06:05 -04:00
Tony Finch
acc3fa04b7 A bit more cleanup in the dnssec-keygen manual
Remove another remnant of shared secret HMAC-MD5 support.

Explain that with currently recommended setups DNSKEY records are
inserted automatically, but you can still use $INCLUDE in other cases.
2019-03-14 13:22:01 +11:00
Mark Andrews
48a7efafc2 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1681
2019-03-13 21:55:21 -04:00
Mark Andrews
b9a276064b placeholder 2019-03-14 12:53:18 +11:00
Mark Andrews
62ff4bcc07 Merge branch '936-missing-unlocks-in-sdlz-c' into 'master'
Resolve "Missing unlocks in sdlz.c"

Closes #936

See merge request isc-projects/bind9!1677
2019-03-13 17:56:14 -04:00
Mark Andrews
32f2ae3791 add CHANGES 2019-03-14 08:55:35 +11:00
Mark Andrews
ff8bf617e7 add missing MAYBE_UNLOCK 2019-03-13 10:51:56 +11:00
Evan Hunt
7ef3bb20cf Merge branch '881-cleanup-ecs' into 'master'
clean up ECS before reusing clients

Closes #881

See merge request isc-projects/bind9!1675
2019-03-12 16:56:26 -04:00
Evan Hunt
9463a781fb CHANGES 2019-03-12 13:38:06 -07:00
Witold Kręcicki
aa3da7a232 Clean up client->ecs when we're done with the request. 2019-03-12 13:35:28 -07:00
Evan Hunt
44c8202b0c Merge branch '834-fix-race-in-fctx-cancel' into 'master'
fix race in socket code

Closes #834

See merge request isc-projects/bind9!1671
2019-03-12 14:35:57 -04:00
Witold Kręcicki
50f6054294 CHANGES 2019-03-12 11:04:09 -07:00
Witold Kręcicki
56183a3917 Fix a race in fctx_cancelquery.
When sending an udp query (resquery_send) we first issue an asynchronous
isc_socket_connect and increment query->connects, then isc_socket_sendto2
and increment query->sends.
If we happen to cancel this query (fctx_cancelquery) we need to cancel
all operations we might have issued on this socket. If we are under very high
load the callback from isc_socket_connect (resquery_udpconnected) might have
not yet been fired. In this case we only cancel the CONNECT event on socket,
and ignore the SEND that's waiting there (as there is an `else if`).
Then we call dns_dispatch_removeresponse which kills the dispatcher socket
and calls isc_socket_close - but if system is under very high load, the send
we issued earlier might still not be complete - which triggers an assertion
because we're trying to close a socket that's still in use.

The fix is to always check if we have incomplete sends on the socket and cancel
them if we do.
2019-03-12 18:42:35 +01:00
Michał Kępień
3365064fb6 Merge branch 'michal/silence-a-perl-warning-output-by-stop.pl' into 'master'
Silence a Perl warning output by stop.pl

See merge request isc-projects/bind9!1649
2019-03-12 04:04:12 -04:00
Michał Kępień
91e5a99b9b Silence a Perl warning output by stop.pl
On Unix systems, the CYGWIN environment variable is not set at all when
BIND system tests are run.  If a named instance crashes on shutdown or
otherwise fails to clean up its pidfile and the CYGWIN environment
variable is not set, stop.pl will print an uninitialized value warning
on standard error.  Prevent this by using defined().
2019-03-12 08:42:48 +01:00
Mark Andrews
985d9d9c84 Merge branch 'ifconfig.sh-anywhere' into 'master'
Allow ifconfig to be called from any directory

See merge request isc-projects/bind9!1563
2019-03-11 23:08:52 -04:00
Petr Menšík
38301052e1 Allow ifconfig to be called from any directory
ifconfig.sh depends on config.guess for platform guessing. It uses it to
choose between ifconfig or ip tools to configure interfaces. If
system-wide automake script is installed and local was not found, use
platform guess. It should work well on mostly any sane platform. Still
prefers local guess, but passes when if cannot find it.
2019-03-11 22:19:49 -04:00
Michał Kępień
faa0de1349 Merge branch '928-stabilize-delzsk.example-zone-checks' into 'master'
Stabilize "delzsk.example" zone checks

See merge request isc-projects/bind9!1640
2019-03-11 08:28:13 -04:00
Michał Kępień
e02de04e97 Stabilize "delzsk.example" zone checks
When a zone is converted from NSEC to NSEC3, the private record at zone
apex indicating that NSEC3 chain creation is in progress may be removed
during a different (later) zone_nsec3chain() call than the one which
adds the NSEC3PARAM record.  The "delzsk.example" zone check only waits
for the NSEC3PARAM record to start appearing in dig output while private
records at zone apex directly affect "rndc signing -list" output.  This
may trigger false positives for the "autosign" system test as the output
of the "rndc signing -list" command used for checking ZSK deletion
progress may contain extra lines which are not accounted for.  Ensure
the private record is removed from zone apex before triggering ZSK
deletion in the aforementioned check.

Also future-proof the ZSK deletion progress check by making it only look
at lines it should care about.
2019-03-11 13:02:54 +01:00
Michał Kępień
5ac5d90620 Merge branch '129-dnssec-system-test-tweaks' into 'master'
"dnssec" system test tweaks

Closes #129

See merge request isc-projects/bind9!1545
2019-03-11 08:02:06 -04:00
Mark Andrews
dee1f1a498 ${ttl} must exist and be non null 2019-03-11 12:04:44 +01:00
Michał Kępień
a85cc41486 Make ANSWER TTL capping checks stricter
For checks querying a named instance with "dnssec-accept-expired yes;"
set, authoritative responses have a TTL of 300 seconds.  Assuming empty
resolver cache, TTLs of RRsets in the ANSWER section of the first
response to a given query will always match their authoritative
counterparts.  Also note that for a DNSSEC-validating named resolver,
validated RRsets replace any existing non-validated RRsets with the same
owner name and type, e.g. cached from responses received while resolving
CD=1 queries.  Since TTL capping happens before a validated RRset is
inserted into the cache and RRSIG expiry time does not impose an upper
TTL bound when "dnssec-accept-expired yes;" is set and, as pointed out
above, the original TTLs of the relevant RRsets equal 300 seconds, the
RRsets in the ANSWER section of the responses to expiring.example/SOA
and expired.example/SOA queries sent with CD=0 should always be exactly
120 seconds, never a lower value.  Make the relevant TTL checks stricter
to reflect that.
2019-03-11 12:04:42 +01:00
Michał Kępień
8baf859063 Relax ADDITIONAL TTL capping checks
Always expecting a TTL of exactly 300 seconds for RRsets found in the
ADDITIONAL section of responses received for CD=1 queries sent during
TTL capping checks is too strict since these responses will contain
records cached from multiple DNS messages received during the resolution
process.

In responses to queries sent with CD=1, ns.expiring.example/A in the
ADDITIONAL section will come from a delegation returned by ns2 while the
ANSWER section will come from an authoritative answer returned by ns3.
If the queries to ns2 and ns3 happen at different Unix timestamps,
RRsets cached from the older response will have a different TTL by the
time they are returned to dig, triggering a false positive.

Allow a safety margin of 60 seconds for checks inspecting the ADDITIONAL
section of responses to queries sent with CD=1 to fix the issue.  A
safety margin this large is likely overkill, but it is used nevertheless
for consistency with similar safety margins used in other TTL capping
checks.
2019-03-11 12:04:42 +01:00
Michał Kępień
a597bd52a6 Fix message section checked in a TTL capping test
Commit c032c54dda inadvertently changed
the DNS message section inspected by one of the TTL capping checks from
ADDITIONAL to ANSWER, introducing a discrepancy between that check's
description and its actual meaning.  Revert to inspecting the ADDITIONAL
section in the aforementioned check.
2019-03-11 12:04:42 +01:00
Michał Kępień
9a36a1bba3 Fix NTA-related races
Changes introduced by commit 6b8e4d6e69
were incomplete as not all time-sensitive checks were updated to match
revised "nta-lifetime" and "nta-recheck" values.  Prevent rare false
positives by updating all NTA-related checks so that they work reliably
with "nta-lifetime 12s;" and "nta-recheck 9s;".  Update comments as well
to prevent confusion.
2019-03-11 12:04:42 +01:00
Mark Andrews
8555fe8b4b Merge branch '803-add-return-code-to-allow-dlz-s-allowzonexfr-to-fall-back-to-to-the-view-s-allow-transfer-setting' into 'master'
Resolve "Add return code to allow dlz's allowzonexfr to fall back to to the view's allow-transfer setting."

Closes #803

See merge request isc-projects/bind9!1292
2019-03-10 23:42:17 -04:00
Evan Hunt
7cc241ca39 CHANGES 2019-03-11 14:27:13 +11:00
Evan Hunt
e2062879c1 test the use of the view ACL in DLZ 2019-03-11 14:27:13 +11:00
Mark Andrews
a520662ed4 allow dlz to signal that the view's transfer acl should be used 2019-03-11 14:27:13 +11:00
Ondřej Surý
76085b7e9c Merge branch 'ondrej/restore-flockfile-check' into 'master'
Restore missing check for flockfile and getc_unlocked

See merge request isc-projects/bind9!1653
2019-03-08 15:34:16 -05:00
Ondřej Surý
7eea756858 Restore missing check for flockfile and getc_unlocked 2019-03-08 21:20:20 +01:00
Ondřej Surý
a6bb44493c Merge branch '4-use-autoconf-check-for-lfs-support' into 'master'
autoconf has native support for detecting LFS support

See merge request isc-projects/bind9!1652
2019-03-08 15:14:57 -05:00
Ondřej Surý
0eff9a184a Enable LFS using standard autoconf macros 2019-03-08 20:29:34 +01:00
Ondřej Surý
5caf126267 Merge branch '4-set-crlf-in-all-vcxproj-files' into 'master'
Set crlf in all *.vcxproj.* files

See merge request isc-projects/bind9!1651
2019-03-08 12:05:42 -05:00
Ondřej Surý
a04a390195 Convert *.vcxproj.user to CRLF line endings 2019-03-08 18:01:48 +01:00
Ondřej Surý
1b53e939ed Set crlf in all *.vcxproj.* files 2019-03-08 17:59:44 +01:00
Ondřej Surý
d49e9181a0 Merge branch '4-autoinclude-config.h' into 'master'
Use compiler directive to include config.h as a first file

See merge request isc-projects/bind9!1650
2019-03-08 11:39:20 -05:00
Ondřej Surý
2621db706e Update dev documentation to explicitly mention that #include <config.h> should not be used 2019-03-08 17:14:38 +01:00
Ondřej Surý
c2637c8429 Use ForcedIncludeFiles directive to include config.h everywhere automatically 2019-03-08 17:14:38 +01:00
Ondřej Surý
a96393e837 Don't generate #include <config.h> line from mksymtbl.pl 2019-03-08 15:15:05 +01:00
Ondřej Surý
ccfe54f541 Remove config.h check from util/checklibs.sh 2019-03-08 15:15:05 +01:00
Ondřej Surý
1b25d8a0ca Remove explicit '#include <config.h>' from the header files (the include should not have been there in the first place) 2019-03-08 15:15:05 +01:00
Ondřej Surý
78d0cb0a7d Use coccinelle to remove explicit '#include <config.h>' from the source files 2019-03-08 15:15:05 +01:00
Ondřej Surý
0b9f7f8a38 Add semantic patch to remove occurences of '#include <config.h>' 2019-03-08 15:15:05 +01:00
Ondřej Surý
15c46a397e Use -include directive to always include config.h 2019-03-08 14:33:49 +01:00
Michał Kępień
893c65ce3f Merge branch 'michal/fix-regex-used-for-mangling-druz-dnskey' into 'master'
Fix regex used for mangling druz/DNSKEY (in the "dlv" system test)

See merge request isc-projects/bind9!1641
2019-03-08 08:08:55 -05:00
Michał Kępień
fd13fef299 Fix regex used for mangling druz/DNSKEY
During "dlv" system test setup, the "sed" regex used for mangling the
DNSKEY RRset for the "druz" zone does not include the plus sign ("+"),
which may:

  - cause the replacement to happen near the end of DNSKEY RDATA, which
    can cause the latter to become an invalid Base64 string,

  - prevent the replacement from being performed altogether.

Both cases prevent the "dlv" system test from behaving as intended and
may trigger false positives.  Add the missing character to the
aforementioned regex to ensure the replacement is always performed on
bytes 10-25 of DNSKEY RDATA.
2019-03-08 13:47:13 +01:00
Michał Kępień
570f56ab77 Merge branch '925-make-delv-use-os-supplied-ephemeral-port-range' into 'master'
Make delv use OS-supplied ephemeral port range

Closes #925

See merge request isc-projects/bind9!1611
2019-03-08 07:46:07 -05:00
Michał Kępień
bf98324956 Add CHANGES entry
5180.	[bug]		delv now honors the operating system's preferred
			ephemeral port range. [GL #925]
2019-03-08 13:13:32 +01:00
Michał Kępień
ada6846a10 Make delv use OS-supplied ephemeral port range
Make delv honor the operating system's preferred ephemeral port range
instead of always using the default 1024-65535 range for outgoing
messages.
2019-03-08 13:13:32 +01:00
Mark Andrews
99138abe38 Merge branch 'u/fanf2/sectypes' into 'master'
cleanup: use dns_secalg_t and dns_dsdigest_t where appropriate

See merge request isc-projects/bind9!1498
2019-03-08 03:26:18 -05:00
Tony Finch
0f219714e1 cleanup: use dns_secalg_t and dns_dsdigest_t where appropriate
Use them in structs for various rdata types where they are missing.
This doesn't change the structs since we are replacing explicit
uint8_t field types with aliases for uint8_t.

Use dns_dsdigest_t in library function arguments.

Improve dnssec-cds with these more specific types.
2019-03-08 18:37:50 +11:00
Mark Andrews
f285dd9a08 Merge branch 'marka-define-path-max' into 'master'
#include <limits.h> for PATH_MAX, define if not found

See merge request isc-projects/bind9!1635
2019-03-08 02:21:46 -05:00
Mark Andrews
1fc7be36eb #include <limits.h> for PATH_MAX, define if not found 2019-03-08 17:15:01 +11:00
Evan Hunt
ce6f3d4bb4 Merge branch 'each-silence-warning' into 'master'
silence a warning about potential snprintf overrun

See merge request isc-projects/bind9!1558
2019-03-08 00:46:17 -05:00
Evan Hunt
7f26cad247 silence a warning about potential snprintf overrun 2019-03-08 00:27:49 -05:00
Evan Hunt
3fe7acaa6f Merge branch '902-hang-when-unexpected-errno-encountered-during-log-rename' into 'master'
Resolve "Hang when unexpected errno encountered during log rename"

Closes #902

See merge request isc-projects/bind9!1567
2019-03-08 00:22:35 -05:00
Mark Andrews
435ae2f29a Handle EDQUOT and ENOSPC errors 2019-03-07 21:02:48 -08:00
Evan Hunt
fced495d47 Merge branch '884-patches-to-review-3' into 'master'
fix the use of dns_wildcardname as an optimisation in DLZ

Closes #884

See merge request isc-projects/bind9!1532
2019-03-07 23:18:49 -05:00
Mark Andrews
cb32cd98bd fix the use of dns_wildcardname as an optimisation in DLZ 2019-03-07 19:59:29 -08:00
Evan Hunt
c37e78539c Merge branch 'ckb-statistics-test-nit' into 'master'
the wrong variable was used to count the test cases in one place.

See merge request isc-projects/bind9!1625
2019-03-07 20:32:49 -05:00
Curtis Blackburn
4f60a84e34 the wrong variable was used to count the test cases in one place. 2019-03-07 20:15:14 -05:00
Mark Andrews
dad333b644 Merge branch '927-teach-clang-that-_fail-does-not-return' into 'master'
Resolve "teach clang that _fail() does not return."

Closes #927

See merge request isc-projects/bind9!1621
2019-03-07 20:11:53 -05:00
Mark Andrews
3f2b7e1006 add noreturn attribute 2019-03-07 16:45:04 +11:00
Evan Hunt
a4c60a9f08 Merge branch '865-option-to-disable-information-leak-on-rpz-rewrites-isc-support-14178' into 'master'
Resolve "Option to disable information leak on RPZ rewrites [ISC-support #14178]"

Closes #865

See merge request isc-projects/bind9!1514
2019-03-07 00:16:42 -05:00
Mark Andrews
89234643e1 CHANGES, release note 2019-03-06 20:48:34 -08:00
Evan Hunt
aeed047495 disable a previously broken test under dnsrps 2019-03-06 20:48:30 -08:00
Mark Andrews
d1fa8be611 add the ability to control whether SOA records are added response-policy modified answers 2019-03-06 20:47:28 -08:00
Mark Andrews
3d512a7e26 Merge branch '926-statschannel-system-tests-fails-json-only-no-libxml' into 'master'
Resolve "statschannel system tests fails json only (no libxml)"

Closes #926

See merge request isc-projects/bind9!1614
2019-03-06 18:42:46 -05:00
Mark Andrews
5bc06a0a11 add CHANGES 2019-03-07 10:25:15 +11:00
Mark Andrews
a9c47414b3 remove dependancy on libxml 2019-03-07 10:09:33 +11:00
Evan Hunt
8b637a1d2f Merge branch '882-zone-data-cannot-be-loaded-with-dnssec-coverage' into 'master'
Resolve "Zone data cannot be loaded with dnssec-coverage"

Closes #882

See merge request isc-projects/bind9!1522
2019-03-06 17:35:05 -05:00
Evan Hunt
57e44efc73 add CHANGES 2019-03-06 14:22:58 -08:00
Mark Andrews
ec3d830bc5 explicitly convert byte to string 2019-03-06 14:17:45 -08:00
Evan Hunt
918fabb65f Merge branch 'u/fanf2/man-dnssec-keygen' into 'master'
cleanup dnssec-keygen manual page

See merge request isc-projects/bind9!1557
2019-03-06 17:13:38 -05:00
Tony Finch
1954f8d2bf cleanup dnssec-keygen manual page
Alphabetize options and synopsis; remove spurious -z from synopsis;
remove remnants of deprecated -k option; remove mention of long-gone
TSIG support; refer to -T KEY in options that are only relevant to
pre-RFC3755 DNSSEC; remove unnecessary -n ZONE from the example, and
add a -f KSK example.
2019-03-06 13:24:56 -08:00
Evan Hunt
52d90da41e Merge branch '874-fix-race-in-socket-code' into 'master'
Fix a race in socket code

Closes #874

See merge request isc-projects/bind9!1590
2019-03-06 16:19:10 -05:00
Evan Hunt
6d24292830 CHANGES 2019-03-06 12:56:24 -08:00
Witold Kręcicki
b57a38ae43 Fix a race in socket code when internal_{accept, send, receive} is called
from event loop on an socket and, in the meantime, someone has closed this
socket.
2019-03-06 12:56:11 -08:00
Evan Hunt
0e67a73bdf Merge branch 'michal/log-plugin-unloading-at-debug-level' into 'master'
Log plugin unloading at debug level

See merge request isc-projects/bind9!1608
2019-03-06 15:30:40 -05:00
Michał Kępień
af4b81f944 Log plugin unloading at debug level
During server reconfiguration, plugin instances set up for the old views
are unloaded very close to the end of the whole process, after new
plugin instances are set up.  As the log message announcing plugin
unloading is emitted at the default "info" level, the user might be
misled into thinking that it is the new plugin instances that are being
unloaded for some reason, particularly because all other messages logged
at the "info" level around the same time inform about setting things up
rather than tearing them down.  Since no distinction is currently made
between destroying a view due to reconfiguration and due to a shutdown
in progress, there is no easy way to vary the contents of the log
message depending on circumstances.  Since this message is not a
particularly critical one, demote it to debug level to prevent
confusion.
2019-03-06 15:19:07 -05:00
Michał Kępień
68ff5f0ebd Merge branch '905-make-nsupdate-use-os-supplied-ephemeral-port-range' into 'master'
Make nsupdate use OS-supplied ephemeral port range

Closes #905

See merge request isc-projects/bind9!1569
2019-03-06 08:27:39 -05:00
Michał Kępień
0e64948274 Add CHANGES entry
5172.	[bug]		nsupdate now honors the operating system's preferred
			ephemeral port range. [GL #905]
2019-03-06 14:02:12 +01:00
Michał Kępień
06f582f23e Make nsupdate use OS-supplied ephemeral port range
Make nsupdate honor the operating system's preferred ephemeral port
range instead of always using the default 1024-65535 range for outgoing
messages.
2019-03-06 14:01:24 +01:00
Evan Hunt
960ddd5381 Merge branch '878-install-named-plugins-into-a-separate-directory' into 'master'
Install named plugins into a separate directory

Closes #878

See merge request isc-projects/bind9!1512
2019-03-05 19:44:49 -05:00
Michał Kępień
d2c960cfc2 Add CHANGES entry
5161.	[func]		named plugins are now installed into a separate
			directory.  Supplying a filename (a string without path
			separators) in a "plugin" configuration stanza now
			causes named to look for that plugin in that directory.
			[GL #878]
2019-03-05 16:06:25 -08:00
Michał Kępień
cba155154b Add -c to usage message for named-checkconf
Add the -c command line option to the usage message for named-checkconf
as it is not present there despite being documented.
2019-03-05 16:06:25 -08:00
Michał Kępień
1a9fc624ca Look for named plugins in ${libdir}/named
When the "library" part of a "plugin" configuration stanza does not
contain at least one path separator, treat it as a filename and assume
it is a name of a shared object present in the named plugin installation
directory.  Absolute and relative paths can still be used and will be
used verbatim.  Get the full path to a plugin before attempting to
check/register it so that all relevant log messages include the same
plugin path (apart from the one logged when the full path cannot be
determined).
2019-03-05 16:06:25 -08:00
Michał Kępień
d181c28c60 Add ns_plugin_expandpath()
Implement a helper function which, given an input string:

  - copies it verbatim if it contains at least one path separator,
  - prepends the named plugin installation directory to it otherwise.

This function will allow configuration parsing code to conveniently
determine the full path to a plugin module given either a path or a
filename.

While other, simpler ways exist for making sure filenames passed to
dlopen() cause the latter to look for shared objects in a specific
directory, they are very platform-specific.  Using full paths is thus
likely the most portable and reliable solution.

Also added unit tests for ns_plugin_expandpath() to ensure it behaves
as expected for absolute paths, relative paths, and filenames, for
various target buffer sizes.

(Note: plugins share a directory with named on Windows; there is no
default plugin path. Therefore the source path is copied to the
destination path with no modification.)
2019-03-05 16:06:24 -08:00
Michał Kępień
c527b7fd5c Install named plugins into a separate directory
Installing named plugins into ${libdir} clutters the latter and is not
in line with common filesystem conventions.  Instead, install named
plugins into a separate directory, ${libdir}/named.
2019-03-05 15:53:04 -08:00
Evan Hunt
a1c9db1baa Merge branch '909-add-explicit-link-check-for-libatomic' into 'master'
Add explicit check for libatomic to fix configure step on NetBSD

Closes #909

See merge request isc-projects/bind9!1586
2019-03-05 18:17:26 -05:00
Ondřej Surý
9a16e0a5ae Add information about NetBSD 6 compilation on i386 2019-03-05 14:27:18 -08:00
Ondřej Surý
fcade0610f Add explicit check for libatomic 2019-03-05 14:24:18 -08:00
Evan Hunt
db7a7357a6 Merge branch '884-patches-to-review-4' into 'master'
dlz filesystem driver failed to properly detect period at end of filename.

Closes #884

See merge request isc-projects/bind9!1533
2019-03-05 17:18:47 -05:00
Mark Andrews
c9dc59eb90 properly detect period as last character in filename 2019-03-05 13:50:22 -08:00
Evan Hunt
648aef129d Merge branch 'michal/disable-servfail-cache-for-ns5-in-the-mkeys-system-test' into 'master'
Disable SERVFAIL cache for ns5 in the "mkeys" system test

See merge request isc-projects/bind9!1585
2019-03-05 16:23:59 -05:00
Michał Kępień
7c6bff3c4e Disable SERVFAIL cache for ns5 in the "mkeys" system test
The "check key refreshes are resumed after root servers become
available" check may trigger a false positive for the "mkeys" system
test if the second example/TXT query sent by dig is received by ns5 less
than a second after it receives a REFUSED response to the upstream query
it sends to ns1 in order to resolve the first example/TXT query sent by
dig.  Since that REFUSED response from ns1 causes ns5 to return a
SERVFAIL answer to dig, example/TXT is added to the SERVFAIL cache,
which is enabled by default with a TTL of 1 second.  This in turn may
cause ns5 to return a cached SERVFAIL response to the second example/TXT
query sent by dig, i.e. make ns5 not perform full query processing as
expected by the check.

Since the primary purpose of the check in question is to ensure that key
refreshes are resumed once initially unavailable root servers become
available, the optimal solution appears to be disabling SERVFAIL cache
for ns5 as doing that still allows the check to fulfill its purpose and
it is arguably more prudent than always sleeping for 1 second.
2019-03-05 11:48:26 -08:00
Evan Hunt
ea95d85091 Merge branch '889-improve-clang-cmocka-interaction' into 'master'
Resolve "Improve clang/cmocka interaction."

Closes #889

See merge request isc-projects/bind9!1542
2019-03-05 13:34:30 -05:00
Mark Andrews
cb913177ae improve clang / cmocka integration 2019-03-05 10:20:29 -08:00
Mark Andrews
12a8574aea Merge branch '919-add-win32util-configure-file-list-check-to-ci' into 'master'
Resolve "Add win32util/Configure file list check to CI"

Closes #919

See merge request isc-projects/bind9!1594
2019-03-05 01:28:46 -05:00
Mark Andrews
442421906b remove '..\\bin\\tests\\system\\dlz\\prereq.sh' from win32util/Configure 2019-03-05 17:11:20 +11:00
Mark Andrews
c3dd8bb9f0 add util/check-win32util-configure to precheck 2019-03-05 17:11:20 +11:00
Matthijs Mekking
bbeff24049 Merge branch 'matthijs/more-clean.sh-related-cleanups' into 'master'
More clean.sh-related cleanups

See merge request isc-projects/bind9!1579
2019-03-04 10:54:16 -05:00
Matthijs Mekking
e410803919 Ensure all system tests run clean.sh from setup.sh
For consistency between all system tests, add missing setup.sh scripts
for tests which do not have one yet and ensure every setup.sh script
calls its respective clean.sh script.
2019-03-04 16:26:06 +01:00
Matthijs Mekking
c64ed484c8 Only perform test cleanups in clean.sh scripts
Temporary files created by a given system test should be removed by its
clean.sh script, not its setup.sh script.  Remove redundant "rm"
invocations from setup.sh scripts.  Move required "rm" invocations from
setup.sh scripts to their corresponding clean.sh scripts.
2019-03-04 16:26:06 +01:00
Mark Andrews
7f6cc1b405 Merge branch 'feature/featuretest-dlz' into 'master'
Test dlz support in feature-test

See merge request isc-projects/bind9!1587
2019-03-03 22:04:37 -05:00
Mark Andrews
5f125df462 add CHANGES 2019-03-04 14:03:23 +11:00
Mark Andrews
4988367b53 run autoheader and autoconf 2019-03-04 09:37:42 +11:00
Petr Menšík
759a7b4ce3 Support DLZ filesystem detection in feature-test
Do not use variable from configure to detect the feature.
2019-03-01 17:41:06 +01:00
Michał Kępień
03dcdb88a2 Merge branch 'michal/fix-ip-regex-used-in-the-resolver-system-test' into 'master'
Fix IP regex used in the "resolver" system test

See merge request isc-projects/bind9!1568
2019-03-01 01:55:42 -05:00
Michał Kępień
70ae48e5cb Fix IP regex used in the "resolver" system test
If dots are not escaped in the "1.2.3.4" regular expressions used for
checking whether IP address 1.2.3.4 is present in the tested resolver's
answers, a COOKIE that matches such a regular expression will trigger a
false positive for the "resolver" system test.  Properly escape dots in
the aforementioned regular expressions to prevent that from happening.
2019-03-01 01:32:54 -05:00
Evan Hunt
ccdeacf45e Merge branch '901-empty-any' into 'master'
handle empty ANY query responses

Closes #901

See merge request isc-projects/bind9!1580
2019-02-28 19:05:44 -05:00
Evan Hunt
4ad0bc38e9 CHANGES, release notes 2019-02-28 15:00:38 -08:00
Evan Hunt
c6939f0bd4 test correct occlusion of DNSSEC records 2019-02-28 15:00:38 -08:00
Evan Hunt
3e74c7e5ff fix crash in query_respond_any() from all records being hidden
in query_respond_any(), the assumption had previously been made that it
was impossible to get past iterating the node with a return value of
ISC_R_NOMORE but not have found any records, unless we were searching
for RRSIG or SIG. however, it is possible for other types to exist but
be hidden, such as when the zone is transitioning from insecure to
secure and DNSSEC types are encountered, and this situation could
trigger an assertion.  removed the assertion and reorganized the code.
2019-02-28 13:55:47 -08:00
Michał Kępień
cdbae0013b Merge branch 'michal/do-not-include-conf.sh-from-ttl-clean.sh' into 'master'
Do not include conf.sh from ttl/clean.sh

See merge request isc-projects/bind9!1564
2019-02-28 07:42:42 -05:00
Michał Kępień
6602848460 Do not include conf.sh from ttl/clean.sh
Including $SYSTEMTESTTOP/conf.sh from a system test's clean.sh script is
not needed for anything while it causes an error message to be printed
out when "./configure" is run, as "make clean" is invoked at the end.
Remove the offending line to prevent the error from occurring.
2019-02-28 13:17:01 +01:00
Michał Kępień
d571b33468 Merge branch 'michal/call-clean.sh-from-all-relevant-setup.sh-scripts' into 'master'
Call clean.sh from all relevant setup.sh scripts

See merge request isc-projects/bind9!1565
2019-02-28 07:11:00 -05:00
Michał Kępień
a077a3ae8a Call clean.sh from all relevant setup.sh scripts
For all system tests utilizing named instances, call clean.sh from each
test's setup.sh script in a consistent way to make sure running the same
system test multiple times using run.sh does not trigger false positives
caused by stale files created by previous runs.

Ideally we would just call clean.sh from run.sh, but that would break
some quirky system tests like "rpz" or "rpzrecurse" and being consistent
for the time being does not hurt.
2019-02-28 12:34:10 +01:00
Matthijs Mekking
a111c8d739 Merge branch '813-matthijs-failure-loading-rpz' into 'master'
Resolve "Problems after failure of loading rpz [ISC-support #14002]"

Closes #813

See merge request isc-projects/bind9!1507
2019-02-22 09:05:46 -05:00
Matthijs Mekking
e5565808e4 Update CHANGES 2019-02-22 14:00:01 +01:00
Matthijs Mekking
6ed14eff25 Unregister RPZ CATZ db cbs when zone load fails
In case when a zone fails to load because the file does not exist
or is malformed, we should not run the callback that updates the
zone database when the load is done.  This is achieved by
unregistering the callbacks if at zone load end if the result
indicates something else than success.
2019-02-22 13:59:10 +01:00
Matthijs Mekking
84700f9783 Update copyrights 2019-02-22 13:59:10 +01:00
Matthijs Mekking
ce5476acf0 Add test for rpz zone load fail 2019-02-22 13:59:10 +01:00
Matthijs Mekking
6756280242 Remove rpz->db_registered
As pointed out in !813 db_registered is sort of redundant.  It is
set to `true` only in `dns_zone_rpz_enable_db()` right before the
`dns_rpz_dbupdate_callback()` callback is registered.  It is only
required in that callback and it is the only place that the callback
is registered.  Therefore there is no path that that `REQUIRE` can
fail.

The `db_registered` variable is only set to `false` in
`dns_rpz_new_zone`, so it is not like the variable is unset again
later.

The only other place where `db_registered` is checked is in
`rpz_detach()`.  If `true`, it will call
`dns_db_updatenotify_unregister()`.  However if that happens, the
`db_registered` is not set back to `false` thus this implies that
this may happen multiple times.  If called a second time, most
likely the unregister function will return `ISC_R_NOTFOUND`, but
the return value is not checked anyway.  So it can do without the
`db_registered` check.
2019-02-22 13:59:10 +01:00
Matthijs Mekking
2e5e429644 Add curly brackets on if statements 2019-02-22 13:59:10 +01:00
Matthijs Mekking
a490c09121 named crashes on shutdown after load rpz failed
This may happen when loading an RPZ failed and the code path skips
calling dns_db_endload().  The dns_rpz_zone_t object is still kept
marked as having registered db.  So when this object is finally
destroyed in rpz_detach(), this code will incorrectly call
`dns_db_updatenotify_unregister()`:

   if (rpz->db_registered)
     dns_db_updatenotify_unregister(rpz->db,
                                    dns_rpz_dbupdate_callback, rpz);

and trigger this assertion failure:

   REQUIRE(db != NULL);

To fix this, only call `dns_db_updatenotify_unregister()` when
`rpz->db` is not NULL.
2019-02-22 13:59:10 +01:00
Matthijs Mekking
8d392f9093 Make RPZ tests more readable 2019-02-22 13:59:10 +01:00
Matthijs Mekking
9ecdb292c4 Add README to RPZ tests 2019-02-22 13:59:10 +01:00
Mark Andrews
f9b50a4019 Merge branch '892-fix-redirect-name' into 'master'
use qname in redirect2

Closes #892

See merge request isc-projects/bind9!1561
2019-02-22 00:42:34 -05:00
Mark Andrews
ad785e4f93 add CHANGES 2019-02-22 16:25:34 +11:00
Mark Andrews
8758d36a5e use client->query.qname 2019-02-22 00:04:52 -05:00
Evan Hunt
138268b78a Merge branch 'prep-915' into 'master'
documentation changes setting up 9.15 development branch

See merge request isc-projects/bind9!1560
2019-02-21 21:03:19 -05:00
Evan Hunt
efb0d1e83d documentation changes setting up 9.15 development branch 2019-02-21 16:42:17 -08:00
Evan Hunt
d7b82380ff Merge branch 'fix-changes' into security-master 2019-02-20 19:44:40 -08:00
Evan Hunt
15b18d8a38 remove "released" line (retained in v9_14) so check-changes won't complain 2019-02-20 19:44:40 -08:00
Evan Hunt
8514320271 Merge branch 'security-dlz-axfr-deny-broken' into security-master
denied axfr requests were not effective for writable DLZ zones

See merge request isc-private/bind9!57
2019-02-20 19:44:39 -08:00
Mark Andrews
821f917db8 add CHANGES and release notes entries 2019-02-20 19:44:38 -08:00
Mark Andrews
a9307de85e denied axfr requests were not effective for writable DLZ zones 2019-02-20 19:44:38 -08:00
Evan Hunt
5e7f1a8d67 Merge 'keytag-memleak' into security-master 2019-02-20 19:44:37 -08:00
Evan Hunt
747035dcc5 fix test error 2019-02-20 19:44:37 -08:00
Mark Andrews
9ae991751c add CHANGES and release note entries 2019-02-20 19:44:37 -08:00
Mark Andrews
fe4810f1f8 check that multiple KEY-TAG trust-anchor-telemetry options don't leak memory 2019-02-20 19:44:36 -08:00
Mark Andrews
35025b6e88 silently ignore additional keytag options 2019-02-20 19:44:36 -08:00
Evan Hunt
6f1ac89c1a Merge 'managed-key-assert' into security-master 2019-02-20 19:44:35 -08:00
Evan Hunt
41a851861e Merge 'managed-key-assert' into security-master 2019-02-20 19:44:34 -08:00
Evan Hunt
3022633d79 use algorithm 255 for both unsupported keys 2019-02-20 19:44:34 -08:00
Matthijs Mekking
e7c12bffbd CHANGES, notes 2019-02-20 19:44:33 -08:00
Matthijs Mekking
f09352d20a Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key.
2019-02-20 19:44:33 -08:00
Matthijs Mekking
38c2bdba0a Add tests for mkeys with unsupported algorithm
These tests check if a key with an unsupported algorithm in
managed-keys is ignored and when seeing an algorithm rollover to
an unsupported algorithm, the new key will be ignored too.
2019-02-20 19:44:33 -08:00
Matthijs Mekking
235a64a5a4 Don't free key in compute_tag in case of failure
If `dns_dnssec_keyfromrdata` failed we don't need to call
`dst_key_free` because no `dstkey` was created.  Doing so
nevertheless will result in an assertion failure.

This can happen if the key uses an unsupported algorithm.
2019-02-20 19:44:32 -08:00
Evan Hunt
91550e21cd Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1551
2019-02-20 21:41:58 -05:00
Evan Hunt
5893689592 placeholder 2019-02-20 18:41:26 -08:00
Evan Hunt
3d1bb8038e Merge branch 'start-915' into 'master'
9.15.0-dev

See merge request isc-projects/bind9!1550
2019-02-20 21:23:51 -05:00
Evan Hunt
040c23e3d7 9.15.0-dev 2019-02-20 18:22:54 -08:00
Evan Hunt
f4ade46f4a Merge branch '428-remove-contrib-sdb' into 'master'
remove contrib/sdb

Closes #428

See merge request isc-projects/bind9!1501
2019-02-19 20:47:55 -05:00
Evan Hunt
bcc2fd679b CHANGES 2019-02-19 17:19:40 -08:00
Evan Hunt
c79e2f12fe remove contrib/sdb
removed the SDB databases in contrib/sdb as they hadn't been
maintained in some time, and were no longer able to link to named
without modification.  also:

- cleaned up contrib/README, which still referred to contrib
  subdirectores that were removed already, and linked to an obsolete URL.
- removed references to sdb in doc/misc/roadmap and doc/misc/sdb.
2019-02-19 17:19:40 -08:00
Mark Andrews
d27f41cb7f Merge branch '884-patches-to-review' into 'master'
Correct errno to result translation

Closes #884

See merge request isc-projects/bind9!1519
2019-02-19 18:11:42 -05:00
Mark Andrews
a0c0d76029 add CHANGES 2019-02-20 09:44:56 +11:00
Mark Andrews
218ce34e7d correct errno to result translation 2019-02-20 09:43:16 +11:00
Mark Andrews
fa79f4b899 Merge branch '836-building-fails-in-build-subdirectory-when-dnstap-is-enabled' into 'master'
Resolve "Building fails in build subdirectory when dnstap is enabled"

Closes #836

See merge request isc-projects/bind9!1510
2019-02-19 17:40:59 -05:00
Mark Andrews
3a21fdf884 add CHANGES 2019-02-20 09:29:07 +11:00
Mark Andrews
c0d4ff5796 teach proto_c to look in the source directory for out of tree builds 2019-02-20 09:27:00 +11:00
Mark Andrews
d76e172480 Merge branch '877-clang-scan-build-redundant-assignments-detected' into 'master'
Remove redundant assignments

Closes #877

See merge request isc-projects/bind9!1513
2019-02-18 18:01:56 -05:00
Mark Andrews
f475dc75b1 remove redundant assignment 2019-02-18 17:40:56 -05:00
Mark Andrews
7b60f6832e silence clang 2019-02-18 17:40:56 -05:00
Mark Andrews
9a9dc4072f declarations before assertions 2019-02-18 17:40:56 -05:00
Mark Andrews
70fab477b1 don't overwrite result 2019-02-18 17:40:56 -05:00
Mark Andrews
63c03cdb2d remove seen_dname 2019-02-18 17:40:56 -05:00
Mark Andrews
a92d281e10 Merge branch '877-clang-scan-build-redundant-assignments-detected-3' into 'master'
Uninitialised reads in dns_tsig_sign after change 5148.

See merge request isc-projects/bind9!1528
2019-02-18 17:39:38 -05:00
Mark Andrews
4938f97c97 record when querytsig is valid 2019-02-18 17:39:08 -05:00
Mark Andrews
0de6a3835f Merge branch '877-clang-scan-build-redundant-assignments-detected-2' into 'master'
decode_NegTokenInit failed to cleanup allocated memory on error.

See merge request isc-projects/bind9!1527
2019-02-18 17:34:50 -05:00
Mark Andrews
7114d16098 fix memory leak 2019-02-19 09:17:03 +11:00
Mark Andrews
d2ca9e79e3 Merge branch '877-clang-scan-build-redundant-assignments-detected-2' into 'master'
Cleanup no longer necessary assignments post refactoring in socket.c

See merge request isc-projects/bind9!1526
2019-02-18 16:14:56 -05:00
Mark Andrews
f87b88e520 remove dead assignments 2019-02-19 08:12:09 +11:00
Mark Andrews
26c0eaf6e0 Merge branch '877-clang-scan-build-redundant-assignments-detected-2' into 'master'
Add missing asserts to socket_test.c and dnstest.c

See merge request isc-projects/bind9!1523
2019-02-18 15:57:46 -05:00
Mark Andrews
76a1c1531a assert result is ISC_R_SUCCESS 2019-02-19 07:57:14 +11:00
Matthijs Mekking
ee6a378fde Merge branch '513-matthijs-update-xfr-logs' into 'master'
Update to !1427:  Make primary's transfer log more detailed

See merge request isc-projects/bind9!1511
2019-02-18 06:33:15 -05:00
Matthijs Mekking
24507abee3 Update to !1427: Make primary's transfer log more detailed 2019-02-18 06:33:15 -05:00
Mark Andrews
7125d1484e Merge branch 'u/fanf2/dnssec-keymgr-man' into 'master'
Improve dnssec-keymgr manual

See merge request isc-projects/bind9!1518
2019-02-17 23:43:26 -05:00
Tony Finch
7ee56e2abd Improve dnssec-keymgr manual
Illustrate the syntax for the policy options, with semicolons.

Explicitly mention the "default" policy.

Fix a few typos and remove some redundant wording.
2019-02-18 14:12:45 +11:00
Evan Hunt
4d4233f637 Merge branch '879-dnssec-checkds-help' into 'master'
Correct path in dnssec-checkds help

Closes #879

See merge request isc-projects/bind9!1515
2019-02-14 15:51:39 -05:00
Petr Menšík
7bd544e795 Correct path in dnssec-checkds help 2019-02-14 15:23:26 +01:00
Michał Kępień
ef9b9035e3 Merge branch '873-do-not-check-sep-bit-for-mirror-zone-trust-anchors' into 'master'
Do not check SEP bit for mirror zone trust anchors

Closes #873

See merge request isc-projects/bind9!1506
2019-02-14 05:21:46 -05:00
Michał Kępień
2b19b8511a Add CHANGES entry
5161.	[bug]		Do not require the SEP bit to be set for mirror zone
			trust anchors. [GL #873]
2019-02-14 11:03:35 +01:00
Michał Kępień
72c201733c Do not check SEP bit for mirror zone trust anchors
When a mirror zone is verified, the 'ignore_kskflag' argument passed to
dns_zoneverify_dnssec() is set to false.  This means that in order for
its verification to succeed, a mirror zone needs to have at least one
key with the SEP bit set configured as a trust anchor.  This brings no
security benefit and prevents zones signed only using keys without the
SEP bit set from being mirrored, so change the value of the
'ignore_kskflag' argument passed to dns_zoneverify_dnssec() to true.
2019-02-14 11:03:35 +01:00
Michał Kępień
724663c165 Merge branch 'michal/improve-stability-of-mirror-zone-tests' into 'master'
Improve stability of mirror zone system tests

See merge request isc-projects/bind9!1505
2019-02-14 04:59:14 -05:00
Michał Kępień
9c611dd999 Prevent races when waiting for log messages
The "mirror" system test checks whether log messages announcing a mirror
zone coming into effect are emitted properly.  However, the helper
functions responsible for waiting for zone transfers and zone loading to
complete do not wait for these exact log messages, but rather for other
ones preceding them, which introduces a possibility of false positives.

This problem cannot be addressed by just changing the log message to
look for because the test still needs to discern between transferring a
zone and loading a zone.

Add two new log messages at debug level 99 (which is what named
instances used in system tests are configured with) that are to be
emitted after the log messages announcing a mirror zone coming into
effect.  Tweak the aforementioned helper functions to only return once
the log messages they originally looked for are followed by the newly
added log messages.  This reliably prevents races when looking for
"mirror zone is now in use" log messages and also enables a workaround
previously put into place in the "mirror" system test to be reverted.
2019-02-14 10:41:56 +01:00
Michał Kępień
2cbf1028e9 Improve reliability of zone verification checks
In the "mirror" system test, ns3 periodically sends trust anchor
telemetry queries to ns1 and ns2.  It may thus happen that for some
non-recursive queries for names inside mirror zones which are not yet
loaded, ns3 will be able to synthesize a negative answer from the cached
records it obtained from trust anchor telemetry responses.  In such
cases, NXDOMAIN responses will be sent with the root zone SOA in the
AUTHORITY section.  Since the root zone used in the "mirror" system test
has the same serial number as ns2/verify.db.in and zone verification
checks look for the specified serial numbers anywhere in the answer, the
test could be broken if different zone names were used.

The +noauth dig option could be used to address this weakness, but that
would prevent entire responses from being stored for later inspection,
which in turn would hamper troubleshooting test failures.  Instead, use
a different serial number for ns2/verify.db.in than for any other zone
used in the "mirror" system test and check the number of records in the
ANSWER section of each response.
2019-02-14 10:41:56 +01:00
Michał Kępień
46480a4b47 Fix serial number used in zone verification checks
Due to the way the "mirror" system test is set up, it is impossible for
the "verify-unsigned" and "verify-untrusted" zones to contain any serial
number other than the original one present in ns2/verify.db.in.  Thus,
using presence of a different serial number in the SOA records of these
zones as an indicator of problems with mirror zone verification is
wrong.  Look for the original zone serial number instead as that is the
one that will be returned by ns3 if one of the aforementioned zones is
successfully verified.
2019-02-14 10:41:56 +01:00
Mark Andrews
3c47622fe9 Merge branch '871-add-a-ci-check-for-missing-prereq.sh-scripts' into 'master'
Add a CI check for missing prereq.sh scripts

Closes #871

See merge request isc-projects/bind9!1494
2019-02-11 16:48:12 -05:00
Mark Andrews
74c1c37563 add util/check-ans-prereq to precheck 2019-02-12 08:26:42 +11:00
Mark Andrews
ec2ecffef1 add check-ans-prereq 2019-02-12 08:26:42 +11:00
Evan Hunt
6537d0a1e2 Merge branch '872-dlz-ldap-dname' into 'master'
added DNAME support to DLZ LDAP schema, and fixed a DLZ compile error

Closes #872

See merge request isc-projects/bind9!1502
2019-02-10 15:07:38 -05:00
Evan Hunt
2e3b5db195 added DNAME support to DLZ LDAP schema, and fixed a DLZ compile error
Thanks to Roland Gruber for the schema contribution.
2019-02-10 11:49:01 -08:00
Evan Hunt
d372d2f62a Merge branch 'u/fanf2/zonemd' into 'master'
Correct ZONEMD expansion in ARM

See merge request isc-projects/bind9!1497
2019-02-08 16:16:29 -05:00
Tony Finch
af74f18536 Correct ZONEMD expansion in ARM 2019-02-08 17:11:30 +00:00
Michał Kępień
b8d37b6c89 Merge branch '869-prereq-sh-needed-in-forward-test' into 'master'
Resolve "prereq.sh needed in forward test"

Closes #869

See merge request isc-projects/bind9!1479
2019-02-08 09:05:02 -05:00
Curtis Blackburn
8c929bd7c5 added prereq.sh to forward test to detect perl Net::DNS 2019-02-08 14:07:00 +01:00
Michał Kępień
60c89a4c85 Merge branch '870-add-a-comment-explaining-a-mirror-zone-glitch' into 'master'
Add a comment explaining a mirror zone glitch

Closes #870

See merge request isc-projects/bind9!1480
2019-02-08 05:49:35 -05:00
Michał Kępień
2e4187afd5 Add a comment explaining a mirror zone glitch
Explain why in a certain edge case mirror zone data may not be used for
resolution purposes despite being available.
2019-02-08 05:49:22 -05:00
Mark Andrews
b46b243884 Merge branch '867-rrtypes-missing-from-named' into 'master'
Resolve "rrtypes missing from named"

Closes #867

See merge request isc-projects/bind9!1490
2019-02-07 22:08:14 -05:00
Mark Andrews
b06c5f8cfd add AMTRELAY and ZONEMD to ARM 2019-02-08 13:54:13 +11:00
Mark Andrews
a9fadafecd fix AMTRELAY name 2019-02-08 13:54:13 +11:00
Evan Hunt
b61c254d38 Merge branch 'each-dnssec-coverage-dots' into 'master'
dnssec-coverage was improperly ignoring some zones

See merge request isc-projects/bind9!1487
2019-02-07 20:10:45 -05:00
Evan Hunt
a242c704f5 CHANGES 2019-02-07 16:53:47 -08:00
Evan Hunt
9949163936 adjust style, match test to other tests 2019-02-07 16:53:46 -08:00
Tony Finch
a159675f44 dnssec-coverage: fix handling of zones without trailing dots
After change 5143, zones listed on the command line without trailing
dots were ignored.
2019-02-07 16:43:21 -08:00
Mark Andrews
cfdf457d3c Merge branch '867-rrtypes-missing-from-named' into 'master'
Resolve "rrtypes missing from named"

Closes #867

See merge request isc-projects/bind9!1484
2019-02-07 18:25:11 -05:00
Mark Andrews
8d69e15988 add top of range checks 2019-02-08 09:37:00 +11:00
Mark Andrews
1fb8d37ed9 Merge branch '867-rrtypes-missing-from-named' into 'master'
Resolve "rrtypes missing from named"

See merge request isc-projects/bind9!1475
2019-02-07 16:04:26 -05:00
Evan Hunt
72f6fb0697 CHANGES 2019-02-07 12:34:14 -08:00
Evan Hunt
3183663dd4 Add support for ZONEMD 2019-02-07 12:34:14 -08:00
Mark Andrews
66922ee7af Add support for ATMRELAY 2019-02-07 10:28:19 -08:00
Mark Andrews
5847318ab1 Merge branch '207-nslookup-takes-2-argvs-w-o-errors-uses-only-1st-and-last' into 'master'
Resolve "nslookup takes >2 argvs w/o errors, uses only 1st and last"

Closes #207

See merge request isc-projects/bind9!1382
2019-02-07 04:07:33 -05:00
Mark Andrews
f73816ff0f error out if there are extra command line options 2019-02-07 19:49:44 +11:00
Evan Hunt
acfbf1ae94 Merge branch 'each-configure-fix' into 'master'
configure could fail if cmocka was not detected

See merge request isc-projects/bind9!1474
2019-02-06 18:44:09 -05:00
Evan Hunt
15d41feb35 configure could fail if cmocka was not detected 2019-02-06 15:26:19 -08:00
Tinderbox User
afe73feae8 Merge branch 'prep-release' 2019-02-06 22:15:10 +00:00
Tinderbox User
b4d3f78293 prep 9.13.6 2019-02-06 22:13:05 +00:00
Evan Hunt
09a5c9aec4 Merge branch '774-improve-mirror-zone-documentation' into 'master'
Improve mirror zone documentation

Closes #774

See merge request isc-projects/bind9!1449
2019-02-06 14:03:38 -05:00
Michał Kępień
c33e1c98db Add CHANGES entry
5156.	[doc]		Extended and refined the section of the ARM describing
			mirror zones. [GL #774]
2019-02-06 11:00:27 -08:00
Michał Kępień
141a60f3a8 Extend and refine mirror zone documentation
Add a warning about potential performance implications of configuring a
non-root zone as a mirror zone.  Explain in more detail how each mirror
zone version is validated and how validation failures are handled.  Move
the paragraphs describing how to set up IANA root zone mirroring higher
up, so that they can be more easily found by the reader.  Explicitly
state that the "masters" option needs to be present for any mirror zone
which is not the root zone.  Tweak the description of the interaction
between the "dnssec-validation" setting and root zone mirroring to make
it less ambiguous.  Specify what the default "notify" setting is for
mirror zones.
2019-02-06 11:00:26 -08:00
Ondřej Surý
1a39a0c053 Merge branch 'ondrej/use-cmocka-if-available' into 'master'
Always use cmocka if available

See merge request isc-projects/bind9!1463
2019-02-06 06:39:02 -05:00
Ondřej Surý
72cb84f029 Fix typo 2019-02-06 12:08:34 +01:00
Ondřej Surý
ec7c41dd2a Simplify cmocka detection to use only pkg-config and always use cmocka if available 2019-02-06 12:04:33 +01:00
Matthijs Mekking
9bc600eff2 Merge branch 'michal/explain-hook-action-calling-order-in-more-detail' into 'master'
Explain hook action calling order in more detail

See merge request isc-projects/bind9!1451
2019-02-06 05:08:25 -05:00
Matthijs Mekking
2c34023a5e Explain hook action calling order in more detail 2019-02-06 10:09:38 +01:00
Mark Andrews
0738890313 Merge branch '857-inline-system-test-wasn-t-cleaning-k-files-on-restart-if-interrupted' into 'master'
Resolve "inline system test wasn't cleaning K* files on restart if interrupted."

Closes #857

See merge request isc-projects/bind9!1454
2019-02-06 00:58:35 -05:00
Ondřej Surý
519152b191 Simplify the inline clean script 2019-02-06 00:57:35 -05:00
Mark Andrews
1878efe661 clean K* files in inline system test directory 2019-02-06 00:57:35 -05:00
Mark Andrews
e8c38b8fff Merge branch '861-dsdigest-system-test-was-trying-to-read-a-non-existent-file-supported' into 'master'
Resolve "dsdigest system test was trying to read a non existent file 'supported'"

Closes #861

See merge request isc-projects/bind9!1467
2019-02-06 00:46:02 -05:00
Mark Andrews
275c355fba supported no longer exists so just do the default behaviour 2019-02-06 16:18:24 +11:00
Evan Hunt
c3219891a2 Merge branch 'u/fanf2/cleanup-cdnskey-to-ds' into 'master'
cleanup: allow building DS directly from CDNSKEY

See merge request isc-projects/bind9!1452
2019-02-05 22:57:44 -05:00
Tony Finch
2e173bbd24 cleanup: allow building DS directly from CDNSKEY
Relax an assertion in lib/dns/ds.c so that dnssec-cds does
not have to work around it. This will also be useful for
dnssec-dsfromkey.
2019-02-05 22:57:13 -05:00
Evan Hunt
18d94c806d Merge branch 'u/fanf2/cleanup-dnssec-revoke-help' into 'master'
cleanup: fix dnssec-revoke help text

See merge request isc-projects/bind9!1453
2019-02-05 22:52:06 -05:00
Tony Finch
f7b2bd304e cleanup: fix dnssec-revoke help text
Correct alignment and alphabetize
2019-02-05 22:51:30 -05:00
Evan Hunt
c22894a3d3 Merge branch 'u/fanf2/dsfromkey-man' into 'master'
cleanup: revamp the dnssec-dsfromkey man page and help output

See merge request isc-projects/bind9!1437
2019-02-05 22:48:20 -05:00
Tony Finch
6ca8e130ac cleanup: revamp the dnssec-dsfromkey man page and help output
* Alphabetize the option lists in the man page and help text

* Make the synopses more consistent between the man page and help
  text, in particular the number of different modes

* Group mutually exclusive options in the man page synopses, and order
  options so that it is more clear which are available in every mode

* Expand the DESCRIPTION to provide an overview of the output modes
  and input modes

* Improve cross-references between options

* Leave RFC citations to the SEE ALSO section, and clarify which RFC
  specifies what

* Clarify list of digest algorithms in dnssec-dsfromkey and dnssec-cds
  man pages
2019-02-05 19:02:18 -08:00
Mark Andrews
cd87d6152a Merge branch '859-named-paths' into 'master'
Resolve "print default file paths in named -V"

Closes #859

See merge request isc-projects/bind9!1458
2019-02-05 21:36:40 -05:00
Evan Hunt
25a3bb0409 CHANGES 2019-02-06 13:18:35 +11:00
Evan Hunt
2e7ec85497 construct the rndc.conf path from rndc.key 2019-02-06 13:18:00 +11:00
Evan Hunt
43ae6c623d print default file paths in 'named -V' output 2019-02-06 13:18:00 +11:00
Evan Hunt
2f13524164 initalize a named_g_defaultbindkeys variable 2019-02-06 13:18:00 +11:00
Mark Andrews
755efa9b18 Merge branch '860-process_opt-could-be-called-multiple-times-on-the-same-message-in-dig' into 'master'
Resolve "process_opt() could be called multiple times on the same message in dig."

Closes #860

See merge request isc-projects/bind9!1459
2019-02-05 20:59:31 -05:00
Mark Andrews
946d5c2c1e add CHANGES 2019-02-06 12:36:37 +11:00
Mark Andrews
0207199bb8 send over and undersized cookie 2019-02-06 12:34:42 +11:00
Mark Andrews
d9c368eee0 the condition test for checking the client cookie value was wrong; don't call process_opt multiple times 2019-02-06 12:34:42 +11:00
Ondřej Surý
a70c444529 Merge branch '822-test-make-install-in-one-of-the-build-jobs' into 'master'
Test "make install" in one of the build jobs

Closes #822

See merge request isc-projects/bind9!1450
2019-02-05 08:41:17 -05:00
Michał Kępień
2a231b6239 Test "make install" in one of the build jobs
Running "make install" in a separate job in the "test" phase of a CI
pipeline causes a lot of object files to be rebuilt due to the way
artifacts are passed between GitLab CI jobs (object files extracted from
the artifacts archive have older modification times than their
respective source files checked out using Git by the worker running the
"install" job).  Test "make install" in one of the build jobs instead,
in order to prevent object rebuilding.

Using 'after_script' for this purpose was not an option because its
failures are ignored.

Duplicating the build script in two places would be error-prone in the
long run and thus was rejected as a solution.  YAML anchors would also
not help in this case.

A "positive" test (`test -n "${RUN_MAKE_INSTALL}" && make install`)
would not work because:

  - it would cause the build script to fail for any job not supposed to
    run "make install",

  - appending `|| :` to the shell pipeline would prevent "make install"
    errors from causing a job failure.

Due to the above, a "negative" test is performed, so that:

  - jobs not supposed to run "make install" succeed immediately,

  - jobs supposed to run "make install" only succeed when "make install"
    succeeds.
2019-02-01 13:42:52 +01:00
Evan Hunt
1557d116ea Merge branch 'each-win-tests' into 'master'
tests failing on windows due to false crash-on-shutdown reports

See merge request isc-projects/bind9!1446
2019-02-01 01:55:25 -05:00
Evan Hunt
449842e1ce disable the check for crash on shutdown when running under cygwin 2019-01-31 21:35:08 -08:00
Evan Hunt
acf42a758a Merge branch '513-add-xfer-stats-for-primary-servers' into 'master'
Make primary's transfer log more detailed

See merge request isc-projects/bind9!1427
2019-01-31 17:16:13 -05:00
Michał Kępień
ed6317a1be Add CHANGES entry
5153.	[func]		Zone transfer statistics (size, number of records, and
			number of messages) are now logged for outgoing
			transfers as well as incoming ones. [GL #513]
2019-01-31 16:55:01 -05:00
Michał Kępień
a9a47c79e9 Add system tests for IXFR statistics
Ensure IXFR statistics are calculated correctly by dig and named, both
for incoming and outgoing transfers.  Disable EDNS when using dig to
request an IXFR so that the same reference file can be used for testing
statistics calculated by both dig and named (dig uses EDNS by default
when sending transfer requests, which affects the number of bytes
transferred).
2019-01-31 16:55:01 -05:00
Michał Kępień
a22e24a411 Add system tests for AXFR statistics
Ensure AXFR statistics are calculated correctly by dig and named, both
for incoming and outgoing transfers.  Rather than employing a zone which
is already used in the "xfer" system test, create a new one whose AXFR
form spans multiple TCP messages.  Disable EDNS when using dig to
request an AXFR so that the same reference file can be used for testing
statistics calculated by both dig and named (dig uses EDNS by default
when sending transfer requests, which affects the number of bytes
transferred).
2019-01-31 16:55:01 -05:00
Michał Kępień
6071c6cc27 Add functions for extracting transfer statistics
Add two helper shell functions to facilitate extracting transfer
statistics from dig output and named log files.
2019-01-31 16:55:01 -05:00
Michał Kępień
7f52b87227 Maintain and report outgoing transfer statistics
Transfer statistics are currently only reported for incoming transfers,
even though they are equally useful for outgoing transfers.  Define a
separate structure for keeping track of the number of messages, records,
and bytes sent during each outgoing transfer, along with the time each
outgoing transfer took.  Repurpose the 'nmsg' field of the xfrout_ctx_t
structure for tracking the number of messages actually sent, ensuring it
is only increased after isc_socket_send() indicates success.  Report the
statistics gathered when an outgoing transfer completes.
2019-01-31 16:55:01 -05:00
Michał Kępień
c20d81fd06 Track QUESTION section presence using a boolean
The 'nmsg' field of the xfrout_ctx_t structure is an integer, even
though it is only ever compared against 0 (for tracking whether the
QUESTION section has already been sent to the client).  Use a boolean
instead as it is more appropriate and also enables 'nmsg' to be
repurposed.
2019-01-31 16:55:01 -05:00
Evan Hunt
08ef7222aa Merge branch 'each-silence-warning' into 'master'
silence a spurious dnssec-keygen warning in the dnssec system test

See merge request isc-projects/bind9!1238
2019-01-31 16:42:38 -05:00
Evan Hunt
6661db9564 silence a spurious dnssec-keygen warning in the dnssec system test
the occluded-key test creates both a KEY and a DNSKEY. the second
call to dnssec-keygen calls dns_dnssec_findmatchingkeys(), which causes
a spurious warning to be printed when it sees the type KEY record.
this should be fixed in dnssec.c, but the meantime this change silences
the warning by reversing the order in which the keys are created.
2019-01-31 13:23:11 -08:00
Evan Hunt
39697f22fc Merge branch '714-dnssec-key-logging' into 'master'
Resolve "Add logging to DNSSEC key events"

Closes #714

See merge request isc-projects/bind9!1371
2019-01-31 15:32:10 -05:00
Evan Hunt
33f181ac93 CHANGES and release note 2019-01-31 12:18:55 -08:00
Evan Hunt
5c1c285370 test logging of key maintenance events 2019-01-31 12:18:55 -08:00
Evan Hunt
3c75d5d7c5 add more key maintenance event logging
log when a key is:
- published in the DNSKEY rrset
- activated
- deactivated
- unpublished from the DNSKEY rrset
- revoked
2019-01-31 12:18:55 -08:00
Evan Hunt
7fa6b88d9b include the name when logging that a key is being fetched from key repostitory 2019-01-31 12:18:19 -08:00
Evan Hunt
e3fe19df55 increase the log level for some key status and managed-key events
some key-related events were logged at DEBUG(3) but seem likely to
be relevant to a typical operator's interests during key rollovers.
2019-01-31 12:18:19 -08:00
Evan Hunt
a7cadde982 use log category "dnssec" instead of "zone" for DNSSEC-related events
use "dnssec" log category for:
- managed key zone events
- DNSSEC key status changes (activation, deletion, etc)
- zone signing status
2019-01-31 12:18:12 -08:00
Evan Hunt
308ab1b4a5 style cleanups 2019-01-31 11:57:16 -08:00
Evan Hunt
41d79f054d Merge branch '850-catch-shutdown-aborts' into 'master'
detect crash on shutdown in stop.pl

Closes #850

See merge request isc-projects/bind9!1435
2019-01-31 12:27:54 -05:00
Evan Hunt
9bf37f4e48 detect crash on shutdown in stop.pl 2019-01-31 12:16:53 -05:00
Evan Hunt
7b86c01d53 Merge branch '849-fix-tkey-leak' into 'master'
fix TKEY problems

Closes #849

See merge request isc-projects/bind9!1434
2019-01-31 12:15:34 -05:00
Evan Hunt
73ba24fb36 Change #4148 wasn't complete
- there was a memory leak when using negotiated TSIG keys.
- TKEY responses could only be signed when using a newly negotiated
  key; if an existent matching TSIG was found in in the keyring it
  would not be used.
2019-01-31 09:01:23 -08:00
Ondřej Surý
8793a4f350 Merge branch '358-ancient-options' into 'master'
make ancient named.conf options fatal

Closes #358

See merge request isc-projects/bind9!1373
2019-01-31 06:16:26 -05:00
Evan Hunt
b986164a0d Add CHANGES entry for #358. 2019-01-31 11:54:50 +01:00
Evan Hunt
ff3dace139 Ancient named.conf options are now a fatal configuration error
- options that were flagged as obsolete or not implemented in 9.0.0
  are now flagged as "ancient", and are a fatal error
- the ARM has been updated to remove these, along with other
  obsolete descriptions of BIND 8 behavior
- the log message for obsolete options explicitly recommends removal
2019-01-31 11:54:26 +01:00
Ondřej Surý
5a623052a1 Merge branch '735-remove-ability-to-disable-dbc-assertions' into 'master'
Remove support for compiling without assertions (Both ISC_CHECK_ALL, ISC_CHECK_NONE are now gone)

Closes #735

See merge request isc-projects/bind9!1130
2019-01-31 05:37:19 -05:00
Ondřej Surý
5840d24033 Add CHANGES entry for GL #735. 2019-01-31 11:16:27 +01:00
Ondřej Surý
3a3e75042d Remove support for compiling without assertions (Both ISC_CHECK_ALL, ISC_CHECK_NONE are now gone) 2019-01-31 11:16:08 +01:00
Matthijs Mekking
dfb2a72e1a Merge branch '101-dumpdb-stale-ttl' into 'master'
Resolve "[Support#12071] [RT#46548] Output stale/expired data with 'rndc dumpdb'"

Closes #101

See merge request isc-projects/bind9!1387
2019-01-31 04:25:20 -05:00
Matthijs Mekking
d17b79fe6a CHANGES 2019-01-31 09:35:50 +01:00
Matthijs Mekking
a2d115cbfc Add tests for dumpdb stale ttl
This adds a test for rndc dumpdb to ensure the correct "stale
comment" is printed.  It also adds a test for non-stale data to
ensure no "stale comment" is printed for active RRsets.

In addition, the serve-stale tests are hardened with more accurate
grep calls.
2019-01-31 09:35:49 +01:00
Matthijs Mekking
924ebc605d Print in dump-file stale ttl
This change makes rndc dumpdb correctly print the "; stale" line.
It also provides extra information on how long this data may still
be served to clients (in other words how long the stale RRset may
still be used).
2019-01-30 14:11:12 -08:00
Evan Hunt
9a58b25f7f Merge branch '821-matthijs-unsigned-gss-tsig-tkey-query-response' into 'master'
Resolve "Unsigned GSS-TSIG TKEY Query Response"

Closes #821

See merge request isc-projects/bind9!1429
2019-01-30 14:59:35 -05:00
Matthijs Mekking
f1c6e01a0f Update CHANGES 2019-01-30 11:47:02 -08:00
Matthijs Mekking
b05a095a3e Harden checks 2019-01-30 11:46:43 -08:00
Matthijs Mekking
1cc25ff5e0 Better signed TKEY response verification 2019-01-30 11:46:11 -08:00
Matthijs Mekking
935af4a795 No longer need +question 2019-01-30 11:46:11 -08:00
Evan Hunt
0010f73cde suggested alternate test for TSIG signature
feel free to remove this commit if you prefer the other method.
2019-01-30 11:46:11 -08:00
Evan Hunt
4754fa2ded "grep -q" isn't portable 2019-01-30 11:46:11 -08:00
Evan Hunt
13c799267b remove the 'new_tsigkey' exception, allow TSIG to be set any time
this allows 'dns_message_settsigkey()' to be run any time after
parsing without having to set a special flag in the message object.
2019-01-30 11:46:11 -08:00
Evan Hunt
33ec311332 allow TSIG key to be added to message structure after parsing
up until now, message->tsigkey could only be set during parsing
of the request, but gss-tsig allows one to be created afterward.

this commit adds a new flag to the message structure, `new_tsigkey`,
which indicates that in this case it's okay for `dns_message_settsigkey()`
to be run on a message after parsing, without hitting any assertions due
to the lack of a TSIG in the request. this allows us to keep the current
restriction in place generally, but add an exception for TKEY processing.
it's probably better to just remove the restriction entirely (see next
commit).
2019-01-30 11:46:11 -08:00
Matthijs Mekking
29323a39bf Weak verification for signed TKEY response
The introduced grep call checks whether there was a
response that has an answer and an additional record.
There should be only one in the nsupdate output that is
for the TKEY response.
2019-01-30 11:46:11 -08:00
Matthijs Mekking
1302dea184 Some thoughts on a solution 2019-01-30 11:45:30 -08:00
Matthijs Mekking
9fcad11e34 Weak verification for signed TKEY response
The introduced grep call checks whether there was a
response that has an answer and an additional record.
There should be only one in the nsupdate output that is
for the TKEY response.
2019-01-30 11:45:30 -08:00
Matthijs Mekking
cbe51ba325 Harden GSS-TSIG tests 2019-01-30 11:45:30 -08:00
Ondřej Surý
92099923c6 Merge branch 'each-fix-win32-build' into 'master'
atomic_store wasn't working on windows

See merge request isc-projects/bind9!1403
2019-01-30 10:56:47 -05:00
Ondřej Surý
27eb6189a8 Fix Centos 6 build by explicitly casting to __typeof__(obj) in atomic_compare_exchange_strong shim function 2019-01-30 15:54:17 +01:00
Witold Kręcicki
9ded5d5193 Cast atomic_load_explicit to proper size 2019-01-30 14:12:06 +01:00
Ondřej Surý
f2d1a88efc Add #pragma intrinsic for intrinsic Windows functions 2019-01-30 13:48:58 +01:00
Ondřej Surý
9539e1c3a1 Fix memory_order_cst_seq -> memory_order_seq_cst typo 2019-01-30 13:48:58 +01:00
Ondřej Surý
d3e0604354 Properly use atomic_compare_exchange instead of load/store 2019-01-30 13:48:58 +01:00
Ondřej Surý
4f5e83b139 Add define for InterlockedExchangeAdd8 intrinsic 2019-01-30 13:48:58 +01:00
Ondřej Surý
7a7a8b0f7b Add atomic_bool implementation to unix and win32 stdatomic.h shim headers 2019-01-30 09:37:38 +01:00
Ondřej Surý
a84e70acd0 Fix copy&paste error in the atomic_fetch_add_explicit{32,64} macros.
- InterlockedExchange was incorrectly used in place where InterlockedExchangeAdd
  should have been used
2019-01-30 09:37:38 +01:00
Ondřej Surý
f8c96ad27a Bump Windows minimum target environment to _WIN32_WINNT_WIN8/NTDDI_WIN8 values 2019-01-30 09:37:38 +01:00
Evan Hunt
19dd6a409c Fix a typo in the win32 version of the atomic_store macro 2019-01-30 09:37:38 +01:00
Evan Hunt
39527e9c36 Moved the unix version to lib/isc/unix/include/isc so it's more obvious in the future that it isn't the only copy 2019-01-30 09:37:38 +01:00
Mark Andrews
3f16a6afc1 Merge branch '848-keymgr-19-old-keys-failing-on-penguin' into 'master'
Resolve "keymgr 19-old-keys failing on penguin"

Closes #848

See merge request isc-projects/bind9!1424
2019-01-29 23:36:31 -05:00
Mark Andrews
b9d5a62bdc add CHANGES 2019-01-29 20:18:01 -08:00
Mark Andrews
acf0292da4 add 300 seconds of fudge 2019-01-29 20:14:45 -08:00
Mark Andrews
36ea9b8181 only use a single policy file when testing. 2019-01-30 15:00:14 +11:00
Evan Hunt
4e86a57ba2 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1421
2019-01-29 18:07:31 -05:00
Evan Hunt
088008328c placeholder 2019-01-29 15:07:01 -08:00
Evan Hunt
8d1cdc60da Merge branch '766-querytrace-doc' into 'master'
Resolve "--enable-querytrace has negative performance impact - update the documentation to say this"

Closes #766

See merge request isc-projects/bind9!1367
2019-01-29 17:19:49 -05:00
Evan Hunt
51048ca06e added querytrace documentation in README
also:
- rearranged things a little, adding a "dependencies" section
- removed the documentation of 'enable-threads'. (this part of
  the change should not be backported.)
2019-01-29 14:18:13 -08:00
Michał Kępień
f0a3525ba3 Merge branch 'michal/add-fedora-29-to-ci' into 'master'
Add Fedora 29 to CI

See merge request isc-projects/bind9!1414
2019-01-29 07:53:15 -05:00
Michał Kępień
38b6c5c444 Add Fedora 29 to CI
Modify .gitlab-ci.yml so that every CI pipeline also builds and tests
BIND on Fedora 29.
2019-01-29 07:25:00 -05:00
Ondřej Surý
8551497df3 Merge branch 'ondrej/configure.ac-fix-int-assignment-to-pointer-in-ECC-checks' into 'master'
Change the check for EC curves so it doesn't assign int to pointer

See merge request isc-projects/bind9!1413
2019-01-29 07:20:41 -05:00
Ondřej Surý
5338e5fc32 Change the check for EC curves so it doesn't assign int to pointer 2019-01-29 12:43:55 +01:00
Witold Krecicki
ffa3be2b04 Merge branch 'wpk-fix-taskmgr-tsan-issues' into 'master'
ix taskmgr tsan issues

See merge request isc-projects/bind9!1396
2019-01-29 03:56:55 -05:00
Witold Kręcicki
a003908af4 Fix a race in access to manager->tasks in taskmgr
Make taskmgr->mode and boolean state flags (exclusive, paused, exiting) atomic.
2019-01-29 03:32:29 -05:00
Mark Andrews
d0222edbdd Merge branch '845-configure-PLATFORMS' into 'master'
corrected PLATFORM.md to PLATFORMS.md to match reality

Closes #845

See merge request isc-projects/bind9!1408
2019-01-28 23:59:57 -05:00
Alan
f60784c625 corrected PLATFORM.md to PLATFORMS.md to match reality 2019-01-28 23:41:49 -05:00
Evan Hunt
1cccf601d7 Merge branch '259-named-args' into 'master'
add properly-formatted -D options to named.args files

Closes #259

See merge request isc-projects/bind9!1372
2019-01-28 23:24:42 -05:00
Evan Hunt
dd45831acc also add -D options for transient named processes started in tests.sh 2019-01-28 19:58:24 -08:00
Evan Hunt
175d6e9bfb add properly-formatted -D options to named.args files
this prevents servers that use arguments specified in named.args
from appearing different in 'ps' output from servers run with arguments
from start.pl
2019-01-28 19:58:24 -08:00
Evan Hunt
377a7e7bba Merge branch 'each-fix-logfileconfig' into 'master'
reset SYSTEMTESTTOP when changing directories

See merge request isc-projects/bind9!1407
2019-01-28 22:57:47 -05:00
Evan Hunt
70f36a25e4 reset SYSTEMTESTTOP when changing directories 2019-01-28 19:57:19 -08:00
Mark Andrews
8672f5cb5a Merge branch '842-broken-build' into 'master'
rename struct members to avoid a name collision on BSD and MacOS

Closes #842

See merge request isc-projects/bind9!1406
2019-01-28 21:32:56 -05:00
Evan Hunt
995134ce76 rename struct members to avoid a name collision on BSD 2019-01-28 10:59:48 -08:00
Evan Hunt
64745bbc21 Merge branch 'michal/update-PLATFORMS-2019-01' into 'master'
Update PLATFORMS (January 2019)

See merge request isc-projects/bind9!1405
2019-01-28 13:54:15 -05:00
Michał Kępień
fd89fa015b Update the list of supported platforms
- Change 5023 (present in BIND 9.13.3+) removed BIND's internal
  implementation of the getifaddrs() function which was required for
  iterating network interfaces on Solaris 10 as that system does not
  support that function natively.
- As of January 2019, FreeBSD 10.x is neither supported upstream nor
  regularly tested by ISC, so move it from the list of regularly tested
  platforms to the "Best effort" section.
- Debian 10, OpenBSD 6.3, and Fedora 29 have been released and are now
  tested regularly.
2019-01-28 10:49:03 -08:00
Witold Krecicki
14d48a9b69 Merge branch 'wpk-atomic-counters-quota' into 'master'
Atomic counters and quota

See merge request isc-projects/bind9!1389
2019-01-25 04:45:27 -05:00
Witold Kręcicki
d314e45cc3 CHANGES entry 2019-01-25 04:26:49 -05:00
Witold Kręcicki
42d9a536a7 Make isc_counter use atomics instead of locks 2019-01-25 04:26:49 -05:00
Witold Kręcicki
0af500a2c5 - Make isc_quota use atomics instead of locks
- Use getters for isc_quota parameters, make fields private
- Fix a potential data race with recursion clients limits logging
2019-01-25 04:26:49 -05:00
Witold Kręcicki
814bfa23b2 Add atomic_store_relaxed and atomic_load_relaxed macros to isc/atomic.h, fix issues in isc/stdatomic.h 2019-01-25 04:26:49 -05:00
Evan Hunt
9a2d889c69 Merge branch 'each-win32-test-list' into 'master'
fix win32 system tests

See merge request isc-projects/bind9!1381
2019-01-25 03:45:06 -05:00
Evan Hunt
7cc9fdc7fb fix rrl test
strip CR characters before using awk/sed
2019-01-25 00:44:11 -08:00
Evan Hunt
8cd39fae80 fix rpz test
- work around a CR newline problem
- use rndc to stop servers
2019-01-25 00:44:11 -08:00
Evan Hunt
f7471494ed fix rpzrecurse test
use rndc to stop servers
2019-01-25 00:44:11 -08:00
Evan Hunt
8778f484b3 fix dnssec test
- work around CR issues
- use UTC for time comparisons
- use $DIFF instead of cmp
2019-01-25 00:44:11 -08:00
Evan Hunt
8acc3434a7 fix legacy test
use rndc rather than signals to stop the server
2019-01-25 00:44:11 -08:00
Evan Hunt
fef19fb978 fix fetchlimit test
use TCP for the test queries in between UDP bursts; this avoids
congestion issues that interfered with the test on windows
2019-01-25 00:44:11 -08:00
Evan Hunt
5656e97ddf fix nsupdate test
rndc_reload was failing on windows
2019-01-25 00:44:11 -08:00
Evan Hunt
7942bc93e2 fix sfcache test
use a lame server configuration to force SERVFAILs instead of killing ns2.
this prevents test failures that occurred due to a different behavior of
the netowrking stack in windows.
2019-01-25 00:44:11 -08:00
Evan Hunt
a77b6a8abc fix rndc test
use regex instead of exact string matching to deal with CR at end of line
2019-01-25 00:44:11 -08:00
Evan Hunt
1150a008b2 fix statistics test
the active sockets test is supposed to be commented out on win32, but
only part of it was
2019-01-25 00:44:11 -08:00
Evan Hunt
37b0af81d2 fix redirect test
strip CR characters before using sed
2019-01-25 00:44:11 -08:00
Evan Hunt
6881f919e7 fix notify test
test the average delay between notifies instead of the minimum delay;
this helps avoid unnecessary test failures on systems with bursty
network performance.
2019-01-25 00:44:11 -08:00
Evan Hunt
10aba2cbbb fix masterformat test
use stop.pl instead of rndc to stop server
2019-01-25 00:44:11 -08:00
Evan Hunt
2ae3c97599 fix inline test
use regex instead of exact string matching, to deal with CR at end of ine
2019-01-25 00:44:11 -08:00
Evan Hunt
8b0d5a98bb fix forward test
strip CR characters before using sed
2019-01-25 00:44:11 -08:00
Evan Hunt
673cd0beeb fix cookie test
strip CR characters before comparing files
2019-01-25 00:44:11 -08:00
Evan Hunt
097cbec3c4 fix cds test
- use $PERL instead of perl
- use $DIFF instead of cmp for windows portability; cmp doesn't
  handle CR characters properly
2019-01-25 00:44:11 -08:00
Evan Hunt
e6f2c2f51f fix addzone test
typographical error prevented reconfiguration
2019-01-25 00:44:11 -08:00
Evan Hunt
def7574b1e use $DIFF instead of diff 2019-01-25 00:44:11 -08:00
Evan Hunt
d3d106b82c remove logfileconfig from test list
this test doesn't work on windows
2019-01-25 00:44:11 -08:00
Evan Hunt
c02dad7991 set and use SYSTEMTESTTOP consistently 2019-01-25 00:44:11 -08:00
Evan Hunt
1bc0ab5217 complete the set of tools available in windows tests
- dnssec-cds wasn't being built for windows
- nsec3hash was available, but the NSEC3HASH variable wasn't
  set in conf.sh.win32
2019-01-25 00:44:11 -08:00
Evan Hunt
086f770b38 more reliable method for killing "ans" servers on windows
as perl and python are both native to cygwin, we don't want to use
the "kill -f" option to terminate them.
2019-01-25 00:44:11 -08:00
Evan Hunt
3012803a22 update ifconfig.bat with current test interfaces
the addresses set up in ifconfig.bat were out of sync with the
ones in ifconfig.sh
2019-01-25 00:44:11 -08:00
Evan Hunt
d1fc4601ce update conf.sh.win32 test list
- the test lists in conf.sh.in and conf.sh.win32 were out of sync
2019-01-25 00:44:11 -08:00
Evan Hunt
99060c0d7f Merge branch '820-dig-return-a-non-zero-exit-code-for-failed-tcp-eof-retries' into 'master'
dig: return a non-zero exit code for failed TCP EOF retries

Closes #820

See merge request isc-projects/bind9!1358
2019-01-25 02:53:48 -05:00
Michał Kępień
7a1c0dc558 Add CHANGES entry
5144.	[bug]		dig now returns a non-zero exit code when a TCP
			connection is prematurely closed by a peer more than
			once for the same lookup.  [GL #820]
2019-01-24 23:06:07 -08:00
Michał Kępień
0f168a4b37 dig: return a non-zero exit code for failed TCP EOF retries
dig retries a TCP query when a server closes the connection prematurely.
However, dig's exit code remains unaffected even if the second attempt
to get a response also fails with the same error for the same lookup,
which should not be the case.  Ensure the exit code is updated
appropriately when a retry triggered by a TCP EOF condition fails.
2019-01-24 23:05:43 -08:00
Evan Hunt
91d1218097 Merge branch '560-dnssec-keymgr-root' into 'master'
improve handling of trailing dots in dnssec-keymgr and dnssec-coverage

Closes #560

See merge request isc-projects/bind9!1374
2019-01-24 15:51:04 -05:00
Evan Hunt
1ccf4e6c16 improve handling of trailing dots in dnssec-keymgr and dnssec-coverage
- mishandling of trailing dots caused bad behavior with the
  root zone or names like "example.com."
- fixing this exposed an error in dnssec-coverage caused the
  wrong return value if there were KSK errors but no ZSK errors
- incidentally silenced the dnssec-keygen output in the coverage
  system test
2019-01-24 12:33:42 -08:00
Evan Hunt
58e4d00c43 Merge branch '323-cleanup-cfg' into 'master'
cleanup cfg_parse_buffer* functions

Closes #323

See merge request isc-projects/bind9!1377
2019-01-24 15:26:17 -05:00
Evan Hunt
cf072d659e cleanup cfg_parse_buffer* functions
cfg_parse_buffer() now has the same signature as the former
cfg_parse_buffer4(). cfg_parse_buffer{2,3,4}() have been removed.
2019-01-24 12:08:54 -08:00
Evan Hunt
57dedab3f3 Merge branch 'each-dead-code-cleanup' into 'master'
remove dead RPZ code

See merge request isc-projects/bind9!1392
2019-01-24 15:03:00 -05:00
Matthijs Mekking
7c13f1779e Remove dead code 2019-01-24 12:00:09 -08:00
Evan Hunt
710a3aaf14 Merge branch '824-configure-nsip' into 'master'
remove --disable-rpz-nsip and --disable-rpz-nsdname from configure

Closes #824

See merge request isc-projects/bind9!1376
2019-01-24 14:57:03 -05:00
Evan Hunt
b9c9f2593a remove --disable-rpz-nsip and --disable-rpz-nsdname from configure 2019-01-24 11:32:44 -08:00
Evan Hunt
7311ebe9d3 Merge branch 'each-set-magic-last' into 'master'
set the magic number at the end of dns_dt_create()

See merge request isc-projects/bind9!1383
2019-01-23 14:12:21 -05:00
Evan Hunt
c29abd307c set the magic number at the end of dns_dt_create() 2019-01-23 14:12:09 -05:00
Evan Hunt
e6bf898edf Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1385
2019-01-23 14:05:32 -05:00
Evan Hunt
1b1cd4de2f placeholder 2019-01-23 11:05:03 -08:00
Evan Hunt
fa53cc0451 Merge branch '117-running-dnssec-keymgr-with-old-keys-inactivates-deletes-them-immediately' into 'master'
Resolve "Running dnssec-keymgr with old keys inactivates/deletes them immediately"

Closes #117

See merge request isc-projects/bind9!1378
2019-01-22 13:10:47 -05:00
Mark Andrews
083b730ec7 introducing keymgr need to preserve functionality 2019-01-22 09:52:47 -08:00
Evan Hunt
914e8ddd61 Merge branch '823-masterformat-test-fix' into 'master'
fix broken masterformat test

Closes #823

See merge request isc-projects/bind9!1365
2019-01-21 02:04:08 -05:00
Evan Hunt
bc7b34d6ef fix broken masterformat test
- dig command had the @ parameter in the wrong place
- private-dnskey and private-cdnskey are queried in a separate
  loop, which strips 'private-' from the name to determine the qtype
2019-01-21 01:41:25 -05:00
Mark Andrews
f13c87b89a Merge branch 'each-remove-fprintf' into 'master'
clean up debugging fprintf

See merge request isc-projects/bind9!1368
2019-01-20 20:56:53 -05:00
Evan Hunt
6c478a3dae removed a debugging fprintf 2019-01-20 17:38:32 -08:00
Michał Kępień
8c30864374 Merge branch 'michal/gitlab-ci-cleanup' into 'master'
GitLab CI cleanup

See merge request isc-projects/bind9!1329
2019-01-18 08:49:40 -05:00
Michał Kępień
a27b9dff18 Add comments 2019-01-18 14:28:47 +01:00
Michał Kępień
a61bf39688 Unify YAML style used throughout .gitlab-ci.yml 2019-01-18 14:28:47 +01:00
Michał Kępień
1c8c1815e4 Tweak pipeline triggering settings
In an attempt to ensure that:

  - all important changes to repository contents are tested,
  - pipelines are not automatically created for every single push,
  - some flexibility is allowed for corner cases,

change pipeline triggering settings so that:

  - full build & test pipelines are only automatically created for merge
    requests and tags (both for creation and updates),

  - pipelines for other repository changes (e.g. pushes to arbitrary
    branches) can only be created manually, using GitLab's web
    interface,

  - merging a merge request only causes jobs pushing the updated ARM to
    GitLab Pages to be run (as semi-linear Git history is enforced and
    thus testing a MR is identical to testing the target branch
    post-merge in terms of code),

  - repository synchronization does not trigger duplicate pipelines in
    projects which are set as mirroring targets.
2019-01-18 14:28:47 +01:00
Michał Kępień
a1dbec3b08 Reorder job definitions
Group jobs by build type and operating system to make the layout of
.gitlab-ci.yml more consistent and improve locality of YAML references.
2019-01-18 14:28:47 +01:00
Michał Kępień
1fe432c6c3 Use a common naming pattern for all jobs
Make sure all jobs are named using the following pattern:

    [<job-type>:]<build-type>:<system>:<architecture>

where specifying <job-type> is optional for "precheck" and "build" jobs.

This should make it easier to quickly recognize:

  - what kind of actions are performed by each job,
  - which BIND build flavor is used by each job,
  - which operating system image is used by each job.
2019-01-18 14:28:47 +01:00
Michał Kępień
e0b5dd67a1 Define a template for precheck jobs 2019-01-18 14:28:47 +01:00
Michał Kępień
de1948398d Merge install_test_job template into the job definition as it is only used once 2019-01-18 14:28:47 +01:00
Michał Kępień
7dd329d385 Shorten Docker image definitions by using YAML anchors for runner tags
While we are at it, drop use of the "docker" tag since all BIND CI jobs
are currently run inside Docker containers.
2019-01-18 14:28:47 +01:00
Michał Kępień
41a67147fe Build ARM in the build stage
There is no need to build BIND binaries before building docs and thus
the job building the current version of the ARM can be moved to the
build stage of CI.
2019-01-18 14:28:47 +01:00
Michał Kępień
75b26d3f50 Replace double colon with a single colon 2019-01-18 14:28:47 +01:00
Michał Kępień
9893bd3246 Remove unused parts of .gitlab-ci.yml
Remove the following from .gitlab-ci.yml:

  - unused variable definitions,
  - unused Docker image definitions,
  - commands which have no effect,
  - sections which were commented out.
2019-01-18 14:28:47 +01:00
Evan Hunt
4a82749461 Merge branch '752-disable-forwarders-when-priming' into 'master'
If possible don't use forwarders when priming the resolver.

Closes #752

See merge request isc-projects/bind9!1296
2019-01-16 17:52:08 -05:00
Witold Kręcicki
b49310ac06 If possible don't use forwarders when priming the resolver.
If we try to fetch a record from cache and need to look into
hints database we assume that the resolver is not primed and
start dns_resolver_prime(). Priming query is supposed to return
NSes for "." in ANSWER section and glue records for them in
ADDITIONAL section, so that we can fill that info in 'regular'
cache and not use hints db anymore.
However, if we're using a forwarder the priming query goes through
it, and if it's configured to return minimal answers we won't get
the addresses of root servers in ADDITIONAL section. Since the
only records for root servers we have are in hints database we'll
try to prime the resolver with every single query.

This patch adds a DNS_FETCHOPT_NOFORWARD flag which avoids using
forwarders if possible (that is if we have forward-first policy).
Using this flag on priming fetch fixes the problem as we get the
proper glue. With forward-only policy the problem is non-existent,
as we'll never ask for root server addresses because we'll never
have a need to query them.

Also added a test to confirm priming queries are not forwarded.
2019-01-16 17:41:13 -05:00
Mark Andrews
a97a63ad51 Merge branch 'pkcs11-pubattr-check' into 'master'
Make sure null atributes are never used

See merge request isc-projects/bind9!1353
2019-01-16 16:37:55 -05:00
Petr Menšík
fe9ef0d9f5 Make sure null atributes are never used
Add INSIST to pubattr fetching where null might occur in therory. Make
sure null is never dereferenced.
2019-01-16 15:48:37 -05:00
Evan Hunt
3d5826b75b Merge branch '797-handle-timeouts-when-qminimizing' into 'master'
Don't retry query on timeout if we're qname minimizing

Closes #797

See merge request isc-projects/bind9!1293
2019-01-16 14:21:08 -05:00
Witold Kręcicki
cfa2804e5a When a forwarder fails and we're not in a forward-only mode we
go back to regular resolution. When this happens the fetch timer is
already running, and we might end up in a situation where we we create
a fetch for qname-minimized query and after that the timer is triggered
and the query is retried (fctx_try) - which causes relaunching of
qname-minimization fetch - and since we already have a qmin fetch
for this fctx - assertion failure.

This fix stops the timer when doing qname minimization - qmin fetch
internal timer should take care of all the possible timeouts.
2019-01-16 11:09:30 -08:00
Evan Hunt
bbb0947ee1 Merge branch '818-improve-mirror-zone-logging' into 'master'
Improve mirror zone logging

Closes #818

See merge request isc-projects/bind9!1351
2019-01-16 14:05:20 -05:00
Michał Kępień
5d37c910c8 Add CHANGES entry
5137.	[func]		named now logs messages whenever a mirror zone becomes
			usable or unusable for resolution purposes. [GL #818]
2019-01-16 10:38:17 -08:00
Michał Kępień
7d6b8f7c12 Log a message when a mirror zone becomes unusable
Log a message if a mirror zone becomes unusable for the resolver (most
usually due to the zone's expiration timer firing).  Ensure that
verification failures do not cause a mirror zone to be unloaded
(instead, its last successfully verified version should be served if it
is available).
2019-01-16 10:38:12 -08:00
Michał Kępień
7665e13206 Log a message when a mirror zone loaded from disk comes into effect
Log a message when a mirror zone is successfully loaded from disk and
subsequently verified.

This could have been implemented in a simpler manner, e.g. by modifying
an earlier code branch inside zone_postload() which checks whether the
zone already has a database attached and calls attachdb() if it does
not, but that would cause the resulting logs to indicate that a mirror
zone comes into effect before the "loaded serial ..." message is logged,
which would be confusing.

Tweak some existing sed commands used in the "mirror" system test to
ensure that separate test cases comprising it do not break each other.
2019-01-16 10:34:15 -08:00
Michał Kępień
1c97ace7dc Log a message when a transferred mirror zone comes into effect
Log a message when a mirror zone is successfully transferred and
verified, but only if no database for that zone was yet loaded at the
time the transfer was initiated.

This could have been implemented in a simpler manner, e.g. by modifying
zone_replacedb(), but (due to the calling order of the functions
involved in finalizing a zone transfer) that would cause the resulting
logs to suggest that a mirror zone comes into effect before its transfer
is finished, which would be confusing given the nature of mirror zones
and the fact that no message is logged upon successful mirror zone
verification.

Once the dns_zone_replacedb() call in axfr_finalize() is made, it
becomes impossible to determine whether the transferred zone had a
database attached before the transfer was started.  Thus, that check is
instead performed when the transfer context is first created and the
result of this check is passed around in a field of the transfer context
structure.  If it turns out to be desired, the relevant log message is
then emitted just before the transfer context is freed.

Taking this approach means that the log message added by this commit is
not timed precisely, i.e. mirror zone data may be used before this
message is logged.  However, that can only be fixed by logging the
message inside zone_replacedb(), which causes arguably more dire issues
discussed above.

dns_zone_isloaded() is not used to double-check that transferred zone
data was correctly loaded since the 'shutdown_result' field of the zone
transfer context will not be set to ISC_R_SUCCESS unless axfr_finalize()
succeeds (and that in turn will not happen unless dns_zone_replacedb()
succeeds).
2019-01-16 10:33:02 -08:00
Evan Hunt
c13879a6fb Merge branch '512-acl-config' into 'master'
Resolve "inconsistent comments, documentation and behavior with some ACLs"

Closes #512

See merge request isc-projects/bind9!733
2019-01-16 02:40:58 -05:00
Evan Hunt
03ab07c9c0 CHANGES 2019-01-15 23:20:38 -08:00
Evan Hunt
33bca30a55 improved documentation 2019-01-15 23:20:38 -08:00
Evan Hunt
27f3a210d7 fix incorrect comments 2019-01-15 23:20:38 -08:00
Evan Hunt
adcc16f2d7 error on allow-update and allow-update-forwarding at options/view level 2019-01-15 23:20:38 -08:00
Evan Hunt
42de310291 Merge branch '816-sparc-assembler-not-recognising-pause-instruction-on-base-v9-arch' into 'master'
Resolve "Sparc assembler not recognising "pause" instruction on base v9 arch"

Closes #816

See merge request isc-projects/bind9!1338
2019-01-15 20:41:43 -05:00
Mark Andrews
2be55f5c05 use smt_pause instead of pause on sparc 2019-01-15 20:29:27 -05:00
Evan Hunt
02497cf6d3 Merge branch '792-bind9-doesn-t-tcp-retransmit' into 'master'
Resolve "bind9 doesn't tcp retransmit"

Closes #792

See merge request isc-projects/bind9!1284
2019-01-15 20:21:18 -05:00
Mark Andrews
dadb924be7 adjust timeout to allow for ECN negotiation failures 2019-01-15 17:10:41 -08:00
Mark Andrews
f056d04eed Merge branch '590-win32-sample-gai-c-should-call-wsastartup' into 'master'
Resolve "[Win32] sample-gai.c should call WSAStartup()"

Closes #590

See merge request isc-projects/bind9!1340
2019-01-15 00:26:32 -05:00
Mark Andrews
4500d9e91a add CHANGES 2019-01-15 14:23:21 +11:00
Mark Andrews
ac01359871 ensure that WSAStartup is called before getservbyname 2019-01-15 14:19:59 +11:00
Evan Hunt
47346110b1 Merge branch 'u/fanf2/rndc-managed-keys' into 'master'
Fix a few cosmetic issues with `rndc managed-keys`

See merge request isc-projects/bind9!1327
2019-01-14 19:11:28 -05:00
Mark Andrews
7122b5786d add multi-view server and tests 2019-01-14 14:10:05 -08:00
Mark Andrews
3175ea9a87 add CHANGES note 2019-01-14 14:01:42 -08:00
Tony Finch
6a3b851f72 Fix a few cosmetic issues with rndc managed-keys
The handling of class and view arguments was broken, because the code
didn't realise that next_token() would overwrite the class name when
it parsed the view name. The code was trying to implement a syntax
like `refresh [[class] view]`, but it was documented to have a syntax
like `refresh [class [view]]`. The latter is consistent with other rndc
commands, so that is how I have fixed it.

Before:

$ rndc managed-keys refresh in rec
rndc: 'managed-keys' failed: unknown class/type
unknown class 'rec'

After:

$ rndc managed-keys refresh in rec
refreshing managed keys for 'rec'

There were missing newlines in the output from `rndc managed-keys
refresh` and `rndc managed-keys destroy`.

Before:

$ rndc managed-keys refresh
refreshing managed keys for 'rec'refreshing managed keys for 'auth'

After:

$ rndc managed-keys refresh
refreshing managed keys for 'rec'
refreshing managed keys for 'auth'
2019-01-14 14:01:24 -08:00
Evan Hunt
2d68f606cf Merge branch 'ondrej/each-fix-dnssec-test-error-bis' into 'master'
b/t/s/dnssec/tests.sh: Cleanup showprivate() function

See merge request isc-projects/bind9!1335
2019-01-14 15:17:56 -05:00
Ondřej Surý
fd050b6baf b/t/s/dnssec/tests.sh: Cleanup showprivate() function 2019-01-14 11:49:55 +01:00
Ondřej Surý
246ac08770 Merge branch 'ondrej/fix-race-condition-in-dnstap' into 'master'
Fix race condition in cleanup part of dns_dt_create()

See merge request isc-projects/bind9!1323
2019-01-14 05:42:25 -05:00
Witold Kręcicki
4b5337e06b Add CHANGES entry for GL!1323 2019-01-14 11:28:47 +01:00
Ondřej Surý
482dd7eed3 Fix race condition in cleanup part of dns_dt_create() 2019-01-14 11:28:47 +01:00
Evan Hunt
3b1a914395 Merge branch 'each-fix-dnssec-test-error' into 'master'
DNSSEC test error

See merge request isc-projects/bind9!1330
2019-01-13 21:09:02 -05:00
Evan Hunt
82e83d5dc7 fix testing errors
- the checkprivate function in the dnssec test set ret=0, erasing
  results from previous tests and making the test appear to have passed
  when it shouldn't have
- checkprivate needed a delay loop to ensure there was time for all
  private signing records to be updated before the test
2019-01-13 17:50:08 -08:00
Mark Andrews
5da2d171df Merge branch 'u/fanf2/rndc-alphabetize' into 'master'
cleanup: alphabetize rndc command dispatch

See merge request isc-projects/bind9!1328
2019-01-13 20:25:41 -05:00
Tony Finch
66be4108bf cleanup: alphabetize rndc command dispatch 2019-01-11 15:34:02 +00:00
Mark Andrews
61f5306226 Merge branch '801-silence-coverity-issues' into 'master'
Resolve "Silence Coverity Issues"

Closes #801

See merge request isc-projects/bind9!1285
2019-01-09 23:02:16 -05:00
Mark Andrews
bd529b1f30 silence coverity issues; move isc_refcount_decrement out of INSIST 2019-01-10 14:42:28 +11:00
Ondřej Surý
67fbbc4e0c Merge branch '709-get-rid-of-message-catalogs' into 'master'
Resolve "Get rid of message catalogs"

Closes #709

See merge request isc-projects/bind9!1131
2019-01-09 18:07:56 -05:00
Ondřej Surý
01b75a9b5b Add CHANGES entry for GL #709 2019-01-09 23:45:14 +01:00
Ondřej Surý
189b8b76d4 Document removal of message catalogs in the release notes 2019-01-09 23:44:26 +01:00
Ondřej Surý
e2cdf066ea Remove message catalogs 2019-01-09 23:44:26 +01:00
Mark Andrews
f8965a5588 Merge branch '798-dlz-build_querystring-broken' into 'master'
Resolve "DLZ build_querystring broken"

Closes #798

See merge request isc-projects/bind9!1281
2019-01-09 04:21:26 -05:00
Mark Andrews
4c7e6e0799 correctly split query string; cleanups 2019-01-09 19:57:46 +11:00
Mark Andrews
f9d9c5686d Merge branch '784-bind-9-12-3-p1-fatal-error' into 'master'
Resolve "bind 9.12.3-P1 fatal error"

Closes #784

See merge request isc-projects/bind9!1283
2019-01-09 03:46:43 -05:00
Mark Andrews
9dd39d5385 add CHANGES 2019-01-09 19:28:16 +11:00
Mark Andrews
ca977e3976 update refreshkeytime 2019-01-09 19:27:40 +11:00
Mark Andrews
43bfd4cccc Merge branch 'marka-maybe_numeric-and-nul' into 'master'
maybe_numeric failed to handle NUL in text region.

Closes #807

See merge request isc-projects/bind9!1319
2019-01-09 02:58:23 -05:00
Mark Andrews
ee23780246 maybe_numeric failed to handle NUL in text region. 2019-01-09 18:33:42 +11:00
Mark Andrews
287bb7b482 Merge branch 'marka-fail-when-required-field-is-missing' into 'master'
Ensure base64/base32/hex fields in DNS records that should be non-empty are.

See merge request isc-projects/bind9!1318
2019-01-09 02:27:37 -05:00
Mark Andrews
5e8b772ad1 Ensure base64/base32/hex fields in DNS records that should be non-empty are. 2019-01-09 18:04:21 +11:00
Mark Andrews
5114270fa7 Merge branch '804-large-nsec3-responses-cause-failure-in-adding-records-to-ncache-and-eventually-formerr-instead-of-nxdomain' into 'master'
Resolve "Large NSEC3 responses cause failure in adding records to ncache and, eventually, FORMERR (instead of NXDOMAIN)"

Closes #804

See merge request isc-projects/bind9!1295
2019-01-09 00:06:30 -05:00
Mark Andrews
3328116b57 add CHANGES entry 2019-01-09 15:54:04 +11:00
Mark Andrews
604889e627 allow for up 100 records or 64K of data to be in a ncache entry 2019-01-09 15:53:32 +11:00
Mark Andrews
8e6af477dd Merge branch '804-large-nsec3-responses-cause-failure-in-adding-records-to-ncache-and-eventually-formerr-instead-of-nxdomain-2' into 'master'
Resolve "Large NSEC3 responses cause failure in adding records to ncache and, eventually, FORMERR (instead of NXDOMAIN)"

Closes #804

See merge request isc-projects/bind9!1298
2019-01-08 23:39:42 -05:00
Mark Andrews
188c184381 add CHANGES 2019-01-09 15:19:42 +11:00
Mark Andrews
0c42a9c0ab explictly convert ISC_R_NOSPACE from dns_message_parse to DNS_R_FORMERR and remove from dns_result_torcode 2019-01-09 15:19:42 +11:00
Evan Hunt
c6ac1b092d Merge branch '812-cookie-test-failed' into 'master'
Resolve "cookie test failed."

Closes #812

See merge request isc-projects/bind9!1300
2019-01-08 23:15:40 -05:00
Mark Andrews
8a8d378def wait longer for dump to complete 2019-01-08 23:04:22 -05:00
Ondřej Surý
10d8f3194f Merge branch 'ondrej/disable-CI-in-release-branches' into 'master'
Run the regular pipelines only for merge requests, and run only the Debian sid...

See merge request isc-projects/bind9!1309
2019-01-08 08:57:13 -05:00
Ondřej Surý
24961f6068 Run the regular pipelines only for merge requests, and run only the Debian sid build for release branches 2019-01-08 14:31:07 +01:00
Michał Kępień
1b409b8cfc Merge branch '692-dig-fix-cleanup-upon-an-error-before-tcp-socket-creation' into 'master'
Fix cleanup upon an error before TCP socket creation

Closes #692

See merge request isc-projects/bind9!1100
2019-01-08 05:57:10 -05:00
Michał Kępień
3242cb53ec Add CHANGES entry
5123.	[bug]		dig could hang indefinitely after encountering an error
			before creating a TCP socket. [GL #692]
2019-01-08 11:17:39 +01:00
Michał Kępień
13975b32c6 Fix cleanup upon an error before TCP socket creation
When a query times out after a socket is created and associated with a
given dig_query_t structure, calling isc_socket_cancel() causes
connect_done() to be run, which in turn takes care of all necessary
cleanups.  However, certain errors (e.g. get_address() returning
ISC_R_FAMILYNOSUPPORT) may prevent a TCP socket from being created in
the first place.  Since force_timeout() may be used in code handling
such errors, connect_timeout() needs to properly clean up a TCP query
which is not associated with any socket.  Call clear_query() from
connect_timeout() after attempting to send a TCP query to the next
available server if the timed out query does not have a socket
associated with it, in order to prevent dig from hanging indefinitely
due to the dig_query_t structure not being detached from its parent
dig_lookup_t structure.
2019-01-08 11:17:39 +01:00
Michał Kępień
c108fc5c6e Refactor code sending a query to the next server upon a timeout
When a query times out and another server is available for querying
within the same lookup, the timeout handler - connect_timeout() - is
responsible for sending the query to the next server.  Extract the
relevant part of connect_timeout() to a separate function in order to
improve code readability.
2019-01-08 11:17:39 +01:00
Michał Kępień
ef1da8731b Remove dead code handling address family mismatches for TCP sockets
Before commit c2ec022f57, using the "-b"
command line switch for dig did not disable use of the other address
family than the one to which the address supplied to that option
belonged to.  Thus, bind9_getaddresses() could e.g. prepare an
isc_sockaddr_t structure for an IPv6 address when an IPv4 address has
been passed to the "-b" command line option.  To avoid attempting the
impossible (e.g. querying an IPv6 address from a socket bound to an IPv4
address), a certain code block in send_tcp_connect() checked whether the
address family of the server to be queried was the same as the address
family of the socket set up for sending that query; if there was a
mismatch, that particular server address was skipped.

Commit c2ec022f57 made
bind9_getaddresses() fail upon an address family mismatch between the
address the hostname passed to it resolved to and the address supplied
to the "-b" command line option.  Such failures were fatal to dig back
then.

Commit 7f65860391 made
bind9_getaddresses() failures non-fatal, but also ensured that a
get_address() failure in send_tcp_connect() still causes the given query
address to be skipped (and also made such failures trigger an early
return from send_tcp_connect()).

Summing up, the code block handling address family mismatches in
send_tcp_connect() has been redundant since commit
c2ec022f57.  Remove it.
2019-01-08 11:17:39 +01:00
Michał Kępień
dca1652458 Merge branch '315-track-forwarder-timeouts-in-fetch-contexts' into 'master'
Track forwarder timeouts in fetch contexts

Closes #315

See merge request isc-projects/bind9!826
2019-01-08 05:00:03 -05:00
Michał Kępień
1df9ca9e6a Add CHANGES entry
5122.	[bug]		In a "forward first;" configuration, a forwarder
			timeout did not prevent that forwarder from being
			queried again after falling back to full recursive
			resolution. [GL #315]
2019-01-08 08:29:54 +01:00
Michał Kępień
33350626f9 Track forwarder timeouts in fetch contexts
Since following a delegation resets most fetch context state, address
marks (FCTX_ADDRINFO_MARK) set inside lib/dns/resolver.c are not
preserved when a delegation is followed.  This is fine for full
recursive resolution but when named is configured with "forward first;"
and one of the specified forwarders times out, triggering a fallback to
full recursive resolution, that forwarder should no longer be consulted
at each delegation point subsequently reached within a given fetch
context.

Add a new badnstype_t enum value, badns_forwarder, and use it to mark a
forwarder as bad when it times out in a "forward first;" configuration.
Since the bad server list is not cleaned when a fetch context follows a
delegation, this prevents a forwarder from being queried again after
falling back to full recursive resolution.  Yet, as each fetch context
maintains its own list of bad servers, this change does not cause a
forwarder timeout to prevent that forwarder from being used by other
fetch contexts.
2019-01-08 08:29:54 +01:00
Mark Andrews
a38b31ccf9 Merge branch 'marka-fix-stub_dlz_allowzonexfr' into 'master'
return ISC_R_NOTFOUND when name does not match the zone name

See merge request isc-projects/bind9!1299
2019-01-06 23:06:13 -05:00
Mark Andrews
bb57c7f775 add CHANGES 2019-01-07 14:38:48 +11:00
Mark Andrews
402190df18 return ISC_R_NOTFOUND when name does not match the zone name 2019-01-06 22:21:24 -05:00
Evan Hunt
3485fe4b86 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1297
2019-01-03 14:10:30 -05:00
Evan Hunt
5cdc63254b placeholder 2019-01-03 11:10:05 -08:00
Evan Hunt
792692f86d Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1294
2019-01-02 20:30:47 -05:00
Evan Hunt
32edbd7859 placeholder 2019-01-02 17:30:18 -08:00
Mark Andrews
971c01ad19 Merge branch 'indenting' into 'master'
indenting

See merge request isc-projects/bind9!1286
2019-01-01 19:41:35 -05:00
Mark Andrews
c69ad95238 indenting 2019-01-02 10:56:59 +11:00
Mark Andrews
18e393bd90 Merge branch 'copyrights' into 'master'
update copyrights

See merge request isc-projects/bind9!1287
2019-01-01 18:53:45 -05:00
Mark Andrews
dc64b70616 update copyrights 2019-01-02 10:20:43 +11:00
Mark Andrews
3a754d4bf8 Merge branch 'marka-readme-typo' into 'master'
fix typo in readme

See merge request isc-projects/bind9!1282
2018-12-26 20:38:21 -05:00
Mark Andrews
4af0d9145a s/now/no/ 2018-12-27 12:37:11 +11:00
Evan Hunt
1b95cb79bb Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1277
2018-12-20 18:38:02 -05:00
Evan Hunt
5ea712d964 placeholder 2018-12-20 15:37:18 -08:00
Evan Hunt
8f02762b81 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1276
2018-12-20 16:26:49 -05:00
Evan Hunt
5b63b595fc placeholder 2018-12-20 13:26:14 -08:00
Ondřej Surý
285d5b125b Merge branch 'ondrej/git-replay-merge-script-update' into 'master'
Update git-replay-merge.sh script

See merge request isc-projects/bind9!1275
2018-12-20 05:51:39 -05:00
Ondřej Surý
5b29b6889b Update git-replay-merge.sh script 2018-12-20 11:48:41 +01:00
Ondřej Surý
6d577430ce Merge branch '768-add-description-to-ldap-schema' into 'master'
Add optional description field to LDAP schema

Closes #768

See merge request isc-projects/bind9!1267
2018-12-20 04:14:53 -05:00
Roland Gruber
83903f6f5e Add optional description field to LDAP schema 2018-12-20 09:47:07 +01:00
Mark Andrews
4075347c47 Merge branch '778-named-checkconf-crashes-in-name-c' into 'master'
Resolve "named-checkconf crashes in name.c"

Closes #778

See merge request isc-projects/bind9!1235
2018-12-20 03:35:29 -05:00
Mark Andrews
b75970efa3 named-checkconf triggered a assertion when a mirror zone had a bad name 2018-12-20 13:19:18 +11:00
Ondřej Surý
314a25e4d4 Merge branch 'ondrej/flycheck-fix' into 'master'
Fix the cppcheck include path for flycheck

See merge request isc-projects/bind9!1264
2018-12-19 18:14:29 -05:00
Ondřej Surý
1a4559030e Fix the cppcheck include path for flycheck 2018-12-19 18:14:17 -05:00
Ondřej Surý
301f2fbedc Merge branch '787-set-the-clang-define-to-1' into 'master'
__SANITIZE_ADDRESS__ needs to be defined to 1

See merge request isc-projects/bind9!1262
2018-12-19 18:14:00 -05:00
Ondřej Surý
ff7c868f25 __SANITIZE_ADDRESS__ needs to be defined to 1 2018-12-19 22:02:37 +01:00
Ondřej Surý
1a93e5bd3e Merge branch 'ondrej/add-emacs-flycheck-mode-configuration' into 'master'
Add emacs flycheck mode configuration

See merge request isc-projects/bind9!1165
2018-12-19 15:50:00 -05:00
Ondřej Surý
272c065268 Add emacs .dir-locals.el settings for flycheck mode 2018-12-19 17:03:37 +01:00
Matthijs Mekking
191b12e304 Merge branch '783-dnssec-signzone-unsupported-algorithms' into 'master'
Resolve "Allow unsupported algorithms in zone when not used for signing"

Closes #783

See merge request isc-projects/bind9!1250
2018-12-19 09:10:09 -05:00
Matthijs Mekking
a7de66142c Artificial change to retry pipeline 2018-12-19 14:52:23 +01:00
Matthijs Mekking
17cdde1e56 Replace DSA with Reserved algorithm 2018-12-19 12:54:57 +01:00
Matthijs Mekking
cefc3706a0 Update copyrights 2018-12-19 12:54:57 +01:00
Matthijs Mekking
5ca649967e Move REQUIRE outside comment unsupported alg 2018-12-19 12:54:57 +01:00
Matthijs Mekking
34c0948aa7 Add DSA key to copyrights 2018-12-19 12:54:57 +01:00
Matthijs Mekking
6afa8a77d3 Update changefile 2018-12-19 12:54:57 +01:00
Matthijs Mekking
1dd11fc754 Allow unsupported alg in zone /w dnssec-signzone
dnssec-signzone should sign a zonefile that contains a DNSKEY record
with an unsupported algorithm.  Current behavior is that it will
fail, hitting a fatal error.  The fix detects unsupported algorithms
and will not try to add it to the keylist.

Also when determining the maximum iterations for NSEC3, don't take
into account DNSKEY records in the zonefile with an unsupported
algorithm.
2018-12-19 12:54:31 +01:00
Matthijs Mekking
6d976b37c1 Add dnssec-signzone tests with unsupported alg
dnssec-signzone should sign a zonefile that contains a DNSKEY record
with an unsupported algorithm.
2018-12-19 12:54:31 +01:00
Ondřej Surý
b04842c057 Merge branch '787-use-correct-define' into 'master'
gcc defines __SANITIZE_ADDRESS__ and not __ADDRESS_SANITIZER__, use the correct #define

Closes #787

See merge request isc-projects/bind9!1255
2018-12-19 06:48:48 -05:00
Ondřej Surý
8903d68d69 gcc defines __SANITIZE_ADDRESS__ and not __ADDRESS_SANITIZER__, use the correct #define 2018-12-19 12:24:59 +01:00
Witold Krecicki
37c2d69547 Merge branch 'wpk-rndc-reload-in-tests' into 'master'
Add a status line to rndc status notifying that server is being reloaded/reconfigured; use it in tests

See merge request isc-projects/bind9!1149
2018-12-19 06:18:46 -05:00
Witold Kręcicki
6e12939d63 CHANGES notes 2018-12-19 11:35:40 +01:00
Witold Kręcicki
6d50138405 Use rndc_reload in tests, make sure that reload is complete before continuing 2018-12-19 11:33:37 +01:00
Witold Kręcicki
517449e0e6 Add a status line to rndc status notifying that server is being reloaded/reconfigured 2018-12-19 11:32:21 +01:00
Ondřej Surý
35d495db68 Merge branch '787-disable-rtld_deepbind-when-compiled-under-asan' into 'master'
Resolve "RTLD_DEEPBIND and AddressSanitizer aren't compatible"

Closes #787

See merge request isc-projects/bind9!1251
2018-12-19 04:46:53 -05:00
Ondřej Surý
cad6b39cab Disable RTLD_DEEPBIND when compiled under AddressSanitizer 2018-12-19 09:59:40 +01:00
Ondřej Surý
e1ce3a3d42 Define __ADDRESS_SANITIZER__ if compiling under clang's AddressSanitizer 2018-12-19 09:54:37 +01:00
Ondřej Surý
16d486ec59 Merge branch '781-fix-python-check-in-configure-script' into 'master'
Resolve "configure script in BIND 9.13.5 release fails to detect python"

Closes #781

See merge request isc-projects/bind9!1248
2018-12-18 10:56:21 -05:00
Ondřej Surý
99cf0faec0 Add some combinations of --with-python=<path>/--with-python/--without-python to GitLab CI 2018-12-18 16:08:20 +01:00
Ondřej Surý
3951cb053b When --with-python is given to configure, use default search list for python binaries instead of 'yes' 2018-12-18 16:08:20 +01:00
Ondřej Surý
41478d0af6 Merge branch 'ondrej-retry-test-jobs' into 'master'
For system tests, retry twice before failing

See merge request isc-projects/bind9!1249
2018-12-18 10:06:01 -05:00
Ondřej Surý
b6538b5488 For system tests, retry twice before failing 2018-12-18 15:33:59 +01:00
Witold Krecicki
d77ac39370 Merge branch 'wpk-separate-common-stuff-conf-sh' into 'master'
Get common stuff out of bin/tests/system/conf.sh.{in,win32} into conf.sh.common

See merge request isc-projects/bind9!1241
2018-12-18 08:57:17 -05:00
Witold Kręcicki
fee890461b Get common stuff out of bin/tests/system/conf.sh.{in,win32} into conf.sh.common 2018-12-18 08:57:05 -05:00
Ondřej Surý
6ea19e66c3 Merge branch '782-add-support-for-msys2-in-stop.pl-script' into 'master'
Properly detect msys/msys2 environment in the stop.pl script.

See merge request isc-projects/bind9!1247
2018-12-18 08:46:03 -05:00
Ondřej Surý
808dac0760 Properly detect msys/msys2 environment in the stop.pl script. 2018-12-18 14:27:56 +01:00
Ondřej Surý
8b10b07d20 Merge branch '785-fix-posix-shell-autoconf-macro' into 'master'
Break out of loop when first POSIX-compatible shell is found

Closes #785

See merge request isc-projects/bind9!1245
2018-12-18 07:29:12 -05:00
Ondřej Surý
cc0a3c5d3c Break out of loop when first POSIX-compatible shell is found 2018-12-18 13:02:00 +01:00
Evan Hunt
39f6d33002 Merge branch 'each-win-fix2' into 'master'
fix windows build error

See merge request isc-projects/bind9!1246
2018-12-17 18:14:27 -05:00
Evan Hunt
b269c7e4a0 CHANGES 2018-12-17 17:10:33 -05:00
Evan Hunt
de13354caf only the debug build was fixed previously; release needs fixing too 2018-12-17 17:10:33 -05:00
Ondřej Surý
90f1446253 Merge branch '782-revert-cygwin-grep-CRLF-issue' into 'master'
Revert "Merge branch '782-cygwin-grep-CRLF-issue' into 'master'"

See merge request isc-projects/bind9!1242
2018-12-17 06:57:44 -05:00
Ondřej Surý
7a721f983e Revert "Merge branch '782-cygwin-grep-CRLF-issue' into 'master'"
This reverts commit 4af9f97189, reversing
changes made to 0289f3f281.
2018-12-17 12:23:14 +01:00
Evan Hunt
4af9f97189 Merge branch '782-cygwin-grep-CRLF-issue' into 'master'
Resolve "current version of cygwin grep causes tests to fail when grepping for end of line character"

Closes #782

See merge request isc-projects/bind9!1230
2018-12-14 21:47:23 -05:00
Curtis Blackburn
2ec746dafe minor fixes to dns64 and rndc CRLF fix. rpzrecurse failure
will be addressed in a separate issue
2018-12-14 18:22:58 -08:00
Curtis Blackburn
9fc68285ef more CRLF fixes (dns64, rndc, rpzrecurse) 2018-12-14 18:22:58 -08:00
Curtis Blackburn
bdbf6ede3a missed one in the digdelv test 2018-12-14 18:22:58 -08:00
Curtis Blackburn
ba1b9ca4d4 digdelv test fixed for CRLF issue 2018-12-14 18:22:58 -08:00
Curtis Blackburn
18e8835044 windows CRLF issues fixed in builtin test 2018-12-14 18:22:58 -08:00
Mark Andrews
0289f3f281 Merge branch '779-named-checkconf-crashes-in-parser-c' into 'master'
Resolve "named-checkconf crashes in parser.c"

Closes #779

See merge request isc-projects/bind9!1234
2018-12-14 14:47:32 -05:00
Mark Andrews
53a33f7365 pass the correct object to cfg_obj_log 2018-12-14 16:29:02 +11:00
Mark Andrews
17ce0b373f Merge branch '742-isc-support-13767-nsec3-typemap-improperly-includes-dnskey-rrset-instead-of-ignoring-it-as-out-of-zone' into 'master'
Resolve "[ISC-support #13767] NSEC3 typemap improperly includes DNSKEY RRset instead of ignoring it as out-of-zone"

Closes #742

See merge request isc-projects/bind9!1231
2018-12-13 21:53:53 -05:00
Mark Andrews
85da986d68 add CHANGES 2018-12-14 13:21:35 +11:00
Mark Andrews
f2f7711977 add unit tests for dns_rdatatype_atcname, dns_rdatatype_atparent and iszonecutauth 2018-12-14 13:21:35 +11:00
Mark Andrews
7e4b82103b check that DNSKEY and other occluded data are excluded from the delegating bitmap 2018-12-14 12:48:55 +11:00
Mark Andrews
f4ceb12b69 create dns_rdatatype_atcname to split records that can appear along side CNAME from DNSSEC; dns_rdatatype_iszonecutauth allowed too many types 2018-12-14 12:48:55 +11:00
Mark Andrews
d78d405d1a Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!1228
2018-12-13 01:30:09 -05:00
Mark Andrews
fed3e7a815 placeholder 2018-12-13 16:49:12 +11:00
Evan Hunt
2da3caf339 Merge branch 'marka-tabify-changes-precheck' into 'master'
tabify changes precheck

See merge request isc-projects/bind9!1220
2018-12-13 00:22:21 -05:00
Mark Andrews
730015f33e white space 2018-12-12 21:10:22 -08:00
Mark Andrews
87b3b46096 tabify-changes precheck 2018-12-12 21:10:22 -08:00
Ondřej Surý
a5678ed78f Merge branch 'ondrej/rename-the-envvar-to-BUILD_PARALLEL_JOBS' into 'master'
Rename the GitLab CI environment variable to BUILD_PARALLEL_JOBS

See merge request isc-projects/bind9!1223
2018-12-12 16:58:35 -05:00
Ondřej Surý
e20d5e4dd2 Rename the GitLab CI environment variable to BUILD_PARALLEL_JOBS 2018-12-12 15:57:36 -05:00
Ondřej Surý
bb60797799 Merge branch 'ondrej/add-ubuntu-to-build-and-test-jobs' into 'master'
Add Ubuntu Xenial and Bionic to build and test jobs in the GitLab CI

See merge request isc-projects/bind9!1221
2018-12-12 09:35:59 -05:00
Ondřej Surý
6e53bb4e09 fixup! Add Ubuntu Xenial and Bionic to GitLab CI jobs 2018-12-12 15:05:12 +01:00
Ondřej Surý
a32d2360f7 Add Ubuntu Xenial and Bionic to GitLab CI jobs 2018-12-12 14:52:29 +01:00
Mark Andrews
d844959a44 Merge branch '760-the-notify-system-test-incorrectly-detects-startup-notify-rate-error' into 'master'
Resolve "The notify system test incorrectly detects startup notify rate error."

Closes #760

See merge request isc-projects/bind9!1179
2018-12-11 18:19:24 -05:00
Mark Andrews
47a4e0eeaa check that the time between notify messages is not too small 2018-12-12 09:39:00 +11:00
Matthijs Mekking
ff20b8040d Merge branch '628-remove-support-for-insecure-rsamd5' into 'master'
Resolve "Remove support for insecure RSAMD5"

Closes #628

See merge request isc-projects/bind9!1106
2018-12-11 09:21:07 -05:00
Ondřej Surý
0ef2853c0d Add CHANGES entry for GL #628 2018-12-11 11:32:24 +01:00
Ondřej Surý
abe39991be Add release notes for RSAMD5 removal. 2018-12-11 11:32:24 +01:00
Ondřej Surý
5cc06e475a Documentation update with newer algorithms tham RSAMD5 and RSASHA1 2018-12-11 11:32:24 +01:00
Ondřej Surý
826c335980 Remove outdated bin/tests/optional/dst_test test 2018-12-11 11:32:24 +01:00
Ondřej Surý
a2e38f758d Add lib/dns/tests/testdata/dnstap/dnstap.file to .gitignore 2018-12-11 11:32:24 +01:00
Ondřej Surý
e69dc0dbc7 Remove RSAMD5 support 2018-12-11 11:32:24 +01:00
Ondřej Surý
74f895740c Merge branch '628-refactor-digdelv-system-test' into 'master'
Refactor digdelv system test

See merge request isc-projects/bind9!1190
2018-12-11 05:16:59 -05:00
Ondřej Surý
bc12c52e82 Run the digdelv tests with set -e enabled 2018-12-11 10:21:47 +01:00
Ondřej Surý
351efd8812 Update digdelv system test to not use static RSAMD5 key and make scripts shellcheck clean 2018-12-11 10:21:40 +01:00
Ondřej Surý
7ff7de0609 Merge branch '628-refactor-synthfromdnssec-system-test' into 'master'
Refactor synthfromdnssec system test

See merge request isc-projects/bind9!1193
2018-12-11 04:19:52 -05:00
Ondřej Surý
f5785f97fc Refactor synthfromdnssec system test to use $DEFAULT_ALGORITHM, be shellcheck clean and run under set -e 2018-12-11 09:44:08 +01:00
Ondřej Surý
e71bbde57d Merge branch '628-refactor-sfcache-test' into 'master'
Refactor sfcache system test

See merge request isc-projects/bind9!1184
2018-12-11 03:43:14 -05:00
Ondřej Surý
e1bf5624fb Run the sfcache system tests with set -e enabled 2018-12-11 09:27:16 +01:00
Ondřej Surý
f566010717 sfcache system test: Remove RSAMD5 usage and make script shellcheck compliant 2018-12-11 09:27:16 +01:00
Ondřej Surý
7e07d05ae7 Replace RSAMD5 keys with keys using DEFAULT_ALGORITHM variable from conf.sh 2018-12-11 09:27:16 +01:00
Ondřej Surý
211d83b0cd Merge branch '628-refactor-dnssec-system-test' into 'master'
Refactor dnssec system test

See merge request isc-projects/bind9!1191
2018-12-10 14:01:44 -05:00
Ondřej Surý
aeebcb4ae8 Run the dnssec system tests with set -e enabled 2018-12-10 19:47:32 +01:00
Ondřej Surý
ca7cadfa92 dnssec system test: Remove RSAMD5 usage and make script shellcheck compliant 2018-12-10 19:47:32 +01:00
Ondřej Surý
a160fecaa1 Replace RSAMD5 keys with keys using DEFAULT_ALGORITHM variable from conf.sh 2018-12-10 09:16:46 -08:00
Evan Hunt
c0eb02d435 Merge branch '756-dyndb-system-test-failing-intermittently' into 'master'
Resolve "dyndb system test failing intermittently."

Closes #756

See merge request isc-projects/bind9!1210
2018-12-10 12:05:14 -05:00
Mark Andrews
3bca52ca07 allow a small about of time for the syncptr event to be processed 2018-12-10 16:59:27 +11:00
Mark Andrews
e5da71f746 Merge branch 'michal-extend-dname-dnssec-tests' into 'master'
Extend DNAME DNSSEC tests

See merge request isc-projects/bind9!1205
2018-12-10 00:51:06 -05:00
Michał Kępień
adbca54079 Check that DNAME is not treated as a delegation when signing 2018-12-09 23:12:41 -05:00
Mark Andrews
6b470bbf42 verify that auto-dnssec maintain generates and signs NSEC3 records with DNAME at the apex 2018-12-09 23:12:41 -05:00
Mark Andrews
06e218c421 verify that dnssec-signzone generates NSEC3 records with DNAME at the apex 2018-12-09 23:12:41 -05:00
Mark Andrews
4ccff3bbed Merge branch 'michal-zone_sign-error-logging' into 'master'
Log CHECK() errors in zone_sign()

See merge request isc-projects/bind9!1206
2018-12-09 23:11:47 -05:00
Mark Andrews
b108376a10 log a error if we don't explicitly know that a error has been logged in zone_sign 2018-12-10 14:57:11 +11:00
Evan Hunt
8b17f364a9 Merge branch 'each-win32-fix' into 'master'
add missing hooks.c and hooks.h to project files, remove missing symbols

See merge request isc-projects/bind9!1207
2018-12-07 13:44:21 -05:00
Evan Hunt
c6527aedc7 fix win32 build
- add missing hooks.h and hooks.c to project files
- remove extraneous symbols from libns.def
2018-12-07 10:12:00 -08:00
Tinderbox User
882ad18c5e Merge branch 'prep-release' 2018-12-07 03:41:27 +00:00
Tinderbox User
5bd855251c prep 9.13.5 2018-12-07 03:41:19 +00:00
Evan Hunt
cbde34e7a3 Merge branch 'each-check-cfg' into 'master'
checklibs needs to grep for the cfg_* prefix in lib/isccfg

See merge request isc-projects/bind9!1201
2018-12-06 21:07:12 -05:00
Evan Hunt
ab7356a7de checklibs needs to grep for the cfg_* prefix in lib/isccfg 2018-12-06 21:05:55 -05:00
Evan Hunt
90b773134c Merge branch '770-building-with-geoip-is-currently-broken-on-master' into 'master'
Resolve "Building with GEOIP is currently broken on master."

See merge request isc-projects/bind9!1202
2018-12-06 21:05:23 -05:00
Mark Andrews
b2aca96c27 move geoip to parser.c 2018-12-07 12:50:03 +11:00
Mark Andrews
388bfdb945 Merge branch 'michal-befix-squashed' into 'master'
Fix bottom of zone determination.

Closes #771

See merge request isc-projects/bind9!1198
2018-12-06 19:38:33 -05:00
Mark Andrews
c8e92d3e45 add CHANGES and release notes entries. 2018-12-07 11:21:47 +11:00
Mark Andrews
9eec02a81f Properly detect bottom of zone when sign_a_node() is not called 2018-12-07 11:20:16 +11:00
Evan Hunt
0c0536a1e4 Merge branch 'each-fix-macos-build' into 'master'
fix shared library build on darwin

See merge request isc-projects/bind9!1197
2018-12-06 18:58:14 -05:00
Evan Hunt
115736b3f5 fix shared library build on darwin 2018-12-06 18:57:53 -05:00
Mark Andrews
5e2cd91321 Merge branch '769-host-u-documented-in-manpage-but-disabled-in-code' into 'master'
Resolve ""host -U" documented in manpage, but disabled in code"

Closes #769

See merge request isc-projects/bind9!1194
2018-12-06 16:10:45 -05:00
Mark Andrews
9586c3a696 add CHANGES 2018-12-07 07:56:43 +11:00
Andreas Hasenack
665618698e add -U to preparse and usage 2018-12-07 07:43:52 +11:00
Evan Hunt
71e54bfe0f Merge branch '15-filter-aaaa-module' into 'master'
first module: filter-aaaa

See merge request isc-projects/bind9!799
2018-12-06 13:57:49 -05:00
Evan Hunt
fa666f5d88 CHANGES, release notes 2018-12-06 10:36:50 -08:00
Michał Kępień
0e12988dd6 make hook actions return an enum instead of a bool
Use an enum instead of a bool for the return type of hook actions in
order to facilitate adding further hook processing models in the future.
2018-12-06 10:36:50 -08:00
Evan Hunt
f70a84537d revise hooks.h comments 2018-12-06 10:36:50 -08:00
Evan Hunt
c63ead9d96 add basic plugins documentation 2018-12-06 10:36:50 -08:00
Michał Kępień
4234968798 add a function for processing a list of configured plugins
Add a new libisccfg function, cfg_pluginlist_foreach(), which allows an
arbitrary callback to be invoked for every "plugin" stanza present in a
configuration object.  Use this function for both loading plugins and
checking their configuration in order to reduce duplication of
configuration processing code present in bin/named/server.c and
lib/bind9/check.c.
2018-12-06 10:36:50 -08:00
Evan Hunt
fd20f10d52 name change from "hook modules" to "plugins"
- "hook" is now used only for hook points and hook actions
- the "hook" statement in named.conf is now "plugin"
- ns_module and ns_modlist are now ns_plugin and ns_plugins
- ns_module_load is renamed ns_plugin_register
- the mandatory functions in plugin modules (hook_register,
  hook_check, hook_version, hook_destroy) have been renamed
2018-12-06 10:36:50 -08:00
Evan Hunt
8da0c0e7d5 eliminate ns_hookctx structure, pass mctx/lctx/view directly 2018-12-06 10:36:44 -08:00
Evan Hunt
7a47e4d85f restore filter-aaaa syntax checking
- added functionality to check hook parameters in named-checkconf,
  and restored the checkconf tests that were removed from the
  filter-aaaa test.
2018-12-06 10:29:12 -08:00
Evan Hunt
b94945e606 refactor to support multiple module instances
- use a per-view module list instead of global hook_modules
- create an 'instance' pointer when registering modules, store it in
  the module structure, and use it as action_data when calling
  hook functions - this enables multiple module instances to be set
  up in parallel
- also some nomenclature changes and cleanup
2018-12-06 10:29:12 -08:00
Evan Hunt
9df0bdc99c add additional hook points, plus some minor refactoring
- added some hook points that will be needed for a dns64 module later
- moved some code from the beginning of query_respond() to
  the end of query_prepresponse(); this has no effect on functionality
  but means we can have a hook point at the top of query_respond(),
  which seems nicer
- compressed duplicated code into query_zerottl_refetch() function
- added a qctx->answered flag so that a module can prevent
  query_addrrset() from being called from query_respond() when
  it's already been called from the module.
2018-12-06 10:29:12 -08:00
Michał Kępień
baa38d6e94 refactor response filtering code in bin/hooks/filter-aaaa.c 2018-12-06 10:29:12 -08:00
Evan Hunt
0b988256c7 copy ns_hook objects before adding them to a hook table
- this is necessary because adding the same hook to multiple views
  causes the ISC_LIST link value to become inconsistent; it isn't
  noticeable when only one hook action is ever registered at a
  given hook point, but it will break things when there are two.
2018-12-06 10:29:12 -08:00
Evan Hunt
74683fbc3b use entirely local persistent data in modules
- eliminate qctx->hookdata and client->hookflags.
- use a memory pool to allocate data blobs in the filter-aaaa module,
  and associate them with the client address in a hash table
- instead of detaching the client in query_done(), mark it for deletion
  and then call ns_client_detach() from qctx_destroy(); this ensures
  that it will still exist when the QCTX_DESTROYED hook point is
  reached.
2018-12-06 10:29:12 -08:00
Evan Hunt
8725f57371 refactor to remove dead code in query_respond_any() 2018-12-06 10:29:12 -08:00
Evan Hunt
427e9ca357 clear AD flag when altering response messages
- the AD flag was not being cleared correctly when filtering
- enabled dnssec valdiation in the filter-aaaa test to confirm this
  works correctly now
2018-12-06 10:29:11 -08:00
Evan Hunt
055bf2665c improve hook processing macros
- use a get_hooktab() function to determine the hook table.
- PROCESS_HOOK now jumps to a cleanup tag on failure
- add PROCESS_ALL_HOOKS in query.c, to run all hook functions at
  a specified hook point without stopping. this is to be used for
  intiialization and destruction functions that must run in every
  module.
- 'result' is set in PROCESS_HOOK only when a hook function
  interrupts processing.
- revised terminology: a "callback" is now a "hook action"
- remove unused NS_PROCESS_HOOK and NS_PROCESS_HOOK_VOID macros.
2018-12-06 10:29:11 -08:00
Evan Hunt
81f58e2ea2 enable modules to store data in qctx
- added a 'hookdata' array to qctx to store pointers to up to
  16 blobs of data which are allocated by modules as needed.
  each module is assigned an ID number as it's loaded, and this
  is the index into the hook data array. this is to be used for
  holding persistent state between calls to a hook module for a
  specific query.
- instead of using qctx->filter_aaaa, we now use qctx->hookdata.
  (this was the last piece of filter-aaaa specific code outside the
  module.)
- added hook points for qctx initialization and destruction. we get
  a filter-aaaa data pointer from the mempool when initializing and
  store it in the qctx->hookdata table; return to to the mempool
  when destroying the qctx.
- link the view to the qctx so that detaching the client doesn't cause
  hooks to fail
- added a qctx_destroy() function which must be called after qctx_init;
  this calls the QCTX_DESTROY hook and detaches the view
- general cleanup and comments
2018-12-06 10:29:11 -08:00
Evan Hunt
9911c835d3 add a parser to filter-aaaa.so and pass in the parameters
- make some cfg-parsing functions global so they can be run
  from filter-aaaa.so
- add filter-aaaa options to the hook module's parser
- mark filter-aaaa options in named.conf as obsolete, remove
  from named and checkconf, and update the filter-aaaa test not to
  use checkconf anymore
- remove filter-aaaa-related struct members from dns_view
2018-12-06 10:29:11 -08:00
Evan Hunt
d2f4644388 add hook statement to configuration parser
- allow multiple "hook" statements at global or view level
- add "optional bracketed text" type for optional parameter list
- load hook module from specified path rather than hardcoded path
- add a hooktable pointer (and a callback for freeing it) to the
  view structure
- change the hooktable functions so they no longer update ns__hook_table
  by default, and modify PROCESS_HOOK so it uses the view hooktable, if
  set, rather than ns__hook_table. (ns__hook_table is retained for
  use by unit tests.)
- update the filter-aaaa system test to load filter-aaaa.so
- add a prereq script to check for dlopen support before running
  the filter-aaaa system test

not yet done:
- configuration parameters are not being passed to the filter-aaaa
  module; the filter-aaaa ACL and filter-aaaa-on-{v4,v6} settings are
  still stored in dns_view
2018-12-06 10:29:11 -08:00
Evan Hunt
e2ac439e28 move filter-aaaa.so build from lib/ns to bin/hooks 2018-12-06 10:29:11 -08:00
Evan Hunt
d3f0f71b6b initial implementation of filter-aaaa.so as a shared object
- temporary kluge! in this version, for testing purposes,
  named always searches for a filter-aaaa module at /tmp/filter-aaaa.so.
  this enables the filter-aaaa system test to run even though the
  code to configure hooks in named.conf hasn't been written yet.
- filter-aaaa-on-v4, filter-aaaa-on-v6 and the filter-aaaa ACL are
  still configured in the view as they were before, not in the hook.
2018-12-06 10:29:10 -08:00
Evan Hunt
e4f0a98b4d move several query.c helper functions to client.c and rename
- these formerly static helper functions have been moved into client.c
  and made external so that they can be used in hook modules as well as
  internally in libns: query_newrdataset, query_putrdataset,
  query_newnamebuf, query_newname, query_getnamebuf, query_keepname,
  query_releasename, query_newdbversion, query_findversion
- made query_recurse() and query_done() into public functions
  ns_query_recurse() and ns_query_done() so they can be called from
  modules.
2018-12-06 10:29:10 -08:00
Evan Hunt
0d7ab9bafc move filter-aaaa implementation into hook functions directly 2018-12-06 10:29:10 -08:00
Evan Hunt
d43dcef139 refactor filter-aaaa implementation
- the goal of this change is for AAAA filtering to be fully contained
   in the query logic, and implemented at discrete points that can be
   replaced with hook callouts later on.
 - the new code may be slightly less efficient than the old filter-aaaa
   implementation, but maximum efficiency was never a priority for AAAA
   filtering anyway.
 - we now use the rdataset RENDERED attribute to indicate that an AAAA
   rdataset should not be included when rendering the message. (this
   flag was originally meant to indicate that an rdataset has already
   been rendered and should not be repeated, but it can also be used to
   prevent rendering in the first place.)
 - the DNS_MESSAGERENDER_FILTER_AAAA, NS_CLIENTATTR_FILTER_AAAA,
   and DNS_RDATASETGLUE_FILTERAAAA flags are all now unnecessary and
   have been removed.
2018-12-06 10:29:10 -08:00
Evan Hunt
29897b14dc refactor query.c to make qctx more accessible
- the purpose of this change is allow for more well-defined hook points
  to be available in the query processing logic. some functions that
  formerly didn't have access to 'qctx' do now; this is needed because
  'qctx' is what gets passed when calling a hook function.
- query_addrdataset() has been broken up into three separate functions
  since it used to do three unrelated things, and what was formerly
  query_addadditional() has been renamed query_additional_cb() for
  clarity.
- client->filter_aaaa is now qctx->filter_aaaa. (later, it will be moved
  into opaque storage in the qctx, for use by the filter-aaaa module.)
- cleaned up style and braces
2018-12-06 10:29:10 -08:00
Evan Hunt
70cc3f803e set up hooks.c to enable setting hook points and loading modules
- move hooks.h to public include directory
- ns_hooktable_init() initializes a hook table. if NULL is passed in, it
  initializes the global hook table
- ns_hooktable_save() saves a pointer to the current global hook table.
- ns_hooktable_reset() replaces the global hook table with different
  one
- ns_hook_add() adds hooks at specified hook points in a hook table (or
  the global hook table if the specified table is NULL)
- load and unload functions support dlopen() of hook modules (this is
  adapted from dyndb and not yet functional)
- began adding new hook points to query.c
2018-12-06 10:29:05 -08:00
Ondřej Surý
6f11f90ef4 Merge branch 'mr1106-remove-some-more-algorithm-references-master' into 'master'
(master) Mr1106 remove some more algorithm references

See merge request isc-projects/bind9!1192
2018-12-06 09:39:41 -05:00
Matthijs Mekking
0737079824 Replace some more DSA examples with ECDSAP256SHA256
(cherry picked from commit 5f27dc35df7651be8bfd24138c2ccd6fd28806af)
2018-12-06 14:47:05 +01:00
Matthijs Mekking
7ef858f503 Remove one more GOST reference
We can remove this, because it is used in `strtodsdigest` but that
already no longer covers the algorithm name "GOST".

There is one more GOST reference in `bin/python/isc/checkds.py.in`
but that is used for presentation format and probably should stay.

(cherry picked from commit 57d44fbc628d3c7dafdd545f6b83dbdcdc39a986)
2018-12-06 14:47:05 +01:00
Mark Andrews
1cf2f7d077 Merge branch '756-dyndb-system-test-failing-intermittently' into 'master'
Add additional logging to driver.

See merge request isc-projects/bind9!1178
2018-12-05 19:04:40 -05:00
Mark Andrews
6a5c8ec2ea add more error logging; add event processing logging 2018-12-05 18:23:30 -05:00
Ondřej Surý
d0ba302028 Merge branch '444-isc_refcount_decrement-uses-invalid-memory-ordering' into 'master'
Resolve "isc_refcount_decrement() uses invalid memory ordering"

Closes #444

See merge request isc-projects/bind9!560
2018-12-05 14:35:35 -05:00
Ondřej Surý
953a957dfa Just #define isc_refcount_increment0() to isc_refcount_increment() 2018-12-05 14:16:41 +01:00
Ondřej Surý
8537adef4c The isc_refcount_decrement must use memory_order_release and isc_refcount_destroy must run thread barrier with memory_order_require 2018-12-05 14:11:53 +01:00
Witold Krecicki
43be6ff428 Merge branch '744-race-in-socket' into 'master'
Fix a race between process_fd and socketclose in unix socket code. [GL #744]

Closes #744

See merge request isc-projects/bind9!1145
2018-12-05 07:19:32 -05:00
Witold Kręcicki
ddc1d4d6d4 Fix a race between process_fd and socketclose in unix socket code. [GL #744] 2018-12-05 12:03:52 +00:00
Ondřej Surý
258ea3a8f4 Merge branch '628-refactor-masterformat-system-test' into 'master'
Refactor masterformat system test

See merge request isc-projects/bind9!1180
2018-12-05 06:22:51 -05:00
Ondřej Surý
00cc0b236a Add DNSKEY and CDNSKEY with unknown algorithm number (PRIVATEDNS) and \0 as content 2018-12-05 11:29:27 +01:00
Ondřej Surý
b13c7ca402 Refactor masterformat to be shellcheck clean and don't use RSAMD5 algorithm in the tests 2018-12-05 11:29:27 +01:00
Ondřej Surý
cbcf6dacb6 Merge branch '745-start.pl-and-stop.pl-cygwin-fixes' into 'master'
Make the start.pl and stop.pl more Cygwin friendly

Closes #745

See merge request isc-projects/bind9!1175
2018-12-04 09:17:06 -05:00
Ondřej Surý
835bad2c5c Make the start.pl and stop.pl more Cygwin friendly 2018-12-04 15:02:22 +01:00
Witold Krecicki
8743a853d2 Merge branch '628-dont-check-for-memory-leaks-in-dnstest.c' into 'master'
Don't check the memory leaks in the libdns tests as they hide the cmocka assertion failures

Closes #628

See merge request isc-projects/bind9!1174
2018-12-04 04:57:38 -05:00
Ondřej Surý
ef87b1e60b Don't check the memory leaks in the libdns tests as they hide the cmocka assertion failures 2018-12-04 09:00:42 +01:00
Ondřej Surý
69dee61f5a Merge branch '745-fix-missing-realpath-on-centos6' into 'master'
Replace realpath with cd&pwd shell magic

See merge request isc-projects/bind9!1172
2018-12-03 15:16:11 -05:00
Ondřej Surý
88d3338f5f Replace realpath with cd&pwd shell magic 2018-12-03 20:40:59 +01:00
Witold Krecicki
c644c0f283 Merge branch 'wpk-test-fixes' into 'master'
Fetchlimit and tcp test fixes

See merge request isc-projects/bind9!1150
2018-12-03 14:03:23 -05:00
Witold Kręcicki
9532e3256e tcp test: sleep for 1 second before gathering stats to make
sure that the stats are there
2018-12-03 18:49:48 +00:00
Witold Kręcicki
a48ca15e77 Fetchlimit test: update softquota limit to 380.
In the test the quota is set to 400, and softquota to 90%*400=360.
We first attach to quota, and then if we're above softquota we
drop the oldest client. With new socket code and taskmgr it's
parallel enough to create a race between multiple instances doing
'attach to quota' and then 'drop oldest client' - making number
of clients go over softquota. It's not a problem in real life, as
it's just soft quota.
2018-12-03 18:49:48 +00:00
Ondřej Surý
998e3e2880 Merge branch '745-start.pl-refactoring' into 'master'
start.pl - wait for server to say 'running', refactor

Closes #745

See merge request isc-projects/bind9!1141
2018-12-03 10:58:32 -05:00
Ondřej Surý
e227815af5 Make calls to the stop.pl always use the test name instead of '.' 2018-12-03 16:24:09 +01:00
Ondřej Surý
27ee629e6b stop.pl - refactor 2018-12-03 16:24:09 +01:00
Ondřej Surý
16b95157e8 Make calls to the start.pl always use the test name instead of '.' 2018-12-03 15:50:21 +01:00
Brian Conry
0fc8bfef13 start.pl - refactor 2018-12-03 15:50:21 +01:00
Brian Conry
597049461d start.pl - wait for server to say 'running' 2018-12-03 15:23:36 +01:00
Ondřej Surý
828d7121e0 Merge branch '628-improvements-to-system-tests-windows-fixes' into 'master'
Fix typos and missing ALTERNATIVE_ALGORITHM in conf.sh.win32

See merge request isc-projects/bind9!1169
2018-12-03 08:38:41 -05:00
Ondřej Surý
253c175d7b Fix typos and missing ALTERNATIVE_ALGORITHM in conf.sh.win32 2018-12-03 09:29:33 +01:00
Ondřej Surý
f454d9825c Merge branch '628-improvements-to-system-tests' into 'master'
Tiny small improvements to system test scripts.

See merge request isc-projects/bind9!1166
2018-12-03 03:01:27 -05:00
Ondřej Surý
b2c4c35493 Add ALTERNATIVE_ALGORITHM to conf.sh 2018-12-03 08:34:49 +01:00
Ondřej Surý
1b2a3a0ea6 Export SYSTEMTESTTOP from run.sh (so, it doesn't have to be defined in each script) and scrub / from the test names 2018-12-03 08:34:45 +01:00
Mark Andrews
7c60b78080 Merge branch '754-silence-warning-about-first-half-of-conditional-always-being-true' into 'master'
Resolve "Silence warning about first half of conditional always being true."

Closes #754

See merge request isc-projects/bind9!1162
2018-12-03 00:49:39 -05:00
Mark Andrews
5744415a75 only test for prefixlen <= 63 2018-12-03 16:26:54 +11:00
Mark Andrews
409ac247f7 Merge branch 'u/fanf2/catz-logging' into 'master'
catz: improved log message when a zone is overridden

See merge request isc-projects/bind9!1157
2018-12-02 23:38:17 -05:00
Mark Andrews
e6c5ad37a4 add CHANGES note 2018-12-03 13:45:28 +11:00
Tony Finch
16eb35187a catz: improved log message when a zone is overridden
If you have a catalog zone containing 10.in-addr.arpa and an
explicitly-configured version which overrides the catz version,
`named` used to log:

catz: error "success" while trying to add zone "10.in-addr.arpa"

After this patch it logs:

catz: zone "10.in-addr.arpa" is overridden by explicitly configured zone
2018-12-02 21:32:56 -05:00
Stephen Morris
b78376ffc9 Merge branch '750-fix-fuzzing-jobs' into 'master'
set known non-zero pesudo-random number seed when compiling for fuzzing

Closes #502 and #750

See merge request isc-projects/bind9!1151
2018-11-30 07:27:23 -05:00
Ondřej Surý
d13cabd27e fixup! When compiling for fuzzing, ensure the pseudo random number seed is non-zero. 2018-11-30 11:21:55 +00:00
Stephen Morris
77032a4e29 When compiling for fuzzing, ensure the pseudo random number seed is non-zero. 2018-11-30 11:21:55 +00:00
Evan Hunt
73bc3147d1 Merge branch 'each-export-dynamic' into 'master'
set the export-dynamic linker flag on linux

See merge request isc-projects/bind9!1154
2018-11-29 02:17:32 -05:00
Evan Hunt
66fc2f7fec set the export-dynamic linker flag on linux 2018-11-29 01:50:00 -05:00
Mark Andrews
b29f0c1d05 Merge branch '748-dns_catz_-are-missing-lots-of-dbc-checks' into 'master'
Resolve "dns_catz_* are missing lots of DBC checks."

Closes #748

See merge request isc-projects/bind9!1143
2018-11-28 21:15:04 -05:00
Mark Andrews
a487473fc5 add missing DBC checks for catz and add isc_magic checks; add DBC checks to ht.c 2018-11-29 12:39:20 +11:00
Mark Andrews
b726ca4533 Merge branch '585-dnssec-coverage-fails-with-typeerror-for-ksk-with-a-deletion-date-set' into 'master'
Resolve "dnssec-coverage fails with TypeError for KSK with a Deletion date set"

Closes #585

See merge request isc-projects/bind9!1133
2018-11-28 16:36:08 -05:00
Mark Andrews
02d20a2f53 add CHANGES note 2018-11-29 07:50:02 +11:00
Mark Andrews
6499bdfd8b use documented default key ttl 2018-11-29 07:50:02 +11:00
Mark Andrews
0ac2a868bb add reproducer for [GL #585] 2018-11-29 07:50:02 +11:00
Evan Hunt
6ab40c043d Merge branch '747-build-failure' into 'master'
silence compiler warning

Closes #747

See merge request isc-projects/bind9!1148
2018-11-28 12:14:22 -05:00
Evan Hunt
b99af25d0f silence compiler warning 2018-11-28 12:00:16 -05:00
Mark Andrews
53bdf8038c Merge branch '731-catalog-zone-incorrect-logging' into 'master'
Resolve "Catalog zone incorrect logging"

Closes #731

See merge request isc-projects/bind9!1142
2018-11-28 07:31:25 -05:00
Mark Andrews
0708e43d3f update zname with the current zone anme 2018-11-28 15:59:30 +11:00
Michał Kępień
e8d7292d5d Merge branch '730-fix-build-time-python-configuration' into 'master'
Fix build-time Python configuration

Closes #730

See merge request isc-projects/bind9!1128
2018-11-27 10:25:21 -05:00
Michał Kępień
b94293f591 Add CHANGES entry
5101.	[bug]		Fix default installation path for Python modules and
			remove the dnspython dependency accidentally introduced
			by change 4970. [GL #730]
2018-11-27 14:09:37 +01:00
Ondřej Surý
d75602406e Fix build-time Python configuration
Apply various fixes and tweaks to Python configuration logic implemented
in the "configure" script:

  - Prevent PYTHON_INSTALL_DIR, which holds the value passed to the
    --with-python-install-dir option, from being set to "unspec" by
    default as this breaks installing Python modules when the
    --with-python-install-dir option is not used.

  - Make the --with-python-install-dir option also work when the Python
    interpreter is specified explicitly (using --with-python=<...>).

  - Remove dnspython dependency which was erroneously introduced in
    commit 31b0dc1f20: no installed Python
    module depends on dnspython, it is only used in system tests, for
    which dedicated scripts exist that check whether dnspython is
    available and act accordingly.

  - Improve contents and placement of error messages.

  - Reduce duplication of code checking Python dependencies.

  - Use Autoconf macros AS_CASE() and AS_IF() instead of plain shell
    code.

  - Update comments.  Capitalize the word "Python" when referring to the
    language itself rather than a specific executable.
2018-11-27 14:09:34 +01:00
Ondřej Surý
2ecd280297 Merge branch 'ondrej-add-python-3.6-and-3.7-to-configure.ac' into 'master'
Add python3.6 and python3.7 to the search list of python versions

See merge request isc-projects/bind9!1136
2018-11-27 04:32:20 -05:00
Ondřej Surý
da9038e9a0 Add python3.6 and python3.7 to the search list of python versions 2018-11-27 09:21:12 +01:00
Ondřej Surý
c5b8bc0e15 Merge branch '620-fix-cmocka-includes' into 'master'
Move the CMocka include directories from CFLAGS to CINCLUDES where it belongs to…

See merge request isc-projects/bind9!1135
2018-11-26 10:41:02 -05:00
Ondřej Surý
a688a43faf Move the CMocka include directories from CFLAGS to CINCLUDES where it belongs to not get overriden later by the default CFLAGS rule 2018-11-26 16:16:34 +01:00
4249 changed files with 278183 additions and 375939 deletions

76
.clang-format Normal file
View File

@@ -0,0 +1,76 @@
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: false
AfterEnum: false
AfterStruct: false
AfterUnion: false
AfterControlStatement: MultiLine
AfterFunction: false # should also be MultiLine, but not yet supported
AfterExternBlock: false
BeforeElse: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
AlwaysBreakAfterReturnType: All
Cpp11BracedListStyle: false
ColumnLimit: 80
AlignAfterOpenBracket: Align
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
AlignEscapedNewlines: Left
DerivePointerAlignment: false
PointerAlignment: Right
PointerBindsToType: false
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<isc/'
Priority: 5
- Regex: '^<(pk11|pkcs11)/'
Priority: 10
- Regex: '^<dns/'
Priority: 15
- Regex: '^<dst/'
Priority: 20
- Regex: '^<isccc/'
Priority: 25
- Regex: '^<isccfg/'
Priority: 30
- Regex: '^<ns/'
Priority: 35
- Regex: '^<irs/'
Priority: 40
- Regex: '^<bind9/'
Priority: 45
- Regex: '^<(dig|named|rndc|confgen|dlz)/'
Priority: 50
- Regex: '^<dlz_'
Priority: 55
- Regex: '^".*"'
Priority: 99
- Regex: '<openssl/'
Priority: 1
- Regex: '<(mysql|protobuf-c)/'
Priority: 1
- Regex: '.*'
Priority: 0
IndentExternBlock: NoIndent
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
PenaltyBreakAssignment: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 80
PenaltyExcessCharacter: 100
Standard: Cpp11
ContinuationIndentWidth: 8

64
.clang-format.headers Normal file
View File

@@ -0,0 +1,64 @@
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: false
AfterEnum: false
AfterStruct: false
AfterUnion: false
AfterControlStatement: MultiLine
AfterFunction: false # should also be MultiLine, but not yet supported
AfterExternBlock: false
BeforeElse: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
AlwaysBreakAfterReturnType: All
Cpp11BracedListStyle: false
ColumnLimit: 80
AlignAfterOpenBracket: Align
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
AlignEscapedNewlines: Left
DerivePointerAlignment: false
PointerAlignment: Right
PointerBindsToType: false
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<isc/'
Priority: 2
- Regex: '^<dns/'
Priority: 3
- Regex: '^<iscccc/'
Priority: 4
- Regex: '^<isccfg/'
Priority: 5
- Regex: '^<ns/'
Priority: 6
- Regex: '^<bind9/)'
Priority: 7
- Regex: '^(<[^/]*)/)'
Priority: 8
- Regex: '<[[:alnum:].]+>'
Priority: 1
- Regex: '".*"'
Priority: 9
IndentExternBlock: NoIndent
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
PenaltyBreakAssignment: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 80
PenaltyExcessCharacter: 100
Standard: Cpp11
ContinuationIndentWidth: 8

113
.dir-locals.el Normal file
View File

@@ -0,0 +1,113 @@
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((c-mode .
((eval .
(set (make-local-variable 'directory-of-current-dir-locals-file)
(file-name-directory (locate-dominating-file default-directory ".dir-locals.el"))
)
)
(eval .
(set (make-local-variable 'include-directories)
(list
;; top directory
(expand-file-name
(concat directory-of-current-dir-locals-file "./"))
;; libisc
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isc/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isc"))
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isc/netmgr"))
;; libdns
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/dns/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/dns"))
;; libisccc
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isccc/include"))
;; libisccfg
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isccfg/include"))
;; libns
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/ns/include"))
;; libirs
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/irs/include"))
;; libbind9
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/bind9/include"))
;; bin
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/check"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/confgen/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/confgen"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/confgen/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/dig/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/named/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/named/unix/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/rndc/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/dnssec/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/named/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/rndc/include"))
(expand-file-name "/usr/local/opt/openssl@1.1/include")
(expand-file-name "/usr/local/opt/libxml2/include/libxml2")
(expand-file-name "/usr/local/opt/json-c/include/json-c/")
(expand-file-name "/usr/local/include")
)
)
)
(eval setq flycheck-clang-include-path include-directories)
(eval setq flycheck-cppcheck-include-path include-directories)
(eval setq flycheck-gcc-include-path include-directories)
(eval setq flycheck-clang-args
(list
"-include"
(expand-file-name
(concat directory-of-current-dir-locals-file "config.h"))
)
)
(eval setq flycheck-gcc-args
(list
"-include"
(expand-file-name
(concat directory-of-current-dir-locals-file "config.h"))
)
)
(eval setq flycheck-cppcheck-args
(list
"--enable=all"
"--suppress=missingIncludeSystem"
"--suppress=nullPointerRedundantCheck"
(concat "--suppressions-list=" (expand-file-name
(concat directory-of-current-dir-locals-file "util/suppressions.txt")))
(concat "-include=" (expand-file-name
(concat directory-of-current-dir-locals-file "config.h")))
)
)
)
))

14
.gitattributes vendored
View File

@@ -1,3 +1,13 @@
*.sln.in eol=crlf
*.vcxproj.in eol=crlf
*.vcxproj.filters.in eol=crlf
*.vcxproj.* eol=crlf
/fuzz/dns_rdata_fromwire_text.in/input-* -text
.gitignore export-ignore
/conftools export-ignore
/doc/design export-ignore
/doc/dev export-ignore
/util/** export-ignore
/util/bindkeys.pl -export-ignore
/util/check-make-install.in -export-ignore
/util/mksymtbl.pl -export-ignore

15
.github/workflows/lockdown.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: 'Lock down mirror repository'
on:
issues:
types: opened
pull_request:
types: opened
jobs:
lockdown:
runs-on: ubuntu-latest
steps:
- uses: dessant/repo-lockdown@v2
with:
github-token: ${{ github.token }}

122
.gitignore vendored
View File

@@ -1,36 +1,100 @@
Makefile
config.log
config.h
config.cache
config.status
libtool
/isc-config.sh
/configure.lineno
autom4te.cache/
*.rej
*.orig
*.o
*.lo
*.so
*.a
*.la
*.gcno
*.gcda
*_test
*-symtbl.c
timestamp
ans.run
named.run
named.memstats
gen.dSYM/
*.a
*.gcda
*.gcno
*.la
*.lo
*.log
*.o
*.orig
*.plist/ # ccc-analyzer store its results in .plist directories
*.rej
*.so
*.trs
*_test
*.ipch # vscode/intellisense precompiled header
*~
__pycache__/
.ccache/
.cproject
.deps/
.dirstamp
.libs/
# ccc-analyzer store its results in .plist directories
*.plist/
*~
.project
.cproject
.settings
kyua.log
/aclocal.m4
/ar-lib
/autom4te.cache/
/bind.keys.h
/compile
/config.cache
/config.guess
/config.h
/config.h.in
/config.log
/config.status
/config.sub
/configure
/configure.lineno
/depcomp
/install-sh
/isc-config.sh
/libtool
/ltmain.sh
/m4/libtool.m4
/m4/ltargz.m4
/m4/ltdl.m4
/m4/ltoptions.m4
/m4/ltsugar.m4
/m4/ltversion.m4
/m4/lt~obsolete.m4
/missing
/py-compile
/stamp-h1
/test-driver
Makefile
Makefile.in
ans.run
gen.dSYM/
named.memstats
named.run
timestamp
/compile_commands.json
# Gets generated by Build Ear (bear)
/compile_commands.commands.json
/cppcheck_html/
/cppcheck.results
/tsan
/util/check-make-install
/INSTALL
doc/man/dnssec-cds.8in
doc/man/dnssec-checkds.8in
doc/man/dnssec-coverage.8in
doc/man/dnssec-dsfromkey.8in
doc/man/dnssec-importkey.8in
doc/man/dnssec-keyfromlabel.8in
doc/man/dnssec-keygen.8in
doc/man/dnssec-keymgr.8in
doc/man/dnssec-revoke.8in
doc/man/dnssec-settime.8in
doc/man/dnssec-signzone.8in
doc/man/dnssec-verify.8in
doc/man/named-checkconf.8in
doc/man/named-checkzone.8in
doc/man/named-journalprint.8in
doc/man/named-nzd2nzf.8in
doc/man/nsec3hash.8in
doc/man/pkcs11-destroy.8in
doc/man/pkcs11-keygen.8in
doc/man/pkcs11-list.8in
doc/man/pkcs11-tokens.8in
# clangd index directory
/\.cache/
# GNU Global index files
/GPATH
/GRTAGS
/GTAGS
# Emacs specific files
\.dir-locals-2.el
/emacs.desktop
/emacs.desktop-lock

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,33 @@
<!--
THIS ISSUE TEMPLATE IS INTENDED ONLY FOR INTERNAL USE.
If the bug you are reporting is potentially security-related - for example,
if it involves an assertion failure or other crash in `named` that can be
triggered repeatedly - then please do *NOT* report it here, but send an
email to [security-officer@isc.org](security-officer@isc.org).
-->
### CVE-specific actions
- [ ] Assign a CVE identifier
- [ ] Determine CVSS score
- [ ] Determine the range of BIND versions affected (including the Subscription Edition)
- [ ] Determine whether workarounds for the problem exists
- [ ] Create a draft of the security advisory and put the information above in there
- [ ] Prepare a detailed description of the problem which should include the following by default:
- instructions for reproducing the problem (a system test is good enough)
- explanation of code flow which triggers the problem (a system test is *not* good enough)
- [ ] Prepare a private merge request containing the following items in separate commits:
- a test for the issue (may be moved to a separate merge request for deferred merging)
- a fix for the issue
- documentation updates (`CHANGES`, release notes, anything else applicable)
- [ ] Ensure the merge request from the previous step is reviewed by SWENG staff and has no outstanding discussions
- [ ] Ensure the documentation changes introduced by the merge request addressing the problem are reviewed by Support and Marketing staff
- [ ] Prepare backports of the merge request addressing the problem for all affected (and still maintained) BIND branches (backporting might affect the issue's scope and/or description)
- [ ] Prepare a standalone patch for the last stable release of each affected (and still maintained) BIND branch
### Release-specific actions
- [ ] Create/update the private issue containing links to fixes & reproducers for all CVEs fixed in a given release cycle
- [ ] Reserve a block of `CHANGES` placeholders once the complete set of vulnerabilities fixed in a given release cycle is determined
- [ ] Ensure the merge requests containing CVE fixes are merged into `security-*` branches in CVE identifier order

View File

@@ -0,0 +1,95 @@
## Release Schedule
**Code Freeze:**
**Tagging Deadline:**
**Public Release:**
## Documentation Review Links
**Closed issues assigned to the milestone without a release note:**
- []()
- []()
- []()
**Merge requests merged into the milestone without a release note:**
- []()
- []()
- []()
**Merge requests merged into the milestone without a `CHANGES` entry:**
- []()
- []()
- []()
## Release Checklist
### Before the Code Freeze
- [ ] ***(QA)*** Inform Support and Marketing of impending release (and give estimated release dates).
- [ ] ***(QA)*** Ensure there are no permanent test failures on any platform.
- [ ] ***(QA)*** Check Perflab to ensure there has been no unexplained drop in performance for the versions being released.
- [ ] ***(QA)*** Check whether all issues assigned to the release milestone are resolved[^1].
- [ ] ***(QA)*** Ensure that there are no outstanding merge requests in the private repository[^1] (Subscription Edition only).
- [ ] ***(QA)*** Ensure all merge requests marked for backporting have been indeed backported.
- [ ] ***(QA)*** Announce (on Mattermost) that the code freeze is in effect.
### Before the Tagging Deadline
- [ ] ***(QA)*** Look for outstanding documentation issues (e.g. `CHANGES` mistakes) and address them if any are found.
- [ ] ***(QA)*** Ensure release notes are correct, ask Support and Marketing to check them as well.
- [ ] ***(QA)*** Update API files for libraries with new version information.
- [ ] ***(QA)*** Change software version and library versions in `configure.ac` (new major release only).
- [ ] ***(QA)*** Rebuild `configure` using Autoconf on `docs.isc.org`.
- [ ] ***(QA)*** Update `CHANGES`.
- [ ] ***(QA)*** Update `CHANGES.SE` (Subscription Edition only).
- [ ] ***(QA)*** Update `README.md`.
- [ ] ***(QA)*** Update `version`.
- [ ] ***(QA)*** Build documentation on `docs.isc.org`.
- [ ] ***(QA)*** Check that the formatting is correct for text, PDF, and HTML versions of release notes.
- [ ] ***(QA)*** Check that the formatting of the generated man pages is correct.
- [ ] ***(QA)*** Tag the releases in the private repository (`git tag -s -m "BIND 9.x.y" v9_x_y`).
### Before the ASN Deadline (for ASN Releases) or the Public Release Date (for Regular Releases)
- [ ] ***(QA)*** Verify GitLab CI results for the tags created and prepare a QA report for the releases to be published.
- [ ] ***(QA)*** Announce (on Mattermost) that the code freeze is over.
- [ ] ***(QA)*** Request signatures for the tarballs, providing their location and checksums.
- [ ] ***(Signers)*** Validate tarball checksums, sign tarballs, and upload signatures.
- [ ] ***(QA)*** Verify tarball signatures and check tarball checksums again.
- [ ] ***(Support)*** Pre-publish ASN and/or Subscription Edition tarballs so that packages can be built.
- [ ] ***(QA)*** Build and test ASN and/or Subscription Edition packages.
- [ ] ***(QA)*** Notify Support that the releases have been prepared.
- [ ] ***(Support)*** Send out ASNs (if applicable).
### On the Day of Public Release
- [ ] ***(Support)*** Wait for clearance from Security Officer to proceed with the public release (if applicable).
- [ ] ***(Support)*** Place tarballs in public location on FTP site.
- [ ] ***(Support)*** Publish links to downloads on ISC website.
- [ ] ***(Support)*** Write release email to *bind-announce*.
- [ ] ***(Support)*** Write email to *bind-users* (if a major release).
- [ ] ***(Support)*** Send eligible customers updated links to the Subscription Edition (update the -S edition delivery tickets, even if those links were provided earlier via an ASN ticket).
- [ ] ***(Support)*** Update tickets in case of waiting support customers.
- [ ] ***(QA)*** Build and test any outstanding private packages.
- [ ] ***(QA)*** Build public packages (`*.deb`, RPMs).
- [ ] ***(QA)*** Inform Marketing of the release.
- [ ] ***(QA)*** Update the internal [BIND release dates wiki page](https://wiki.isc.org/bin/view/Main/BindReleaseDates) when public announcement has been made.
- [ ] ***(Marketing)*** Post short note to Twitter.
- [ ] ***(Marketing)*** Update [Wikipedia entry for BIND](https://en.wikipedia.org/wiki/BIND).
- [ ] ***(Marketing)*** Write blog article (if a major release).
- [ ] ***(QA)*** Ensure all new tags are annotated and signed.
- [ ] ***(QA)*** Push tags for the published releases to the public repository.
- [ ] ***(QA)*** Merge the automatically prepared `prep 9.x.y` commit which updates `version` and documentation on the release branch into the relevant maintenance branch (`v9_x`).
- [ ] ***(QA)*** For each maintained branch, update the `BIND_BASELINE_VERSION` variable for the `abi-check` job in `.gitlab-ci.yml` to the latest published BIND version tag for a given branch.
- [ ] ***(QA)*** Prepare empty release notes for the next set of releases.
- [ ] ***(QA)*** Sanitize confidential issues which are assigned to the current release milestone and do not describe a security vulnerability, then make them public.
- [ ] ***(QA)*** Sanitize confidential issues which are assigned to older release milestones and describe security vulnerabilities, then make them public if appropriate[^2].
- [ ] ***(QA)*** Update QA tools used in GitLab CI (e.g. Flake8, PyLint) by modifying the relevant `Dockerfile`.
[^1]: If not, use the time remaining until the tagging deadline to ensure all outstanding issues are either resolved or moved to a different milestone.
[^2]: As a rule of thumb, security vulnerabilities which have reproducers merged to the public repository are considered okay for full disclosure.

View File

@@ -1,44 +0,0 @@
## Release Checklist
- [ ] (Manager) Check for the presence of a milestone for the release:
- If there is a milestone, are all the issues for the milestone resolved? (other than this checklist).
- [ ] (Manager) Inform Support/Marketing of impending release (and give estimated release dates).
- (SwEng) Prepare the sources for tarball generation:
- [ ] Check perflab to ensure there has been no unexplained drop in performance for the version being released.
- [ ] Ensure that there are no outstanding merge requests in the private repository (subscription version only).
- [ ] Update API files for libraries with new version information.
- [ ] Change software version and library versions in configure.in (new major release only).
- [ ] Rebuild configure using autoconf on docs.isc.org.
- [ ] Update CHANGES.
- [ ] Update CHANGES.SE (subscription branch only).
- [ ] Update "version".
- [ ] Update "readme.md".
- Check the release notes are correct:
- [ ] Compare content with merge requests for the release.
- [ ] Check formatting.
- [ ] Build documentation on docs.isc.org.
- [ ] Commit changes and make sure the gitlab-ci tests are passing.
- [ ] Push the changes and tag ("alphatag" is an optional string such as "b1", "rc1" etc.). (```git tag -u <DEVELOPER_KEYID> -a -s -m "BIND 9.X.Y[alphatag]" v9_X_Y[alphatag]```)
- [ ] If this is the first tag for a release (e.g. beta), create a release branch named `release_v9_X_Y` (this allows development to continue on the release branch whilst release engineering continues).
- [ ] (SwEng) Run the "make release" Jenkins job to produce the tarballs and zips.
- [ ] (SwEng) Ask QA to sanity check the tarball and zips (passing to them the number of the Jenkins job).
- [ ] (QA) Sanity check the tarballs.
- [ ] (QA) Request the signature on the tarballs.
- [ ] (QA) Check signatures on tarballs.
- [ ] (QA) Tell Support to handle notification of release.
- [ ] (Manager) Inform Marketing of the release
- [ ] (Manager) Update the internal [BIND release dates wiki page](https://wiki.isc.org/bin/view/Main/BindReleaseDates) when public announcement has been made.
- [ ] (SwEng) Update DEB and RPM packages
- [ ] (SwEng) Merge the automatically prepared `prep 9.X.Y` commit which updates `version` and documentation on the release branch into the relevant maintenance branch (`v9_X`)
## Support
- [ ] Make tarballs and signatures available to download.
- [ ] Write release email to bind9-announce.
- [ ] Write email to bind9-users (if a major release).
- [ ] Update tickets in case of waiting support customers.
## Marketing
- [ ] Post short note to Twitter.
- [ ] Update [Wikipedia entry for BIND](http://en.wikipedia.org/wiki/BIND).
- [ ] Write blog article (if a major release).

35
.lgtm.yml Normal file
View File

@@ -0,0 +1,35 @@
extraction:
cpp:
prepare:
packages:
- "libxml2-dev"
- "libjson-c-dev"
- "libssl-dev"
- "zlib1g-dev"
- "libcmocka-dev"
- "pkg-config"
- "libcap2-dev"
- "libedit-dev"
- "libidn2-dev"
- "libmaxminddb-dev"
- "libuv1-dev"
- "libnghttp2-dev"
configure:
command:
- "autoreconf -fi"
- "CFLAGS=\"-Og -g\" ./configure --enable-developer"
path_classifiers:
test:
- "lib/*/tests/"
- "bin/tests/"
docs:
- "**/*.xml"
- "**/*.docbook"
- "**/*.html"
- "**/*.1"
- "**/*.5"
- "**/*.8"
queries:
- exclude: fuzz/
- exclude: "bin/tests/system/*/ans*/*.py"
- exclude: cpp/use-of-goto

8
.pylintrc Normal file
View File

@@ -0,0 +1,8 @@
[MASTER]
disable=
C0114, # missing-module-docstring
C0115, # missing-class-docstring
C0116, # missing-function-docstring
R0801, # duplicate-code
C0103, # invalid-name
C0415,# import-outside-toplevel

View File

@@ -24,7 +24,7 @@ string_escape_char2 = 0 # number
# Improvements to template detection may make this option obsolete.
tok_split_gte = false # false/true
# Control what to do with the UTF-8 BOM (recommed 'remove')
# Control what to do with the UTF-8 BOM (recommend 'remove')
utf8_bom = ignore # ignore/add/remove/force
# If the file only contains chars between 128 and 255 and is not UTF-8, then output as UTF-8
@@ -1352,7 +1352,7 @@ cmt_insert_func_header = "" # string
# Will substitute $(class) with the class name.
cmt_insert_class_header = "" # string
# The filename that contains text to insert before a Obj-C message specification if the method isn't preceeded with a C/C++ comment.
# The filename that contains text to insert before a Obj-C message specification if the method isn't preceded with a C/C++ comment.
# Will substitute $(message) with the function name and $(javaparam) with the javadoc @param and @return stuff.
cmt_insert_oc_msg_header = "" # string

53
AUTHORS Normal file
View File

@@ -0,0 +1,53 @@
Mark Andrews
Andreas Gustafsson
Evan Hunt
Brian Wellington
Bob Halley
David Lawrence
Michael Graff
Michael Sawyer
Ondřej Surý
James Brister
Tatuya JINMEI 神明達哉
Francis Dupont
Michał Kępień
Danny Mayer
Mukund Sivaraman
Jeremy C. Reed
William King
Stephen Morris
Witold Kręcicki
Curtis Blackburn
Scott Mann
Rob Austein
Jim Reid
Eric Luce
Olafur Gudmundsson
Stephen Jacob
Damien Neil
Tony Finch
Jakob Schlyter
Petr Menšík
Vernon Schryver
Matt Nelson
Shane Kerr
Paul Ebersman
Ray Bellis
Shawn Routhier
Ben Cottrell
Tomas Hozza
johnd
Bill Parker
李昶
Kevin Chen
Jonathan Casey
Mary Stahl
Mathieu Arnold
David Hankins
Paul Hoffman
Paul Vixie
Brian Conry
Anay Panvalkar
colleen
Robert Edmonds
João Damas

2345
CHANGES

File diff suppressed because it is too large Load Diff

71
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,71 @@
# BIND 9 Code of Conduct
Like the technical community as a whole, the BIND 9 team and community is made
up of a mixture of professionals and volunteers from all over the world, working
on every aspect of the mission - including mentorship, teaching, and connecting
people.
Diversity is one of our huge strengths, but it can also lead to communication
issues and unhappiness. To that end, we have a few ground rules that we ask
people to adhere to. This code applies equally to the core development team,
open source contributors and those seeking help and guidance.
This isn't an exhaustive list of things that you can't do. Rather, take it in
the spirit in which it's intended - a guide to make it easier to enrich all of
us and the technical communities in which we participate.
This code of conduct applies to all spaces managed by the BIND 9 project or
Internet Systems Consortium. This includes chat, the mailing lists, the issue
tracker, and any other fora created by the project team which the
community uses for communication. In addition, violations of this code outside
these spaces may affect a person's ability to participate within them.
If you believe someone is violating the code of conduct, we ask that you report
it by emailing [conduct@isc.org](conduct@isc.org). For more details please see
our [Reporting Guidelines](https://www.isc.org/conductreporting/).
* **Be friendly and patient.**
* **Be welcoming.** We strive to be a community that welcomes and supports
people of all backgrounds and identities. This includes, but is not limited to
members of any race, ethnicity, culture, national origin, colour, immigration
status, social and economic class, educational level, sex, sexual orientation,
gender identity and expression, age, size, family status, political belief,
religion, and mental and physical ability.
* **Be considerate.** Your work will be used by other people, and you in turn
will depend on the work of others. Any decision you take will affect users and
colleagues, and you should take those consequences into account when making
decisions. Remember that we're a world-wide community, so you might not be
communicating in someone else's primary language.
* **Be respectful.** Not all of us will agree all the time, but disagreement is
no excuse for poor behavior and poor manners. We might all experience some
frustration now and then, but we cannot allow that frustration to turn into a
personal attack. It's important to remember that a community where people feel
uncomfortable or threatened is not a productive one. Members of the BIND 9
community should be respectful when dealing with other members as well as with
people outside the BIND 9 community.
* **Be careful in the words that you choose.** We are a community of
professionals, and we conduct ourselves professionally. Be kind to others. Do
not insult or put down other participants. Harassment and other exclusionary
behavior aren't acceptable. This includes, but is not limited to:
* Violent threats or language directed against another person.
* Discriminatory jokes and language.
* Posting sexually explicit or violent material.
* Posting (or threatening to post) other people's personally identifying
information ("doxing").
* Personal insults, especially those using racist or sexist terms.
* Unwelcome sexual attention.
* Advocating for, or encouraging, any of the above behavior.
* Repeated harassment of others. In general, if someone asks you to stop, then
stop.
* **When we disagree, try to understand why.** Disagreements, both social and
technical, happen all the time and BIND 9 is no exception. It is important
that we resolve disagreements and differing views constructively. Remember
that we're different. The strength of BIND 9 comes from its varied community,
people from a wide range of backgrounds. Different people have different
perspectives on issues. Being unable to understand why someone holds a
viewpoint doesn't mean that they're wrong. Don't forget that it is human to
err and blaming each other doesn't get us anywhere. Instead, focus on helping
to resolve issues and learning from mistakes.
Original text courtesy of the [Django Code of Conduct](https://www.djangoproject.com/conduct/)
project.

View File

@@ -1,186 +0,0 @@
BIND Source Access and Contributor Guidelines
Feb 22, 2018
Contents
1. Access to source code
2. Reporting bugs
3. Contributing code
Introduction
Thank you for using BIND!
BIND is open source software that implements the Domain Name System (DNS)
protocols for the Internet. It is a reference implementation of those
protocols, but it is also production-grade software, suitable for use in
high-volume and high-reliability applications. It is by far the most
widely used DNS software, providing a robust and stable platform on top of
which organizations can build distributed computing systems with the
knowledge that those systems are fully compliant with published DNS
standards.
BIND is and will always remain free and openly available. It can be used
and modified in any way by anyone.
BIND is maintained by the Internet Systems Consortium, a public-benefit
501(c)(3) nonprofit, using a "managed open source" approach: anyone can
see the source, but only ISC employees have commit access. Until recently,
the source could only be seen once ISC had published a release: read
access to the source repository was restricted just as commit access was.
That's now changing, with the opening of a public git mirror to the BIND
source tree (see below).
Access to source code
Public BIND releases are always available from the ISC FTP site.
A public-access GIT repository is also available at https://gitlab.isc.org
. This repository is a mirror, updated several times per day, of the
source repository maintained by ISC. It contains all the public release
branches; upcoming releases can be viewed in their current state at any
time. It does not contain development branches or unreviewed work in
progress. Commits which address security vulnerablilities are withheld
until after public disclosure.
You can browse the source online via https://gitlab.isc.org/isc-projects/
bind9
To clone the repository, use:
$ git clone https://gitlab.isc.org/isc-projects/bind9.git
Release branch names are of the form v9_X, where X represents the second
number in the BIND 9 version number. So, to check out the BIND 9.12
branch, use:
$ git checkout v9_12
Whenever a branch is ready for publication, a tag will be placed of the
form v9_X_Y. The 9.12.0 release, for instance, is tagged as v9_12_0.
The branch in which the next major release is being developed is called
master.
Reporting bugs
Reports of flaws in the BIND package, including software bugs, errors in
the documentation, missing files in the tarball, suggested changes or
requests for new features, etc, can be filed using https://gitlab.isc.org/
isc-projects/bind9/issues.
Due to a large ticket backlog, we are sometimes slow to respond,
especially if a bug is cosmetic or if a feature request is vague or low in
priority, but we will try at least to acknowledge legitimate bug reports
within a week.
ISC's ticketing system is publicly readable; however, you must have an
account to file a new issue. You can either register locally or use
credentials from an existing account at GitHub, GitLab, Google, Twitter,
or Facebook.
Reporting possible security issues
If you think you may be seeing a potential security vulnerability in BIND
(for example, a crash with REQUIRE, INSIST, or ASSERT failure), please
report it immediately by emailing to security-officer@isc.org. Plain-text
e-mail is not a secure choice for communications concerning undisclosed
security issues so please encrypt your communications to us if possible,
using the ISC Security Officer public key.
Do not discuss undisclosed security vulnerabilites on any public mailing
list. ISC has a long history of handling reported vulnerabilities promptly
and effectively and we respect and acknowledge responsible reporters.
ISC's Security Vulnerability Disclosure Policy is documented at https://
kb.isc.org/article/AA-00861/0.
If you have a crash, you may want to consult ?What to do if your BIND or
DHCP server has crashed.?
Contributing code
BIND is licensed under the Mozilla Public License 2.0. Earier versions
(BIND 9.10 and earlier) were licensed under the ISC License
ISC does not require an explicit copyright assignment for patch
contributions. However, by submitting a patch to ISC, you implicitly
certify that you are the author of the code, that you intend to reliquish
exclusive copyright, and that you grant permission to publish your work
under the open source license used for the BIND version(s) to which your
patch will be applied.
BIND code
Patches for BIND may be submitted directly via merge requests in ISC's
Gitlab source repository for BIND.
Patches can also be submitted as diffs against a specific version of BIND
-- preferably the current top of the master branch. Diffs may be generated
using either git format-patch or git diff.
Those wanting to write code for BIND may be interested in the developer
information page, which includes information about BIND design and coding
practices, including discussion of internal APIs and overall system
architecture. (This is a work in progress, and still quite preliminary.)
Every patch submitted will be reviewed by ISC engineers following our code
review process before it is merged.
It may take considerable time to review patch submissions, especially if
they don't meet ISC style and quality guidelines. If a patch is a good
idea, we can and will do additional work to bring it up to par, but if
we're busy with other work, it may take us a long time to get to it.
To ensure your patch is acted on as promptly as possible, please:
* Try to adhere to the BIND 9 coding style.
* Run make check to ensure your change hasn't caused any functional
regressions.
* Document your work, both in the patch itself and in the accompanying
email.
* In patches that make non-trivial functional changes, include system
tests if possible; when introducing or substantially altering a
library API, include unit tests. See Testing for more information.
Changes to configure
If you need to make changes to configure, you should not edit it directly;
instead, edit configure.in, then run autoconf. Similarly, instead of
editing config.h.in directly, edit configure.in and run autoheader.
When submitting a patch as a diff, it's fine to omit the configure diffs
to save space. Just send the configure.in diffs and we'll generate the new
configure during the review process.
Documentation
All functional changes should be documented. There are three types of
documentation in the BIND source tree:
* Man pages are kept alongside the source code for the commands they
document, in files ending in .docbook; for example, the named man page
is bin/named/named.docbook.
* The BIND 9 Administrator Reference Manual is mostly in doc/arm/
Bv9ARM-book.xml, plus a few other XML files that are included in it.
* API documentation is in the header file describing the API, in
Doxygen-formatted comments.
It is not necessary to edit any documentation files other than these; all
PDF, HTML, and nroff-format man page files will be updated automatically
from the docbook and XML files after merging.
Patches to improve existing documentation are also very welcome!
Tests
BIND is a large and complex project. We rely heavily on continuous
automated testing and cannot merge new code without adequate test
coverage. Please see the 'Testing' section of doc/dev/dev.md for more
information.
Thanks
Thank you for your interest in contributing to the ongoing development of
BIND.

View File

@@ -8,8 +8,8 @@
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
## BIND Source Access and Contributor Guidelines
*Feb 22, 2018*
## BIND 9 Source Access and Contributor Guidelines
*May 28, 2020*
### Contents
@@ -19,12 +19,12 @@
### Introduction
Thank you for using BIND!
Thank you for using BIND 9!
BIND is open source software that implements the Domain Name System (DNS)
protocols for the Internet. It is a reference implementation of those
protocols, but it is also production-grade software, suitable for use in
high-volume and high-reliability applications. It is by far the most
high-volume and high-reliability applications. It is very
widely used DNS software, providing a robust and stable platform on top of
which organizations can build distributed computing systems with the
knowledge that those systems are fully compliant with published DNS
@@ -33,27 +33,34 @@ standards.
BIND is and will always remain free and openly available. It can be
used and modified in any way by anyone.
BIND is maintained by the [Internet Systems Consortium](https://www.isc.org),
BIND is maintained by [Internet Systems Consortium](https://www.isc.org),
a public-benefit 501(c)(3) nonprofit, using a "managed open source" approach:
anyone can see the source, but only ISC employees have commit access.
Until recently, the source could only be seen once ISC had published
a release: read access to the source repository was restricted just
as commit access was. That's now changing, with the opening of a
public git mirror to the BIND source tree (see below).
In the past, the source could only be seen once ISC had published
a release; read access to the source repository was restricted just
as commit access was. That has changed, as ISC now provides a
public git repository of the BIND source tree (see below).
At ISC, we're committed to
building communities that are welcoming and inclusive: environments where people
are encouraged to share ideas, treat each other with respect, and collaborate
towards the best solutions. To reinforce our commitment, ISC
has adopted a slightly modified version of the Django
[Code of Conduct](https://gitlab.isc.org/isc-projects/bind9/-/blob/main/CODE_OF_CONDUCT.md)
for the BIND 9 project, as well as for the conduct of our developers throughout
the industry.
### <a name="access"></a>Access to source code
Public BIND releases are always available from the
[ISC FTP site](ftp://ftp.isc.org/isc/bind9).
A public-access GIT repository is also available at
[https://gitlab.isc.org](https://gitlab.isc.org).
This repository is a mirror, updated several times per day, of the
source repository maintained by ISC. It contains all the public release
branches; upcoming releases can be viewed in their current state at any
time. It does *not* contain development branches or unreviewed work in
progress. Commits which address security vulnerablilities are withheld
until after public disclosure.
A public-access git repository is also available at
[https://gitlab.isc.org](https://gitlab.isc.org). This repository
contains all public release branches. Upcoming releases can be viewed in
their current state at any time. Short-lived development branches
contain unreviewed work in progress. Commits which address security
vulnerablilities are withheld until after public disclosure.
You can browse the source online via
[https://gitlab.isc.org/isc-projects/bind9](https://gitlab.isc.org/isc-projects/bind9)
@@ -68,55 +75,58 @@ branch, use:
> $ git checkout v9_12
Whenever a branch is ready for publication, a tag will be placed of the
Whenever a branch is ready for publication, a tag is placed of the
form `v9_X_Y`. The 9.12.0 release, for instance, is tagged as `v9_12_0`.
The branch in which the next major release is being developed is called
`master`.
`main`.
### <a name="bugs"></a>Reporting bugs
Reports of flaws in the BIND package, including software bugs, errors
in the documentation, missing files in the tarball, suggested changes
or requests for new features, etc, can be filed using
or requests for new features, etc., can be filed using
[https://gitlab.isc.org/isc-projects/bind9/issues](https://gitlab.isc.org/isc-projects/bind9/issues).
Due to a large ticket backlog, we are sometimes slow to respond,
especially if a bug is cosmetic or if a feature request is vague or
low in priority, but we will try at least to acknowledge legitimate
low in priority, but we try at least to acknowledge legitimate
bug reports within a week.
ISC's ticketing system is publicly readable; however, you must have
an account to file a new issue. You can either register locally or
ISC's GitLab system is publicly readable; however, you must have
an account to create a new issue. You can either register locally or
use credentials from an existing account at GitHub, GitLab, Google,
Twitter, or Facebook.
### Reporting possible security issues
If you think you may be seeing a potential security vulnerability in BIND
(for example, a crash with REQUIRE, INSIST, or ASSERT failure), please
report it immediately by emailing to security-officer@isc.org. Plain-text
e-mail is not a secure choice for communications concerning undisclosed
security issues so please encrypt your communications to us if possible,
using the [ISC Security Officer public key](https://www.isc.org/downloads/software-support-policy/openpgp-key/).
using the [ISC Security Officer public key](https://www.isc.org/pgpkey/).
Do not discuss undisclosed security vulnerabilites on any public mailing list.
Do not discuss undisclosed security vulnerabilities on any public mailing list.
ISC has a long history of handling reported vulnerabilities promptly and
effectively and we respect and acknowledge responsible reporters.
ISC's Security Vulnerability Disclosure Policy is documented at [https://kb.isc.org/article/AA-00861/0](https://kb.isc.org/article/AA-00861/0).
ISC's Security Vulnerability Disclosure Policy is documented at
[https://kb.isc.org/docs/aa-00861](https://kb.isc.org/docs/aa-00861).
If you have a crash, you may want to consult
[What to do if your BIND or DHCP server has crashed.](https://kb.isc.org/article/AA-00340/89/What-to-do-if-your-BIND-or-DHCP-server-has-crashed.html)
["What to do if your BIND or DHCP server has crashed."](https://kb.isc.org/docs/aa-00340)
### <a name="bugs"></a>Contributing code
### <a name="contrib"></a>Contributing code
BIND is licensed under the
[Mozilla Public License 2.0](http://www.isc.org/downloads/software-support-policy/isc-license/).
Earier versions (BIND 9.10 and earlier) were licensed under the [ISC License](http://www.isc.org/downloads/software-support-policy/isc-license/)
[Mozilla Public License 2.0](https://www.mozilla.org/en-US/MPL/2.0/).
Earlier versions (BIND 9.10 and earlier) were licensed under the
[ISC License](https://www.isc.org/licenses/)
ISC does not require an explicit copyright assignment for patch
contributions. However, by submitting a patch to ISC, you implicitly
certify that you are the author of the code, that you intend to reliquish
certify that you are the author of the code, that you intend to relinquish
exclusive copyright, and that you grant permission to publish your work
under the open source license used for the BIND version(s) to which your
patch will be applied.
@@ -124,20 +134,19 @@ patch will be applied.
#### <a name="bind"></a>BIND code
Patches for BIND may be submitted directly via merge requests in
[ISC's Gitlab](https://gitlab.isc.org/isc-projects/bind9/) source
[ISC's GitLab](https://gitlab.isc.org/isc-projects/bind9/) source
repository for BIND.
Patches can also be submitted as diffs against a specific version of
BIND -- preferably the current top of the `master` branch. Diffs may
BIND -- preferably the current top of the `main` branch. Diffs may
be generated using either `git format-patch` or `git diff`.
Those wanting to write code for BIND may be interested in the
[developer information](doc/dev/dev.md) page, which includes information
about BIND design and coding practices, including discussion of internal
APIs and overall system architecture. (This is a work in progress, and
still quite preliminary.)
APIs and overall system architecture.
Every patch submitted will be reviewed by ISC engineers following our
Every patch submitted is reviewed by ISC engineers following our
[code review process](doc/dev/dev.md#reviews) before it is merged.
It may take considerable time to review patch submissions, especially if
@@ -148,7 +157,7 @@ we're busy with other work, it may take us a long time to get to it.
To ensure your patch is acted on as promptly as possible, please:
* Try to adhere to the [BIND 9 coding style](doc/dev/style.md).
* Run `make` `check` to ensure your change hasn't caused any
* Run `make check` to ensure your change hasn't caused any
functional regressions.
* Document your work, both in the patch itself and in the
accompanying email.
@@ -174,28 +183,24 @@ All functional changes should be documented. There are three types
of documentation in the BIND source tree:
* Man pages are kept alongside the source code for the commands
they document, in files ending in `.docbook`; for example, the
`named` man page is `bin/named/named.docbook`.
* The *BIND 9 Administrator Reference Manual* is mostly in
`doc/arm/Bv9ARM-book.xml`, plus a few other XML files that are included
in it.
they document, in files ending in `.rst`: for example, the
`named` man page is `bin/named/named.rst`.
* The *BIND 9 Administrator Reference Manual* is in the .rst files in
`doc/arm/`; the PDF and HTML versions are automatically generated from
the `.rst` files.
* API documentation is in the header file describing the API, in
Doxygen-formatted comments.
It is not necessary to edit any documentation files other than these;
all PDF, HTML, and `nroff`-format man page files will be updated
automatically from the `docbook` and `XML` files after merging.
Patches to improve existing documentation are also very welcome!
##### Tests
BIND is a large and complex project. We rely heavily on continuous
automated testing and cannot merge new code without adequate test coverage.
Please see [the 'Testing' section of doc/dev/dev.md](doc/dev/dev.md#testing)
Please see [the "Testing" section of doc/dev/dev.md](doc/dev/dev.md#testing)
for more information.
#### Thanks
Thank you for your interest in contributing to the ongoing development
of BIND.
of BIND 9.

1
COPYING Symbolic link
View File

@@ -0,0 +1 @@
LICENSE

251
COPYRIGHT
View File

@@ -1,8 +1,8 @@
Copyright (C) 1996-2018 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 1996-2021 Internet Systems Consortium, Inc. ("ISC")
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 http://mozilla.org/MPL/2.0/.
file, you can obtain one at https://mozilla.org/MPL/2.0/.
-----------------------------------------------------------------------------
@@ -181,67 +181,6 @@ SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (c) 1998 Doug Rabson
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright ((c)) 2002, Rice University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Rice University (RICE) nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
This software is provided by RICE and the contributors on an "as is"
basis, without any representations or warranties of any kind, express
or implied including, but not limited to, representations or
warranties of non-infringement, merchantability or fitness for a
particular purpose. In no event shall RICE or contributors be liable
for any direct, indirect, incidental, special, exemplary, or
consequential damages (including, but not limited to, procurement of
substitute goods or services; loss of use, data, or profits; or
business interruption) however caused and on any theory of liability,
whether in contract, strict liability, or tort (including negligence
or otherwise) arising in any way out of the use of this software, even
if advised of the possibility of such damage.
-----------------------------------------------------------------------------
Copyright (c) 1993 by Digital Equipment Corporation.
Permission to use, copy, modify, and distribute this software for any
@@ -262,61 +201,6 @@ SOFTWARE.
-----------------------------------------------------------------------------
Copyright 2000 Aaron D. Gifford. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTOR(S) ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTOR(S) BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (c) 1998 Doug Rabson.
Copyright (c) 2001 Jake Burkholder.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
All rights reserved.
@@ -363,49 +247,6 @@ SOFTWARE.
-----------------------------------------------------------------------------
Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved.
By using this file, you agree to the terms and conditions set forth bellow.
LICENSE TERMS AND CONDITIONS
The following License Terms and Conditions apply, unless a different
license is obtained from Japan Network Information Center ("JPNIC"),
a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda,
Chiyoda-ku, Tokyo 101-0047, Japan.
1. Use, Modification and Redistribution (including distribution of any
modified or derived work) in source and/or binary forms is permitted
under this License Terms and Conditions.
2. Redistribution of source code must retain the copyright notices as they
appear in each source code file, this License Terms and Conditions.
3. Redistribution in binary form must reproduce the Copyright Notice,
this License Terms and Conditions, in the documentation and/or other
materials provided with the distribution. For the purposes of binary
distribution the "Copyright Notice" refers to the following language:
"Copyright (c) 2000-2002 Japan Network Information Center. All rights
reserved."
4. The name of JPNIC may not be used to endorse or promote products
derived from this Software without specific prior written approval of
JPNIC.
5. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY JPNIC
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-----------------------------------------------------------------------------
Copyright (C) 2004 Nominet, Ltd.
Permission to use, copy, modify, and distribute this software for any
@@ -422,24 +263,6 @@ PERFORMANCE OF THIS SOFTWARE.
-----------------------------------------------------------------------------
Portions Copyright RSA Security Inc.
License to copy and use this software is granted provided that it is
identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
(Cryptoki)" in all material mentioning or referencing this software.
License is also granted to make and use derivative works provided that
such works are identified as "derived from the RSA Security Inc. PKCS #11
Cryptographic Token Interface (Cryptoki)" in all material mentioning or
referencing the derived work.
RSA Security Inc. makes no representations concerning either the
merchantability of this software or the suitability of this software for
any particular purpose. It is provided "as is" without express or implied
warranty of any kind.
-----------------------------------------------------------------------------
Copyright (c) 1996, David Mazieres <dm@uun.org>
Copyright (c) 2008, Damien Miller <djm@openbsd.org>
@@ -457,54 +280,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-----------------------------------------------------------------------------
Copyright (c) 2000-2001 The OpenSSL Project. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. All advertising materials mentioning features or use of this
software must display the following acknowledgment:
"This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
endorse or promote products derived from this software without
prior written permission. For written permission, please contact
licensing@OpenSSL.org.
5. Products derived from this software may not be called "OpenSSL"
nor may "OpenSSL" appear in their names without prior written
permission of the OpenSSL Project.
6. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
Copyright (c) 1995, 1997, 1998 The NetBSD Foundation, Inc.
All rights reserved.
@@ -592,3 +367,25 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-----------------------------------------------------------------------------
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

1
ChangeLog Symbolic link
View File

@@ -0,0 +1 @@
CHANGES

524
HISTORY
View File

@@ -1,524 +0,0 @@
Functional enhancements from prior major releases of BIND 9
BIND 9.11
BIND 9.11.0 includes a number of changes from BIND 9.10 and earlier
releases. New features include:
* Added support for Catalog Zones, a new method for provisioning
servers: a list of zones to be served is stored in a DNS zone, along
with their configuration parameters. Changes to the catalog zone are
propagated to slaves via normal AXFR/IXFR, whereupon the zones that
are listed in it are automatically added, deleted or reconfigured.
* Added support for "dnstap", a fast and flexible method of capturing
and logging DNS traffic.
* Added support for "dyndb", a new API for loading zone data from an
external database, developed by Red Hat for the FreeIPA project.
* "fetchlimit" quotas are now compiled in by default. These are for the
use of recursive resolvers that are are under high query load for
domains whose authoritative servers are nonresponsive or are
experiencing a denial of service attack:
+ "fetches-per-server" limits the number of simultaneous queries
that can be sent to any single authoritative server. The
configured value is a starting point; it is automatically adjusted
downward if the server is partially or completely non-responsive.
The algorithm used to adjust the quota can be configured via the
"fetch-quota-params" option.
+ "fetches-per-zone" limits the number of simultaneous queries that
can be sent for names within a single domain. (Note: Unlike
"fetches-per-server", this value is not self-tuning.)
+ New stats counters have been added to count queries spilled due to
these quotas.
* Added a new "dnssec-keymgr" key mainenance utility, which can generate
or update keys as needed to ensure that a zone's keys match a defined
DNSSEC policy.
* The experimental "SIT" feature in BIND 9.10 has been renamed "COOKIE"
and is no longer optional. EDNS COOKIE is a mechanism enabling clients
to detect off-path spoofed responses, and servers to detect
spoofed-source queries. Clients that identify themselves using COOKIE
options are not subject to response rate limiting (RRL) and can
receive larger UDP responses.
* SERVFAIL responses can now be cached for a limited time (defaulting to
1 second, with an upper limit of 30). This can reduce the frequency of
retries when a query is persistently failing.
* Added an "nsip-wait-recurse" switch to RPZ. This causes NSIP rules to
be skipped if a name server IP address isn't in the cache yet; the
address will be looked up and the rule will be applied on future
queries.
* Added a Python RNDC module. This allows multiple commands to sent over
a persistent RNDC channel, which saves time.
* The "controls" block in named.conf can now grant read-only "rndc"
access to specified clients or keys. Read-only clients could, for
example, check "rndc status" but could not reconfigure or shut down
the server.
* "rndc" commands can now return arbitrarily large amounts of text to
the caller.
* The zone serial number of a dynamically updatable zone can now be set
via "rndc signing -serial ". This allows inline-signing zones to be
set to a specific serial number.
* The new "rndc nta" command can be used to set a Negative Trust Anchor
(NTA), disabling DNSSEC validation for a specific domain; this can be
used when responses from a domain are known to be failing validation
due to administrative error rather than because of a spoofing attack.
Negative trust anchors are strictly temporary; by default they expire
after one hour, but can be configured to last up to one week.
* "rndc delzone" can now be used on zones that were not originally
created by "rndc addzone".
* "rndc modzone" reconfigures a single zone, without requiring the
entire server to be reconfigured.
* "rndc showzone" displays the current configuration of a zone.
* "rndc managed-keys" can be used to check the status of RFC 5001
managed trust anchors, or to force trust anchors to be refreshed.
* "max-cache-size" can now be set to a percentage of available memory.
The default is 90%.
* Update forwarding performance has been improved by allowing a single
TCP connection to be shared by multiple updates.
* The EDNS Client Subnet (ECS) option is now supported for authoritative
servers; if a query contains an ECS option then ACLs containing
"geoip" or "ecs" elements can match against the the address encoded in
the option. This can be used to select a view for a query, so that
different answers can be provided depending on the client network.
* The EDNS EXPIRE option has been implemented on the client side,
allowing a slave server to set the expiration timer correctly when
transferring zone data from another slave server.
* The key generation and manipulation tools (dnssec-keygen,
dnssec-settime, dnssec-importkey, dnssec-keyfromlabel) now take
"-Psync" and "-Dsync" options to set the publication and deletion
times of CDS and CDNSKEY parent-synchronization records. Both named
and dnssec-signzone can now publish and remove these records at the
scheduled times.
* A new "minimal-any" option reduces the size of UDP responses for query
type ANY by returning a single arbitrarily selected RRset instead of
all RRsets.
* A new "masterfile-style" zone option controls the formatting of text
zone files: When set to "full", a zone file is dumped in
single-line-per-record format.
* "serial-update-method" can now be set to "date". On update, the serial
number will be set to the current date in YYYYMMDDNN format.
* "dnssec-signzone -N date" sets the serial number to YYYYMMDDNN.
* "named -L " causes named to send log messages to the specified file by
default instead of to the system log.
* "dig +ttlunits" prints TTL values with time-unit suffixes: w, d, h, m,
s for weeks, days, hours, minutes, and seconds.
* "dig +unknownformat" prints dig output in RFC 3597 "unknown record"
presentation format.
* "dig +ednsopt" allows dig to set arbitrary EDNS options on requests.
* "dig +ednsflags" allows dig to set yet-to-be-defined EDNS flags on
requests.
* "mdig" is an alternate version of dig which sends multiple pipelined
TCP queries to a server. Instead of waiting for a response after
sending a query, it sends all queries immediately and displays
responses in the order received.
* "serial-query-rate" no longer controls NOTIFY messages. These are
separately controlled by "notify-rate" and "startup-notify-rate".
* "nsupdate" now performs "check-names" processing by default on records
to be added. This can be disabled with "check-names no".
* The statistics channel now supports DEFLATE compression, reducing the
size of the data sent over the network when querying statistics.
* New counters have been added to the statistics channel to track the
sizes of incoming queries and outgoing responses in histogram buckets,
as specified in RSSAC002.
* A new NXDOMAIN redirect method (option "nxdomain-redirect") has been
added, allowing redirection to a specified DNS namespace instead of a
single redirect zone.
* When starting up, named now ensures that no other named process is
already running.
* Files created by named to store information, including "mkeys" and
"nzf" files, are now named after their corresponding views unless the
view name contains characters incompatible with use as a filename. Old
style filenames (based on the hash of the view name) will still work.
BIND 9.10.0
BIND 9.10.0 includes a number of changes from BIND 9.9 and earlier
releases. New features include:
* DNS Response-rate limiting (DNS RRL), which blunts the impact of
reflection and amplification attacks, is always compiled in and no
longer requires a compile-time option to enable it.
* An experimental "Source Identity Token" (SIT) EDNS option is now
available. Similar to DNS Cookies as invented by Donald Eastlake 3rd,
these are designed to enable clients to detect off-path spoofed
responses, and to enable servers to detect spoofed-source queries.
Servers can be configured to send smaller responses to clients that
have not identified themselves using a SIT option, reducing the
effectiveness of amplification attacks. RRL processing has also been
updated; clients proven to be legitimate via SIT are not subject to
rate limiting. Use "configure --enable-sit" to enable this feature in
BIND.
* A new zone file format, "map", stores zone data in a format that can
be mapped directly into memory, allowing significantly faster zone
loading.
* "delv" (domain entity lookup and validation) is a new tool with
dig-like semantics for looking up DNS data and performing internal
DNSSEC validation. This allows easy validation in environments where
the resolver may not be trustworthy, and assists with troubleshooting
of DNSSEC problems. (NOTE: In previous development releases of BIND
9.10, this utility was called "delve". The spelling has been changed
to avoid confusion with the "delve" utility included with the Xapian
search engine.)
* Improved EDNS(0) processing for better resolver performance and
reliability over slow or lossy connections.
* A new "configure --with-tuning=large" option tunes certain compiled-in
constants and default settings to values better suited to large
servers with abundant memory. This can improve performance on such
servers, but will consume more memory and may degrade performance on
smaller systems.
* Substantial improvement in response-policy zone (RPZ) performance. Up
to 32 response-policy zones can be configured with minimal performance
loss.
* To improve recursive resolver performance, cache records which are
still being requested by clients can now be automatically refreshed
from the authoritative server before they expire, reducing or
eliminating the time window in which no answer is available in the
cache.
* New "rpz-client-ip" triggers and drop policies allowing response
policies based on the IP address of the client.
* ACLs can now be specified based on geographic location using the
MaxMind GeoIP databases. Use "configure --with-geoip" to enable.
* Zone data can now be shared between views, allowing multiple views to
serve the same zones authoritatively without storing multiple copies
in memory.
* New XML schema (version 3) for the statistics channel includes many
new statistics and uses a flattened XML tree for faster parsing. The
older schema is now deprecated.
* A new stylesheet, based on the Google Charts API, displays XML
statistics in charts and graphs on javascript-enabled browsers.
* The statistics channel can now provide data in JSON format as well as
XML.
* New stats counters track TCP and UDP queries received per zone, and
EDNS options received in total.
* The internal and export versions of the BIND libraries (libisc,
libdns, etc) have been unified so that external library clients can
use the same libraries as BIND itself.
* A new compile-time option, "configure --enable-native-pkcs11", allows
BIND 9 cryptography functions to use the PKCS#11 API natively, so that
BIND can drive a cryptographic hardware service module (HSM) directly
instead of using a modified OpenSSL as an intermediary. (Note: This
feature requires an HSM to have a full implementation of the PKCS#11
API; many current HSMs only have partial implementations. The new
"pkcs11-tokens" command can be used to check API completeness. Native
PKCS#11 is known to work with the Thales nShield HSM and with SoftHSM
version 2 from the Open DNSSEC project.)
* The new "max-zone-ttl" option enforces maximum TTLs for zones. This
can simplify the process of rolling DNSSEC keys by guaranteeing that
cached signatures will have expired within the specified amount of
time.
* "dig +subnet" sends an EDNS CLIENT-SUBNET option when querying.
* "dig +expire" sends an EDNS EXPIRE option when querying. When this
option is sent with an SOA query to a server that supports it, it will
report the expiry time of a slave zone.
* New "dnssec-coverage" tool to check DNSSEC key coverage for a zone and
report if a lapse in signing coverage has been inadvertently
scheduled.
* Signing algorithm flexibility and other improvements for the "rndc"
control channel.
* "named-checkzone" and "named-compilezone" can now read journal files,
allowing them to process dynamic zones.
* Multiple DLZ databases can now be configured. Individual zones can be
configured to be served from a specific DLZ database. DLZ databases
now serve zones of type "master" and "redirect".
* "rndc zonestatus" reports information about a specified zone.
* "named" now listens on IPv6 as well as IPv4 interfaces by default.
* "named" now preserves the capitalization of names when responding to
queries: for instance, a query for "example.com" may be answered with
"example.COM" if the name was configured that way in the zone file.
Some clients have a bug causing them to depend on the older behavior,
in which the case of the answer always matched the case of the query,
rather than the case of the name configured in the DNS. Such clients
can now be specified in the new "no-case-compress" ACL; this will
restore the older behavior of "named" for those clients only.
* new "dnssec-importkey" command allows the use of offline DNSSEC keys
with automatic DNSKEY management.
* New "named-rrchecker" tool to verify the syntactic correctness of
individual resource records.
* When re-signing a zone, the new "dnssec-signzone -Q" option drops
signatures from keys that are still published but are no longer
active.
* "named-checkconf -px" will print the contents of configuration files
with the shared secrets obscured, making it easier to share
configuration (e.g. when submitting a bug report) without revealing
private information.
* "rndc scan" causes named to re-scan network interfaces for changes in
local addresses.
* On operating systems with support for routing sockets, network
interfaces are re-scanned automatically whenever they change.
* "tsig-keygen" is now available as an alternate command name to use for
"ddns-confgen".
BIND 9.9.0
BIND 9.9.0 includes a number of changes from BIND 9.8 and earlier
releases. New features include:
* Inline signing, allowing automatic DNSSEC signing of master zones
without modification of the zonefile, or "bump in the wire" signing in
slaves.
* NXDOMAIN redirection.
* New 'rndc flushtree' command clears all data under a given name from
the DNS cache.
* New 'rndc sync' command dumps pending changes in a dynamic zone to
disk without a freeze/thaw cycle.
* New 'rndc signing' command displays or clears signing status records
in 'auto-dnssec' zones.
* NSEC3 parameters for 'auto-dnssec' zones can now be set prior to
signing, eliminating the need to initially sign with NSEC.
* Startup time improvements on large authoritative servers.
* Slave zones are now saved in raw format by default.
* Several improvements to response policy zones (RPZ).
* Improved hardware scalability by using multiple threads to listen for
queries and using finer-grained client locking
* The 'also-notify' option now takes the same syntax as 'masters', so it
can used named masterlists and TSIG keys.
* 'dnssec-signzone -D' writes an output file containing only DNSSEC
data, which can be included by the primary zone file.
* 'dnssec-signzone -R' forces removal of signatures that are not expired
but were created by a key which no longer exists.
* 'dnssec-signzone -X' allows a separate expiration date to be specified
for DNSKEY signatures from other signatures.
* New '-L' option to dnssec-keygen, dnssec-settime, and
dnssec-keyfromlabel sets the default TTL for the key.
* dnssec-dsfromkey now supports reading from standard input, to make it
easier to convert DNSKEY to DS.
* RFC 1918 reverse zones have been added to the empty-zones table per
RFC 6303.
* Dynamic updates can now optionally set the zone's SOA serial number to
the current UNIX time.
* DLZ modules can now retrieve the source IP address of the querying
client.
* 'request-ixfr' option can now be set at the per-zone level.
* 'dig +rrcomments' turns on comments about DNSKEY records, indicating
their key ID, algorithm and function
* Simplified nsupdate syntax and added readline support
BIND 9.8.0
BIND 9.8.0 includes a number of changes from BIND 9.7 and earlier
releases. New features include:
* Built-in trust anchor for the root zone, which can be switched on via
"dnssec-validation auto;"
* Support for DNS64.
* Support for response policy zones (RPZ).
* Support for writable DLZ zones.
* Improved ease of configuration of GSS/TSIG for interoperability with
Active Directory
* Support for GOST signing algorithm for DNSSEC.
* Removed RTT Banding from server selection algorithm.
* New "static-stub" zone type.
* Allow configuration of resolver timeouts via "resolver-query-timeout"
option.
* The DLZ "dlopen" driver is now built by default.
* Added a new include file with function typedefs for the DLZ "dlopen"
driver.
* Made "--with-gssapi" default.
* More verbose error reporting from DLZ LDAP.
BIND 9.7.0
BIND 9.7.0 includes a number of changes from BIND 9.6 and earlier
releases. Most are intended to simplify DNSSEC configuration. New features
include:
* Fully automatic signing of zones by "named".
* Simplified configuration of DNSSEC Lookaside Validation (DLV).
* Simplified configuration of Dynamic DNS, using the "ddns-confgen"
command line tool or the "local" update-policy option. (As a side
effect, this also makes it easier to configure automatic zone
re-signing.)
* New named option "attach-cache" that allows multiple views to share a
single cache.
* DNS rebinding attack prevention.
* New default values for dnssec-keygen parameters.
* Support for RFC 5011 automated trust anchor maintenance
* Smart signing: simplified tools for zone signing and key maintenance.
* The "statistics-channels" option is now available on Windows.
* A new DNSSEC-aware libdns API for use by non-BIND9 applications
* On some platforms, named and other binaries can now print out a stack
backtrace on assertion failure, to aid in debugging.
* A "tools only" installation mode on Windows, which only installs dig,
host, nslookup and nsupdate.
* Improved PKCS#11 support, including Keyper support and explicit
OpenSSL engine selection.
BIND 9.6.0
* Full NSEC3 support
* Automatic zone re-signing
* New update-policy methods tcp-self and 6to4-self
* The BIND 8 resolver library, libbind, has been removed from the BIND 9
distribution and is now available as a separate download.
* Change the default pid file location from /var/run to /var/run/
{named,lwresd} for improved chroot/setuid support.
BIND 9.5.0
* GSS-TSIG support (RFC 3645).
* DHCID support.
* Experimental http server and statistics support for named via xml.
* More detailed statistics counters including those supported in BIND 8.
* Faster ACL processing.
* Use Doxygen to generate internal documentation.
* Efficient LRU cache-cleaning mechanism.
* NSID support.
BIND 9.4.0
* Implemented "additional section caching (or acache)", an internal
cache framework for additional section content to improve response
performance. Several configuration options were provided to control
the behavior.
* New notify type 'master-only'. Enable notify for master zones only.
* Accept 'notify-source' style syntax for query-source.
* rndc now allows addresses to be set in the server clauses.
* New option "allow-query-cache". This lets "allow-query" be used to
specify the default zone access level rather than having to have every
zone override the global value. "allow-query-cache" can be set at both
the options and view levels. If "allow-query-cache" is not set then
"allow-recursion" is used if set, otherwise "allow-query" is used if
set unless "recursion no;" is set in which case "none;" is used,
otherwise the default (localhost; localnets;) is used.
* rndc: the source address can now be specified.
* ixfr-from-differences now takes master and slave in addition to yes
and no at the options and view levels.
* Allow the journal's name to be changed via named.conf.
* 'rndc notify zone [class [view]]' resend the NOTIFY messages for the
specified zone.
* 'dig +trace' now randomly selects the next servers to try. Report if
there is a bad delegation.
* Improve check-names error messages.
* Make public the function to read a key file, dst_key_read_public().
* dig now returns the byte count for axfr/ixfr.
* allow-update is now settable at the options / view level.
* named-checkconf now checks the logging configuration.
* host now can turn on memory debugging flags with '-m'.
* Don't send notify messages to self.
* Perform sanity checks on NS records which refer to 'in zone' names.
* New zone option "notify-delay". Specify a minimum delay between sets
of NOTIFY messages.
* Extend adjusting TTL warning messages.
* Named and named-checkzone can now both check for non-terminal wildcard
records.
* "rndc freeze/thaw" now freezes/thaws all zones.
* named-checkconf now check acls to verify that they only refer to
existing acls.
* The server syntax has been extended to support a range of servers.
* Report differences between hints and real NS rrset and associated
address records.
* Preserve the case of domain names in rdata during zone transfers.
* Restructured the data locking framework using architecture dependent
atomic operations (when available), improving response performance on
multi-processor machines significantly. x86, x86_64, alpha, powerpc,
and mips are currently supported.
* UNIX domain controls are now supported.
* Add support for additional zone file formats for improving loading
performance. The masterfile-format option in named.conf can be used to
specify a non-default format. A separate command named-compilezone was
provided to generate zone files in the new format. Additionally, the
-I and -O options for dnssec-signzone specify the input and output
formats.
* dnssec-signzone can now randomize signature end times (dnssec-signzone
-j jitter).
* Add support for CH A record.
* Add additional zone data constancy checks. named-checkzone has
extended checking of NS, MX and SRV record and the hosts they
reference. named has extended post zone load checks. New zone options:
check-mx and integrity-check.
* edns-udp-size can now be overridden on a per server basis.
* dig can now specify the EDNS version when making a query.
* Added framework for handling multiple EDNS versions.
* Additional memory debugging support to track size and mctx arguments.
* Detect duplicates of UDP queries we are recursing on and drop them.
New stats category "duplicates".
* "USE INTERNAL MALLOC" is now runtime selectable.
* The lame cache is now done on a basis as some servers only appear to
be lame for certain query types.
* Limit the number of recursive clients that can be waiting for a single
query () to resolve. New options clients-per-query and
max-clients-per-query.
* dig: report the number of extra bytes still left in the packet after
processing all the records.
* Support for IPSECKEY rdata type.
* Raise the UDP recieve buffer size to 32k if it is less than 32k.
* x86 and x86_64 now have seperate atomic locking implementations.
* named-checkconf now validates update-policy entries.
* Attempt to make the amount of work performed in a iteration self
tuning. The covers nodes clean from the cache per iteration, nodes
written to disk when rewriting a master file and nodes destroyed per
iteration when destroying a zone or a cache.
* ISC string copy API.
* Automatic empty zone creation for D.F.IP6.ARPA and friends. Note: RFC
1918 zones are not yet covered by this but are likely to be in a
future release.
* New options: empty-server, empty-contact, empty-zones-enable and
disable-empty-zone.
* dig now has a '-q queryname' and '+showsearch' options.
* host/nslookup now continue (default)/fail on SERVFAIL.
* dig now warns if 'RA' is not set in the answer when 'RD' was set in
the query. host/nslookup skip servers that fail to set 'RA' when 'RD'
is set unless a server is explicitly set.
* Integrate contibuted DLZ code into named.
* Integrate contibuted IDN code from JPNIC.
* libbind: corresponds to that from BIND 8.4.7.
BIND 9.3.0
* DNSSEC is now DS based (RFC 3658).
* DNSSEC lookaside validation.
* check-names is now implemented.
* rrset-order is more complete.
* IPv4/IPv6 transition support, dual-stack-servers.
* IXFR deltas can now be generated when loading master files,
ixfr-from-differences.
* It is now possible to specify the size of a journal, max-journal-size.
* It is now possible to define a named set of master servers to be used
in masters clause, masters.
* The advertised EDNS UDP size can now be set, edns-udp-size.
* allow-v6-synthesis has been obsoleted.
* Zones containing MD and MF will now be rejected.
* dig, nslookup name. now report "Not Implemented" as NOTIMP rather than
NOTIMPL. This will have impact on scripts that are looking for
NOTIMPL.
* libbind: corresponds to that from BIND 8.4.5.
BIND 9.2.0
* The size of the cache can now be limited using the "max-cache-size"
option.
* The server can now automatically convert RFC1886-style recursive
lookup requests into RFC2874-style lookups, when enabled using the new
option "allow-v6-synthesis". This allows stub resolvers that support
AAAA records but not A6 record chains or binary labels to perform
lookups in domains that make use of these IPv6 DNS features.
* Performance has been improved.
* The man pages now use the more portable "man" macros rather than the
"mandoc" macros, and are installed by "make install".
* The named.conf parser has been completely rewritten. It now supports
"include" directives in more places such as inside "view" statements,
and it no longer has any reserved words.
* The "rndc status" command is now implemented.
* rndc can now be configured automatically.
* A BIND 8 compatible stub resolver library is now included in lib/bind.
* OpenSSL has been removed from the distribution. This means that to use
DNSSEC, OpenSSL must be installed and the --with-openssl option must
be supplied to configure. This does not apply to the use of TSIG,
which does not require OpenSSL.
* The source distribution now builds on Windows. See win32utils/
readme1.txt and win32utils/win32-build.txt for details.
* This distribution also includes a new lightweight stub resolver
library and associated resolver daemon that fully support forward and
reverse lookups of both IPv4 and IPv6 addresses. This library is
considered experimental and is not a complete replacement for the BIND
8 resolver library. Applications that use the BIND 8 res_* functions
to perform DNS lookups or dynamic updates still need to be linked
against the BIND 8 libraries. For DNS lookups, they can also use the
new "getrrsetbyname()" API.
* BIND 9.2 is capable of acting as an authoritative server for DNSSEC
secured zones. This functionality is believed to be stable and
complete except for lacking support for verifications involving
wildcard records in secure zones.
* When acting as a caching server, BIND 9.2 can be configured to perform
DNSSEC secure resolution on behalf of its clients. This part of the
DNSSEC implementation is still considered experimental. For detailed
information about the state of the DNSSEC implementation, see the file
doc/misc/dnssec.

View File

@@ -1,542 +0,0 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- 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 http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
### Functional enhancements from prior major releases of BIND 9
#### BIND 9.11
BIND 9.11.0 includes a number of changes from BIND 9.10 and earlier
releases. New features include:
- Added support for Catalog Zones, a new method for provisioning servers: a
list of zones to be served is stored in a DNS zone, along with their
configuration parameters. Changes to the catalog zone are propagated to
slaves via normal AXFR/IXFR, whereupon the zones that are listed in it
are automatically added, deleted or reconfigured.
- Added support for "dnstap", a fast and flexible method of capturing and
logging DNS traffic.
- Added support for "dyndb", a new API for loading zone data from an
external database, developed by Red Hat for the FreeIPA project.
- "fetchlimit" quotas are now compiled in by default. These are for the
use of recursive resolvers that are are under high query load for domains
whose authoritative servers are nonresponsive or are experiencing a
denial of service attack:
- "fetches-per-server" limits the number of simultaneous queries that
can be sent to any single authoritative server. The configured value
is a starting point; it is automatically adjusted downward if the
server is partially or completely non-responsive. The algorithm used
to adjust the quota can be configured via the "fetch-quota-params"
option.
- "fetches-per-zone" limits the number of simultaneous queries that can
be sent for names within a single domain. (Note: Unlike
"fetches-per-server", this value is not self-tuning.)
- New stats counters have been added to count queries spilled due to
these quotas.
- Added a new "dnssec-keymgr" key mainenance utility, which can generate or
update keys as needed to ensure that a zone's keys match a defined DNSSEC
policy.
- The experimental "SIT" feature in BIND 9.10 has been renamed "COOKIE" and
is no longer optional. EDNS COOKIE is a mechanism enabling clients to
detect off-path spoofed responses, and servers to detect spoofed-source
queries. Clients that identify themselves using COOKIE options are not
subject to response rate limiting (RRL) and can receive larger UDP
responses.
- SERVFAIL responses can now be cached for a limited time (defaulting to 1
second, with an upper limit of 30). This can reduce the frequency of
retries when a query is persistently failing.
- Added an "nsip-wait-recurse" switch to RPZ. This causes NSIP rules to be
skipped if a name server IP address isn't in the cache yet; the address
will be looked up and the rule will be applied on future queries.
- Added a Python RNDC module. This allows multiple commands to sent over a
persistent RNDC channel, which saves time.
- The "controls" block in named.conf can now grant read-only "rndc" access
to specified clients or keys. Read-only clients could, for example, check
"rndc status" but could not reconfigure or shut down the server.
- "rndc" commands can now return arbitrarily large amounts of text to the
caller.
- The zone serial number of a dynamically updatable zone can now be set via
"rndc signing -serial <number> <zonename>". This allows inline-signing
zones to be set to a specific serial number.
- The new "rndc nta" command can be used to set a Negative Trust Anchor
(NTA), disabling DNSSEC validation for a specific domain; this can be
used when responses from a domain are known to be failing validation due
to administrative error rather than because of a spoofing attack.
Negative trust anchors are strictly temporary; by default they expire
after one hour, but can be configured to last up to one week.
- "rndc delzone" can now be used on zones that were not originally created
by "rndc addzone".
- "rndc modzone" reconfigures a single zone, without requiring the entire
server to be reconfigured.
- "rndc showzone" displays the current configuration of a zone.
- "rndc managed-keys" can be used to check the status of RFC 5001 managed
trust anchors, or to force trust anchors to be refreshed.
- "max-cache-size" can now be set to a percentage of available memory. The
default is 90%.
- Update forwarding performance has been improved by allowing a single TCP
connection to be shared by multiple updates.
- The EDNS Client Subnet (ECS) option is now supported for authoritative
servers; if a query contains an ECS option then ACLs containing "geoip"
or "ecs" elements can match against the the address encoded in the
option. This can be used to select a view for a query, so that different
answers can be provided depending on the client network.
- The EDNS EXPIRE option has been implemented on the client side, allowing
a slave server to set the expiration timer correctly when transferring
zone data from another slave server.
- The key generation and manipulation tools (dnssec-keygen, dnssec-settime,
dnssec-importkey, dnssec-keyfromlabel) now take "-Psync" and "-Dsync"
options to set the publication and deletion times of CDS and CDNSKEY
parent-synchronization records. Both named and dnssec-signzone can now
publish and remove these records at the scheduled times.
- A new "minimal-any" option reduces the size of UDP responses for query
type ANY by returning a single arbitrarily selected RRset instead of all
RRsets.
- A new "masterfile-style" zone option controls the formatting of text zone
files: When set to "full", a zone file is dumped in
single-line-per-record format.
- "serial-update-method" can now be set to "date". On update, the serial
number will be set to the current date in YYYYMMDDNN format.
- "dnssec-signzone -N date" sets the serial number to YYYYMMDDNN.
- "named -L <filename>" causes named to send log messages to the specified
file by default instead of to the system log.
- "dig +ttlunits" prints TTL values with time-unit suffixes: w, d, h, m, s
for weeks, days, hours, minutes, and seconds.
- "dig +unknownformat" prints dig output in RFC 3597 "unknown record"
presentation format.
- "dig +ednsopt" allows dig to set arbitrary EDNS options on requests.
- "dig +ednsflags" allows dig to set yet-to-be-defined EDNS flags on
requests.
- "mdig" is an alternate version of dig which sends multiple pipelined TCP
queries to a server. Instead of waiting for a response after sending a
query, it sends all queries immediately and displays responses in the
order received.
- "serial-query-rate" no longer controls NOTIFY messages. These are
separately controlled by "notify-rate" and "startup-notify-rate".
- "nsupdate" now performs "check-names" processing by default on records to
be added. This can be disabled with "check-names no".
- The statistics channel now supports DEFLATE compression, reducing the
size of the data sent over the network when querying statistics.
- New counters have been added to the statistics channel to track the sizes
of incoming queries and outgoing responses in histogram buckets, as
specified in RSSAC002.
- A new NXDOMAIN redirect method (option "nxdomain-redirect") has been
added, allowing redirection to a specified DNS namespace instead of a
single redirect zone.
- When starting up, named now ensures that no other named process is
already running.
- Files created by named to store information, including "mkeys" and "nzf"
files, are now named after their corresponding views unless the view name
contains characters incompatible with use as a filename. Old style
filenames (based on the hash of the view name) will still work.
#### BIND 9.10.0
BIND 9.10.0 includes a number of changes from BIND 9.9 and earlier
releases. New features include:
- DNS Response-rate limiting (DNS RRL), which blunts the
impact of reflection and amplification attacks, is always
compiled in and no longer requires a compile-time option
to enable it.
- An experimental "Source Identity Token" (SIT) EDNS option
is now available. Similar to DNS Cookies as invented by
Donald Eastlake 3rd, these are designed to enable clients
to detect off-path spoofed responses, and to enable servers
to detect spoofed-source queries. Servers can be configured
to send smaller responses to clients that have not identified
themselves using a SIT option, reducing the effectiveness of
amplification attacks. RRL processing has also been updated;
clients proven to be legitimate via SIT are not subject to
rate limiting. Use "configure --enable-sit" to enable this
feature in BIND.
- A new zone file format, "map", stores zone data in a
format that can be mapped directly into memory, allowing
significantly faster zone loading.
- "delv" (domain entity lookup and validation) is a new tool
with dig-like semantics for looking up DNS data and performing
internal DNSSEC validation. This allows easy validation in
environments where the resolver may not be trustworthy, and
assists with troubleshooting of DNSSEC problems. (NOTE:
In previous development releases of BIND 9.10, this utility
was called "delve". The spelling has been changed to avoid
confusion with the "delve" utility included with the Xapian
search engine.)
- Improved EDNS(0) processing for better resolver performance
and reliability over slow or lossy connections.
- A new "configure --with-tuning=large" option tunes certain
compiled-in constants and default settings to values better
suited to large servers with abundant memory. This can
improve performance on such servers, but will consume more
memory and may degrade performance on smaller systems.
- Substantial improvement in response-policy zone (RPZ)
performance. Up to 32 response-policy zones can be
configured with minimal performance loss.
- To improve recursive resolver performance, cache records
which are still being requested by clients can now be
automatically refreshed from the authoritative server
before they expire, reducing or eliminating the time
window in which no answer is available in the cache.
- New "rpz-client-ip" triggers and drop policies allowing
response policies based on the IP address of the client.
- ACLs can now be specified based on geographic location
using the MaxMind GeoIP databases. Use "configure
--with-geoip" to enable.
- Zone data can now be shared between views, allowing
multiple views to serve the same zones authoritatively
without storing multiple copies in memory.
- New XML schema (version 3) for the statistics channel
includes many new statistics and uses a flattened XML tree
for faster parsing. The older schema is now deprecated.
- A new stylesheet, based on the Google Charts API, displays
XML statistics in charts and graphs on javascript-enabled
browsers.
- The statistics channel can now provide data in JSON
format as well as XML.
- New stats counters track TCP and UDP queries received
per zone, and EDNS options received in total.
- The internal and export versions of the BIND libraries
(libisc, libdns, etc) have been unified so that external
library clients can use the same libraries as BIND itself.
- A new compile-time option, "configure --enable-native-pkcs11",
allows BIND 9 cryptography functions to use the PKCS#11 API
natively, so that BIND can drive a cryptographic hardware
service module (HSM) directly instead of using a modified
OpenSSL as an intermediary. (Note: This feature requires an
HSM to have a full implementation of the PKCS#11 API; many
current HSMs only have partial implementations. The new
"pkcs11-tokens" command can be used to check API completeness.
Native PKCS#11 is known to work with the Thales nShield HSM
and with SoftHSM version 2 from the Open DNSSEC project.)
- The new "max-zone-ttl" option enforces maximum TTLs for
zones. This can simplify the process of rolling DNSSEC keys
by guaranteeing that cached signatures will have expired
within the specified amount of time.
- "dig +subnet" sends an EDNS CLIENT-SUBNET option when
querying.
- "dig +expire" sends an EDNS EXPIRE option when querying.
When this option is sent with an SOA query to a server
that supports it, it will report the expiry time of
a slave zone.
- New "dnssec-coverage" tool to check DNSSEC key coverage
for a zone and report if a lapse in signing coverage has
been inadvertently scheduled.
- Signing algorithm flexibility and other improvements
for the "rndc" control channel.
- "named-checkzone" and "named-compilezone" can now read
journal files, allowing them to process dynamic zones.
- Multiple DLZ databases can now be configured. Individual
zones can be configured to be served from a specific DLZ
database. DLZ databases now serve zones of type "master"
and "redirect".
- "rndc zonestatus" reports information about a specified zone.
- "named" now listens on IPv6 as well as IPv4 interfaces
by default.
- "named" now preserves the capitalization of names
when responding to queries: for instance, a query for
"example.com" may be answered with "example.COM" if the
name was configured that way in the zone file. Some
clients have a bug causing them to depend on the older
behavior, in which the case of the answer always matched
the case of the query, rather than the case of the name
configured in the DNS. Such clients can now be specified
in the new "no-case-compress" ACL; this will restore the
older behavior of "named" for those clients only.
- new "dnssec-importkey" command allows the use of offline
DNSSEC keys with automatic DNSKEY management.
- New "named-rrchecker" tool to verify the syntactic
correctness of individual resource records.
- When re-signing a zone, the new "dnssec-signzone -Q" option
drops signatures from keys that are still published but are
no longer active.
- "named-checkconf -px" will print the contents of configuration
files with the shared secrets obscured, making it easier to
share configuration (e.g. when submitting a bug report)
without revealing private information.
- "rndc scan" causes named to re-scan network interfaces for
changes in local addresses.
- On operating systems with support for routing sockets,
network interfaces are re-scanned automatically whenever
they change.
- "tsig-keygen" is now available as an alternate command
name to use for "ddns-confgen".
#### BIND 9.9.0
BIND 9.9.0 includes a number of changes from BIND 9.8 and earlier
releases. New features include:
- Inline signing, allowing automatic DNSSEC signing of
master zones without modification of the zonefile, or
"bump in the wire" signing in slaves.
- NXDOMAIN redirection.
- New 'rndc flushtree' command clears all data under a given
name from the DNS cache.
- New 'rndc sync' command dumps pending changes in a dynamic
zone to disk without a freeze/thaw cycle.
- New 'rndc signing' command displays or clears signing status
records in 'auto-dnssec' zones.
- NSEC3 parameters for 'auto-dnssec' zones can now be set prior
to signing, eliminating the need to initially sign with NSEC.
- Startup time improvements on large authoritative servers.
- Slave zones are now saved in raw format by default.
- Several improvements to response policy zones (RPZ).
- Improved hardware scalability by using multiple threads
to listen for queries and using finer-grained client locking
- The 'also-notify' option now takes the same syntax as
'masters', so it can used named masterlists and TSIG keys.
- 'dnssec-signzone -D' writes an output file containing only DNSSEC
data, which can be included by the primary zone file.
- 'dnssec-signzone -R' forces removal of signatures that are
not expired but were created by a key which no longer exists.
- 'dnssec-signzone -X' allows a separate expiration date to
be specified for DNSKEY signatures from other signatures.
- New '-L' option to dnssec-keygen, dnssec-settime, and
dnssec-keyfromlabel sets the default TTL for the key.
- dnssec-dsfromkey now supports reading from standard input,
to make it easier to convert DNSKEY to DS.
- RFC 1918 reverse zones have been added to the empty-zones
table per RFC 6303.
- Dynamic updates can now optionally set the zone's SOA serial
number to the current UNIX time.
- DLZ modules can now retrieve the source IP address of
the querying client.
- 'request-ixfr' option can now be set at the per-zone level.
- 'dig +rrcomments' turns on comments about DNSKEY records,
indicating their key ID, algorithm and function
- Simplified nsupdate syntax and added readline support
#### BIND 9.8.0
BIND 9.8.0 includes a number of changes from BIND 9.7 and earlier
releases. New features include:
- Built-in trust anchor for the root zone, which can be
switched on via "dnssec-validation auto;"
- Support for DNS64.
- Support for response policy zones (RPZ).
- Support for writable DLZ zones.
- Improved ease of configuration of GSS/TSIG for
interoperability with Active Directory
- Support for GOST signing algorithm for DNSSEC.
- Removed RTT Banding from server selection algorithm.
- New "static-stub" zone type.
- Allow configuration of resolver timeouts via
"resolver-query-timeout" option.
- The DLZ "dlopen" driver is now built by default.
- Added a new include file with function typedefs
for the DLZ "dlopen" driver.
- Made "--with-gssapi" default.
- More verbose error reporting from DLZ LDAP.
#### BIND 9.7.0
BIND 9.7.0 includes a number of changes from BIND 9.6 and earlier
releases. Most are intended to simplify DNSSEC configuration.
New features include:
- Fully automatic signing of zones by "named".
- Simplified configuration of DNSSEC Lookaside Validation (DLV).
- Simplified configuration of Dynamic DNS, using the "ddns-confgen"
command line tool or the "local" update-policy option. (As a side
effect, this also makes it easier to configure automatic zone
re-signing.)
- New named option "attach-cache" that allows multiple views to
share a single cache.
- DNS rebinding attack prevention.
- New default values for dnssec-keygen parameters.
- Support for RFC 5011 automated trust anchor maintenance
- Smart signing: simplified tools for zone signing and key
maintenance.
- The "statistics-channels" option is now available on Windows.
- A new DNSSEC-aware libdns API for use by non-BIND9 applications
- On some platforms, named and other binaries can now print out
a stack backtrace on assertion failure, to aid in debugging.
- A "tools only" installation mode on Windows, which only installs
dig, host, nslookup and nsupdate.
- Improved PKCS#11 support, including Keyper support and explicit
OpenSSL engine selection.
#### BIND 9.6.0
- Full NSEC3 support
- Automatic zone re-signing
- New update-policy methods tcp-self and 6to4-self
- The BIND 8 resolver library, libbind, has been removed from the BIND 9
distribution and is now available as a separate download.
- Change the default pid file location from /var/run to
/var/run/{named,lwresd} for improved chroot/setuid support.
#### BIND 9.5.0
- GSS-TSIG support (RFC 3645).
- DHCID support.
- Experimental http server and statistics support for named via xml.
- More detailed statistics counters including those supported in BIND 8.
- Faster ACL processing.
- Use Doxygen to generate internal documentation.
- Efficient LRU cache-cleaning mechanism.
- NSID support.
BIND 9.4.0
- Implemented "additional section caching (or acache)", an internal cache
framework for additional section content to improve response performance.
Several configuration options were provided to control the behavior.
- New notify type 'master-only'. Enable notify for master zones only.
- Accept 'notify-source' style syntax for query-source.
- rndc now allows addresses to be set in the server clauses.
- New option "allow-query-cache". This lets "allow-query" be used to
specify the default zone access level rather than having to have every
zone override the global value. "allow-query-cache" can be set at both
the options and view levels. If "allow-query-cache" is not set then
"allow-recursion" is used if set, otherwise "allow-query" is used if set
unless "recursion no;" is set in which case "none;" is used, otherwise
the default (localhost; localnets;) is used.
- rndc: the source address can now be specified.
- ixfr-from-differences now takes master and slave in addition to yes and
no at the options and view levels.
- Allow the journal's name to be changed via named.conf.
- 'rndc notify zone [class [view]]' resend the NOTIFY messages for the
specified zone.
- 'dig +trace' now randomly selects the next servers to try. Report if
there is a bad delegation.
- Improve check-names error messages.
- Make public the function to read a key file, dst_key_read_public().
- dig now returns the byte count for axfr/ixfr.
- allow-update is now settable at the options / view level.
- named-checkconf now checks the logging configuration.
- host now can turn on memory debugging flags with '-m'.
- Don't send notify messages to self.
- Perform sanity checks on NS records which refer to 'in zone' names.
- New zone option "notify-delay". Specify a minimum delay between sets of
NOTIFY messages.
- Extend adjusting TTL warning messages.
- Named and named-checkzone can now both check for non-terminal wildcard
records.
- "rndc freeze/thaw" now freezes/thaws all zones.
- named-checkconf now check acls to verify that they only refer to existing
acls.
- The server syntax has been extended to support a range of servers.
- Report differences between hints and real NS rrset and associated address
records.
- Preserve the case of domain names in rdata during zone transfers.
- Restructured the data locking framework using architecture dependent
atomic operations (when available), improving response performance on
multi-processor machines significantly. x86, x86_64, alpha, powerpc, and
mips are currently supported.
- UNIX domain controls are now supported.
- Add support for additional zone file formats for improving loading
performance. The masterfile-format option in named.conf can be used to
specify a non-default format. A separate command named-compilezone was
provided to generate zone files in the new format. Additionally, the -I
and -O options for dnssec-signzone specify the input and output formats.
- dnssec-signzone can now randomize signature end times (dnssec-signzone -j
jitter).
- Add support for CH A record.
- Add additional zone data constancy checks. named-checkzone has extended
checking of NS, MX and SRV record and the hosts they reference. named
has extended post zone load checks. New zone options: check-mx and
integrity-check.
- edns-udp-size can now be overridden on a per server basis.
- dig can now specify the EDNS version when making a query.
- Added framework for handling multiple EDNS versions.
- Additional memory debugging support to track size and mctx arguments.
- Detect duplicates of UDP queries we are recursing on and drop them. New
stats category "duplicates".
- "USE INTERNAL MALLOC" is now runtime selectable.
- The lame cache is now done on a <qname,qclass,qtype> basis as some
servers only appear to be lame for certain query types.
- Limit the number of recursive clients that can be waiting for a single
query (<qname,qtype,qclass>) to resolve. New options clients-per-query
and max-clients-per-query.
- dig: report the number of extra bytes still left in the packet after
processing all the records.
- Support for IPSECKEY rdata type.
- Raise the UDP recieve buffer size to 32k if it is less than 32k.
- x86 and x86_64 now have seperate atomic locking implementations.
- named-checkconf now validates update-policy entries.
- Attempt to make the amount of work performed in a iteration self tuning.
The covers nodes clean from the cache per iteration, nodes written to
disk when rewriting a master file and nodes destroyed per iteration when
destroying a zone or a cache.
- ISC string copy API.
- Automatic empty zone creation for D.F.IP6.ARPA and friends. Note: RFC
1918 zones are not yet covered by this but are likely to be in a future
release.
- New options: empty-server, empty-contact, empty-zones-enable and
disable-empty-zone.
- dig now has a '-q queryname' and '+showsearch' options.
- host/nslookup now continue (default)/fail on SERVFAIL.
- dig now warns if 'RA' is not set in the answer when 'RD' was set in the
query. host/nslookup skip servers that fail to set 'RA' when 'RD' is set
unless a server is explicitly set.
- Integrate contibuted DLZ code into named.
- Integrate contibuted IDN code from JPNIC.
- libbind: corresponds to that from BIND 8.4.7.
#### BIND 9.3.0
- DNSSEC is now DS based (RFC 3658).
- DNSSEC lookaside validation.
- check-names is now implemented.
- rrset-order is more complete.
- IPv4/IPv6 transition support, dual-stack-servers.
- IXFR deltas can now be generated when loading master files,
ixfr-from-differences.
- It is now possible to specify the size of a journal, max-journal-size.
- It is now possible to define a named set of master servers to be used in
masters clause, masters.
- The advertised EDNS UDP size can now be set, edns-udp-size.
- allow-v6-synthesis has been obsoleted.
- Zones containing MD and MF will now be rejected.
- dig, nslookup name. now report "Not Implemented" as NOTIMP rather than
NOTIMPL. This will have impact on scripts that are looking for NOTIMPL.
- libbind: corresponds to that from BIND 8.4.5.
#### BIND 9.2.0
- The size of the cache can now be limited using the "max-cache-size"
option.
- The server can now automatically convert RFC1886-style recursive lookup
requests into RFC2874-style lookups, when enabled using the new option
"allow-v6-synthesis". This allows stub resolvers that support AAAA
records but not A6 record chains or binary labels to perform lookups in
domains that make use of these IPv6 DNS features.
- Performance has been improved.
- The man pages now use the more portable "man" macros rather than the
"mandoc" macros, and are installed by "make install".
- The named.conf parser has been completely rewritten. It now supports
"include" directives in more places such as inside "view" statements, and
it no longer has any reserved words.
- The "rndc status" command is now implemented.
- rndc can now be configured automatically.
- A BIND 8 compatible stub resolver library is now included in lib/bind.
- OpenSSL has been removed from the distribution. This means that to use
DNSSEC, OpenSSL must be installed and the --with-openssl option must be
supplied to configure. This does not apply to the use of TSIG, which
does not require OpenSSL.
- The source distribution now builds on Windows. See
win32utils/readme1.txt and win32utils/win32-build.txt for details.
- This distribution also includes a new lightweight stub resolver library
and associated resolver daemon that fully support forward and reverse
lookups of both IPv4 and IPv6 addresses. This library is considered
experimental and is not a complete replacement for the BIND 8 resolver
library. Applications that use the BIND 8 `res_*` functions to perform
DNS lookups or dynamic updates still need to be linked against the BIND 8
libraries. For DNS lookups, they can also use the new "getrrsetbyname()"
API.
- BIND 9.2 is capable of acting as an authoritative server for DNSSEC
secured zones. This functionality is believed to be stable and complete
except for lacking support for verifications involving wildcard records
in secure zones.
- When acting as a caching server, BIND 9.2 can be configured to perform
DNSSEC secure resolution on behalf of its clients. This part of the
DNSSEC implementation is still considered experimental. For detailed
information about the state of the DNSSEC implementation, see the file
doc/misc/dnssec.

View File

@@ -1,4 +0,0 @@
syntax(2)
test_suite('bind9')
include('lib/Kyuafile')

25
Makefile.am Normal file
View File

@@ -0,0 +1,25 @@
include $(top_srcdir)/Makefile.top
SUBDIRS = . lib doc bin fuzz
BUILT_SOURCES = bind.keys.h
CLEANFILES = bind.keys.h
bind.keys.h: bind.keys Makefile
${PERL} ${top_srcdir}/util/bindkeys.pl ${top_srcdir}/bind.keys > $@
dist_sysconf_DATA = bind.keys
.PHONY: doc
EXTRA_DIST = \
util/bindkeys.pl \
contrib \
CHANGES \
COPYRIGHT \
LICENSE \
*.md
dist-hook:
find $(distdir) -type f -name .gitignore -delete
git rev-parse --short HEAD | cut -b1-7 > $(distdir)/srcid

52
Makefile.docs Normal file
View File

@@ -0,0 +1,52 @@
SPHINX_V = $(SPHINX_V_@AM_V@)
SPHINX_V_ = $(SPHINX_V_@AM_DEFAULT_V@)
SPHINX_V_0 = -q
SPHINX_V_1 = -n
AM_V_SPHINX = $(AM_V_SPHINX_@AM_V@)
AM_V_SPHINX_ = $(AM_V_SPHINX_@AM_DEFAULT_V@)
AM_V_SPHINX_0 = @echo " SPHINX $@";
SPHINXBUILDDIR = $(builddir)/_build
common_SPHINXOPTS = \
-W \
-c $(srcdir) \
-a \
$(SPHINX_V)
ALLSPHINXOPTS = \
$(common_SPHINXOPTS) \
-D version="$(PACKAGE_VERSION)" \
-D today="$(RELEASE_DATE)" \
-D release="$(PACKAGE_VERSION)" \
$(SPHINXOPTS) \
$(srcdir)
man_SPHINXOPTS = \
$(common_SPHINXOPTS) \
-D version="@""PACKAGE_VERSION@"\
-D today="@""RELEASE_DATE@" \
-D release="@""PACKAGE_VERSION@"\
$(SPHINXOPTS) \
$(srcdir)
AM_V_SED = $(AM_V_SED_@AM_V@)
AM_V_SED_ = $(AM_V_SED_@AM_DEFAULT_V@)
AM_V_SED_0 = @echo " SED $@";
AM_V_CFG_TEST = $(AM_V_CFG_TEST_@AM_V@)
AM_V_CFG_TEST_ = $(AM_V_CFG_TEST_@AM_DEFAULT_V@)
AM_V_CFG_TEST_0 = @echo " CFG_GEN $@";
AM_V_RST_OPTIONS = $(AM_V_CFG_TEST_@AM_V@)
AM_V_RST_OPTIONS_ = $(AM_V_RST_OPTIONS_@AM_DEFAULT_V@)
AM_V_RST_OPTIONS_0 = @echo " RST_OPTIONS $@";
AM_V_RST_ZONEOPT = $(AM_V_CFG_TEST_@AM_V@)
AM_V_RST_ZONEOPT_ = $(AM_V_RST_ZONEOPT_@AM_DEFAULT_V@)
AM_V_RST_ZONEOPT_0 = @echo " RST_ZONEOPT $@";
AM_V_RST_GRAMMARS = $(AM_V_CFG_TEST_@AM_V@)
AM_V_RST_GRAMMARS_ = $(AM_V_RST_GRAMMARS_@AM_DEFAULT_V@)
AM_V_RST_GRAMMARS_0 = @echo " RST_GRAMMARS $@";

View File

@@ -1,127 +0,0 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# 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 http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
VERSION=@BIND9_VERSION@
SUBDIRS = make lib fuzz bin doc
TARGETS =
PREREQS = bind.keys.h
MANPAGES = isc-config.sh.1
HTMLPAGES = isc-config.sh.html
MANOBJS = README HISTORY OPTIONS CONTRIBUTING PLATFORMS \
${MANPAGES} ${HTMLPAGES}
@BIND9_MAKE_RULES@
newrr:
cd lib/dns; ${MAKE} newrr
bind.keys.h: ${top_srcdir}/bind.keys ${srcdir}/util/bindkeys.pl
${PERL} ${srcdir}/util/bindkeys.pl < ${top_srcdir}/bind.keys > $@
distclean::
rm -f config.cache config.h config.log config.status TAGS
rm -f libtool isc-config.sh configure.lineno
rm -f util/conf.sh docutil/docbook2man-wrapper.sh
# XXX we should clean libtool stuff too. Only do this after we add rules
# to make it.
maintainer-clean::
rm -f configure
rm -f bind.keys.h
docclean manclean maintainer-clean::
rm -f ${MANOBJS}
doc man:: ${MANOBJS}
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir} \
${DESTDIR}${localstatedir}/run ${DESTDIR}${sysconfdir}
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
install:: isc-config.sh installdirs
${INSTALL_SCRIPT} isc-config.sh ${DESTDIR}${bindir}
rm -f ${DESTDIR}${bindir}/bind9-config
@LN@ ${DESTDIR}${bindir}/isc-config.sh ${DESTDIR}${bindir}/bind9-config
${INSTALL_DATA} ${top_srcdir}/isc-config.sh.1 ${DESTDIR}${mandir}/man1
rm -f ${DESTDIR}${mandir}/man1/bind9-config.1
@LN@ ${DESTDIR}${mandir}/man1/isc-config.sh.1 ${DESTDIR}${mandir}/man1/bind9-config.1
${INSTALL_DATA} ${top_srcdir}/bind.keys ${DESTDIR}${sysconfdir}
uninstall::
rm -f ${DESTDIR}${sysconfdir}/bind.keys
rm -f ${DESTDIR}${mandir}/man1/bind9-config.1
rm -f ${DESTDIR}${mandir}/man1/isc-config.sh.1
rm -f ${DESTDIR}${bindir}/bind9-config
rm -f ${DESTDIR}${bindir}/isc-config.sh
tags:
rm -f TAGS
find lib bin -name "*.[ch]" -print | @ETAGS@ -
test check:
@if test -n "`${PERL} ${top_srcdir}/bin/tests/system/testsock.pl 2>/dev/null || echo fail`"; then \
echo I: NOTE: The tests were not run because they require that; \
echo I: the IP addresses 10.53.0.1 through 10.53.0.8 are configured; \
echo I: as alias addresses on the loopback interface. Please run; \
echo I: \'bin/tests/system/ifconfig.sh up\' as root to configure; \
echo I: them, then rerun the tests. Run make force-test to run the; \
echo I: tests anyway.; \
exit 1; \
fi
${MAKE} test-force
force-test: test-force
test-force:
status=0; \
(cd fuzz && ${MAKE} check) || status=1; \
(cd bin/tests && ${MAKE} ${MAKEDEFS} test) || status=1; \
(test -f ${top_builddir}/unit/unittest.sh && \
$(SHELL) ${top_builddir}/unit/unittest.sh) || status=1; \
exit $$status
README: README.md
${PANDOC} --email-obfuscation=none -s -t html README.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
HISTORY: HISTORY.md
${PANDOC} --email-obfuscation=none -s -t html HISTORY.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
OPTIONS: OPTIONS.md
${PANDOC} --email-obfuscation=none -s -t html OPTIONS.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
CONTRIBUTING: CONTRIBUTING.md
${PANDOC} --email-obfuscation=none -s -t html CONTRIBUTING.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
PLATFORMS: PLATFORMS.md
${PANDOC} --email-obfuscation=none -s -t html PLATFORMS.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
unit::
sh ${top_builddir}/unit/unittest.sh
clean::

17
Makefile.tests Normal file
View File

@@ -0,0 +1,17 @@
# Hey Emacs, this is -*- makefile-automake -*- file!
# vim: filetype=automake
unit-local: check
TESTS = $(check_PROGRAMS)
LOG_COMPILER = $(builddir)/../../unit-test-driver.sh
AM_CPPFLAGS += \
$(CMOCKA_CFLAGS) \
-DNAMED_PLUGINDIR=\"$(libdir)/named\" \
-DSKIPPED_TEST_EXIT_CODE=77 \
-DTESTS_DIR=\"$(abs_srcdir)\"
LDADD += \
$(CMOCKA_LIBS)

64
Makefile.top Normal file
View File

@@ -0,0 +1,64 @@
# Hey Emacs, this is -*- makefile-automake -*- file!
# vim: filetype=automake
ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4
AM_CFLAGS = \
$(STD_CFLAGS)
AM_CPPFLAGS = \
$(STD_CPPFLAGS) \
-include $(top_builddir)/config.h \
-I$(srcdir)/include
AM_LDFLAGS =
LDADD =
if HOST_MACOS
AM_LDFLAGS += \
-Wl,-flat_namespace
endif HOST_MACOS
LIBISC_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/isc/include \
-I$(top_builddir)/lib/isc/include
LIBISC_LIBS = $(top_builddir)/lib/isc/libisc.la
LIBDNS_CFLAGS = \
-I$(top_srcdir)/lib/dns/include \
-I$(top_builddir)/lib/dns/include
LIBDNS_LIBS = \
$(top_builddir)/lib/dns/libdns.la
LIBNS_CFLAGS = \
-I$(top_srcdir)/lib/ns/include
LIBNS_LIBS = \
$(top_builddir)/lib/ns/libns.la
LIBIRS_CFLAGS = \
-I$(top_srcdir)/lib/irs/include
LIBIRS_LIBS = \
$(top_builddir)/lib/irs/libirs.la
LIBISCCFG_CFLAGS = \
-I$(top_srcdir)/lib/isccfg/include
LIBISCCFG_LIBS = \
$(top_builddir)/lib/isccfg/libisccfg.la
LIBISCCC_CFLAGS = \
-I$(top_srcdir)/lib/isccc/include/
LIBISCCC_LIBS = \
$(top_builddir)/lib/isccc/libisccc.la
LIBBIND9_CFLAGS = \
-I$(top_srcdir)/lib/bind9/include
LIBBIND9_LIBS = \
$(top_builddir)/lib/bind9/libbind9.la

1
NEWS Symbolic link
View File

@@ -0,0 +1 @@
CHANGES

26
OPTIONS
View File

@@ -1,26 +0,0 @@
Setting the STD_CDEFINES environment variable before running configure can
be used to enable certain compile-time options that are not explicitly
defined in configure.
Some of these settings are:
Setting Description
Overwrite memory with tag values when allocating
-DISC_MEM_DEFAULTFILL=1 or freeing it; this impairs performance but
makes debugging of memory problems easier.
Don't track memory allocations by file and line
-DISC_MEM_TRACKLINES=0 number; this improves performance but makes
debugging more difficult.
-DISC_FACILITY=LOG_LOCAL0 Change the default syslog facility for named
-DNS_CLIENT_DROPPORT=0 Disable dropping queries from particular
well-known ports:
-DCHECK_SIBLING=0 Don't check sibling glue in named-checkzone
-DCHECK_LOCAL=0 Don't check out-of-zone addresses in
named-checkzone
-DNS_RUN_PID_DIR=0 Create default PID files in ${localstatedir}/run
rather than ${localstatedir}/run/named/
Disable the use of inline functions to implement
-DISC_BUFFER_USEINLINE=0 the isc_buffer API: this reduces performance but
may be useful when debugging
-DISC_HEAP_CHECK Test heap consistency after every heap
operation; used when debugging

View File

@@ -8,20 +8,19 @@
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
Setting the `STD_CDEFINES` environment variable before running `configure`
can be used to enable certain compile-time options that are not explicitly
defined in `configure`.
Setting the `CPPFLAGS` environment variable before running `configure`
can be used to enable certain compile-time options that are not
explicitly defined in `configure`.
Some of these settings are:
|Setting |Description |
|-----------------------------------|----------------------------------------|
|`-DISC_MEM_DEFAULTFILL=1`|Overwrite memory with tag values when allocating or freeing it; this impairs performance but makes debugging of memory problems easier.|
|`-DISC_MEM_TRACKLINES=0`|Don't track memory allocations by file and line number; this improves performance but makes debugging more difficult.|
|<nobr>`-DISC_FACILITY=LOG_LOCAL0`</nobr>|Change the default syslog facility for `named`|
|`-DNS_CLIENT_DROPPORT=0`|Disable dropping queries from particular well-known ports:|
|`-DCHECK_SIBLING=0`|Don't check sibling glue in `named-checkzone`|
|`-DCHECK_LOCAL=0`|Don't check out-of-zone addresses in `named-checkzone`|
|`-DNS_RUN_PID_DIR=0`|Create default PID files in `${localstatedir}/run` rather than `${localstatedir}/run/named/`|
|`-DISC_BUFFER_USEINLINE=0`|Disable the use of inline functions to implement the `isc_buffer` API: this reduces performance but may be useful when debugging |
|`-DISC_HEAP_CHECK`|Test heap consistency after every heap operation; used when debugging|
| Setting | Description |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `-DCHECK_LOCAL=0` | Don't check out-of-zone addresses in `named-checkzone` |
| `-DCHECK_SIBLING=0` | Don't check sibling glue in `named-checkzone` |
| `-DISC_FACILITY=LOG_LOCAL0` | Change the default syslog facility for `named` |
| `-DISC_HEAP_CHECK` | Test heap consistency after every heap operation; used when debugging |
| `-DISC_MEM_DEFAULTFILL=1` | Overwrite memory with tag values when allocating or freeing it; this impairs performance but makes debugging of memory problems easier |
| `-DISC_MEM_TRACKLINES=0` | Don't track memory allocations by file and line number; this improves performance but makes debugging more difficult |
| `-DNAMED_RUN_PID_DIR=0` | Create default PID files in `${localstatedir}/run` rather than `${localstatedir}/run/named/` |
| `-DNS_CLIENT_DROPPORT=0` | Disable dropping queries from particular well-known ports |

View File

@@ -1,89 +0,0 @@
Supported platforms
In general, this version of BIND will build and run on any POSIX-compliant
system with a C99-compliant C compiler, BSD-style sockets with
RFC-compliant IPv6 support, POSIX-compliant threads, and the OpenSSL
cryptography library. Atomic operations support from the compiler is
needed, either in the form of builtin operations, C11 atomics or the
Interlocked family of functions on Windows.
ISC regularly tests BIND on many operating systems and architectures, but
lacks the resources to test all of them. Consequently, ISC is only able to
offer support on a "best effort" basis for some.
Regularly tested platforms
As of May 2018, BIND 9.13 is tested on the following systems:
* Debian 8, 9
* Ubuntu 16.04, 18.04
* Fedora 27, 28
* Red Hat/CentOS 6, 7
* FreeBSD 10.x, 11.x
* OpenBSD 6.3
The amd64, i386, armhf and arm64 CPU architectures are all fully
supported.
Best effort
The following are platforms on which BIND is known to build and run, but
on which it is not routinely tested. ISC makes every effort to fix bugs on
these platforms, but may be unable to do so quickly due to lack of
hardware, less familiarity on the part of engineering staff, and other
constraints.
* Windows 10 / x64
* Windows Server 2012 R2, 2016 / x64
* macOS 10.12+
* Solaris 10
* FreeBSD 12+
* OpenBSD 6.2
* NetBSD
* Older or less popular Linux distributions still supported by their
vendors, such as:
+ Ubuntu 14.04, 18.10+
+ Gentoo
+ ArchLinux
+ Alpine Linux
* OpenWRT/LEDE 17.0
* Other CPU architectures (mips, mipsel, sparc, ...)
Unsupported platforms
These are platforms on which BIND is known not to build or run:
* Platforms without at least OpenSSL 1.0.2
* Windows 10 / x86
* Windows Server 2012 and older
* Platforms that don't support IPv6 Advanced Socket API (RFC 3542)
* Platforms that don't support atomic operations (via compiler or
library)
* Linux without NPTL (Native POSIX Thread Library)
Platform quirks
ARM
If the compilation ends with following error:
Error: selected processor does not support `yield' in ARM mode
You will need to set -march compiler option to native, so the compiler
recognizes yield assembler instruction. The proper way to set -march=
native would be to put it into CFLAGS, e.g. run ./configure like this:
CFLAGS="-march=native -Os -g" ./configure plus your usual options.
If that doesn't work, you can enforce the minimum CPU and FPU (taken from
Debian armhf documentation):
* The lowest worthwhile CPU implementation is Armv7-A, therefore the
recommended build option is -march=armv7-a.
* FPU should be set at VFPv3-D16 as they represent the miminum
specification of the processors to support here, therefore the
recommended build option is -mfpu=vfpv3-d16.
The configure command should look like this:
CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -Os -g" ./configure

View File

@@ -11,11 +11,45 @@
## Supported platforms
In general, this version of BIND will build and run on any POSIX-compliant
system with a C99-compliant C compiler, BSD-style sockets with RFC-compliant
IPv6 support, POSIX-compliant threads, and the OpenSSL cryptography library.
Atomic operations support from the compiler is needed, either in the form of
builtin operations, C11 atomics or the Interlocked family of functions on
Windows.
system with a C11-compliant C compiler, BSD-style sockets with RFC-compliant
IPv6 support, and POSIX-compliant threads, plus the following mandatory
libraries:
- `libuv` for asynchronous I/O operations and event loops
- `libssl` and `libcrypto` from OpenSSL for cryptography
Use of the following libraries is optional:
- `libjemalloc` for improved memory allocation performance
- `libnghttp2` for DNS-over-HTTPS (DoH) support
The following C11 features are used in BIND 9:
* Atomic operations support, either in the form of C11 atomics or
`__atomic` builtin operations.
* Thread Local Storage support, either in the form of C11
`_Thread_local`/`thread_local`, or the `__thread` GCC extension.
The C11 variants are preferred.
BIND 9.17 requires a fairly recent version of `libuv` (at least 1.x). For
some of the older systems listed below, you will have to install an updated
`libuv` package from sources such as EPEL, PPA, or other native sources for
updated packages. The other option is to build and install `libuv` from
source.
Certain optional BIND features have additional library dependencies.
These include:
* `libfstrm` and `libprotobuf-c` for DNSTAP
* `libidn2` for display of internationalized domain names in `dig`
* `libjson-c` for JSON statistics
* `libmaxminddb` for geolocation
* `libnghttp2` for DNS over HTTPS
* `libxml2` for XML statistics
* `libz` for compression of the HTTP statistics channel
* `readline` for line editing in `nsupdate` and `nslookup`
ISC regularly tests BIND on many operating systems and architectures, but
lacks the resources to test all of them. Consequently, ISC is only able to
@@ -23,78 +57,61 @@ offer support on a "best effort" basis for some.
### Regularly tested platforms
As of May 2018, BIND 9.13 is tested on the following systems:
As of Nov 2020, BIND 9.17 is fully supported and regularly tested on the
following systems:
* Debian 8, 9
* Ubuntu 16.04, 18.04
* Fedora 27, 28
* Red Hat/CentOS 6, 7
* FreeBSD 10.x, 11.x
* OpenBSD 6.3
* Debian 9, 10
* Ubuntu LTS 18.04, 20.04
* Fedora 34
* Red Hat Enterprise Linux / CentOS 7, 8
* FreeBSD 11.4, 12.2, 13.0
* OpenBSD 6.9
* Alpine Linux 3.14
The amd64, i386, armhf and arm64 CPU architectures are all fully supported.
### Best effort
The following are platforms on which BIND is known to build and run,
but on which it is not routinely tested. ISC makes every effort to fix bugs
on these platforms, but may be unable to do so quickly due to lack of
hardware, less familiarity on the part of engineering staff, and other
constraints.
The following are platforms on which BIND is known to build and run.
ISC makes every effort to fix bugs on these platforms, but may be unable
to do so quickly due to lack of hardware, less familiarity on the part
of engineering staff, and other constraints. None of these are tested
regularly by ISC.
* Windows 10 / x64
* Windows Server 2012 R2, 2016 / x64
* macOS 10.12+
* Solaris 10
* FreeBSD 12+
* OpenBSD 6.2
* Solaris 11
* NetBSD
* Older or less popular Linux distributions still supported by their vendors, such as:
* Ubuntu 14.04, 18.10+
* Other Linux distributions still supported by their vendors, such as:
* Ubuntu 20.10+
* Gentoo
* ArchLinux
* Alpine Linux
* OpenWRT/LEDE 17.0
* Arch Linux
* OpenWRT/LEDE 17.01+
* Other CPU architectures (mips, mipsel, sparc, ...)
### Community maintained
These systems may not all have the required dependencies for building BIND
easily available, although it will be possible in many cases to compile
those directly from source. The community and interested parties may wish
to help with maintenance, and we welcome patch contributions, although we
cannot guarantee that we will accept them. All contributions will be
assessed against the risk of adverse effect on officially supported
platforms.
* Platforms past or close to their respective EOL dates, such as:
* Ubuntu 14.04, 16.04 (Ubuntu ESM releases are not supported)
* CentOS 6
* Debian Jessie
* FreeBSD 10.x
## Unsupported platforms
These are platforms on which BIND is known *not* to build or run:
These are platforms on which BIND 9.17 is known *not* to build or run:
* Platforms without at least OpenSSL 1.0.2
* Windows 10 / x86
* Windows Server 2012 and older
* Windows
* Solaris 10 and older
* Platforms that don't support IPv6 Advanced Socket API (RFC 3542)
* Platforms that don't support atomic operations (via compiler or library)
* Linux without NPTL (Native POSIX Thread Library)
## Platform quirks
### ARM
If the compilation ends with following error:
```
Error: selected processor does not support `yield' in ARM mode
```
You will need to set `-march` compiler option to `native`, so the compiler
recognizes `yield` assembler instruction. The proper way to set `-march=native`
would be to put it into `CFLAGS`, e.g. run `./configure` like this:
`CFLAGS="-march=native -Os -g" ./configure` plus your usual options.
If that doesn't work, you can enforce the minimum CPU and FPU (taken from Debian
armhf documentation):
* The lowest worthwhile CPU implementation is Armv7-A, therefore the recommended
build option is `-march=armv7-a`.
* FPU should be set at VFPv3-D16 as they represent the miminum specification of
the processors to support here, therefore the recommended build option is
`-mfpu=vfpv3-d16`.
The configure command should look like this:
```
CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -Os -g" ./configure
```
* Platforms on which `libuv` cannot be compiled

371
README
View File

@@ -1,371 +0,0 @@
BIND 9
Contents
1. Introduction
2. Reporting bugs and getting help
3. Contributing to BIND
4. BIND 9.13 features
5. Building BIND
6. macOS
7. Compile-time options
8. Automated testing
9. Documentation
10. Change log
11. Acknowledgments
Introduction
BIND (Berkeley Internet Name Domain) is a complete, highly portable
implementation of the DNS (Domain Name System) protocol.
The BIND name server, named, is able to serve as an authoritative name
server, recursive resolver, DNS forwarder, or all three simultaneously. It
implements views for split-horizon DNS, automatic DNSSEC zone signing and
key management, catalog zones to facilitate provisioning of zone data
throughout a name server constellation, response policy zones (RPZ) to
protect clients from malicious data, response rate limiting (RRL) and
recursive query limits to reduce distributed denial of service attacks,
and many other advanced DNS features. BIND also includes a suite of
administrative tools, including the dig and delv DNS lookup tools,
nsupdate for dynamic DNS zone updates, rndc for remote name server
administration, and more.
BIND 9 began as a complete re-write of the BIND architecture that was used
in versions 4 and 8. Internet Systems Consortium (https://www.isc.org), a
501(c)(3) public benefit corporation dedicated to providing software and
services in support of the Internet infrastructure, developed BIND 9 and
is responsible for its ongoing maintenance and improvement. BIND is open
source software licenced under the terms of the Mozilla Public License,
version 2.0.
For a summary of features introduced in past major releases of BIND, see
the file HISTORY.
For a detailed list of changes made throughout the history of BIND 9, see
the file CHANGES. See below for details on the CHANGES file format.
For up-to-date release notes and errata, see http://www.isc.org/software/
bind9/releasenotes
For information about supported platforms, see PLATFORMS.
Reporting bugs and getting help
To report non-security-sensitive bugs or request new features, you may
open an Issue in the BIND 9 project on the ISC GitLab server at https://
gitlab.isc.org/isc-projects/bind9.
Please note that, unless you explicitly mark the newly created Issue as
"confidential", it will be publicly readable. Please do not include any
information in bug reports that you consider to be confidential unless the
issue has been marked as such. In particular, if submitting the contents
of your configuration file in a non-confidential Issue, it is advisable to
obscure key secrets: this can be done automatically by using
named-checkconf -px.
If the bug you are reporting is a potential security issue, such as an
assertion failure or other crash in named, please do NOT use GitLab to
report it. Instead, please send mail to security-officer@isc.org.
Professional support and training for BIND are available from ISC at
https://www.isc.org/support.
To join the BIND Users mailing list, or view the archives, visit https://
lists.isc.org/mailman/listinfo/bind-users.
If you're planning on making changes to the BIND 9 source code, you may
also want to join the BIND Workers mailing list, at https://lists.isc.org/
mailman/listinfo/bind-workers.
Contributing to BIND
ISC maintains a public git repository for BIND; details can be found at
http://www.isc.org/git/.
Information for BIND contributors can be found in the following files: -
General information: CONTRIBUTING.md - BIND 9 code style: doc/dev/style.md
- BIND architecture and developer guide: doc/dev/dev.md
Patches for BIND may be submitted as Merge Requests in the ISC GitLab
server at at https://gitlab.isc.org/isc-projects/bind9/merge_requests.
By default, external contributors don't have ability to fork BIND in the
GitLab server, but if you wish to contribute code to BIND, you may request
permission to do so. Thereafter, you can create git branches and directly
submit requests that they be reviewed and merged.
If you prefer, you may also submit code by opening a GitLab Issue and
including your patch as an attachment, preferably generated by git
format-patch.
BIND 9.13 features
BIND 9.13 is the newest development branch of BIND 9. It includes a number
of changes from BIND 9.12 and earlier releases. New features include:
* Socket and task code has been refactored to improve performance.
* QNAME minimization, as described in RFC 7816, is now supported.
* "Root key sentinel" support, enabling validating resolvers to indicate
via a special query which trust anchors are configured for the root
zone.
* Secondary zones can now be configured as "mirror" zones; their
contents are transferred in as with traditional slave zones, but are
subject to DNSSEC validation and are not treated as authoritative data
when answering. This makes it easier to configure a local copy of the
root zone as described in RFC 7706.
* The "validate-except" option allows configuration of domains below
which DNSSEC validation should not be performed.
* The default value of "dnssec-validation" is now "auto".
* IDNA2008 is now supported when linking with libidn2.
In addition, workarounds that were formerly in place to enable resolution
of domains whose authoritative servers did not respond to EDNS queries
have been removed. See https://dnsflagday.net for more details.
Cryptographic support has been modernized. BIND now uses the best
available pseudo-random number generator for the platform on which it's
built. Very old versions of OpenSSL are no longer supported. Cryptography
is now mandatory: building BIND without DNSSEC is now longer supported.
Special code to support certain legacy operating systems has also been
removed; see the file PLATFORMS.md for details of supported platforms. In
addition to OpenSSL, BIND now requires support for IPv6, threads, and
standard atomic operations provided by the C compiler.
Building BIND
Minimally, BIND requires a UNIX or Linux system with an ANSI C compiler,
basic POSIX support, and a 64-bit integer type. Successful builds have
been observed on many versions of Linux and UNIX, including RedHat,
Fedora, Debian, Ubuntu, SuSE, Slackware, FreeBSD, NetBSD, OpenBSD, Mac OS
X, Solaris, HP-UX, and OpenWRT.
BIND requires a cryptography provider library such as OpenSSL or a
hardware service module supporting PKCS#11. On Linux, BIND requires the
libcap library to set process privileges, though this requirement can be
overridden by disabling capability support at compile time. See
Compile-time options below for details on other libraries that may be
required to support optional features.
BIND is also available for Windows 2008 and higher. See win32utils/
readme1st.txt for details on building for Windows systems.
To build on a UNIX or Linux system, use:
$ ./configure
$ make
If you're planning on making changes to the BIND 9 source, you should run
make depend. If you're using Emacs, you might find make tags helpful.
Several environment variables that can be set before running configure
will affect compilation:
Variable Description
CC The C compiler to use. configure tries to figure out the
right one for supported systems.
C compiler flags. Defaults to include -g and/or -O2 as
CFLAGS supported by the compiler. Please include '-g' if you need
to set CFLAGS.
System header file directories. Can be used to specify
STD_CINCLUDES where add-on thread or IPv6 support is, for example.
Defaults to empty string.
Any additional preprocessor symbols you want defined.
STD_CDEFINES Defaults to empty string. For a list of possible settings,
see the file OPTIONS.
LDFLAGS Linker flags. Defaults to empty string.
BUILD_CC Needed when cross-compiling: the native C compiler to use
when building for the target system.
BUILD_CFLAGS Optional, used for cross-compiling
BUILD_CPPFLAGS
BUILD_LDFLAGS
BUILD_LIBS
macOS
Building on macOS assumes that the "Command Tools for Xcode" is installed.
This can be downloaded from https://developer.apple.com/download/more/ or
if you have Xcode already installed you can run "xcode-select --install".
This will add /usr/include to the system and install the compiler and
other tools so that they can be easily found.
Compile-time options
To see a full list of configuration options, run configure --help.
On most platforms, BIND 9 is built with multithreading support, allowing
it to take advantage of multiple CPUs. You can configure this by
specifying --enable-threads or --disable-threads on the configure command
line. The default is to enable threads, except on some older operating
systems on which threads are known to have had problems in the past.
(Note: Prior to BIND 9.10, the default was to disable threads on Linux
systems; this has now been reversed. On Linux systems, the threaded build
is known to change BIND's behavior with respect to file permissions; it
may be necessary to specify a user with the -u option when running named.)
To build shared libraries, specify --with-libtool on the configure command
line.
Certain compiled-in constants and default settings can be increased to
values better suited to large servers with abundant memory resources (e.g,
64-bit servers with 12G or more of memory) by specifying --with-tuning=
large on the configure command line. This can improve performance on big
servers, but will consume more memory and may degrade performance on
smaller systems.
For the server to support DNSSEC, you need to build it with crypto
support. To use OpenSSL, you should have OpenSSL 1.0.2e or newer
installed. If the OpenSSL library is installed in a nonstandard location,
specify the prefix using --with-openssl=<PREFIX> on the configure command
line. To use a PKCS#11 hardware service module for cryptographic
operations, specify the path to the PKCS#11 provider library using
--with-pkcs11=<PREFIX>, and configure BIND with --enable-native-pkcs11.
To support the HTTP statistics channel, the server must be linked with at
least one of the following: libxml2 http://xmlsoft.org or json-c https://
github.com/json-c. If these are installed at a nonstandard location,
specify the prefix using --with-libxml2=/prefix or --with-libjson=/prefix.
To support compression on the HTTP statistics channel, the server must be
linked against libzlib. If this is installed in a nonstandard location,
specify the prefix using --with-zlib=/prefix.
To support storing configuration data for runtime-added zones in an LMDB
database, the server must be linked with liblmdb. If this is installed in
a nonstandard location, specify the prefix using with-lmdb=/prefix.
To support GeoIP location-based ACLs, the server must be linked with
libGeoIP. This is not turned on by default; BIND must be configured with
--with-geoip. If the library is installed in a nonstandard location,
specify the prefix using --with-geoip=/prefix.
For DNSTAP packet logging, you must have installed libfstrm https://
github.com/farsightsec/fstrm and libprotobuf-c https://
developers.google.com/protocol-buffers, and BIND must be configured with
--enable-dnstap.
On Linux, process capabilities are managed in user space using the libcap
library, which can be installed on most Linux systems via the libcap-dev
or libcap-devel module. Process capability support can also be disabled by
configuring with --disable-linux-caps.
Portions of BIND that are written in Python, including dnssec-keymgr,
dnssec-coverage, dnssec-checkds, and some of the system tests, require the
'argparse' and 'ply' modules to be available. 'argparse' is a standard
module as of Python 2.7 and Python 3.2. 'ply' is available from https://
pypi.python.org/pypi/ply.
On some platforms it is necessary to explicitly request large file support
to handle files bigger than 2GB. This can be done by using
--enable-largefile on the configure command line.
Support for the "fixed" rrset-order option can be enabled or disabled by
specifying --enable-fixed-rrset or --disable-fixed-rrset on the configure
command line. By default, fixed rrset-order is disabled to reduce memory
footprint.
make install will install named and the various BIND 9 libraries. By
default, installation is into /usr/local, but this can be changed with the
--prefix option when running configure.
You may specify the option --sysconfdir to set the directory where
configuration files like named.conf go by default, and --localstatedir to
set the default parent directory of run/named.pid. For backwards
compatibility with BIND 8, --sysconfdir defaults to /etc and
--localstatedir defaults to /var if no --prefix option is given. If there
is a --prefix option, sysconfdir defaults to $prefix/etc and localstatedir
defaults to $prefix/var.
Automated testing
A system test suite can be run with make test. The system tests require
you to configure a set of virtual IP addresses on your system (this allows
multiple servers to run locally and communicate with one another). These
IP addresses can be configured by running the command bin/tests/system/
ifconfig.sh up as root.
Some tests require Perl and the Net::DNS and/or IO::Socket::INET6 modules,
and will be skipped if these are not available. Some tests require Python
and the 'dnspython' module and will be skipped if these are not available.
See bin/tests/system/README for further details.
Unit tests are implemented using the CMocka unit testing framework. To
build them, use configure --with-cmocka. Execution of tests is done by the
Kyua test execution engine; if the kyua command is available, then unit
tests can be run via make test or make unit.
Documentation
The BIND 9 Administrator Reference Manual is included with the source
distribution, in DocBook XML, HTML and PDF format, in the doc/arm
directory.
Some of the programs in the BIND 9 distribution have man pages in their
directories. In particular, the command line options of named are
documented in bin/named/named.8.
Frequently (and not-so-frequently) asked questions and their answers can
be found in the ISC Knowledge Base at https://kb.isc.org.
Additional information on various subjects can be found in other README
files throughout the source tree.
Change log
A detailed list of all changes that have been made throughout the
development BIND 9 is included in the file CHANGES, with the most recent
changes listed first. Change notes include tags indicating the category of
the change that was made; these categories are:
Category Description
[func] New feature
[bug] General bug fix
[security] Fix for a significant security flaw
[experimental] Used for new features when the syntax or other aspects of
the design are still in flux and may change
[port] Portability enhancement
[maint] Updates to built-in data such as root server addresses and
keys
[tuning] Changes to built-in configuration defaults and constants to
improve performance
[performance] Other changes to improve server performance
[protocol] Updates to the DNS protocol such as new RR types
[test] Changes to the automatic tests, not affecting server
functionality
[cleanup] Minor corrections and refactoring
[doc] Documentation
[contrib] Changes to the contributed tools and libraries in the
'contrib' subdirectory
Used in the master development branch to reserve change
[placeholder] numbers for use in other branches, e.g. when fixing a bug
that only exists in older releases
In general, [func] and [experimental] tags will only appear in new-feature
releases (i.e., those with version numbers ending in zero). Some new
functionality may be backported to older releases on a case-by-case basis.
All other change types may be applied to all currently-supported releases.
Acknowledgments
* The original development of BIND 9 was underwritten by the following
organizations:
Sun Microsystems, Inc.
Hewlett Packard
Compaq Computer Corporation
IBM
Process Software Corporation
Silicon Graphics, Inc.
Network Associates, Inc.
U.S. Defense Information Systems Agency
USENIX Association
Stichting NLnet - NLnet Foundation
Nominum, Inc.
* This product includes software developed by the OpenSSL Project for
use in the OpenSSL Toolkit. http://www.OpenSSL.org/
* This product includes cryptographic software written by Eric Young
(eay@cryptsoft.com)
* This product includes software written by Tim Hudson
(tjh@cryptsoft.com)

334
README.md
View File

@@ -15,9 +15,9 @@
1. [Introduction](#intro)
1. [Reporting bugs and getting help](#help)
1. [Contributing to BIND](#contrib)
1. [BIND 9.13 features](#features)
1. [Building BIND](#build)
1. [macOS](#macos)
1. [Dependencies](#dependencies)
1. [Compile-time options](#opts)
1. [Automated testing](#testing)
1. [Documentation](#doc)
@@ -27,62 +27,67 @@
### <a name="intro"/> Introduction
BIND (Berkeley Internet Name Domain) is a complete, highly portable
implementation of the DNS (Domain Name System) protocol.
implementation of the Domain Name System (DNS) protocol.
The BIND name server, `named`, is able to serve as an authoritative name
server, recursive resolver, DNS forwarder, or all three simultaneously. It
The BIND name server, `named`, can act as an authoritative name
server, recursive resolver, DNS forwarder, or all three simultaneously. It
implements views for split-horizon DNS, automatic DNSSEC zone signing and
key management, catalog zones to facilitate provisioning of zone data
throughout a name server constellation, response policy zones (RPZ) to
protect clients from malicious data, response rate limiting (RRL) and
recursive query limits to reduce distributed denial of service attacks,
and many other advanced DNS features. BIND also includes a suite of
and many other advanced DNS features. BIND also includes a suite of
administrative tools, including the `dig` and `delv` DNS lookup tools,
`nsupdate` for dynamic DNS zone updates, `rndc` for remote name server
administration, and more.
BIND 9 began as a complete re-write of the BIND architecture that was
BIND 9 began as a complete rewrite of the BIND architecture that was
used in versions 4 and 8. Internet Systems Consortium
([https://www.isc.org](https://www.isc.org)), a 501(c)(3) public benefit
([https://www.isc.org](https://www.isc.org)), a 501(c)(3) US public benefit
corporation dedicated to providing software and services in support of the
Internet infrastructure, developed BIND 9 and is responsible for its
ongoing maintenance and improvement. BIND is open source software
licenced under the terms of the Mozilla Public License, version 2.0.
For a summary of features introduced in past major releases of BIND,
see the file [HISTORY](HISTORY.md).
ongoing maintenance and improvement. BIND is open source software
licensed under the terms of the Mozilla Public License, version 2.0.
For a detailed list of changes made throughout the history of BIND 9, see
the file [CHANGES](CHANGES). See [below](#changes) for details on the
CHANGES file format.
For up-to-date release notes and errata, see
[http://www.isc.org/software/bind9/releasenotes](http://www.isc.org/software/bind9/releasenotes)
For up-to-date versions and release notes, see
[https://www.isc.org/download/](https://www.isc.org/download/).
For information about supported platforms, see [PLATFORMS](PLATFORMS.md).
### <a name="help"/> Reporting bugs and getting help
To report non-security-sensitive bugs or request new features, you may
open an Issue in the BIND 9 project on the
open an issue in the BIND 9 project on the
[ISC GitLab server](https://gitlab.isc.org) at
[https://gitlab.isc.org/isc-projects/bind9](https://gitlab.isc.org/isc-projects/bind9).
Please note that, unless you explicitly mark the newly created Issue as
"confidential", it will be publicly readable. Please do not include any
Please note that, unless you explicitly mark the newly created issue as
"confidential," it will be publicly readable. Please do not include any
information in bug reports that you consider to be confidential unless
the issue has been marked as such. In particular, if submitting the
contents of your configuration file in a non-confidential Issue, it is
advisable to obscure key secrets: this can be done automatically by
the issue has been marked as such. In particular, if submitting the
contents of your configuration file in a non-confidential issue, it is
advisable to obscure key secrets; this can be done automatically by
using `named-checkconf -px`.
If the bug you are reporting is a potential security issue, such as an
If you are reporting a bug that is a potential security issue, such as an
assertion failure or other crash in `named`, please do *NOT* use GitLab to
report it. Instead, please send mail to
[security-officer@isc.org](mailto:security-officer@isc.org).
report it. Instead, send mail to
[security-officer@isc.org](mailto:security-officer@isc.org) using our
OpenPGP key to secure your message. (Information about OpenPGP and links
to our key can be found at
[https://www.isc.org/pgpkey](https://www.isc.org/pgpkey).) Please do not
discuss the bug on any public mailing list.
For a general overview of ISC security policies, read the Knowledgebase
article at [https://kb.isc.org/docs/aa-00861](https://kb.isc.org/docs/aa-00861).
Professional support and training for BIND are available from
ISC at [https://www.isc.org/support](https://www.isc.org/support).
ISC. Contact us at [https://www.isc.org/contact](https://www.isc.org/contact)
for more information.
To join the __BIND Users__ mailing list, or view the archives, visit
[https://lists.isc.org/mailman/listinfo/bind-users](https://lists.isc.org/mailman/listinfo/bind-users).
@@ -94,237 +99,197 @@ may also want to join the __BIND Workers__ mailing list, at
### <a name="contrib"/> Contributing to BIND
ISC maintains a public git repository for BIND; details can be found
at [http://www.isc.org/git/](http://www.isc.org/git/).
at [https://www.isc.org/sourceaccess/](https://www.isc.org/sourceaccess/).
Information for BIND contributors can be found in the following files:
- General information: [CONTRIBUTING.md](CONTRIBUTING)
- General information: [CONTRIBUTING.md](CONTRIBUTING.md)
- Code of Conduct: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
- BIND 9 code style: [doc/dev/style.md](doc/dev/style.md)
- BIND architecture and developer guide: [doc/dev/dev.md](doc/dev/dev.md)
Patches for BIND may be submitted as
[Merge Requests](https://gitlab.isc.org/isc-projects/bind9/merge_requests)
in the [ISC GitLab server](https://gitlab.isc.org) at
at [https://gitlab.isc.org/isc-projects/bind9/merge_requests](https://gitlab.isc.org/isc-projects/bind9/merge_requests).
[merge requests](https://gitlab.isc.org/isc-projects/bind9/merge_requests)
on the [ISC GitLab server](https://gitlab.isc.org).
By default, external contributors don't have ability to fork BIND in the
GitLab server, but if you wish to contribute code to BIND, you may request
By default, external contributors do not have the ability to fork BIND on the
GitLab server; if you wish to contribute code to BIND, you may request
permission to do so. Thereafter, you can create git branches and directly
submit requests that they be reviewed and merged.
If you prefer, you may also submit code by opening a
[GitLab Issue](https://gitlab.isc.org/isc-projects/bind9/issues) and
[GitLab issue](https://gitlab.isc.org/isc-projects/bind9/issues) and
including your patch as an attachment, preferably generated by
`git format-patch`.
### <a name="features"/> BIND 9.13 features
### <a name="build"/> Building BIND 9
BIND 9.13 is the newest development branch of BIND 9. It includes a
number of changes from BIND 9.12 and earlier releases. New features
include:
At a minimum, BIND requires a Unix or Linux system with an ANSI C compiler,
basic POSIX support, and a 64-bit integer type. BIND also requires the
`libuv` asynchronous I/O library, the `nghttp2` HTTP/2 library, the
`jemalloc` memory allocation library, and the OpenSSL cryptography
library. On Linux, BIND requires the `libcap` library to set process
privileges, though this requirement can be overridden by disabling
capability support at compile time. See [Compile-time options](#opts)
below for details on other libraries that may be required to support
optional features.
* Socket and task code has been refactored to improve performance.
* QNAME minimization, as described in RFC 7816, is now supported.
* "Root key sentinel" support, enabling validating resolvers to indicate
via a special query which trust anchors are configured for the root zone.
* Secondary zones can now be configured as "mirror" zones; their contents
are transferred in as with traditional slave zones, but are subject to
DNSSEC validation and are not treated as authoritative data when
answering. This makes it easier to configure a local copy of the root
zone as described in RFC 7706.
* The "validate-except" option allows configuration of domains below which
DNSSEC validation should not be performed.
* The default value of "dnssec-validation" is now "auto".
* IDNA2008 is now supported when linking with `libidn2`.
Successful builds have been observed on many versions of Linux and
Unix, including RHEL/CentOS, Fedora, Debian, Ubuntu, SLES, openSUSE,
Slackware, Alpine, FreeBSD, NetBSD, OpenBSD, macOS, Solaris,
OpenIndiana, OmniOS CE, HP-UX, and OpenWRT.
In addition, workarounds that were formerly in place to enable resolution
of domains whose authoritative servers did not respond to EDNS queries
have been removed. See [https://dnsflagday.net](https://dnsflagday.net)
for more details.
Cryptographic support has been modernized. BIND now uses the
best available pseudo-random number generator for the platform on which
it's built. Very old versions of OpenSSL are no longer supported.
Cryptography is now mandatory: building BIND without DNSSEC is now
longer supported.
Special code to support certain legacy operating systems has also
been removed; see the file [PLATFORMS.md](PLATFORMS.md) for details
of supported platforms. In addition to OpenSSL, BIND now requires
support for IPv6, threads, and standard atomic operations provided
by the C compiler.
### <a name="build"/> Building BIND
Minimally, BIND requires a UNIX or Linux system with an ANSI C compiler,
basic POSIX support, and a 64-bit integer type. Successful builds have been
observed on many versions of Linux and UNIX, including RedHat, Fedora,
Debian, Ubuntu, SuSE, Slackware, FreeBSD, NetBSD, OpenBSD, Mac OS X,
Solaris, HP-UX, and OpenWRT.
BIND requires a cryptography provider library such as OpenSSL or a
hardware service module supporting PKCS#11. On Linux, BIND requires
the `libcap` library to set process privileges, though this requirement
can be overridden by disabling capability support at compile time.
See [Compile-time options](#opts) below for details on other libraries
that may be required to support optional features.
BIND is also available for Windows 2008 and higher. See
`win32utils/readme1st.txt` for details on building for Windows
systems.
To build on a UNIX or Linux system, use:
To build on a Unix or Linux system, use:
$ autoreconf -fi (if you are building in the git repository)
$ ./configure
$ make
If you're planning on making changes to the BIND 9 source, you should run
`make depend`. If you're using Emacs, you might find `make tags` helpful.
If you're using Emacs, you might find `make tags` helpful.
Several environment variables that can be set before running `configure` will
affect compilation:
Several environment variables, which can be set before running `configure`,
affect compilation. Significant ones are:
|Variable|Description |
|--------------------|-----------------------------------------------|
|`CC`|The C compiler to use. `configure` tries to figure out the right one for supported systems.|
|`CFLAGS`|C compiler flags. Defaults to include -g and/or -O2 as supported by the compiler. Please include '-g' if you need to set `CFLAGS`. |
|`STD_CINCLUDES`|System header file directories. Can be used to specify where add-on thread or IPv6 support is, for example. Defaults to empty string.|
|`STD_CDEFINES`|Any additional preprocessor symbols you want defined. Defaults to empty string. For a list of possible settings, see the file [OPTIONS](OPTIONS.md).|
|`LDFLAGS`|Linker flags. Defaults to empty string.|
|`BUILD_CC`|Needed when cross-compiling: the native C compiler to use when building for the target system.|
|`BUILD_CFLAGS`|Optional, used for cross-compiling|
|`BUILD_CPPFLAGS`||
|`BUILD_LDFLAGS`||
|`BUILD_LIBS`||
Additional environment variables affecting the build are listed at the
end of the `configure` help text, which can be obtained by running the
command:
$ ./configure --help
#### <a name="macos"> macOS
Building on macOS assumes that the "Command Tools for Xcode" is installed.
This can be downloaded from https://developer.apple.com/download/more/
or if you have Xcode already installed you can run "xcode-select --install".
This will add /usr/include to the system and install the compiler and other
tools so that they can be easily found.
Building on macOS assumes that the "Command Tools for Xcode" are installed.
These can be downloaded from
[https://developer.apple.com/download/more/](https://developer.apple.com/download/more/)
or, if you have Xcode already installed, you can run `xcode-select --install`.
(Note that an Apple ID may be required to access the download page.)
#### <a name="dependencies"> Dependencies
To build BIND you need to have the following packages installed:
libuv
pkg-config / pkgconfig / pkgconf
To build BIND from the git repository, you need the following tools
installed:
autoconf (includes autoreconf)
automake
libtool
#### <a name="opts"/> Compile-time options
To see a full list of configuration options, run `configure --help`.
On most platforms, BIND 9 is built with multithreading support, allowing it
to take advantage of multiple CPUs. You can configure this by specifying
`--enable-threads` or `--disable-threads` on the `configure` command line.
The default is to enable threads, except on some older operating systems on
which threads are known to have had problems in the past. (Note: Prior to
BIND 9.10, the default was to disable threads on Linux systems; this has
now been reversed. On Linux systems, the threaded build is known to change
BIND's behavior with respect to file permissions; it may be necessary to
specify a user with the -u option when running `named`.)
To build shared libraries, specify `--with-libtool` on the `configure`
command line.
Certain compiled-in constants and default settings can be increased to
values better suited to large servers with abundant memory resources (e.g,
64-bit servers with 12G or more of memory) by specifying
`--with-tuning=large` on the `configure` command line. This can improve
performance on big servers, but will consume more memory and may degrade
performance on smaller systems.
For the server to support DNSSEC, you need to build it with crypto support.
To use OpenSSL, you should have OpenSSL 1.0.2e or newer installed. If the
To use OpenSSL, you must have OpenSSL 1.0.2e or newer installed. If the
OpenSSL library is installed in a nonstandard location, specify the prefix
using `--with-openssl=<PREFIX>` on the configure command line. To use a
PKCS#11 hardware service module for cryptographic operations, specify the
path to the PKCS#11 provider library using `--with-pkcs11=<PREFIX>`, and
configure BIND with `--enable-native-pkcs11`.
To support DNS over HTTPS, the server must be linked with `libnghttp2`.
To support the HTTP statistics channel, the server must be linked with at
least one of the following: libxml2
[http://xmlsoft.org](http://xmlsoft.org) or json-c
[https://github.com/json-c](https://github.com/json-c). If these are
installed at a nonstandard location, specify the prefix using
`--with-libxml2=/prefix` or `--with-libjson=/prefix`.
least one of the following libraries: `libxml2`
[http://xmlsoft.org](http://xmlsoft.org) or `json-c`
[https://github.com/json-c/json-c](https://github.com/json-c/json-c).
If these are installed at a nonstandard location, then:
* for `libxml2`, specify the prefix using `--with-libxml2=/prefix`.
* for `json-c`, adjust `PKG_CONFIG_PATH`.
To support compression on the HTTP statistics channel, the server must be
linked against libzlib. If this is installed in a nonstandard location,
linked against `libzlib`. If this is installed in a nonstandard location,
specify the prefix using `--with-zlib=/prefix`.
To support storing configuration data for runtime-added zones in an LMDB
database, the server must be linked with liblmdb. If this is installed in a
database, the server must be linked with `liblmdb`. If this is installed in a
nonstandard location, specify the prefix using `with-lmdb=/prefix`.
To support GeoIP location-based ACLs, the server must be linked with
libGeoIP. This is not turned on by default; BIND must be configured with
`--with-geoip`. If the library is installed in a nonstandard location,
specify the prefix using `--with-geoip=/prefix`.
To support MaxMind GeoIP2 location-based ACLs, the server must be linked
with `libmaxminddb`. This is turned on by default if the library is
found; if the library is installed in a nonstandard location,
specify the prefix using `--with-maxminddb=/prefix`. GeoIP2 support
can be switched off with `--disable-geoip`.
For DNSTAP packet logging, you must have installed libfstrm
For DNSTAP packet logging, you must have installed `libfstrm`
[https://github.com/farsightsec/fstrm](https://github.com/farsightsec/fstrm)
and libprotobuf-c
and `libprotobuf-c`
[https://developers.google.com/protocol-buffers](https://developers.google.com/protocol-buffers),
and BIND must be configured with `--enable-dnstap`.
Certain compiled-in constants and default settings can be decreased to
values better suited to small machines, e.g. OpenWRT boxes, by specifying
`--with-tuning=small` on the `configure` command line. This decreases
memory usage by using smaller structures, but degrades performance.
On Linux, process capabilities are managed in user space using
the `libcap` library, which can be installed on most Linux systems via
the `libcap-dev` or `libcap-devel` module. Process capability support can
the `libcap-dev` or `libcap-devel` package. Process capability support can
also be disabled by configuring with `--disable-linux-caps`.
Portions of BIND that are written in Python, including
`dnssec-keymgr`, `dnssec-coverage`, `dnssec-checkds`, and some of the
system tests, require the 'argparse' and 'ply' modules to be available.
'argparse' is a standard module as of Python 2.7 and Python 3.2.
'ply' is available from [https://pypi.python.org/pypi/ply](https://pypi.python.org/pypi/ply).
On some platforms it is necessary to explicitly request large file support
to handle files bigger than 2GB. This can be done by using
`--enable-largefile` on the `configure` command line.
Support for the "fixed" rrset-order option can be enabled or disabled by
specifying `--enable-fixed-rrset` or `--disable-fixed-rrset` on the
configure command line. By default, fixed rrset-order is disabled to
configure command line. By default, fixed rrset-order is disabled to
reduce memory footprint.
`make install` will install `named` and the various BIND 9 libraries. By
The `--enable-querytrace` option causes `named` to log every step of
processing every query. The `--enable-singletrace` option turns on the
same verbose tracing, but allows an individual query to be separately
traced by setting its query ID to 0. These options should only be enabled
when debugging, because they have a significant negative impact on query
performance.
`make install` installs `named` and the various BIND 9 libraries. By
default, installation is into /usr/local, but this can be changed with the
`--prefix` option when running `configure`.
You may specify the option `--sysconfdir` to set the directory where
configuration files like `named.conf` go by default, and `--localstatedir`
to set the default parent directory of `run/named.pid`. For backwards
compatibility with BIND 8, `--sysconfdir` defaults to `/etc` and
`--localstatedir` defaults to `/var` if no `--prefix` option is given. If
there is a `--prefix` option, sysconfdir defaults to `$prefix/etc` and
localstatedir defaults to `$prefix/var`.
to set the default parent directory of `run/named.pid`. `--sysconfdir`
defaults to `$prefix/etc` and `--localstatedir` defaults to `$prefix/var`.
### <a name="testing"/> Automated testing
A system test suite can be run with `make test`. The system tests require
A system test suite can be run with `make check`. The system tests require
you to configure a set of virtual IP addresses on your system (this allows
multiple servers to run locally and communicate with one another). These
multiple servers to run locally and communicate with each other). These
IP addresses can be configured by running the command
`bin/tests/system/ifconfig.sh up` as root.
Some tests require Perl and the Net::DNS and/or IO::Socket::INET6 modules,
and will be skipped if these are not available. Some tests require Python
and the 'dnspython' module and will be skipped if these are not available.
Some tests require Perl and the `Net::DNS` and/or `IO::Socket::INET6` modules,
and are skipped if these are not available. Some tests require Python
and the `dnspython` module and are skipped if these are not available.
See bin/tests/system/README for further details.
Unit tests are implemented using the CMocka unit testing framework.
To build them, use `configure --with-cmocka`. Execution of tests is done
by the Kyua test execution engine; if the `kyua` command is available,
then unit tests can be run via `make test` or `make unit`.
Unit tests are implemented using the CMocka unit testing framework. To build
them, use `configure --with-cmocka`. Execution of tests is done by the automake
parallel test driver; unit tests are also run by `make check`.
### <a name="doc"/> Documentation
The *BIND 9 Administrator Reference Manual* is included with the source
distribution, in DocBook XML, HTML and PDF format, in the `doc/arm`
directory.
The *BIND 9 Administrator Reference Manual* (ARM) is included with the source
distribution, and in .rst format, in the `doc/arm`
directory. HTML and PDF versions are automatically generated and can
be viewed at [https://bind9.readthedocs.io/en/latest/index.html](https://bind9.readthedocs.io/en/latest/index.html).
Some of the programs in the BIND 9 distribution have man pages in their
directories. In particular, the command line options of `named` are
documented in `bin/named/named.8`.
Man pages for some of the programs in the BIND 9 distribution
are also included in the BIND ARM.
Frequently (and not-so-frequently) asked questions and their answers
can be found in the ISC Knowledge Base at
can be found in the ISC Knowledgebase at
[https://kb.isc.org](https://kb.isc.org).
Additional information on various subjects can be found in other
@@ -333,8 +298,8 @@ Additional information on various subjects can be found in other
### <a name="changes"/> Change log
A detailed list of all changes that have been made throughout the
development BIND 9 is included in the file CHANGES, with the most recent
changes listed first. Change notes include tags indicating the category of
development of BIND 9 is included in the file CHANGES, with the most recent
changes listed first. Change notes include tags indicating the category of
the change that was made; these categories are:
|Category |Description |
@@ -352,12 +317,31 @@ the change that was made; these categories are:
| [cleanup] | Minor corrections and refactoring |
| [doc] | Documentation |
| [contrib] | Changes to the contributed tools and libraries in the 'contrib' subdirectory |
| [placeholder] | Used in the master development branch to reserve change numbers for use in other branches, e.g. when fixing a bug that only exists in older releases |
| [placeholder] | Used in the main development branch to reserve change numbers for use in other branches, e.g., when fixing a bug that only exists in older releases |
In general, [func] and [experimental] tags will only appear in new-feature
releases (i.e., those with version numbers ending in zero). Some new
In general, [func] and [experimental] tags only appear in new-feature
releases (i.e., those with version numbers ending in zero). Some new
functionality may be backported to older releases on a case-by-case basis.
All other change types may be applied to all currently-supported releases.
All other change types may be applied to all currently supported releases.
#### Bug report identifiers
Most notes in the CHANGES file include a reference to a bug report or
issue number. Prior to 2018, these were usually of the form `[RT #NNN]`
and referred to entries in the "bind9-bugs" RT database, which was not open
to the public. More recent entries use the form `[GL #NNN]` or, less often,
`[GL !NNN]`, which, respectively, refer to issues or merge requests in the
GitLab database. Most of these are publicly readable, unless they include
information which is confidential or security-sensitive.
To look up a GitLab issue by its number, use the URL
[https://gitlab.isc.org/isc-projects/bind9/issues/NNN](https://gitlab.isc.org/isc-projects/bind9/issues).
To look up a merge request, use
[https://gitlab.isc.org/isc-projects/bind9/merge_requests/NNN](https://gitlab.isc.org/isc-projects/bind9/merge_requests).
In rare cases, an issue or merge request number may be followed with the
letter "P". This indicates that the information is in the private ISC
GitLab instance, which is not visible to the public.
### <a name="ack"/> Acknowledgments
@@ -378,7 +362,7 @@ All other change types may be applied to all currently-supported releases.
* This product includes software developed by the OpenSSL Project for use
in the OpenSSL Toolkit.
[http://www.OpenSSL.org/](http://www.OpenSSL.org/)
[https://www.OpenSSL.org/](https://www.OpenSSL.org/)
* This product includes cryptographic software written by Eric Young
(eay@cryptsoft.com)
* This product includes software written by Tim Hudson (tjh@cryptsoft.com)
(eay@cryptsoft.com).
* This product includes software written by Tim Hudson (tjh@cryptsoft.com).

298
aclocal.m4 vendored
View File

@@ -1,298 +0,0 @@
# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])dnl PKG_PROG_PKG_CONFIG
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])dnl _PKG_CONFIG
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_INSTALLDIR
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
m4_include([m4/ax_check_openssl.m4])
m4_include([m4/ax_posix_shell.m4])
m4_include([m4/ax_pthread.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])

View File

@@ -1,13 +0,0 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# 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 http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# Run this script after modifying configure.in to generate configure
autoreconf -f -i

5
bin/Makefile.am Normal file
View File

@@ -0,0 +1,5 @@
SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen tests plugins
if HAVE_PKCS11
SUBDIRS += pkcs11
endif

View File

@@ -1,18 +0,0 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# 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 http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen \
@NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ tests
TARGETS =
@BIND9_MAKE_RULES@

34
bin/check/Makefile.am Normal file
View File

@@ -0,0 +1,34 @@
include $(top_srcdir)/Makefile.top
AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBNS_CFLAGS) \
$(LIBISCCFG_CFLAGS) \
$(LIBBIND9_CFLAGS)
AM_CPPFLAGS += \
-DNAMED_CONFFILE=\"${sysconfdir}/named.conf\"
noinst_LTLIBRARIES = libcheck-tool.la
libcheck_tool_la_SOURCES = \
check-tool.h \
check-tool.c
LDADD += \
libcheck-tool.la \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS) \
$(LIBNS_LIBS) \
$(LIBISCCFG_LIBS) \
$(LIBBIND9_LIBS)
bin_PROGRAMS = named-checkconf named-checkzone
install-exec-hook:
ln -f $(DESTDIR)$(bindir)/named-checkzone \
$(DESTDIR)$(bindir)/named-compilezone
uninstall-hook:
-rm -f $(DESTDIR)$(bindir)/named-compilezone

View File

@@ -1,102 +0,0 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# 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 http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${NS_INCLUDES} ${BIND9_INCLUDES} ${DNS_INCLUDES} ${ISCCFG_INCLUDES} \
${ISC_INCLUDES} @OPENSSL_INCLUDES@
CDEFINES = -DNAMED_CONFFILE=\"${sysconfdir}/named.conf\"
CWARNINGS =
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
NSLIBS = ../../lib/ns/libns.@A@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
NSDEPENDLIBS = ../../lib/ns/libns.@A@
LIBS = ${ISCLIBS} @LIBS@
NOSYMLIBS = ${ISCNOSYMLIBS} @LIBS@
SUBDIRS =
# Alphabetically
TARGETS = named-checkconf@EXEEXT@ named-checkzone@EXEEXT@
# Alphabetically
SRCS = named-checkconf.c named-checkzone.c check-tool.c
MANPAGES = named-checkconf.8 named-checkzone.8
HTMLPAGES = named-checkconf.html named-checkzone.html
MANOBJS = ${MANPAGES} ${HTMLPAGES}
@BIND9_MAKE_RULES@
named-checkconf.@O@: named-checkconf.c
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-c ${srcdir}/named-checkconf.c
named-checkzone.@O@: named-checkzone.c
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
-DVERSION=\"${VERSION}\" \
-c ${srcdir}/named-checkzone.c
named-checkconf@EXEEXT@: named-checkconf.@O@ check-tool.@O@ ${ISCDEPLIBS} \
${NSDEPENDLIBS} ${DNSDEPLIBS} ${ISCCFGDEPLIBS} ${BIND9DEPLIBS}
export BASEOBJS="named-checkconf.@O@ check-tool.@O@"; \
export LIBS0="${NSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} ${DNSLIBS}"; \
${FINALBUILDCMD}
named-checkzone@EXEEXT@: named-checkzone.@O@ check-tool.@O@ ${ISCDEPLIBS} \
${NSDEPENDLIBS} ${DNSDEPLIBS}
export BASEOBJS="named-checkzone.@O@ check-tool.@O@"; \
export LIBS0="${NSLIBS} ${ISCCFGLIBS} ${DNSLIBS}"; \
${FINALBUILDCMD}
doc man:: ${MANOBJS}
docclean manclean maintainer-clean::
rm -f ${MANOBJS}
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
install:: named-checkconf@EXEEXT@ named-checkzone@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkconf@EXEEXT@ ${DESTDIR}${sbindir}
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkzone@EXEEXT@ ${DESTDIR}${sbindir}
(cd ${DESTDIR}${sbindir}; rm -f named-compilezone@EXEEXT@; ${LINK_PROGRAM} named-checkzone@EXEEXT@ named-compilezone@EXEEXT@)
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8 || exit 1; done
(cd ${DESTDIR}${mandir}/man8; rm -f named-compilezone.8; ${LINK_PROGRAM} named-checkzone.8 named-compilezone.8)
uninstall::
rm -f ${DESTDIR}${mandir}/man8/named-compilezone.8
for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m || exit 1; done
rm -f ${DESTDIR}${sbindir}/named-compilezone@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-checkconf@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-checkzone@EXEEXT@
clean distclean::
rm -f ${TARGETS} r1.htm

View File

@@ -3,31 +3,23 @@
*
* 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 http://mozilla.org/MPL/2.0/.
* 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.
*/
/*! \file */
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <inttypes.h>
#ifdef _WIN32
#include <Winsock2.h>
#endif
#include "check-tool.h"
#include <isc/buffer.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/netdb.h>
#include <isc/net.h>
#include <isc/netdb.h>
#include <isc/print.h>
#include <isc/region.h>
#include <isc/stdio.h>
@@ -54,29 +46,31 @@
#include <ns/log.h>
#include "check-tool.h"
#ifndef CHECK_SIBLING
#define CHECK_SIBLING 1
#endif
#endif /* ifndef CHECK_SIBLING */
#ifndef CHECK_LOCAL
#define CHECK_LOCAL 1
#endif
#endif /* ifndef CHECK_LOCAL */
#define CHECK(r) \
do { \
result = (r); \
#define CHECK(r) \
do { \
result = (r); \
if (result != ISC_R_SUCCESS) \
goto cleanup; \
goto cleanup; \
} while (0)
#define ERR_IS_CNAME 1
#define ERR_NO_ADDRESSES 2
#define ERR_IS_CNAME 1
#define ERR_NO_ADDRESSES 2
#define ERR_LOOKUP_FAILURE 3
#define ERR_EXTRA_A 4
#define ERR_EXTRA_AAAA 5
#define ERR_MISSING_GLUE 5
#define ERR_IS_MXCNAME 6
#define ERR_IS_SRVCNAME 7
#define ERR_EXTRA_A 4
#define ERR_EXTRA_AAAA 5
#define ERR_MISSING_GLUE 5
#define ERR_IS_MXCNAME 6
#define ERR_IS_SRVCNAME 7
static const char *dbtype[] = { "rbt" };
@@ -87,31 +81,26 @@ bool nomerge = true;
bool docheckmx = true;
bool dochecksrv = true;
bool docheckns = true;
#else
#else /* if CHECK_LOCAL */
bool docheckmx = false;
bool dochecksrv = false;
bool docheckns = false;
#endif
dns_zoneopt_t zone_options = DNS_ZONEOPT_CHECKNS |
DNS_ZONEOPT_CHECKMX |
DNS_ZONEOPT_MANYERRORS |
DNS_ZONEOPT_CHECKNAMES |
#endif /* if CHECK_LOCAL */
dns_zoneopt_t zone_options = DNS_ZONEOPT_CHECKNS | DNS_ZONEOPT_CHECKMX |
DNS_ZONEOPT_MANYERRORS | DNS_ZONEOPT_CHECKNAMES |
DNS_ZONEOPT_CHECKINTEGRITY |
#if CHECK_SIBLING
DNS_ZONEOPT_CHECKSIBLING |
#endif
#endif /* if CHECK_SIBLING */
DNS_ZONEOPT_CHECKWILDCARD |
DNS_ZONEOPT_WARNMXCNAME |
DNS_ZONEOPT_WARNSRVCNAME;
DNS_ZONEOPT_WARNMXCNAME | DNS_ZONEOPT_WARNSRVCNAME;
/*
* This needs to match the list in bin/named/log.c.
*/
static isc_logcategory_t categories[] = {
{ "", 0 },
{ "unmatched", 0 },
{ NULL, 0 }
};
static isc_logcategory_t categories[] = { { "", 0 },
{ "unmatched", 0 },
{ NULL, 0 } };
static isc_symtab_t *symtab = NULL;
static isc_mem_t *sym_mctx;
@@ -129,46 +118,45 @@ add(char *key, int value) {
isc_symvalue_t symvalue;
if (sym_mctx == NULL) {
result = isc_mem_create(0, 0, &sym_mctx);
if (result != ISC_R_SUCCESS)
return;
isc_mem_create(&sym_mctx);
}
if (symtab == NULL) {
result = isc_symtab_create(sym_mctx, 100, freekey, sym_mctx,
false, &symtab);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
return;
}
}
key = isc_mem_strdup(sym_mctx, key);
if (key == NULL)
return;
symvalue.as_pointer = NULL;
result = isc_symtab_define(symtab, key, value, symvalue,
isc_symexists_reject);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
isc_mem_free(sym_mctx, key);
}
}
static bool
logged(char *key, int value) {
isc_result_t result;
if (symtab == NULL)
if (symtab == NULL) {
return (false);
}
result = isc_symtab_lookup(symtab, key, value, NULL);
if (result == ISC_R_SUCCESS)
if (result == ISC_R_SUCCESS) {
return (true);
}
return (false);
}
static bool
checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
dns_rdataset_t *a, dns_rdataset_t *aaaa)
{
dns_rdataset_t *a, dns_rdataset_t *aaaa) {
dns_rdataset_t *rdataset;
dns_rdata_t rdata = DNS_RDATA_INIT;
struct addrinfo hints, *ai, *cur;
@@ -186,8 +174,9 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
REQUIRE(aaaa == NULL || !dns_rdataset_isassociated(aaaa) ||
aaaa->type == dns_rdatatype_aaaa);
if (a == NULL || aaaa == NULL)
if (a == NULL || aaaa == NULL) {
return (answer);
}
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME;
@@ -214,16 +203,17 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
*/
cur = ai;
while (cur != NULL && cur->ai_canonname == NULL &&
cur->ai_next != NULL)
cur->ai_next != NULL) {
cur = cur->ai_next;
}
if (cur != NULL && cur->ai_canonname != NULL &&
strcasecmp(cur->ai_canonname, namebuf) != 0 &&
!logged(namebuf, ERR_IS_CNAME)) {
!logged(namebuf, ERR_IS_CNAME))
{
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/NS '%s' (out of zone) "
"is a CNAME '%s' (illegal)",
ownerbuf, namebuf,
cur->ai_canonname);
ownerbuf, namebuf, cur->ai_canonname);
/* XXX950 make fatal for 9.5.0 */
/* answer = false; */
add(namebuf, ERR_IS_CNAME);
@@ -232,7 +222,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
case EAI_NONAME:
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
case EAI_NODATA:
#endif
#endif /* if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME) */
if (!logged(namebuf, ERR_NO_ADDRESSES)) {
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/NS '%s' (out of zone) "
@@ -246,8 +236,8 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
dns_zone_log(zone, ISC_LOG_WARNING,
"getaddrinfo(%s) failed: %s",
namebuf, gai_strerror(result));
"getaddrinfo(%s) failed: %s", namebuf,
gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return (true);
@@ -256,15 +246,17 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
/*
* Check that all glue records really exist.
*/
if (!dns_rdataset_isassociated(a))
if (!dns_rdataset_isassociated(a)) {
goto checkaaaa;
}
result = dns_rdataset_first(a);
while (result == ISC_R_SUCCESS) {
dns_rdataset_current(a, &rdata);
match = false;
for (cur = ai; cur != NULL; cur = cur->ai_next) {
if (cur->ai_family != AF_INET)
if (cur->ai_family != AF_INET) {
continue;
}
ptr = &((struct sockaddr_in *)(cur->ai_addr))->sin_addr;
if (memcmp(ptr, rdata.data, rdata.length) == 0) {
match = true;
@@ -272,11 +264,12 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
}
}
if (!match && !logged(namebuf, ERR_EXTRA_A)) {
dns_zone_log(zone, ISC_LOG_ERROR, "%s/NS '%s' "
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/NS '%s' "
"extra GLUE A record (%s)",
ownerbuf, namebuf,
inet_ntop(AF_INET, rdata.data,
addrbuf, sizeof(addrbuf)));
inet_ntop(AF_INET, rdata.data, addrbuf,
sizeof(addrbuf)));
add(namebuf, ERR_EXTRA_A);
/* XXX950 make fatal for 9.5.0 */
/* answer = false; */
@@ -285,28 +278,32 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
result = dns_rdataset_next(a);
}
checkaaaa:
if (!dns_rdataset_isassociated(aaaa))
checkaaaa:
if (!dns_rdataset_isassociated(aaaa)) {
goto checkmissing;
}
result = dns_rdataset_first(aaaa);
while (result == ISC_R_SUCCESS) {
dns_rdataset_current(aaaa, &rdata);
match = false;
for (cur = ai; cur != NULL; cur = cur->ai_next) {
if (cur->ai_family != AF_INET6)
if (cur->ai_family != AF_INET6) {
continue;
ptr = &((struct sockaddr_in6 *)(cur->ai_addr))->sin6_addr;
}
ptr = &((struct sockaddr_in6 *)(cur->ai_addr))
->sin6_addr;
if (memcmp(ptr, rdata.data, rdata.length) == 0) {
match = true;
break;
}
}
if (!match && !logged(namebuf, ERR_EXTRA_AAAA)) {
dns_zone_log(zone, ISC_LOG_ERROR, "%s/NS '%s' "
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/NS '%s' "
"extra GLUE AAAA record (%s)",
ownerbuf, namebuf,
inet_ntop(AF_INET6, rdata.data,
addrbuf, sizeof(addrbuf)));
inet_ntop(AF_INET6, rdata.data, addrbuf,
sizeof(addrbuf)));
add(namebuf, ERR_EXTRA_AAAA);
/* XXX950 make fatal for 9.5.0. */
/* answer = false; */
@@ -315,7 +312,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
result = dns_rdataset_next(aaaa);
}
checkmissing:
checkmissing:
/*
* Check that all addresses appear in the glue.
*/
@@ -325,42 +322,50 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
switch (cur->ai_family) {
case AF_INET:
rdataset = a;
ptr = &((struct sockaddr_in *)(cur->ai_addr))->sin_addr;
ptr = &((struct sockaddr_in *)(cur->ai_addr))
->sin_addr;
type = "A";
break;
case AF_INET6:
rdataset = aaaa;
ptr = &((struct sockaddr_in6 *)(cur->ai_addr))->sin6_addr;
ptr = &((struct sockaddr_in6 *)(cur->ai_addr))
->sin6_addr;
type = "AAAA";
break;
default:
continue;
continue;
}
match = false;
if (dns_rdataset_isassociated(rdataset))
if (dns_rdataset_isassociated(rdataset)) {
result = dns_rdataset_first(rdataset);
else
} else {
result = ISC_R_FAILURE;
}
while (result == ISC_R_SUCCESS && !match) {
dns_rdataset_current(rdataset, &rdata);
if (memcmp(ptr, rdata.data, rdata.length) == 0)
{
match = true;
}
dns_rdata_reset(&rdata);
result = dns_rdataset_next(rdataset);
}
if (!match) {
dns_zone_log(zone, ISC_LOG_ERROR, "%s/NS '%s' "
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/NS '%s' "
"missing GLUE %s record (%s)",
ownerbuf, namebuf, type,
inet_ntop(cur->ai_family, ptr,
addrbuf, sizeof(addrbuf)));
addrbuf,
sizeof(addrbuf)));
/* XXX950 make fatal for 9.5.0. */
/* answer = false; */
missing_glue = true;
}
}
if (missing_glue)
if (missing_glue) {
add(namebuf, ERR_MISSING_GLUE);
}
}
freeaddrinfo(ai);
return (answer);
@@ -400,12 +405,15 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
*/
cur = ai;
while (cur != NULL && cur->ai_canonname == NULL &&
cur->ai_next != NULL)
cur->ai_next != NULL) {
cur = cur->ai_next;
}
if (cur != NULL && cur->ai_canonname != NULL &&
strcasecmp(cur->ai_canonname, namebuf) != 0) {
if ((zone_options & DNS_ZONEOPT_WARNMXCNAME) != 0)
strcasecmp(cur->ai_canonname, namebuf) != 0)
{
if ((zone_options & DNS_ZONEOPT_WARNMXCNAME) != 0) {
level = ISC_LOG_WARNING;
}
if ((zone_options & DNS_ZONEOPT_IGNOREMXCNAME) == 0) {
if (!logged(namebuf, ERR_IS_MXCNAME)) {
dns_zone_log(zone, level,
@@ -416,8 +424,9 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
cur->ai_canonname);
add(namebuf, ERR_IS_MXCNAME);
}
if (level == ISC_LOG_ERROR)
if (level == ISC_LOG_ERROR) {
answer = false;
}
}
}
freeaddrinfo(ai);
@@ -426,7 +435,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
case EAI_NONAME:
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
case EAI_NODATA:
#endif
#endif /* if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME) */
if (!logged(namebuf, ERR_NO_ADDRESSES)) {
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/MX '%s' (out of zone) "
@@ -440,8 +449,8 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
dns_zone_log(zone, ISC_LOG_WARNING,
"getaddrinfo(%s) failed: %s",
namebuf, gai_strerror(result));
"getaddrinfo(%s) failed: %s", namebuf,
gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return (true);
@@ -482,23 +491,28 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
*/
cur = ai;
while (cur != NULL && cur->ai_canonname == NULL &&
cur->ai_next != NULL)
cur->ai_next != NULL) {
cur = cur->ai_next;
}
if (cur != NULL && cur->ai_canonname != NULL &&
strcasecmp(cur->ai_canonname, namebuf) != 0) {
if ((zone_options & DNS_ZONEOPT_WARNSRVCNAME) != 0)
strcasecmp(cur->ai_canonname, namebuf) != 0)
{
if ((zone_options & DNS_ZONEOPT_WARNSRVCNAME) != 0) {
level = ISC_LOG_WARNING;
}
if ((zone_options & DNS_ZONEOPT_IGNORESRVCNAME) == 0) {
if (!logged(namebuf, ERR_IS_SRVCNAME)) {
dns_zone_log(zone, level, "%s/SRV '%s'"
dns_zone_log(zone, level,
"%s/SRV '%s'"
" (out of zone) is a "
"CNAME '%s' (illegal)",
ownerbuf, namebuf,
cur->ai_canonname);
add(namebuf, ERR_IS_SRVCNAME);
}
if (level == ISC_LOG_ERROR)
if (level == ISC_LOG_ERROR) {
answer = false;
}
}
}
freeaddrinfo(ai);
@@ -507,7 +521,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
case EAI_NONAME:
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
case EAI_NODATA:
#endif
#endif /* if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME) */
if (!logged(namebuf, ERR_NO_ADDRESSES)) {
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/SRV '%s' (out of zone) "
@@ -521,8 +535,8 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
dns_zone_log(zone, ISC_LOG_WARNING,
"getaddrinfo(%s) failed: %s",
namebuf, gai_strerror(result));
"getaddrinfo(%s) failed: %s", namebuf,
gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return (true);
@@ -535,7 +549,7 @@ setup_logging(isc_mem_t *mctx, FILE *errout, isc_log_t **logp) {
isc_logconfig_t *logconfig = NULL;
isc_log_t *log = NULL;
RUNTIME_CHECK(isc_log_create(mctx, &log, &logconfig) == ISC_R_SUCCESS);
isc_log_create(mctx, &log, &logconfig);
isc_log_registercategories(log, categories);
isc_log_setcontext(log);
dns_log_init(log);
@@ -547,12 +561,11 @@ setup_logging(isc_mem_t *mctx, FILE *errout, isc_log_t **logp) {
destination.file.name = NULL;
destination.file.versions = ISC_LOG_ROLLNEVER;
destination.file.maximum_size = 0;
RUNTIME_CHECK(isc_log_createchannel(logconfig, "stderr",
ISC_LOG_TOFILEDESC,
ISC_LOG_DYNAMIC,
&destination, 0) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_log_usechannel(logconfig, "stderr",
NULL, NULL) == ISC_R_SUCCESS);
isc_log_createchannel(logconfig, "stderr", ISC_LOG_TOFILEDESC,
ISC_LOG_DYNAMIC, &destination, 0);
RUNTIME_CHECK(isc_log_usechannel(logconfig, "stderr", NULL, NULL) ==
ISC_R_SUCCESS);
*logp = log;
return (ISC_R_SUCCESS);
@@ -579,18 +592,20 @@ check_ttls(dns_zone_t *zone, dns_ttl_t maxttl) {
CHECK(dns_db_newversion(db, &version));
CHECK(dns_db_createiterator(db, 0, &dbiter));
for (result = dns_dbiterator_first(dbiter);
result == ISC_R_SUCCESS;
result = dns_dbiterator_next(dbiter)) {
for (result = dns_dbiterator_first(dbiter); result == ISC_R_SUCCESS;
result = dns_dbiterator_next(dbiter))
{
result = dns_dbiterator_current(dbiter, &node, name);
if (result == DNS_R_NEWORIGIN)
if (result == DNS_R_NEWORIGIN) {
result = ISC_R_SUCCESS;
}
CHECK(result);
CHECK(dns_db_allrdatasets(db, node, version, 0, &rdsiter));
for (result = dns_rdatasetiter_first(rdsiter);
result == ISC_R_SUCCESS;
result = dns_rdatasetiter_next(rdsiter)) {
result = dns_rdatasetiter_next(rdsiter))
{
dns_rdatasetiter_current(rdsiter, &rdataset);
if (rdataset.ttl > maxttl) {
char nbuf[DNS_NAME_FORMATSIZE];
@@ -613,28 +628,35 @@ check_ttls(dns_zone_t *zone, dns_ttl_t maxttl) {
}
dns_rdataset_disassociate(&rdataset);
}
if (result == ISC_R_NOMORE)
if (result == ISC_R_NOMORE) {
result = ISC_R_SUCCESS;
}
CHECK(result);
dns_rdatasetiter_destroy(&rdsiter);
dns_db_detachnode(db, &node);
}
if (result == ISC_R_NOMORE)
if (result == ISC_R_NOMORE) {
result = ISC_R_SUCCESS;
}
cleanup:
if (node != NULL)
cleanup:
if (node != NULL) {
dns_db_detachnode(db, &node);
if (rdsiter != NULL)
}
if (rdsiter != NULL) {
dns_rdatasetiter_destroy(&rdsiter);
if (dbiter != NULL)
}
if (dbiter != NULL) {
dns_dbiterator_destroy(&dbiter);
if (version != NULL)
}
if (version != NULL) {
dns_db_closeversion(db, &version, false);
if (db != NULL)
}
if (db != NULL) {
dns_db_detach(&db);
}
return (result);
}
@@ -643,8 +665,7 @@ check_ttls(dns_zone_t *zone, dns_ttl_t maxttl) {
isc_result_t
load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
dns_masterformat_t fileformat, const char *classname,
dns_ttl_t maxttl, dns_zone_t **zonep)
{
dns_ttl_t maxttl, dns_zone_t **zonep) {
isc_result_t result;
dns_rdataclass_t rdclass;
isc_textregion_t region;
@@ -655,9 +676,10 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
REQUIRE(zonep == NULL || *zonep == NULL);
if (debug)
if (debug) {
fprintf(stderr, "loading \"%s\" from \"%s\" class \"%s\"\n",
zonename, filename, classname);
}
CHECK(dns_zone_create(&zone, mctx));
@@ -668,11 +690,17 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
origin = dns_fixedname_initname(&fixorigin);
CHECK(dns_name_fromtext(origin, &buffer, dns_rootname, 0, NULL));
CHECK(dns_zone_setorigin(zone, origin));
CHECK(dns_zone_setdbtype(zone, 1, (const char * const *) dbtype));
CHECK(dns_zone_setfile(zone, filename, fileformat,
&dns_master_style_default));
if (journal != NULL)
dns_zone_setdbtype(zone, 1, (const char *const *)dbtype);
if (strcmp(filename, "-") == 0) {
CHECK(dns_zone_setstream(zone, stdin, fileformat,
&dns_master_style_default));
} else {
CHECK(dns_zone_setfile(zone, filename, fileformat,
&dns_master_style_default));
}
if (journal != NULL) {
CHECK(dns_zone_setjournal(zone, journal));
}
DE_CONST(classname, region.base);
region.length = strlen(classname);
@@ -684,12 +712,15 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
dns_zone_setmaxttl(zone, maxttl);
if (docheckmx)
if (docheckmx) {
dns_zone_setcheckmx(zone, checkmx);
if (docheckns)
}
if (docheckns) {
dns_zone_setcheckns(zone, checkns);
if (dochecksrv)
}
if (dochecksrv) {
dns_zone_setchecksrv(zone, checksrv);
}
CHECK(dns_zone_load(zone, false));
@@ -706,9 +737,10 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
zone = NULL;
}
cleanup:
if (zone != NULL)
cleanup:
if (zone != NULL) {
dns_zone_detach(&zone);
}
return (result);
}
@@ -716,58 +748,39 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
isc_result_t
dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
dns_masterformat_t fileformat, const dns_master_style_t *style,
const uint32_t rawversion)
{
const uint32_t rawversion) {
isc_result_t result;
FILE *output = stdout;
const char *flags;
flags = (fileformat == dns_masterformat_text) ? "w+" : "wb+";
flags = (fileformat == dns_masterformat_text) ? "w" : "wb";
if (debug) {
if (filename != NULL && strcmp(filename, "-") != 0)
fprintf(stderr, "dumping \"%s\" to \"%s\"\n",
zonename, filename);
else
if (filename != NULL && strcmp(filename, "-") != 0) {
fprintf(stderr, "dumping \"%s\" to \"%s\"\n", zonename,
filename);
} else {
fprintf(stderr, "dumping \"%s\"\n", zonename);
}
}
if (filename != NULL && strcmp(filename, "-") != 0) {
result = isc_stdio_open(filename, flags, &output);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "could not open output "
"file \"%s\" for writing\n", filename);
fprintf(stderr,
"could not open output "
"file \"%s\" for writing\n",
filename);
return (ISC_R_FAILURE);
}
}
result = dns_zone_dumptostream(zone, output, fileformat, style,
rawversion);
if (output != stdout)
if (output != stdout) {
(void)isc_stdio_close(output);
}
return (result);
}
#ifdef _WIN32
void
InitSockets(void) {
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD(2, 0);
err = WSAStartup( wVersionRequested, &wsaData );
if (err != 0) {
fprintf(stderr, "WSAStartup() failed: %d\n", err);
exit(1);
}
}
void
DestroySockets(void) {
WSACleanup();
}
#endif

View File

@@ -3,13 +3,12 @@
*
* 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 http://mozilla.org/MPL/2.0/.
* 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.
*/
#ifndef CHECK_TOOL_H
#define CHECK_TOOL_H
@@ -41,11 +40,6 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
dns_masterformat_t fileformat, const dns_master_style_t *style,
const uint32_t rawversion);
#ifdef _WIN32
void InitSockets(void);
void DestroySockets(void);
#endif
extern int debug;
extern const char *journal;
extern bool nomerge;
@@ -56,4 +50,4 @@ extern dns_zoneopt_t zone_options;
ISC_LANG_ENDDECLS
#endif
#endif /* ifndef CHECK_TOOL_H */

View File

@@ -1,140 +0,0 @@
.\" Copyright (C) 2000-2002, 2004, 2005, 2007, 2009, 2014-2016, 2018 Internet Systems Consortium, Inc. ("ISC")
.\"
.\" 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 http://mozilla.org/MPL/2.0/.
.\"
.hy 0
.ad l
'\" t
.\" Title: named-checkconf
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 2014-01-10
.\" Manual: BIND9
.\" Source: ISC
.\" Language: English
.\"
.TH "NAMED\-CHECKCONF" "8" "2014\-01\-10" "ISC" "BIND9"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
named-checkconf \- named configuration file syntax checking tool
.SH "SYNOPSIS"
.HP \w'\fBnamed\-checkconf\fR\ 'u
\fBnamed\-checkconf\fR [\fB\-hjlvz\fR] [\fB\-p\fR\ [\fB\-x\fR\ ]] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] {filename}
.SH "DESCRIPTION"
.PP
\fBnamed\-checkconf\fR
checks the syntax, but not the semantics, of a
\fBnamed\fR
configuration file\&. The file is parsed and checked for syntax errors, along with all files included by it\&. If no file is specified,
/etc/named\&.conf
is read by default\&.
.PP
Note: files that
\fBnamed\fR
reads in separate parser contexts, such as
rndc\&.key
and
bind\&.keys, are not automatically read by
\fBnamed\-checkconf\fR\&. Configuration errors in these files may cause
\fBnamed\fR
to fail to run, even if
\fBnamed\-checkconf\fR
was successful\&.
\fBnamed\-checkconf\fR
can be run on these files explicitly, however\&.
.SH "OPTIONS"
.PP
\-h
.RS 4
Print the usage summary and exit\&.
.RE
.PP
\-j
.RS 4
When loading a zonefile read the journal if it exists\&.
.RE
.PP
\-l
.RS 4
List all the configured zones\&. Each line of output contains the zone name, class (e\&.g\&. IN), view, and type (e\&.g\&. master or slave)\&.
.RE
.PP
\-p
.RS 4
Print out the
named\&.conf
and included files in canonical form if no errors were detected\&. See also the
\fB\-x\fR
option\&.
.RE
.PP
\-t \fIdirectory\fR
.RS 4
Chroot to
directory
so that include directives in the configuration file are processed as if run by a similarly chrooted
\fBnamed\fR\&.
.RE
.PP
\-v
.RS 4
Print the version of the
\fBnamed\-checkconf\fR
program and exit\&.
.RE
.PP
\-x
.RS 4
When printing the configuration files in canonical form, obscure shared secrets by replacing them with strings of question marks (\*(Aq?\*(Aq)\&. This allows the contents of
named\&.conf
and related files to be shared \(em for example, when submitting bug reports \(em without compromising private data\&. This option cannot be used without
\fB\-p\fR\&.
.RE
.PP
\-z
.RS 4
Perform a test load of all master zones found in
named\&.conf\&.
.RE
.PP
filename
.RS 4
The name of the configuration file to be checked\&. If not specified, it defaults to
/etc/named\&.conf\&.
.RE
.SH "RETURN VALUES"
.PP
\fBnamed\-checkconf\fR
returns an exit status of 1 if errors were detected and 0 otherwise\&.
.SH "SEE ALSO"
.PP
\fBnamed\fR(8),
\fBnamed-checkzone\fR(8),
BIND 9 Administrator Reference Manual\&.
.SH "AUTHOR"
.PP
\fBInternet Systems Consortium, Inc\&.\fR
.SH "COPYRIGHT"
.br
Copyright \(co 2000-2002, 2004, 2005, 2007, 2009, 2014-2016, 2018 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -3,22 +3,20 @@
*
* 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 http://mozilla.org/MPL/2.0/.
* 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.
*/
/*! \file */
#include <config.h>
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <isc/attributes.h>
#include <isc/commandline.h>
#include <isc/dir.h>
#include <isc/hash.h>
@@ -29,10 +27,6 @@
#include <isc/string.h>
#include <isc/util.h>
#include <isccfg/namedconf.h>
#include <bind9/check.h>
#include <dns/db.h>
#include <dns/fixedname.h>
#include <dns/log.h>
@@ -42,27 +36,36 @@
#include <dns/rootns.h>
#include <dns/zone.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
#include <bind9/check.h>
#include "check-tool.h"
static const char *program = "named-checkconf";
static bool loadplugins = true;
isc_log_t *logc = NULL;
#define CHECK(r)\
do { \
result = (r); \
#define CHECK(r) \
do { \
result = (r); \
if (result != ISC_R_SUCCESS) \
goto cleanup; \
goto cleanup; \
} while (0)
/*% usage */
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_NORETURN static void
usage(void);
static void
usage(void) {
fprintf(stderr, "usage: %s [-hjlvz] [-p [-x]] [-t directory] "
"[named.conf]\n", program);
fprintf(stderr,
"usage: %s [-chijlvz] [-p [-x]] [-t directory] "
"[named.conf]\n",
program);
exit(1);
}
@@ -84,8 +87,8 @@ directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
result = isc_dir_chdir(directory);
if (result != ISC_R_SUCCESS) {
cfg_obj_log(obj, logc, ISC_LOG_ERROR,
"change directory to '%s' failed: %s\n",
directory, isc_result_totext(result));
"change directory to '%s' failed: %s\n", directory,
isc_result_totext(result));
return (result);
}
@@ -96,10 +99,12 @@ static bool
get_maps(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
int i;
for (i = 0;; i++) {
if (maps[i] == NULL)
if (maps[i] == NULL) {
return (false);
if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS)
}
if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS) {
return (true);
}
}
}
@@ -113,25 +118,26 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
int i;
for (i = 0;; i++) {
if (maps[i] == NULL)
if (maps[i] == NULL) {
return (false);
}
checknames = NULL;
result = cfg_map_get(maps[i], "check-names", &checknames);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
continue;
}
if (checknames != NULL && !cfg_obj_islist(checknames)) {
*obj = checknames;
return (true);
}
for (element = cfg_list_first(checknames);
element != NULL;
element = cfg_list_next(element)) {
for (element = cfg_list_first(checknames); element != NULL;
element = cfg_list_next(element))
{
value = cfg_listelt_value(element);
type = cfg_tuple_get(value, "type");
if ((strcasecmp(cfg_obj_asstring(type),
"primary") != 0) &&
(strcasecmp(cfg_obj_asstring(type),
"master") != 0))
if ((strcasecmp(cfg_obj_asstring(type), "primary") !=
0) &&
(strcasecmp(cfg_obj_asstring(type), "master") != 0))
{
continue;
}
@@ -148,18 +154,21 @@ configure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
dns_rdataclass_t rdclass;
isc_textregion_t r;
if (zfile == NULL)
if (zfile == NULL) {
return (ISC_R_FAILURE);
}
DE_CONST(zclass, r.base);
r.length = strlen(zclass);
result = dns_rdataclass_fromtext(&rdclass, &r);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
return (result);
}
result = dns_rootns_create(mctx, rdclass, zfile, &db);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
return (result);
}
dns_db_detach(&db);
return (ISC_R_SUCCESS);
@@ -167,17 +176,16 @@ configure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
/*% configure the zone */
static isc_result_t
configure_zone(const char *vclass, const char *view,
const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
const cfg_obj_t *config, isc_mem_t *mctx, bool list)
{
configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, const cfg_obj_t *config,
isc_mem_t *mctx, bool list) {
int i = 0;
isc_result_t result;
const char *zclass;
const char *zname;
const char *zfile = NULL;
const cfg_obj_t *maps[4];
const cfg_obj_t *mastersobj = NULL;
const cfg_obj_t *primariesobj = NULL;
const cfg_obj_t *inviewobj = NULL;
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *classobj = NULL;
@@ -194,19 +202,22 @@ configure_zone(const char *vclass, const char *view,
zname = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
classobj = cfg_tuple_get(zconfig, "class");
if (!cfg_obj_isstring(classobj))
if (!cfg_obj_isstring(classobj)) {
zclass = vclass;
else
} else {
zclass = cfg_obj_asstring(classobj);
}
zoptions = cfg_tuple_get(zconfig, "options");
maps[i++] = zoptions;
if (vconfig != NULL)
if (vconfig != NULL) {
maps[i++] = cfg_tuple_get(vconfig, "options");
}
if (config != NULL) {
cfg_map_get(config, "options", &obj);
if (obj != NULL)
if (obj != NULL) {
maps[i++] = obj;
}
}
maps[i] = NULL;
@@ -215,12 +226,14 @@ configure_zone(const char *vclass, const char *view,
const char *inview = cfg_obj_asstring(inviewobj);
printf("%s %s %s in-view %s\n", zname, zclass, view, inview);
}
if (inviewobj != NULL)
if (inviewobj != NULL) {
return (ISC_R_SUCCESS);
}
cfg_map_get(zoptions, "type", &typeobj);
if (typeobj == NULL)
if (typeobj == NULL) {
return (ISC_R_FAILURE);
}
if (list) {
const char *ztype = cfg_obj_asstring(typeobj);
@@ -232,18 +245,21 @@ configure_zone(const char *vclass, const char *view,
* Skip checks when using an alternate data source.
*/
cfg_map_get(zoptions, "database", &dbobj);
if (dbobj != NULL &&
strcmp("rbt", cfg_obj_asstring(dbobj)) != 0 &&
if (dbobj != NULL && strcmp("rbt", cfg_obj_asstring(dbobj)) != 0 &&
strcmp("rbt64", cfg_obj_asstring(dbobj)) != 0)
{
return (ISC_R_SUCCESS);
}
cfg_map_get(zoptions, "dlz", &dlzobj);
if (dlzobj != NULL)
if (dlzobj != NULL) {
return (ISC_R_SUCCESS);
}
cfg_map_get(zoptions, "file", &fileobj);
if (fileobj != NULL)
if (fileobj != NULL) {
zfile = cfg_obj_asstring(fileobj);
}
/*
* Check hints files for hint zones.
@@ -263,13 +279,19 @@ configure_zone(const char *vclass, const char *view,
* Is the redirect zone configured as a slave?
*/
if (strcasecmp(cfg_obj_asstring(typeobj), "redirect") == 0) {
cfg_map_get(zoptions, "masters", &mastersobj);
if (mastersobj != NULL)
cfg_map_get(zoptions, "primaries", &primariesobj);
if (primariesobj == NULL) {
cfg_map_get(zoptions, "masters", &primariesobj);
}
if (primariesobj != NULL) {
return (ISC_R_SUCCESS);
}
}
if (zfile == NULL)
if (zfile == NULL) {
return (ISC_R_FAILURE);
}
obj = NULL;
if (get_maps(maps, "check-dup-records", &obj)) {
@@ -313,12 +335,14 @@ configure_zone(const char *vclass, const char *view,
obj = NULL;
if (get_maps(maps, "check-integrity", &obj)) {
if (cfg_obj_asboolean(obj))
if (cfg_obj_asboolean(obj)) {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
else
} else {
zone_options &= ~DNS_ZONEOPT_CHECKINTEGRITY;
} else
}
} else {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
}
obj = NULL;
if (get_maps(maps, "check-mx-cname", &obj)) {
@@ -362,10 +386,11 @@ configure_zone(const char *vclass, const char *view,
obj = NULL;
if (get_maps(maps, "check-sibling", &obj)) {
if (cfg_obj_asboolean(obj))
if (cfg_obj_asboolean(obj)) {
zone_options |= DNS_ZONEOPT_CHECKSIBLING;
else
} else {
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
}
}
obj = NULL;
@@ -398,8 +423,8 @@ configure_zone(const char *vclass, const char *view,
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKNAMES;
zone_options |= DNS_ZONEOPT_CHECKNAMESFAIL;
zone_options |= DNS_ZONEOPT_CHECKNAMES;
zone_options |= DNS_ZONEOPT_CHECKNAMESFAIL;
}
masterformat = dns_masterformat_text;
@@ -420,23 +445,23 @@ configure_zone(const char *vclass, const char *view,
obj = NULL;
if (get_maps(maps, "max-zone-ttl", &obj)) {
maxttl = cfg_obj_asuint32(obj);
maxttl = cfg_obj_asduration(obj);
zone_options |= DNS_ZONEOPT_CHECKTTL;
}
result = load_zone(mctx, zname, zfile, masterformat,
zclass, maxttl, NULL);
if (result != ISC_R_SUCCESS)
result = load_zone(mctx, zname, zfile, masterformat, zclass, maxttl,
NULL);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "%s/%s/%s: %s\n", view, zname, zclass,
dns_result_totext(result));
}
return (result);
}
/*% configure a view */
static isc_result_t
configure_view(const char *vclass, const char *view, const cfg_obj_t *config,
const cfg_obj_t *vconfig, isc_mem_t *mctx, bool list)
{
const cfg_obj_t *vconfig, isc_mem_t *mctx, bool list) {
const cfg_listelt_t *element;
const cfg_obj_t *voptions;
const cfg_obj_t *zonelist;
@@ -444,32 +469,33 @@ configure_view(const char *vclass, const char *view, const cfg_obj_t *config,
isc_result_t tresult;
voptions = NULL;
if (vconfig != NULL)
if (vconfig != NULL) {
voptions = cfg_tuple_get(vconfig, "options");
}
zonelist = NULL;
if (voptions != NULL)
if (voptions != NULL) {
(void)cfg_map_get(voptions, "zone", &zonelist);
else
} else {
(void)cfg_map_get(config, "zone", &zonelist);
}
for (element = cfg_list_first(zonelist);
element != NULL;
for (element = cfg_list_first(zonelist); element != NULL;
element = cfg_list_next(element))
{
const cfg_obj_t *zconfig = cfg_listelt_value(element);
tresult = configure_zone(vclass, view, zconfig, vconfig,
config, mctx, list);
if (tresult != ISC_R_SUCCESS)
tresult = configure_zone(vclass, view, zconfig, vconfig, config,
mctx, list);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
}
return (result);
}
static isc_result_t
config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
dns_rdataclass_t *classp)
{
dns_rdataclass_t *classp) {
isc_textregion_t r;
if (!cfg_obj_isstring(classobj)) {
@@ -484,8 +510,7 @@ config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
/*% load zones from the configuration */
static isc_result_t
load_zones_fromconfig(const cfg_obj_t *config, isc_mem_t *mctx,
bool list_zones)
{
bool list_zones) {
const cfg_listelt_t *element;
const cfg_obj_t *views;
const cfg_obj_t *vconfig;
@@ -495,8 +520,7 @@ load_zones_fromconfig(const cfg_obj_t *config, isc_mem_t *mctx,
views = NULL;
(void)cfg_map_get(config, "view", &views);
for (element = cfg_list_first(views);
element != NULL;
for (element = cfg_list_first(views); element != NULL;
element = cfg_list_next(element))
{
const cfg_obj_t *classobj;
@@ -505,28 +529,36 @@ load_zones_fromconfig(const cfg_obj_t *config, isc_mem_t *mctx,
char buf[sizeof("CLASS65535")];
vconfig = cfg_listelt_value(element);
if (vconfig == NULL)
if (vconfig == NULL) {
continue;
}
classobj = cfg_tuple_get(vconfig, "class");
CHECK(config_getclass(classobj, dns_rdataclass_in,
&viewclass));
if (dns_rdataclass_ismeta(viewclass))
tresult = config_getclass(classobj, dns_rdataclass_in,
&viewclass);
if (tresult != ISC_R_SUCCESS) {
CHECK(tresult);
}
if (dns_rdataclass_ismeta(viewclass)) {
CHECK(ISC_R_FAILURE);
}
dns_rdataclass_format(viewclass, buf, sizeof(buf));
vname = cfg_obj_asstring(cfg_tuple_get(vconfig, "name"));
tresult = configure_view(buf, vname, config, vconfig, mctx,
list_zones);
if (tresult != ISC_R_SUCCESS)
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
}
if (views == NULL) {
tresult = configure_view("IN", "_default", config, NULL, mctx,
list_zones);
if (tresult != ISC_R_SUCCESS)
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
}
cleanup:
@@ -555,6 +587,7 @@ main(int argc, char **argv) {
bool load_zones = false;
bool list_zones = false;
bool print = false;
bool nodeprecate = false;
unsigned int flags = 0;
isc_commandline_errprint = false;
@@ -562,20 +595,22 @@ main(int argc, char **argv) {
/*
* Process memory debugging argument first.
*/
#define CMDLINE_FLAGS "dhjlm:t:pvxz"
#define CMDLINE_FLAGS "cdhijlm:t:pvxz"
while ((c = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (c) {
case 'm':
if (strcasecmp(isc_commandline_argument, "record") == 0)
{
isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
}
if (strcasecmp(isc_commandline_argument, "trace") == 0)
{
isc_mem_debugging |= ISC_MEM_DEBUGTRACE;
}
if (strcasecmp(isc_commandline_argument, "usage") == 0)
{
isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
if (strcasecmp(isc_commandline_argument, "size") == 0)
isc_mem_debugging |= ISC_MEM_DEBUGSIZE;
if (strcasecmp(isc_commandline_argument, "mctx") == 0)
isc_mem_debugging |= ISC_MEM_DEBUGCTX;
}
break;
default:
break;
@@ -583,14 +618,22 @@ main(int argc, char **argv) {
}
isc_commandline_reset = true;
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
isc_mem_create(&mctx);
while ((c = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != EOF) {
switch (c) {
case 'c':
loadplugins = false;
break;
case 'd':
debug++;
break;
case 'i':
nodeprecate = true;
break;
case 'j':
nomerge = false;
break;
@@ -616,7 +659,7 @@ main(int argc, char **argv) {
break;
case 'v':
printf(VERSION "\n");
printf("%s\n", PACKAGE_VERSION);
exit(0);
case 'x':
@@ -631,16 +674,17 @@ main(int argc, char **argv) {
break;
case '?':
if (isc_commandline_option != '?')
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
/* FALLTHROUGH */
}
/* FALLTHROUGH */
case 'h':
usage();
default:
fprintf(stderr, "%s: unhandled option -%c\n",
program, isc_commandline_option);
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
exit(1);
}
}
@@ -654,16 +698,15 @@ main(int argc, char **argv) {
exit(1);
}
if (isc_commandline_index + 1 < argc)
if (isc_commandline_index + 1 < argc) {
usage();
if (argv[isc_commandline_index] != NULL)
}
if (argv[isc_commandline_index] != NULL) {
conffile = argv[isc_commandline_index];
if (conffile == NULL || conffile[0] == '\0')
}
if (conffile == NULL || conffile[0] == '\0') {
conffile = NAMED_CONFFILE;
#ifdef _WIN32
InitSockets();
#endif
}
RUNTIME_CHECK(setup_logging(mctx, stdout, &logc) == ISC_R_SUCCESS);
@@ -671,37 +714,39 @@ main(int argc, char **argv) {
RUNTIME_CHECK(cfg_parser_create(mctx, logc, &parser) == ISC_R_SUCCESS);
if (nodeprecate) {
cfg_parser_setflags(parser, CFG_PCTX_NODEPRECATED, true);
}
cfg_parser_setcallback(parser, directory_callback, NULL);
if (cfg_parse_file(parser, conffile, &cfg_type_namedconf, &config) !=
ISC_R_SUCCESS)
{
exit(1);
}
result = bind9_check_namedconf(config, logc, mctx);
if (result != ISC_R_SUCCESS)
result = bind9_check_namedconf(config, loadplugins, logc, mctx);
if (result != ISC_R_SUCCESS) {
exit_status = 1;
}
if (result == ISC_R_SUCCESS && (load_zones || list_zones)) {
result = load_zones_fromconfig(config, mctx, list_zones);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
exit_status = 1;
}
}
if (print && exit_status == 0)
if (print && exit_status == 0) {
cfg_printx(config, flags, output, NULL);
}
cfg_obj_destroy(parser, &config);
cfg_parser_destroy(&parser);
dns_name_destroy();
isc_log_destroy(&logc);
isc_mem_destroy(&mctx);
#ifdef _WIN32
DestroySockets();
#endif
return (exit_status);
}

View File

@@ -1,207 +0,0 @@
<!DOCTYPE book [
<!ENTITY mdash "&#8212;">]>
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- 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 http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
<!-- Converted by db4-upgrade version 1.0 -->
<refentry xmlns:db="http://docbook.org/ns/docbook" version="5.0" xml:id="man.named-checkconf">
<info>
<date>2014-01-10</date>
</info>
<refentryinfo>
<corpname>ISC</corpname>
<corpauthor>Internet Systems Consortium, Inc.</corpauthor>
</refentryinfo>
<refmeta>
<refentrytitle><application>named-checkconf</application></refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
<docinfo>
<copyright>
<year>2000</year>
<year>2001</year>
<year>2002</year>
<year>2004</year>
<year>2005</year>
<year>2007</year>
<year>2009</year>
<year>2014</year>
<year>2015</year>
<year>2016</year>
<year>2018</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
<refnamediv>
<refname><application>named-checkconf</application></refname>
<refpurpose>named configuration file syntax checking tool</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis sepchar=" ">
<command>named-checkconf</command>
<arg choice="opt" rep="norepeat"><option>-hjlvz</option></arg>
<arg choice="opt" rep="norepeat"><option>-p</option>
<arg choice="opt" rep="norepeat"><option>-x</option>
</arg></arg>
<arg choice="opt" rep="norepeat"><option>-t <replaceable class="parameter">directory</replaceable></option></arg>
<arg choice="req" rep="norepeat">filename</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsection><info><title>DESCRIPTION</title></info>
<para><command>named-checkconf</command>
checks the syntax, but not the semantics, of a
<command>named</command> configuration file. The file is parsed
and checked for syntax errors, along with all files included by it.
If no file is specified, <filename>/etc/named.conf</filename> is read
by default.
</para>
<para>
Note: files that <command>named</command> reads in separate
parser contexts, such as <filename>rndc.key</filename> and
<filename>bind.keys</filename>, are not automatically read
by <command>named-checkconf</command>. Configuration
errors in these files may cause <command>named</command> to
fail to run, even if <command>named-checkconf</command> was
successful. <command>named-checkconf</command> can be run
on these files explicitly, however.
</para>
</refsection>
<refsection><info><title>OPTIONS</title></info>
<variablelist>
<varlistentry>
<term>-h</term>
<listitem>
<para>
Print the usage summary and exit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-j</term>
<listitem>
<para>
When loading a zonefile read the journal if it exists.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-l</term>
<listitem>
<para>
List all the configured zones. Each line of output
contains the zone name, class (e.g. IN), view, and type
(e.g. master or slave).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-p</term>
<listitem>
<para>
Print out the <filename>named.conf</filename> and included files
in canonical form if no errors were detected.
See also the <option>-x</option> option.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-t <replaceable class="parameter">directory</replaceable></term>
<listitem>
<para>
Chroot to <filename>directory</filename> so that include
directives in the configuration file are processed as if
run by a similarly chrooted <command>named</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-v</term>
<listitem>
<para>
Print the version of the <command>named-checkconf</command>
program and exit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-x</term>
<listitem>
<para>
When printing the configuration files in canonical
form, obscure shared secrets by replacing them with
strings of question marks ('?'). This allows the
contents of <filename>named.conf</filename> and related
files to be shared &mdash; for example, when submitting
bug reports &mdash; without compromising private data.
This option cannot be used without <option>-p</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-z</term>
<listitem>
<para>
Perform a test load of all master zones found in
<filename>named.conf</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>filename</term>
<listitem>
<para>
The name of the configuration file to be checked. If not
specified, it defaults to <filename>/etc/named.conf</filename>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection><info><title>RETURN VALUES</title></info>
<para><command>named-checkconf</command>
returns an exit status of 1 if
errors were detected and 0 otherwise.
</para>
</refsection>
<refsection><info><title>SEE ALSO</title></info>
<para><citerefentry>
<refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>named-checkzone</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citetitle>BIND 9 Administrator Reference Manual</citetitle>.
</para>
</refsection>
</refentry>

View File

@@ -1,166 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
- Copyright (C) 2000-2002, 2004, 2005, 2007, 2009, 2014-2016, 2018 Internet Systems Consortium, Inc. ("ISC")
-
- 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 http://mozilla.org/MPL/2.0/.
-->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>named-checkconf</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
<a name="man.named-checkconf"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>
<span class="application">named-checkconf</span>
&#8212; named configuration file syntax checking tool
</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="cmdsynopsis"><p>
<code class="command">named-checkconf</code>
[<code class="option">-hjlvz</code>]
[<code class="option">-p</code>
[<code class="option">-x</code>
]]
[<code class="option">-t <em class="replaceable"><code>directory</code></em></code>]
{filename}
</p></div>
</div>
<div class="refsection">
<a name="id-1.7"></a><h2>DESCRIPTION</h2>
<p><span class="command"><strong>named-checkconf</strong></span>
checks the syntax, but not the semantics, of a
<span class="command"><strong>named</strong></span> configuration file. The file is parsed
and checked for syntax errors, along with all files included by it.
If no file is specified, <code class="filename">/etc/named.conf</code> is read
by default.
</p>
<p>
Note: files that <span class="command"><strong>named</strong></span> reads in separate
parser contexts, such as <code class="filename">rndc.key</code> and
<code class="filename">bind.keys</code>, are not automatically read
by <span class="command"><strong>named-checkconf</strong></span>. Configuration
errors in these files may cause <span class="command"><strong>named</strong></span> to
fail to run, even if <span class="command"><strong>named-checkconf</strong></span> was
successful. <span class="command"><strong>named-checkconf</strong></span> can be run
on these files explicitly, however.
</p>
</div>
<div class="refsection">
<a name="id-1.8"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl class="variablelist">
<dt><span class="term">-h</span></dt>
<dd>
<p>
Print the usage summary and exit.
</p>
</dd>
<dt><span class="term">-j</span></dt>
<dd>
<p>
When loading a zonefile read the journal if it exists.
</p>
</dd>
<dt><span class="term">-l</span></dt>
<dd>
<p>
List all the configured zones. Each line of output
contains the zone name, class (e.g. IN), view, and type
(e.g. master or slave).
</p>
</dd>
<dt><span class="term">-p</span></dt>
<dd>
<p>
Print out the <code class="filename">named.conf</code> and included files
in canonical form if no errors were detected.
See also the <code class="option">-x</code> option.
</p>
</dd>
<dt><span class="term">-t <em class="replaceable"><code>directory</code></em></span></dt>
<dd>
<p>
Chroot to <code class="filename">directory</code> so that include
directives in the configuration file are processed as if
run by a similarly chrooted <span class="command"><strong>named</strong></span>.
</p>
</dd>
<dt><span class="term">-v</span></dt>
<dd>
<p>
Print the version of the <span class="command"><strong>named-checkconf</strong></span>
program and exit.
</p>
</dd>
<dt><span class="term">-x</span></dt>
<dd>
<p>
When printing the configuration files in canonical
form, obscure shared secrets by replacing them with
strings of question marks ('?'). This allows the
contents of <code class="filename">named.conf</code> and related
files to be shared &#8212; for example, when submitting
bug reports &#8212; without compromising private data.
This option cannot be used without <code class="option">-p</code>.
</p>
</dd>
<dt><span class="term">-z</span></dt>
<dd>
<p>
Perform a test load of all master zones found in
<code class="filename">named.conf</code>.
</p>
</dd>
<dt><span class="term">filename</span></dt>
<dd>
<p>
The name of the configuration file to be checked. If not
specified, it defaults to <code class="filename">/etc/named.conf</code>.
</p>
</dd>
</dl></div>
</div>
<div class="refsection">
<a name="id-1.9"></a><h2>RETURN VALUES</h2>
<p><span class="command"><strong>named-checkconf</strong></span>
returns an exit status of 1 if
errors were detected and 0 otherwise.
</p>
</div>
<div class="refsection">
<a name="id-1.10"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry">
<span class="refentrytitle">named</span>(8)
</span>,
<span class="citerefentry">
<span class="refentrytitle">named-checkzone</span>(8)
</span>,
<em class="citetitle">BIND 9 Administrator Reference Manual</em>.
</p>
</div>
</div></body>
</html>

View File

@@ -0,0 +1,105 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
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.
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
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 http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. highlight: console
.. _man_named-checkconf:
named-checkconf - named configuration file syntax checking tool
---------------------------------------------------------------
Synopsis
~~~~~~~~
:program:`named-checkconf` [**-chjlvz**] [**-p** [**-x** ]] [**-t** directory] {filename}
Description
~~~~~~~~~~~
``named-checkconf`` checks the syntax, but not the semantics, of a
``named`` configuration file. The file, along with all files included by it, is parsed and checked for syntax
errors. If no file is specified,
``/etc/named.conf`` is read by default.
Note: files that ``named`` reads in separate parser contexts, such as
``rndc.key`` and ``bind.keys``, are not automatically read by
``named-checkconf``. Configuration errors in these files may cause
``named`` to fail to run, even if ``named-checkconf`` was successful.
However, ``named-checkconf`` can be run on these files explicitly.
Options
~~~~~~~
``-h``
This option prints the usage summary and exits.
``-j``
When loading a zonefile, this option instructs ``named`` to read the journal if it exists.
``-l``
This option lists all the configured zones. Each line of output contains the zone
name, class (e.g. IN), view, and type (e.g. primary or secondary).
``-c``
This option specifies that only the "core" configuration should be checked. This suppresses the loading of
plugin modules, and causes all parameters to ``plugin`` statements to
be ignored.
``-i``
This option ignores warnings on deprecated options.
``-p``
This option prints out the ``named.conf`` and included files in canonical form if
no errors were detected. See also the ``-x`` option.
``-t directory``
This option instructs ``named`` to chroot to ``directory``, so that ``include`` directives in the
configuration file are processed as if run by a similarly chrooted
``named``.
``-v``
This option prints the version of the ``named-checkconf`` program and exits.
``-x``
When printing the configuration files in canonical form, this option obscures
shared secrets by replacing them with strings of question marks
(``?``). This allows the contents of ``named.conf`` and related files
to be shared - for example, when submitting bug reports -
without compromising private data. This option cannot be used without
``-p``.
``-z``
This option performs a test load of all zones of type ``primary`` found in ``named.conf``.
``filename``
This indicates the name of the configuration file to be checked. If not specified,
it defaults to ``/etc/named.conf``.
Return Values
~~~~~~~~~~~~~
``named-checkconf`` returns an exit status of 1 if errors were detected
and 0 otherwise.
See Also
~~~~~~~~
:manpage:`named(8)`, :manpage:`named-checkzone(8)`, BIND 9 Administrator Reference Manual.

View File

@@ -1,329 +0,0 @@
.\" Copyright (C) 2000-2002, 2004-2007, 2009-2016, 2018 Internet Systems Consortium, Inc. ("ISC")
.\"
.\" 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 http://mozilla.org/MPL/2.0/.
.\"
.hy 0
.ad l
'\" t
.\" Title: named-checkzone
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 2014-02-19
.\" Manual: BIND9
.\" Source: ISC
.\" Language: English
.\"
.TH "NAMED\-CHECKZONE" "8" "2014\-02\-19" "ISC" "BIND9"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
named-checkzone, named-compilezone \- zone file validity checking or converting tool
.SH "SYNOPSIS"
.HP \w'\fBnamed\-checkzone\fR\ 'u
\fBnamed\-checkzone\fR [\fB\-d\fR] [\fB\-h\fR] [\fB\-j\fR] [\fB\-q\fR] [\fB\-v\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-f\ \fR\fB\fIformat\fR\fR] [\fB\-F\ \fR\fB\fIformat\fR\fR] [\fB\-J\ \fR\fB\fIfilename\fR\fR] [\fB\-i\ \fR\fB\fImode\fR\fR] [\fB\-k\ \fR\fB\fImode\fR\fR] [\fB\-m\ \fR\fB\fImode\fR\fR] [\fB\-M\ \fR\fB\fImode\fR\fR] [\fB\-n\ \fR\fB\fImode\fR\fR] [\fB\-l\ \fR\fB\fIttl\fR\fR] [\fB\-L\ \fR\fB\fIserial\fR\fR] [\fB\-o\ \fR\fB\fIfilename\fR\fR] [\fB\-r\ \fR\fB\fImode\fR\fR] [\fB\-s\ \fR\fB\fIstyle\fR\fR] [\fB\-S\ \fR\fB\fImode\fR\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-T\ \fR\fB\fImode\fR\fR] [\fB\-w\ \fR\fB\fIdirectory\fR\fR] [\fB\-D\fR] [\fB\-W\ \fR\fB\fImode\fR\fR] {zonename} {filename}
.HP \w'\fBnamed\-compilezone\fR\ 'u
\fBnamed\-compilezone\fR [\fB\-d\fR] [\fB\-j\fR] [\fB\-q\fR] [\fB\-v\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-C\ \fR\fB\fImode\fR\fR] [\fB\-f\ \fR\fB\fIformat\fR\fR] [\fB\-F\ \fR\fB\fIformat\fR\fR] [\fB\-J\ \fR\fB\fIfilename\fR\fR] [\fB\-i\ \fR\fB\fImode\fR\fR] [\fB\-k\ \fR\fB\fImode\fR\fR] [\fB\-m\ \fR\fB\fImode\fR\fR] [\fB\-n\ \fR\fB\fImode\fR\fR] [\fB\-l\ \fR\fB\fIttl\fR\fR] [\fB\-L\ \fR\fB\fIserial\fR\fR] [\fB\-r\ \fR\fB\fImode\fR\fR] [\fB\-s\ \fR\fB\fIstyle\fR\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-T\ \fR\fB\fImode\fR\fR] [\fB\-w\ \fR\fB\fIdirectory\fR\fR] [\fB\-D\fR] [\fB\-W\ \fR\fB\fImode\fR\fR] {\fB\-o\ \fR\fB\fIfilename\fR\fR} {zonename} {filename}
.SH "DESCRIPTION"
.PP
\fBnamed\-checkzone\fR
checks the syntax and integrity of a zone file\&. It performs the same checks as
\fBnamed\fR
does when loading a zone\&. This makes
\fBnamed\-checkzone\fR
useful for checking zone files before configuring them into a name server\&.
.PP
\fBnamed\-compilezone\fR
is similar to
\fBnamed\-checkzone\fR, but it always dumps the zone contents to a specified file in a specified format\&. Additionally, it applies stricter check levels by default, since the dump output will be used as an actual zone file loaded by
\fBnamed\fR\&. When manually specified otherwise, the check levels must at least be as strict as those specified in the
\fBnamed\fR
configuration file\&.
.SH "OPTIONS"
.PP
\-d
.RS 4
Enable debugging\&.
.RE
.PP
\-h
.RS 4
Print the usage summary and exit\&.
.RE
.PP
\-q
.RS 4
Quiet mode \- exit code only\&.
.RE
.PP
\-v
.RS 4
Print the version of the
\fBnamed\-checkzone\fR
program and exit\&.
.RE
.PP
\-j
.RS 4
When loading a zone file, read the journal if it exists\&. The journal file name is assumed to be the zone file name appended with the string
\&.jnl\&.
.RE
.PP
\-J \fIfilename\fR
.RS 4
When loading the zone file read the journal from the given file, if it exists\&. (Implies \-j\&.)
.RE
.PP
\-c \fIclass\fR
.RS 4
Specify the class of the zone\&. If not specified, "IN" is assumed\&.
.RE
.PP
\-i \fImode\fR
.RS 4
Perform post\-load zone integrity checks\&. Possible modes are
\fB"full"\fR
(default),
\fB"full\-sibling"\fR,
\fB"local"\fR,
\fB"local\-sibling"\fR
and
\fB"none"\fR\&.
.sp
Mode
\fB"full"\fR
checks that MX records refer to A or AAAA record (both in\-zone and out\-of\-zone hostnames)\&. Mode
\fB"local"\fR
only checks MX records which refer to in\-zone hostnames\&.
.sp
Mode
\fB"full"\fR
checks that SRV records refer to A or AAAA record (both in\-zone and out\-of\-zone hostnames)\&. Mode
\fB"local"\fR
only checks SRV records which refer to in\-zone hostnames\&.
.sp
Mode
\fB"full"\fR
checks that delegation NS records refer to A or AAAA record (both in\-zone and out\-of\-zone hostnames)\&. It also checks that glue address records in the zone match those advertised by the child\&. Mode
\fB"local"\fR
only checks NS records which refer to in\-zone hostnames or that some required glue exists, that is when the nameserver is in a child zone\&.
.sp
Mode
\fB"full\-sibling"\fR
and
\fB"local\-sibling"\fR
disable sibling glue checks but are otherwise the same as
\fB"full"\fR
and
\fB"local"\fR
respectively\&.
.sp
Mode
\fB"none"\fR
disables the checks\&.
.RE
.PP
\-f \fIformat\fR
.RS 4
Specify the format of the zone file\&. Possible formats are
\fB"text"\fR
(default),
\fB"raw"\fR, and
\fB"map"\fR\&.
.RE
.PP
\-F \fIformat\fR
.RS 4
Specify the format of the output file specified\&. For
\fBnamed\-checkzone\fR, this does not cause any effects unless it dumps the zone contents\&.
.sp
Possible formats are
\fB"text"\fR
(default), which is the standard textual representation of the zone, and
\fB"map"\fR,
\fB"raw"\fR, and
\fB"raw=N"\fR, which store the zone in a binary format for rapid loading by
\fBnamed\fR\&.
\fB"raw=N"\fR
specifies the format version of the raw zone file: if N is 0, the raw file can be read by any version of
\fBnamed\fR; if N is 1, the file can be read by release 9\&.9\&.0 or higher; the default is 1\&.
.RE
.PP
\-k \fImode\fR
.RS 4
Perform
\fB"check\-names"\fR
checks with the specified failure mode\&. Possible modes are
\fB"fail"\fR
(default for
\fBnamed\-compilezone\fR),
\fB"warn"\fR
(default for
\fBnamed\-checkzone\fR) and
\fB"ignore"\fR\&.
.RE
.PP
\-l \fIttl\fR
.RS 4
Sets a maximum permissible TTL for the input file\&. Any record with a TTL higher than this value will cause the zone to be rejected\&. This is similar to using the
\fBmax\-zone\-ttl\fR
option in
named\&.conf\&.
.RE
.PP
\-L \fIserial\fR
.RS 4
When compiling a zone to "raw" or "map" format, set the "source serial" value in the header to the specified serial number\&. (This is expected to be used primarily for testing purposes\&.)
.RE
.PP
\-m \fImode\fR
.RS 4
Specify whether MX records should be checked to see if they are addresses\&. Possible modes are
\fB"fail"\fR,
\fB"warn"\fR
(default) and
\fB"ignore"\fR\&.
.RE
.PP
\-M \fImode\fR
.RS 4
Check if a MX record refers to a CNAME\&. Possible modes are
\fB"fail"\fR,
\fB"warn"\fR
(default) and
\fB"ignore"\fR\&.
.RE
.PP
\-n \fImode\fR
.RS 4
Specify whether NS records should be checked to see if they are addresses\&. Possible modes are
\fB"fail"\fR
(default for
\fBnamed\-compilezone\fR),
\fB"warn"\fR
(default for
\fBnamed\-checkzone\fR) and
\fB"ignore"\fR\&.
.RE
.PP
\-o \fIfilename\fR
.RS 4
Write zone output to
filename\&. If
filename
is
\-
then write to standard out\&. This is mandatory for
\fBnamed\-compilezone\fR\&.
.RE
.PP
\-r \fImode\fR
.RS 4
Check for records that are treated as different by DNSSEC but are semantically equal in plain DNS\&. Possible modes are
\fB"fail"\fR,
\fB"warn"\fR
(default) and
\fB"ignore"\fR\&.
.RE
.PP
\-s \fIstyle\fR
.RS 4
Specify the style of the dumped zone file\&. Possible styles are
\fB"full"\fR
(default) and
\fB"relative"\fR\&. The full format is most suitable for processing automatically by a separate script\&. On the other hand, the relative format is more human\-readable and is thus suitable for editing by hand\&. For
\fBnamed\-checkzone\fR
this does not cause any effects unless it dumps the zone contents\&. It also does not have any meaning if the output format is not text\&.
.RE
.PP
\-S \fImode\fR
.RS 4
Check if a SRV record refers to a CNAME\&. Possible modes are
\fB"fail"\fR,
\fB"warn"\fR
(default) and
\fB"ignore"\fR\&.
.RE
.PP
\-t \fIdirectory\fR
.RS 4
Chroot to
directory
so that include directives in the configuration file are processed as if run by a similarly chrooted
\fBnamed\fR\&.
.RE
.PP
\-T \fImode\fR
.RS 4
Check if Sender Policy Framework (SPF) records exist and issues a warning if an SPF\-formatted TXT record is not also present\&. Possible modes are
\fB"warn"\fR
(default),
\fB"ignore"\fR\&.
.RE
.PP
\-w \fIdirectory\fR
.RS 4
chdir to
directory
so that relative filenames in master file $INCLUDE directives work\&. This is similar to the directory clause in
named\&.conf\&.
.RE
.PP
\-D
.RS 4
Dump zone file in canonical format\&. This is always enabled for
\fBnamed\-compilezone\fR\&.
.RE
.PP
\-W \fImode\fR
.RS 4
Specify whether to check for non\-terminal wildcards\&. Non\-terminal wildcards are almost always the result of a failure to understand the wildcard matching algorithm (RFC 1034)\&. Possible modes are
\fB"warn"\fR
(default) and
\fB"ignore"\fR\&.
.RE
.PP
zonename
.RS 4
The domain name of the zone being checked\&.
.RE
.PP
filename
.RS 4
The name of the zone file\&.
.RE
.SH "RETURN VALUES"
.PP
\fBnamed\-checkzone\fR
returns an exit status of 1 if errors were detected and 0 otherwise\&.
.SH "SEE ALSO"
.PP
\fBnamed\fR(8),
\fBnamed-checkconf\fR(8),
RFC 1035,
BIND 9 Administrator Reference Manual\&.
.SH "AUTHOR"
.PP
\fBInternet Systems Consortium, Inc\&.\fR
.SH "COPYRIGHT"
.br
Copyright \(co 2000-2002, 2004-2007, 2009-2016, 2018 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -3,24 +3,23 @@
*
* 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 http://mozilla.org/MPL/2.0/.
* 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.
*/
/*! \file */
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <inttypes.h>
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/commandline.h>
#include <isc/dir.h>
#include <isc/file.h>
#include <isc/hash.h>
#include <isc/log.h>
#include <isc/mem.h>
@@ -55,31 +54,31 @@ static const char *prog_name = NULL;
static const dns_master_style_t *outputstyle = NULL;
static enum { progmode_check, progmode_compile } progmode;
#define ERRRET(result, function) \
do { \
if (result != ISC_R_SUCCESS) { \
if (!quiet) \
fprintf(stderr, "%s() returned %s\n", \
#define ERRRET(result, function) \
do { \
if (result != ISC_R_SUCCESS) { \
if (!quiet) \
fprintf(stderr, "%s() returned %s\n", \
function, dns_result_totext(result)); \
return (result); \
} \
return (result); \
} \
} while (0)
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
ISC_NORETURN static void
usage(void);
static void
usage(void) {
fprintf(stderr,
"usage: %s [-djqvD] [-c class] "
"[-f inputformat] [-F outputformat] [-J filename] "
"[-t directory] [-w directory] [-k (ignore|warn|fail)] "
"[-n (ignore|warn|fail)] [-m (ignore|warn|fail)] "
"[-r (ignore|warn|fail)] "
"[-s (full|relative)] [-t directory] [-w directory] "
"[-k (ignore|warn|fail)] [-m (ignore|warn|fail)] "
"[-n (ignore|warn|fail)] [-r (ignore|warn|fail)] "
"[-i (full|full-sibling|local|local-sibling|none)] "
"[-M (ignore|warn|fail)] [-S (ignore|warn|fail)] "
"[-W (ignore|warn)] "
"%s zonename filename\n",
"%s zonename [ (filename|-) ]\n",
prog_name,
progmode == progmode_check ? "[-o filename]" : "-o filename");
exit(1);
@@ -87,9 +86,9 @@ usage(void) {
static void
destroy(void) {
if (zone != NULL)
if (zone != NULL) {
dns_zone_detach(&zone);
dns_name_destroy();
}
}
/*% main processing routine */
@@ -97,7 +96,7 @@ int
main(int argc, char **argv) {
int c;
char *origin = NULL;
char *filename = NULL;
const char *filename = NULL;
isc_log_t *lctx = NULL;
isc_result_t result;
char classname_in[] = "IN";
@@ -123,18 +122,21 @@ main(int argc, char **argv) {
outputstyle = &dns_master_style_full;
prog_name = strrchr(argv[0], '/');
if (prog_name == NULL)
if (prog_name == NULL) {
prog_name = strrchr(argv[0], '\\');
if (prog_name != NULL)
}
if (prog_name != NULL) {
prog_name++;
else
} else {
prog_name = argv[0];
}
/*
* Libtool doesn't preserve the program name prior to final
* installation. Remove the libtool prefix ("lt-").
*/
if (strncmp(prog_name, "lt-", 3) == 0)
if (strncmp(prog_name, "lt-", 3) == 0) {
prog_name += 3;
}
#define PROGCMP(X) \
(strcasecmp(prog_name, X) == 0 || strcasecmp(prog_name, X ".exe") == 0)
@@ -150,24 +152,23 @@ main(int argc, char **argv) {
/* Compilation specific defaults */
if (progmode == progmode_compile) {
zone_options |= (DNS_ZONEOPT_CHECKNS |
DNS_ZONEOPT_FATALNS |
DNS_ZONEOPT_CHECKSPF |
DNS_ZONEOPT_CHECKDUPRR |
zone_options |= (DNS_ZONEOPT_CHECKNS | DNS_ZONEOPT_FATALNS |
DNS_ZONEOPT_CHECKSPF | DNS_ZONEOPT_CHECKDUPRR |
DNS_ZONEOPT_CHECKNAMES |
DNS_ZONEOPT_CHECKNAMESFAIL |
DNS_ZONEOPT_CHECKWILDCARD);
} else
zone_options |= (DNS_ZONEOPT_CHECKDUPRR |
DNS_ZONEOPT_CHECKSPF);
} else {
zone_options |= (DNS_ZONEOPT_CHECKDUPRR | DNS_ZONEOPT_CHECKSPF);
}
#define ARGCMP(X) (strcmp(isc_commandline_argument, X) == 0)
isc_commandline_errprint = false;
while ((c = isc_commandline_parse(argc, argv,
"c:df:hi:jJ:k:L:l:m:n:qr:s:t:o:vw:DF:M:S:T:W:"))
!= EOF) {
"c:df:hi:jJ:k:L:l:m:n:qr:s:t:o:vw:DF:"
"M:S:T:W:")) != EOF)
{
switch (c) {
case 'c':
classname = isc_commandline_argument;
@@ -271,16 +272,15 @@ main(int argc, char **argv) {
}
break;
case 'n':
if (ARGCMP("ignore")) {
zone_options &= ~(DNS_ZONEOPT_CHECKNS|
zone_options &= ~(DNS_ZONEOPT_CHECKNS |
DNS_ZONEOPT_FATALNS);
} else if (ARGCMP("warn")) {
zone_options |= DNS_ZONEOPT_CHECKNS;
zone_options &= ~DNS_ZONEOPT_FATALNS;
} else if (ARGCMP("fail")) {
zone_options |= DNS_ZONEOPT_CHECKNS|
zone_options |= DNS_ZONEOPT_CHECKNS |
DNS_ZONEOPT_FATALNS;
} else {
fprintf(stderr, "invalid argument to -n: %s\n",
@@ -332,9 +332,9 @@ main(int argc, char **argv) {
break;
case 's':
if (ARGCMP("full"))
if (ARGCMP("full")) {
outputstyle = &dns_master_style_full;
else if (ARGCMP("relative")) {
} else if (ARGCMP("relative")) {
outputstyle = &dns_master_style_default;
} else {
fprintf(stderr,
@@ -355,7 +355,7 @@ main(int argc, char **argv) {
break;
case 'v':
printf(VERSION "\n");
printf("%s\n", PACKAGE_VERSION);
exit(0);
case 'w':
@@ -413,23 +413,25 @@ main(int argc, char **argv) {
break;
case 'W':
if (ARGCMP("warn"))
if (ARGCMP("warn")) {
zone_options |= DNS_ZONEOPT_CHECKWILDCARD;
else if (ARGCMP("ignore"))
} else if (ARGCMP("ignore")) {
zone_options &= ~DNS_ZONEOPT_CHECKWILDCARD;
}
break;
case '?':
if (isc_commandline_option != '?')
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
prog_name, isc_commandline_option);
/* FALLTHROUGH */
}
/* FALLTHROUGH */
case 'h':
usage();
default:
fprintf(stderr, "%s: unhandled option -%c\n",
prog_name, isc_commandline_option);
fprintf(stderr, "%s: unhandled option -%c\n", prog_name,
isc_commandline_option);
exit(1);
}
}
@@ -437,26 +439,26 @@ main(int argc, char **argv) {
if (workdir != NULL) {
result = isc_dir_chdir(workdir);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "isc_dir_chdir: %s: %s\n",
workdir, isc_result_totext(result));
fprintf(stderr, "isc_dir_chdir: %s: %s\n", workdir,
isc_result_totext(result));
exit(1);
}
}
if (inputformatstr != NULL) {
if (strcasecmp(inputformatstr, "text") == 0)
if (strcasecmp(inputformatstr, "text") == 0) {
inputformat = dns_masterformat_text;
else if (strcasecmp(inputformatstr, "raw") == 0)
} else if (strcasecmp(inputformatstr, "raw") == 0) {
inputformat = dns_masterformat_raw;
else if (strncasecmp(inputformatstr, "raw=", 4) == 0) {
} else if (strncasecmp(inputformatstr, "raw=", 4) == 0) {
inputformat = dns_masterformat_raw;
fprintf(stderr,
"WARNING: input format raw, version ignored\n");
fprintf(stderr, "WARNING: input format raw, version "
"ignored\n");
} else if (strcasecmp(inputformatstr, "map") == 0) {
inputformat = dns_masterformat_map;
} else {
fprintf(stderr, "unknown file format: %s\n",
inputformatstr);
inputformatstr);
exit(1);
}
}
@@ -473,8 +475,7 @@ main(int argc, char **argv) {
rawversion = strtol(outputformatstr + 4, &end, 10);
if (end == outputformatstr + 4 || *end != '\0' ||
rawversion > 1U) {
fprintf(stderr,
"unknown raw format version\n");
fprintf(stderr, "unknown raw format version\n");
exit(1);
}
} else if (strcasecmp(outputformatstr, "map") == 0) {
@@ -487,47 +488,56 @@ main(int argc, char **argv) {
}
if (progmode == progmode_compile) {
dumpzone = 1; /* always dump */
dumpzone = 1; /* always dump */
logdump = !quiet;
if (output_filename == NULL) {
fprintf(stderr,
"output file required, but not specified\n");
fprintf(stderr, "output file required, but not "
"specified\n");
usage();
}
}
if (output_filename != NULL)
if (output_filename != NULL) {
dumpzone = 1;
}
/*
* If we are outputing to stdout then send the informational
* If we are printing to stdout then send the informational
* output to stderr.
*/
if (dumpzone &&
(output_filename == NULL ||
strcmp(output_filename, "-") == 0 ||
(output_filename == NULL || strcmp(output_filename, "-") == 0 ||
strcmp(output_filename, "/dev/fd/1") == 0 ||
strcmp(output_filename, "/dev/stdout") == 0)) {
strcmp(output_filename, "/dev/stdout") == 0))
{
errout = stderr;
logdump = false;
}
if (isc_commandline_index + 2 != argc)
if (argc - isc_commandline_index < 1 ||
argc - isc_commandline_index > 2) {
usage();
}
#ifdef _WIN32
InitSockets();
#endif
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
if (!quiet)
RUNTIME_CHECK(setup_logging(mctx, errout, &lctx)
== ISC_R_SUCCESS);
isc_mem_create(&mctx);
if (!quiet) {
RUNTIME_CHECK(setup_logging(mctx, errout, &lctx) ==
ISC_R_SUCCESS);
}
dns_result_register();
origin = argv[isc_commandline_index++];
filename = argv[isc_commandline_index++];
if (isc_commandline_index == argc) {
/* "-" will be interpreted as stdin */
filename = "-";
} else {
filename = argv[isc_commandline_index];
}
isc_commandline_index++;
result = load_zone(mctx, origin, filename, inputformat, classname,
maxttl, &zone);
@@ -543,20 +553,21 @@ main(int argc, char **argv) {
fprintf(errout, "dump zone to %s...", output_filename);
fflush(errout);
}
result = dump_zone(origin, zone, output_filename,
outputformat, outputstyle, rawversion);
if (logdump)
result = dump_zone(origin, zone, output_filename, outputformat,
outputstyle, rawversion);
if (logdump) {
fprintf(errout, "done\n");
}
}
if (!quiet && result == ISC_R_SUCCESS)
if (!quiet && result == ISC_R_SUCCESS) {
fprintf(errout, "OK\n");
}
destroy();
if (lctx != NULL)
if (lctx != NULL) {
isc_log_destroy(&lctx);
}
isc_mem_destroy(&mctx);
#ifdef _WIN32
DestroySockets();
#endif
return ((result == ISC_R_SUCCESS) ? 0 : 1);
}

View File

@@ -1,527 +0,0 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- 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 http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
<!-- Converted by db4-upgrade version 1.0 -->
<refentry xmlns:db="http://docbook.org/ns/docbook" version="5.0" xml:id="man.named-checkzone">
<info>
<date>2014-02-19</date>
</info>
<refentryinfo>
<corpname>ISC</corpname>
<corpauthor>Internet Systems Consortium, Inc.</corpauthor>
</refentryinfo>
<refmeta>
<refentrytitle><application>named-checkzone</application></refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
<docinfo>
<copyright>
<year>2000</year>
<year>2001</year>
<year>2002</year>
<year>2004</year>
<year>2005</year>
<year>2006</year>
<year>2007</year>
<year>2009</year>
<year>2010</year>
<year>2011</year>
<year>2012</year>
<year>2013</year>
<year>2014</year>
<year>2015</year>
<year>2016</year>
<year>2018</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
<refnamediv>
<refname><application>named-checkzone</application></refname>
<refname><application>named-compilezone</application></refname>
<refpurpose>zone file validity checking or converting tool</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis sepchar=" ">
<command>named-checkzone</command>
<arg choice="opt" rep="norepeat"><option>-d</option></arg>
<arg choice="opt" rep="norepeat"><option>-h</option></arg>
<arg choice="opt" rep="norepeat"><option>-j</option></arg>
<arg choice="opt" rep="norepeat"><option>-q</option></arg>
<arg choice="opt" rep="norepeat"><option>-v</option></arg>
<arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">class</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-f <replaceable class="parameter">format</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-F <replaceable class="parameter">format</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-J <replaceable class="parameter">filename</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-i <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-k <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-m <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-M <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-n <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-l <replaceable class="parameter">ttl</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-L <replaceable class="parameter">serial</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-o <replaceable class="parameter">filename</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-r <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-s <replaceable class="parameter">style</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-S <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-t <replaceable class="parameter">directory</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-T <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-w <replaceable class="parameter">directory</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-D</option></arg>
<arg choice="opt" rep="norepeat"><option>-W <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="req" rep="norepeat">zonename</arg>
<arg choice="req" rep="norepeat">filename</arg>
</cmdsynopsis>
<cmdsynopsis sepchar=" ">
<command>named-compilezone</command>
<arg choice="opt" rep="norepeat"><option>-d</option></arg>
<arg choice="opt" rep="norepeat"><option>-j</option></arg>
<arg choice="opt" rep="norepeat"><option>-q</option></arg>
<arg choice="opt" rep="norepeat"><option>-v</option></arg>
<arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">class</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-C <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-f <replaceable class="parameter">format</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-F <replaceable class="parameter">format</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-J <replaceable class="parameter">filename</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-i <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-k <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-m <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-n <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-l <replaceable class="parameter">ttl</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-L <replaceable class="parameter">serial</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-r <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-s <replaceable class="parameter">style</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-t <replaceable class="parameter">directory</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-T <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-w <replaceable class="parameter">directory</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-D</option></arg>
<arg choice="opt" rep="norepeat"><option>-W <replaceable class="parameter">mode</replaceable></option></arg>
<arg choice="req" rep="norepeat"><option>-o <replaceable class="parameter">filename</replaceable></option></arg>
<arg choice="req" rep="norepeat">zonename</arg>
<arg choice="req" rep="norepeat">filename</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsection><info><title>DESCRIPTION</title></info>
<para><command>named-checkzone</command>
checks the syntax and integrity of a zone file. It performs the
same checks as <command>named</command> does when loading a
zone. This makes <command>named-checkzone</command> useful for
checking zone files before configuring them into a name server.
</para>
<para>
<command>named-compilezone</command> is similar to
<command>named-checkzone</command>, but it always dumps the
zone contents to a specified file in a specified format.
Additionally, it applies stricter check levels by default,
since the dump output will be used as an actual zone file
loaded by <command>named</command>.
When manually specified otherwise, the check levels must at
least be as strict as those specified in the
<command>named</command> configuration file.
</para>
</refsection>
<refsection><info><title>OPTIONS</title></info>
<variablelist>
<varlistentry>
<term>-d</term>
<listitem>
<para>
Enable debugging.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-h</term>
<listitem>
<para>
Print the usage summary and exit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-q</term>
<listitem>
<para>
Quiet mode - exit code only.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-v</term>
<listitem>
<para>
Print the version of the <command>named-checkzone</command>
program and exit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-j</term>
<listitem>
<para>
When loading a zone file, read the journal if it exists.
The journal file name is assumed to be the zone file name
appended with the string <filename>.jnl</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-J <replaceable class="parameter">filename</replaceable></term>
<listitem>
<para>
When loading the zone file read the journal from the given
file, if it exists. (Implies -j.)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-c <replaceable class="parameter">class</replaceable></term>
<listitem>
<para>
Specify the class of the zone. If not specified, "IN" is assumed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-i <replaceable class="parameter">mode</replaceable></term>
<listitem>
<para>
Perform post-load zone integrity checks. Possible modes are
<command>"full"</command> (default),
<command>"full-sibling"</command>,
<command>"local"</command>,
<command>"local-sibling"</command> and
<command>"none"</command>.
</para>
<para>
Mode <command>"full"</command> checks that MX records
refer to A or AAAA record (both in-zone and out-of-zone
hostnames). Mode <command>"local"</command> only
checks MX records which refer to in-zone hostnames.
</para>
<para>
Mode <command>"full"</command> checks that SRV records
refer to A or AAAA record (both in-zone and out-of-zone
hostnames). Mode <command>"local"</command> only
checks SRV records which refer to in-zone hostnames.
</para>
<para>
Mode <command>"full"</command> checks that delegation NS
records refer to A or AAAA record (both in-zone and out-of-zone
hostnames). It also checks that glue address records
in the zone match those advertised by the child.
Mode <command>"local"</command> only checks NS records which
refer to in-zone hostnames or that some required glue exists,
that is when the nameserver is in a child zone.
</para>
<para>
Mode <command>"full-sibling"</command> and
<command>"local-sibling"</command> disable sibling glue
checks but are otherwise the same as <command>"full"</command>
and <command>"local"</command> respectively.
</para>
<para>
Mode <command>"none"</command> disables the checks.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-f <replaceable class="parameter">format</replaceable></term>
<listitem>
<para>
Specify the format of the zone file.
Possible formats are <command>"text"</command> (default),
<command>"raw"</command>, and <command>"map"</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-F <replaceable class="parameter">format</replaceable></term>
<listitem>
<para>
Specify the format of the output file specified.
For <command>named-checkzone</command>,
this does not cause any effects unless it dumps the zone
contents.
</para>
<para>
Possible formats are <command>"text"</command> (default),
which is the standard textual representation of the zone,
and <command>"map"</command>, <command>"raw"</command>,
and <command>"raw=N"</command>, which store the zone in a
binary format for rapid loading by <command>named</command>.
<command>"raw=N"</command> specifies the format version of
the raw zone file: if N is 0, the raw file can be read by
any version of <command>named</command>; if N is 1, the file
can be read by release 9.9.0 or higher; the default is 1.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-k <replaceable class="parameter">mode</replaceable></term>
<listitem>
<para>
Perform <command>"check-names"</command> checks with the
specified failure mode.
Possible modes are <command>"fail"</command>
(default for <command>named-compilezone</command>),
<command>"warn"</command>
(default for <command>named-checkzone</command>) and
<command>"ignore"</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-l <replaceable class="parameter">ttl</replaceable></term>
<listitem>
<para>
Sets a maximum permissible TTL for the input file.
Any record with a TTL higher than this value will cause
the zone to be rejected. This is similar to using the
<command>max-zone-ttl</command> option in
<filename>named.conf</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-L <replaceable class="parameter">serial</replaceable></term>
<listitem>
<para>
When compiling a zone to "raw" or "map" format, set the
"source serial" value in the header to the specified serial
number. (This is expected to be used primarily for testing
purposes.)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-m <replaceable class="parameter">mode</replaceable></term>
<listitem>
<para>
Specify whether MX records should be checked to see if they
are addresses. Possible modes are <command>"fail"</command>,
<command>"warn"</command> (default) and
<command>"ignore"</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-M <replaceable class="parameter">mode</replaceable></term>
<listitem>
<para>
Check if a MX record refers to a CNAME.
Possible modes are <command>"fail"</command>,
<command>"warn"</command> (default) and
<command>"ignore"</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-n <replaceable class="parameter">mode</replaceable></term>
<listitem>
<para>
Specify whether NS records should be checked to see if they
are addresses.
Possible modes are <command>"fail"</command>
(default for <command>named-compilezone</command>),
<command>"warn"</command>
(default for <command>named-checkzone</command>) and
<command>"ignore"</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-o <replaceable class="parameter">filename</replaceable></term>
<listitem>
<para>
Write zone output to <filename>filename</filename>.
If <filename>filename</filename> is <filename>-</filename> then
write to standard out.
This is mandatory for <command>named-compilezone</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-r <replaceable class="parameter">mode</replaceable></term>
<listitem>
<para>
Check for records that are treated as different by DNSSEC but
are semantically equal in plain DNS.
Possible modes are <command>"fail"</command>,
<command>"warn"</command> (default) and
<command>"ignore"</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-s <replaceable class="parameter">style</replaceable></term>
<listitem>
<para>
Specify the style of the dumped zone file.
Possible styles are <command>"full"</command> (default)
and <command>"relative"</command>.
The full format is most suitable for processing
automatically by a separate script.
On the other hand, the relative format is more
human-readable and is thus suitable for editing by hand.
For <command>named-checkzone</command>
this does not cause any effects unless it dumps the zone
contents.
It also does not have any meaning if the output format
is not text.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-S <replaceable class="parameter">mode</replaceable></term>
<listitem>
<para>
Check if a SRV record refers to a CNAME.
Possible modes are <command>"fail"</command>,
<command>"warn"</command> (default) and
<command>"ignore"</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-t <replaceable class="parameter">directory</replaceable></term>
<listitem>
<para>
Chroot to <filename>directory</filename> so that
include
directives in the configuration file are processed as if
run by a similarly chrooted <command>named</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-T <replaceable class="parameter">mode</replaceable></term>
<listitem>
<para>
Check if Sender Policy Framework (SPF) records exist
and issues a warning if an SPF-formatted TXT record is
not also present. Possible modes are <command>"warn"</command>
(default), <command>"ignore"</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-w <replaceable class="parameter">directory</replaceable></term>
<listitem>
<para>
chdir to <filename>directory</filename> so that
relative
filenames in master file $INCLUDE directives work. This
is similar to the directory clause in
<filename>named.conf</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-D</term>
<listitem>
<para>
Dump zone file in canonical format.
This is always enabled for <command>named-compilezone</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-W <replaceable class="parameter">mode</replaceable></term>
<listitem>
<para>
Specify whether to check for non-terminal wildcards.
Non-terminal wildcards are almost always the result of a
failure to understand the wildcard matching algorithm (RFC 1034).
Possible modes are <command>"warn"</command> (default)
and
<command>"ignore"</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>zonename</term>
<listitem>
<para>
The domain name of the zone being checked.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>filename</term>
<listitem>
<para>
The name of the zone file.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection><info><title>RETURN VALUES</title></info>
<para><command>named-checkzone</command>
returns an exit status of 1 if
errors were detected and 0 otherwise.
</para>
</refsection>
<refsection><info><title>SEE ALSO</title></info>
<para><citerefentry>
<refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>named-checkconf</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citetitle>RFC 1035</citetitle>,
<citetitle>BIND 9 Administrator Reference Manual</citetitle>.
</para>
</refsection>
</refentry>

View File

@@ -1,429 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
- Copyright (C) 2000-2002, 2004-2007, 2009-2016, 2018 Internet Systems Consortium, Inc. ("ISC")
-
- 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 http://mozilla.org/MPL/2.0/.
-->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>named-checkzone</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
<a name="man.named-checkzone"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>
<span class="application">named-checkzone</span>,
<span class="application">named-compilezone</span>
&#8212; zone file validity checking or converting tool
</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="cmdsynopsis"><p>
<code class="command">named-checkzone</code>
[<code class="option">-d</code>]
[<code class="option">-h</code>]
[<code class="option">-j</code>]
[<code class="option">-q</code>]
[<code class="option">-v</code>]
[<code class="option">-c <em class="replaceable"><code>class</code></em></code>]
[<code class="option">-f <em class="replaceable"><code>format</code></em></code>]
[<code class="option">-F <em class="replaceable"><code>format</code></em></code>]
[<code class="option">-J <em class="replaceable"><code>filename</code></em></code>]
[<code class="option">-i <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-k <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-m <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-M <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-n <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-l <em class="replaceable"><code>ttl</code></em></code>]
[<code class="option">-L <em class="replaceable"><code>serial</code></em></code>]
[<code class="option">-o <em class="replaceable"><code>filename</code></em></code>]
[<code class="option">-r <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-s <em class="replaceable"><code>style</code></em></code>]
[<code class="option">-S <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-t <em class="replaceable"><code>directory</code></em></code>]
[<code class="option">-T <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-w <em class="replaceable"><code>directory</code></em></code>]
[<code class="option">-D</code>]
[<code class="option">-W <em class="replaceable"><code>mode</code></em></code>]
{zonename}
{filename}
</p></div>
<div class="cmdsynopsis"><p>
<code class="command">named-compilezone</code>
[<code class="option">-d</code>]
[<code class="option">-j</code>]
[<code class="option">-q</code>]
[<code class="option">-v</code>]
[<code class="option">-c <em class="replaceable"><code>class</code></em></code>]
[<code class="option">-C <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-f <em class="replaceable"><code>format</code></em></code>]
[<code class="option">-F <em class="replaceable"><code>format</code></em></code>]
[<code class="option">-J <em class="replaceable"><code>filename</code></em></code>]
[<code class="option">-i <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-k <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-m <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-n <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-l <em class="replaceable"><code>ttl</code></em></code>]
[<code class="option">-L <em class="replaceable"><code>serial</code></em></code>]
[<code class="option">-r <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-s <em class="replaceable"><code>style</code></em></code>]
[<code class="option">-t <em class="replaceable"><code>directory</code></em></code>]
[<code class="option">-T <em class="replaceable"><code>mode</code></em></code>]
[<code class="option">-w <em class="replaceable"><code>directory</code></em></code>]
[<code class="option">-D</code>]
[<code class="option">-W <em class="replaceable"><code>mode</code></em></code>]
{<code class="option">-o <em class="replaceable"><code>filename</code></em></code>}
{zonename}
{filename}
</p></div>
</div>
<div class="refsection">
<a name="id-1.7"></a><h2>DESCRIPTION</h2>
<p><span class="command"><strong>named-checkzone</strong></span>
checks the syntax and integrity of a zone file. It performs the
same checks as <span class="command"><strong>named</strong></span> does when loading a
zone. This makes <span class="command"><strong>named-checkzone</strong></span> useful for
checking zone files before configuring them into a name server.
</p>
<p>
<span class="command"><strong>named-compilezone</strong></span> is similar to
<span class="command"><strong>named-checkzone</strong></span>, but it always dumps the
zone contents to a specified file in a specified format.
Additionally, it applies stricter check levels by default,
since the dump output will be used as an actual zone file
loaded by <span class="command"><strong>named</strong></span>.
When manually specified otherwise, the check levels must at
least be as strict as those specified in the
<span class="command"><strong>named</strong></span> configuration file.
</p>
</div>
<div class="refsection">
<a name="id-1.8"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl class="variablelist">
<dt><span class="term">-d</span></dt>
<dd>
<p>
Enable debugging.
</p>
</dd>
<dt><span class="term">-h</span></dt>
<dd>
<p>
Print the usage summary and exit.
</p>
</dd>
<dt><span class="term">-q</span></dt>
<dd>
<p>
Quiet mode - exit code only.
</p>
</dd>
<dt><span class="term">-v</span></dt>
<dd>
<p>
Print the version of the <span class="command"><strong>named-checkzone</strong></span>
program and exit.
</p>
</dd>
<dt><span class="term">-j</span></dt>
<dd>
<p>
When loading a zone file, read the journal if it exists.
The journal file name is assumed to be the zone file name
appended with the string <code class="filename">.jnl</code>.
</p>
</dd>
<dt><span class="term">-J <em class="replaceable"><code>filename</code></em></span></dt>
<dd>
<p>
When loading the zone file read the journal from the given
file, if it exists. (Implies -j.)
</p>
</dd>
<dt><span class="term">-c <em class="replaceable"><code>class</code></em></span></dt>
<dd>
<p>
Specify the class of the zone. If not specified, "IN" is assumed.
</p>
</dd>
<dt><span class="term">-i <em class="replaceable"><code>mode</code></em></span></dt>
<dd>
<p>
Perform post-load zone integrity checks. Possible modes are
<span class="command"><strong>"full"</strong></span> (default),
<span class="command"><strong>"full-sibling"</strong></span>,
<span class="command"><strong>"local"</strong></span>,
<span class="command"><strong>"local-sibling"</strong></span> and
<span class="command"><strong>"none"</strong></span>.
</p>
<p>
Mode <span class="command"><strong>"full"</strong></span> checks that MX records
refer to A or AAAA record (both in-zone and out-of-zone
hostnames). Mode <span class="command"><strong>"local"</strong></span> only
checks MX records which refer to in-zone hostnames.
</p>
<p>
Mode <span class="command"><strong>"full"</strong></span> checks that SRV records
refer to A or AAAA record (both in-zone and out-of-zone
hostnames). Mode <span class="command"><strong>"local"</strong></span> only
checks SRV records which refer to in-zone hostnames.
</p>
<p>
Mode <span class="command"><strong>"full"</strong></span> checks that delegation NS
records refer to A or AAAA record (both in-zone and out-of-zone
hostnames). It also checks that glue address records
in the zone match those advertised by the child.
Mode <span class="command"><strong>"local"</strong></span> only checks NS records which
refer to in-zone hostnames or that some required glue exists,
that is when the nameserver is in a child zone.
</p>
<p>
Mode <span class="command"><strong>"full-sibling"</strong></span> and
<span class="command"><strong>"local-sibling"</strong></span> disable sibling glue
checks but are otherwise the same as <span class="command"><strong>"full"</strong></span>
and <span class="command"><strong>"local"</strong></span> respectively.
</p>
<p>
Mode <span class="command"><strong>"none"</strong></span> disables the checks.
</p>
</dd>
<dt><span class="term">-f <em class="replaceable"><code>format</code></em></span></dt>
<dd>
<p>
Specify the format of the zone file.
Possible formats are <span class="command"><strong>"text"</strong></span> (default),
<span class="command"><strong>"raw"</strong></span>, and <span class="command"><strong>"map"</strong></span>.
</p>
</dd>
<dt><span class="term">-F <em class="replaceable"><code>format</code></em></span></dt>
<dd>
<p>
Specify the format of the output file specified.
For <span class="command"><strong>named-checkzone</strong></span>,
this does not cause any effects unless it dumps the zone
contents.
</p>
<p>
Possible formats are <span class="command"><strong>"text"</strong></span> (default),
which is the standard textual representation of the zone,
and <span class="command"><strong>"map"</strong></span>, <span class="command"><strong>"raw"</strong></span>,
and <span class="command"><strong>"raw=N"</strong></span>, which store the zone in a
binary format for rapid loading by <span class="command"><strong>named</strong></span>.
<span class="command"><strong>"raw=N"</strong></span> specifies the format version of
the raw zone file: if N is 0, the raw file can be read by
any version of <span class="command"><strong>named</strong></span>; if N is 1, the file
can be read by release 9.9.0 or higher; the default is 1.
</p>
</dd>
<dt><span class="term">-k <em class="replaceable"><code>mode</code></em></span></dt>
<dd>
<p>
Perform <span class="command"><strong>"check-names"</strong></span> checks with the
specified failure mode.
Possible modes are <span class="command"><strong>"fail"</strong></span>
(default for <span class="command"><strong>named-compilezone</strong></span>),
<span class="command"><strong>"warn"</strong></span>
(default for <span class="command"><strong>named-checkzone</strong></span>) and
<span class="command"><strong>"ignore"</strong></span>.
</p>
</dd>
<dt><span class="term">-l <em class="replaceable"><code>ttl</code></em></span></dt>
<dd>
<p>
Sets a maximum permissible TTL for the input file.
Any record with a TTL higher than this value will cause
the zone to be rejected. This is similar to using the
<span class="command"><strong>max-zone-ttl</strong></span> option in
<code class="filename">named.conf</code>.
</p>
</dd>
<dt><span class="term">-L <em class="replaceable"><code>serial</code></em></span></dt>
<dd>
<p>
When compiling a zone to "raw" or "map" format, set the
"source serial" value in the header to the specified serial
number. (This is expected to be used primarily for testing
purposes.)
</p>
</dd>
<dt><span class="term">-m <em class="replaceable"><code>mode</code></em></span></dt>
<dd>
<p>
Specify whether MX records should be checked to see if they
are addresses. Possible modes are <span class="command"><strong>"fail"</strong></span>,
<span class="command"><strong>"warn"</strong></span> (default) and
<span class="command"><strong>"ignore"</strong></span>.
</p>
</dd>
<dt><span class="term">-M <em class="replaceable"><code>mode</code></em></span></dt>
<dd>
<p>
Check if a MX record refers to a CNAME.
Possible modes are <span class="command"><strong>"fail"</strong></span>,
<span class="command"><strong>"warn"</strong></span> (default) and
<span class="command"><strong>"ignore"</strong></span>.
</p>
</dd>
<dt><span class="term">-n <em class="replaceable"><code>mode</code></em></span></dt>
<dd>
<p>
Specify whether NS records should be checked to see if they
are addresses.
Possible modes are <span class="command"><strong>"fail"</strong></span>
(default for <span class="command"><strong>named-compilezone</strong></span>),
<span class="command"><strong>"warn"</strong></span>
(default for <span class="command"><strong>named-checkzone</strong></span>) and
<span class="command"><strong>"ignore"</strong></span>.
</p>
</dd>
<dt><span class="term">-o <em class="replaceable"><code>filename</code></em></span></dt>
<dd>
<p>
Write zone output to <code class="filename">filename</code>.
If <code class="filename">filename</code> is <code class="filename">-</code> then
write to standard out.
This is mandatory for <span class="command"><strong>named-compilezone</strong></span>.
</p>
</dd>
<dt><span class="term">-r <em class="replaceable"><code>mode</code></em></span></dt>
<dd>
<p>
Check for records that are treated as different by DNSSEC but
are semantically equal in plain DNS.
Possible modes are <span class="command"><strong>"fail"</strong></span>,
<span class="command"><strong>"warn"</strong></span> (default) and
<span class="command"><strong>"ignore"</strong></span>.
</p>
</dd>
<dt><span class="term">-s <em class="replaceable"><code>style</code></em></span></dt>
<dd>
<p>
Specify the style of the dumped zone file.
Possible styles are <span class="command"><strong>"full"</strong></span> (default)
and <span class="command"><strong>"relative"</strong></span>.
The full format is most suitable for processing
automatically by a separate script.
On the other hand, the relative format is more
human-readable and is thus suitable for editing by hand.
For <span class="command"><strong>named-checkzone</strong></span>
this does not cause any effects unless it dumps the zone
contents.
It also does not have any meaning if the output format
is not text.
</p>
</dd>
<dt><span class="term">-S <em class="replaceable"><code>mode</code></em></span></dt>
<dd>
<p>
Check if a SRV record refers to a CNAME.
Possible modes are <span class="command"><strong>"fail"</strong></span>,
<span class="command"><strong>"warn"</strong></span> (default) and
<span class="command"><strong>"ignore"</strong></span>.
</p>
</dd>
<dt><span class="term">-t <em class="replaceable"><code>directory</code></em></span></dt>
<dd>
<p>
Chroot to <code class="filename">directory</code> so that
include
directives in the configuration file are processed as if
run by a similarly chrooted <span class="command"><strong>named</strong></span>.
</p>
</dd>
<dt><span class="term">-T <em class="replaceable"><code>mode</code></em></span></dt>
<dd>
<p>
Check if Sender Policy Framework (SPF) records exist
and issues a warning if an SPF-formatted TXT record is
not also present. Possible modes are <span class="command"><strong>"warn"</strong></span>
(default), <span class="command"><strong>"ignore"</strong></span>.
</p>
</dd>
<dt><span class="term">-w <em class="replaceable"><code>directory</code></em></span></dt>
<dd>
<p>
chdir to <code class="filename">directory</code> so that
relative
filenames in master file $INCLUDE directives work. This
is similar to the directory clause in
<code class="filename">named.conf</code>.
</p>
</dd>
<dt><span class="term">-D</span></dt>
<dd>
<p>
Dump zone file in canonical format.
This is always enabled for <span class="command"><strong>named-compilezone</strong></span>.
</p>
</dd>
<dt><span class="term">-W <em class="replaceable"><code>mode</code></em></span></dt>
<dd>
<p>
Specify whether to check for non-terminal wildcards.
Non-terminal wildcards are almost always the result of a
failure to understand the wildcard matching algorithm (RFC 1034).
Possible modes are <span class="command"><strong>"warn"</strong></span> (default)
and
<span class="command"><strong>"ignore"</strong></span>.
</p>
</dd>
<dt><span class="term">zonename</span></dt>
<dd>
<p>
The domain name of the zone being checked.
</p>
</dd>
<dt><span class="term">filename</span></dt>
<dd>
<p>
The name of the zone file.
</p>
</dd>
</dl></div>
</div>
<div class="refsection">
<a name="id-1.9"></a><h2>RETURN VALUES</h2>
<p><span class="command"><strong>named-checkzone</strong></span>
returns an exit status of 1 if
errors were detected and 0 otherwise.
</p>
</div>
<div class="refsection">
<a name="id-1.10"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry">
<span class="refentrytitle">named</span>(8)
</span>,
<span class="citerefentry">
<span class="refentrytitle">named-checkconf</span>(8)
</span>,
<em class="citetitle">RFC 1035</em>,
<em class="citetitle">BIND 9 Administrator Reference Manual</em>.
</p>
</div>
</div></body>
</html>

View File

@@ -0,0 +1,213 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
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.
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
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 http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. highlight: console
named-checkzone, named-compilezone - zone file validity checking or converting tool
-----------------------------------------------------------------------------------
Synopsis
~~~~~~~~
:program:`named-checkzone` [**-d**] [**-h**] [**-j**] [**-q**] [**-v**] [**-c** class] [**-f** format] [**-F** format] [**-J** filename] [**-i** mode] [**-k** mode] [**-m** mode] [**-M** mode] [**-n** mode] [**-l** ttl] [**-L** serial] [**-o** filename] [**-r** mode] [**-s** style] [**-S** mode] [**-t** directory] [**-T** mode] [**-w** directory] [**-D**] [**-W** mode] {zonename} {filename}
:program:`named-compilezone` [**-d**] [**-j**] [**-q**] [**-v**] [**-c** class] [**-C** mode] [**-f** format] [**-F** format] [**-J** filename] [**-i** mode] [**-k** mode] [**-m** mode] [**-n** mode] [**-l** ttl] [**-L** serial] [**-r** mode] [**-s** style] [**-t** directory] [**-T** mode] [**-w** directory] [**-D**] [**-W** mode] {**-o** filename} {zonename} {filename}
Description
~~~~~~~~~~~
``named-checkzone`` checks the syntax and integrity of a zone file. It
performs the same checks as ``named`` does when loading a zone. This
makes ``named-checkzone`` useful for checking zone files before
configuring them into a name server.
``named-compilezone`` is similar to ``named-checkzone``, but it always
dumps the zone contents to a specified file in a specified format.
It also applies stricter check levels by default, since the
dump output is used as an actual zone file loaded by ``named``.
When manually specified otherwise, the check levels must at least be as
strict as those specified in the ``named`` configuration file.
Options
~~~~~~~
``-d``
This option enables debugging.
``-h``
This option prints the usage summary and exits.
``-q``
This option sets quiet mode, which only sets an exit code to indicate
successful or failed completion.
``-v``
This option prints the version of the ``named-checkzone`` program and exits.
``-j``
When loading a zone file, this option tells ``named`` to read the journal if it exists. The journal
file name is assumed to be the zone file name with the
string ``.jnl`` appended.
``-J filename``
When loading the zone file, this option tells ``named`` to read the journal from the given file, if
it exists. This implies ``-j``.
``-c class``
This option specifies the class of the zone. If not specified, ``IN`` is assumed.
``-i mode``
This option performs post-load zone integrity checks. Possible modes are
``full`` (the default), ``full-sibling``, ``local``,
``local-sibling``, and ``none``.
Mode ``full`` checks that MX records refer to A or AAAA records
(both in-zone and out-of-zone hostnames). Mode ``local`` only
checks MX records which refer to in-zone hostnames.
Mode ``full`` checks that SRV records refer to A or AAAA records
(both in-zone and out-of-zone hostnames). Mode ``local`` only
checks SRV records which refer to in-zone hostnames.
Mode ``full`` checks that delegation NS records refer to A or AAAA
records (both in-zone and out-of-zone hostnames). It also checks that
glue address records in the zone match those advertised by the child.
Mode ``local`` only checks NS records which refer to in-zone
hostnames or verifies that some required glue exists, i.e., when the
name server is in a child zone.
Modes ``full-sibling`` and ``local-sibling`` disable sibling glue
checks, but are otherwise the same as ``full`` and ``local``,
respectively.
Mode ``none`` disables the checks.
``-f format``
This option specifies the format of the zone file. Possible formats are ``text``
(the default), ``raw``, and ``map``.
``-F format``
This option specifies the format of the output file specified. For
``named-checkzone``, this does not have any effect unless it dumps
the zone contents.
Possible formats are ``text`` (the default), which is the standard
textual representation of the zone, and ``map``, ``raw``, and
``raw=N``, which store the zone in a binary format for rapid
loading by ``named``. ``raw=N`` specifies the format version of the
raw zone file: if ``N`` is 0, the raw file can be read by any version of
``named``; if N is 1, the file can only be read by release 9.9.0 or
higher. The default is 1.
``-k mode``
This option performs ``check-names`` checks with the specified failure mode.
Possible modes are ``fail`` (the default for ``named-compilezone``),
``warn`` (the default for ``named-checkzone``), and ``ignore``.
``-l ttl``
This option sets a maximum permissible TTL for the input file. Any record with a
TTL higher than this value causes the zone to be rejected. This
is similar to using the ``max-zone-ttl`` option in ``named.conf``.
``-L serial``
When compiling a zone to ``raw`` or ``map`` format, this option sets the "source
serial" value in the header to the specified serial number. This is
expected to be used primarily for testing purposes.
``-m mode``
This option specifies whether MX records should be checked to see if they are
addresses. Possible modes are ``fail``, ``warn`` (the default), and
``ignore``.
``-M mode``
This option checks whether a MX record refers to a CNAME. Possible modes are
``fail``, ``warn`` (the default), and ``ignore``.
``-n mode``
This option specifies whether NS records should be checked to see if they are
addresses. Possible modes are ``fail`` (the default for
``named-compilezone``), ``warn`` (the default for ``named-checkzone``),
and ``ignore``.
``-o filename``
This option writes the zone output to ``filename``. If ``filename`` is ``-``, then
the zone output is written to standard output. This is mandatory for ``named-compilezone``.
``-r mode``
This option checks for records that are treated as different by DNSSEC but are
semantically equal in plain DNS. Possible modes are ``fail``,
``warn`` (the default), and ``ignore``.
``-s style``
This option specifies the style of the dumped zone file. Possible styles are
``full`` (the default) and ``relative``. The ``full`` format is most
suitable for processing automatically by a separate script.
The relative format is more human-readable and is thus
suitable for editing by hand. For ``named-checkzone``, this does not
have any effect unless it dumps the zone contents. It also does not
have any meaning if the output format is not text.
``-S mode``
This option checks whether an SRV record refers to a CNAME. Possible modes are
``fail``, ``warn`` (the default), and ``ignore``.
``-t directory``
This option tells ``named`` to chroot to ``directory``, so that ``include`` directives in the
configuration file are processed as if run by a similarly chrooted
``named``.
``-T mode``
This option checks whether Sender Policy Framework (SPF) records exist and issues a
warning if an SPF-formatted TXT record is not also present. Possible
modes are ``warn`` (the default) and ``ignore``.
``-w directory``
This option instructs ``named`` to chdir to ``directory``, so that relative filenames in master file
``$INCLUDE`` directives work. This is similar to the directory clause in
``named.conf``.
``-D``
This option dumps the zone file in canonical format. This is always enabled for
``named-compilezone``.
``-W mode``
This option specifies whether to check for non-terminal wildcards. Non-terminal
wildcards are almost always the result of a failure to understand the
wildcard matching algorithm (:rfc:`1034`). Possible modes are ``warn``
(the default) and ``ignore``.
``zonename``
This indicates the domain name of the zone being checked.
``filename``
This is the name of the zone file.
Return Values
~~~~~~~~~~~~~
``named-checkzone`` returns an exit status of 1 if errors were detected
and 0 otherwise.
See Also
~~~~~~~~
:manpage:`named(8)`, :manpage:`named-checkconf(8)`, :rfc:`1035`, BIND 9 Administrator Reference
Manual.

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkconf.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,115 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{03A96113-CB14-43AA-AEB2-48950E3915C5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>checkconf</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkconf.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\check-tool.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,101 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\check-tool.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2C1F7096-C5B5-48D4-846F-A7ACA454335D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>checktool</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<OutDir>.\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<IntDir>.\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<OutDir>.\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<IntDir>.\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\ns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Lib>
<OutputFile>.\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\ns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Lib>
<OutputFile>.\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
</Lib>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkzone.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{66028555-7DD5-4016-B601-9EF9A1EE8BFA}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>checkzone</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y named-checkzone.exe named-compilezone.exe
copy /Y named-checkzone.ilk named-compilezone.ilk
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y named-checkzone.exe named-compilezone.exe
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkzone.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

30
bin/confgen/Makefile.am Normal file
View File

@@ -0,0 +1,30 @@
include $(top_srcdir)/Makefile.top
AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
-DRNDC_KEYFILE=\"${sysconfdir}/rndc.key\"
LDADD += \
libconfgen.la \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS)
noinst_LTLIBRARIES = libconfgen.la
libconfgen_la_SOURCES = \
include/confgen/os.h \
keygen.c \
keygen.h \
os.c \
util.c \
util.h
sbin_PROGRAMS = tsig-keygen rndc-confgen
install-exec-hook:
ln -f $(DESTDIR)$(sbindir)/tsig-keygen \
$(DESTDIR)$(sbindir)/ddns-confgen
uninstall-hook:
-rm -f $(DESTDIR)$(sbindir)/ddns-confgen

View File

@@ -1,113 +0,0 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# 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 http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
# Attempt to disable parallel processing.
.NOTPARALLEL:
.NO_PARALLEL:
VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include ${ISC_INCLUDES} ${ISCCC_INCLUDES} \
${ISCCFG_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES}
CDEFINES =
CWARNINGS =
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
ISCCCLIBS = ../../lib/isccc/libisccc.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
ISCCCDEPLIBS = ../../lib/isccc/libisccc.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
RNDCLIBS = ${ISCCFGLIBS} ${ISCCCLIBS} ${BIND9LIBS} ${DNSLIBS} ${ISCLIBS} @LIBS@
RNDCDEPLIBS = ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${BIND9DEPLIBS} ${DNSDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
NOSYMLIBS = ${DNSLIBS} ${ISCNOSYMLIBS} @LIBS@
CONFDEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
SRCS= rndc-confgen.c ddns-confgen.c
SUBDIRS = unix
TARGETS = rndc-confgen@EXEEXT@ ddns-confgen@EXEEXT@ tsig-keygen@EXEEXT@
MANPAGES = rndc-confgen.8 ddns-confgen.8
HTMLPAGES = rndc-confgen.html ddns-confgen.html
MANOBJS = ${MANPAGES} ${HTMLPAGES}
UOBJS = unix/os.@O@
@BIND9_MAKE_RULES@
rndc-confgen.@O@: rndc-confgen.c
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
-DRNDC_KEYFILE=\"${sysconfdir}/rndc.key\" \
-c ${srcdir}/rndc-confgen.c
ddns-confgen.@O@: ddns-confgen.c
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -c ${srcdir}/ddns-confgen.c
rndc-confgen@EXEEXT@: rndc-confgen.@O@ util.@O@ keygen.@O@ ${CONFDEPLIBS}
export BASEOBJS="rndc-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS}"; \
${FINALBUILDCMD}
ddns-confgen@EXEEXT@: ddns-confgen.@O@ util.@O@ keygen.@O@ ${CONFDEPLIBS}
export BASEOBJS="ddns-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS}"; \
${FINALBUILDCMD}
# make a link in the build directory to assist with testing
tsig-keygen@EXEEXT@: ddns-confgen@EXEEXT@
rm -f tsig-keygen@EXEEXT@
${LINK_PROGRAM} ddns-confgen@EXEEXT@ tsig-keygen@EXEEXT@
doc man:: ${MANOBJS}
docclean manclean maintainer-clean::
rm -f ${MANOBJS}
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
install:: rndc-confgen@EXEEXT@ ddns-confgen@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} rndc-confgen@EXEEXT@ ${DESTDIR}${sbindir}
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} ddns-confgen@EXEEXT@ ${DESTDIR}${sbindir}
${INSTALL_DATA} ${srcdir}/rndc-confgen.8 ${DESTDIR}${mandir}/man8
${INSTALL_DATA} ${srcdir}/ddns-confgen.8 ${DESTDIR}${mandir}/man8
(cd ${DESTDIR}${sbindir}; rm -f tsig-keygen@EXEEXT@; ${LINK_PROGRAM} ddns-confgen@EXEEXT@ tsig-keygen@EXEEXT@)
(cd ${DESTDIR}${mandir}/man8; rm -f tsig-keygen.8; ${LINK_PROGRAM} ddns-confgen.8 tsig-keygen.8)
uninstall::
rm -f ${DESTDIR}${mandir}/man8/tsig-keygen.8
rm -f ${DESTDIR}${sbindir}/tsig-keygen@EXEEXT@
rm -f ${DESTDIR}${mandir}/man8/ddns-confgen.8
rm -f ${DESTDIR}${mandir}/man8/rndc-confgen.8
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/ddns-confgen@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/rndc-confgen@EXEEXT@
clean distclean maintainer-clean::
rm -f ${TARGETS}

View File

@@ -1,148 +0,0 @@
.\" Copyright (C) 2009, 2014-2016, 2018 Internet Systems Consortium, Inc. ("ISC")
.\"
.\" 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 http://mozilla.org/MPL/2.0/.
.\"
.hy 0
.ad l
'\" t
.\" Title: ddns-confgen
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 2014-03-06
.\" Manual: BIND9
.\" Source: ISC
.\" Language: English
.\"
.TH "DDNS\-CONFGEN" "8" "2014\-03\-06" "ISC" "BIND9"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ddns-confgen \- ddns key generation tool
.SH "SYNOPSIS"
.HP \w'\fBtsig\-keygen\fR\ 'u
\fBtsig\-keygen\fR [\fB\-a\ \fR\fB\fIalgorithm\fR\fR] [\fB\-h\fR] [name]
.HP \w'\fBddns\-confgen\fR\ 'u
\fBddns\-confgen\fR [\fB\-a\ \fR\fB\fIalgorithm\fR\fR] [\fB\-h\fR] [\fB\-k\ \fR\fB\fIkeyname\fR\fR] [\fB\-q\fR] [\fB\-r\ \fR\fB\fIrandomfile\fR\fR] [\-s\ \fIname\fR | \-z\ \fIzone\fR]
.SH "DESCRIPTION"
.PP
\fBtsig\-keygen\fR
and
\fBddns\-confgen\fR
are invocation methods for a utility that generates keys for use in TSIG signing\&. The resulting keys can be used, for example, to secure dynamic DNS updates to a zone or for the
\fBrndc\fR
command channel\&.
.PP
When run as
\fBtsig\-keygen\fR, a domain name can be specified on the command line which will be used as the name of the generated key\&. If no name is specified, the default is
\fBtsig\-key\fR\&.
.PP
When run as
\fBddns\-confgen\fR, the generated key is accompanied by configuration text and instructions that can be used with
\fBnsupdate\fR
and
\fBnamed\fR
when setting up dynamic DNS, including an example
\fBupdate\-policy\fR
statement\&. (This usage similar to the
\fBrndc\-confgen\fR
command for setting up command channel security\&.)
.PP
Note that
\fBnamed\fR
itself can configure a local DDNS key for use with
\fBnsupdate \-l\fR: it does this when a zone is configured with
\fBupdate\-policy local;\fR\&.
\fBddns\-confgen\fR
is only needed when a more elaborate configuration is required: for instance, if
\fBnsupdate\fR
is to be used from a remote system\&.
.SH "OPTIONS"
.PP
\-a \fIalgorithm\fR
.RS 4
Specifies the algorithm to use for the TSIG key\&. Available choices are: hmac\-md5, hmac\-sha1, hmac\-sha224, hmac\-sha256, hmac\-sha384 and hmac\-sha512\&. The default is hmac\-sha256\&. Options are case\-insensitive, and the "hmac\-" prefix may be omitted\&.
.RE
.PP
\-h
.RS 4
Prints a short summary of options and arguments\&.
.RE
.PP
\-k \fIkeyname\fR
.RS 4
Specifies the key name of the DDNS authentication key\&. The default is
\fBddns\-key\fR
when neither the
\fB\-s\fR
nor
\fB\-z\fR
option is specified; otherwise, the default is
\fBddns\-key\fR
as a separate label followed by the argument of the option, e\&.g\&.,
\fBddns\-key\&.example\&.com\&.\fR
The key name must have the format of a valid domain name, consisting of letters, digits, hyphens and periods\&.
.RE
.PP
\-q
.RS 4
(\fBddns\-confgen\fR
only\&.) Quiet mode: Print only the key, with no explanatory text or usage examples; This is essentially identical to
\fBtsig\-keygen\fR\&.
.RE
.PP
\-s \fIname\fR
.RS 4
(\fBddns\-confgen\fR
only\&.) Generate configuration example to allow dynamic updates of a single hostname\&. The example
\fBnamed\&.conf\fR
text shows how to set an update policy for the specified
\fIname\fR
using the "name" nametype\&. The default key name is ddns\-key\&.\fIname\fR\&. Note that the "self" nametype cannot be used, since the name to be updated may differ from the key name\&. This option cannot be used with the
\fB\-z\fR
option\&.
.RE
.PP
\-z \fIzone\fR
.RS 4
(\fBddns\-confgen\fR
only\&.) Generate configuration example to allow dynamic updates of a zone: The example
\fBnamed\&.conf\fR
text shows how to set an update policy for the specified
\fIzone\fR
using the "zonesub" nametype, allowing updates to all subdomain names within that
\fIzone\fR\&. This option cannot be used with the
\fB\-s\fR
option\&.
.RE
.SH "SEE ALSO"
.PP
\fBnsupdate\fR(1),
\fBnamed.conf\fR(5),
\fBnamed\fR(8),
BIND 9 Administrator Reference Manual\&.
.SH "AUTHOR"
.PP
\fBInternet Systems Consortium, Inc\&.\fR
.SH "COPYRIGHT"
.br
Copyright \(co 2009, 2014-2016, 2018 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,301 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
/**
* ddns-confgen generates configuration files for dynamic DNS. It can
* be used as a convenient alternative to writing the ddns.key file
* and the corresponding key and update-policy statements in named.conf.
*/
#include <config.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/file.h>
#include <isc/mem.h>
#include <isc/net.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/util.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif
#include <dns/keyvalues.h>
#include <dns/name.h>
#include <dns/result.h>
#include <dst/dst.h>
#include <confgen/os.h>
#include "util.h"
#include "keygen.h"
#define KEYGEN_DEFAULT "tsig-key"
#define CONFGEN_DEFAULT "ddns-key"
static char program[256];
const char *progname;
static enum { progmode_keygen, progmode_confgen} progmode;
bool verbose = false; /* needed by util.c but not used here */
ISC_PLATFORM_NORETURN_PRE static void
usage(int status) ISC_PLATFORM_NORETURN_POST;
static void
usage(int status) {
if (progmode == progmode_confgen) {
fprintf(stderr, "\
Usage:\n\
%s [-a alg] [-k keyname] [-q] [-s name | -z zone]\n\
-a alg: algorithm (default hmac-sha256)\n\
-k keyname: name of the key as it will be used in named.conf\n\
-s name: domain name to be updated using the created key\n\
-z zone: name of the zone as it will be used in named.conf\n\
-q: quiet mode: print the key, with no explanatory text\n",
progname);
} else {
fprintf(stderr, "\
Usage:\n\
%s [-a alg] [keyname]\n\
-a alg: algorithm (default hmac-sha256)\n\n",
progname);
}
exit (status);
}
int
main(int argc, char **argv) {
isc_result_t result = ISC_R_SUCCESS;
bool show_final_mem = false;
bool quiet = false;
isc_buffer_t key_txtbuffer;
char key_txtsecret[256];
isc_mem_t *mctx = NULL;
const char *keyname = NULL;
const char *zone = NULL;
const char *self_domain = NULL;
char *keybuf = NULL;
dns_secalg_t alg = DST_ALG_HMACSHA256;
const char *algname;
int keysize = 256;
int len = 0;
int ch;
#if USE_PKCS11
pk11_result_register();
#endif
dns_result_register();
result = isc_file_progname(*argv, program, sizeof(program));
if (result != ISC_R_SUCCESS)
memmove(program, "tsig-keygen", 11);
progname = program;
/*
* Libtool doesn't preserve the program name prior to final
* installation. Remove the libtool prefix ("lt-").
*/
if (strncmp(progname, "lt-", 3) == 0)
progname += 3;
#define PROGCMP(X) \
(strcasecmp(progname, X) == 0 || strcasecmp(progname, X ".exe") == 0)
if (PROGCMP("tsig-keygen")) {
progmode = progmode_keygen;
quiet = true;
} else if (PROGCMP("ddns-confgen")) {
progmode = progmode_confgen;
} else {
INSIST(0);
ISC_UNREACHABLE();
}
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv,
"a:hk:Mmr:qs:y:z:")) != -1) {
switch (ch) {
case 'a':
algname = isc_commandline_argument;
alg = alg_fromtext(algname);
if (alg == DST_ALG_UNKNOWN)
fatal("Unsupported algorithm '%s'", algname);
keysize = alg_bits(alg);
break;
case 'h':
usage(0);
case 'k':
case 'y':
if (progmode == progmode_confgen)
keyname = isc_commandline_argument;
else
usage(1);
break;
case 'M':
isc_mem_debugging = ISC_MEM_DEBUGTRACE;
break;
case 'm':
show_final_mem = true;
break;
case 'q':
if (progmode == progmode_confgen)
quiet = true;
else
usage(1);
break;
case 'r':
fatal("The -r option has been deprecated.");
break;
case 's':
if (progmode == progmode_confgen)
self_domain = isc_commandline_argument;
else
usage(1);
break;
case 'z':
if (progmode == progmode_confgen)
zone = isc_commandline_argument;
else
usage(1);
break;
case '?':
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
usage(1);
} else
usage(0);
break;
default:
fprintf(stderr, "%s: unhandled option -%c\n",
program, isc_commandline_option);
exit(1);
}
}
if (progmode == progmode_keygen)
keyname = argv[isc_commandline_index++];
POST(argv);
if (self_domain != NULL && zone != NULL)
usage(1); /* -s and -z cannot coexist */
if (argc > isc_commandline_index)
usage(1);
/* Use canonical algorithm name */
algname = alg_totext(alg);
DO("create memory context", isc_mem_create(0, 0, &mctx));
if (keyname == NULL) {
const char *suffix = NULL;
keyname = ((progmode == progmode_keygen)
? KEYGEN_DEFAULT
: CONFGEN_DEFAULT);
if (self_domain != NULL)
suffix = self_domain;
else if (zone != NULL)
suffix = zone;
if (suffix != NULL) {
len = strlen(keyname) + strlen(suffix) + 2;
keybuf = isc_mem_get(mctx, len);
if (keybuf == NULL)
fatal("failed to allocate memory for keyname");
snprintf(keybuf, len, "%s.%s", keyname, suffix);
keyname = (const char *) keybuf;
}
}
isc_buffer_init(&key_txtbuffer, &key_txtsecret, sizeof(key_txtsecret));
generate_key(mctx, alg, keysize, &key_txtbuffer);
if (!quiet)
printf("\
# To activate this key, place the following in named.conf, and\n\
# in a separate keyfile on the system or systems from which nsupdate\n\
# will be run:\n");
printf("\
key \"%s\" {\n\
algorithm %s;\n\
secret \"%.*s\";\n\
};\n",
keyname, algname,
(int)isc_buffer_usedlength(&key_txtbuffer),
(char *)isc_buffer_base(&key_txtbuffer));
if (!quiet) {
if (self_domain != NULL) {
printf("\n\
# Then, in the \"zone\" statement for the zone containing the\n\
# name \"%s\", place an \"update-policy\" statement\n\
# like this one, adjusted as needed for your preferred permissions:\n\
update-policy {\n\
grant %s name %s ANY;\n\
};\n",
self_domain, keyname, self_domain);
} else if (zone != NULL) {
printf("\n\
# Then, in the \"zone\" definition statement for \"%s\",\n\
# place an \"update-policy\" statement like this one, adjusted as \n\
# needed for your preferred permissions:\n\
update-policy {\n\
grant %s zonesub ANY;\n\
};\n",
zone, keyname);
} else {
printf("\n\
# Then, in the \"zone\" statement for each zone you wish to dynamically\n\
# update, place an \"update-policy\" statement granting update permission\n\
# to this key. For example, the following statement grants this key\n\
# permission to update any name within the zone:\n\
update-policy {\n\
grant %s zonesub ANY;\n\
};\n",
keyname);
}
printf("\n\
# After the keyfile has been placed, the following command will\n\
# execute nsupdate using this key:\n\
nsupdate -k <keyfile>\n");
}
if (keybuf != NULL)
isc_mem_put(mctx, keybuf, len);
if (show_final_mem)
isc_mem_stats(mctx, stderr);
isc_mem_destroy(&mctx);
return (0);
}

View File

@@ -1,211 +0,0 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- 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 http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
<!-- Converted by db4-upgrade version 1.0 -->
<refentry xmlns:db="http://docbook.org/ns/docbook" version="5.0" xml:id="man.ddns-confgen">
<info>
<date>2014-03-06</date>
</info>
<refentryinfo>
<corpname>ISC</corpname>
<corpauthor>Internet Systems Consortium, Inc.</corpauthor>
</refentryinfo>
<refmeta>
<refentrytitle><application>ddns-confgen</application></refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
<refnamediv>
<refname><application>ddns-confgen</application></refname>
<refpurpose>ddns key generation tool</refpurpose>
</refnamediv>
<docinfo>
<copyright>
<year>2009</year>
<year>2014</year>
<year>2015</year>
<year>2016</year>
<year>2018</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
<refsynopsisdiv>
<cmdsynopsis sepchar=" ">
<command>tsig-keygen</command>
<arg choice="opt" rep="norepeat"><option>-a <replaceable class="parameter">algorithm</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-h</option></arg>
<arg choice="opt" rep="norepeat">name</arg>
</cmdsynopsis>
<cmdsynopsis sepchar=" ">
<command>ddns-confgen</command>
<arg choice="opt" rep="norepeat"><option>-a <replaceable class="parameter">algorithm</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-h</option></arg>
<arg choice="opt" rep="norepeat"><option>-k <replaceable class="parameter">keyname</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-q</option></arg>
<arg choice="opt" rep="norepeat"><option>-r <replaceable class="parameter">randomfile</replaceable></option></arg>
<group choice="opt" rep="norepeat">
<arg choice="plain" rep="norepeat">-s <replaceable class="parameter">name</replaceable></arg>
<arg choice="plain" rep="norepeat">-z <replaceable class="parameter">zone</replaceable></arg>
</group>
</cmdsynopsis>
</refsynopsisdiv>
<refsection><info><title>DESCRIPTION</title></info>
<para>
<command>tsig-keygen</command> and <command>ddns-confgen</command>
are invocation methods for a utility that generates keys for use
in TSIG signing. The resulting keys can be used, for example,
to secure dynamic DNS updates to a zone or for the
<command>rndc</command> command channel.
</para>
<para>
When run as <command>tsig-keygen</command>, a domain name
can be specified on the command line which will be used as
the name of the generated key. If no name is specified,
the default is <constant>tsig-key</constant>.
</para>
<para>
When run as <command>ddns-confgen</command>, the generated
key is accompanied by configuration text and instructions
that can be used with <command>nsupdate</command> and
<command>named</command> when setting up dynamic DNS,
including an example <command>update-policy</command>
statement. (This usage similar to the
<command>rndc-confgen</command> command for setting
up command channel security.)
</para>
<para>
Note that <command>named</command> itself can configure a
local DDNS key for use with <command>nsupdate -l</command>:
it does this when a zone is configured with
<command>update-policy local;</command>.
<command>ddns-confgen</command> is only needed when a
more elaborate configuration is required: for instance,
if <command>nsupdate</command> is to be used from a remote
system.
</para>
</refsection>
<refsection><info><title>OPTIONS</title></info>
<variablelist>
<varlistentry>
<term>-a <replaceable class="parameter">algorithm</replaceable></term>
<listitem>
<para>
Specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256,
hmac-sha384 and hmac-sha512. The default is hmac-sha256.
Options are case-insensitive, and the "hmac-" prefix
may be omitted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-h</term>
<listitem>
<para>
Prints a short summary of options and arguments.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-k <replaceable class="parameter">keyname</replaceable></term>
<listitem>
<para>
Specifies the key name of the DDNS authentication key.
The default is <constant>ddns-key</constant> when neither
the <option>-s</option> nor <option>-z</option> option is
specified; otherwise, the default
is <constant>ddns-key</constant> as a separate label
followed by the argument of the option, e.g.,
<constant>ddns-key.example.com.</constant>
The key name must have the format of a valid domain name,
consisting of letters, digits, hyphens and periods.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-q</term>
<listitem>
<para>
(<command>ddns-confgen</command> only.) Quiet mode: Print
only the key, with no explanatory text or usage examples;
This is essentially identical to <command>tsig-keygen</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-s <replaceable class="parameter">name</replaceable></term>
<listitem>
<para>
(<command>ddns-confgen</command> only.)
Generate configuration example to allow dynamic updates
of a single hostname. The example <command>named.conf</command>
text shows how to set an update policy for the specified
<replaceable class="parameter">name</replaceable>
using the "name" nametype. The default key name is
ddns-key.<replaceable class="parameter">name</replaceable>.
Note that the "self" nametype cannot be used, since
the name to be updated may differ from the key name.
This option cannot be used with the <option>-z</option> option.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-z <replaceable class="parameter">zone</replaceable></term>
<listitem>
<para>
(<command>ddns-confgen</command> only.)
Generate configuration example to allow dynamic updates
of a zone: The example <command>named.conf</command> text
shows how to set an update policy for the specified
<replaceable class="parameter">zone</replaceable>
using the "zonesub" nametype, allowing updates to
all subdomain names within that
<replaceable class="parameter">zone</replaceable>.
This option cannot be used with the <option>-s</option> option.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection><info><title>SEE ALSO</title></info>
<para><citerefentry>
<refentrytitle>nsupdate</refentrytitle><manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>named.conf</refentrytitle><manvolnum>5</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citetitle>BIND 9 Administrator Reference Manual</citetitle>.
</para>
</refsection>
</refentry>

View File

@@ -1,187 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
- Copyright (C) 2009, 2014-2016, 2018 Internet Systems Consortium, Inc. ("ISC")
-
- 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 http://mozilla.org/MPL/2.0/.
-->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ddns-confgen</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
<a name="man.ddns-confgen"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>
<span class="application">ddns-confgen</span>
&#8212; ddns key generation tool
</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="cmdsynopsis"><p>
<code class="command">tsig-keygen</code>
[<code class="option">-a <em class="replaceable"><code>algorithm</code></em></code>]
[<code class="option">-h</code>]
[name]
</p></div>
<div class="cmdsynopsis"><p>
<code class="command">ddns-confgen</code>
[<code class="option">-a <em class="replaceable"><code>algorithm</code></em></code>]
[<code class="option">-h</code>]
[<code class="option">-k <em class="replaceable"><code>keyname</code></em></code>]
[<code class="option">-q</code>]
[<code class="option">-r <em class="replaceable"><code>randomfile</code></em></code>]
[
-s <em class="replaceable"><code>name</code></em>
| -z <em class="replaceable"><code>zone</code></em>
]
</p></div>
</div>
<div class="refsection">
<a name="id-1.7"></a><h2>DESCRIPTION</h2>
<p>
<span class="command"><strong>tsig-keygen</strong></span> and <span class="command"><strong>ddns-confgen</strong></span>
are invocation methods for a utility that generates keys for use
in TSIG signing. The resulting keys can be used, for example,
to secure dynamic DNS updates to a zone or for the
<span class="command"><strong>rndc</strong></span> command channel.
</p>
<p>
When run as <span class="command"><strong>tsig-keygen</strong></span>, a domain name
can be specified on the command line which will be used as
the name of the generated key. If no name is specified,
the default is <code class="constant">tsig-key</code>.
</p>
<p>
When run as <span class="command"><strong>ddns-confgen</strong></span>, the generated
key is accompanied by configuration text and instructions
that can be used with <span class="command"><strong>nsupdate</strong></span> and
<span class="command"><strong>named</strong></span> when setting up dynamic DNS,
including an example <span class="command"><strong>update-policy</strong></span>
statement. (This usage similar to the
<span class="command"><strong>rndc-confgen</strong></span> command for setting
up command channel security.)
</p>
<p>
Note that <span class="command"><strong>named</strong></span> itself can configure a
local DDNS key for use with <span class="command"><strong>nsupdate -l</strong></span>:
it does this when a zone is configured with
<span class="command"><strong>update-policy local;</strong></span>.
<span class="command"><strong>ddns-confgen</strong></span> is only needed when a
more elaborate configuration is required: for instance,
if <span class="command"><strong>nsupdate</strong></span> is to be used from a remote
system.
</p>
</div>
<div class="refsection">
<a name="id-1.8"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl class="variablelist">
<dt><span class="term">-a <em class="replaceable"><code>algorithm</code></em></span></dt>
<dd>
<p>
Specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256,
hmac-sha384 and hmac-sha512. The default is hmac-sha256.
Options are case-insensitive, and the "hmac-" prefix
may be omitted.
</p>
</dd>
<dt><span class="term">-h</span></dt>
<dd>
<p>
Prints a short summary of options and arguments.
</p>
</dd>
<dt><span class="term">-k <em class="replaceable"><code>keyname</code></em></span></dt>
<dd>
<p>
Specifies the key name of the DDNS authentication key.
The default is <code class="constant">ddns-key</code> when neither
the <code class="option">-s</code> nor <code class="option">-z</code> option is
specified; otherwise, the default
is <code class="constant">ddns-key</code> as a separate label
followed by the argument of the option, e.g.,
<code class="constant">ddns-key.example.com.</code>
The key name must have the format of a valid domain name,
consisting of letters, digits, hyphens and periods.
</p>
</dd>
<dt><span class="term">-q</span></dt>
<dd>
<p>
(<span class="command"><strong>ddns-confgen</strong></span> only.) Quiet mode: Print
only the key, with no explanatory text or usage examples;
This is essentially identical to <span class="command"><strong>tsig-keygen</strong></span>.
</p>
</dd>
<dt><span class="term">-s <em class="replaceable"><code>name</code></em></span></dt>
<dd>
<p>
(<span class="command"><strong>ddns-confgen</strong></span> only.)
Generate configuration example to allow dynamic updates
of a single hostname. The example <span class="command"><strong>named.conf</strong></span>
text shows how to set an update policy for the specified
<em class="replaceable"><code>name</code></em>
using the "name" nametype. The default key name is
ddns-key.<em class="replaceable"><code>name</code></em>.
Note that the "self" nametype cannot be used, since
the name to be updated may differ from the key name.
This option cannot be used with the <code class="option">-z</code> option.
</p>
</dd>
<dt><span class="term">-z <em class="replaceable"><code>zone</code></em></span></dt>
<dd>
<p>
(<span class="command"><strong>ddns-confgen</strong></span> only.)
Generate configuration example to allow dynamic updates
of a zone: The example <span class="command"><strong>named.conf</strong></span> text
shows how to set an update policy for the specified
<em class="replaceable"><code>zone</code></em>
using the "zonesub" nametype, allowing updates to
all subdomain names within that
<em class="replaceable"><code>zone</code></em>.
This option cannot be used with the <code class="option">-s</code> option.
</p>
</dd>
</dl></div>
</div>
<div class="refsection">
<a name="id-1.9"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry">
<span class="refentrytitle">nsupdate</span>(1)
</span>,
<span class="citerefentry">
<span class="refentrytitle">named.conf</span>(5)
</span>,
<span class="citerefentry">
<span class="refentrytitle">named</span>(8)
</span>,
<em class="citetitle">BIND 9 Administrator Reference Manual</em>.
</p>
</div>
</div></body>
</html>

View File

@@ -0,0 +1 @@
../../../.clang-format.headers

View File

@@ -3,24 +3,25 @@
*
* 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 http://mozilla.org/MPL/2.0/.
* 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.
*/
/*! \file */
#ifndef RNDC_OS_H
#define RNDC_OS_H 1
#include <isc/lang.h>
#include <stdio.h>
#include <isc/lang.h>
ISC_LANG_BEGINDECLS
int set_user(FILE *fd, const char *user);
int
set_user(FILE *fd, const char *user);
/*%<
* Set the owner of the file referenced by 'fd' to 'user'.
* Returns:
@@ -30,4 +31,4 @@ int set_user(FILE *fd, const char *user);
ISC_LANG_ENDDECLS
#endif
#endif /* ifndef RNDC_OS_H */

View File

@@ -3,19 +3,17 @@
*
* 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 http://mozilla.org/MPL/2.0/.
* 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.
*/
/*! \file */
#include <config.h>
#include <stdlib.h>
#include "keygen.h"
#include <stdarg.h>
#include <stdlib.h>
#include <isc/base64.h>
#include <isc/buffer.h>
@@ -31,10 +29,10 @@
#include <dns/name.h>
#include <dst/dst.h>
#include <confgen/os.h>
#include "util.h"
#include "keygen.h"
/*%
* Convert algorithm type to string.
@@ -42,20 +40,20 @@
const char *
alg_totext(dns_secalg_t alg) {
switch (alg) {
case DST_ALG_HMACMD5:
return "hmac-md5";
case DST_ALG_HMACSHA1:
return "hmac-sha1";
case DST_ALG_HMACSHA224:
return "hmac-sha224";
case DST_ALG_HMACSHA256:
return "hmac-sha256";
case DST_ALG_HMACSHA384:
return "hmac-sha384";
case DST_ALG_HMACSHA512:
return "hmac-sha512";
default:
return "(unknown)";
case DST_ALG_HMACMD5:
return ("hmac-md5");
case DST_ALG_HMACSHA1:
return ("hmac-sha1");
case DST_ALG_HMACSHA224:
return ("hmac-sha224");
case DST_ALG_HMACSHA256:
return ("hmac-sha256");
case DST_ALG_HMACSHA384:
return ("hmac-sha384");
case DST_ALG_HMACSHA512:
return ("hmac-sha512");
default:
return ("(unknown)");
}
}
@@ -65,22 +63,29 @@ alg_totext(dns_secalg_t alg) {
dns_secalg_t
alg_fromtext(const char *name) {
const char *p = name;
if (strncasecmp(p, "hmac-", 5) == 0)
if (strncasecmp(p, "hmac-", 5) == 0) {
p = &name[5];
}
if (strcasecmp(p, "md5") == 0)
return DST_ALG_HMACMD5;
if (strcasecmp(p, "sha1") == 0)
return DST_ALG_HMACSHA1;
if (strcasecmp(p, "sha224") == 0)
return DST_ALG_HMACSHA224;
if (strcasecmp(p, "sha256") == 0)
return DST_ALG_HMACSHA256;
if (strcasecmp(p, "sha384") == 0)
return DST_ALG_HMACSHA384;
if (strcasecmp(p, "sha512") == 0)
return DST_ALG_HMACSHA512;
return DST_ALG_UNKNOWN;
if (strcasecmp(p, "md5") == 0) {
return (DST_ALG_HMACMD5);
}
if (strcasecmp(p, "sha1") == 0) {
return (DST_ALG_HMACSHA1);
}
if (strcasecmp(p, "sha224") == 0) {
return (DST_ALG_HMACSHA224);
}
if (strcasecmp(p, "sha256") == 0) {
return (DST_ALG_HMACSHA256);
}
if (strcasecmp(p, "sha384") == 0) {
return (DST_ALG_HMACSHA384);
}
if (strcasecmp(p, "sha512") == 0) {
return (DST_ALG_HMACSHA512);
}
return (DST_ALG_UNKNOWN);
}
/*%
@@ -89,20 +94,20 @@ alg_fromtext(const char *name) {
int
alg_bits(dns_secalg_t alg) {
switch (alg) {
case DST_ALG_HMACMD5:
return 128;
case DST_ALG_HMACSHA1:
return 160;
case DST_ALG_HMACSHA224:
return 224;
case DST_ALG_HMACSHA256:
return 256;
case DST_ALG_HMACSHA384:
return 384;
case DST_ALG_HMACSHA512:
return 512;
default:
return 0;
case DST_ALG_HMACMD5:
return (128);
case DST_ALG_HMACSHA1:
return (160);
case DST_ALG_HMACSHA224:
return (224);
case DST_ALG_HMACSHA256:
return (256);
case DST_ALG_HMACSHA384:
return (384);
case DST_ALG_HMACSHA512:
return (512);
default:
return (0);
}
}
@@ -119,30 +124,31 @@ generate_key(isc_mem_t *mctx, dns_secalg_t alg, int keysize,
dst_key_t *key = NULL;
switch (alg) {
case DST_ALG_HMACMD5:
case DST_ALG_HMACSHA1:
case DST_ALG_HMACSHA224:
case DST_ALG_HMACSHA256:
if (keysize < 1 || keysize > 512)
case DST_ALG_HMACMD5:
case DST_ALG_HMACSHA1:
case DST_ALG_HMACSHA224:
case DST_ALG_HMACSHA256:
if (keysize < 1 || keysize > 512) {
fatal("keysize %d out of range (must be 1-512)\n",
keysize);
}
break;
case DST_ALG_HMACSHA384:
case DST_ALG_HMACSHA512:
if (keysize < 1 || keysize > 1024)
case DST_ALG_HMACSHA384:
case DST_ALG_HMACSHA512:
if (keysize < 1 || keysize > 1024) {
fatal("keysize %d out of range (must be 1-1024)\n",
keysize);
}
break;
default:
default:
fatal("unsupported algorithm %d\n", alg);
}
DO("initialize dst library", dst_lib_init(mctx, NULL));
DO("generate key", dst_key_generate(dns_rootname, alg,
keysize, 0, 0, DNS_KEYPROTO_ANY,
dns_rdataclass_in, mctx, &key,
NULL));
DO("generate key",
dst_key_generate(dns_rootname, alg, keysize, 0, 0, DNS_KEYPROTO_ANY,
dns_rdataclass_in, mctx, &key, NULL));
isc_buffer_init(&key_rawbuffer, &key_rawsecret, sizeof(key_rawsecret));
@@ -150,11 +156,12 @@ generate_key(isc_mem_t *mctx, dns_secalg_t alg, int keysize,
isc_buffer_usedregion(&key_rawbuffer, &key_rawregion);
DO("bsse64 encode secret", isc_base64_totext(&key_rawregion, -1, "",
key_txtbuffer));
DO("bsse64 encode secret",
isc_base64_totext(&key_rawregion, -1, "", key_txtbuffer));
if (key != NULL)
if (key != NULL) {
dst_key_free(&key);
}
dst_lib_destroy();
}
@@ -165,9 +172,8 @@ generate_key(isc_mem_t *mctx, dns_secalg_t alg, int keysize,
* the name 'keyname' and the secret in the buffer 'secret'.
*/
void
write_key_file(const char *keyfile, const char *user,
const char *keyname, isc_buffer_t *secret,
dns_secalg_t alg) {
write_key_file(const char *keyfile, const char *user, const char *keyname,
isc_buffer_t *secret, dns_secalg_t alg) {
isc_result_t result;
const char *algname = alg_totext(alg);
FILE *fd = NULL;
@@ -175,19 +181,21 @@ write_key_file(const char *keyfile, const char *user,
DO("create keyfile", isc_file_safecreate(keyfile, &fd));
if (user != NULL) {
if (set_user(fd, user) == -1)
if (set_user(fd, user) == -1) {
fatal("unable to set file owner\n");
}
}
fprintf(fd, "key \"%s\" {\n\talgorithm %s;\n"
fprintf(fd,
"key \"%s\" {\n\talgorithm %s;\n"
"\tsecret \"%.*s\";\n};\n",
keyname, algname,
(int)isc_buffer_usedlength(secret),
keyname, algname, (int)isc_buffer_usedlength(secret),
(char *)isc_buffer_base(secret));
fflush(fd);
if (ferror(fd))
if (ferror(fd)) {
fatal("write to %s failed\n", keyfile);
if (fclose(fd))
}
if (fclose(fd)) {
fatal("fclose(%s) failed\n", keyfile);
fprintf(stderr, "wrote key file \"%s\"\n", keyfile);
}
}

View File

@@ -3,32 +3,39 @@
*
* 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 http://mozilla.org/MPL/2.0/.
* 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.
*/
#ifndef RNDC_KEYGEN_H
#define RNDC_KEYGEN_H 1
/*! \file */
#include <isc/buffer.h>
#include <isc/lang.h>
#include <isc/mem.h>
#include <dns/secalg.h>
ISC_LANG_BEGINDECLS
void generate_key(isc_mem_t *mctx, dns_secalg_t alg, int keysize,
isc_buffer_t *key_txtbuffer);
void
generate_key(isc_mem_t *mctx, dns_secalg_t alg, int keysize,
isc_buffer_t *key_txtbuffer);
void write_key_file(const char *keyfile, const char *user,
const char *keyname, isc_buffer_t *secret,
dns_secalg_t alg);
void
write_key_file(const char *keyfile, const char *user, const char *keyname,
isc_buffer_t *secret, dns_secalg_t alg);
const char *alg_totext(dns_secalg_t alg);
dns_secalg_t alg_fromtext(const char *name);
int alg_bits(dns_secalg_t alg);
const char *
alg_totext(dns_secalg_t alg);
dns_secalg_t
alg_fromtext(const char *name);
int
alg_bits(dns_secalg_t alg);
ISC_LANG_ENDDECLS

34
bin/confgen/os.c Normal file
View File

@@ -0,0 +1,34 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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.
*/
/*! \file */
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <confgen/os.h>
int
set_user(FILE *fd, const char *user) {
struct passwd *pw;
pw = getpwnam(user);
if (pw == NULL) {
errno = EINVAL;
return (-1);
}
return (fchown(fileno(fd), pw->pw_uid, -1));
}

View File

@@ -1,210 +0,0 @@
.\" Copyright (C) 2001, 2003-2005, 2007, 2009, 2013-2018 Internet Systems Consortium, Inc. ("ISC")
.\"
.\" 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 http://mozilla.org/MPL/2.0/.
.\"
.hy 0
.ad l
'\" t
.\" Title: rndc-confgen
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 2013-03-14
.\" Manual: BIND9
.\" Source: ISC
.\" Language: English
.\"
.TH "RNDC\-CONFGEN" "8" "2013\-03\-14" "ISC" "BIND9"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
rndc-confgen \- rndc key generation tool
.SH "SYNOPSIS"
.HP \w'\fBrndc\-confgen\fR\ 'u
\fBrndc\-confgen\fR [\fB\-a\fR] [\fB\-A\ \fR\fB\fIalgorithm\fR\fR] [\fB\-b\ \fR\fB\fIkeysize\fR\fR] [\fB\-c\ \fR\fB\fIkeyfile\fR\fR] [\fB\-h\fR] [\fB\-k\ \fR\fB\fIkeyname\fR\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-s\ \fR\fB\fIaddress\fR\fR] [\fB\-t\ \fR\fB\fIchrootdir\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR]
.SH "DESCRIPTION"
.PP
\fBrndc\-confgen\fR
generates configuration files for
\fBrndc\fR\&. It can be used as a convenient alternative to writing the
rndc\&.conf
file and the corresponding
\fBcontrols\fR
and
\fBkey\fR
statements in
named\&.conf
by hand\&. Alternatively, it can be run with the
\fB\-a\fR
option to set up a
rndc\&.key
file and avoid the need for a
rndc\&.conf
file and a
\fBcontrols\fR
statement altogether\&.
.SH "OPTIONS"
.PP
\-a
.RS 4
Do automatic
\fBrndc\fR
configuration\&. This creates a file
rndc\&.key
in
/etc
(or whatever
\fIsysconfdir\fR
was specified as when
BIND
was built) that is read by both
\fBrndc\fR
and
\fBnamed\fR
on startup\&. The
rndc\&.key
file defines a default command channel and authentication key allowing
\fBrndc\fR
to communicate with
\fBnamed\fR
on the local host with no further configuration\&.
.sp
Running
\fBrndc\-confgen \-a\fR
allows BIND 9 and
\fBrndc\fR
to be used as drop\-in replacements for BIND 8 and
\fBndc\fR, with no changes to the existing BIND 8
named\&.conf
file\&.
.sp
If a more elaborate configuration than that generated by
\fBrndc\-confgen \-a\fR
is required, for example if rndc is to be used remotely, you should run
\fBrndc\-confgen\fR
without the
\fB\-a\fR
option and set up a
rndc\&.conf
and
named\&.conf
as directed\&.
.RE
.PP
\-A \fIalgorithm\fR
.RS 4
Specifies the algorithm to use for the TSIG key\&. Available choices are: hmac\-md5, hmac\-sha1, hmac\-sha224, hmac\-sha256, hmac\-sha384 and hmac\-sha512\&. The default is hmac\-sha256\&.
.RE
.PP
\-b \fIkeysize\fR
.RS 4
Specifies the size of the authentication key in bits\&. Must be between 1 and 512 bits; the default is the hash size\&.
.RE
.PP
\-c \fIkeyfile\fR
.RS 4
Used with the
\fB\-a\fR
option to specify an alternate location for
rndc\&.key\&.
.RE
.PP
\-h
.RS 4
Prints a short summary of the options and arguments to
\fBrndc\-confgen\fR\&.
.RE
.PP
\-k \fIkeyname\fR
.RS 4
Specifies the key name of the rndc authentication key\&. This must be a valid domain name\&. The default is
\fBrndc\-key\fR\&.
.RE
.PP
\-p \fIport\fR
.RS 4
Specifies the command channel port where
\fBnamed\fR
listens for connections from
\fBrndc\fR\&. The default is 953\&.
.RE
.PP
\-s \fIaddress\fR
.RS 4
Specifies the IP address where
\fBnamed\fR
listens for command channel connections from
\fBrndc\fR\&. The default is the loopback address 127\&.0\&.0\&.1\&.
.RE
.PP
\-t \fIchrootdir\fR
.RS 4
Used with the
\fB\-a\fR
option to specify a directory where
\fBnamed\fR
will run chrooted\&. An additional copy of the
rndc\&.key
will be written relative to this directory so that it will be found by the chrooted
\fBnamed\fR\&.
.RE
.PP
\-u \fIuser\fR
.RS 4
Used with the
\fB\-a\fR
option to set the owner of the
rndc\&.key
file generated\&. If
\fB\-t\fR
is also specified only the file in the chroot area has its owner changed\&.
.RE
.SH "EXAMPLES"
.PP
To allow
\fBrndc\fR
to be used with no manual configuration, run
.PP
\fBrndc\-confgen \-a\fR
.PP
To print a sample
rndc\&.conf
file and corresponding
\fBcontrols\fR
and
\fBkey\fR
statements to be manually inserted into
named\&.conf, run
.PP
\fBrndc\-confgen\fR
.SH "SEE ALSO"
.PP
\fBrndc\fR(8),
\fBrndc.conf\fR(5),
\fBnamed\fR(8),
BIND 9 Administrator Reference Manual\&.
.SH "AUTHOR"
.PP
\fBInternet Systems Consortium, Inc\&.\fR
.SH "COPYRIGHT"
.br
Copyright \(co 2001, 2003-2005, 2007, 2009, 2013-2018 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -3,7 +3,7 @@
*
* 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 http://mozilla.org/MPL/2.0/.
* 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.
@@ -20,13 +20,12 @@
* controls statement altogether.
*/
#include <config.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/attributes.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
@@ -45,14 +44,15 @@
#include <dns/name.h>
#include <dst/dst.h>
#include <confgen/os.h>
#include "util.h"
#include "keygen.h"
#include "util.h"
#define DEFAULT_KEYNAME "rndc-key"
#define DEFAULT_SERVER "127.0.0.1"
#define DEFAULT_PORT 953
#define DEFAULT_KEYNAME "rndc-key"
#define DEFAULT_SERVER "127.0.0.1"
#define DEFAULT_PORT 953
static char program[256];
const char *progname;
@@ -61,12 +61,11 @@ bool verbose = false;
const char *keyfile, *keydef;
ISC_PLATFORM_NORETURN_PRE static void
usage(int status) ISC_PLATFORM_NORETURN_POST;
ISC_NORETURN static void
usage(int status);
static void
usage(int status) {
fprintf(stderr, "\
Usage:\n\
%s [-a] [-b bits] [-c keyfile] [-k keyname] [-p port] \
@@ -77,12 +76,13 @@ Usage:\n\
-c keyfile: specify an alternate key file (requires -a)\n\
-k keyname: the name as it will be used in named.conf and rndc.conf\n\
-p port: the port named will listen on and rndc will connect to\n\
-q: suppress printing written key path\n\
-s addr: the address to which rndc should connect\n\
-t chrootdir: write a keyfile in chrootdir as well (requires -a)\n\
-u user: set the keyfile owner to \"user\" (requires -a)\n",
progname, keydef);
progname, keydef);
exit (status);
exit(status);
}
int
@@ -105,13 +105,15 @@ main(int argc, char **argv) {
char *chrootdir = NULL;
char *user = NULL;
bool keyonly = false;
bool quiet = false;
int len;
keydef = keyfile = RNDC_KEYFILE;
result = isc_file_progname(*argv, program, sizeof(program));
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
memmove(program, "rndc-confgen", 13);
}
progname = program;
keyname = DEFAULT_KEYNAME;
@@ -131,13 +133,15 @@ main(int argc, char **argv) {
case 'A':
algname = isc_commandline_argument;
alg = alg_fromtext(algname);
if (alg == DST_ALG_UNKNOWN)
if (alg == DST_ALG_UNKNOWN) {
fatal("Unsupported algorithm '%s'", algname);
}
break;
case 'b':
keysize = strtol(isc_commandline_argument, &p, 10);
if (*p != '\0' || keysize < 0)
if (*p != '\0' || keysize < 0) {
fatal("-b requires a non-negative number");
}
break;
case 'c':
keyfile = isc_commandline_argument;
@@ -145,7 +149,7 @@ main(int argc, char **argv) {
case 'h':
usage(0);
case 'k':
case 'y': /* Compatible with rndc -y. */
case 'y': /* Compatible with rndc -y. */
keyname = isc_commandline_argument;
break;
case 'M':
@@ -157,9 +161,13 @@ main(int argc, char **argv) {
break;
case 'p':
port = strtol(isc_commandline_argument, &p, 10);
if (*p != '\0' || port < 0 || port > 65535)
if (*p != '\0' || port < 0 || port > 65535) {
fatal("port '%s' out of range",
isc_commandline_argument);
}
break;
case 'q':
quiet = true;
break;
case 'r':
fatal("The -r option has been deprecated.");
@@ -168,7 +176,9 @@ main(int argc, char **argv) {
serveraddr = isc_commandline_argument;
if (inet_pton(AF_INET, serveraddr, &addr4_dummy) != 1 &&
inet_pton(AF_INET6, serveraddr, &addr6_dummy) != 1)
{
fatal("-s should be an IPv4 or IPv6 address");
}
break;
case 't':
chrootdir = isc_commandline_argument;
@@ -184,12 +194,13 @@ main(int argc, char **argv) {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
usage(1);
} else
} else {
usage(0);
}
break;
default:
fprintf(stderr, "%s: unhandled option -%c\n",
program, isc_commandline_option);
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
exit(1);
}
}
@@ -198,20 +209,22 @@ main(int argc, char **argv) {
argv += isc_commandline_index;
POST(argv);
if (argc > 0)
if (argc > 0) {
usage(1);
if (alg == DST_ALG_HMACMD5) {
fprintf(stderr,
"warning: use of hmac-md5 for RNDC keys "
"is deprecated; hmac-sha256 is now recommended.\n");
}
if (keysize < 0)
if (alg == DST_ALG_HMACMD5) {
fprintf(stderr, "warning: use of hmac-md5 for RNDC keys "
"is deprecated; hmac-sha256 is now "
"recommended.\n");
}
if (keysize < 0) {
keysize = alg_bits(alg);
}
algname = alg_totext(alg);
DO("create memory context", isc_mem_create(0, 0, &mctx));
isc_mem_create(&mctx);
isc_buffer_init(&key_txtbuffer, &key_txtsecret, sizeof(key_txtsecret));
generate_key(mctx, alg, keysize, &key_txtbuffer);
@@ -219,17 +232,21 @@ main(int argc, char **argv) {
if (keyonly) {
write_key_file(keyfile, chrootdir == NULL ? user : NULL,
keyname, &key_txtbuffer, alg);
if (!quiet) {
printf("wrote key file \"%s\"\n", keyfile);
}
if (chrootdir != NULL) {
char *buf;
len = strlen(chrootdir) + strlen(keyfile) + 2;
buf = isc_mem_get(mctx, len);
if (buf == NULL)
fatal("isc_mem_get(%d) failed\n", len);
snprintf(buf, len, "%s%s%s", chrootdir,
(*keyfile != '/') ? "/" : "", keyfile);
write_key_file(buf, user, keyname, &key_txtbuffer, alg);
if (!quiet) {
printf("wrote key file \"%s\"\n", buf);
}
isc_mem_put(mctx, buf, len);
}
} else {
@@ -260,16 +277,16 @@ options {\n\
# End of named.conf\n",
keyname, algname,
(int)isc_buffer_usedlength(&key_txtbuffer),
(char *)isc_buffer_base(&key_txtbuffer),
keyname, serveraddr, port,
keyname, algname,
(char *)isc_buffer_base(&key_txtbuffer), keyname,
serveraddr, port, keyname, algname,
(int)isc_buffer_usedlength(&key_txtbuffer),
(char *)isc_buffer_base(&key_txtbuffer),
serveraddr, port, serveraddr, keyname);
(char *)isc_buffer_base(&key_txtbuffer), serveraddr,
port, serveraddr, keyname);
}
if (show_final_mem)
if (show_final_mem) {
isc_mem_stats(mctx, stderr);
}
isc_mem_destroy(&mctx);

View File

@@ -1,269 +0,0 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- 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 http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
<!-- Converted by db4-upgrade version 1.0 -->
<refentry xmlns:db="http://docbook.org/ns/docbook" version="5.0" xml:id="man.rndc-confgen">
<info>
<date>2013-03-14</date>
</info>
<refentryinfo>
<corpname>ISC</corpname>
<corpauthor>Internet Systems Consortium, Inc.</corpauthor>
</refentryinfo>
<refmeta>
<refentrytitle><application>rndc-confgen</application></refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
<refnamediv>
<refname><application>rndc-confgen</application></refname>
<refpurpose>rndc key generation tool</refpurpose>
</refnamediv>
<docinfo>
<copyright>
<year>2001</year>
<year>2003</year>
<year>2004</year>
<year>2005</year>
<year>2007</year>
<year>2009</year>
<year>2013</year>
<year>2014</year>
<year>2015</year>
<year>2016</year>
<year>2017</year>
<year>2018</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
<refsynopsisdiv>
<cmdsynopsis sepchar=" ">
<command>rndc-confgen</command>
<arg choice="opt" rep="norepeat"><option>-a</option></arg>
<arg choice="opt" rep="norepeat"><option>-A <replaceable class="parameter">algorithm</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-b <replaceable class="parameter">keysize</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">keyfile</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-h</option></arg>
<arg choice="opt" rep="norepeat"><option>-k <replaceable class="parameter">keyname</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-p <replaceable class="parameter">port</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-s <replaceable class="parameter">address</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-t <replaceable class="parameter">chrootdir</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-u <replaceable class="parameter">user</replaceable></option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsection><info><title>DESCRIPTION</title></info>
<para><command>rndc-confgen</command>
generates configuration files
for <command>rndc</command>. It can be used as a
convenient alternative to writing the
<filename>rndc.conf</filename> file
and the corresponding <command>controls</command>
and <command>key</command>
statements in <filename>named.conf</filename> by hand.
Alternatively, it can be run with the <command>-a</command>
option to set up a <filename>rndc.key</filename> file and
avoid the need for a <filename>rndc.conf</filename> file
and a <command>controls</command> statement altogether.
</para>
</refsection>
<refsection><info><title>OPTIONS</title></info>
<variablelist>
<varlistentry>
<term>-a</term>
<listitem>
<para>
Do automatic <command>rndc</command> configuration.
This creates a file <filename>rndc.key</filename>
in <filename>/etc</filename> (or whatever
<varname>sysconfdir</varname>
was specified as when <acronym>BIND</acronym> was
built)
that is read by both <command>rndc</command>
and <command>named</command> on startup. The
<filename>rndc.key</filename> file defines a default
command channel and authentication key allowing
<command>rndc</command> to communicate with
<command>named</command> on the local host
with no further configuration.
</para>
<para>
Running <command>rndc-confgen -a</command> allows
BIND 9 and <command>rndc</command> to be used as
drop-in
replacements for BIND 8 and <command>ndc</command>,
with no changes to the existing BIND 8
<filename>named.conf</filename> file.
</para>
<para>
If a more elaborate configuration than that
generated by <command>rndc-confgen -a</command>
is required, for example if rndc is to be used remotely,
you should run <command>rndc-confgen</command> without
the
<command>-a</command> option and set up a
<filename>rndc.conf</filename> and
<filename>named.conf</filename>
as directed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-A <replaceable class="parameter">algorithm</replaceable></term>
<listitem>
<para>
Specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256,
hmac-sha384 and hmac-sha512. The default is hmac-sha256.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-b <replaceable class="parameter">keysize</replaceable></term>
<listitem>
<para>
Specifies the size of the authentication key in bits.
Must be between 1 and 512 bits; the default is the
hash size.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-c <replaceable class="parameter">keyfile</replaceable></term>
<listitem>
<para>
Used with the <command>-a</command> option to specify
an alternate location for <filename>rndc.key</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-h</term>
<listitem>
<para>
Prints a short summary of the options and arguments to
<command>rndc-confgen</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-k <replaceable class="parameter">keyname</replaceable></term>
<listitem>
<para>
Specifies the key name of the rndc authentication key.
This must be a valid domain name.
The default is <constant>rndc-key</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-p <replaceable class="parameter">port</replaceable></term>
<listitem>
<para>
Specifies the command channel port where <command>named</command>
listens for connections from <command>rndc</command>.
The default is 953.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-s <replaceable class="parameter">address</replaceable></term>
<listitem>
<para>
Specifies the IP address where <command>named</command>
listens for command channel connections from
<command>rndc</command>. The default is the loopback
address 127.0.0.1.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-t <replaceable class="parameter">chrootdir</replaceable></term>
<listitem>
<para>
Used with the <command>-a</command> option to specify
a directory where <command>named</command> will run
chrooted. An additional copy of the <filename>rndc.key</filename>
will be written relative to this directory so that
it will be found by the chrooted <command>named</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-u <replaceable class="parameter">user</replaceable></term>
<listitem>
<para>
Used with the <command>-a</command> option to set the
owner
of the <filename>rndc.key</filename> file generated.
If
<command>-t</command> is also specified only the file
in
the chroot area has its owner changed.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection><info><title>EXAMPLES</title></info>
<para>
To allow <command>rndc</command> to be used with
no manual configuration, run
</para>
<para><userinput>rndc-confgen -a</userinput>
</para>
<para>
To print a sample <filename>rndc.conf</filename> file and
corresponding <command>controls</command> and <command>key</command>
statements to be manually inserted into <filename>named.conf</filename>,
run
</para>
<para><userinput>rndc-confgen</userinput>
</para>
</refsection>
<refsection><info><title>SEE ALSO</title></info>
<para><citerefentry>
<refentrytitle>rndc</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>rndc.conf</refentrytitle><manvolnum>5</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citetitle>BIND 9 Administrator Reference Manual</citetitle>.
</para>
</refsection>
</refentry>

View File

@@ -1,226 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
- Copyright (C) 2001, 2003-2005, 2007, 2009, 2013-2018 Internet Systems Consortium, Inc. ("ISC")
-
- 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 http://mozilla.org/MPL/2.0/.
-->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>rndc-confgen</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
<a name="man.rndc-confgen"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>
<span class="application">rndc-confgen</span>
&#8212; rndc key generation tool
</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="cmdsynopsis"><p>
<code class="command">rndc-confgen</code>
[<code class="option">-a</code>]
[<code class="option">-A <em class="replaceable"><code>algorithm</code></em></code>]
[<code class="option">-b <em class="replaceable"><code>keysize</code></em></code>]
[<code class="option">-c <em class="replaceable"><code>keyfile</code></em></code>]
[<code class="option">-h</code>]
[<code class="option">-k <em class="replaceable"><code>keyname</code></em></code>]
[<code class="option">-p <em class="replaceable"><code>port</code></em></code>]
[<code class="option">-s <em class="replaceable"><code>address</code></em></code>]
[<code class="option">-t <em class="replaceable"><code>chrootdir</code></em></code>]
[<code class="option">-u <em class="replaceable"><code>user</code></em></code>]
</p></div>
</div>
<div class="refsection">
<a name="id-1.7"></a><h2>DESCRIPTION</h2>
<p><span class="command"><strong>rndc-confgen</strong></span>
generates configuration files
for <span class="command"><strong>rndc</strong></span>. It can be used as a
convenient alternative to writing the
<code class="filename">rndc.conf</code> file
and the corresponding <span class="command"><strong>controls</strong></span>
and <span class="command"><strong>key</strong></span>
statements in <code class="filename">named.conf</code> by hand.
Alternatively, it can be run with the <span class="command"><strong>-a</strong></span>
option to set up a <code class="filename">rndc.key</code> file and
avoid the need for a <code class="filename">rndc.conf</code> file
and a <span class="command"><strong>controls</strong></span> statement altogether.
</p>
</div>
<div class="refsection">
<a name="id-1.8"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl class="variablelist">
<dt><span class="term">-a</span></dt>
<dd>
<p>
Do automatic <span class="command"><strong>rndc</strong></span> configuration.
This creates a file <code class="filename">rndc.key</code>
in <code class="filename">/etc</code> (or whatever
<code class="varname">sysconfdir</code>
was specified as when <acronym class="acronym">BIND</acronym> was
built)
that is read by both <span class="command"><strong>rndc</strong></span>
and <span class="command"><strong>named</strong></span> on startup. The
<code class="filename">rndc.key</code> file defines a default
command channel and authentication key allowing
<span class="command"><strong>rndc</strong></span> to communicate with
<span class="command"><strong>named</strong></span> on the local host
with no further configuration.
</p>
<p>
Running <span class="command"><strong>rndc-confgen -a</strong></span> allows
BIND 9 and <span class="command"><strong>rndc</strong></span> to be used as
drop-in
replacements for BIND 8 and <span class="command"><strong>ndc</strong></span>,
with no changes to the existing BIND 8
<code class="filename">named.conf</code> file.
</p>
<p>
If a more elaborate configuration than that
generated by <span class="command"><strong>rndc-confgen -a</strong></span>
is required, for example if rndc is to be used remotely,
you should run <span class="command"><strong>rndc-confgen</strong></span> without
the
<span class="command"><strong>-a</strong></span> option and set up a
<code class="filename">rndc.conf</code> and
<code class="filename">named.conf</code>
as directed.
</p>
</dd>
<dt><span class="term">-A <em class="replaceable"><code>algorithm</code></em></span></dt>
<dd>
<p>
Specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256,
hmac-sha384 and hmac-sha512. The default is hmac-sha256.
</p>
</dd>
<dt><span class="term">-b <em class="replaceable"><code>keysize</code></em></span></dt>
<dd>
<p>
Specifies the size of the authentication key in bits.
Must be between 1 and 512 bits; the default is the
hash size.
</p>
</dd>
<dt><span class="term">-c <em class="replaceable"><code>keyfile</code></em></span></dt>
<dd>
<p>
Used with the <span class="command"><strong>-a</strong></span> option to specify
an alternate location for <code class="filename">rndc.key</code>.
</p>
</dd>
<dt><span class="term">-h</span></dt>
<dd>
<p>
Prints a short summary of the options and arguments to
<span class="command"><strong>rndc-confgen</strong></span>.
</p>
</dd>
<dt><span class="term">-k <em class="replaceable"><code>keyname</code></em></span></dt>
<dd>
<p>
Specifies the key name of the rndc authentication key.
This must be a valid domain name.
The default is <code class="constant">rndc-key</code>.
</p>
</dd>
<dt><span class="term">-p <em class="replaceable"><code>port</code></em></span></dt>
<dd>
<p>
Specifies the command channel port where <span class="command"><strong>named</strong></span>
listens for connections from <span class="command"><strong>rndc</strong></span>.
The default is 953.
</p>
</dd>
<dt><span class="term">-s <em class="replaceable"><code>address</code></em></span></dt>
<dd>
<p>
Specifies the IP address where <span class="command"><strong>named</strong></span>
listens for command channel connections from
<span class="command"><strong>rndc</strong></span>. The default is the loopback
address 127.0.0.1.
</p>
</dd>
<dt><span class="term">-t <em class="replaceable"><code>chrootdir</code></em></span></dt>
<dd>
<p>
Used with the <span class="command"><strong>-a</strong></span> option to specify
a directory where <span class="command"><strong>named</strong></span> will run
chrooted. An additional copy of the <code class="filename">rndc.key</code>
will be written relative to this directory so that
it will be found by the chrooted <span class="command"><strong>named</strong></span>.
</p>
</dd>
<dt><span class="term">-u <em class="replaceable"><code>user</code></em></span></dt>
<dd>
<p>
Used with the <span class="command"><strong>-a</strong></span> option to set the
owner
of the <code class="filename">rndc.key</code> file generated.
If
<span class="command"><strong>-t</strong></span> is also specified only the file
in
the chroot area has its owner changed.
</p>
</dd>
</dl></div>
</div>
<div class="refsection">
<a name="id-1.9"></a><h2>EXAMPLES</h2>
<p>
To allow <span class="command"><strong>rndc</strong></span> to be used with
no manual configuration, run
</p>
<p><strong class="userinput"><code>rndc-confgen -a</code></strong>
</p>
<p>
To print a sample <code class="filename">rndc.conf</code> file and
corresponding <span class="command"><strong>controls</strong></span> and <span class="command"><strong>key</strong></span>
statements to be manually inserted into <code class="filename">named.conf</code>,
run
</p>
<p><strong class="userinput"><code>rndc-confgen</code></strong>
</p>
</div>
<div class="refsection">
<a name="id-1.10"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry">
<span class="refentrytitle">rndc</span>(8)
</span>,
<span class="citerefentry">
<span class="refentrytitle">rndc.conf</span>(5)
</span>,
<span class="citerefentry">
<span class="refentrytitle">named</span>(8)
</span>,
<em class="citetitle">BIND 9 Administrator Reference Manual</em>.
</p>
</div>
</div></body>
</html>

View File

@@ -0,0 +1,119 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
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.
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
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 http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. highlight: console
.. _man_rndc-confgen:
rndc-confgen - rndc key generation tool
---------------------------------------
Synopsis
~~~~~~~~
:program:`rndc-confgen` [**-a**] [**-A** algorithm] [**-b** keysize] [**-c** keyfile] [**-h**] [**-k** keyname] [**-p** port] [**-s** address] [**-t** chrootdir] [**-u** user]
Description
~~~~~~~~~~~
``rndc-confgen`` generates configuration files for ``rndc``. It can be
used as a convenient alternative to writing the ``rndc.conf`` file and
the corresponding ``controls`` and ``key`` statements in ``named.conf``
by hand. Alternatively, it can be run with the ``-a`` option to set up a
``rndc.key`` file and avoid the need for a ``rndc.conf`` file and a
``controls`` statement altogether.
Options
~~~~~~~
``-a``
This option sets automatic ``rndc`` configuration, which creates a file ``rndc.key``
in ``/etc`` (or a different ``sysconfdir`` specified when BIND
was built) that is read by both ``rndc`` and ``named`` on startup.
The ``rndc.key`` file defines a default command channel and
authentication key allowing ``rndc`` to communicate with ``named`` on
the local host with no further configuration.
If a more elaborate configuration than that generated by
``rndc-confgen -a`` is required, for example if rndc is to be used
remotely, run ``rndc-confgen`` without the ``-a`` option
and set up ``rndc.conf`` and ``named.conf`` as directed.
``-A algorithm``
This option specifies the algorithm to use for the TSIG key. Available choices
are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384, and
hmac-sha512. The default is hmac-sha256.
``-b keysize``
This option specifies the size of the authentication key in bits. The size must be between
1 and 512 bits; the default is the hash size.
``-c keyfile``
This option is used with the ``-a`` option to specify an alternate location for
``rndc.key``.
``-h``
This option prints a short summary of the options and arguments to
``rndc-confgen``.
``-k keyname``
This option specifies the key name of the ``rndc`` authentication key. This must be a
valid domain name. The default is ``rndc-key``.
``-p port``
This option specifies the command channel port where ``named`` listens for
connections from ``rndc``. The default is 953.
``-q``
This option prevets printing the written path in automatic configuration mode.
``-s address``
This option specifies the IP address where ``named`` listens for command-channel
connections from ``rndc``. The default is the loopback address
127.0.0.1.
``-t chrootdir``
This option is used with the ``-a`` option to specify a directory where ``named``
runs chrooted. An additional copy of the ``rndc.key`` is
written relative to this directory, so that it is found by the
chrooted ``named``.
``-u user``
This option is used with the ``-a`` option to set the owner of the generated ``rndc.key`` file.
If ``-t`` is also specified, only the file in the chroot
area has its owner changed.
Examples
~~~~~~~~
To allow ``rndc`` to be used with no manual configuration, run:
``rndc-confgen -a``
To print a sample ``rndc.conf`` file and the corresponding ``controls`` and
``key`` statements to be manually inserted into ``named.conf``, run:
``rndc-confgen``
See Also
~~~~~~~~
:manpage:`rndc(8)`, :manpage:`rndc.conf(5)`, :manpage:`named(8)`, BIND 9 Administrator Reference Manual.

309
bin/confgen/tsig-keygen.c Normal file
View File

@@ -0,0 +1,309 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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.
*/
/*! \file */
/**
* tsig-keygen generates TSIG keys that can be used in named configuration
* files for dynamic DNS.
*/
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/assertions.h>
#include <isc/attributes.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/file.h>
#include <isc/mem.h>
#include <isc/net.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/time.h>
#include <isc/util.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include <dns/keyvalues.h>
#include <dns/name.h>
#include <dns/result.h>
#include <dst/dst.h>
#include <confgen/os.h>
#include "keygen.h"
#include "util.h"
#define KEYGEN_DEFAULT "tsig-key"
#define CONFGEN_DEFAULT "ddns-key"
static char program[256];
const char *progname;
static enum { progmode_keygen, progmode_confgen } progmode;
bool verbose = false; /* needed by util.c but not used here */
ISC_NORETURN static void
usage(int status);
static void
usage(int status) {
if (progmode == progmode_confgen) {
fprintf(stderr, "\
Usage:\n\
%s [-a alg] [-k keyname] [-q] [-s name | -z zone]\n\
-a alg: algorithm (default hmac-sha256)\n\
-k keyname: name of the key as it will be used in named.conf\n\
-s name: domain name to be updated using the created key\n\
-z zone: name of the zone as it will be used in named.conf\n\
-q: quiet mode: print the key, with no explanatory text\n",
progname);
} else {
fprintf(stderr, "\
Usage:\n\
%s [-a alg] [keyname]\n\
-a alg: algorithm (default hmac-sha256)\n\n",
progname);
}
exit(status);
}
int
main(int argc, char **argv) {
isc_result_t result = ISC_R_SUCCESS;
bool show_final_mem = false;
bool quiet = false;
isc_buffer_t key_txtbuffer;
char key_txtsecret[256];
isc_mem_t *mctx = NULL;
const char *keyname = NULL;
const char *zone = NULL;
const char *self_domain = NULL;
char *keybuf = NULL;
dns_secalg_t alg = DST_ALG_HMACSHA256;
const char *algname;
int keysize = 256;
int len = 0;
int ch;
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
result = isc_file_progname(*argv, program, sizeof(program));
if (result != ISC_R_SUCCESS) {
memmove(program, "tsig-keygen", 11);
}
progname = program;
/*
* Libtool doesn't preserve the program name prior to final
* installation. Remove the libtool prefix ("lt-").
*/
if (strncmp(progname, "lt-", 3) == 0) {
progname += 3;
}
#define PROGCMP(X) \
(strcasecmp(progname, X) == 0 || strcasecmp(progname, X ".exe") == 0)
if (PROGCMP("tsig-keygen")) {
progmode = progmode_keygen;
quiet = true;
} else if (PROGCMP("ddns-confgen")) {
progmode = progmode_confgen;
} else {
INSIST(0);
ISC_UNREACHABLE();
}
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv, "a:hk:Mmr:qs:y:z:")) !=
-1) {
switch (ch) {
case 'a':
algname = isc_commandline_argument;
alg = alg_fromtext(algname);
if (alg == DST_ALG_UNKNOWN) {
fatal("Unsupported algorithm '%s'", algname);
}
keysize = alg_bits(alg);
break;
case 'h':
usage(0);
case 'k':
case 'y':
if (progmode == progmode_confgen) {
keyname = isc_commandline_argument;
} else {
usage(1);
}
break;
case 'M':
isc_mem_debugging = ISC_MEM_DEBUGTRACE;
break;
case 'm':
show_final_mem = true;
break;
case 'q':
if (progmode == progmode_confgen) {
quiet = true;
} else {
usage(1);
}
break;
case 'r':
fatal("The -r option has been deprecated.");
break;
case 's':
if (progmode == progmode_confgen) {
self_domain = isc_commandline_argument;
} else {
usage(1);
}
break;
case 'z':
if (progmode == progmode_confgen) {
zone = isc_commandline_argument;
} else {
usage(1);
}
break;
case '?':
if (isc_commandline_option != '?') {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
usage(1);
} else {
usage(0);
}
break;
default:
fprintf(stderr, "%s: unhandled option -%c\n", program,
isc_commandline_option);
exit(1);
}
}
if (progmode == progmode_keygen) {
keyname = argv[isc_commandline_index++];
}
POST(argv);
if (self_domain != NULL && zone != NULL) {
usage(1); /* -s and -z cannot coexist */
}
if (argc > isc_commandline_index) {
usage(1);
}
/* Use canonical algorithm name */
algname = alg_totext(alg);
isc_mem_create(&mctx);
if (keyname == NULL) {
const char *suffix = NULL;
keyname = ((progmode == progmode_keygen) ? KEYGEN_DEFAULT
: CONFGEN_DEFAULT);
if (self_domain != NULL) {
suffix = self_domain;
} else if (zone != NULL) {
suffix = zone;
}
if (suffix != NULL) {
len = strlen(keyname) + strlen(suffix) + 2;
keybuf = isc_mem_get(mctx, len);
snprintf(keybuf, len, "%s.%s", keyname, suffix);
keyname = (const char *)keybuf;
}
}
isc_buffer_init(&key_txtbuffer, &key_txtsecret, sizeof(key_txtsecret));
generate_key(mctx, alg, keysize, &key_txtbuffer);
if (!quiet) {
printf("\
# To activate this key, place the following in named.conf, and\n\
# in a separate keyfile on the system or systems from which nsupdate\n\
# will be run:\n");
}
printf("\
key \"%s\" {\n\
algorithm %s;\n\
secret \"%.*s\";\n\
};\n",
keyname, algname, (int)isc_buffer_usedlength(&key_txtbuffer),
(char *)isc_buffer_base(&key_txtbuffer));
if (!quiet) {
if (self_domain != NULL) {
printf("\n\
# Then, in the \"zone\" statement for the zone containing the\n\
# name \"%s\", place an \"update-policy\" statement\n\
# like this one, adjusted as needed for your preferred permissions:\n\
update-policy {\n\
grant %s name %s ANY;\n\
};\n",
self_domain, keyname, self_domain);
} else if (zone != NULL) {
printf("\n\
# Then, in the \"zone\" definition statement for \"%s\",\n\
# place an \"update-policy\" statement like this one, adjusted as \n\
# needed for your preferred permissions:\n\
update-policy {\n\
grant %s zonesub ANY;\n\
};\n",
zone, keyname);
} else {
printf("\n\
# Then, in the \"zone\" statement for each zone you wish to dynamically\n\
# update, place an \"update-policy\" statement granting update permission\n\
# to this key. For example, the following statement grants this key\n\
# permission to update any name within the zone:\n\
update-policy {\n\
grant %s zonesub ANY;\n\
};\n",
keyname);
}
printf("\n\
# After the keyfile has been placed, the following command will\n\
# execute nsupdate using this key:\n\
nsupdate -k <keyfile>\n");
}
if (keybuf != NULL) {
isc_mem_put(mctx, keybuf, len);
}
if (show_final_mem) {
isc_mem_stats(mctx, stderr);
}
isc_mem_destroy(&mctx);
return (0);
}

101
bin/confgen/tsig-keygen.rst Normal file
View File

@@ -0,0 +1,101 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
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.
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
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 http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. highlight: console
tsig-keygen, ddns-confgen - TSIG key generation tool
----------------------------------------------------
Synopsis
~~~~~~~~
:program:`tsig-keygen` [**-a** algorithm] [**-h**] [**-r** randomfile] [name]
:program:`ddns-confgen` [**-a** algorithm] [**-h**] [**-k** keyname] [**-q**] [**-r** randomfile] [**-s** name] [**-z** zone]
Description
~~~~~~~~~~~
``tsig-keygen`` and ``ddns-confgen`` are invocation methods for a
utility that generates keys for use in TSIG signing. The resulting keys
can be used, for example, to secure dynamic DNS updates to a zone, or for
the ``rndc`` command channel.
When run as ``tsig-keygen``, a domain name can be specified on the
command line to be used as the name of the generated key. If no
name is specified, the default is ``tsig-key``.
When run as ``ddns-confgen``, the key name can specified using ``-k``
parameter and defaults to ``ddns-key``. The generated key is accompanied
by configuration text and instructions that can be used with ``nsupdate``
and ``named`` when setting up dynamic DNS, including an example
``update-policy`` statement. (This usage is similar to the ``rndc-confgen``
command for setting up command-channel security.)
Note that ``named`` itself can configure a local DDNS key for use with
``nsupdate -l``; it does this when a zone is configured with
``update-policy local;``. ``ddns-confgen`` is only needed when a more
elaborate configuration is required: for instance, if ``nsupdate`` is to
be used from a remote system.
Options
~~~~~~~
``-a algorithm``
This option specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384,
and hmac-sha512. The default is hmac-sha256. Options are
case-insensitive, and the "hmac-" prefix may be omitted.
``-h``
This option prints a short summary of options and arguments.
``-k keyname``
This option specifies the key name of the DDNS authentication key. The
default is ``ddns-key`` when neither the ``-s`` nor ``-z`` option is
specified; otherwise, the default is ``ddns-key`` as a separate label
followed by the argument of the option, e.g., ``ddns-key.example.com.``
The key name must have the format of a valid domain name, consisting of
letters, digits, hyphens, and periods.
``-q`` (``ddns-confgen`` only)
This option enables quiet mode, which prints only the key, with no
explanatory text or usage examples. This is essentially identical to
``tsig-keygen``.
``-s name`` (``ddns-confgen`` only)
This option generates a configuration example to allow dynamic updates
of a single hostname. The example ``named.conf`` text shows how to set
an update policy for the specified name using the "name" nametype. The
default key name is ``ddns-key.name``. Note that the "self" nametype
cannot be used, since the name to be updated may differ from the key
name. This option cannot be used with the ``-z`` option.
``-z zone`` (``ddns-confgen`` only)
This option generates a configuration example to allow
dynamic updates of a zone. The example ``named.conf`` text shows how
to set an update policy for the specified zone using the "zonesub"
nametype, allowing updates to all subdomain names within that zone.
This option cannot be used with the ``-s`` option.
See Also
~~~~~~~~
:manpage:`nsupdate(1)`, :manpage:`named.conf(5)`, :manpage:`named(8)`, BIND 9 Administrator Reference Manual.

View File

@@ -1,28 +0,0 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# 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 http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include -I${srcdir}/../include \
${DNS_INCLUDES} ${ISC_INCLUDES}
CDEFINES =
CWARNINGS =
OBJS = os.@O@
SRCS = os.c
TARGETS = ${OBJS}
@BIND9_MAKE_RULES@

View File

@@ -1,37 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
#include <config.h>
#include <confgen/os.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <pwd.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
int
set_user(FILE *fd, const char *user) {
struct passwd *pw;
pw = getpwnam(user);
if (pw == NULL) {
errno = EINVAL;
return (-1);
}
return (fchown(fileno(fd), pw->pw_uid, -1));
}

View File

@@ -3,26 +3,22 @@
*
* 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 http://mozilla.org/MPL/2.0/.
* 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.
*/
/*! \file */
#include <config.h>
#include "util.h"
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <isc/print.h>
#include "util.h"
extern bool verbose;
extern const char *progname;
@@ -34,7 +30,7 @@ notify(const char *fmt, ...) {
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fputs("\n", stderr);
fprintf(stderr, "\n");
}
}

View File

@@ -3,33 +3,31 @@
*
* 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 http://mozilla.org/MPL/2.0/.
* 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.
*/
#ifndef RNDC_UTIL_H
#define RNDC_UTIL_H 1
/*! \file */
#include <isc/lang.h>
#include <isc/platform.h>
#include <isc/attributes.h>
#include <isc/formatcheck.h>
#include <isc/lang.h>
#define NS_CONTROL_PORT 953
#define NS_CONTROL_PORT 953
#undef DO
#define DO(name, function) \
do { \
result = function; \
if (result != ISC_R_SUCCESS) \
#define DO(name, function) \
do { \
result = function; \
if (result != ISC_R_SUCCESS) \
fatal("%s: %s", name, isc_result_totext(result)); \
else \
notify("%s", name); \
else \
notify("%s", name); \
} while (0)
ISC_LANG_BEGINDECLS
@@ -37,9 +35,8 @@ ISC_LANG_BEGINDECLS
void
notify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
ISC_PLATFORM_NORETURN_PRE void
fatal(const char *format, ...)
ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
ISC_NORETURN void
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
ISC_LANG_ENDDECLS

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\keygen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\confgen\os.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\keygen.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\util.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="os.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,111 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{64964B03-4815-41F0-9057-E766A94AF197}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>confgentool</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\include\confgen\os.h" />
<ClInclude Include="..\keygen.h" />
<ClInclude Include="..\util.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\keygen.c" />
<ClCompile Include="..\util.c" />
<ClCompile Include="os.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\ddns-confgen.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1EA4FC64-F33B-4A50-970A-EA052BBE9CF1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ddnsconfgen</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>ddns-confgen</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>ddns-confgen</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y ddns-confgen.exe tsig-keygen.exe
copy /Y ddns-confgen.ilk tsig-keygen.ilk
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y ddns-confgen.exe tsig-keygen.exe
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\ddns-confgen.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,28 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* 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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#include <config.h>
#include <confgen/os.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
#include <io.h>
#include <sys/stat.h>
int
set_user(FILE *fd, const char *user) {
return (0);
}

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\rndc-confgen.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1E2C1635-3093-4D59-80E7-4743AC10F22F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>rndcconfgen</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>rndc-confgen</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>rndc-confgen</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\rndc-confgen.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

21
bin/delv/Makefile.am Normal file
View File

@@ -0,0 +1,21 @@
include $(top_srcdir)/Makefile.top
AM_CPPFLAGS += \
-I$(top_builddir)/include \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBISCCFG_CFLAGS) \
$(LIBIRS_CFLAGS)
AM_CPPFLAGS += \
-DSYSCONFDIR=\"${sysconfdir}\"
bin_PROGRAMS = delv
delv_SOURCES = \
delv.c
delv_LDADD = \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS) \
$(LIBISCCFG_LIBS) \
$(LIBIRS_LIBS)

View File

@@ -1,81 +0,0 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# 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 http://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} ${ISC_INCLUDES} \
${IRS_INCLUDES} ${ISCCFG_INCLUDES} @OPENSSL_INCLUDES@
CDEFINES = -DVERSION=\"${VERSION}\" \
-DSYSCONFDIR=\"${sysconfdir}\"
CWARNINGS =
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
IRSLIBS = ../../lib/irs/libirs.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
IRSDEPLIBS = ../../lib/irs/libirs.@A@
DEPLIBS = ${DNSDEPLIBS} ${IRSDEPLIBS} ${ISCCFGDEPLIBS} ${ISCDEPLIBS}
LIBS = ${DNSLIBS} ${IRSLIBS} ${ISCCFGLIBS} ${ISCLIBS} @LIBS@
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${ISCCFGLIBS} ${ISCNOSYMLIBS} @LIBS@
SUBDIRS =
TARGETS = delv@EXEEXT@
OBJS = delv.@O@
SRCS = delv.c
MANPAGES = delv.1
HTMLPAGES = delv.html
MANOBJS = ${MANPAGES} ${HTMLPAGES}
@BIND9_MAKE_RULES@
delv@EXEEXT@: delv.@O@ ${DEPLIBS}
export BASEOBJS="delv.@O@"; \
export LIBS0="${DNSLIBS}"; \
${FINALBUILDCMD}
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir}
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
install:: delv@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
delv@EXEEXT@ ${DESTDIR}${bindir}
${INSTALL_DATA} ${srcdir}/delv.1 ${DESTDIR}${mandir}/man1
uninstall::
rm -f ${DESTDIR}${mandir}/man1/delv.1
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/delv@EXEEXT@
doc man:: ${MANOBJS}
docclean manclean maintainer-clean::
rm -f ${MANOBJS}
clean distclean maintainer-clean::
rm -f ${TARGETS}

View File

@@ -1,441 +0,0 @@
.\" Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC")
.\"
.\" 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 http://mozilla.org/MPL/2.0/.
.\"
.hy 0
.ad l
'\" t
.\" Title: delv
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 2014-04-23
.\" Manual: BIND9
.\" Source: ISC
.\" Language: English
.\"
.TH "DELV" "1" "2014\-04\-23" "ISC" "BIND9"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
delv \- DNS lookup and validation utility
.SH "SYNOPSIS"
.HP \w'\fBdelv\fR\ 'u
\fBdelv\fR [@server] [[\fB\-4\fR] | [\fB\-6\fR]] [\fB\-a\ \fR\fB\fIanchor\-file\fR\fR] [\fB\-b\ \fR\fB\fIaddress\fR\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-d\ \fR\fB\fIlevel\fR\fR] [\fB\-i\fR] [\fB\-m\fR] [\fB\-p\ \fR\fB\fIport#\fR\fR] [\fB\-q\ \fR\fB\fIname\fR\fR] [\fB\-t\ \fR\fB\fItype\fR\fR] [\fB\-x\ \fR\fB\fIaddr\fR\fR] [name] [type] [class] [queryopt...]
.HP \w'\fBdelv\fR\ 'u
\fBdelv\fR [\fB\-h\fR]
.HP \w'\fBdelv\fR\ 'u
\fBdelv\fR [\fB\-v\fR]
.HP \w'\fBdelv\fR\ 'u
\fBdelv\fR [queryopt...] [query...]
.SH "DESCRIPTION"
.PP
\fBdelv\fR
is a tool for sending DNS queries and validating the results, using the same internal resolver and validator logic as
\fBnamed\fR\&.
.PP
\fBdelv\fR
will send to a specified name server all queries needed to fetch and validate the requested data; this includes the original requested query, subsequent queries to follow CNAME or DNAME chains, and queries for DNSKEY, DS and DLV records to establish a chain of trust for DNSSEC validation\&. It does not perform iterative resolution, but simulates the behavior of a name server configured for DNSSEC validating and forwarding\&.
.PP
By default, responses are validated using built\-in DNSSEC trust anchor for the root zone ("\&.")\&. Records returned by
\fBdelv\fR
are either fully validated or were not signed\&. If validation fails, an explanation of the failure is included in the output; the validation process can be traced in detail\&. Because
\fBdelv\fR
does not rely on an external server to carry out validation, it can be used to check the validity of DNS responses in environments where local name servers may not be trustworthy\&.
.PP
Unless it is told to query a specific name server,
\fBdelv\fR
will try each of the servers listed in
/etc/resolv\&.conf\&. If no usable server addresses are found,
\fBdelv\fR
will send queries to the localhost addresses (127\&.0\&.0\&.1 for IPv4, ::1 for IPv6)\&.
.PP
When no command line arguments or options are given,
\fBdelv\fR
will perform an NS query for "\&." (the root zone)\&.
.SH "SIMPLE USAGE"
.PP
A typical invocation of
\fBdelv\fR
looks like:
.sp
.if n \{\
.RS 4
.\}
.nf
delv @server name type
.fi
.if n \{\
.RE
.\}
.sp
where:
.PP
\fBserver\fR
.RS 4
is the name or IP address of the name server to query\&. This can be an IPv4 address in dotted\-decimal notation or an IPv6 address in colon\-delimited notation\&. When the supplied
\fIserver\fR
argument is a hostname,
\fBdelv\fR
resolves that name before querying that name server (note, however, that this initial lookup is
\fInot\fR
validated by DNSSEC)\&.
.sp
If no
\fIserver\fR
argument is provided,
\fBdelv\fR
consults
/etc/resolv\&.conf; if an address is found there, it queries the name server at that address\&. If either of the
\fB\-4\fR
or
\fB\-6\fR
options are in use, then only addresses for the corresponding transport will be tried\&. If no usable addresses are found,
\fBdelv\fR
will send queries to the localhost addresses (127\&.0\&.0\&.1 for IPv4, ::1 for IPv6)\&.
.RE
.PP
\fBname\fR
.RS 4
is the domain name to be looked up\&.
.RE
.PP
\fBtype\fR
.RS 4
indicates what type of query is required \(em ANY, A, MX, etc\&.
\fItype\fR
can be any valid query type\&. If no
\fItype\fR
argument is supplied,
\fBdelv\fR
will perform a lookup for an A record\&.
.RE
.SH "OPTIONS"
.PP
\-a \fIanchor\-file\fR
.RS 4
Specifies a file from which to read DNSSEC trust anchors\&. The default is
/etc/bind\&.keys, which is included with
BIND
9 and contains one or more trust anchors for the root zone ("\&.")\&.
.sp
Keys that do not match the root zone name are ignored\&. An alternate key name can be specified using the
\fB+root=NAME\fR
options\&. DNSSEC Lookaside Validation can also be turned on by using the
\fB+dlv=NAME\fR
to specify the name of a zone containing DLV records\&.
.sp
Note: When reading the trust anchor file,
\fBdelv\fR
treats
\fBmanaged\-keys\fR
statements and
\fBtrusted\-keys\fR
statements identically\&. That is, for a managed key, it is the
\fIinitial\fR
key that is trusted; RFC 5011 key management is not supported\&.
\fBdelv\fR
will not consult the managed\-keys database maintained by
\fBnamed\fR\&. This means that if either of the keys in
/etc/bind\&.keys
is revoked and rolled over, it will be necessary to update
/etc/bind\&.keys
to use DNSSEC validation in
\fBdelv\fR\&.
.RE
.PP
\-b \fIaddress\fR
.RS 4
Sets the source IP address of the query to
\fIaddress\fR\&. This must be a valid address on one of the host\*(Aqs network interfaces or "0\&.0\&.0\&.0" or "::"\&. An optional source port may be specified by appending "#<port>"
.RE
.PP
\-c \fIclass\fR
.RS 4
Sets the query class for the requested data\&. Currently, only class "IN" is supported in
\fBdelv\fR
and any other value is ignored\&.
.RE
.PP
\-d \fIlevel\fR
.RS 4
Set the systemwide debug level to
\fBlevel\fR\&. The allowed range is from 0 to 99\&. The default is 0 (no debugging)\&. Debugging traces from
\fBdelv\fR
become more verbose as the debug level increases\&. See the
\fB+mtrace\fR,
\fB+rtrace\fR, and
\fB+vtrace\fR
options below for additional debugging details\&.
.RE
.PP
\-h
.RS 4
Display the
\fBdelv\fR
help usage output and exit\&.
.RE
.PP
\-i
.RS 4
Insecure mode\&. This disables internal DNSSEC validation\&. (Note, however, this does not set the CD bit on upstream queries\&. If the server being queried is performing DNSSEC validation, then it will not return invalid data; this can cause
\fBdelv\fR
to time out\&. When it is necessary to examine invalid data to debug a DNSSEC problem, use
\fBdig +cd\fR\&.)
.RE
.PP
\-m
.RS 4
Enables memory usage debugging\&.
.RE
.PP
\-p \fIport#\fR
.RS 4
Specifies a destination port to use for queries instead of the standard DNS port number 53\&. This option would be used with a name server that has been configured to listen for queries on a non\-standard port number\&.
.RE
.PP
\-q \fIname\fR
.RS 4
Sets the query name to
\fIname\fR\&. While the query name can be specified without using the
\fB\-q\fR, it is sometimes necessary to disambiguate names from types or classes (for example, when looking up the name "ns", which could be misinterpreted as the type NS, or "ch", which could be misinterpreted as class CH)\&.
.RE
.PP
\-t \fItype\fR
.RS 4
Sets the query type to
\fItype\fR, which can be any valid query type supported in BIND 9 except for zone transfer types AXFR and IXFR\&. As with
\fB\-q\fR, this is useful to distinguish query name type or class when they are ambiguous\&. it is sometimes necessary to disambiguate names from types\&.
.sp
The default query type is "A", unless the
\fB\-x\fR
option is supplied to indicate a reverse lookup, in which case it is "PTR"\&.
.RE
.PP
\-v
.RS 4
Print the
\fBdelv\fR
version and exit\&.
.RE
.PP
\-x \fIaddr\fR
.RS 4
Performs a reverse lookup, mapping an addresses to a name\&.
\fIaddr\fR
is an IPv4 address in dotted\-decimal notation, or a colon\-delimited IPv6 address\&. When
\fB\-x\fR
is used, there is no need to provide the
\fIname\fR
or
\fItype\fR
arguments\&.
\fBdelv\fR
automatically performs a lookup for a name like
11\&.12\&.13\&.10\&.in\-addr\&.arpa
and sets the query type to PTR\&. IPv6 addresses are looked up using nibble format under the IP6\&.ARPA domain\&.
.RE
.PP
\-4
.RS 4
Forces
\fBdelv\fR
to only use IPv4\&.
.RE
.PP
\-6
.RS 4
Forces
\fBdelv\fR
to only use IPv6\&.
.RE
.SH "QUERY OPTIONS"
.PP
\fBdelv\fR
provides a number of query options which affect the way results are displayed, and in some cases the way lookups are performed\&.
.PP
Each query option is identified by a keyword preceded by a plus sign (+)\&. Some keywords set or reset an option\&. These may be preceded by the string
no
to negate the meaning of that keyword\&. Other keywords assign values to options like the timeout interval\&. They have the form
\fB+keyword=value\fR\&. The query options are:
.PP
\fB+[no]cdflag\fR
.RS 4
Controls whether to set the CD (checking disabled) bit in queries sent by
\fBdelv\fR\&. This may be useful when troubleshooting DNSSEC problems from behind a validating resolver\&. A validating resolver will block invalid responses, making it difficult to retrieve them for analysis\&. Setting the CD flag on queries will cause the resolver to return invalid responses, which
\fBdelv\fR
can then validate internally and report the errors in detail\&.
.RE
.PP
\fB+[no]class\fR
.RS 4
Controls whether to display the CLASS when printing a record\&. The default is to display the CLASS\&.
.RE
.PP
\fB+[no]ttl\fR
.RS 4
Controls whether to display the TTL when printing a record\&. The default is to display the TTL\&.
.RE
.PP
\fB+[no]rtrace\fR
.RS 4
Toggle resolver fetch logging\&. This reports the name and type of each query sent by
\fBdelv\fR
in the process of carrying out the resolution and validation process: this includes including the original query and all subsequent queries to follow CNAMEs and to establish a chain of trust for DNSSEC validation\&.
.sp
This is equivalent to setting the debug level to 1 in the "resolver" logging category\&. Setting the systemwide debug level to 1 using the
\fB\-d\fR
option will product the same output (but will affect other logging categories as well)\&.
.RE
.PP
\fB+[no]mtrace\fR
.RS 4
Toggle message logging\&. This produces a detailed dump of the responses received by
\fBdelv\fR
in the process of carrying out the resolution and validation process\&.
.sp
This is equivalent to setting the debug level to 10 for the "packets" module of the "resolver" logging category\&. Setting the systemwide debug level to 10 using the
\fB\-d\fR
option will produce the same output (but will affect other logging categories as well)\&.
.RE
.PP
\fB+[no]vtrace\fR
.RS 4
Toggle validation logging\&. This shows the internal process of the validator as it determines whether an answer is validly signed, unsigned, or invalid\&.
.sp
This is equivalent to setting the debug level to 3 for the "validator" module of the "dnssec" logging category\&. Setting the systemwide debug level to 3 using the
\fB\-d\fR
option will produce the same output (but will affect other logging categories as well)\&.
.RE
.PP
\fB+[no]short\fR
.RS 4
Provide a terse answer\&. The default is to print the answer in a verbose form\&.
.RE
.PP
\fB+[no]comments\fR
.RS 4
Toggle the display of comment lines in the output\&. The default is to print comments\&.
.RE
.PP
\fB+[no]rrcomments\fR
.RS 4
Toggle the display of per\-record comments in the output (for example, human\-readable key information about DNSKEY records)\&. The default is to print per\-record comments\&.
.RE
.PP
\fB+[no]crypto\fR
.RS 4
Toggle the display of cryptographic fields in DNSSEC records\&. The contents of these field are unnecessary to debug most DNSSEC validation failures and removing them makes it easier to see the common failures\&. The default is to display the fields\&. When omitted they are replaced by the string "[omitted]" or in the DNSKEY case the key id is displayed as the replacement, e\&.g\&. "[ key id = value ]"\&.
.RE
.PP
\fB+[no]trust\fR
.RS 4
Controls whether to display the trust level when printing a record\&. The default is to display the trust level\&.
.RE
.PP
\fB+[no]split[=W]\fR
.RS 4
Split long hex\- or base64\-formatted fields in resource records into chunks of
\fIW\fR
characters (where
\fIW\fR
is rounded up to the nearest multiple of 4)\&.
\fI+nosplit\fR
or
\fI+split=0\fR
causes fields not to be split at all\&. The default is 56 characters, or 44 characters when multiline mode is active\&.
.RE
.PP
\fB+[no]all\fR
.RS 4
Set or clear the display options
\fB+[no]comments\fR,
\fB+[no]rrcomments\fR, and
\fB+[no]trust\fR
as a group\&.
.RE
.PP
\fB+[no]multiline\fR
.RS 4
Print long records (such as RRSIG, DNSKEY, and SOA records) in a verbose multi\-line format with human\-readable comments\&. The default is to print each record on a single line, to facilitate machine parsing of the
\fBdelv\fR
output\&.
.RE
.PP
\fB+[no]dnssec\fR
.RS 4
Indicates whether to display RRSIG records in the
\fBdelv\fR
output\&. The default is to do so\&. Note that (unlike in
\fBdig\fR) this does
\fInot\fR
control whether to request DNSSEC records or whether to validate them\&. DNSSEC records are always requested, and validation will always occur unless suppressed by the use of
\fB\-i\fR
or
\fB+noroot\fR
and
\fB+nodlv\fR\&.
.RE
.PP
\fB+[no]root[=ROOT]\fR
.RS 4
Indicates whether to perform conventional (non\-lookaside) DNSSEC validation, and if so, specifies the name of a trust anchor\&. The default is to validate using a trust anchor of "\&." (the root zone), for which there is a built\-in key\&. If specifying a different trust anchor, then
\fB\-a\fR
must be used to specify a file containing the key\&.
.RE
.PP
\fB+[no]dlv[=DLV]\fR
.RS 4
Indicates whether to perform DNSSEC lookaside validation, and if so, specifies the name of the DLV trust anchor\&. The
\fB\-a\fR
option must also be used to specify a file containing the DLV key\&.
.RE
.PP
\fB+[no]tcp\fR
.RS 4
Controls whether to use TCP when sending queries\&. The default is to use UDP unless a truncated response has been received\&.
.RE
.PP
\fB+[no]unknownformat\fR
.RS 4
Print all RDATA in unknown RR type presentation format (RFC 3597)\&. The default is to print RDATA for known types in the type\*(Aqs presentation format\&.
.RE
.SH "FILES"
.PP
/etc/bind\&.keys
.PP
/etc/resolv\&.conf
.SH "SEE ALSO"
.PP
\fBdig\fR(1),
\fBnamed\fR(8),
RFC4034,
RFC4035,
RFC4431,
RFC5074,
RFC5155\&.
.SH "AUTHOR"
.PP
\fBInternet Systems Consortium, Inc\&.\fR
.SH "COPYRIGHT"
.br
Copyright \(co 2014-2018 Internet Systems Consortium, Inc. ("ISC")
.br

File diff suppressed because it is too large Load Diff

View File

@@ -1,700 +0,0 @@
<!DOCTYPE book [
<!ENTITY mdash "&#8212;">]>
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- 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 http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
<!-- Converted by db4-upgrade version 1.0 -->
<refentry xmlns:db="http://docbook.org/ns/docbook" version="5.0" xml:id="man.delv">
<info>
<date>2014-04-23</date>
</info>
<refentryinfo>
<corpname>ISC</corpname>
<corpauthor>Internet Systems Consortium, Inc.</corpauthor>
</refentryinfo>
<refmeta>
<refentrytitle>delv</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>BIND9</refmiscinfo>
</refmeta>
<refnamediv>
<refname>delv</refname>
<refpurpose>DNS lookup and validation utility</refpurpose>
</refnamediv>
<docinfo>
<copyright>
<year>2014</year>
<year>2015</year>
<year>2016</year>
<year>2017</year>
<year>2018</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
<refsynopsisdiv>
<cmdsynopsis sepchar=" ">
<command>delv</command>
<arg choice="opt" rep="norepeat">@server</arg>
<group choice="opt" rep="norepeat">
<arg choice="opt" rep="norepeat"><option>-4</option></arg>
<arg choice="opt" rep="norepeat"><option>-6</option></arg>
</group>
<arg choice="opt" rep="norepeat"><option>-a <replaceable class="parameter">anchor-file</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-b <replaceable class="parameter">address</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">class</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-d <replaceable class="parameter">level</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-i</option></arg>
<arg choice="opt" rep="norepeat"><option>-m</option></arg>
<arg choice="opt" rep="norepeat"><option>-p <replaceable class="parameter">port#</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-q <replaceable class="parameter">name</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-t <replaceable class="parameter">type</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-x <replaceable class="parameter">addr</replaceable></option></arg>
<arg choice="opt" rep="norepeat">name</arg>
<arg choice="opt" rep="norepeat">type</arg>
<arg choice="opt" rep="norepeat">class</arg>
<arg choice="opt" rep="repeat">queryopt</arg>
</cmdsynopsis>
<cmdsynopsis sepchar=" ">
<command>delv</command>
<arg choice="opt" rep="norepeat"><option>-h</option></arg>
</cmdsynopsis>
<cmdsynopsis sepchar=" ">
<command>delv</command>
<arg choice="opt" rep="norepeat"><option>-v</option></arg>
</cmdsynopsis>
<cmdsynopsis sepchar=" ">
<command>delv</command>
<arg choice="opt" rep="repeat">queryopt</arg>
<arg choice="opt" rep="repeat">query</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsection><info><title>DESCRIPTION</title></info>
<para><command>delv</command>
is a tool for sending
DNS queries and validating the results, using the same internal
resolver and validator logic as <command>named</command>.
</para>
<para>
<command>delv</command> will send to a specified name server all
queries needed to fetch and validate the requested data; this
includes the original requested query, subsequent queries to follow
CNAME or DNAME chains, and queries for DNSKEY, DS and DLV records
to establish a chain of trust for DNSSEC validation.
It does not perform iterative resolution, but simulates the
behavior of a name server configured for DNSSEC validating and
forwarding.
</para>
<para>
By default, responses are validated using built-in DNSSEC trust
anchor for the root zone ("."). Records returned by
<command>delv</command> are either fully validated or
were not signed. If validation fails, an explanation of
the failure is included in the output; the validation process
can be traced in detail. Because <command>delv</command> does
not rely on an external server to carry out validation, it can
be used to check the validity of DNS responses in environments
where local name servers may not be trustworthy.
</para>
<para>
Unless it is told to query a specific name server,
<command>delv</command> will try each of the servers listed in
<filename>/etc/resolv.conf</filename>. If no usable server
addresses are found, <command>delv</command> will send
queries to the localhost addresses (127.0.0.1 for IPv4, ::1
for IPv6).
</para>
<para>
When no command line arguments or options are given,
<command>delv</command> will perform an NS query for "."
(the root zone).
</para>
</refsection>
<refsection><info><title>SIMPLE USAGE</title></info>
<para>
A typical invocation of <command>delv</command> looks like:
<programlisting> delv @server name type </programlisting>
where:
<variablelist>
<varlistentry>
<term><constant>server</constant></term>
<listitem>
<para>
is the name or IP address of the name server to query. This
can be an IPv4 address in dotted-decimal notation or an IPv6
address in colon-delimited notation. When the supplied
<parameter>server</parameter> argument is a hostname,
<command>delv</command> resolves that name before
querying that name server (note, however, that this
initial lookup is <emphasis>not</emphasis> validated
by DNSSEC).
</para>
<para>
If no <parameter>server</parameter> argument is
provided, <command>delv</command> consults
<filename>/etc/resolv.conf</filename>; if an
address is found there, it queries the name server at
that address. If either of the <option>-4</option> or
<option>-6</option> options are in use, then
only addresses for the corresponding transport
will be tried. If no usable addresses are found,
<command>delv</command> will send queries to
the localhost addresses (127.0.0.1 for IPv4,
::1 for IPv6).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>name</constant></term>
<listitem>
<para>
is the domain name to be looked up.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>type</constant></term>
<listitem>
<para>
indicates what type of query is required &mdash;
ANY, A, MX, etc.
<parameter>type</parameter> can be any valid query
type. If no
<parameter>type</parameter> argument is supplied,
<command>delv</command> will perform a lookup for an
A record.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsection>
<refsection><info><title>OPTIONS</title></info>
<variablelist>
<varlistentry>
<term>-a <replaceable class="parameter">anchor-file</replaceable></term>
<listitem>
<para>
Specifies a file from which to read DNSSEC trust anchors.
The default is <filename>/etc/bind.keys</filename>, which
is included with <acronym>BIND</acronym> 9 and contains
one or more trust anchors for the root zone (".").
</para>
<para>
Keys that do not match the root zone name are ignored.
An alternate key name can be specified using the
<option>+root=NAME</option> options. DNSSEC Lookaside
Validation can also be turned on by using the
<option>+dlv=NAME</option> to specify the name of a
zone containing DLV records.
</para>
<para>
Note: When reading the trust anchor file,
<command>delv</command> treats <option>managed-keys</option>
statements and <option>trusted-keys</option> statements
identically. That is, for a managed key, it is the
<emphasis>initial</emphasis> key that is trusted; RFC 5011
key management is not supported. <command>delv</command>
will not consult the managed-keys database maintained by
<command>named</command>. This means that if either of the
keys in <filename>/etc/bind.keys</filename> is revoked
and rolled over, it will be necessary to update
<filename>/etc/bind.keys</filename> to use DNSSEC
validation in <command>delv</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-b <replaceable class="parameter">address</replaceable></term>
<listitem>
<para>
Sets the source IP address of the query to
<parameter>address</parameter>. This must be a valid address
on one of the host's network interfaces or "0.0.0.0" or "::".
An optional source port may be specified by appending
"#&lt;port&gt;"
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-c <replaceable class="parameter">class</replaceable></term>
<listitem>
<para>
Sets the query class for the requested data. Currently,
only class "IN" is supported in <command>delv</command>
and any other value is ignored.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-d <replaceable class="parameter">level</replaceable></term>
<listitem>
<para>
Set the systemwide debug level to <option>level</option>.
The allowed range is from 0 to 99.
The default is 0 (no debugging).
Debugging traces from <command>delv</command> become
more verbose as the debug level increases.
See the <option>+mtrace</option>, <option>+rtrace</option>,
and <option>+vtrace</option> options below for additional
debugging details.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-h</term>
<listitem>
<para>
Display the <command>delv</command> help usage output and exit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-i</term>
<listitem>
<para>
Insecure mode. This disables internal DNSSEC validation.
(Note, however, this does not set the CD bit on upstream
queries. If the server being queried is performing DNSSEC
validation, then it will not return invalid data; this
can cause <command>delv</command> to time out. When it
is necessary to examine invalid data to debug a DNSSEC
problem, use <command>dig +cd</command>.)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-m</term>
<listitem>
<para>
Enables memory usage debugging.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-p <replaceable class="parameter">port#</replaceable></term>
<listitem>
<para>
Specifies a destination port to use for queries instead of
the standard DNS port number 53. This option would be used
with a name server that has been configured to listen
for queries on a non-standard port number.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-q <replaceable class="parameter">name</replaceable></term>
<listitem>
<para>
Sets the query name to <parameter>name</parameter>.
While the query name can be specified without using the
<option>-q</option>, it is sometimes necessary to disambiguate
names from types or classes (for example, when looking up the
name "ns", which could be misinterpreted as the type NS,
or "ch", which could be misinterpreted as class CH).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-t <replaceable class="parameter">type</replaceable></term>
<listitem>
<para>
Sets the query type to <parameter>type</parameter>, which
can be any valid query type supported in BIND 9 except
for zone transfer types AXFR and IXFR. As with
<option>-q</option>, this is useful to distinguish
query name type or class when they are ambiguous.
it is sometimes necessary to disambiguate names from types.
</para>
<para>
The default query type is "A", unless the <option>-x</option>
option is supplied to indicate a reverse lookup, in which case
it is "PTR".
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-v</term>
<listitem>
<para>
Print the <command>delv</command> version and exit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-x <replaceable class="parameter">addr</replaceable></term>
<listitem>
<para>
Performs a reverse lookup, mapping an addresses to
a name. <parameter>addr</parameter> is an IPv4 address in
dotted-decimal notation, or a colon-delimited IPv6 address.
When <option>-x</option> is used, there is no need to provide
the <parameter>name</parameter> or <parameter>type</parameter>
arguments. <command>delv</command> automatically performs a
lookup for a name like <literal>11.12.13.10.in-addr.arpa</literal>
and sets the query type to PTR. IPv6 addresses are looked up
using nibble format under the IP6.ARPA domain.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-4</term>
<listitem>
<para>
Forces <command>delv</command> to only use IPv4.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-6</term>
<listitem>
<para>
Forces <command>delv</command> to only use IPv6.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection><info><title>QUERY OPTIONS</title></info>
<para><command>delv</command>
provides a number of query options which affect the way results are
displayed, and in some cases the way lookups are performed.
</para>
<para>
Each query option is identified by a keyword preceded by a plus sign
(<literal>+</literal>). Some keywords set or reset an
option. These may be preceded by the string
<literal>no</literal> to negate the meaning of that keyword.
Other keywords assign values to options like the timeout interval.
They have the form <option>+keyword=value</option>.
The query options are:
<variablelist>
<varlistentry>
<term><option>+[no]cdflag</option></term>
<listitem>
<para>
Controls whether to set the CD (checking disabled) bit in
queries sent by <command>delv</command>. This may be useful
when troubleshooting DNSSEC problems from behind a validating
resolver. A validating resolver will block invalid responses,
making it difficult to retrieve them for analysis. Setting
the CD flag on queries will cause the resolver to return
invalid responses, which <command>delv</command> can then
validate internally and report the errors in detail.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]class</option></term>
<listitem>
<para>
Controls whether to display the CLASS when printing
a record. The default is to display the CLASS.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]ttl</option></term>
<listitem>
<para>
Controls whether to display the TTL when printing
a record. The default is to display the TTL.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]rtrace</option></term>
<listitem>
<para>
Toggle resolver fetch logging. This reports the
name and type of each query sent by <command>delv</command>
in the process of carrying out the resolution and validation
process: this includes including the original query and
all subsequent queries to follow CNAMEs and to establish a
chain of trust for DNSSEC validation.
</para>
<para>
This is equivalent to setting the debug level to 1 in
the "resolver" logging category. Setting the systemwide
debug level to 1 using the <option>-d</option> option will
product the same output (but will affect other logging
categories as well).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]mtrace</option></term>
<listitem>
<para>
Toggle message logging. This produces a detailed dump of
the responses received by <command>delv</command> in the
process of carrying out the resolution and validation process.
</para>
<para>
This is equivalent to setting the debug level to 10
for the "packets" module of the "resolver" logging
category. Setting the systemwide debug level to 10 using
the <option>-d</option> option will produce the same output
(but will affect other logging categories as well).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]vtrace</option></term>
<listitem>
<para>
Toggle validation logging. This shows the internal
process of the validator as it determines whether an
answer is validly signed, unsigned, or invalid.
</para>
<para>
This is equivalent to setting the debug level to 3
for the "validator" module of the "dnssec" logging
category. Setting the systemwide debug level to 3 using
the <option>-d</option> option will produce the same output
(but will affect other logging categories as well).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]short</option></term>
<listitem>
<para>
Provide a terse answer. The default is to print the answer in a
verbose form.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]comments</option></term>
<listitem>
<para>
Toggle the display of comment lines in the output. The default
is to print comments.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]rrcomments</option></term>
<listitem>
<para>
Toggle the display of per-record comments in the output (for
example, human-readable key information about DNSKEY records).
The default is to print per-record comments.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]crypto</option></term>
<listitem>
<para>
Toggle the display of cryptographic fields in DNSSEC records.
The contents of these field are unnecessary to debug most DNSSEC
validation failures and removing them makes it easier to see
the common failures. The default is to display the fields.
When omitted they are replaced by the string "[omitted]" or
in the DNSKEY case the key id is displayed as the replacement,
e.g. "[ key id = value ]".
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]trust</option></term>
<listitem>
<para>
Controls whether to display the trust level when printing
a record. The default is to display the trust level.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]split[=W]</option></term>
<listitem>
<para>
Split long hex- or base64-formatted fields in resource
records into chunks of <parameter>W</parameter> characters
(where <parameter>W</parameter> is rounded up to the nearest
multiple of 4).
<parameter>+nosplit</parameter> or
<parameter>+split=0</parameter> causes fields not to be
split at all. The default is 56 characters, or 44 characters
when multiline mode is active.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]all</option></term>
<listitem>
<para>
Set or clear the display options
<option>+[no]comments</option>,
<option>+[no]rrcomments</option>, and
<option>+[no]trust</option> as a group.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]multiline</option></term>
<listitem>
<para>
Print long records (such as RRSIG, DNSKEY, and SOA records)
in a verbose multi-line format with human-readable comments.
The default is to print each record on a single line, to
facilitate machine parsing of the <command>delv</command>
output.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]dnssec</option></term>
<listitem>
<para>
Indicates whether to display RRSIG records in the
<command>delv</command> output. The default is to
do so. Note that (unlike in <command>dig</command>)
this does <emphasis>not</emphasis> control whether to
request DNSSEC records or whether to validate them.
DNSSEC records are always requested, and validation
will always occur unless suppressed by the use of
<option>-i</option> or <option>+noroot</option> and
<option>+nodlv</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]root[=ROOT]</option></term>
<listitem>
<para>
Indicates whether to perform conventional (non-lookaside)
DNSSEC validation, and if so, specifies the
name of a trust anchor. The default is to validate using
a trust anchor of "." (the root zone), for which there is
a built-in key. If specifying a different trust anchor,
then <option>-a</option> must be used to specify a file
containing the key.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]dlv[=DLV]</option></term>
<listitem>
<para>
Indicates whether to perform DNSSEC lookaside validation,
and if so, specifies the name of the DLV trust anchor.
The <option>-a</option> option must also be used to specify
a file containing the DLV key.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]tcp</option></term>
<listitem>
<para>
Controls whether to use TCP when sending queries.
The default is to use UDP unless a truncated
response has been received.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]unknownformat</option></term>
<listitem>
<para>
Print all RDATA in unknown RR type presentation format
(RFC 3597). The default is to print RDATA for known types
in the type's presentation format.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsection>
<refsection><info><title>FILES</title></info>
<para><filename>/etc/bind.keys</filename></para>
<para><filename>/etc/resolv.conf</filename></para>
</refsection>
<refsection><info><title>SEE ALSO</title></info>
<para><citerefentry>
<refentrytitle>dig</refentrytitle><manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citetitle>RFC4034</citetitle>,
<citetitle>RFC4035</citetitle>,
<citetitle>RFC4431</citetitle>,
<citetitle>RFC5074</citetitle>,
<citetitle>RFC5155</citetitle>.
</para>
</refsection>
</refentry>

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