Commit graph

26990 commits

Author SHA1 Message Date
Michał Kępień
5cc841fa53 Reset dig exit code after a TCP connection is established
The "exitcode" variable is set to 9 if a TCP connection fails, but is
not reset to 0 if a subsequent TCP connection succeeds.  This causes dig
to return a non-zero exit code if it succeeds in getting a TCP response
after a retry.  Fix by resetting "exitcode" to 0 if connect_done()
receives an event with the "result" field set to ISC_R_SUCCESS.

(cherry picked from commit deb3b85cb2)
2018-08-27 14:30:06 +10:00
Ondřej Surý
6021b95451 Merge branch 'run-update_copyrights-v9_12' into 'v9_12'
Run update copyrights in precheck stage

See merge request isc-projects/bind9!701
2018-08-24 08:42:59 -04:00
Ondřej Surý
a8d5dd1878 Check update_copyright results in precheck stage
(cherry picked from commit 4016369212)
2018-08-24 08:34:44 -04:00
Ondřej Surý
791663dd60 Whitespace fixes
(cherry picked from commit 31b5360943)
2018-08-24 08:34:44 -04:00
Ondřej Surý
bb10ea3f7a Cleanup cruft in util/copyrights
(cherry picked from commit 65de91f512)
2018-08-24 08:34:44 -04:00
Ondřej Surý
017968d90b Make update_copyrights return error code when error is encountered during processing the files
(cherry picked from commit db3d69263d)
2018-08-24 08:34:44 -04:00
Michał Kępień
6ef408d28f Merge branch '470-log-a-message-when-ixfr-from-differences-is-set-for-an-inline-signed-zone-v9_12' into 'v9_12'
[v9_12] Log a message when "ixfr-from-differences" is set for an inline-signed zone

See merge request isc-projects/bind9!695
2018-08-24 04:35:32 -04:00
Michał Kępień
5ea91c5a43 Add CHANGES entry
5019.	[cleanup]	A message is now logged when ixfr-from-differences is
			set at zone level for an inline-signed zone. [GL #470]

(cherry picked from commit 4fb5d072c2)
2018-08-24 10:21:28 +02:00
Michał Kępień
e0b9bb1d2c Log a message when "ixfr-from-differences" is set for an inline-signed zone
For inline-signed zones, the value of "ixfr-from-differences" is
hardcoded to:

  - "yes" for the raw version of the zone,
  - "no" for the signed version of the zone.

In other words, any user-provided "ixfr-from-differences" setting is
effectively ignored for an inline-signed zone.  Ensure the user is aware
of that by adding a note to the ARM and logging a message when an
"ixfr-from-differences" option is found at the zone level.

(cherry picked from commit 087157d14f)
2018-08-24 10:21:27 +02:00
Michał Kępień
a6e79d7ce4 Merge branch '477-fix-intermittent-mkeys-system-test-failures' into 'v9_12'
Fix intermittent "mkeys" system test failures

See merge request isc-projects/bind9!684
2018-08-24 04:10:42 -04:00
Michał Kępień
c12388f5e8 Do not call bin/tools/genrandom unconditionally in system tests
$RANDFILE, i.e. bin/tests/system/random.data, should only be written to
if a system test requires support for cryptography and that file does
not already exist.  Otherwise, when multiple system tests are run in
parallel, that file might get truncated due to bin/tools/genrandom.c
using fopen() with mode "w" when writing the destination file.  With
unfortunate timing, this may cause system tests employing BIND tools
which need entropy (e.g. dnssec-keygen) to fail.

Make sure bin/tests/system/metadata/tests.sh no longer calls
bin/tools/genrandom since $RANDFILE is guaranteed to already be created
by the time bin/tools/genrandom is currently called because
bin/tests/system/metadata/prereq.sh uses bin/tests/system/testcrypto.sh.

Make sure bin/tests/system/sfcache/prereq.sh only writes to $RANDFILE if
it does not already exist.
2018-08-24 09:57:15 +02:00
Michał Kępień
262c9e8aab Merge branch '491-prevent-a-race-in-the-inline-system-test-v9_12' into 'v9_12'
[v9_12] Prevent a race in the "inline" system test

See merge request isc-projects/bind9!692
2018-08-24 03:55:14 -04:00
Michał Kępień
56da51da7b Prevent a race in the "inline" system test
A short time window exists between logging the addition of an NSEC3PARAM
record to a zone and committing it to the current version of the zone
database.  If a query arrives during such a time window, an unsigned
response will be returned.  One of the checks in the "inline" system
test requires NSEC3 records to be present in an answer - that check
would fail in the case described above.  Use rndc instead of log
watching for checking whether zone signing and NSEC3 chain modifications
are complete in order to prevent intermittent "inline" system test
failures.

(cherry picked from commit e36c869e85)
2018-08-24 09:38:22 +02:00
Mark Andrews
d347b4227a Merge branch 'fix-non-portable-v9_12' into 'v9_12'
use sizeof(CK_SLOT_ID)

See merge request isc-projects/bind9!689
2018-08-23 21:44:28 -04:00
Mark Andrews
fef6fc20e1 add CHANGES note
(cherry picked from commit 42b16771db)
2018-08-24 11:32:18 +10:00
Mark Andrews
072069f1d5 use sizeof(CK_SLOT_ID)
(cherry picked from commit 2c1d8b2e99)
2018-08-24 11:32:11 +10:00
Mark Andrews
661d2628c5 Merge branch 'value-not-updated-atomically-v9_12' into 'v9_12'
unlink before unlock

See merge request isc-projects/bind9!687
2018-08-23 21:12:53 -04:00
Mark Andrews
7a0bd7f04c add CHANGES note
(cherry picked from commit 05531d3a86)
2018-08-24 10:58:20 +10:00
Mark Andrews
59ce0f2620 unlink before unlock
(cherry picked from commit 4742f4ecba)
2018-08-24 10:58:20 +10:00
Mark Andrews
08efcd0662 Merge branch '445-filter-aaaa-and-dns64-can-both-attempt-to-recurse-for-a-records-at-the-same-time-v9_12' into 'v9_12'
Resolve "filter-aaaa and dns64 can both attempt to recurse for A records at the same time"

See merge request isc-projects/bind9!685
2018-08-23 19:55:12 -04:00
Mark Andrews
69f7460395 add CHANGES note
(cherry picked from commit c1bc3baf7f)
2018-08-24 09:47:17 +10:00
Mark Andrews
68138381b4 when filter-aaaa and dns64 are both configured a assertion failure could occur
(cherry picked from commit 1056376d10)
2018-08-24 09:47:17 +10:00
Michał Kępień
070b679104 Merge branch '435-fix-reloading-inline-signed-zones-v9_12' into 'v9_12'
[v9_12] Fix reloading inline-signed zones

See merge request isc-projects/bind9!674
2018-08-22 06:00:58 -04:00
Michał Kępień
61a71f82c5 Add CHANGES entry
5015.	[bug]		Reloading all zones caused zone maintenance to cease
			for inline-signed zones. [GL #435]

(cherry picked from commit f9931f1d22)
2018-08-22 11:45:30 +02:00
Michał Kępień
7680c7d1cf Fix reloading inline-signed zones
While "rndc reload" causes dns_zone_asyncload() to be called for the
signed version of an inline-signed zone, the subsequent zone_load() call
causes the raw version to be reloaded from storage.  This means that
DNS_ZONEFLG_LOADPENDING gets set for the signed version of the zone by
dns_zone_asyncload() before the reload is attempted, but zone_postload()
is only called for the raw version and thus DNS_ZONEFLG_LOADPENDING is
cleared for the raw version, but not for the signed version.  This in
turn prevents zone maintenance from happening for the signed version of
the zone.

Until commit 7c64547d95, this problem
remained dormant because DNS_ZONEFLG_LOADPENDING was previously
immediately, unconditionally cleared after zone loading was started
(whereas it should only be cleared when zone loading is finished or an
error occurs).  This behavior caused other issues [1] and thus had to be
changed.

Fix reloading inline-signed zones by clearing DNS_ZONEFLG_LOADPENDING
for the signed version of the zone once the raw version reload
completes.  Take care not to clear it prematurely during initial zone
load.  Also make sure that DNS_ZONEFLG_LOADPENDING gets cleared when
zone_postload() encounters an error or returns early, to prevent other
scenarios from resulting in the same problem.  Add comments aiming to
help explain code flow.

[1] see RT #47076

(cherry picked from commit 5431583971)
2018-08-22 11:45:24 +02:00
Michał Kępień
057cedc818 Merge branch '482-fix-secure-journal-loading-for-inline-signed-zones-v9_12' into 'v9_12'
[v9_12] Set DNS_JOURNALOPT_RESIGN when loading the secure journal for an inline-signed zone

See merge request isc-projects/bind9!672
2018-08-22 05:21:23 -04:00
Michał Kępień
3a269081df Add CHANGES entry
5014.	[bug]		Signatures loaded from the journal for the signed
			version of an inline-signed zone were not scheduled for
			refresh. [GL #482]

(cherry picked from commit b3b1a9081b)
2018-08-22 10:51:48 +02:00
Michał Kępień
8d468a4f60 Set DNS_JOURNALOPT_RESIGN when loading the secure journal for an inline-signed zone
When an inline-signed zone is loaded, the master file for its signed
version is loaded and then a rollforward of the journal for the signed
version of the zone is performed.  If DNS_JOURNALOPT_RESIGN is not set
during the latter phase, signatures loaded from the journal for the
signed version of the zone will not be scheduled for refresh.  Fix the
conditional expression determining which flags should be used for the
dns_journal_rollforward() call so that DNS_JOURNALOPT_RESIGN is set when
zone_postload() is called for the signed version of an inline-signed
zone.

Extend bin/tests/system/stop.pl so that it can use "rndc halt" instead
of "rndc stop" as the former allows master file flushing upon shutdown
to be suppressed.

(cherry picked from commit 8db550c42f)
2018-08-22 10:51:42 +02:00
Michał Kępień
ab084b866e Merge branch '390-do-not-treat-a-referral-with-a-non-empty-answer-section-as-an-error-v9_12' into 'v9_12'
[v9_12] Do not treat a referral with a non-empty ANSWER section as an error

See merge request isc-projects/bind9!671
2018-08-22 04:43:56 -04:00
Michał Kępień
899ea537b5 Add CHANGES entry
5013.	[bug]		A referral response with a non-empty ANSWER section was
			inadvertently being treated as an error. [GL #390]

(cherry picked from commit 2923ab4945)
2018-08-22 10:16:11 +02:00
Michał Kępień
367b973835 Do not treat a referral with a non-empty ANSWER section as an error
As part of resquery_response() refactoring [1], a goto statement was
replaced [2] with a call to a new function - originally called
rctx_delegation(), now folded into rctx_answer_none() - extracted from
existing code.  However, one call site of that refactored function does
not reset the "result" variable, causing a referral with a non-empty
ANSWER section to be inadvertently treated as an error, which prevents
resolution of names reliant on servers sending such responses.  Fix by
resetting the "result" variable to ISC_R_SUCCESS when a response
containing a non-empty ANSWER section can be treated as a delegation.

[1] see RT #45362

[2] see commit e1380a16741a3b4a57e54d7a9ce09dd12691522f

(cherry picked from commit 24b9ec555a)
2018-08-22 10:16:08 +02:00
Ondřej Surý
50b838b405 Merge branch '488-install-compatibility-int-and-boolean-shim-headers' into 'v9_12'
Install isc/boolean.h and isc/int.h shim headers

See merge request isc-projects/bind9!670
2018-08-22 03:30:31 -04:00
Ondřej Surý
9257d3542e Add install test job 2018-08-22 09:22:45 +02:00
Ondřej Surý
e66fdc5738 We want to install compatibility shim isc/int.h and isc/boolean.h headers 2018-08-22 09:22:35 +02:00
Mark Andrews
a544caec90 Merge branch 'fix-lock-order-reversal-v9_12' into 'v9_12'
fix lock order reversal

See merge request isc-projects/bind9!666
2018-08-20 23:40:28 -04:00
Mark Andrews
f00e73874d add CHANGES note
(cherry picked from commit 083007e930)
2018-08-21 13:31:16 +10:00
Mark Andrews
2dd18e9f60 fix lock order reversal
(cherry picked from commit 2bb4392bb3)
2018-08-21 13:30:47 +10:00
Mark Andrews
cd75073105 Merge branch '9-use-C99-integer-types-fix-install-v9_12' into 'v9_12'
Resolve "Replace custom datatypes (isc_<foo>_t) with C11 equivalents"

See merge request isc-projects/bind9!634
2018-08-14 20:17:38 -04:00
Ondřej Surý
e897ec66e6 Don't install removed int.h and boolean.h headers 2018-08-14 20:10:14 -04:00
Evan Hunt
6925485c04 Merge branch '465-missing-check-in-acl_test-c-unit-test-v9_12' into 'v9_12'
Resolve "Missing check in acl_test.c unit test"

See merge request isc-projects/bind9!651
2018-08-14 12:25:07 -04:00
Mark Andrews
75a39614cc add missing ATF_REQUIRE
(cherry picked from commit 0ce82e9d5f)
2018-08-14 09:15:52 -07:00
Evan Hunt
0e3c9d5080 Merge branch '474-mempool-is-broken-if-object-size-is-below-the-alignment-size-v9_12' into 'v9_12'
Resolve "mempool is broken if object size is below the alignment size"

See merge request isc-projects/bind9!649
2018-08-14 12:08:28 -04:00
Mark Andrews
cbccec86f7 mempool didn't work for sizes less than sizeof(void*)
(cherry picked from commit 5dd1beec8e)
2018-08-14 09:00:05 -07:00
Michał Kępień
aa0e39f05f Merge branch '476-fix-openssl-error-logging-v9_12' into 'v9_12'
[v9_12] Fix OpenSSL error logging

See merge request isc-projects/bind9!645
2018-08-14 07:11:50 -04:00
Michał Kępień
218166acf8 Add CHANGES entry
5009.	[bug]		Upon an OpenSSL failure, the first error in the OpenSSL
			error queue was not logged. [GL #476]

(cherry picked from commit cab7c34fbd)
2018-08-14 12:53:20 +02:00
Michał Kępień
36436268b5 Do not remove errors from the OpenSSL error queue in toresult()
dst__openssl_toresult3() first calls toresult() and subsequently uses
ERR_get_error_line_data() in a loop.  Given this, it is a mistake to use
ERR_get_error() in toresult() because it causes the retrieved error to
be removed from the OpenSSL error queue, thus preventing it from being
retrieved by the subsequent ERR_get_error_line_data() calls.  Fix by
using ERR_peek_error() instead of ERR_get_error() in toresult().

(cherry picked from commit fe20f8fe25)
2018-08-14 12:53:18 +02:00
Michał Kępień
8e64812293 Merge branch '471-fix-rbt_insert_and_remove-unit-test-v9_12' into 'v9_12'
[v9_12] Prevent rare rbt_insert_and_remove unit test failures

See merge request isc-projects/bind9!642
2018-08-14 05:11:18 -04:00
Michał Kępień
1a341e15e8 Prevent rare rbt_insert_and_remove unit test failures
When two or more absolute, two-label names are added to a completely
empty RBT, an extra, empty node for the root name will be created due to
node splitting.  check_tree() expects that, but the extra node will not
be created when just one name is added to a completely empty RBT.  This
problem could be handled inside check_tree(), but that would introduce
unnecessary complexity into it since adding a single name will result in
a different node count for a completely empty RBT (node count will be 1)
and an RBT containing only an empty node for the root name, created due
to prior node splitting (node count will be 2).  Thus, first explicitly
create a node for the root name to prevent rare check_tree() failures
caused by a single name being added in the first iteration of the
insert/remove loop.

(cherry picked from commit 13fe763798)
2018-08-14 10:44:49 +02:00
Michał Kępień
a635b242ab Merge branch '285-make-the-inline-system-test-more-lightweight-v9_12' into 'v9_12'
[v9_12] Make the "inline" system test more lightweight

See merge request isc-projects/bind9!640
2018-08-14 04:39:00 -04:00
Michał Kępień
a0dbee8418 Make the "inline" system test more lightweight
Each zone used in the "inline" system test contains a few dozen records.
Over a dozen of these zones are used in the test.  Most records present
in these zones are not subsequently used in the test itself, but all of
them need to be signed by the named instances launched by the test,
which puts quite a bit of strain on lower-end machines, leading to
intermittent failures of the "inline" system test.  Remove all redundant
records from the zones used in the "inline" system test in order to
stabilize it.

(cherry picked from commit 24dd865b97)
2018-08-14 10:16:30 +02:00