Commit Graph

10863 Commits

Author SHA1 Message Date
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
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
Michał Kępień
93c176d2d6 Lock zone before checking whether its asynchronous load is already pending
While this is not an issue in named, which only calls
dns_zone_asyncload() from task-exclusive mode, this function is exported
by libdns and thus may in theory be concurrently called for the same
zone by multiple threads.  It also does not hurt to be consistent
locking-wise with other DNS_ZONEFLG_LOADPENDING accesses.
2018-02-16 08:47:40 +01:00
Mark Andrews
3208b02910 add POST(len); 2018-02-16 14:08:26 +11:00
Mark Andrews
736cbc97d7 conditionally declare stacksize 2018-02-16 14:08:26 +11:00
Mark Andrews
58c141e9b6 add POST(len); 2018-02-16 14:08:26 +11:00
Mark Andrews
494a3b33a2 Clarify calculation precedence for '&' and '?' 2018-02-16 14:08:26 +11:00
Mark Andrews
d6b79d3d43 add POST(tl) 2018-02-16 14:08:26 +11:00
Mark Andrews
13e2a127f2 test for == 0 rather than <= as value is unsigned 2018-02-16 14:08:26 +11:00
Mark Andrews
fb93276320 use %u instead of %d 2018-02-16 14:08:26 +11:00
Mark Andrews
3b412a0634 use %u instead of %d 2018-02-16 14:08:26 +11:00
Mark Andrews
d23375e5b3 use %u instead of %d 2018-02-16 14:08:26 +11:00
Mark Andrews
e34eec79a8 use %u instead of %d 2018-02-16 14:08:26 +11:00
Mark Andrews
7670515fac use %u instead of %d 2018-02-16 14:08:26 +11:00
Mark Andrews
14e5f05a5e use %u instead of %d 2018-02-16 14:08:26 +11:00
Mark Andrews
5a21fe753d use %u instead of %d 2018-02-16 14:08:26 +11:00
Mark Andrews
1e943e3f3a use %u instead of %d 2018-02-16 14:08:26 +11:00
Mark Andrews
ade6a20c56 use %u instead of %d 2018-02-16 14:08:26 +11:00
Mark Andrews
cf063314f2 use %u instead of %d 2018-02-16 14:08:26 +11:00
Mark Andrews
bf74665d5c case to unsigned; reorder expression 2018-02-16 14:08:26 +11:00
Mark Andrews
800c5a61a2 simplify expression 2018-02-16 14:08:26 +11:00
Mark Andrews
2f859b6f9e use %u and preserve unsigned property 2018-02-16 14:08:26 +11:00
Mark Andrews
a4d75d92aa make declaration and use of setnocookie fully conditional 2018-02-16 14:08:26 +11:00
Mark Andrews
c178a8e904 cast to unsigned 2018-02-16 14:08:26 +11:00
Mark Andrews
19ef6d7b21 preserve unsigned property 2018-02-16 14:08:26 +11:00
Mark Andrews
585a420c64 make both arguments of & unsigned 2018-02-16 14:08:26 +11:00