Compare commits

..

3253 Commits

Author SHA1 Message Date
Michael McNally
1896343049 Minor tone edits during review with Vicky 2020-07-09 22:48:16 +00: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
3045 changed files with 168247 additions and 300303 deletions

73
.clang-format Normal file
View File

@@ -0,0 +1,73 @@
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
IndentBraces: false
SplitEmptyFunction: true
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
AlwaysBreakAfterReturnType: All
Cpp11BracedListStyle: false
ColumnLimit: 80
AlignAfterOpenBracket: Align
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
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
PenaltyBreakAssignment: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 80
PenaltyExcessCharacter: 100
Standard: Cpp11
ContinuationIndentWidth: 8

61
.clang-format.headers Normal file
View File

@@ -0,0 +1,61 @@
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
IndentBraces: false
SplitEmptyFunction: true
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
AlwaysBreakAfterReturnType: All
Cpp11BracedListStyle: false
ColumnLimit: 80
AlignAfterOpenBracket: Align
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
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
PenaltyBreakAssignment: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 80
PenaltyExcessCharacter: 100
Standard: Cpp11
ContinuationIndentWidth: 8

View File

@@ -66,6 +66,8 @@
(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
@@ -77,6 +79,7 @@
(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")
)
)
@@ -84,5 +87,28 @@
(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"
(concat "-include=" (expand-file-name
(concat directory-of-current-dir-locals-file "config.h")))
)
)
)
))

12
.gitattributes vendored
View File

@@ -1,3 +1,11 @@
*.sln.in eol=crlf
*.vcxproj.in eol=crlf
*.vcxproj.filters.in eol=crlf
*.vcxproj.* eol=crlf
.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

11
.gitignore vendored
View File

@@ -4,13 +4,17 @@
*.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/
@@ -50,9 +54,16 @@
/stamp-h1
/test-driver
Makefile
Makefile.in
ans.run
gen.dSYM/
kyua.log
named.memstats
named.run
timestamp
/compile_commands.json
/cppcheck_html/
/cppcheck.results
/tsan
/util/check-make-install
/INSTALL

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,74 @@
## Release Schedule
**Code Freeze:**
**Tagging Deadline:**
**Public Release:**
## 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.
### 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.
- [ ] ***(Support)*** Check release notes, ask QA to correct any mistakes found.
- [ ] ***(Marketing)*** Check release notes, ask QA to correct any mistakes found.
- [ ] ***(SwEng)*** Update API files for libraries with new version information.
- [ ] ***(SwEng)*** Change software version and library versions in `configure.ac` (new major release only).
- [ ] ***(SwEng)*** Rebuild `configure` using Autoconf on `docs.isc.org`.
- [ ] ***(SwEng)*** Update `CHANGES`.
- [ ] ***(SwEng)*** Update `CHANGES.SE` (Subscription Edition only).
- [ ] ***(SwEng)*** Update `README.md`.
- [ ] ***(SwEng)*** Update `version`.
- [ ] ***(SwEng)*** Build documentation on `docs.isc.org`.
- [ ] ***(QA)*** Check that all the above steps were performed correctly.
- [ ] ***(QA)*** Check that the formatting is correct for text, PDF, and HTML versions of release notes.
- [ ] ***(SwEng)*** Tag the releases[^2]. (Tags may only be pushed to the public repository for releases which are *not* security releases.)
- [ ] ***(SwEng)*** If this is the first tag for a release (e.g. beta), create a release branch named `release_v9_X_Y` to allow development to continue on the maintenance branch whilst release engineering continues.
### 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)*** 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)*** 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.
- [ ] ***(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`).
- [ ] ***(SwEng)*** Push tags for the published releases to the public repository.
- [ ] ***(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)*** 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]: Preferred command line: `git tag -u <DEVELOPER_KEYID> -a -s -m "BIND 9.X.Y[alphatag]" v9_X_Y[alphatag]`, where `[alphatag]` is an optional string such as `b1`, `rc1`, etc.

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"
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: libltdl/
- exclude: fuzz/
- exclude: "bin/tests/system/*/ans*/*.py"
- exclude: cpp/use-of-goto

7
.pylintrc Normal file
View File

@@ -0,0 +1,7 @@
[MASTER]
disable=
C0114, # missing-module-docstring
C0115, # missing-class-docstring
C0116, # missing-function-docstring
R0801, # duplicate-code
C0103, # invalid-name

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

864
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 to which we expect
people to adhere. 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,188 +0,0 @@
CONTRIBUTING
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,14 +33,22 @@ 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
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 mirror to 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/master/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
@@ -68,7 +76,7 @@ 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
@@ -78,16 +86,16 @@ The branch in which the next major release is being developed is called
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.
@@ -97,26 +105,26 @@ If you think you may be seeing a potential security vulnerability in BIND
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,7 +132,7 @@ 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
@@ -134,10 +142,9 @@ 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 +155,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 +181,23 @@ 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

227
COPYRIGHT
View File

@@ -1,4 +1,4 @@
Copyright (C) 1996-2019 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 1996-2020 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
@@ -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.

1
ChangeLog Symbolic link
View File

@@ -0,0 +1 @@
CHANGES

526
HISTORY
View File

@@ -1,526 +0,0 @@
HISTORY
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 <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

@@ -10,6 +10,96 @@
-->
### Functional enhancements from prior major releases of BIND 9
#### BIND 9.16
BIND 9.16 (a stable branch based on the 9.15 development branch)
includes a number of changes from BIND 9.14 and earlier releases.
New features include:
* New `dnssec-policy` statement to configure a key and signing policy
for zones, enabling automatic key regeneration and rollover.
* New network manager based on `libuv`.
* Added support for the new GeoIP2 geolocation API, `libmaxminddb`.
* Improved DNSSEC trust anchor configuration using the `trust-anchors`
statement, permitting configuration of trust anchors in DS as well as
DNSKEY format.
* YAML output for `dig`, `mdig`, and `delv`.
#### BIND 9.14
BIND 9.14 (a stable branch based on the 9.13 development branch)
includes a number of changes from BIND 9.12 and earlier releases.
New features include:
* A new "plugin" mechanism has been added to allow query functionality
to be extended using dynamically loadable libraries. The "filter-aaaa"
feature has been removed from named and is now implemented as a plugin.
* 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`.
* "named -V" now outputs the default paths for files used by named
and other tools.
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 no
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.
#### BIND 9.12
BIND 9.12 includes a number of changes from BIND 9.11 and earlier releases.
New features include:
* `named` and related libraries have been substantially refactored for
improved query performance -- particularly on delegation heavy zones --
and for improved readability, maintainability, and testability.
* Code implementing the name server query processing logic has been moved
into a new `libns` library, for easier testing and use in tools other
than `named`.
* Cached, validated NSEC and other records can now be used to synthesize
NXDOMAIN responses.
* The DNS Response Policy Service API (DNSRPS) is now supported.
* Setting `'max-journal-size default'` now limits the size of journal files
to twice the size of the zone.
* `dnstap-read -x` prints a hex dump of the wire format of each logged
DNS message.
* `dnstap` output files can now be configured to roll automatically when
reaching a given size.
* Log file timestamps can now also be formatted in ISO 8601 (local) or ISO
8601 (UTC) formats.
* Logging channels and `dnstap` output files can now be configured to use a
timestamp as the suffix when rolling to a new file.
* `'named-checkconf -l'` lists zones found in `named.conf`.
* Added support for the EDNS Padding and Keepalive options.
* 'new-zones-directory' option sets the location where the configuration
data for zones added by rndc addzone is stored.
* The default key algorithm in `rndc-confgen` is now hmac-sha256.
* `filter-aaaa-on-v4` and `filter-aaaa-on-v6` options are now available
by default without a configure option.
* The obsolete `isc-hmac-fixup` command has been removed.
#### BIND 9.11
BIND 9.11.0 includes a number of changes from BIND 9.10 and earlier
@@ -75,7 +165,7 @@ releases. New features include:
- "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
- "rndc managed-keys" can be used to check the status of RFC 5011 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%.
@@ -458,8 +548,8 @@ BIND 9.4.0
- 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.
- Raise the UDP receive buffer size to 32k if it is less than 32k.
- x86 and x86_64 now have separate 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
@@ -476,8 +566,8 @@ BIND 9.4.0
- 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.
- Integrate contributed DLZ code into named.
- Integrate contributed IDN code from JPNIC.
- libbind: corresponds to that from BIND 8.4.7.
#### BIND 9.3.0

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 = . libltdl lib doc bin
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

51
Makefile.docs Normal file
View File

@@ -0,0 +1,51 @@
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 = \
-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 --metadata title="README" -f markdown-smart -t html README.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
HISTORY: HISTORY.md
${PANDOC} --email-obfuscation=none -s --metadata title="HISTORY" -f markdown-smart -t html HISTORY.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
OPTIONS: OPTIONS.md
${PANDOC} --email-obfuscation=none -s --metadata title="OPTIONS" -f markdown-smart -t html OPTIONS.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
CONTRIBUTING: CONTRIBUTING.md
${PANDOC} --email-obfuscation=none -s --metadata title="CONTRIBUTING" -f markdown-smart -t html CONTRIBUTING.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
PLATFORMS: PLATFORMS.md
${PANDOC} --email-obfuscation=none -s --metadata title="PLATFORMS" -f markdown-smart -t html PLATFORMS.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
unit::
sh ${top_builddir}/unit/unittest.sh
clean::

10
Makefile.tests Normal file
View File

@@ -0,0 +1,10 @@
# Hey Emacs, this is -*- makefile-automake -*- file!
# vim: filetype=automake
AM_CPPFLAGS += \
$(CMOCKA_CFLAGS) \
-DTESTS_DIR=\"$(abs_srcdir)\" \
-DNAMED_PLUGINDIR=\"$(libdir)/named\"
LDADD = \
$(CMOCKA_LIBS)

89
Makefile.top Normal file
View File

@@ -0,0 +1,89 @@
# 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
if HAVE_GSSAPI
AM_CPPFLAGS += \
$(GSSAPI_CFLAGS)
endif
LIBISC_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/isc/unix/include \
-I$(top_srcdir)/lib/isc/pthreads/include \
-I$(top_srcdir)/lib/isc/include \
-I$(top_builddir)/lib/isc/include
if HAVE_JSON_C
LIBISC_CFLAGS += \
$(JSON_C_CFLAGS)
endif HAVE_JSON_C
if HAVE_LIBXML2
LIBISC_CFLAGS += \
$(LIBXML2_CFLAGS)
endif HAVE_LIBXML2
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
if HAVE_DNSTAP
LIBDNS_CFLAGS += \
$(DNSTAP_CFLAGS)
endif HAVE_DNSTAP
if HAVE_LMDB
LIBDNS_CFLAGS += \
$(LMDB_CFLAGS)
endif HAVE_LMDB
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
LIBLTDL_CFLAGS = \
-I$(top_srcdir)/libltdl
LIBLTDL_LIBS = \
$(top_builddir)/libltdl/libltdlc.la

1
NEWS Symbolic link
View File

@@ -0,0 +1 @@
CHANGES

28
OPTIONS
View File

@@ -1,28 +0,0 @@
OPTIONS
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

@@ -1,75 +0,0 @@
PLATFORMS
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 Feb 2019, BIND 9.14 is fully supported and regularly tested on the
following systems:
* Debian 8, 9, 10
* Ubuntu 16.04, 18.04
* Fedora 28, 29
* Red Hat Enterprise Linux / CentOS 6, 7
* FreeBSD 11.x
* OpenBSD 6.2, 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. 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. With the exception of Windows
Server 2012 R2, none of these are tested regularly by ISC.
* Windows Server 2012 R2, 2016 / x64
* Windows 10 / x64
* macOS 10.12+
* Solaris 11
* FreeBSD 10.x, 12.0+
* OpenBSD 6.4+
* NetBSD
* Other Linux distributions still supported by their vendors, such as:
+ Ubuntu 14.04, 18.10+
+ Gentoo
+ Arch Linux
+ Alpine Linux
* OpenWRT/LEDE 17.01+
* Other CPU architectures (mips, mipsel, sparc, ...)
Unsupported platforms
These are platforms on which BIND 9.14 is known not to build or run:
* Platforms without at least OpenSSL 1.0.2
* Windows 10 / x86
* Windows Server 2012 and older
* 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
NetBSD 6 i386
The i386 build of NetBSD requires the libatomic library, available from
the gcc5-libs package. Because this library is in a non-standard path, its
location must be specified in the configure command line:
LDFLAGS="-L/usr/pkg/gcc5/i486--netbsdelf/lib/ -Wl,-R/usr/pkg/gcc5/i486--netbsdelf/lib/" ./configure

View File

@@ -11,11 +11,30 @@
## 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, POSIX-compliant threads, the `libuv` asynchronous I/O library,
and the OpenSSL cryptography library.
The following C11 features are used in BIND 9:
* 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.
* Thread Local Storage support from the compiler is needed, either in the form
of C11 `_Thread_local`/`thread_local`, the `__thread` GCC extension, or
the `__declspec(thread)` MSVC extension on Windows.
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 `libxml2` and `libjson-c` for statistics, `libmaxminddb` for
geolocation, `libfstrm` and `libprotobuf-c` for DNSTAP, and `libidn2` for
internationalized domain name conversion.
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,15 +42,16 @@ offer support on a "best effort" basis for some.
### Regularly tested platforms
As of Feb 2019, BIND 9.14 is fully supported and regularly tested on the
As of Jul 2020, BIND 9.17 is fully supported and regularly tested on the
following systems:
* Debian 8, 9, 10
* Ubuntu 16.04, 18.04
* Fedora 28, 29
* Red Hat Enterprise Linux / CentOS 6, 7
* FreeBSD 11.x
* OpenBSD 6.2, 6.3
* Debian 9, 10
* Ubuntu LTS 16.04, 20.04
* Fedora 32
* Red Hat Enterprise Linux / CentOS 7, 8
* FreeBSD 11.4, 12.1
* OpenBSD 6.7
* Alpine Linux 3.12
The amd64, i386, armhf and arm64 CPU architectures are all fully supported.
@@ -47,20 +67,33 @@ Server 2012 R2, none of these are tested regularly by ISC.
* Windows 10 / x64
* macOS 10.12+
* Solaris 11
* FreeBSD 10.x, 12.0+
* OpenBSD 6.4+
* NetBSD
* Other Linux distributions still supported by their vendors, such as:
* Ubuntu 14.04, 18.10+
* Ubuntu 19.04+
* Gentoo
* Arch Linux
* Alpine 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, 18.10
* CentOS 6
* Debian Jessie
* FreeBSD 10.x
## Unsupported platforms
These are platforms on which BIND 9.14 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
@@ -69,15 +102,4 @@ These are platforms on which BIND 9.14 is known *not* to build or run:
* 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
### NetBSD 6 i386
The i386 build of NetBSD requires the `libatomic` library, available from
the `gcc5-libs` package. Because this library is in a non-standard path,
its location must be specified in the `configure` command line:
```
LDFLAGS="-L/usr/pkg/gcc5/i486--netbsdelf/lib/ -Wl,-R/usr/pkg/gcc5/i486--netbsdelf/lib/" ./configure
```
* Platforms on which `libuv` cannot be compiled

436
README
View File

@@ -1,436 +0,0 @@
README
BIND 9
Contents
1. Introduction
2. Reporting bugs and getting help
3. Contributing to BIND
4. BIND 9.14 features
5. Building BIND
6. macOS
7. Dependencies
8. Compile-time options
9. Automated testing
10. Documentation
11. Change log
12. 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 licensed 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.
For a general overview of ISC security policies, read the Knowledge Base
article at https://kb.isc.org/docs/aa-00861.
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.14 features
BIND 9.14.0 is the first release from a new stable branch of BIND 9,
incorporating all changes from the 9.13 development branch, updating the
most recent stable branch, 9.12. These changes include:
* A new "plugin" mechanism has been added to allow query functionality
to be extended using dynamically loadable libraries. The "filter-aaaa"
feature has been removed from named and is now implemented as a
plugin.
* QNAME minimization, as described in RFC 7816, is now supported.
* Socket and task code has been refactored to improve performance on
most modern machines.
* "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.
* "named -V" now outputs the default paths for files used by named and
other tools.
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 no 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. Non-threaded builds
are no longer supported.
BIND 9.14.1
BIND 9.14.1 is a maintenance release, and addresses security
vulnerabilities disclosed in CVE-2018-5743 and CVE-2019-6467.
BIND 9.14.2
BIND 9.14.2 is a maintenance release.
BIND 9.14.3
BIND 9.14.3 is a maintenance release, and addresses the security
vulnerability disclosed in CVE-2019-6471.
BIND 9.14.4
BIND 9.14.4 is a maintenance release, and also adds support for the new
MaxMind GeoIP2 geolocation API when built with configure --with-geoip2.
BIND 9.14.5
BIND 9.14.5 is a maintenance release.
BIND 9.14.6
BIND 9.14.6 is a maintenance release.
BIND 9.14.7
BIND 9.14.7 is a maintenance release, and also addresses the security
vulnerabilities disclosed in CVE-2019-6475 and CVE-2019-6476.
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 RHEL/CentOS,
Fedora, Debian, Ubuntu, SLES, openSUSE, Slackware, Alpine, FreeBSD,
NetBSD, OpenBSD, macOS, Solaris, OpenIndiana, OmniOS CE, 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 Server 2008 and higher. See win32utils/
build.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 CFLAGS for the target system during cross-compiling.
BUILD_CPPFLAGS CPPFLAGS for the target system during cross-compiling.
BUILD_LDFLAGS LDFLAGS for the target system during cross-compiling.
BUILD_LIBS LIBS for the target system during cross-compiling.
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.
Dependencies
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.
Compile-time options
To see a full list of configuration options, run configure --help.
To build shared libraries, specify --with-libtool on the configure command
line.
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 libraries: libxml2 http://xmlsoft.org or 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,
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.
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.
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 package. Process capability support can also be disabled
by configuring with --disable-linux-caps.
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.
The --enable-querytrace option causes named to log every step of
processing every query. This should only be enabled when debugging,
because it has a significant negative impact on query performance.
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.
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. To look up a merge request,
use https://gitlab.isc.org/isc-projects/bind9/merge_requests/NNN.
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.
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)

312
README.md
View File

@@ -15,7 +15,7 @@
1. [Introduction](#intro)
1. [Reporting bugs and getting help](#help)
1. [Contributing to BIND](#contrib)
1. [BIND 9.14 features](#features)
1. [BIND 9.17 features](#features)
1. [Building BIND](#build)
1. [macOS](#macos)
1. [Dependencies](#dependencies)
@@ -28,26 +28,26 @@
### <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
ongoing maintenance and improvement. BIND is open source software
licensed under the terms of the Mozilla Public License, version 2.0.
For a summary of features introduced in past major releases of BIND,
@@ -57,36 +57,41 @@ 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 Knowledge Base
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).
@@ -98,160 +103,106 @@ 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).
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.14 features
### <a name="features"/> BIND 9.17 features
BIND 9.14.0 is the first release from a new stable branch of BIND 9,
incorporating all changes from the 9.13 development branch, updating
the most recent stable branch, 9.12. These changes include:
BIND 9.17 is the newest development branch of BIND 9. It includes a
number of changes from BIND 9.16 and earlier releases. New features include:
* A new "plugin" mechanism has been added to allow query functionality
to be extended using dynamically loadable libraries. The "filter-aaaa"
feature has been removed from named and is now implemented as a plugin.
* QNAME minimization, as described in RFC 7816, is now supported.
* Socket and task code has been refactored to improve performance on most
modern machines.
* "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`.
* "named -V" now outputs the default paths for files used by named
and other tools.
* The new option `max-ixfr-ratio` to limit the size of outgoing IXFR responses
before falling back to full zone transfers.
* `rndc nta -d` and `rndc secroots` now include `validate-except` entries
when listing negative trust anchors.
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.
### <a name="build"/> Building BIND 9
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 no
longer supported.
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, and 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.
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. Non-threaded builds are no longer supported.
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.
#### BIND 9.14.1
BIND 9.14.1 is a maintenance release, and addresses security
vulnerabilities disclosed in CVE-2018-5743 and CVE-2019-6467.
#### BIND 9.14.2
BIND 9.14.2 is a maintenance release.
#### BIND 9.14.3
BIND 9.14.3 is a maintenance release, and addresses the security
vulnerability disclosed in CVE-2019-6471.
#### BIND 9.14.4
BIND 9.14.4 is a maintenance release, and also adds support for
the new MaxMind GeoIP2 geolocation API when built with
`configure --with-geoip2`.
#### BIND 9.14.5
BIND 9.14.5 is a maintenance release.
#### BIND 9.14.6
BIND 9.14.6 is a maintenance release.
#### BIND 9.14.7
BIND 9.14.7 is a maintenance release, and also addresses the security
vulnerabilities disclosed in CVE-2019-6475 and CVE-2019-6476.
### <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 RHEL/CentOS, Fedora,
Debian, Ubuntu, SLES, openSUSE, Slackware, Alpine, FreeBSD, NetBSD,
OpenBSD, macOS, Solaris, OpenIndiana, OmniOS CE, 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 Server 2008 and higher. See
BIND 9 is also available for Windows Server 2012 R2 and higher. See
`win32utils/build.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.
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`|`CFLAGS` for the target system during cross-compiling.|
|`BUILD_CPPFLAGS`|`CPPFLAGS` for the target system during cross-compiling.|
|`BUILD_LDFLAGS`|`LDFLAGS` for the target system during cross-compiling.|
|`BUILD_LIBS`|`LIBS` for the target system during cross-compiling.|
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/](https://developer.apple.com/download/more/)
or if you have Xcode already installed you can run `xcode-select --install`.
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
#### <a name="dependencies"> Dependencies
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).
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
libltdl-dev (Debian) / libtool-ltdl-dev (Fedora/CentOS) / libltdl (FreeBSD)
#### <a name="opts"/> Compile-time options
@@ -261,7 +212,7 @@ To build shared libraries, specify `--with-libtool` on the `configure`
command line.
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 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
@@ -274,21 +225,22 @@ least one of the following libraries: `libxml2`
[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 `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`
[https://github.com/farsightsec/fstrm](https://github.com/farsightsec/fstrm)
@@ -296,12 +248,10 @@ 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 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.
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
@@ -314,56 +264,54 @@ to handle files bigger than 2GB. This can be done by using
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.
The `--enable-querytrace` option causes `named` to log every step of
processing every query. This should only be enabled when debugging, because
it has a significant negative impact on query performance.
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` will install `named` and the various BIND 9 libraries. By
`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.
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](https://cmocka.org/).
To build them, use `configure --with-cmocka`. Execution of tests is done
by the [Kyua test execution engine](https://github.com/jmmv/kyua); 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
@@ -372,8 +320,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 |
@@ -391,12 +339,12 @@ 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 master 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
@@ -406,7 +354,7 @@ 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.
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).
@@ -436,7 +384,7 @@ GitLab instance, which is not visible to the public.
* 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).

300
aclocal.m4 vendored
View File

@@ -1,300 +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/ax_restore_flags.m4])
m4_include([m4/ax_save_flags.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@ plugins 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@ ${MAXMINDDB_LIBS} @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="${BIND9LIBS} ${NSLIBS} ${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

@@ -9,25 +9,21 @@
* 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
#endif /* ifdef _WIN32 */
#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 +50,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 +85,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 +122,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 +178,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 +207,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 +226,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 +240,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 +250,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 +268,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 +282,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 +316,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 +326,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 +409,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 +428,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 +439,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 +453,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 +495,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 +525,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 +539,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 +553,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 +565,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 +596,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 +632,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 +669,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 +680,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 +694,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 +716,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 +741,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,36 +752,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);
}
@@ -759,7 +798,7 @@ InitSockets(void) {
wVersionRequested = MAKEWORD(2, 0);
err = WSAStartup( wVersionRequested, &wsaData );
err = WSAStartup(wVersionRequested, &wsaData);
if (err != 0) {
fprintf(stderr, "WSAStartup() failed: %d\n", err);
exit(1);
@@ -770,4 +809,4 @@ void
DestroySockets(void) {
WSACleanup();
}
#endif
#endif /* ifdef _WIN32 */

View File

@@ -9,7 +9,6 @@
* information regarding copyright ownership.
*/
#ifndef CHECK_TOOL_H
#define CHECK_TOOL_H
@@ -42,9 +41,11 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
const uint32_t rawversion);
#ifdef _WIN32
void InitSockets(void);
void DestroySockets(void);
#endif
void
InitSockets(void);
void
DestroySockets(void);
#endif /* ifdef _WIN32 */
extern int debug;
extern const char *journal;
@@ -56,4 +57,4 @@ extern dns_zoneopt_t zone_options;
ISC_LANG_ENDDECLS
#endif
#endif /* ifndef CHECK_TOOL_H */

View File

@@ -1,147 +0,0 @@
.\" Copyright (C) 2000-2002, 2004, 2005, 2007, 2009, 2014-2016, 2018, 2019 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\-chjlvz\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
\-c
.RS 4
Check "core" configuration only\&. This suppresses the loading of plugin modules, and causes all parameters to
\fBplugin\fR
statements to be ignored\&.
.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, 2019 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -9,16 +9,14 @@
* 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,6 +36,11 @@
#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";
@@ -50,21 +49,23 @@ 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 [-chjlvz] [-p [-x]] [-t directory] "
"[named.conf]\n", program);
fprintf(stderr,
"usage: %s [-chijlvz] [-p [-x]] [-t directory] "
"[named.conf]\n",
program);
exit(1);
}
@@ -86,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);
}
@@ -98,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);
}
}
}
@@ -115,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;
}
@@ -150,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);
@@ -169,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;
@@ -196,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;
@@ -217,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);
@@ -234,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.
@@ -265,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)) {
@@ -315,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)) {
@@ -364,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;
@@ -400,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;
@@ -422,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;
@@ -446,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)) {
@@ -486,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;
@@ -497,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;
@@ -507,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:
@@ -557,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;
@@ -564,20 +595,28 @@ main(int argc, char **argv) {
/*
* Process memory debugging argument first.
*/
#define CMDLINE_FLAGS "cdhjlm: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)
}
if (strcasecmp(isc_commandline_argument, "size") == 0) {
isc_mem_debugging |= ISC_MEM_DEBUGSIZE;
if (strcasecmp(isc_commandline_argument, "mctx") == 0)
}
if (strcasecmp(isc_commandline_argument, "mctx") == 0) {
isc_mem_debugging |= ISC_MEM_DEBUGCTX;
}
break;
default:
break;
@@ -585,7 +624,7 @@ 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) {
@@ -597,6 +636,10 @@ main(int argc, char **argv) {
debug++;
break;
case 'i':
nodeprecate = true;
break;
case 'j':
nomerge = false;
break;
@@ -622,7 +665,7 @@ main(int argc, char **argv) {
break;
case 'v':
printf(VERSION "\n");
printf("%s\n", PACKAGE_VERSION);
exit(0);
case 'x':
@@ -637,16 +680,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);
}
}
@@ -660,16 +704,19 @@ 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
#endif /* ifdef _WIN32 */
RUNTIME_CHECK(setup_logging(mctx, stdout, &logc) == ISC_R_SUCCESS);
@@ -677,11 +724,16 @@ 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, loadplugins, logc, mctx);
if (result != ISC_R_SUCCESS) {
@@ -690,25 +742,25 @@ main(int argc, char **argv) {
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
#endif /* ifdef _WIN32 */
return (exit_status);
}

View File

@@ -1,219 +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>
<year>2019</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>-chjlvz</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>-c</term>
<listitem>
<para>
Check "core" configuration only. This suppresses the loading
of plugin modules, and causes all parameters to
<command>plugin</command> statements to be ignored.
</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,174 +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, 2019 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">-chjlvz</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">-c</span></dt>
<dd>
<p>
Check "core" configuration only. This suppresses the loading
of plugin modules, and causes all parameters to
<span class="command"><strong>plugin</strong></span> statements to be ignored.
</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 http://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, 2019 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, 2019 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -9,18 +9,17 @@
* 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,60 @@ 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
#endif /* ifdef _WIN32 */
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 +557,24 @@ 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
#endif /* ifdef _WIN32 */
return ((result == ISC_R_SUCCESS) ? 0 : 1);
}

View File

@@ -1,528 +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>
<year>2019</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, 2019 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,215 @@
..
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.
..
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-checkzone:
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

@@ -44,19 +44,22 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -65,6 +68,7 @@
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<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>
@@ -78,7 +82,8 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@@ -92,6 +97,7 @@
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<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>
@@ -112,6 +118,26 @@
<ItemGroup>
<ClCompile Include="..\named-checkconf.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\ns\win32\libns.vcxproj">
<Project>{82ACD33C-E75F-45B8-BB6D-42643A10D7EE}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\bind9\win32\libbind9.vcxproj">
<Project>{E741C10B-B075-4206-9596-46765B665E03}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\check\win32\checktool.vcxproj">
<Project>{2C1F7096-C5B5-48D4-846F-A7ACA454335D}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -48,18 +48,21 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<OutDir>.\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -68,6 +71,7 @@
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<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>
@@ -77,7 +81,8 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@@ -91,6 +96,7 @@
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<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>
@@ -98,6 +104,20 @@
<OutputFile>.\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\ns\win32\libns.vcxproj">
<Project>{82ACD33C-E75F-45B8-BB6D-42643A10D7EE}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -44,19 +44,22 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -65,6 +68,7 @@
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
@@ -84,7 +88,8 @@ copy /Y named-checkzone.ilk named-compilezone.ilk
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@@ -98,6 +103,7 @@ copy /Y named-checkzone.ilk named-compilezone.ilk
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
@@ -123,6 +129,23 @@ copy /Y named-checkzone.exe named-compilezone.exe
<ItemGroup>
<ClCompile Include="..\named-checkzone.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\ns\win32\libns.vcxproj">
<Project>{82ACD33C-E75F-45B8-BB6D-42643A10D7EE}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\check\win32\checktool.vcxproj">
<Project>{2C1F7096-C5B5-48D4-846F-A7ACA454335D}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?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.h \
keygen.c \
util.h \
util.c \
unix/os.c
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@ ${MAXMINDDB_LIBS} @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, 2019 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, 2019 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,212 +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>
<year>2019</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, 2019 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

@@ -9,18 +9,19 @@
* 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

@@ -9,13 +9,11 @@
* 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

@@ -9,26 +9,33 @@
* 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

View File

@@ -1,210 +0,0 @@
.\" Copyright (C) 2001, 2003-2005, 2007, 2009, 2013-2019 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-2019 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -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,270 +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>
<year>2019</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-2019 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 http://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.

View File

@@ -12,18 +12,16 @@
/*! \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.
* tsig-keygen generates TSIG keys that can be used in named configuration
* files for dynamic DNS.
*/
#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>
@@ -38,28 +36,29 @@
#if USE_PKCS11
#include <pk11/result.h>
#endif
#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 "util.h"
#include "keygen.h"
#include "util.h"
#define KEYGEN_DEFAULT "tsig-key"
#define CONFGEN_DEFAULT "ddns-key"
#define KEYGEN_DEFAULT "tsig-key"
#define CONFGEN_DEFAULT "ddns-key"
static char program[256];
const char *progname;
static enum { progmode_keygen, progmode_confgen} progmode;
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;
ISC_NORETURN static void
usage(int status);
static void
usage(int status) {
@@ -72,16 +71,16 @@ Usage:\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);
progname);
} else {
fprintf(stderr, "\
Usage:\n\
%s [-a alg] [keyname]\n\
-a alg: algorithm (default hmac-sha256)\n\n",
progname);
progname);
}
exit (status);
exit(status);
}
int
@@ -104,20 +103,22 @@ main(int argc, char **argv) {
#if USE_PKCS11
pk11_result_register();
#endif
#endif /* if USE_PKCS11 */
dns_result_register();
result = isc_file_progname(*argv, program, sizeof(program));
if (result != ISC_R_SUCCESS)
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)
if (strncmp(progname, "lt-", 3) == 0) {
progname += 3;
}
#define PROGCMP(X) \
(strcasecmp(progname, X) == 0 || strcasecmp(progname, X ".exe") == 0)
@@ -134,24 +135,26 @@ main(int argc, char **argv) {
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv,
"a:hk:Mmr:qs:y:z:")) != -1) {
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)
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)
if (progmode == progmode_confgen) {
keyname = isc_commandline_argument;
else
} else {
usage(1);
}
break;
case 'M':
isc_mem_debugging = ISC_MEM_DEBUGTRACE;
@@ -160,74 +163,79 @@ main(int argc, char **argv) {
show_final_mem = true;
break;
case 'q':
if (progmode == progmode_confgen)
if (progmode == progmode_confgen) {
quiet = true;
else
} else {
usage(1);
}
break;
case 'r':
fatal("The -r option has been deprecated.");
break;
case 's':
if (progmode == progmode_confgen)
if (progmode == progmode_confgen) {
self_domain = isc_commandline_argument;
else
} else {
usage(1);
}
break;
case 'z':
if (progmode == progmode_confgen)
if (progmode == progmode_confgen) {
zone = isc_commandline_argument;
else
} else {
usage(1);
}
break;
case '?':
if (isc_commandline_option != '?') {
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);
}
}
if (progmode == progmode_keygen)
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 (self_domain != NULL && zone != NULL) {
usage(1); /* -s and -z cannot coexist */
}
if (argc > isc_commandline_index)
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));
isc_mem_create(&mctx);
if (keyname == NULL) {
const char *suffix = NULL;
keyname = ((progmode == progmode_keygen)
? KEYGEN_DEFAULT
: CONFGEN_DEFAULT);
if (self_domain != NULL)
keyname = ((progmode == progmode_keygen) ? KEYGEN_DEFAULT
: CONFGEN_DEFAULT);
if (self_domain != NULL) {
suffix = self_domain;
else if (zone != NULL)
} 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;
keyname = (const char *)keybuf;
}
}
@@ -235,20 +243,19 @@ main(int argc, char **argv) {
generate_key(mctx, alg, keysize, &key_txtbuffer);
if (!quiet)
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),
keyname, algname, (int)isc_buffer_usedlength(&key_txtbuffer),
(char *)isc_buffer_base(&key_txtbuffer));
if (!quiet) {
@@ -286,14 +293,15 @@ update-policy {\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)
if (keybuf != NULL) {
isc_mem_put(mctx, keybuf, len);
}
if (show_final_mem)
if (show_final_mem) {
isc_mem_stats(mctx, stderr);
}
isc_mem_destroy(&mctx);

103
bin/confgen/tsig-keygen.rst Normal file
View File

@@ -0,0 +1,103 @@
..
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.
..
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_tsig-keygen:
tsig-keygen, ddns-confgen - TSIG key generation tool
----------------------------------------------------
Synopsis
~~~~~~~~
:program:`tsig-keygen` [**-a** algorithm] [**-h**] [**-r** randomfile] [**-s** 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

@@ -9,20 +9,17 @@
* 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 <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) {

View File

@@ -9,20 +9,16 @@
* 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

@@ -9,27 +9,26 @@
* information regarding copyright ownership.
*/
#ifndef RNDC_UTIL_H
#define RNDC_UTIL_H 1
/*! \file */
#include <isc/attributes.h>
#include <isc/formatcheck.h>
#include <isc/lang.h>
#include <isc/platform.h>
#include <isc/formatcheck.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 +36,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

@@ -44,17 +44,20 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>.\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -63,6 +66,7 @@
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
@@ -73,7 +77,8 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@@ -87,6 +92,7 @@
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
@@ -108,6 +114,14 @@
<ClCompile Include="..\util.c" />
<ClCompile Include="os.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -9,19 +9,16 @@
* information regarding copyright ownership.
*/
#include <config.h>
#include <errno.h>
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.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

@@ -44,19 +44,22 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>rndc-confgen</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>rndc-confgen</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -65,20 +68,22 @@
<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>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<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>
<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>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@@ -92,7 +97,8 @@
<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>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
@@ -102,13 +108,24 @@
<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>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\rndc-confgen.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\confgen\win32\confgentool.vcxproj">
<Project>{64964B03-4815-41F0-9057-E766A94AF197}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -11,8 +11,8 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\ddns-confgen.c">
<ClCompile Include="..\tsig-keygen.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
</Project>

View File

@@ -13,7 +13,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{1EA4FC64-F33B-4A50-970A-EA052BBE9CF1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ddnsconfgen</RootNamespace>
<RootNamespace>tsigkeygen</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -44,19 +44,22 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>ddns-confgen</TargetName>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>tsig-keygen</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>ddns-confgen</TargetName>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>tsig-keygen</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -65,26 +68,28 @@
<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>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<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>
<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>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.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
copy /Y tsig-keygen.exe ddns-confgen.exe
copy /Y tsig-keygen.ilk ddns-confgen.ilk
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@@ -98,7 +103,8 @@ copy /Y ddns-confgen.ilk tsig-keygen.ilk
<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>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
@@ -108,17 +114,28 @@ copy /Y ddns-confgen.ilk tsig-keygen.ilk
<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>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y ddns-confgen.exe tsig-keygen.exe
copy /Y tsig-keygen.exe ddns-confgen.exe
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\ddns-confgen.c" />
<ClCompile Include="..\tsig-keygen.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\confgen\win32\confgentool.vcxproj">
<Project>{64964B03-4815-41F0-9057-E766A94AF197}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
<?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@ ${MAXMINDDB_LIBS} @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-2019 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-2019 Internet Systems Consortium, Inc. ("ISC")
.br

File diff suppressed because it is too large Load Diff

View File

@@ -1,701 +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>
<year>2019</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>

View File

@@ -1,592 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
- Copyright (C) 2014-2019 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>delv</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.delv"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>
delv
&#8212; DNS lookup and validation utility
</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="cmdsynopsis"><p>
<code class="command">delv</code>
[@server]
[
[<code class="option">-4</code>]
| [<code class="option">-6</code>]
]
[<code class="option">-a <em class="replaceable"><code>anchor-file</code></em></code>]
[<code class="option">-b <em class="replaceable"><code>address</code></em></code>]
[<code class="option">-c <em class="replaceable"><code>class</code></em></code>]
[<code class="option">-d <em class="replaceable"><code>level</code></em></code>]
[<code class="option">-i</code>]
[<code class="option">-m</code>]
[<code class="option">-p <em class="replaceable"><code>port#</code></em></code>]
[<code class="option">-q <em class="replaceable"><code>name</code></em></code>]
[<code class="option">-t <em class="replaceable"><code>type</code></em></code>]
[<code class="option">-x <em class="replaceable"><code>addr</code></em></code>]
[name]
[type]
[class]
[queryopt...]
</p></div>
<div class="cmdsynopsis"><p>
<code class="command">delv</code>
[<code class="option">-h</code>]
</p></div>
<div class="cmdsynopsis"><p>
<code class="command">delv</code>
[<code class="option">-v</code>]
</p></div>
<div class="cmdsynopsis"><p>
<code class="command">delv</code>
[queryopt...]
[query...]
</p></div>
</div>
<div class="refsection">
<a name="id-1.7"></a><h2>DESCRIPTION</h2>
<p><span class="command"><strong>delv</strong></span>
is a tool for sending
DNS queries and validating the results, using the same internal
resolver and validator logic as <span class="command"><strong>named</strong></span>.
</p>
<p>
<span class="command"><strong>delv</strong></span> 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.
</p>
<p>
By default, responses are validated using built-in DNSSEC trust
anchor for the root zone ("."). Records returned by
<span class="command"><strong>delv</strong></span> 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 <span class="command"><strong>delv</strong></span> 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.
</p>
<p>
Unless it is told to query a specific name server,
<span class="command"><strong>delv</strong></span> will try each of the servers listed in
<code class="filename">/etc/resolv.conf</code>. If no usable server
addresses are found, <span class="command"><strong>delv</strong></span> will send
queries to the localhost addresses (127.0.0.1 for IPv4, ::1
for IPv6).
</p>
<p>
When no command line arguments or options are given,
<span class="command"><strong>delv</strong></span> will perform an NS query for "."
(the root zone).
</p>
</div>
<div class="refsection">
<a name="id-1.8"></a><h2>SIMPLE USAGE</h2>
<p>
A typical invocation of <span class="command"><strong>delv</strong></span> looks like:
</p>
<pre class="programlisting"> delv @server name type </pre>
<p>
where:
</p>
<div class="variablelist"><dl class="variablelist">
<dt><span class="term"><code class="constant">server</code></span></dt>
<dd>
<p>
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
<em class="parameter"><code>server</code></em> argument is a hostname,
<span class="command"><strong>delv</strong></span> resolves that name before
querying that name server (note, however, that this
initial lookup is <span class="emphasis"><em>not</em></span> validated
by DNSSEC).
</p>
<p>
If no <em class="parameter"><code>server</code></em> argument is
provided, <span class="command"><strong>delv</strong></span> consults
<code class="filename">/etc/resolv.conf</code>; if an
address is found there, it queries the name server at
that address. If either of the <code class="option">-4</code> or
<code class="option">-6</code> options are in use, then
only addresses for the corresponding transport
will be tried. If no usable addresses are found,
<span class="command"><strong>delv</strong></span> will send queries to
the localhost addresses (127.0.0.1 for IPv4,
::1 for IPv6).
</p>
</dd>
<dt><span class="term"><code class="constant">name</code></span></dt>
<dd>
<p>
is the domain name to be looked up.
</p>
</dd>
<dt><span class="term"><code class="constant">type</code></span></dt>
<dd>
<p>
indicates what type of query is required &#8212;
ANY, A, MX, etc.
<em class="parameter"><code>type</code></em> can be any valid query
type. If no
<em class="parameter"><code>type</code></em> argument is supplied,
<span class="command"><strong>delv</strong></span> will perform a lookup for an
A record.
</p>
</dd>
</dl></div>
<p>
</p>
</div>
<div class="refsection">
<a name="id-1.9"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl class="variablelist">
<dt><span class="term">-a <em class="replaceable"><code>anchor-file</code></em></span></dt>
<dd>
<p>
Specifies a file from which to read DNSSEC trust anchors.
The default is <code class="filename">/etc/bind.keys</code>, which
is included with <acronym class="acronym">BIND</acronym> 9 and contains
one or more trust anchors for the root zone (".").
</p>
<p>
Keys that do not match the root zone name are ignored.
An alternate key name can be specified using the
<code class="option">+root=NAME</code> options. DNSSEC Lookaside
Validation can also be turned on by using the
<code class="option">+dlv=NAME</code> to specify the name of a
zone containing DLV records.
</p>
<p>
Note: When reading the trust anchor file,
<span class="command"><strong>delv</strong></span> treats <code class="option">managed-keys</code>
statements and <code class="option">trusted-keys</code> statements
identically. That is, for a managed key, it is the
<span class="emphasis"><em>initial</em></span> key that is trusted; RFC 5011
key management is not supported. <span class="command"><strong>delv</strong></span>
will not consult the managed-keys database maintained by
<span class="command"><strong>named</strong></span>. This means that if either of the
keys in <code class="filename">/etc/bind.keys</code> is revoked
and rolled over, it will be necessary to update
<code class="filename">/etc/bind.keys</code> to use DNSSEC
validation in <span class="command"><strong>delv</strong></span>.
</p>
</dd>
<dt><span class="term">-b <em class="replaceable"><code>address</code></em></span></dt>
<dd>
<p>
Sets the source IP address of the query to
<em class="parameter"><code>address</code></em>. 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;"
</p>
</dd>
<dt><span class="term">-c <em class="replaceable"><code>class</code></em></span></dt>
<dd>
<p>
Sets the query class for the requested data. Currently,
only class "IN" is supported in <span class="command"><strong>delv</strong></span>
and any other value is ignored.
</p>
</dd>
<dt><span class="term">-d <em class="replaceable"><code>level</code></em></span></dt>
<dd>
<p>
Set the systemwide debug level to <code class="option">level</code>.
The allowed range is from 0 to 99.
The default is 0 (no debugging).
Debugging traces from <span class="command"><strong>delv</strong></span> become
more verbose as the debug level increases.
See the <code class="option">+mtrace</code>, <code class="option">+rtrace</code>,
and <code class="option">+vtrace</code> options below for additional
debugging details.
</p>
</dd>
<dt><span class="term">-h</span></dt>
<dd>
<p>
Display the <span class="command"><strong>delv</strong></span> help usage output and exit.
</p>
</dd>
<dt><span class="term">-i</span></dt>
<dd>
<p>
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 <span class="command"><strong>delv</strong></span> to time out. When it
is necessary to examine invalid data to debug a DNSSEC
problem, use <span class="command"><strong>dig +cd</strong></span>.)
</p>
</dd>
<dt><span class="term">-m</span></dt>
<dd>
<p>
Enables memory usage debugging.
</p>
</dd>
<dt><span class="term">-p <em class="replaceable"><code>port#</code></em></span></dt>
<dd>
<p>
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.
</p>
</dd>
<dt><span class="term">-q <em class="replaceable"><code>name</code></em></span></dt>
<dd>
<p>
Sets the query name to <em class="parameter"><code>name</code></em>.
While the query name can be specified without using the
<code class="option">-q</code>, 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).
</p>
</dd>
<dt><span class="term">-t <em class="replaceable"><code>type</code></em></span></dt>
<dd>
<p>
Sets the query type to <em class="parameter"><code>type</code></em>, which
can be any valid query type supported in BIND 9 except
for zone transfer types AXFR and IXFR. As with
<code class="option">-q</code>, this is useful to distinguish
query name type or class when they are ambiguous.
it is sometimes necessary to disambiguate names from types.
</p>
<p>
The default query type is "A", unless the <code class="option">-x</code>
option is supplied to indicate a reverse lookup, in which case
it is "PTR".
</p>
</dd>
<dt><span class="term">-v</span></dt>
<dd>
<p>
Print the <span class="command"><strong>delv</strong></span> version and exit.
</p>
</dd>
<dt><span class="term">-x <em class="replaceable"><code>addr</code></em></span></dt>
<dd>
<p>
Performs a reverse lookup, mapping an addresses to
a name. <em class="parameter"><code>addr</code></em> is an IPv4 address in
dotted-decimal notation, or a colon-delimited IPv6 address.
When <code class="option">-x</code> is used, there is no need to provide
the <em class="parameter"><code>name</code></em> or <em class="parameter"><code>type</code></em>
arguments. <span class="command"><strong>delv</strong></span> automatically performs a
lookup for a name like <code class="literal">11.12.13.10.in-addr.arpa</code>
and sets the query type to PTR. IPv6 addresses are looked up
using nibble format under the IP6.ARPA domain.
</p>
</dd>
<dt><span class="term">-4</span></dt>
<dd>
<p>
Forces <span class="command"><strong>delv</strong></span> to only use IPv4.
</p>
</dd>
<dt><span class="term">-6</span></dt>
<dd>
<p>
Forces <span class="command"><strong>delv</strong></span> to only use IPv6.
</p>
</dd>
</dl></div>
</div>
<div class="refsection">
<a name="id-1.10"></a><h2>QUERY OPTIONS</h2>
<p><span class="command"><strong>delv</strong></span>
provides a number of query options which affect the way results are
displayed, and in some cases the way lookups are performed.
</p>
<p>
Each query option is identified by a keyword preceded by a plus sign
(<code class="literal">+</code>). Some keywords set or reset an
option. These may be preceded by the string
<code class="literal">no</code> to negate the meaning of that keyword.
Other keywords assign values to options like the timeout interval.
They have the form <code class="option">+keyword=value</code>.
The query options are:
</p>
<div class="variablelist"><dl class="variablelist">
<dt><span class="term"><code class="option">+[no]cdflag</code></span></dt>
<dd>
<p>
Controls whether to set the CD (checking disabled) bit in
queries sent by <span class="command"><strong>delv</strong></span>. 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 <span class="command"><strong>delv</strong></span> can then
validate internally and report the errors in detail.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]class</code></span></dt>
<dd>
<p>
Controls whether to display the CLASS when printing
a record. The default is to display the CLASS.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]ttl</code></span></dt>
<dd>
<p>
Controls whether to display the TTL when printing
a record. The default is to display the TTL.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]rtrace</code></span></dt>
<dd>
<p>
Toggle resolver fetch logging. This reports the
name and type of each query sent by <span class="command"><strong>delv</strong></span>
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.
</p>
<p>
This is equivalent to setting the debug level to 1 in
the "resolver" logging category. Setting the systemwide
debug level to 1 using the <code class="option">-d</code> option will
product the same output (but will affect other logging
categories as well).
</p>
</dd>
<dt><span class="term"><code class="option">+[no]mtrace</code></span></dt>
<dd>
<p>
Toggle message logging. This produces a detailed dump of
the responses received by <span class="command"><strong>delv</strong></span> in the
process of carrying out the resolution and validation process.
</p>
<p>
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 <code class="option">-d</code> option will produce the same output
(but will affect other logging categories as well).
</p>
</dd>
<dt><span class="term"><code class="option">+[no]vtrace</code></span></dt>
<dd>
<p>
Toggle validation logging. This shows the internal
process of the validator as it determines whether an
answer is validly signed, unsigned, or invalid.
</p>
<p>
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 <code class="option">-d</code> option will produce the same output
(but will affect other logging categories as well).
</p>
</dd>
<dt><span class="term"><code class="option">+[no]short</code></span></dt>
<dd>
<p>
Provide a terse answer. The default is to print the answer in a
verbose form.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]comments</code></span></dt>
<dd>
<p>
Toggle the display of comment lines in the output. The default
is to print comments.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]rrcomments</code></span></dt>
<dd>
<p>
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.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]crypto</code></span></dt>
<dd>
<p>
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 ]".
</p>
</dd>
<dt><span class="term"><code class="option">+[no]trust</code></span></dt>
<dd>
<p>
Controls whether to display the trust level when printing
a record. The default is to display the trust level.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]split[=W]</code></span></dt>
<dd>
<p>
Split long hex- or base64-formatted fields in resource
records into chunks of <em class="parameter"><code>W</code></em> characters
(where <em class="parameter"><code>W</code></em> is rounded up to the nearest
multiple of 4).
<em class="parameter"><code>+nosplit</code></em> or
<em class="parameter"><code>+split=0</code></em> causes fields not to be
split at all. The default is 56 characters, or 44 characters
when multiline mode is active.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]all</code></span></dt>
<dd>
<p>
Set or clear the display options
<code class="option">+[no]comments</code>,
<code class="option">+[no]rrcomments</code>, and
<code class="option">+[no]trust</code> as a group.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]multiline</code></span></dt>
<dd>
<p>
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 <span class="command"><strong>delv</strong></span>
output.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]dnssec</code></span></dt>
<dd>
<p>
Indicates whether to display RRSIG records in the
<span class="command"><strong>delv</strong></span> output. The default is to
do so. Note that (unlike in <span class="command"><strong>dig</strong></span>)
this does <span class="emphasis"><em>not</em></span> 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
<code class="option">-i</code> or <code class="option">+noroot</code> and
<code class="option">+nodlv</code>.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]root[=ROOT]</code></span></dt>
<dd>
<p>
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 <code class="option">-a</code> must be used to specify a file
containing the key.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]dlv[=DLV]</code></span></dt>
<dd>
<p>
Indicates whether to perform DNSSEC lookaside validation,
and if so, specifies the name of the DLV trust anchor.
The <code class="option">-a</code> option must also be used to specify
a file containing the DLV key.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]tcp</code></span></dt>
<dd>
<p>
Controls whether to use TCP when sending queries.
The default is to use UDP unless a truncated
response has been received.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]unknownformat</code></span></dt>
<dd>
<p>
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.
</p>
</dd>
</dl></div>
<p>
</p>
</div>
<div class="refsection">
<a name="id-1.11"></a><h2>FILES</h2>
<p><code class="filename">/etc/bind.keys</code></p>
<p><code class="filename">/etc/resolv.conf</code></p>
</div>
<div class="refsection">
<a name="id-1.12"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry">
<span class="refentrytitle">dig</span>(1)
</span>,
<span class="citerefentry">
<span class="refentrytitle">named</span>(8)
</span>,
<em class="citetitle">RFC4034</em>,
<em class="citetitle">RFC4035</em>,
<em class="citetitle">RFC4431</em>,
<em class="citetitle">RFC5074</em>,
<em class="citetitle">RFC5155</em>.
</p>
</div>
</div></body>
</html>

336
bin/delv/delv.rst Normal file
View File

@@ -0,0 +1,336 @@
..
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.
..
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_delv:
delv - DNS lookup and validation utility
----------------------------------------
Synopsis
~~~~~~~~
:program:`delv` [@server] [ [**-4**] | [**-6**] ] [**-a** anchor-file] [**-b** address] [**-c** class] [**-d** level] [**-i**] [**-m**] [**-p** port#] [**-q** name] [**-t** type] [**-x** addr] [name] [type] [class] [queryopt...]
:program:`delv` [**-h**]
:program:`delv` [**-v**]
:program:`delv` [queryopt...] [query...]
Description
~~~~~~~~~~~
``delv`` is a tool for sending DNS queries and validating the results,
using the same internal resolver and validator logic as ``named``.
``delv`` sends 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,
queries for DNSKEY, and DS 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.
By default, responses are validated using the built-in DNSSEC trust anchor
for the root zone ("."). Records returned by ``delv`` 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 ``delv`` 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.
Unless it is told to query a specific name server, ``delv`` tries
each of the servers listed in ``/etc/resolv.conf``. If no usable server
addresses are found, ``delv`` sends queries to the localhost
addresses (127.0.0.1 for IPv4, ::1 for IPv6).
When no command-line arguments or options are given, ``delv``
performs an NS query for "." (the root zone).
Simple Usage
~~~~~~~~~~~~
A typical invocation of ``delv`` looks like:
::
delv @server name type
where:
``server``
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 ``server`` argument is a
hostname, ``delv`` resolves that name before querying that name
server (note, however, that this initial lookup is *not* validated by
DNSSEC).
If no ``server`` argument is provided, ``delv`` consults
``/etc/resolv.conf``; if an address is found there, it queries the
name server at that address. If either of the ``-4`` or ``-6``
options is in use, then only addresses for the corresponding
transport are tried. If no usable addresses are found, ``delv``
sends queries to the localhost addresses (127.0.0.1 for IPv4, ::1
for IPv6).
``name``
is the domain name to be looked up.
``type``
indicates what type of query is required - ANY, A, MX, etc.
``type`` can be any valid query type. If no ``type`` argument is
supplied, ``delv`` performs a lookup for an A record.
Options
~~~~~~~
``-a anchor-file``
This option 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 (".").
Keys that do not match the root zone name are ignored. An alternate
key name can be specified using the ``+root=NAME`` options.
Note: When reading the trust anchor file, ``delv`` treats ``trust-anchors``,
``initial-key``, and ``static-key`` identically. That is, for a managed key,
it is the *initial* key that is trusted; :rfc:`5011` key management is not
supported. ``delv`` does not consult the managed-keys database maintained by
``named``, which means that if either of the keys in ``/etc/bind.keys`` is
revoked and rolled over, ``/etc/bind.keys`` must be updated to
use DNSSEC validation in ``delv``.
``-b address``
This option sets the source IP address of the query to ``address``. 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
``#<port>``
``-c class``
This option sets the query class for the requested data. Currently, only class
"IN" is supported in ``delv`` and any other value is ignored.
``-d level``
This option sets the systemwide debug level to ``level``. The allowed range is
from 0 to 99. The default is 0 (no debugging). Debugging traces from
``delv`` become more verbose as the debug level increases. See the
``+mtrace``, ``+rtrace``, and ``+vtrace`` options below for
additional debugging details.
``-h``
This option displays the ``delv`` help usage output and exits.
``-i``
This option sets insecure mode, which disables internal DNSSEC validation. (Note,
however, that this does not set the CD bit on upstream queries. If the
server being queried is performing DNSSEC validation, then it does
not return invalid data; this can cause ``delv`` to time out. When it
is necessary to examine invalid data to debug a DNSSEC problem, use
``dig +cd``.)
``-m``
This option enables memory usage debugging.
``-p port#``
This option specifies a destination port to use for queries, instead of the
standard DNS port number 53. This option is used with a name
server that has been configured to listen for queries on a
non-standard port number.
``-q name``
This option sets the query name to ``name``. While the query name can be
specified without using the ``-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).
``-t type``
This option sets the query type to ``type``, which can be any valid query type
supported in BIND 9 except for zone transfer types AXFR and IXFR. As
with ``-q``, this is useful to distinguish query-name types or classes
when they are ambiguous. It is sometimes necessary to disambiguate
names from types.
The default query type is "A", unless the ``-x`` option is supplied
to indicate a reverse lookup, in which case it is "PTR".
``-v``
This option prints the ``delv`` version and exits.
``-x addr``
This option performs a reverse lookup, mapping an address to a name. ``addr``
is an IPv4 address in dotted-decimal notation, or a colon-delimited
IPv6 address. When ``-x`` is used, there is no need to provide the
``name`` or ``type`` arguments; ``delv`` 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.
``-4``
This option forces ``delv`` to only use IPv4.
``-6``
This option forces ``delv`` to only use IPv6.
Query Options
~~~~~~~~~~~~~
``delv`` provides a number of query options which affect the way results
are displayed, and in some cases the way lookups are performed.
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
``+keyword=value``. The query options are:
``+[no]cdflag``
This option controls whether to set the CD (checking disabled) bit in queries
sent by ``delv``. This may be useful when troubleshooting DNSSEC
problems from behind a validating resolver. A validating resolver
blocks invalid responses, making it difficult to retrieve them
for analysis. Setting the CD flag on queries causes the resolver
to return invalid responses, which ``delv`` can then validate
internally and report the errors in detail.
``+[no]class``
This option controls whether to display the CLASS when printing a record. The
default is to display the CLASS.
``+[no]ttl``
This option controls whether to display the TTL when printing a record. The
default is to display the TTL.
``+[no]rtrace``
This option toggles resolver fetch logging. This reports the name and type of each
query sent by ``delv`` in the process of carrying out the resolution
and validation process, including the original query
and all subsequent queries to follow CNAMEs and to establish a chain
of trust for DNSSEC validation.
This is equivalent to setting the debug level to 1 in the "resolver"
logging category. Setting the systemwide debug level to 1 using the
``-d`` option produces the same output, but affects other
logging categories as well.
``+[no]mtrace``
This option toggles message logging. This produces a detailed dump of the
responses received by ``delv`` in the process of carrying out the
resolution and validation process.
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 ``-d`` option produces the same
output, but affects other logging categories as well.
``+[no]vtrace``
This option toggles validation logging. This shows the internal process of the
validator as it determines whether an answer is validly signed,
unsigned, or invalid.
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 ``-d`` option produces the
same output, but affects other logging categories as well.
``+[no]short``
This option toggles between verbose and terse answers. The default is to print the answer in a
verbose form.
``+[no]comments``
This option toggles the display of comment lines in the output. The default is to
print comments.
``+[no]rrcomments``
This option toggles 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.
``+[no]crypto``
This option toggles the display of cryptographic fields in DNSSEC records. The
contents of these fields 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 ]``.
``+[no]trust``
This option controls whether to display the trust level when printing a record.
The default is to display the trust level.
``+[no]split[=W]``
This option splits long hex- or base64-formatted fields in resource records into
chunks of ``W`` characters (where ``W`` is rounded up to the nearest
multiple of 4). ``+nosplit`` or ``+split=0`` causes fields not to be
split at all. The default is 56 characters, or 44 characters when
multiline mode is active.
``+[no]all``
This option sets or clears the display options ``+[no]comments``,
``+[no]rrcomments``, and ``+[no]trust`` as a group.
``+[no]multiline``
This option prints 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 ``delv`` output.
``+[no]dnssec``
This option indicates whether to display RRSIG records in the ``delv`` output.
The default is to do so. Note that (unlike in ``dig``) this does
*not* control whether to request DNSSEC records or to
validate them. DNSSEC records are always requested, and validation
always occurs unless suppressed by the use of ``-i`` or
``+noroot``.
``+[no]root[=ROOT]``
This option indicates whether to perform conventional 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 ``-a`` must be used to specify a
file containing the key.
``+[no]tcp``
This option controls whether to use TCP when sending queries. The default is to
use UDP unless a truncated response has been received.
``+[no]unknownformat``
This option prints 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.
``+[no]yaml``
This option prints response data in YAML format.
Files
~~~~~
``/etc/bind.keys``
``/etc/resolv.conf``
See Also
~~~~~~~~
:manpage:`dig(1)`, :manpage:`named(8)`, :rfc:`4034`, :rfc:`4035`, :rfc:`4431`, :rfc:`5074`, :rfc:`5155`.

View File

@@ -44,17 +44,20 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -63,7 +66,8 @@
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<AdditionalIncludeDirectories>..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@GEOIP_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\win32\include;..\..\..\lib\dns\include;..\..\..\lib\irs\win32\include;..\..\..\lib\irs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@GEOIP_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\win32\include;..\..\..\lib\dns\include;..\..\..\lib\irs\win32\include;..\..\..\lib\irs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
@@ -76,7 +80,8 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@@ -90,7 +95,8 @@
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@GEOIP_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\win32\include;..\..\..\lib\dns\include;..\..\..\lib\irs\win32\include;..\..\..\lib\irs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@GEOIP_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\win32\include;..\..\..\lib\dns\include;..\..\..\lib\irs\win32\include;..\..\..\lib\irs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
@@ -107,6 +113,20 @@
<ItemGroup>
<ClCompile Include="..\delv.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\irs\win32\libirs.vcxproj">
<Project>{A4F29CEB-7644-4A7F-BE9E-02B6A90E4919}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

30
bin/dig/Makefile.am Normal file
View File

@@ -0,0 +1,30 @@
include $(top_srcdir)/Makefile.top
AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBISCCFG_CFLAGS) \
$(LIBIRS_CFLAGS) \
$(LIBBIND9_CFLAGS) \
$(LIBIDN2_CFLAGS)
LDADD = \
libdighost.la \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS) \
$(LIBISCCFG_LIBS) \
$(LIBIRS_LIBS) \
$(LIBBIND9_LIBS) \
$(LIBIDN2_LIBS)
noinst_LTLIBRARIES = libdighost.la
libdighost_la_SOURCES = \
dighost.h \
dighost.c
bin_PROGRAMS = dig host nslookup
nslookup_LDADD = \
$(LDADD) \
$(READLINE_LIB)

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@
VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
READLINE_LIB = @READLINE_LIB@
CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} \
${BIND9_INCLUDES} ${ISC_INCLUDES} \
${IRS_INCLUDES} ${ISCCFG_INCLUDES} @LIBIDN2_CFLAGS@ @OPENSSL_INCLUDES@
CDEFINES = -DVERSION=\"${VERSION}\"
CWARNINGS =
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
IRSLIBS = ../../lib/irs/libirs.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
IRSDEPLIBS = ../../lib/irs/libirs.@A@
DEPLIBS = ${DNSDEPLIBS} ${IRSDEPLIBS} ${BIND9DEPLIBS} \
${ISCDEPLIBS} ${ISCCFGDEPLIBS}
LIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} \
${ISCLIBS} @LIBIDN2_LIBS@ @LIBS@
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} \
${ISCNOSYMLIBS} @LIBIDN2_LIBS@ @LIBS@
SUBDIRS =
TARGETS = dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@
OBJS = dig.@O@ dighost.@O@ host.@O@ nslookup.@O@
UOBJS =
SRCS = dig.c dighost.c host.c nslookup.c
MANPAGES = dig.1 host.1 nslookup.1
HTMLPAGES = dig.html host.html nslookup.html
MANOBJS = ${MANPAGES} ${HTMLPAGES}
@BIND9_MAKE_RULES@
LDFLAGS = @LDFLAGS@ @LIBIDN2_LDFLAGS@
dig@EXEEXT@: dig.@O@ dighost.@O@ ${UOBJS} ${DEPLIBS}
export BASEOBJS="dig.@O@ dighost.@O@ ${UOBJS}"; \
export LIBS0="${DNSLIBS} ${IRSLIBS}"; \
${FINALBUILDCMD}
host@EXEEXT@: host.@O@ dighost.@O@ ${UOBJS} ${DEPLIBS}
export BASEOBJS="host.@O@ dighost.@O@ ${UOBJS}"; \
export LIBS0="${DNSLIBS} ${IRSLIBS}"; \
${FINALBUILDCMD}
nslookup@EXEEXT@: nslookup.@O@ dighost.@O@ ${UOBJS} ${DEPLIBS}
export BASEOBJS="nslookup.@O@ dighost.@O@ ${READLINE_LIB} ${UOBJS}"; \
export LIBS0="${DNSLIBS} ${IRSLIBS}"; \
${FINALBUILDCMD}
doc man:: ${MANOBJS}
docclean manclean maintainer-clean::
rm -f ${MANOBJS}
clean distclean maintainer-clean::
rm -f ${TARGETS}
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir}
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
install:: dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
dig@EXEEXT@ ${DESTDIR}${bindir}
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
host@EXEEXT@ ${DESTDIR}${bindir}
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
nslookup@EXEEXT@ ${DESTDIR}${bindir}
for m in ${MANPAGES}; do \
${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man1 || exit 1; \
done
uninstall::
for m in ${MANPAGES}; do \
rm -f ${DESTDIR}${mandir}/man1/$$m || exit 1; \
done
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/nslookup@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/host@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/dig@EXEEXT@

View File

@@ -1,834 +0,0 @@
.\" Copyright (C) 2000-2011, 2013-2019 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: dig
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 2014-02-19
.\" Manual: BIND9
.\" Source: ISC
.\" Language: English
.\"
.TH "DIG" "1" "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"
dig \- DNS lookup utility
.SH "SYNOPSIS"
.HP \w'\fBdig\fR\ 'u
\fBdig\fR [@server] [\fB\-b\ \fR\fB\fIaddress\fR\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-f\ \fR\fB\fIfilename\fR\fR] [\fB\-k\ \fR\fB\fIfilename\fR\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\-v\fR] [\fB\-x\ \fR\fB\fIaddr\fR\fR] [\fB\-y\ \fR\fB\fI[hmac:]\fR\fIname:key\fR\fR] [[\fB\-4\fR] | [\fB\-6\fR]] [name] [type] [class] [queryopt...]
.HP \w'\fBdig\fR\ 'u
\fBdig\fR [\fB\-h\fR]
.HP \w'\fBdig\fR\ 'u
\fBdig\fR [global\-queryopt...] [query...]
.SH "DESCRIPTION"
.PP
\fBdig\fR
is a flexible tool for interrogating DNS name servers\&. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried\&. Most DNS administrators use
\fBdig\fR
to troubleshoot DNS problems because of its flexibility, ease of use and clarity of output\&. Other lookup tools tend to have less functionality than
\fBdig\fR\&.
.PP
Although
\fBdig\fR
is normally used with command\-line arguments, it also has a batch mode of operation for reading lookup requests from a file\&. A brief summary of its command\-line arguments and options is printed when the
\fB\-h\fR
option is given\&. Unlike earlier versions, the BIND 9 implementation of
\fBdig\fR
allows multiple lookups to be issued from the command line\&.
.PP
Unless it is told to query a specific name server,
\fBdig\fR
will try each of the servers listed in
/etc/resolv\&.conf\&. If no usable server addresses are found,
\fBdig\fR
will send the query to the local host\&.
.PP
When no command line arguments or options are given,
\fBdig\fR
will perform an NS query for "\&." (the root)\&.
.PP
It is possible to set per\-user defaults for
\fBdig\fR
via
${HOME}/\&.digrc\&. This file is read and any options in it are applied before the command line arguments\&. The
\fB\-r\fR
option disables this feature, for scripts that need predictable behaviour\&.
.PP
The IN and CH class names overlap with the IN and CH top level domain names\&. Either use the
\fB\-t\fR
and
\fB\-c\fR
options to specify the type and class, use the
\fB\-q\fR
the specify the domain name, or use "IN\&." and "CH\&." when looking up these top level domains\&.
.SH "SIMPLE USAGE"
.PP
A typical invocation of
\fBdig\fR
looks like:
.sp
.if n \{\
.RS 4
.\}
.nf
dig @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,
\fBdig\fR
resolves that name before querying that name server\&.
.sp
If no
\fIserver\fR
argument is provided,
\fBdig\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,
\fBdig\fR
will send the query to the local host\&. The reply from the name server that responds is displayed\&.
.RE
.PP
\fBname\fR
.RS 4
is the name of the resource record that is to be looked up\&.
.RE
.PP
\fBtype\fR
.RS 4
indicates what type of query is required \(em ANY, A, MX, SIG, etc\&.
\fItype\fR
can be any valid query type\&. If no
\fItype\fR
argument is supplied,
\fBdig\fR
will perform a lookup for an A record\&.
.RE
.SH "OPTIONS"
.PP
\-4
.RS 4
Use IPv4 only\&.
.RE
.PP
\-6
.RS 4
Use IPv6 only\&.
.RE
.PP
\-b \fIaddress\fR\fI[#port]\fR
.RS 4
Set the source IP address of the query\&. The
\fIaddress\fR
must be a valid address on one of the host\*(Aqs network interfaces, or "0\&.0\&.0\&.0" or "::"\&. An optional port may be specified by appending "#<port>"
.RE
.PP
\-c \fIclass\fR
.RS 4
Set the query class\&. The default
\fIclass\fR
is IN; other classes are HS for Hesiod records or CH for Chaosnet records\&.
.RE
.PP
\-f \fIfile\fR
.RS 4
Batch mode:
\fBdig\fR
reads a list of lookup requests to process from the given
\fIfile\fR\&. Each line in the file should be organized in the same way they would be presented as queries to
\fBdig\fR
using the command\-line interface\&.
.RE
.PP
\-k \fIkeyfile\fR
.RS 4
Sign queries using TSIG using a key read from the given file\&. Key files can be generated using
\fBtsig-keygen\fR(8)\&. When using TSIG authentication with
\fBdig\fR, the name server that is queried needs to know the key and algorithm that is being used\&. In BIND, this is done by providing appropriate
\fBkey\fR
and
\fBserver\fR
statements in
named\&.conf\&.
.RE
.PP
\-m
.RS 4
Enable memory usage debugging\&.
.RE
.PP
\-p \fIport\fR
.RS 4
Send the query to a non\-standard port on the server, instead of the default port 53\&. This option would be used to test a name server that has been configured to listen for queries on a non\-standard port number\&.
.RE
.PP
\-q \fIname\fR
.RS 4
The domain name to query\&. This is useful to distinguish the
\fIname\fR
from other arguments\&.
.RE
.PP
\-r
.RS 4
Do not read options from
${HOME}/\&.digrc\&. This is useful for scripts that need predictable behaviour\&.
.RE
.PP
\-t \fItype\fR
.RS 4
The resource record type to query\&. It can be any valid query type\&. If it is a resource record type supported in BIND 9, it can be given by the type mnemonic (such as "NS" or "AAAA")\&. The default query type is "A", unless the
\fB\-x\fR
option is supplied to indicate a reverse lookup\&. A zone transfer can be requested by specifying a type of AXFR\&. When an incremental zone transfer (IXFR) is required, set the
\fItype\fR
to
ixfr=N\&. The incremental zone transfer will contain the changes made to the zone since the serial number in the zone\*(Aqs SOA record was
\fIN\fR\&.
.sp
All resource record types can be expressed as "TYPEnn", where "nn" is the number of the type\&. If the resource record type is not supported in BIND 9, the result will be displayed as described in RFC 3597\&.
.RE
.PP
\-u
.RS 4
Print query times in microseconds instead of milliseconds\&.
.RE
.PP
\-v
.RS 4
Print the version number and exit\&.
.RE
.PP
\-x \fIaddr\fR
.RS 4
Simplified reverse lookups, for mapping addresses to names\&. The
\fIaddr\fR
is an IPv4 address in dotted\-decimal notation, or a colon\-delimited IPv6 address\&. When the
\fB\-x\fR
is used, there is no need to provide the
\fIname\fR,
\fIclass\fR
and
\fItype\fR
arguments\&.
\fBdig\fR
automatically performs a lookup for a name like
94\&.2\&.0\&.192\&.in\-addr\&.arpa
and sets the query type and class to PTR and IN respectively\&. IPv6 addresses are looked up using nibble format under the IP6\&.ARPA domain\&.
.RE
.PP
\-y \fI[hmac:]\fR\fIkeyname:secret\fR
.RS 4
Sign queries using TSIG with the given authentication key\&.
\fIkeyname\fR
is the name of the key, and
\fIsecret\fR
is the base64 encoded shared secret\&.
\fIhmac\fR
is the name of the key algorithm; valid choices are
hmac\-md5,
hmac\-sha1,
hmac\-sha224,
hmac\-sha256,
hmac\-sha384, or
hmac\-sha512\&. If
\fIhmac\fR
is not specified, the default is
hmac\-md5
or if MD5 was disabled
hmac\-sha256\&.
.sp
NOTE: You should use the
\fB\-k\fR
option and avoid the
\fB\-y\fR
option, because with
\fB\-y\fR
the shared secret is supplied as a command line argument in clear text\&. This may be visible in the output from
\fBps\fR(1)
or in a history file maintained by the user\*(Aqs shell\&.
.RE
.SH "QUERY OPTIONS"
.PP
\fBdig\fR
provides a number of query options which affect the way in which lookups are made and the results displayed\&. Some of these set or reset flag bits in the query header, some determine which sections of the answer get printed, and others determine the timeout and retry strategies\&.
.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\&. Keywords may be abbreviated, provided the abbreviation is unambiguous; for example,
+cd
is equivalent to
+cdflag\&. The query options are:
.PP
\fB+[no]aaflag\fR
.RS 4
A synonym for
\fI+[no]aaonly\fR\&.
.RE
.PP
\fB+[no]aaonly\fR
.RS 4
Sets the "aa" flag in the query\&.
.RE
.PP
\fB+[no]additional\fR
.RS 4
Display [do not display] the additional section of a reply\&. The default is to display it\&.
.RE
.PP
\fB+[no]adflag\fR
.RS 4
Set [do not set] the AD (authentic data) bit in the query\&. This requests the server to return whether all of the answer and authority sections have all been validated as secure according to the security policy of the server\&. AD=1 indicates that all records have been validated as secure and the answer is not from a OPT\-OUT range\&. AD=0 indicate that some part of the answer was insecure or not validated\&. This bit is set by default\&.
.RE
.PP
\fB+[no]all\fR
.RS 4
Set or clear all display flags\&.
.RE
.PP
\fB+[no]answer\fR
.RS 4
Display [do not display] the answer section of a reply\&. The default is to display it\&.
.RE
.PP
\fB+[no]authority\fR
.RS 4
Display [do not display] the authority section of a reply\&. The default is to display it\&.
.RE
.PP
\fB+[no]badcookie\fR
.RS 4
Retry lookup with the new server cookie if a BADCOOKIE response is received\&.
.RE
.PP
\fB+[no]besteffort\fR
.RS 4
Attempt to display the contents of messages which are malformed\&. The default is to not display malformed answers\&.
.RE
.PP
\fB+bufsize=B\fR
.RS 4
Set the UDP message buffer size advertised using EDNS0 to
\fIB\fR
bytes\&. The maximum and minimum sizes of this buffer are 65535 and 0 respectively\&. Values outside this range are rounded up or down appropriately\&. Values other than zero will cause a EDNS query to be sent\&.
.RE
.PP
\fB+[no]cdflag\fR
.RS 4
Set [do not set] the CD (checking disabled) bit in the query\&. This requests the server to not perform DNSSEC validation of responses\&.
.RE
.PP
\fB+[no]class\fR
.RS 4
Display [do not display] the CLASS when printing the record\&.
.RE
.PP
\fB+[no]cmd\fR
.RS 4
Toggles the printing of the initial comment in the output, identifying the version of
\fBdig\fR
and the query options that have been applied\&. This option always has global effect; it cannot be set globally and then overridden on a per\-lookup basis\&. The default is to print this comment\&.
.RE
.PP
\fB+[no]comments\fR
.RS 4
Toggles the display of some comment lines in the output, containing information about the packet header and OPT pseudosection, and the names of the response section\&. The default is to print these comments\&.
.sp
Other types of comments in the output are not affected by this option, but can be controlled using other command line switches\&. These include
\fB+[no]cmd\fR,
\fB+[no]question\fR,
\fB+[no]stats\fR, and
\fB+[no]rrcomments\fR\&.
.RE
.PP
\fB+[no]cookie\fR\fB[=####]\fR
.RS 4
Send a COOKIE EDNS option, with optional value\&. Replaying a COOKIE from a previous response will allow the server to identify a previous client\&. The default is
\fB+cookie\fR\&.
.sp
\fB+cookie\fR
is also set when +trace is set to better emulate the default queries from a nameserver\&.
.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]defname\fR
.RS 4
Deprecated, treated as a synonym for
\fI+[no]search\fR
.RE
.PP
\fB+[no]dnssec\fR
.RS 4
Requests DNSSEC records be sent by setting the DNSSEC OK bit (DO) in the OPT record in the additional section of the query\&.
.RE
.PP
\fB+domain=somename\fR
.RS 4
Set the search list to contain the single domain
\fIsomename\fR, as if specified in a
\fBdomain\fR
directive in
/etc/resolv\&.conf, and enable search list processing as if the
\fI+search\fR
option were given\&.
.RE
.PP
\fB+dscp=value\fR
.RS 4
Set the DSCP code point to be used when sending the query\&. Valid DSCP code points are in the range [0\&.\&.63]\&. By default no code point is explicitly set\&.
.RE
.PP
\fB+[no]edns[=#]\fR
.RS 4
Specify the EDNS version to query with\&. Valid values are 0 to 255\&. Setting the EDNS version will cause a EDNS query to be sent\&.
\fB+noedns\fR
clears the remembered EDNS version\&. EDNS is set to 0 by default\&.
.RE
.PP
\fB+[no]ednsflags[=#]\fR
.RS 4
Set the must\-be\-zero EDNS flags bits (Z bits) to the specified value\&. Decimal, hex and octal encodings are accepted\&. Setting a named flag (e\&.g\&. DO) will silently be ignored\&. By default, no Z bits are set\&.
.RE
.PP
\fB+[no]ednsnegotiation\fR
.RS 4
Enable / disable EDNS version negotiation\&. By default EDNS version negotiation is enabled\&.
.RE
.PP
\fB+[no]ednsopt[=code[:value]]\fR
.RS 4
Specify EDNS option with code point
\fBcode\fR
and optionally payload of
\fBvalue\fR
as a hexadecimal string\&.
\fBcode\fR
can be either an EDNS option name (for example,
NSID
or
ECS), or an arbitrary numeric value\&.
\fB+noednsopt\fR
clears the EDNS options to be sent\&.
.RE
.PP
\fB+[no]expire\fR
.RS 4
Send an EDNS Expire option\&.
.RE
.PP
\fB+[no]fail\fR
.RS 4
Do not try the next server if you receive a SERVFAIL\&. The default is to not try the next server which is the reverse of normal stub resolver behavior\&.
.RE
.PP
\fB+[no]header\-only\fR
.RS 4
Send a query with a DNS header without a question section\&. The default is to add a question section\&. The query type and query name are ignored when this is set\&.
.RE
.PP
\fB+[no]identify\fR
.RS 4
Show [or do not show] the IP address and port number that supplied the answer when the
\fI+short\fR
option is enabled\&. If short form answers are requested, the default is not to show the source address and port number of the server that provided the answer\&.
.RE
.PP
\fB+[no]idnin\fR
.RS 4
Process [do not process] IDN domain names on input\&. This requires IDN SUPPORT to have been enabled at compile time\&.
.sp
The default is to process IDN input when standard output is a tty\&. The IDN processing on input is disabled when dig output is redirected to files, pipes, and other non\-tty file descriptors\&.
.RE
.PP
\fB+[no]idnout\fR
.RS 4
Convert [do not convert] puny code on output\&. This requires IDN SUPPORT to have been enabled at compile time\&.
.sp
The default is to process puny code on output when standard output is a tty\&. The puny code processing on output is disabled when dig output is redirected to files, pipes, and other non\-tty file descriptors\&.
.RE
.PP
\fB+[no]ignore\fR
.RS 4
Ignore truncation in UDP responses instead of retrying with TCP\&. By default, TCP retries are performed\&.
.RE
.PP
\fB+[no]keepalive\fR
.RS 4
Send [or do not send] an EDNS Keepalive option\&.
.RE
.PP
\fB+[no]keepopen\fR
.RS 4
Keep the TCP socket open between queries and reuse it rather than creating a new TCP socket for each lookup\&. The default is
\fB+nokeepopen\fR\&.
.RE
.PP
\fB+[no]mapped\fR
.RS 4
Allow mapped IPv4 over IPv6 addresses to be used\&. The default is
\fB+mapped\fR\&.
.RE
.PP
\fB+[no]multiline\fR
.RS 4
Print records like the 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
\fBdig\fR
output\&.
.RE
.PP
\fB+ndots=D\fR
.RS 4
Set the number of dots that have to appear in
\fIname\fR
to
\fID\fR
for it to be considered absolute\&. The default value is that defined using the ndots statement in
/etc/resolv\&.conf, or 1 if no ndots statement is present\&. Names with fewer dots are interpreted as relative names and will be searched for in the domains listed in the
\fBsearch\fR
or
\fBdomain\fR
directive in
/etc/resolv\&.conf
if
\fB+search\fR
is set\&.
.RE
.PP
\fB+[no]nsid\fR
.RS 4
Include an EDNS name server ID request when sending a query\&.
.RE
.PP
\fB+[no]nssearch\fR
.RS 4
When this option is set,
\fBdig\fR
attempts to find the authoritative name servers for the zone containing the name being looked up and display the SOA record that each name server has for the zone\&. Addresses of servers that that did not respond are also printed\&.
.RE
.PP
\fB+[no]onesoa\fR
.RS 4
Print only one (starting) SOA record when performing an AXFR\&. The default is to print both the starting and ending SOA records\&.
.RE
.PP
\fB+[no]opcode=value\fR
.RS 4
Set [restore] the DNS message opcode to the specified value\&. The default value is QUERY (0)\&.
.RE
.PP
\fB+padding=value\fR
.RS 4
Pad the size of the query packet using the EDNS Padding option to blocks of
\fIvalue\fR
bytes\&. For example,
\fB+padding=32\fR
would cause a 48\-byte query to be padded to 64 bytes\&. The default block size is 0, which disables padding\&. The maximum is 512\&. Values are ordinarily expected to be powers of two, such as 128; however, this is not mandatory\&. Responses to padded queries may also be padded, but only if the query uses TCP or DNS COOKIE\&.
.RE
.PP
\fB+[no]qr\fR
.RS 4
Toggles the display of the query message as it is sent\&. By default, the query is not printed\&.
.RE
.PP
\fB+[no]question\fR
.RS 4
Toggles the display of the question section of a query when an answer is returned\&. The default is to print the question section as a comment\&.
.RE
.PP
\fB+[no]raflag\fR
.RS 4
Set [do not set] the RA (Recursion Available) bit in the query\&. The default is +noraflag\&. This bit should be ignored by the server for QUERY\&.
.RE
.PP
\fB+[no]rdflag\fR
.RS 4
A synonym for
\fI+[no]recurse\fR\&.
.RE
.PP
\fB+[no]recurse\fR
.RS 4
Toggle the setting of the RD (recursion desired) bit in the query\&. This bit is set by default, which means
\fBdig\fR
normally sends recursive queries\&. Recursion is automatically disabled when using the
\fI+nssearch\fR
option, and when using
\fI+trace\fR
except for an initial recursive query to get the list of root servers\&.
.RE
.PP
\fB+retry=T\fR
.RS 4
Sets the number of times to retry UDP queries to server to
\fIT\fR
instead of the default, 2\&. Unlike
\fI+tries\fR, this does not include the initial query\&.
.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 not to print record comments unless multiline mode is active\&.
.RE
.PP
\fB+[no]search\fR
.RS 4
Use [do not use] the search list defined by the searchlist or domain directive in
resolv\&.conf
(if any)\&. The search list is not used by default\&.
.sp
\*(Aqndots\*(Aq from
resolv\&.conf
(default 1) which may be overridden by
\fI+ndots\fR
determines if the name will be treated as relative or not and hence whether a search is eventually performed or not\&.
.RE
.PP
\fB+[no]short\fR
.RS 4
Provide a terse answer\&. The default is to print the answer in a verbose form\&. This option always has global effect; it cannot be set globally and then overridden on a per\-lookup basis\&.
.RE
.PP
\fB+[no]showsearch\fR
.RS 4
Perform [do not perform] a search showing intermediate results\&.
.RE
.PP
\fB+[no]sigchase\fR
.RS 4
This feature is now obsolete and has been removed; use
\fBdelv\fR
instead\&.
.RE
.PP
\fB+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]stats\fR
.RS 4
Toggles the printing of statistics: when the query was made, the size of the reply and so on\&. The default behavior is to print the query statistics as a comment after each lookup\&.
.RE
.PP
\fB+[no]subnet=addr[/prefix\-length]\fR
.RS 4
Send (don\*(Aqt send) an EDNS Client Subnet option with the specified IP address or network prefix\&.
.sp
\fBdig +subnet=0\&.0\&.0\&.0/0\fR, or simply
\fBdig +subnet=0\fR
for short, sends an EDNS CLIENT\-SUBNET option with an empty address and a source prefix\-length of zero, which signals a resolver that the client\*(Aqs address information must
\fInot\fR
be used when resolving this query\&.
.RE
.PP
\fB+[no]tcflag\fR
.RS 4
Set [do not set] the TC (TrunCation) bit in the query\&. The default is +notcflag\&. This bit should be ignored by the server for QUERY\&.
.RE
.PP
\fB+[no]tcp\fR
.RS 4
Use [do not use] TCP when querying name servers\&. The default behavior is to use UDP unless a type
any
or
ixfr=N
query is requested, in which case the default is TCP\&. AXFR queries always use TCP\&.
.RE
.PP
\fB+timeout=T\fR
.RS 4
Sets the timeout for a query to
\fIT\fR
seconds\&. The default timeout is 5 seconds\&. An attempt to set
\fIT\fR
to less than 1 will result in a query timeout of 1 second being applied\&.
.RE
.PP
\fB+[no]topdown\fR
.RS 4
This feature is related to
\fBdig +sigchase\fR, which is obsolete and has been removed\&. Use
\fBdelv\fR
instead\&.
.RE
.PP
\fB+[no]trace\fR
.RS 4
Toggle tracing of the delegation path from the root name servers for the name being looked up\&. Tracing is disabled by default\&. When tracing is enabled,
\fBdig\fR
makes iterative queries to resolve the name being looked up\&. It will follow referrals from the root servers, showing the answer from each server that was used to resolve the lookup\&.
.sp
If @server is also specified, it affects only the initial query for the root zone name servers\&.
.sp
\fB+dnssec\fR
is also set when +trace is set to better emulate the default queries from a nameserver\&.
.RE
.PP
\fB+tries=T\fR
.RS 4
Sets the number of times to try UDP queries to server to
\fIT\fR
instead of the default, 3\&. If
\fIT\fR
is less than or equal to zero, the number of tries is silently rounded up to 1\&.
.RE
.PP
\fB+trusted\-key=####\fR
.RS 4
Formerly specified trusted keys for use with
\fBdig +sigchase\fR\&. This feature is now obsolete and has been removed; use
\fBdelv\fR
instead\&.
.RE
.PP
\fB+[no]ttlid\fR
.RS 4
Display [do not display] the TTL when printing the record\&.
.RE
.PP
\fB+[no]ttlunits\fR
.RS 4
Display [do not display] the TTL in friendly human\-readable time units of "s", "m", "h", "d", and "w", representing seconds, minutes, hours, days and weeks\&. Implies +ttlid\&.
.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
.PP
\fB+[no]vc\fR
.RS 4
Use [do not use] TCP when querying name servers\&. This alternate syntax to
\fI+[no]tcp\fR
is provided for backwards compatibility\&. The "vc" stands for "virtual circuit"\&.
.RE
.PP
\fB+[no]zflag\fR
.RS 4
Set [do not set] the last unassigned DNS header flag in a DNS query\&. This flag is off by default\&.
.RE
.SH "MULTIPLE QUERIES"
.PP
The BIND 9 implementation of
\fBdig \fR
supports specifying multiple queries on the command line (in addition to supporting the
\fB\-f\fR
batch file option)\&. Each of those queries can be supplied with its own set of flags, options and query options\&.
.PP
In this case, each
\fIquery\fR
argument represent an individual query in the command\-line syntax described above\&. Each consists of any of the standard options and flags, the name to be looked up, an optional query type and class and any query options that should be applied to that query\&.
.PP
A global set of query options, which should be applied to all queries, can also be supplied\&. These global query options must precede the first tuple of name, class, type, options, flags, and query options supplied on the command line\&. Any global query options (except
\fB+[no]cmd\fR
and
\fB+[no]short\fR
options) can be overridden by a query\-specific set of query options\&. For example:
.sp
.if n \{\
.RS 4
.\}
.nf
dig +qr www\&.isc\&.org any \-x 127\&.0\&.0\&.1 isc\&.org ns +noqr
.fi
.if n \{\
.RE
.\}
.sp
shows how
\fBdig\fR
could be used from the command line to make three lookups: an ANY query for
www\&.isc\&.org, a reverse lookup of 127\&.0\&.0\&.1 and a query for the NS records of
isc\&.org\&. A global query option of
\fI+qr\fR
is applied, so that
\fBdig\fR
shows the initial query it made for each lookup\&. The final query has a local query option of
\fI+noqr\fR
which means that
\fBdig\fR
will not print the initial query when it looks up the NS records for
isc\&.org\&.
.SH "IDN SUPPORT"
.PP
If
\fBdig\fR
has been built with IDN (internationalized domain name) support, it can accept and display non\-ASCII domain names\&.
\fBdig\fR
appropriately converts character encoding of domain name before sending a request to DNS server or displaying a reply from the server\&. If you\*(Aqd like to turn off the IDN support for some reason, use parameters
\fI+noidnin\fR
and
\fI+noidnout\fR
or define the
\fBIDN_DISABLE\fR
environment variable\&.
.SH "FILES"
.PP
/etc/resolv\&.conf
.PP
${HOME}/\&.digrc
.SH "SEE ALSO"
.PP
\fBdelv\fR(1),
\fBhost\fR(1),
\fBnamed\fR(8),
\fBdnssec-keygen\fR(8),
RFC 1035\&.
.SH "BUGS"
.PP
There are probably too many query options\&.
.SH "AUTHOR"
.PP
\fBInternet Systems Consortium, Inc\&.\fR
.SH "COPYRIGHT"
.br
Copyright \(co 2000-2011, 2013-2019 Internet Systems Consortium, Inc. ("ISC")
.br

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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