2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 21:47:59 +00:00

29831 Commits

Author SHA1 Message Date
Michał Kępień
fac23cf939 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.
2019-07-31 08:47:02 +02:00
Mark Andrews
7c210a2b3b Merge branch '1152-dig-expandaaaa-doesn-t-work-with-short' into 'master'
Resolve "dig +expandaaaa doesn't work with +short"

Closes #1152

See merge request isc-projects/bind9!2169
2019-07-30 21:40:49 -04:00
Mark Andrews
b791ab542b add CHANGES 2019-07-31 11:09:32 +10:00
Mark Andrews
9836d5bc17 check that dig +short +expandaaaa works 2019-07-30 21:05:56 -04:00
Mark Andrews
2a047af31e set DNS_STYLEFLAG_EXPANDAAAA flag in say_message if appropriate 2019-07-30 21:05:56 -04:00
Mark Andrews
6f8d363514 Merge branch '1133-your-problem-or-cygwin-s' into 'master'
Resolve "Your problem or Cygwin's ?????"

Closes #1133

See merge request isc-projects/bind9!2137
2019-07-30 20:58:36 -04:00
Mark Andrews
12d9681442 add CHANGES 2019-07-30 16:21:49 -07:00
Mark Andrews
91a0cb5da3 handle connect() returning ETIMEDOUT on a non-blocking socket 2019-07-30 16:21:49 -07:00
Michał Kępień
f30bdd1aac Merge branch '1171-alpine-linux-tweaks' into 'master'
Alpine Linux tweaks

Closes #1171

See merge request isc-projects/bind9!2204
2019-07-30 16:49:15 -04:00
Michał Kępień
326a334b49 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.
2019-07-30 21:25:18 +02:00
Michał Kępień
f4daf6e0e7 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.
2019-07-30 21:25:18 +02:00
Michał Kępień
bb9c1654e2 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.
2019-07-30 21:25:18 +02:00
Michał Kępień
b10d28d1e0 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.
2019-07-30 21:25:18 +02:00
Michał Kępień
266e3ed52a 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.
2019-07-30 21:25:18 +02:00
Michał Kępień
ad008f7dbf 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.
2019-07-30 21:25:18 +02:00
Michał Kępień
3384455659 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.
2019-07-30 21:25:18 +02:00
Michał Kępień
b5cd146033 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.
2019-07-30 21:25:18 +02:00
Michał Kępień
5381ac0fcc 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.
2019-07-30 21:25:15 +02:00
Michał Kępień
59528d0e9d 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.
2019-07-30 21:08:40 +02:00
Michał Kępień
03de34194d Merge branch 'michal/filter-aaaa-system-test-make-root-hints-consistent-with-authoritative-data' into 'master'
"filter-aaaa" system test: make root hints consistent with authoritative data

See merge request isc-projects/bind9!2057
2019-07-29 16:10:44 -04:00
Michał Kępień
c19ebde14b 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.
2019-07-29 21:44:31 +02:00
Evan Hunt
c14dc46319 Merge branch 'placeholder' into 'master'
placeholder

See merge request isc-projects/bind9!2202
2019-07-25 22:05:03 -04:00
Evan Hunt
78da483941 placeholder 2019-07-25 22:04:29 -04:00
Ondřej Surý
73e615fcfa Merge branch '1030-statistics-channel-improvements-generated-files' into 'master'
Regenerate bind9.xsl.h

Closes #1030

See merge request isc-projects/bind9!2201
2019-07-25 21:43:52 -04:00
Ondřej Surý
36bc018275 Regenerate bind9.xsl.h 2019-07-25 21:31:47 -04:00
Matthijs Mekking
e976db255f Merge branch 'matthijs-addzone-ignored-some-test-results' into 'master'
The 'addzone' test ignored some test results

See merge request isc-projects/bind9!2198
2019-07-25 11:03:40 -04:00
Matthijs Mekking
4b40266a1d The 'addzone' test ignored some test results 2019-07-25 16:30:20 +02:00
Ondřej Surý
8751585841 Merge branch '1030-statistics-channel-improvements' into 'master'
Statistics Channel Improvements

Closes #1030

See merge request isc-projects/bind9!1944
2019-07-25 08:22:32 -04:00
Mark Andrews
b8a96bfa78 add CHANGES 2019-07-25 08:03:10 -04:00
Mark Andrews
570d1cf0bb use h?+script selectors 2019-07-25 08:03:10 -04:00
Mark Andrews
e6c13ebb26 toggle graph/counter pairs 2019-07-25 08:03:10 -04:00
Mark Andrews
34ce90565c toggle graph/counter pairs 2019-07-25 08:03:10 -04:00
Timothe Litt
86595ed8cb Make statistics tables (in HTML view) togglable
The HTML view of the statistics channel creates
pages with many long tables.  These can be difficult
to navigate.

This commit adds a "show/hide" toggle to each
heading, which makes it easy to compress/expand
the view.
2019-07-25 08:03:10 -04:00
Ondřej Surý
d807ecde24 Merge branch 'ondrej/cleanup_isc_mem_get_failure_handling_blocks' into 'master'
Cleanup isc_mem_get() failure handling blocks

See merge request isc-projects/bind9!2155
2019-07-23 16:25:14 -04:00
Evan Hunt
a1871e7f1d further cleanup
- removed some dead code
- dns_zone_setdbtype is now void as it could no longer return
  anything but ISC_R_SUCCESS; calls to it no longer check for a result
- controlkeylist_fromconfig() is also now void
- fixed a whitespace error
2019-07-23 15:32:36 -04:00
Ondřej Surý
19eb5d0e83 Cleanup the failure handling in isc_mem_allocate 2019-07-23 15:32:36 -04:00
Ondřej Surý
9123da5362 Adjust tkey_test.c test to mock_assert() when there's no memory 2019-07-23 15:32:36 -04:00
Ondřej Surý
f0c6aef542 Cleanup stray goto labels from removing isc_mem_allocate/strdup checking blocks 2019-07-23 15:32:36 -04:00
Ondřej Surý
9bdc24a9fd Use coccinelle to cleanup the failure handling blocks from isc_mem_strdup 2019-07-23 15:32:36 -04:00
Ondřej Surý
601cb4e4cc Use coccinelle to cleanup the failure handling blocks from isc_mem_allocate 2019-07-23 15:32:35 -04:00
Ondřej Surý
3c1d4298af Add spatch for isc_mem_allocate; it also cannot fail gracefully 2019-07-23 15:32:35 -04:00
Ondřej Surý
49f244406c Add spatch for isc_mem_strdup; it also cannot fail gracefully 2019-07-23 15:32:35 -04:00
Ondřej Surý
ae83801e2b Remove blocks checking whether isc_mem_get() failed using the coccinelle 2019-07-23 15:32:35 -04:00
Ondřej Surý
f63e696967 Add semantic patch to remove checking for isc_mem_get() return value
The isc_mem_get() cannot fail gracefully now, it either gets memory of
assert()s.  The added semantic patch cleans all the blocks checking whether
the return value of isc_mem_get() was NULL.
2019-07-23 15:32:35 -04:00
Ondřej Surý
7f828a213c Revert to patch generating check-cocci script
The coccinelle and util/update_copyright script have different
idea about how the whitespace should look like.  Revert the script
to the previous version, so it doesn't mangle the files in place,
and deal with just whitespace changes.
2019-07-23 15:32:35 -04:00
Ondřej Surý
3bcd05f081 Merge branch 'ondrej/disable-LD_WRAP-without-libtool' into 'master'
Disable LD_WRAP tests when libtool is disabled

See merge request isc-projects/bind9!2192
2019-07-23 12:02:03 -04:00
Ondřej Surý
0cd1e5ed28 Disable LD_WRAP tests when libtool is disabled 2019-07-23 11:49:21 -04:00
Ondřej Surý
14a4a799c0 Merge branch 'ondrej/fix-LD_WRAP-Makefile' into 'master'
Fix the lib/dns/tests/Makefile.in to work without LD_WRAP

See merge request isc-projects/bind9!2188
2019-07-23 09:05:36 -04:00
Ondřej Surý
b558346437 Fix the lib/dns/tests/Makefile.in to work without LD_WRAP 2019-07-23 08:59:36 -04:00
Ondřej Surý
14d10521ba Merge branch '1149-restore-locking-in-resume_dslookup' into 'master'
Restore locking in resume_dslookup()

Closes #1149

See merge request isc-projects/bind9!2184
2019-07-23 07:02:44 -04:00