Commit Graph

10482 Commits

Author SHA1 Message Date
Michał Kępień
d76fdb8718 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)
(cherry picked from commit d45ee39bae)
2018-05-10 09:20:31 -07:00
Mark Andrews
44ff35c6cb simplify mask construction
(cherry picked from commit 22fab3199f)
2018-05-03 17:16:10 +02:00
Michał Kępień
fcbdeed802 Apply raw zone deltas to yet unsigned secure zones
When inline signing is enabled for a zone without creating signing keys
for it, changes subsequently applied to the raw zone will not be
reflected in the secure zone due to the dns_update_signaturesinc() call
inside receive_secure_serial() failing.  Given that an inline zone will
be served (without any signatures) even with no associated signing keys
being present, keep applying raw zone deltas to the secure zone until
keys become available in an attempt to follow the principle of least
astonishment.

(cherry picked from commit 6acf326969)
(cherry picked from commit 8a58a60772)
2018-04-25 12:10:26 -07:00
Michał Kępień
c042ec70d2 Only log bumped signed serial after a successful secure zone update
If a raw zone is modified, but the dns_update_signaturesinc() call in
receive_secure_serial() fails, the corresponding secure zone's database
will not be modified, even though by that time a message containing the
bumped signed serial will already have been logged.  This creates
confusion, because a different secure zone version will be served than
the one announced in the logs.  Move the relevant dns_zone_log() call so
that it is only performed if the secure zone's database is modified.

(cherry picked from commit cfbc8e264d)
(cherry picked from commit cdc7ab42b1)
2018-04-25 12:10:26 -07:00
Evan Hunt
636f8d53d8 remove unnecessary comparison
(cherry picked from commit 8b1baa10ee)
(cherry picked from commit f9da5a735e)
2018-04-22 12:58:36 -07:00
Evan Hunt
61121be596 silence warnings about unnecessary comparisons
- these are cases where result has been explicitly set, so
  if (result != ISC_R_SUCCESS) is unnecessary

(cherry picked from commit e00eb55cd2)
(cherry picked from commit 0dcff8f93c)
2018-04-22 12:58:36 -07:00
Evan Hunt
bda3ea150f add header guards in files that were missing them
(cherry picked from commit 4247477b61)
(cherry picked from commit 7f61e9d50e)
2018-04-22 12:58:36 -07:00
Evan Hunt
2f5ec44952 fix shadowed global variables
(cherry picked from commit 9ca3ab1168)
(cherry picked from commit 694a1486ca)
2018-04-22 12:58:36 -07:00
Evan Hunt
03e2d9d6de fix duplicate include guard in dnsconf.h
- IMHO we should consider removing dnsconf.c and deprecating the
  /etc/dns.conf file, though, as I don't think it's likely anyone
  is using it

(cherry picked from commit a08ba418ef)
(cherry picked from commit b9db91aa64)
2018-04-22 12:58:35 -07:00
Ondřej Surý
d416af9b15 A couple of more cleanups after free in opensslrsa_generate()
(cherry picked from commit d2b3188c61)
2018-04-06 14:26:04 +10:00
Petr Mensik
5a13cc651c Do not assign NULL conditionally in OpenSSL < 1.1, make it always explicit.
(cherry picked from commit edaafacf36)
2018-04-06 14:26:04 +10:00
Petr Mensik
05bed6173b Fix double free on RSA_generate_key_ex failure
(cherry picked from commit 01cc622e7b)
2018-04-06 14:26:03 +10:00
Mukund Sivaraman
b6e2633ca8 Check return value of isc_mem_get()
(cherry picked from commit de3a4af1bf)
2018-03-20 09:55:50 +11:00
Evan Hunt
89d3cfb4e8 update file headers 2018-03-15 18:49:47 -07:00
Evan Hunt
2b22c3bd4f add an 'untested' case when none of the atomic operations are available
- this fixes a build failure introduced in change 4913 when
  compiling with ATF and --disable-atomic

(cherry picked from commit 1b3eac926e)
2018-03-15 12:09:40 -07:00
Evan Hunt
7044b67b67 update file headers to remove copyright years 2018-03-14 21:12:08 -07:00
Ondřej Surý
1cdcae1183 Fix whitespaces 2018-03-14 12:44:08 +01:00
Evan Hunt
8188d164a3 Fix compiler warnings and test failures when building without threads
(cherry picked from commit 56353aaf42)
2018-03-10 10:37:22 -08:00
Evan Hunt
56fcddbb86 Merge branch 'clean-bin-tests-v9_10' into 'v9_10'
clean up bin/tests, convert unit tests to ATF

Closes #115

See merge request isc-projects/bind9!93
2018-03-09 22:49:58 -08:00
Evan Hunt
6fe8188cc3 final cleanup
- update Kyuafiles to match Atffiles
- copyrights
- CHANGES note

(cherry picked from commit 86e00cbb71)
(cherry picked from commit 80834b5b90)
(cherry picked from commit 442c1530a3)
2018-03-09 19:31:04 -08:00
Evan Hunt
ec55b0136a remove lib/tests as nothing uses it anymore
(cherry picked from commit d132f73497)
(cherry picked from commit d35f62434a)
(cherry picked from commit 941946cf14)
2018-03-09 18:48:59 -08:00
Evan Hunt
dbc21e4393 migrate t_dst signature test to lib/dns/tests/dst_test
(cherry picked from commit a4ebe83cdb)
(cherry picked from commit 4439c471d1)
(cherry picked from commit 57a5820dcc)
2018-03-09 18:46:54 -08:00
Evan Hunt
c5dbc0b727 migrate t_db to lib/dns/tests/db_test
(cherry picked from commit f58ac8ada3)
(cherry picked from commit 56da937399)
(cherry picked from commit d3518e57b1)
2018-03-09 18:45:18 -08:00
Evan Hunt
2893e982ed migrate t_names to lib/dns/tests/name_test
(cherry picked from commit 8ecf69ef7b)
(cherry picked from commit aefad99e1e)
(cherry picked from commit b2fef3b438)
2018-03-09 18:44:48 -08:00
Evan Hunt
4c6818ff8e migrate t_rbt to lib/dns/tests/rbt_test
(cherry picked from commit 109546cbda)
(cherry picked from commit c505afd183)
(cherry picked from commit 42fa3932ab)
2018-03-09 18:43:58 -08:00
Evan Hunt
430d35e332 migrate t_tasks to lib/isc/tests/task_test
(cherry picked from commit c6c1e99252)
(cherry picked from commit 88bfe56876)
(cherry picked from commit 38f9cddcad)
2018-03-09 18:42:57 -08:00
Evan Hunt
29474940ea migrate t_resolver to lib/dns/tests/resolver_test
(cherry picked from commit d80825c40b)
(cherry picked from commit 30e157f6e4)
(cherry picked from commit 5dd25f2285)
2018-03-09 18:40:53 -08:00
Evan Hunt
5b477b2aa4 migrate t_timers to lib/isc/tests/timer_test
(cherry picked from commit e2b8699df9)
(cherry picked from commit efccdad0ea)
(cherry picked from commit 274ee0b425)
2018-03-09 18:40:05 -08:00
Evan Hunt
1200d6f072 migrate t_atomic to lib/isc/tests/atomic_test
(cherry picked from commit 874e2fc70c)
(cherry picked from commit c7fa56e8db)
(cherry picked from commit 492e19d6ec)
2018-03-09 18:38:09 -08:00
Evan Hunt
7014d0994b migrate t_mem to lib/isc/tests/mem_test
(cherry picked from commit 979f054702)
(cherry picked from commit af48544b75)
(cherry picked from commit 814cd21e22)
2018-03-09 18:34:51 -08:00
Evan Hunt
67b63a3e10 migrate t_net to lib/isc/tests
(cherry picked from commit 05b7251d51)
(cherry picked from commit af0c9b2cee)
(cherry picked from commit faedafd2b4)
2018-03-09 18:34:04 -08:00
Evan Hunt
b392c18f6e migrate t_sockaddr to lib/isc/tests
(cherry picked from commit 62f650078a)
(cherry picked from commit fadb93cf43)
(cherry picked from commit 323e2f7152)
2018-03-09 18:33:11 -08:00
Evan Hunt
e9e74e7af6 allow ATF tests to run in parallel
(cherry picked from commit ef0b4c91bc)
(cherry picked from commit 787c5d1394)
2018-03-09 14:38:02 -08:00
Evan Hunt
d4379f55da Merge branch 'v9_10_7_patch' into v9_10 2018-03-08 14:29:57 -08:00
Mark Andrews
6c70c71553 check for in-view zones colliding with other zone definitions; also check the syntax of the in-view zone name
(cherry picked from commit 3e7e280040)
(cherry picked from commit 229e9e2215)
2018-03-08 12:32:52 +11:00
Michał Kępień
b05a048a33 Remove duplicate irs_resconf_load() unit test
The "sortlist-v4.conf" unit test for irs_resconf_load() is always run
twice due to a duplicate entry in the "tests" table.  Remove one of them
to prevent this.

(cherry picked from commit 6c09f305ae)
2018-03-06 09:25:02 +01:00
Michał Kępień
ea04e0583c Do not ignore resolv.conf syntax errors
irs_resconf_load() stores the value returned by add_search() into ret
without consulting its current value first.  This causes any previous
errors raised while parsing resolv.conf to be ignored as long as any
"domain" or "search" statement is present in the file.

Prevent this by returning early in case an error is detected while
parsing resolv.conf.  Ensure that "searchlist" and "magic" members of
the created irs_resconf_t structure are always initialized before
isc_resconf_destroy() is called.

(cherry picked from commit 1f400b68a8)
2018-03-06 09:25:02 +01:00
Tinderbox User
98ed062cf9 prep 9.10.7rc2 2018-03-02 21:53:56 +00:00
Evan Hunt
8b2a96ca41 temporarily revert change #4859
(cherry picked from commit 06b52cc939)
2018-03-02 12:17:25 -08:00
Evan Hunt
9c6d288f27 temporarily revert change #4859
(cherry picked from commit 84ec07999f)
2018-03-02 12:03:50 -08:00
Mark Andrews
9a0373b896 update printf format to match type
(cherry picked from commit 48ca11df5f)
2018-02-26 10:48:19 +11:00
Mark Andrews
8e046acb50 improve the conditional declaration and use of variable to silence cppcheck
(cherry picked from commit a04bb76973)
2018-02-26 10:48:18 +11:00
Mark Andrews
cdb6c5c106 silence unread assignment warning by using POST macro
(cherry picked from commit e8249dcd49)
2018-02-26 10:47:57 +11:00
Mark Andrews
06b7a4397a update the sscanf format strings so they match the pointer types
(cherry picked from commit 70d192eb97)
2018-02-26 10:47:56 +11:00
Mark Andrews
d17558a874 redefine CHECK so cppcheck see the definition
(cherry picked from commit a4186b1867)
2018-02-26 10:47:56 +11:00
Mark Andrews
981d548a66 adjust goto target and conditional compilation so that cleanup_spillattimer and cleanup_alglock labels match the element to be cleanup and so that they are always used
(cherry picked from commit 7b27be54ee)
2018-02-26 10:46:03 +11:00
Evan Hunt
90ae2fce20 final cleanup
- add CHANGES note
- update copyrights and license headers
2018-02-25 01:04:16 -08:00
Petr Menšík
6f2fd5ccca unit/unittest.sh is generated by configure. It will always be
generated into builddir. If out-of-tree build is used, make unit
will always fail. Kyuafiles and testdata still have to be copied
manually into the builddir.

(cherry picked from commit 95cde3608a)
(cherry picked from commit 6d9b38e9fe)
2018-02-23 15:51:16 -08:00
Petr Menšík
16ea60d8cc Reuse new function from rt46864 for similar block elsewhere.
(cherry picked from commit e7a93321f0)
(cherry picked from commit cb98ce8e67)
(cherry picked from commit 6876501605)
2018-02-23 13:57:12 -08:00
Michał Kępień
fbc282e6bf Do not recheck DNS_ZONEFLG_LOADPENDING in zone_asyncload()
Remove a block of code which dates back to commit 8a2ab2b920, when
dns_zone_asyncload() did not yet check DNS_ZONEFLG_LOADPENDING.
Currently, no race in accessing DNS_ZONEFLG_LOADPENDING is possible any
more, because:

  - dns_zone_asyncload() is still the only function which may queue
    zone_asyncload(),

  - dns_zone_asyncload() accesses DNS_ZONEFLG_LOADPENDING under a lock
    (and potentially queues an event under the same lock),

  - DNS_ZONEFLG_LOADPENDING is not cleared until the load actually
    completes.

Thus, the rechecking code can be safely removed from zone_asyncload().

Note that this also brings zone_asyncload() to a state in which the
completion callback is always invoked.  This is required to prevent
leaking memory in case something goes wrong in zone_asyncload() and a
zone table the zone belongs to is indefinitely left with a positive
reference count.
2018-02-16 08:59:46 +01:00