Commit Graph

29421 Commits

Author SHA1 Message Date
Michał Kępień
0cebbd2742 Merge branch 'michal/update-gitlab-ci-to-fedora-30-v9_14' into 'v9_14'
[v9_14] Update GitLab CI to Fedora 30

See merge request isc-projects/bind9!2213
2019-07-31 03:14:26 -04:00
Michał Kępień
947d40692b Update GitLab CI to Fedora 30
Since Fedora 30 is the current Fedora release, replace Fedora 29 GitLab
CI jobs with their up-to-date counterparts.

(cherry picked from commit fac23cf939)
2019-07-31 08:47:36 +02:00
Mark Andrews
3c11f3ea0c Merge branch '1133-your-problem-or-cygwin-s-v9_14' into 'v9_14'
Resolve "Your problem or Cygwin's ?????"

See merge request isc-projects/bind9!2211
2019-07-30 21:26:45 -04:00
Mark Andrews
2b5237c325 add CHANGES
(cherry picked from commit 12d9681442)
2019-07-31 11:03:26 +10:00
Mark Andrews
f6d6fb8124 handle connect() returning ETIMEDOUT on a non-blocking socket
(cherry picked from commit 91a0cb5da3)
2019-07-31 11:02:30 +10:00
Michał Kępień
ef63765c73 Merge branch '1171-alpine-linux-tweaks-v9_14' into 'v9_14'
[v9_14] Alpine Linux tweaks

See merge request isc-projects/bind9!2209
2019-07-30 16:49:16 -04:00
Michał Kępień
6cf79bc963 Add Alpine Linux to GitLab CI
Ensure BIND is continuously tested on Alpine Linux as it is commonly
used as a base for Docker containers and employs a less popular libc
implementation, musl libc.

(cherry picked from commit 326a334b49)
2019-07-30 21:25:47 +02:00
Michał Kępień
8d0cdb54ee Do not use legacy time zone names
"PST8PDT" is a legacy time zone name whose use in modern code is
discouraged.  It so happens that using this time zone with musl libc
time functions results in different output than for other libc
implementations, which breaks the lib/isc/tests/time_test unit test.
Use the "America/Los_Angeles" time zone instead in order to get
consistent output across all tested libc implementations.

(cherry picked from commit f4daf6e0e7)
2019-07-30 21:25:47 +02:00
Michał Kępień
5159597db5 Fix awk invocation in the "verify" system test
Appending output of a command to the same file as the one that command
is reading from is a dangerous practice.  It seems to have accidentally
worked with all the awk implementations we have tested against so far,
but for BusyBox awk, doing this may result in the input/output file
being written to in an infinite loop.  Prevent this from happening by
redirect awk output to a temporary file and appending its contents to
the original file in a separate shell pipeline.

(cherry picked from commit bb9c1654e2)
2019-07-30 21:25:47 +02:00
Michał Kępień
61981b3688 Extend prerequisites for the "xfer" system test
The Net::DNS Perl module needs the Digest::HMAC module to support TSIG.
However, since the latter is not a hard requirement for the former, some
packagers do not make Net::DNS depend on Digest::HMAC.  If Net::DNS is
installed on a host but Digest::HMAC is not, the "xfer" system test
breaks in a very hard-to-debug way (ans5 returns TSIG RRs with empty
RDATA, which prevents TSIG-signed SOA queries and transfers from
working).  Prevent this from happening by making the "xfer" system test
explicitly require Digest::HMAC apart from Net::DNS.

(cherry picked from commit b10d28d1e0)
2019-07-30 21:25:47 +02:00
Michał Kępień
fe7dec851b Make "digdelv" system test work with BusyBox sed
The BusyBox version of sed treats leading '\+' in a regular expression
to be matched as a syntax error ("Repetition not preceded by valid
expression"), which triggers false positives for the "digdelv" system
test.  Make the relevant sed invocations work portably across all sed
implementations by removing the leading backslash.

(cherry picked from commit 266e3ed52a)
2019-07-30 21:25:47 +02:00
Michał Kępień
fdd926d7cb Make "autosign" system test work with BusyBox awk
The BusyBox version of awk treats some variables which other awk
implementations consider to be decimal values as octal values.  This
intermittently breaks key event interval calculations in the "autosign"
system test, trigger false positives for it.  Prevent the problem from
happening by stripping leading zeros from the affected awk variables.

(cherry picked from commit ad008f7dbf)
2019-07-30 21:25:46 +02:00
Michał Kępień
149ffc529d Tweak buffer sizes to prevent compilation warnings
For some libc implementations, BUFSIZ is small enough (e.g. 1024 for
musl libc) to trigger compilation warnings about insufficient size of
certain buffers.  Since the relevant buffers are used for printing DNS
names, increase their size to '(n + 1) * DNS_NAME_FORMATSIZE', where 'n'
is the number of DNS names which are printed to a given buffer.  This
results in somewhat arbitrary, albeit nicely-aligned and large enough
buffer sizes.

(cherry picked from commit 3384455659)
2019-07-30 21:25:46 +02:00
Michał Kępień
3f341b996d Always include <errno.h> instead of <sys/errno.h>
Including <sys/errno.h> instead of <errno.h> raises a compiler warning
when building against musl libc.  Always include <errno.h> instead of
<sys/errno.h> to prevent that compilation warning from being triggered
and to achieve consistency in this regard across the entire source tree.

(cherry picked from commit b5cd146033)
2019-07-30 21:25:46 +02:00
Michał Kępień
80669d8c89 Unify header ordering in unit tests
Make sure all unit tests include headers in a similar order:

 1. Three headers which must be included before <cmocka.h>.
 2. System headers.
 3. UNIT_TESTING definition, followed by the <cmocka.h> header.
 4. libisc headers.
 5. Headers from other BIND libraries.
 6. Local headers.

Also make sure header file names are sorted alphabetically within each
block of #include directives.

(cherry picked from commit 5381ac0fcc)
2019-07-30 21:25:45 +02:00
Michał Kępień
77dc5be6b4 Include <sched.h> where necessary for musl libc
All unit tests define the UNIT_TESTING macro, which causes <cmocka.h> to
replace malloc(), calloc(), realloc(), and free() with its own functions
tracking memory allocations.  In order for this not to break
compilation, the system header declaring the prototypes for these
standard functions must be included before <cmocka.h>.

Normally, these prototypes are only present in <stdlib.h>, so we make
sure it is included before <cmocka.h>.  However, musl libc also defines
the prototypes for calloc() and free() in <sched.h>, which is included
by <pthread.h>, which is included e.g. by <isc/mutex.h>.  Thus, unit
tests including "dnstest.h" (which includes <isc/mem.h>, which includes
<isc/mutex.h>) after <cmocka.h> will not compile with musl libc as for
these programs, <sched.h> will be included after <cmocka.h>.

Always including <cmocka.h> after all other header files is not a
feasible solution as that causes the mock assertion macros defined in
<isc/util.h> to mangle the contents of <cmocka.h>, thus breaking
compilation.  We cannot really use the __noreturn__ or analyzer_noreturn
attributes with cmocka assertion functions because they do return if the
tested condition is true.  The problem is that what BIND unit tests do
is incompatible with Clang Static Analyzer's assumptions: since we use
cmocka, our custom assertion handlers are present in a shared library
(i.e. it is the cmocka library that checks the assertion condition, not
a macro in unit test code).  Redefining cmocka's assertion macros in
<isc/util.h> is an ugly hack to overcome that problem - unfortunately,
this is the only way we can think of to make Clang Static Analyzer
properly process unit test code.  Giving up on Clang Static Analyzer
being able to properly process unit test code is not a satisfactory
solution.

Undefining _GNU_SOURCE for unit test code could work around the problem
(musl libc's <sched.h> only defines the prototypes for calloc() and
free() when _GNU_SOURCE is defined), but doing that could introduce
discrepancies for unit tests including entire *.c files, so it is also
not a good solution.

All in all, including <sched.h> before <cmocka.h> for all affected unit
tests seems to be the most benign way of working around this musl libc
quirk.  While quite an ugly solution, it achieves our goals here, which
are to keep the benefit of proper static analysis of unit test code and
to fix compilation against musl libc.

(cherry picked from commit 59528d0e9d)
2019-07-30 21:25:30 +02:00
Michał Kępień
747dbdcb84 Merge branch 'michal/filter-aaaa-system-test-make-root-hints-consistent-with-authoritative-data-v9_14' into 'v9_14'
[v9_14] "filter-aaaa" system test: make root hints consistent with authoritative data

See merge request isc-projects/bind9!2205
2019-07-29 16:10:45 -04:00
Michał Kępień
7bcb5a3178 Make root hints consistent with authoritative data
Resolvers in the "filter-aaaa" system test are configured with a single
root hint: "ns.rootservers.net", pointing to 10.53.0.1.  However,
querying ns1 for "ns.rootservers.net" results in NXDOMAIN answers.
Since the TTL for the root hint is set to 0, it may happen that a
resolver's ADB will be asked to return any known addresses for
"ns.rootservers.net", but it will only have access to a cached NXDOMAIN
answer for that name and an expired root hint, which will result in a
resolution failure, triggering a false positive for the "filter-aaaa"
system test.  Prevent this from happening by making all the root hints
consistent with authoritative data served by ns1.

(cherry picked from commit c19ebde14b)
2019-07-29 21:44:51 +02:00
Evan Hunt
cd288f14e2 Merge branch '1163-geoip-subtype-fix' into 'v9_14'
fix a bug that could cause an assert when configuring "geoip continent"

See merge request isc-projects/bind9!2200
2019-07-25 22:22:56 -04:00
Evan Hunt
c3a996d547 CHANGES 2019-07-25 22:06:19 -04:00
Evan Hunt
8f1cdaeed9 add a system test, confirming that named fails to reload without crashing 2019-07-25 16:53:01 -04:00
Evan Hunt
326349228a fix a bug that could cause an assert when configuring "geoip continent"
- incidentally fixed some typos in log messages
2019-07-25 15:55:00 -04:00
Ondřej Surý
fd5fc5b46a Merge branch 'ondrej/fix-LD_WRAP-Makefile-v9_14' into 'v9_14'
Fix the lib/dns/tests/Makefile.in to work without LD_WRAP

See merge request isc-projects/bind9!2189
2019-07-23 09:06:49 -04:00
Ondřej Surý
16610d5477 Fix the lib/dns/tests/Makefile.in to work without LD_WRAP
(cherry picked from commit b558346437)
2019-07-23 09:06:12 -04:00
Mark Andrews
b572a5a210 Merge branch '1136-named-checkconf-should-report-missing-dnstap-output-option-when-dnstap-option-is-set-v9_14' into 'v9_14'
Resolve "named-checkconf should report missing dnstap-output option when dnstap option is set"

See merge request isc-projects/bind9!2185
2019-07-23 07:22:13 -04:00
Mark Andrews
2524d76133 named-checkconf failed to report dnstap-output missing
from named.conf when dnstap was specified

(cherry picked from commit a4f38bec6a)
2019-07-23 21:09:34 +10:00
Ondřej Surý
2a2d512ca3 Merge branch 'u/fanf2/arm-rrset-order-random-v9_14' into 'v9_14'
doc/arm: correct default for rrset-order

See merge request isc-projects/bind9!2183
2019-07-22 18:26:56 -04:00
Tony Finch
448ec6acad doc/arm: correct default for rrset-order
(cherry picked from commit bded8af7b8)
2019-07-22 18:25:37 -04:00
Ondřej Surý
1298a2aa40 Merge branch '195-add-dnstap-builds-to-ci-v9_14' into 'v9_14'
Add dnstap builds to CI

See merge request isc-projects/bind9!2181
2019-07-22 18:09:23 -04:00
Michał Kępień
e1006e0a25 Add dnstap builds to CI
Ensure BIND with dnstap support enabled is being continuously tested by
adding --enable-dnstap to the ./configure invocation used for CentOS 7
and Debian sid builds in GitLab CI.

(cherry picked from commit 2bf44c6cd4)
2019-07-22 17:53:27 -04:00
Ondřej Surý
f6bc62e663 Merge branch 'each-fix-ld-wrap-test-v9_14' into 'v9_14'
Fix LD_WRAP test [v9_14]

See merge request isc-projects/bind9!2180
2019-07-22 17:33:56 -04:00
Evan Hunt
b8e6b68d88 Make the symbol wrapping work with dynamic linking
When the unit test is linked with dynamic libraries, the wrapping
doesn't occur, probably because it's different translation unit.

To workaround the issue, we provide thin wrappers with *real* symbol
names that just call the mocked functions.

(cherry picked from commit 839ed7894b)
2019-07-22 17:20:19 -04:00
Ondřej Surý
6ba4b02d67 Fix the configure.ac and Makefile.in to correctly test for --wrap
(cherry picked from commit 135519e59a)
2019-07-22 17:19:51 -04:00
Mark Andrews
97f1bff3cc Merge branch '1106-interaction-between-dns64-and-rpz-can-cause-unexpected-results-v9_14' into 'v9_14'
Resolve "Interaction between dns64 and RPZ can cause unexpected results"

See merge request isc-projects/bind9!2179
2019-07-22 15:31:10 -04:00
Mark Andrews
22471cc532 add CHANGES
(cherry picked from commit b9a1c31df1)
2019-07-23 05:11:47 +10:00
Mark Andrews
4e63bacc04 Do not attempt to perform a DNS64 rewrite if RPZ returns NODATA.
(cherry picked from commit 1eb640049c)
2019-07-23 05:10:41 +10:00
Mark Andrews
984f2cea47 Check that RPZ 'CNAME *.' (NODATA) works with DNS64.
(cherry picked from commit b9dc9b68cd)
2019-07-23 05:10:41 +10:00
Ondřej Surý
712d991b2a Merge branch 'michal/add-debian-buster-to-ci-v9_14' into 'v9_14'
Add Debian buster to CI

See merge request isc-projects/bind9!2176
2019-07-22 11:52:20 -04:00
Michał Kępień
d8a613b78d Add Debian buster to CI
Ensure BIND is continuously tested on Debian 10 (buster) as it is the
current stable Debian release.

(cherry picked from commit 5f71d9c6ac)
2019-07-22 11:26:31 -04:00
Ondřej Surý
1b85e20f03 Merge branch 'ondrej-disable-freebsd-again-v9_14' into 'v9_14'
Disable FreeBSD Runner in the CI; it's broken again.

See merge request isc-projects/bind9!2174
2019-07-22 08:08:09 -04:00
Ondřej Surý
b2401f0caa Disable FreeBSD Runner in the CI; it's broken again.
(cherry picked from commit 747736d361)
2019-07-22 08:07:12 -04:00
Ondřej Surý
01b76c373e Merge branch '605-add-siphash24-v9_14' into 'v9_14'
Resolve "Add SipHash24 and synchronize the Cookie algorithm with other vendors"

See merge request isc-projects/bind9!2170
2019-07-21 17:58:38 -04:00
Ondřej Surý
be0cd728c5 Add CHANGES note 2019-07-21 17:30:53 -04:00
Ondřej Surý
7d8e7b0194 Add release notes 2019-07-21 17:30:53 -04:00
Ondřej Surý
196b342bc9 Add new default siphash24 cookie algorithm
This commit changes the BIND cookie algorithms to match
draft-sury-toorop-dnsop-server-cookies-00.  Namely, it changes the Client Cookie
algorithm to use SipHash 2-4, adds the new Server Cookie algorithm using SipHash
2-4.  The change doesn't make the SipHash 2-4 to be the default algorithm, this
is up to the operator.
2019-07-21 17:30:53 -04:00
Michał Kępień
496397eb3f Make ifconfig.sh work on DragonFly BSD
On DragonFly BSD, use the same commands for configuring network
interfaces used during system tests as on NetBSD and OpenBSD.
2019-07-21 15:37:22 -04:00
Ondřej Surý
84ff6a6963 Revise the Windows section of <isc/endian.h>
Add a comment and remove redundant definitions.
2019-07-21 15:37:22 -04:00
Ondřej Surý
c727a31eab Revise the macOS section of <isc/endian.h>
Move the macOS section of <isc/endian.h> to a lower spot as it is
believed not to be the most popular platform for running BIND.  Add a
comment and remove redundant definitions.
2019-07-21 15:37:22 -04:00
Ondřej Surý
a98c7408fc Make <isc/endian.h> detect GNU rather than Linux
Instead of only supporting Linux, try making <isc/endian.h> support
other GNU platforms as well.  Since some compilers define __GNUC__ on
BSDs (e.g. Clang on FreeBSD), move the relevant section to the bottom of
the platform-specific part of <isc/endian.h>, so that it only gets
evaluated when more specific platform determination criteria are not
met.  Also include <byteswap.h> so that any byte-swapping macros which
may be defined in that file on older platforms are used in the fallback
definitions of the nonstandard hto[bl]e{16,32,64}() and
[bl]e{16,32,64}toh() conversion functions.
2019-07-21 15:37:22 -04:00
Ondřej Surý
5b0f81e549 Add Solaris support for <isc/endian.h>
While Solaris does not support the nonstandard hto[bl]e{16,32,64}() and
[bl]e{16,32,64}toh() conversion functions, it does have some
byte-swapping macros available in <sys/byteorder.h>.  Ensure these
macros are used in the fallback definitions of the aforementioned
nonstandard functions.
2019-07-21 15:37:22 -04:00