Commit graph

11003 commits

Author SHA1 Message Date
Evan Hunt
2b0e2bc920 set freed pointers to NULL 2018-11-15 17:45:44 -08:00
Evan Hunt
dd29de6f19 convert resconf_test; remove ATF from lib/irs/tests
(cherry picked from commit cec8c52cbe)
(cherry picked from commit 1d76da4943)
2018-11-15 17:45:44 -08:00
Evan Hunt
0b6ecdf509 convert parser_test; remove ATF from lib/isccfg/tests
(cherry picked from commit 7ec945bd41)
(cherry picked from commit 66fa5b9af6)
2018-11-15 17:45:44 -08:00
Evan Hunt
fbd563baea convert config_test; remove ATF from lib/lwres/tests 2018-11-15 17:45:44 -08:00
Evan Hunt
f533ab528d improvements to test setup and teardown
- assert if {isc,dns,ns}_test_begin() is called when a prior test is running
- add dns_test_init() and dns_test_final(), which can be run before and
  after all tests. this ensures openssl doesn't have to be reinitialized.
2018-11-15 17:44:13 -08:00
Evan Hunt
099883e2b1 remove .NOTPARALLEL so unit tests can build faster
(cherry picked from commit b434b0a4b6)
(cherry picked from commit 03c7a096c6)
2018-11-16 01:05:35 +00:00
Evan Hunt
a9a626e440 add cmocka support to remaining unit test makefiles
- also cleaned up some existing test code

(cherry picked from commit 2afd18a2ce)
(cherry picked from commit cd5855378e)
2018-11-16 01:05:35 +00:00
Mark Andrews
f14f70833f uninitalize memory read on error path
(cherry picked from commit 4eadebe2b2)
2018-11-15 00:16:35 +00:00
Mark Andrews
3aafdbf160 errors initalizing badcaches were not caught or cleaned up on error paths
(cherry picked from commit 93776c4c81)
2018-11-15 00:16:31 +00:00
Mark Andrews
e409b8c698 free tmpzonename and restart_master
(cherry picked from commit 50714a9b35)
2018-11-14 11:42:44 -08:00
Mark Andrews
ccf915f7e4 don't use 'typename' as it is reserved in C++ 2018-11-14 11:13:21 -08:00
Mark Andrews
03f2cc49e3 remove lib/isc/tests/result_test as it is now cmocka
(cherry picked from commit 9024cf0c15)
2018-11-13 07:50:51 +11:00
Mark Andrews
ffc56a4bf3 link in lib/isccc/tests/Kyuafile
(cherry picked from commit 9a59352b4c)
2018-11-13 07:50:30 +11:00
Mark Andrews
58812a4641 define CMOCKA_CFLAGS and CMOCKA_LIBS
(cherry picked from commit 1e8cdc20f3)
2018-11-12 18:42:58 +11:00
Evan Hunt
181c5442b9 convert result tests to use CMocka instead of ATF
(cherry picked from commit 471110933a)
2018-11-12 15:38:50 +11:00
Mark Andrews
af5a051e4d check result tables are complete
(cherry picked from commit 4f04a79250)
2018-11-12 15:32:58 +11:00
Ondřej Surý
22c0f129ae Add support for cmocka assert testing by overriding REQUIRE/INSIST/... macros when UNIT_TESTING is defined
(cherry picked from commit 52731c000d)
2018-11-12 12:56:15 +11:00
Ondřej Surý
b0745fb156 Integrate cmocka unit testing framework to kyua
(cherry picked from commit 07910f0153)
2018-11-12 12:53:15 +11:00
Ondřej Surý
9000f73ba3 Properly use ATOMIC_*_LOCK_FREE preprocessor constants
The ATOMIC_*_LOCK_FREE can evalutate either 0, 1, or 2 which indicate the
lock-free property of the corresponding atomic types (both signed and unsigned).

	Value	Explanation
	-----	--------------------------------------
	  0	The atomic type is never lock-free
	  1	The atomic type is sometimes lock-free
	  2	The atomic type is always lock-free
	-----	--------------------------------------

(cherry picked from commit a5e7901eb9)
2018-11-09 05:00:32 +07:00
Ondřej Surý
ba263b5b7e isc_stdtime_t is always 32-bit now, so remove the always true macro STDTIME_ON_32BITS
(cherry picked from commit 6f5fe11f5a)
2018-11-09 03:04:22 +07:00
Ondřej Surý
52784fc3cc Disable runtime detection of md5 and sha1 support for Utimaco HSM.
Utimaco HSM requires user to be logged in before executing DigestUpdate, thus
breaking dst_lib_init2 that ran isc_md5_check and isc_sha1_check before sending
PIN to the HSM.  Therefore isc_*_check needs to be disabled when Utimaco HSM is
being used as PKCS#11 library.
2018-11-09 00:07:55 +07:00
Ondřej Surý
2079e44fb9 Define PK11_UTIMACO_FLAVOR and add detection code to configure.ac 2018-11-09 00:07:44 +07:00
Ondřej Surý
c5b54803cd Remove dummy ISLOCKED macro
(cherry picked from commit 68ca987792)
(cherry picked from commit 5ad72603a8)
2018-11-08 22:42:52 +07:00
Ondřej Surý
2f8b28efad Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached
(cherry picked from commit 23fff6c569)
(cherry picked from commit 4568669807)
2018-11-08 22:42:52 +07:00
Ondřej Surý
baa5811623 Modify the dbversion_test.c to detect disabled assertions
(cherry picked from commit b992b5b811)
(cherry picked from commit ce6ef5b50e)
2018-11-08 22:03:33 +07:00
Ondřej Surý
6aa63d9349 Add extra return failure after INSIST(0) in default branch
(cherry picked from commit 29c45200e7)
(cherry picked from commit 2a26189256)
2018-11-08 22:03:33 +07:00
Ondřej Surý
d894b2da79 Use larger buffers on snprintf buffer overflow false positives
(cherry picked from commit 4eaf927571)
(cherry picked from commit 65536fb10b)
2018-11-08 22:03:33 +07:00
Ondřej Surý
c576cb2ff6 Don't assert on failed getrlimit call to allow called to handle this gracefully as it already does, just abort where we need to know the numbers
(cherry picked from commit e2e138a801)
(cherry picked from commit 1e6329038b)
2018-11-08 22:03:31 +07:00
Ondřej Surý
f1224b4af1 When ISC assertions are disabled, still execute the condition to prevent unused variable warnings/errors from the compiler
(cherry picked from commit a831e0f72d)
(cherry picked from commit 3d834566f1)
2018-11-08 22:03:00 +07:00
Ondřej Surý
12a266211e Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool
(cherry picked from commit b2b43fd235)
(cherry picked from commit fcd1569e2b)
2018-11-08 22:02:58 +07:00
Ondřej Surý
9d15323e24 Add small tweaks to the code to fix compilation when ISC assertions are disabled
While implementing the new unit testing framework cmocka, it was found that the
BIND 9 code doesn't compile when assertions are disabled or replaced with any
function (such as mock_assert() from cmocka unit testing framework) that's not
directly recognized as assertion by the compiler.

This made the compiler to complain about blocks of code that was recognized as
unreachable before, but now it isn't.

The changes in this commit include:

* assigns default values to couple of local variables,
* moves some return statements around INSIST assertions,
* adds __builtin_unreachable(); annotations after some INSIST assertions,
* fixes one broken assertion (= instead of ==)

(cherry picked from commit fbd2e47f51)
(cherry picked from commit b222783ae9)
2018-11-08 22:00:49 +07:00
Evan Hunt
6690b9e5a3 silence warning from missing print.h
(cherry picked from commit a0de6707c0)
2018-10-30 08:09:44 -07:00
Michał Kępień
00bc5bf6bd Fix isc_buffer_copyregion() for auto-reallocated buffers
While isc_buffer_copyregion() calls isc_buffer_reserve() to ensure the
target buffer will have enough available space to append the contents of
the source region to it, the variables used for subsequently checking
available space are not updated accordingly after that call.  This
prevents isc_buffer_copyregion() from working as expected for
auto-reallocated buffers: ISC_R_NOSPACE will be returned if enough space
is not already available in the target buffer before it is reallocated.
Fix by calling isc_buffer_used() and isc_buffer_availablelength()
directly instead of assigning their return values to local variables.

(cherry picked from commit e1f0aed034)
2018-10-30 13:34:49 +01:00
Michał Kępień
b549996d58 Add unit tests for isc_buffer_copyregion()
Add some basic checks for isc_buffer_copyregion() to ensure it behaves
as expected for both fixed-size buffers and buffers which can be
automatically reallocated.  Adjust the list of headers included by
lib/isc/tests/buffer_test.c so that it matches what that test program
really uses.

(cherry picked from commit 15440d8027)
2018-10-30 13:34:48 +01:00
Mark Andrews
e646307f91 compare_nxt compared records with identical next fields case insensitively
(cherry picked from commit cf83016682)
2018-10-30 15:10:55 +11:00
Mark Andrews
375df38a4a move declaration of pending
(cherry picked from commit bc53e5e5d4)
2018-10-30 11:55:12 +11:00
Mark Andrews
67816c747d document eol
(cherry picked from commit 97a680e5ce)
2018-10-30 11:18:06 +11:00
Mark Andrews
9b0a277490 Record types which support a empty rdata field were not handling the empty rdata field case.
(cherry picked from commit 2ff57d8a39)
2018-10-30 11:17:59 +11:00
Evan Hunt
dc59f82011 allow unquoted response-policy zone names
(cherry picked from commit 507230aa88)
2018-10-29 10:00:27 -07:00
Mark Andrews
bf299d5ee1 Only set IPV6_USE_MIN_MTU on IPv6.
(cherry picked from commit 561b780ba0)
2018-10-29 17:29:36 +11:00
Mark Andrews
a7fb84e783 Initalize TZ environment variable before calling dns_test_begin in dnstap_test.
(cherry picked from commit 1cf1254051)
2018-10-29 16:36:25 +11:00
Mark Andrews
9674fdcbfb Add support for EID and NIMLOC
(cherry picked from commit fbab100426)
2018-10-25 15:31:32 -07:00
Mark Andrews
e3a812507f GID, UID and UINFO could not be loaded using unknown record format.
(cherry picked from commit eb7ca65b78)
2018-10-25 13:35:37 -07:00
Michał Kępień
9e204a3376 Fix the configuration type used by the "server-addresses" option
Contrary to what the documentation states, the "server-addresses"
static-stub zone option does not accept custom port numbers.  Fix the
configuration type used by the "server-addresses" option to ensure
documentation matches source code.  Remove a check_zoneconf() test which
is unnecessary with this fix in place.

(cherry picked from commit b324576858)
2018-10-25 09:04:43 +02:00
Mark Andrews
1828ba389d Add support for ATMA
(cherry picked from commit f9ceddd8ca)
2018-10-25 14:17:29 +11:00
Mark Andrews
169b5ee36f expand the pool then copy over the old entries so we that failures do not break the old pool; also don't leak the new pool on error
(cherry picked from commit afde30fe9b)
2018-10-25 13:20:14 +11:00
Mark Andrews
36a0bf14e9 free key on error
(cherry picked from commit 607c2d7441)
2018-10-24 11:57:57 +11:00
Thomas Jach
56e54fb695 Couple additional Windows build fixes in VCX files
(cherry picked from commit f2d6b1b859)
(cherry picked from commit b39bd2816e)
2018-10-02 10:41:18 -07:00
Mark Andrews
c7766cee64 improve case presevation
(cherry picked from commit 0fc1b1bffa)
2018-10-02 15:28:06 +10:00
Tinderbox User
186cf94c9a prep 9.11.5rc1 2018-09-29 03:57:26 +00:00
Evan Hunt
debb94462f fix chaosnet address comparison
(cherry picked from commit b4dca44ad2)
2018-09-28 09:01:06 -07:00
Mark Andrews
e4fd1abccf 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:59 -07:00
Zhaolong Zhang
f889f48f61 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 13:00:05 -07:00
Michał Kępień
74cd632f18 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:21 -07:00
Mark Andrews
b2ffe56fc5 add krb5-selfsub and ms-selfsub
(cherry picked from commit fbeefd4990)
2018-09-10 17:40:19 +10:00
Mark Andrews
6ff17d94bf check that name field is not a valid type
(cherry picked from commit 5fb75a3d75)
2018-09-10 17:25:07 +10:00
Mark Andrews
dbaf32a667 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:25:07 +10:00
Mark Andrews
ced589e379 avoid macro name collision with system defined macro
(cherry picked from commit 81b133d963)
2018-09-10 09:30:59 +10:00
Ondřej Surý
d20fd7b109 Remove excessive inclusion of isc/refcount.h from various header files 2018-09-07 16:55:22 +02:00
Ondřej Surý
b92a1791b3 Use isc/stdatomic.h to switch to __atomic builtins when compiling in C++ mode 2018-09-07 16:55:22 +02:00
Witold Kręcicki
3da95ab2ed 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:30:12 +02:00
Ondřej Surý
94a1c85366 Add C++ declarations to dns/fixedname.h 2018-09-05 18:00:32 -04:00
Ondřej Surý
302cae89f3 Bail-out early in the for install loops instead of continuing because for masks the error in the middle
(cherry picked from commit 25248eb097)
(cherry picked from commit 3fbceba0a8)
2018-09-03 13:49:35 +02:00
Witold Krecicki
eec06494aa Silence some warnings and errors
(cherry picked from commit 0f0dfc7f86)
2018-08-31 17:54:54 -07:00
Mark Andrews
10fdd1aa23 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:09:40 +10:00
Mark Andrews
20c79090bd fclose origfile and zonefile
(cherry picked from commit 455bb23236)
2018-08-31 12:25:01 +10:00
Evan Hunt
d3add15848 silence "missing print.h" warning
(cherry picked from commit 3c18b7d3fd)
2018-08-28 16:22:15 -07:00
Witold Kręcicki
80a025d1a7 rndc reconfig should not stat on existing zones, just load new ones. 2018-08-28 16:53:43 +02:00
Mark Andrews
c2c7020057 use sizeof(CK_SLOT_ID)
(cherry picked from commit 2c1d8b2e99)
2018-08-24 11:33:12 +10:00
Mark Andrews
58e33fcdb4 unlink before unlock
(cherry picked from commit 4742f4ecba)
2018-08-24 10:58:30 +10:00
Michał Kępień
cf7557dce0 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 749b3cacfc, 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:46:08 +02:00
Michał Kępień
de6b8ded56 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:56:42 +02:00
Ondřej Surý
32a0d602ea We want to install compatibility shim isc/int.h and isc/boolean.h headers 2018-08-22 09:07:39 +02:00
Ondřej Surý
e37e27c560 Update lwres to use stdint types to finish transition to using stdint types 2018-08-22 09:04:02 +02:00
Mark Andrews
d5cef9cd55 fix lock order reversal
(cherry picked from commit 2bb4392bb3)
2018-08-21 13:33:37 +10:00
Ondřej Surý
a2ffc37ad3 Don't install removed int.h and boolean.h headers 2018-08-14 20:14:05 -04:00
Mark Andrews
49b7ac4d44 add missing ATF_REQUIRE
(cherry picked from commit 0ce82e9d5f)
2018-08-14 19:59:06 -04:00
Mark Andrews
a21b1b86dc mempool didn't work for sizes less than sizeof(void*)
(cherry picked from commit 5dd1beec8e)
2018-08-14 09:12:41 -07:00
Michał Kępień
0d174c46ff 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 36436268b5)
2018-08-14 12:53:44 +02:00
Michał Kępień
c6d1239d90 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:59 +02:00
Michał Kępień
cbd85e0137 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:29:54 +02:00
Ondřej Surý
af6fe731fb Make ENOBUFS a soft error
(cherry picked from commit ebf3083e08)
2018-08-13 19:23:21 +02:00
Ondřej Surý
8ad12f613e Fix extra closing parenthesis in DNSTAP code 2018-08-12 16:12:14 +02:00
Ondřej Surý
71059dac02 Fix various build failures on Windows (Courtesy of rockerinthelocker) 2018-08-11 05:57:52 -04:00
Ondřej Surý
bfd31e282a Fix missing config.h in win32/socket.c and replace config.h with <config.h>
(cherry picked from commit d87c1a120d)
2018-08-11 11:00:50 +02:00
Ondřej Surý
0a10dfa524 Add compatibility isc/boolean.h and isc/int.h headers
(cherry picked from commit 0dad73aafa)
2018-08-10 15:20:58 +02:00
Ondřej Surý
eb745a2125 Remove duplicate config.h
(cherry picked from commit 7351c505a0)
(cherry picked from commit 2844f6529d)
2018-08-10 15:20:58 +02:00
Ondřej Surý
1084b40b44 Replace custom isc_boolean_t with C standard bool type
(cherry picked from commit 994e656977)
(cherry picked from commit 884929400c)
2018-08-10 15:20:57 +02:00
Ondřej Surý
aaa76dc654 Replace custom isc_u?intNN_t types with C99 u?intNN_t types
(cherry picked from commit cb6a185c69)
(cherry picked from commit d61e6a3111)
2018-08-10 15:20:57 +02:00
Ondřej Surý
07970c501d Get rid of extra UINT64_MAX definition in lib/isc/win32/time.c
(cherry picked from commit 055278c936)
(cherry picked from commit 3523850065)
2018-08-10 15:20:57 +02:00
Ondřej Surý
bfc6a25f2d Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants
(cherry picked from commit 64fe6bbaf2)
(cherry picked from commit c863a076ae)
2018-08-10 15:20:57 +02:00
Evan Hunt
ba162bd0d4 caclulate nlabels and set *chainingp correctly
(cherry picked from commit e78e55f435)
2018-08-08 14:27:44 -07:00
Tinderbox User
4b0b459e5b prep 9.11.4-P1 2018-08-08 14:27:44 -07:00
Evan Hunt
98b2377de3 explicit DNAME query could trigger a crash if deny-answer-aliases was set
(cherry picked from commit a21c3810d3453548cc05ae19995125dabea9ca9c)
(cherry picked from commit 6e187b8656)
2018-08-08 14:27:17 -07:00
Mark Andrews
4130859964 remove dead code
(cherry picked from commit 83a1e87dd2)
2018-08-03 09:50:45 +10:00
Mark Andrews
c4089d38cd treat the signed instance of a inline zone as dynamic
(cherry picked from commit 9130f055f4)
2018-08-02 14:27:41 +10:00
Mark Andrews
a65c8e27b1 handle dns_aclelementtype_geoip
(cherry picked from commit 57eadf4d4f)
2018-08-02 09:59:58 +10:00
Mark Andrews
c47f3abead test dns_acl_isinsecure with geoip element
(cherry picked from commit fb8bb4e306)
2018-08-02 09:59:58 +10:00
Mark Andrews
d024898f35 use tlsa and smime structs to set common values
(cherry picked from commit 63c9ec367f)
2018-08-02 08:52:30 +10:00
Mark Andrews
0a9f953a2f refcount errors on error paths
(cherry picked from commit 4093efc900)
2018-07-31 18:43:18 +10:00
Mark Andrews
43c6f0d801 remove re-initalisation of common structure
(cherry picked from commit 6e06d3e7c6)
2018-07-12 09:49:01 +10:00
Mark Andrews
f1f2c0c493 remove redundant test
(cherry picked from commit 6eec7fe092)
2018-07-10 19:05:12 -07:00
Mark Andrews
078962a616 fix spelling of 'telemetry'
(cherry picked from commit 4f18b6a09a)
2018-07-10 18:30:45 -07:00
Tinderbox User
3bbd725a2c prep 9.11.4rc2 2018-06-28 05:07:42 +00:00
Evan Hunt
65bf99c85a use ISC_INT32_MAX as maximum 2018-06-27 18:40:24 -07:00
Witold Kręcicki
e92d5421c3 Fallback to normal procedure if creating of ixfr-from-differences fails
(cherry picked from commit b1254430df)
2018-06-27 18:33:33 -07:00
Witold Kręcicki
1919f5c937 Fix some issues with large journal entries
(cherry picked from commit 0db7130f2b)
2018-06-27 18:33:32 -07:00
Mark Andrews
6a52c54af6 cfg_parse_boolean's REQUIRE test for ret was incomplete.
(cherry picked from commit f1ee5e4a16)
2018-06-27 17:37:17 +10:00
Ondřej Surý
a6887424ca Un-deprecate the answer-cookie option 2018-06-26 15:18:36 -07:00
Witold Kręcicki
5e375f8b52 Use completely static-sized buffers
(cherry picked from commit 49f90025a0)
(cherry picked from commit 4007a9d020)
2018-06-26 15:23:28 -04:00
Witold Kręcicki
cd7bf90a54 Fix socket cmsg buffer usage
(cherry picked from commit d79be7dd5e)
(cherry picked from commit da63e95612)
2018-06-26 15:23:28 -04:00
Mark Andrews
316eebb699 construct a symtab of valid in-view targets then check that the target exists
(cherry picked from commit e01a4bcb20)
2018-06-26 10:53:59 -07:00
Mark Andrews
236ab4c453 fix casecompare return type for ninfo, tkey, txt
(cherry picked from commit 3ba1d1e43b)
2018-06-25 13:10:06 +10:00
Evan Hunt
a1690b24bc prepare 9.11.4rc1 2018-06-21 18:54:43 +02:00
Mark Andrews
09776e3e54 Declare the 'rdata' argument for dns_rdata_tostruct() to be const
(cherry picked from commit abb2fd1027)
2018-06-15 08:52:41 +02:00
Michał Kępień
2c09f7a06c Reimplement all zone logging functions using dns_zone_logv()
In order to decrease code duplication, express the logic contained in
all zone logging functions using dns_zone_logv() calls.

(cherry picked from commit 5c03cd339e)
2018-06-11 12:50:25 +02:00
Michał Kępień
4fab6fec76 Add dns_zone_logv()
Add a new libdns function, dns_zone_logv(), which takes a single va_list
argument rather than a variable number of arguments and can be used as a
base for implementing more specific zone logging functions.

(cherry picked from commit bb2dfb3f49)
2018-06-11 12:50:25 +02:00
Evan Hunt
b75a2b9730 improve readability of radix code
- use RADIX_V4, RADIX_V6, RADIX_V4_ECS, and RADIX_V6_ECS as array
  indices instead of 0 through 3.
- remove some unused macros

(cherry picked from commit f7f20b1202)
2018-06-08 12:11:19 -07:00
Evan Hunt
7a00ce2e77 ensure we try to validate glue records so RRSIG TTLs will be capped 2018-06-08 11:41:48 -07:00
Mark Andrews
d1f9dcca00 add cfg_parse_buffer4
(cherry picked from commit b313084af2)
2018-06-08 17:40:32 +10:00
Mukund Sivaraman
441de7dbe3 Add a answer-cookie named config option
(cherry picked from commit 2930507357)
2018-06-08 17:29:28 +10:00
Mark Andrews
34bfd20348 Add support for marking a option as deprecated.
(cherry picked from commit befff9452c)
2018-06-08 15:56:01 +10:00
Witold Kręcicki
9b17be187f Don't fetch DNSKEY when fuzzing resolver
(cherry picked from commit cb3208aa43)
2018-06-06 15:27:27 +02:00
Mark Andrews
dd05287a31 add support -T sigvalinsecs
(cherry picked from commit 87a3dc8ab9)
(cherry picked from commit 69340b5ac5)
2018-06-06 17:17:48 +10:00
Mark Andrews
298372d8d2 only sign with other keys when deleting a key if there are not already existing signature for the deleted algorithm
(cherry picked from commit 0667bf7ae7)
(cherry picked from commit c1e342cedb)
2018-06-06 17:10:01 +10:00
Mark Andrews
9a5f308287 add named.conf option root-key-sentinel
(cherry picked from commit 68e9315c7d)
(cherry picked from commit ee763ef281)
2018-06-04 17:41:22 -04:00
Mark Andrews
f9d19cab7f 4699. [func] Multiple cookie-secret clauses can now be specified.
The first one specified is used to generate new
                        server cookies.  [RT #45672]
2018-06-04 13:16:28 -07:00
Mukund Sivaraman
2bbea4513f Add NSEC3 fromtext/totext unittests
(cherry picked from commit b0d9198e03)
2018-06-04 13:02:44 +10:00
Mukund Sivaraman
0aa9c410d7 Don't insert 2nd space between NSEC3 nexthash and typemap fields
(cherry picked from commit d4ea1edd2c)
2018-06-04 13:02:44 +10:00
Mark Andrews
e568d66db3 work around cppcheck false positive
(cherry picked from commit cb5802e854)
2018-05-29 09:45:23 +10:00
Evan Hunt
884e8df7ca copyrights 2018-05-23 09:55:41 -07:00
Mark Andrews
fed871b720 ISC_SOCKEVENTATTR_TRUNC was not be set
(cherry picked from commit 6bff1768cf)
2018-05-18 16:00:36 +10:00
Mark Andrews
4868351c45 look for '\0'
(cherry picked from commit d03a81c265)
2018-05-18 12:45:14 +10:00
Mark Andrews
0256a07b96 add some %f format tests
(cherry picked from commit f5233ba5de)
2018-05-18 12:45:14 +10:00
Michał Kępień
803537b991 isc_buffer_*(): if source can be NULL, only call memmove() when length is non-zero
Certain isc_buffer_*() functions might call memmove() with the second
argument (source) set to NULL and the third argument (length) set to 0.
While harmless, it triggers an ubsan warning:

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

Modify all memmove() call sites in lib/isc/include/isc/buffer.h and
lib/isc/buffer.c which may potentially use NULL as the second argument
(source) so that memmove() is only called if the third argument (length)
is non-zero.

(cherry picked from commit 6ddbca6f2b)
2018-05-15 09:32:19 +02:00
Michał Kępień
b7b1de0a39 dns_rdataslab_merge(): use dns_rdata_compare() instead of compare_rdata()
compare_rdata() was meant to be used as a qsort() callback.  Meanwhile,
dns_rdataslab_merge() calls compare_rdata() for a pair of dns_rdata_t
structures rather than a pair of struct xrdata structures, which is
harmless, but triggers an ubsan warning:

    rdataslab.c:84:33: runtime error: member access within address <address> with insufficient space for an object of type 'const struct xrdata'

Use dns_rdata_compare() instead of compare_rdata() to prevent the
warning from being triggered.

(cherry picked from commit 9bc6ba0be9)
2018-05-15 09:32:19 +02:00
Michał Kępień
bdc9f829c8 Extend the list of headers included by lib/dns/tests/sigs_test.c
(cherry picked from commit f98e145c5b)
2018-05-14 09:32:07 +02:00
Mark Andrews
c8f13be0dd return untested if not built with OPENSSL or PKCS11CRYPTO
(cherry picked from commit 2420320b96)
2018-05-14 09:32:07 +02:00
Ondřej Surý
188526f41c Remove $Id markers, Principal Author and Reviewed tags from the full source tree
(cherry picked from commit 55a10b7acd)
2018-05-11 14:25:15 +02:00
Michał Kępień
b4f07af8df Address GCC 8 -Wformat-truncation warnings
(cherry picked from commit 172d0c401e)
2018-05-10 10:54:38 +02:00
Evan Hunt
3123862be9 Merge branch '135-add-basic-unit-tests-for-update_sigs-v9_11' into 'v9_11'
Add basic unit tests for update_sigs()

Closes #135

See merge request isc-projects/bind9!112
2018-05-10 00:07:28 -07:00
Michał Kępień
505267f320 Define basic test cases for dns__zone_updatesigs()
Add some basic test cases ensuring dns__zone_updatesigs() behaves as
expected.

(cherry picked from commit 8b9d2c27b4)
(cherry picked from commit 3e93e4bb62)
2018-05-10 00:04:57 -07:00
Michał Kępień
e787e54ea1 Add a framework for dns__zone_updatesigs() unit tests
Add a new ATF test, sigs_test, containing everything required to start
defining test cases for dns__zone_updatesigs().  The framework is
written in a way which ensures that changes to zone database applied by
any dns__zone_updatesigs() invocation are preserved between subsequent
checks.

(cherry picked from commit 1f10186476)
(cherry picked from commit 3dde7c42db)
2018-05-10 00:04:55 -07:00
Michał Kępień
a6be59ce08 Move find_zone_keys() to lib/dns/zone_p.h
Rename find_zone_keys() to dns__zone_findkeys() and move it to
lib/dns/zone_p.h, so that it can be used in unit tests.  Add a comment
describing the purpose of this function.

(cherry picked from commit d7143986b1)
(cherry picked from commit fc0e99c7d7)
2018-05-10 00:04:14 -07:00
Michał Kępień
5c71a025c6 Move update_sigs() to lib/dns/zone_p.h
Rename update_sigs() to dns__zone_updatesigs() and move it to
lib/dns/zone_p.h, so that it can be unit tested.  Add a comment
describing the purpose of this function.

(cherry picked from commit b1947cee82)
(cherry picked from commit 4d06f50ba8)
2018-05-10 00:04:12 -07:00
Michał Kępień
5712d9528f Move zonediff_t to lib/dns/zone_p.h
Rename zonediff_t to dns__zonediff_t and move it to lib/dns/zone_p.h, so
that unit tests can be written for functions taking pointers to
structures of this type as arguments.

(cherry picked from commit ace465a9f9)
(cherry picked from commit ea15c54d8a)
2018-05-10 00:03:16 -07:00
Michał Kępień
536d6dc0c5 Add lib/dns/zone_p.h
Add a new private header file, lib/dns/zone_p.h, which will hold type
definitions and function prototypes not meant to be exported by libdns,
but required by zone-related unit tests.

(cherry picked from commit c1bc3be806)
(cherry picked from commit 2b0add6d1a)
2018-05-10 00:03:16 -07:00
Michał Kępień
1f454b8d91 Add a helper function to facilitate preparing dns_diff_t structures
Implement dns_test_difffromchanges(), a function which enables preparing
a dns_diff_t structure from a mostly-textual representation of zone
database changes to be applied.  This will improve readability of test
case definitions by allowing contents of a dns_diff_t structure, passed
e.g. to update_sigs(), to be represented in a human-friendly manner.

(cherry picked from commit 3c22af0d35)
(cherry picked from commit d4c603eb8a)
2018-05-10 00:03:16 -07:00
Michał Kępień
5097723d1b Rename dns_test_rdata_fromstring() to dns_test_rdatafromstring()
Remove the underscore from "rdata_fromstring" so that all helper
functions for libdns tests use a common naming covention.

(cherry picked from commit 2980cbd55f)
(cherry picked from commit 107102d333)
2018-05-10 00:03:15 -07:00
Michał Kępień
d45ee39bae Rework dns_test_makezone()
The dns_test_makezone() helper function always assigns the created zone
to some view, which is not always necessary and complicates cleanup of
non-managed zones as they are required not to be assigned to any view.

Rework dns_test_makezone() in order to make it easier to use in unit
tests operating on non-managed zones.  Use dns_name_fromstring() instead
of dns_name_fromtext() to simplify code.  Do not use the CHECK() macro
and add comments to make code flow simpler to follow.  Use
dns_test_makeview() instead of dns_view_create().

Adjust existing unit tests using this function so that they still pass.

(cherry picked from commit bfbeef3609)
(cherry picked from commit f70c02d2c2)
2018-05-10 00:03:15 -07:00