Commit graph

11044 commits

Author SHA1 Message Date
Mark Andrews
90fdf40bda improve case presevation
(cherry picked from commit 0fc1b1bffa)
2018-10-02 15:21:22 +10:00
Tinderbox User
7f5e4faed8 prep 9.12.3rc1 2018-09-29 04:21:11 +00:00
Evan Hunt
6452c017f5 fix chaosnet address comparison
(cherry picked from commit b4dca44ad2)
2018-09-28 08:58:45 -07:00
Tony Finch
98f9c5fb26 RPZ now treats covering NSEC records the same as negative answers
(cherry picked from commit 9407d9e266)
2018-09-27 15:22:43 -07:00
Mark Andrews
3992a37c06 only emit a single space between mac length and the orginal id if the mac length is zero
(cherry picked from commit ac1c3aaa27)
2018-09-27 14:28:47 -07:00
Zhaolong Zhang
811c5ebf92 Fix crash caused by race condition in timer creation
The race condition is the timer elapses before isc__timer_create()
returns the pointer to the caller.  Assigning the return pointer before
enabling the timer will fix it.

(cherry picked from commit 21966423cd)
2018-09-27 12:59:51 -07:00
Michał Kępień
3c43ba5fec Prevent a race after zone load
Zone loading happens in a different task (zone->loadtask) than other
zone actions (zone->task).  Thus, when zone_postload() is called in the
context of zone->loadtask, it may cause zone maintenance to be queued in
zone->task and another thread can then execute zone_maintenance() before
zone_postload() gets a chance to finish its work in the first thread.
This would not be a problem if zone_maintenance() accounted for this
possibility by locking the zone before checking the state of its
DNS_ZONEFLG_LOADPENDING flag.  However, the zone is currently not locked
before the state of that flag is checked, which may prevent zone
maintenance from happening despite zone_postload() scheduling it.  Fix
by locking the zone in zone_maintenance() before checking the state of
the zone's DNS_ZONEFLG_LOADPENDING flag.

(cherry picked from commit 56003e9f9f)
2018-09-26 19:46:09 -07:00
Mark Andrews
c827981de2 add krb5-selfsub and ms-selfsub
(cherry picked from commit fbeefd4990)
2018-09-10 17:18:38 +10:00
Mark Andrews
eae8d858e5 check that name field is not a valid type
(cherry picked from commit 5fb75a3d75)
2018-09-10 17:16:10 +10:00
Mark Andrews
4375370ba6 fix dns_ssumatchtype_subdomainms dns_ssumatchtype_subdomainkrb5 as they don't require the name field to be '.'
(cherry picked from commit 156d86e673)
2018-09-10 17:16:10 +10:00
Mark Andrews
9a14141676 avoid macro name collision with system defined macro
(cherry picked from commit 81b133d963)
2018-09-10 09:30:38 +10:00
Witold Kręcicki
0f6dee2a45 Align CMSG buffers to a void* boundary, fixes crash on architectures with strict alignment
CHANGES entry

(cherry picked from commit 17212cf996)
2018-09-07 10:27:20 +02:00
Ondřej Surý
f24af7deac Add C++ declarations to dns/fixedname.h
(cherry picked from commit 94a1c85366)
2018-09-06 08:11:04 +10:00
Ondřej Surý
3fbceba0a8 Bail-out early in the for install loops instead of continuing because for masks the error in the middle
(cherry picked from commit 25248eb097)
2018-09-03 13:31:17 +02:00
Witold Krecicki
0f0dfc7f86 Silence some warnings and errors 2018-08-31 17:33:03 -07:00
Mark Andrews
2289ba8b48 increase jitter to cover the entire potential steady state expire range when initially signing the zone
(cherry picked from commit 050fca2139)
2018-08-31 13:07:45 +10:00
Mark Andrews
3b9a6f0db8 fclose origfile and zonefile
(cherry picked from commit 455bb23236)
2018-08-31 12:24:46 +10:00
Evan Hunt
3bd113ddd1 silence "missing print.h" warning
(cherry picked from commit 3c18b7d3fd)
2018-08-28 16:22:05 -07:00
Witold Kręcicki
90b75d94ff rndc reconfig should not stat on existing zones, just load new ones.
(cherry picked from commit 80a025d1a7)
2018-08-28 17:03:10 +02:00
Mark Andrews
072069f1d5 use sizeof(CK_SLOT_ID)
(cherry picked from commit 2c1d8b2e99)
2018-08-24 11:32:11 +10:00
Mark Andrews
59ce0f2620 unlink before unlock
(cherry picked from commit 4742f4ecba)
2018-08-24 10:58:20 +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ń
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ń
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ń
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ý
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
2dd18e9f60 fix lock order reversal
(cherry picked from commit 2bb4392bb3)
2018-08-21 13:30:47 +10:00
Ondřej Surý
e897ec66e6 Don't install removed int.h and boolean.h headers 2018-08-14 20:10:14 -04:00
Mark Andrews
75a39614cc add missing ATF_REQUIRE
(cherry picked from commit 0ce82e9d5f)
2018-08-14 09:15:52 -07: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ń
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ń
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ń
cb5f86d99e Queue "rndc signing -nsec3param ..." requests if needed
If "rndc signing -nsec3param ..." is ran for a zone which has not yet
been loaded or transferred (i.e. its "db" field is NULL), it will be
silently ignored by named despite rndc logging an "nsec3param request
queued" message, which is misleading.  Prevent this by keeping a
per-zone queue of NSEC3PARAM change requests which arrive before a zone
is loaded or transferred and processing that queue once the raw version
of an inline-signed zone becomes available.

(cherry picked from commit cb40c5229a)
2018-08-14 09:26:38 +02:00
Ondřej Surý
cee556c4dd Make ENOBUFS a soft error
(cherry picked from commit ebf3083e08)
2018-08-13 19:22:56 +02:00
Ondřej Surý
08a962545d Fix various build failures on Windows (Courtesy of rockerinthelocker) 2018-08-11 05:57:42 -04:00
Ondřej Surý
d87c1a120d Fix missing config.h in win32/socket.c and replace config.h with <config.h> 2018-08-11 04:45:37 -04:00
Ondřej Surý
3f5db28568 Fix !!validate typo to -> !validate
(cherry picked from commit bdc9860262)
2018-08-11 10:28:27 +02:00
Evan Hunt
e8e7c597f8 mismatch between defined log modules and ns_modules[] in lib/ns/log.c
(cherry picked from commit b865fb77de)
2018-08-10 12:22:04 -07:00
Ondřej Surý
0dad73aafa Add compatibility isc/boolean.h and isc/int.h headers 2018-08-10 11:17:51 +02:00
Ondřej Surý
2844f6529d Remove duplicate config.h
(cherry picked from commit 7351c505a0)
2018-08-10 11:17:51 +02:00
Ondřej Surý
884929400c Replace custom isc_boolean_t with C standard bool type
(cherry picked from commit 994e656977)
2018-08-10 11:17:51 +02:00
Ondřej Surý
d61e6a3111 Replace custom isc_u?intNN_t types with C99 u?intNN_t types
(cherry picked from commit cb6a185c69)
2018-08-09 18:30:20 +02:00
Ondřej Surý
3523850065 Get rid of extra UINT64_MAX definition in lib/isc/win32/time.c
(cherry picked from commit 055278c936)
2018-08-09 18:30:20 +02:00
Ondřej Surý
c863a076ae Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants
(cherry picked from commit 64fe6bbaf2)
2018-08-09 18:30:20 +02:00
Evan Hunt
d97001a37c caclulate nlabels and set *chainingp correctly 2018-08-08 14:24:15 -07:00
Tinderbox User
a7213875ff prep 9.12.2-P1 2018-08-08 14:24:15 -07:00
Evan Hunt
45da24f272 explicit DNAME query could trigger a crash if deny-answer-aliases was set
(cherry picked from commit a21c3810d3453548cc05ae19995125dabea9ca9c)
2018-08-08 14:23:26 -07:00
Evan Hunt
2f611cf600 Silence a compiler warning on openbsd and fix windows build
(cherry picked from commit b55338e447)
2018-08-08 09:36:02 +02:00
Michał Kępień
fe526c3e57 Extract code preparing a delegation response to a separate function
Changes introduced by the previous two commits make the parts of
query_delegation() and query_zone_delegation() which prepare a
delegation response functionally equivalent.  Extract this code into a
separate function, query_prepare_delegation_response(), and then call
the latter from both query_delegation() and query_zone_delegation() in
order to reduce code duplication.  Add a comment describing the purpose
of the extracted code.  Fix coding style issues.

(cherry picked from commit 8e3fc5725f)
2018-08-08 08:09:30 +02:00
Michał Kępień
252b154371 Remove unused NS_QUERYATTR_CACHEGLUEOK query attribute
The NS_QUERYATTR_CACHEGLUEOK query attribute has no influence on query
processing.  Remove it.

(cherry picked from commit 7db4dedf6b)
2018-08-08 08:09:30 +02:00