Commit Graph
27715 Commits
Author SHA1 Message Date
Michał Kępień 678a631f54 Implement a convenience function for "rndc dumpdb"
Add a helper shell function, rndc_dumpdb(), which provides a convenient
way to call "rndc dumpdb" for a given server with optional additional
arguments.  Since database dumping is an asynchronous process, the
function waits until the dump is complete before returning, which
prevents false positives in system tests caused by inspecting the dump
before its preparation is finished.  The function also renames the dump
file before returning so that it does not get overwritten by subsequent
calls; this retains forensic data in case of an unexpected test failure.

(cherry picked from commit ab78e350dd)
2019-08-08 15:12:12 +02:00
Ondřej Surý 32232caaa4 Merge branch '1182-add-older-autoconf-pkg-config-compat-macros-v9_11' into 'v9_11'
Add PKG_CHECK_VAR and AS_VAR_COPY compat macros (Courtesy of ycflash)

See merge request isc-projects/bind9!2248
2019-08-08 09:09:42 -04:00
Ondřej Surý 8cdc9c28b9 Add PKG_CHECK_VAR and AS_VAR_COPY compat macros (Courtesy of ycflash)
(cherry picked from commit d80b6ec879)
2019-08-08 14:58:03 +02:00
Evan Hunt ee5f5b186d Merge branch 'each-mdig-multi-norrcomments-v9_11' into 'v9_11'
minor bugfix in mdig: when using +multi, +norrcomments was ignored

See merge request isc-projects/bind9!2241
2019-08-08 00:19:05 -04:00
Evan Hunt 529a81217b added "mdig +multi +norrcomment" test; also fixed the flawed dig test
(cherry picked from commit 93ad3eea90)
2019-08-07 21:05:53 -07:00
Evan Hunt 3562b0003f minor bugfix in mdig: when using +multi, +norrcomments was ignored
(cherry picked from commit edab51b420)
2019-08-07 20:55:14 -07:00
Ondřej Surý e3903e8396 Merge branch '1148-deadlock-hangs-named-v9_11' into 'v9_11'
Convert (dns_view_t){ .weakrefs } to isc_refcount_t

See merge request isc-projects/bind9!2227
2019-08-07 05:46:45 -04:00
Ondřej Surý e80c4c3431 Have the dns_client hold a .references until all external references are removed
so that cleanup can all be done in dns_client_destroy().
2019-08-07 11:35:06 +02:00
Mark AndrewsandOndřej Surý be8af3afb7 Have the view hold a weakref until all external references are removed
so that cleanup can all be done in dns_view_weakattach().
2019-08-06 17:18:48 +02:00
Ondřej Surý 6353032a8a lib/isc/app_api.c: Protect the global is_running bool variable with a mutex 2019-08-06 15:03:35 +02:00
Ondřej Surý a7c9a52c89 lib/dns/resolver.c: Convert (dns_view_t *)->weakrefs to isc_refcount_t
There's a deadlock in BIND 9 code where (dns_view_t){ .lock } and
(dns_resolver_t){ .buckets[i].lock } gets locked in different order.  When
view->weakrefs gets converted to a reference counting we can reduce the locking
in dns_view_weakdetach only to cases where it's the last instance of the
dns_view_t object.
2019-08-06 15:03:35 +02:00
Evan Hunt 18f56f1e3d Merge branch '1170-dig-comments-v9_11' into 'v9_11'
Resolve "dig +nocomment still comments"

See merge request isc-projects/bind9!2232
2019-08-06 01:11:52 -04:00
Evan Hunt c6694fa017 clarify descriptions of comment-related options in dig usage and man page
(cherry picked from commit 9679c8c20a)
2019-08-05 21:58:40 -07:00
Evan Hunt 67b153ac8a always check 'printcmd' before printing cmdline message
(cherry picked from commit 6d50f7d924)
2019-08-05 21:57:40 -07:00
Mark Andrews 1955a63216 Merge branch '964-use-referral-ds-record-when-validating-v9_11' into 'v9_11'
Resolve "Use referral DS record when validating"

See merge request isc-projects/bind9!2229
2019-08-02 03:04:43 -04:00
Mark Andrews d83241a3b3 add CHANGES
(cherry picked from commit ac28cc14e1)
2019-08-02 16:52:57 +10:00
Mark Andrews 153512960b check that example/DS is not fetched when validating a.example
(cherry picked from commit 4293a2f4bf)
2019-08-02 16:52:57 +10:00
Mark Andrews cfbefb57d6 Store the DS and RRSIG(DS) with trust dns_trust_pending_answer
so that the validator can validate the records as part of validating
the current request.

(cherry picked from commit 57a328d67e)
2019-08-02 16:52:57 +10:00
Mark Andrews 74c39de667 Merge branch '1159-bits-65-72-of-the-dns64-prefix-are-supposed-to-be-zero-v9_11' into 'v9_11'
Resolve "Bits 64..71 of the dns64 prefix are supposed to be zero"

See merge request isc-projects/bind9!2221
2019-07-31 08:59:59 -04:00
Mark Andrews 2fc1234b4c add CHANGES
(cherry picked from commit d95ae93dd3)
2019-07-31 22:45:02 +10:00
Mark Andrews 30f5a99364 check that bits 64..71 in a dns64 prefix are zero
(cherry picked from commit a7ec7eb6ed)
2019-07-31 22:45:02 +10:00
Michał Kępień e74ec0627f Merge branch 'michal/wildcard-system-test-make-root-hints-consistent-with-authoritative-data-v9_11' into 'v9_11'
[v9_11] "wildcard" system test: make root hints consistent with authoritative data

See merge request isc-projects/bind9!2218
2019-07-31 05:43:19 -04:00
Michał Kępień 6987363936 Make root hints consistent with authoritative data
Multiple resolvers in the "wildcard" system test are configured with a
single root hint: "ns.root-servers.nil", pointing to 10.53.0.1, which is
inconsistent with authoritative data served by ns1.  This may cause
intermittent resolution failures, triggering false positives for the
"wildcard" system test.  Prevent this from happening by making ns2, ns3,
and ns5 use root hints corresponding to the contents of ns1/root.db.in.

(cherry picked from commit dd430c3093)
2019-07-31 11:07:47 +02:00
Michał Kępień 1d9ec9e386 Merge branch 'michal/staticstub-system-test-make-root-hints-consistent-with-authoritative-data-v9_11' into 'v9_11'
[v9_11] "staticstub" system test: make root hints consistent with authoritative data

See merge request isc-projects/bind9!2216
2019-07-31 03:42:42 -04:00
Michał Kępień 9829962c81 Make root hints consistent with authoritative data
The ns2 named instance in the "staticstub" system test is configured
with a single root hint commonly used in BIND system tests
(a.root-servers.nil with an address of 10.53.0.1), which is inconsistent
with authoritative data served by ns1.  This may cause intermittent
resolution failures, triggering false positives for the "staticstub"
system test.  Prevent this from happening by making ns1 serve data
corresponding to the contents of bin/tests/system/common/root.hint.

(cherry picked from commit 4b5e1da0e3)
2019-07-31 09:18:24 +02:00
Michał Kępień ca21075c45 Merge branch 'michal/update-gitlab-ci-to-fedora-30-v9_11' into 'v9_11'
[v9_11] Update GitLab CI to Fedora 30

See merge request isc-projects/bind9!2214
2019-07-31 03:14:29 -04:00
Michał Kępień b61899f031 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:48:04 +02:00
Mark Andrews 3798c6451c Merge branch '1133-your-problem-or-cygwin-s-v9_11' into 'v9_11'
Resolve "Your problem or Cygwin's ?????"

See merge request isc-projects/bind9!2212
2019-07-30 21:18:07 -04:00
Mark Andrews 0ef5b2852b add CHANGES
(cherry picked from commit 12d9681442)
2019-07-31 11:04:22 +10:00
Mark Andrews 75d89f023a handle connect() returning ETIMEDOUT on a non-blocking socket
(cherry picked from commit 91a0cb5da3)
2019-07-31 11:03:56 +10:00
Michał Kępień 70ae7129e9 Merge branch '1171-alpine-linux-tweaks-v9_11' into 'v9_11'
[v9_11] Alpine Linux tweaks

See merge request isc-projects/bind9!2210
2019-07-30 16:49:17 -04:00
Michał Kępień 2efc475a2f 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 22:22:28 +02:00
Michał Kępień 28c89c37b0 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 22:22:28 +02:00
Michał Kępień 1546298005 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 22:22:28 +02:00
Michał Kępień 2ce4f23bc0 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 22:22:28 +02:00
Michał Kępień 566f76b1fe 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 22:22:28 +02:00
Michał Kępień 4e266a810e 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 22:22:28 +02:00
Michał Kępień 3098c79270 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 22:22:28 +02:00
Michał Kępień eb13d4b279 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 22:22:28 +02:00
Michał Kępień 5e9ac86c2b 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 22:22:27 +02:00
Michał Kępień b911bfaaf2 Merge branch 'michal/filter-aaaa-system-test-make-root-hints-consistent-with-authoritative-data-v9_11' into 'v9_11'
[v9_11] "filter-aaaa" system test: make root hints consistent with authoritative data

See merge request isc-projects/bind9!2206
2019-07-29 16:10:47 -04:00
Michał Kępień 6563ee9c7d 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:45:06 +02:00
Evan Hunt b96796bbf1 Merge branch '1163-geoip-subtype-fix-v9_11' into 'v9_11'
fix a bug that could cause an assert when configuring "geoip continent"

See merge request isc-projects/bind9!2203
2019-07-28 16:30:03 -04:00
Evan Hunt 48447be09a CHANGES
(cherry picked from commit c3a996d547)
2019-07-28 13:16:35 -07:00
Evan Hunt 661ea29ecb add a system test, confirming that named fails to reload without crashing
(cherry picked from commit 8f1cdaeed9)
2019-07-28 13:16:29 -07:00
Evan Hunt 2a80d4e277 fix a bug that could cause an assert when configuring "geoip continent"
- incidentally fixed some typos in log messages

(cherry picked from commit 326349228a)
2019-07-25 22:52:18 -04:00
Mark Andrews 6637b947e0 Merge branch '1106-interaction-between-dns64-and-rpz-can-cause-unexpected-results-v9_11' into 'v9_11'
Resolve "Interaction between dns64 and RPZ can cause unexpected results"

See merge request isc-projects/bind9!2197
2019-07-24 17:41:45 -04:00
Mark Andrews d1f69ba757 add CHANGES
(cherry picked from commit b9a1c31df1)
2019-07-25 07:26:35 +10:00
Mark Andrews de153f1a43 Do not attempt to perform a DNS64 rewrite if RPZ returns NODATA.
(cherry picked from commit 1eb640049c)
2019-07-25 07:26:35 +10:00
Mark Andrews 00920b3a9b Check that RPZ 'CNAME *.' (NODATA) works with DNS64.
(cherry picked from commit b9dc9b68cd)
2019-07-25 07:26:35 +10:00