Commit Graph

10887 Commits

Author SHA1 Message Date
Evan Hunt
a61afa750f 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:33 -07:00
Ondřej Surý
661364c8cf Fix whitespace 2018-03-15 00:14:23 +01:00
Michał Kępień
f2838e68e8 Fix a zone database reference counting bug in dump_done()
A typo in commit d39ab7440e introduced a bug in zone database reference
counting which leads to a crash if dumping one version of a slave zone
is not finished by the time transferring a newer version from a master
completes.  Correct the typo to fix reference counting, thus preventing
crashes.

(cherry picked from commit fbd5658db7)
2018-03-13 10:52:01 -07:00
Evan Hunt
09fade72a0 Fix compiler warnings and test failures when building without threads
(cherry picked from commit 56353aaf42)
2018-03-10 10:37:12 -08:00
Evan Hunt
07e2e20868 add missing includes
(cherry picked from commit a173c9c18f)
2018-03-09 16:55:56 -08:00
Evan Hunt
7bc7557df9 Merge branch 'clean-bin-tests-v9_12' into 'v9_12'
clean up bin/tests, convert unit tests to ATF

Closes #115

See merge request isc-projects/bind9!93
2018-03-09 14:40:12 -08:00
Evan Hunt
80834b5b90 final cleanup
- update Kyuafiles to match Atffiles
- copyrights
- CHANGES note

(cherry picked from commit 86e00cbb71)
2018-03-09 14:40:12 -08:00
Evan Hunt
d35f62434a remove lib/tests as nothing uses it anymore
(cherry picked from commit d132f73497)
2018-03-09 14:39:57 -08:00
Evan Hunt
289836a066 shorten ht_test and random_test
(cherry picked from commit 9b753aa154)
2018-03-09 14:39:56 -08:00
Evan Hunt
4439c471d1 migrate t_dst signature test to lib/dns/tests/dst_test
(cherry picked from commit a4ebe83cdb)
2018-03-09 14:39:56 -08:00
Evan Hunt
56da937399 migrate t_db to lib/dns/tests/db_test
(cherry picked from commit f58ac8ada3)
2018-03-09 14:39:56 -08:00
Evan Hunt
aefad99e1e migrate t_names to lib/dns/tests/name_test
(cherry picked from commit 8ecf69ef7b)
2018-03-09 14:39:56 -08:00
Evan Hunt
c505afd183 migrate t_rbt to lib/dns/tests/rbt_test
(cherry picked from commit 109546cbda)
2018-03-09 14:39:56 -08:00
Evan Hunt
88bfe56876 migrate t_tasks to lib/isc/tests/task_test
(cherry picked from commit c6c1e99252)
2018-03-09 14:39:56 -08:00
Evan Hunt
30e157f6e4 migrate t_resolver to lib/dns/tests/resolver_test
(cherry picked from commit d80825c40b)
2018-03-09 14:39:56 -08:00
Evan Hunt
efccdad0ea migrate t_timers to lib/isc/tests/timer_test
(cherry picked from commit e2b8699df9)
2018-03-09 14:39:56 -08:00
Evan Hunt
c7fa56e8db migrate t_atomic to lib/isc/tests/atomic_test
(cherry picked from commit 874e2fc70c)
2018-03-09 14:39:55 -08:00
Evan Hunt
af48544b75 migrate t_mem to lib/isc/tests/mem_test
(cherry picked from commit 979f054702)
2018-03-09 14:39:55 -08:00
Evan Hunt
af0c9b2cee migrate t_net to lib/isc/tests
(cherry picked from commit 05b7251d51)
2018-03-09 14:39:55 -08:00
Evan Hunt
fadb93cf43 migrate t_sockaddr to lib/isc/tests
(cherry picked from commit 62f650078a)
2018-03-09 14:39:55 -08:00
Evan Hunt
787c5d1394 allow ATF tests to run in parallel
(cherry picked from commit ef0b4c91bc)
2018-03-09 14:36:06 -08:00
Evan Hunt
c54e379267 Merge branch 'v9_12_1_patch' into v9_12 2018-03-08 14:26:15 -08:00
Mark Andrews
a395ee02d3 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)
2018-03-08 12:15:29 +11:00
Mark Andrews
573b33b6c2 check insist on every call; make conditional block constistent with rest of code
(cherry picked from commit f1def91625)
2018-03-07 12:32:17 -08:00
Michał Kępień
b873806cae 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:23:49 +01:00
Michał Kępień
c437451566 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:23:48 +01:00
Tinderbox User
38be7f6d9b prep 9.12.1rc2 2018-03-02 21:53:26 +00:00
Evan Hunt
06b52cc939 temporarily revert change #4859 2018-03-02 12:14:20 -08:00
Evan Hunt
84ec07999f temporarily revert change #4859 2018-03-02 12:01:55 -08:00
Michał Kępień
590f092e00 Fix MX checks for dynamic updates
The check_mx() function in lib/ns/update.c incorrectly tests whether the
DNS_RDATA_CHECKMX/DNS_RDATA_CHECKMXFAIL flags are set for each applied
MX record update as these flags are never set in code paths related to
dynamic updates; they can only be set when loading a zone from a master
file (DNS_ZONEOPT_CHECKMX -> DNS_MASTER_CHECKMX -> DNS_RDATA_CHECKMX).
This flaw allows MX records containing IP addresses to be added to a
zone even when "check-mx fail;" is used.

Ensure correct behavior by modifying the relevant tests in check_mx() so
that they use DNS_ZONEOPT_CHECKMX/DNS_ZONEOPT_CHECKMXFAIL instead.

(cherry picked from commit 857a40c87b)
2018-02-26 15:15:27 -08:00
Evan Hunt
26b1e37f87 minor cleanup and addressed a sprintf format warning
(cherry picked from commit ab0fe63f07)
2018-02-26 10:39:44 +11:00
Mark Andrews
a29f564e1f update printf format to match type
(cherry picked from commit 48ca11df5f)
2018-02-26 10:39:44 +11:00
Mark Andrews
7adbccfb6d improve the conditional declaration and use of variable to silence cppcheck
(cherry picked from commit a04bb76973)
2018-02-26 10:39:44 +11:00
Mark Andrews
a7c51e8c79 remove deadcode
(cherry picked from commit b71a1386ed)
2018-02-26 10:39:44 +11:00
Mark Andrews
c5b7bdf0cb silence unread assignment warning by using POST macro
(cherry picked from commit e8249dcd49)
2018-02-26 10:39:44 +11:00
Mark Andrews
1470774f9c update the sscanf format strings so they match the pointer types
(cherry picked from commit 70d192eb97)
2018-02-26 10:39:44 +11:00
Mark Andrews
efb8880d1b redefine CHECK so cppcheck see the definition
(cherry picked from commit a4186b1867)
2018-02-26 10:39:44 +11:00
Mark Andrews
b34931bd49 conditionally typedef fstrmtable
(cherry picked from commit dcd309bea1)
2018-02-26 10:39:43 +11:00
Mark Andrews
65bf254fc8 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:39:43 +11:00
Petr Menšík
eb5c7e91fa 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)
2018-02-23 15:45:19 -08:00
Petr Menšík
cb98ce8e67 Reuse new function from rt46864 for similar block elsewhere.
(cherry picked from commit e7a93321f0)
2018-02-23 13:51:23 -08:00
Ondřej Surý
557a5c3f78 Update license headers to not include years in copyright in all applicable files
(cherry picked from commit 843d389661)
2018-02-23 10:38:02 +01:00
Evan Hunt
cd8d44403b [v9_12] copyrights 2018-02-17 21:26:12 -08:00
Evan Hunt
5254978eec [v9_12] re-prep 9.12.1rc1 to include needed fixes; update README 2018-02-17 19:54:52 -08:00
Michał Kępień
5f12985f0b Make dns_dt_send() call dns_dt_reopen() asynchronously
Instead of checking current dnstap output file size and potentially
synchronously calling dns_dt_reopen() upon every call to dns_dt_send():

  - call dns_dt_reopen() asynchronously by queuing an event to the task
    specified at dnstap environment creation time,

  - ensure no roll event is outstanding before checking dnstap output
    file size and potentially queuing another roll event.

This causes dnstap output files to exceed their configured size limits,
but prevents any two threads from performing the roll simultaneously
(which causes crashes).
2018-02-16 09:37:23 +01:00
Michał Kępień
2c1307f061 Make dns_dt_reopen() request task-exclusive mode on its own
Instead of relying on the caller to set up task-exclusive mode, make
dns_dt_reopen() enforce task-exclusive mode itself, using the task
specified at dnstap environment creation time.
2018-02-16 09:37:23 +01:00
Michał Kępień
e26c5df16f Add dns_dt_create2()
Implement a new variant of dns_dt_create() to enable a dnstap
environment structure to hold the task in the context of which
dns_dt_reopen() will be executed.
2018-02-16 09:37:23 +01:00
Michał Kępień
840c9348bf 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:47:40 +01:00
Michał Kępień
3395f6fac3 Asynchronous zone load events have no way of getting canceled
Code handling cancellation of asynchronous zone load events was likely
copied over from other functions when asynchronous zone loading was
first implemented in commit 8a2ab2b920.  However, unlike those other
functions, asynchronous zone loading events currently have no way of
getting canceled once they get posted, which means the aforementioned
code is effectively dead.  Remove it to prevent confusion.
2018-02-16 08:47:40 +01:00
Michał Kępień
7c64547d95 Only clear DNS_ZONEFLG_LOADPENDING in zone_asyncload() if zone loading is completed immediately
zone_load() is not always synchronous, it may only initiate an
asynchronous load and return DNS_R_CONTINUE, which means zone loading
has not yet been completed.  In such a case, zone_asyncload() must not
clear DNS_ZONEFLG_LOADPENDING immediately and leave that up to
zone_postload().
2018-02-16 08:47:40 +01:00