Commit graph

1065 commits

Author SHA1 Message Date
Michal Nowak
d92b9a02b1
Teach configure to find Python 3.9, 3.10, and 3.11
FreeBSD does not have python3 symlink, and ./configure relies on finding
python3.X binaries instead.
2022-08-15 15:11:27 +02:00
Tinderbox User
0842c032fd prep 9.16.30 2022-06-02 19:30:41 +00:00
Ondřej Surý
b9e5b319db Use libuv CFLAGS and LIBS when checking for features
When autoconf was checking for libuv features, the LIBUV_CFLAGS was not
added to CFLAGS and LIBUV_LIBS to LIBS which resulted in false
negatives.

Use AX_SAVE_FLAGS and AX_RESTORE_FLAGS to temporarily add LIBUV_CFLAGS
and LIBUV_LIBS to their respective variables.

(cherry picked from commit f063ee276e)
2022-05-18 21:18:51 +02:00
Mark Andrews
ea54e39cdb Remove extraneous '$' in AS_VAR_COPY([MAXMINDDB_PREFIX], [with_maxminddb])
(cherry picked from commit 686d691fa9)
2022-05-18 05:38:46 +10:00
Michał Kępień
1f4667061f Use setuptools instead of distutils if possible
According to PEP 632 [1], the distutils module is considered deprecated
in Python 3.10 and will be removed in Python 3.12.  Setup scripts
using it should be migrated to the setuptools module, which contains
drop-in replacements for distutils functions [2].  The catch is that the
setuptools module is not part of the Python Standard Library.

While this problem could be addressed by adding a hard dependency on
setuptools, it only affects BIND 9.16, which is an Extended Support
Version.  To avoid unnecessary disruptions, try importing setup() from
the setuptools module and fall back to using distutils if that fails.
Add a PyLint suppression for this specific "deprecated-module" warning.

Since the setuptools module is not part of the Python Standard Library
and therefore it is not guaranteed that it is universally available in
every Python installation, update Python-related checks in configure.ac
to ensure Python module installation does not silently fail.

[1] https://peps.python.org/pep-0632/
[2] https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
2022-04-22 12:36:57 +02:00
Ondřej Surý
2c86bd4ed9 Remove debugging implementation of stdatomic using mutexes
Upcoming LLVM/Clang 15 has marked the ATOMIC_VAR_INIT() as deprecated
breaking the build.  In the previous commit, we have removed the use of
ATOMIC_VAR_INIT(), but as that was a prerequisite to using the
--enable-mutexatomic debugging mode, we have to remove the debugging
mode.
2022-03-17 21:44:04 +01:00
Tinderbox User
05e2e8c98b prep 9.16.27 2022-03-17 00:19:11 +01:00
Aram Sargsyan
73e660a806 Use autoconf check for BN_GENCB_new()
BIND unconditionally uses shims for BN_GENCB_new(), BN_GENCB_free(),
and BN_GENCB_get_arg() for all LibreSSL versions and, correctly, for
OpenSSL <1.1.0 versions.

This breaks LibreSSL compilation starting with LibreSSL 3.5.0.

Use autoconf check instead to check whether the family of the functions
are available.

(cherry picked from commit 749973f3259b7638a6af02b7da2f40ae28bdd402)
2022-03-02 09:34:29 +00:00
Ondřej Surý
13cc8e3109 Change the bug reporting address from email to gitlab URI
In autoconf, the AC_INIT() accepts bugreport address for reporting
issues (f.e. when the test suite fails).  Instead of providing generic
emails address, change this to the address where to report with the
default Bug template applied.

(cherry picked from commit bb60622250)
2022-02-11 08:55:17 +01:00
Ondřej Surý
ad5869ac6c Remove unused functions from isc_thread API
The isc_thread_setaffinity call was removed in !5265 and we are not
going to restore it because it was proven that the performance is better
without it.  Additionally, remove the already disabled cpu system test.

The isc_thread_setconcurrency function is unused and also calling
pthread_setconcurrency() on Linux has no meaning, formerly it was
added because of Solaris in 2001 and it was removed when taskmgr was
refactored to run on top of netmgr in !4918.

(cherry picked from commit 0500345513)
2022-02-09 18:09:48 +01:00
Ondřej Surý
7df5065c75 Use UTC datetime for reproducible builds
For reproducible builds, we use last modification time of the CHANGES
file.  This works pretty well, unless the builds are made in different
timezones.

Use UTC option to date command to make the builds reproducible.
2022-01-24 16:24:36 +01:00
Tinderbox User
4e0d55cdcd prep 9.16.25 2022-01-20 11:37:08 +01:00
Ondrej Sury
04eeb67d97 Instead of detecting MUSL libc, detect padding in struct msghdr
The detection of MUSL libc via autoconf $host turned out to be
not reliable.

Convert the autoconf check from $host detection to actually detect
the padding used in the struct msghdr.
2022-01-13 23:05:38 +01:00
Ondrej Sury
de8dbcbfbc Disable udp recvmmsg support on systems with MUSL libc
The Linux kernel diverts from the POSIX specification for two members of
struct msghdr making them size_t sized (instead of int and socklen_t).
In glibc, the developers have decided to use that.  However, the MUSL
developers used padding for the struct and kept the members defined
according to the POSIX.

This creates a problem, because libuv doesn't use recvmmsg() library
call where the padding members are correctly zeroed and instead calls
the syscall directly, the struct msghdr is passed to the kernel with
enormous values in those two members (because of the random junk in the
padding members) and the syscall thus fail with EMSGSIZE.

Disable udp recvmmsg support on systems with MUSL libc until the libuv
starts zeroing the struct msghdr before passing it to the syscall.

(cherry picked from commit 287ea095f1)
2022-01-13 21:39:57 +01:00
Ondřej Surý
5b02f5a8a0 Fix the UDP recvmmsg support
Previously, the netmgr/udp.c tried to detect the recvmmsg detection in
libuv with #ifdef UV_UDP_<foo> preprocessor macros.  However, because
the UV_UDP_<foo> are not preprocessor macros, but enum members, the
detection didn't work.  Because the detection didn't work, the code
didn't have access to the information when we received the final chunk
of the recvmmsg and tried to free the uvbuf every time.  Fortunately,
the isc__nm_free_uvbuf() had a kludge that detected attempt to free in
the middle of the receive buffer, so the code worked.

However, libuv 1.37.0 changed the way the recvmmsg was enabled from
implicit to explicit, and we checked for yet another enum member
presence with preprocessor macro, so in fact libuv recvmmsg support was
never enabled with libuv >= 1.37.0.

This commit changes to the preprocessor macros to autoconf checks for
declaration, so the detection now works again.  On top of that, it's now
possible to cleanup the alloc_cb and free_uvbuf functions because now,
the information whether we can or cannot free the buffer is available to
us.

(cherry picked from commit 7370725008)
2022-01-13 21:38:43 +01:00
Ondřej Surý
2bf7921c7e Update the copyright information in all files in the repository
This commit converts the license handling to adhere to the REUSE
specification.  It specifically:

1. Adds used licnses to LICENSES/ directory

2. Add "isc" template for adding the copyright boilerplate

3. Changes all source files to include copyright and SPDX license
   header, this includes all the C sources, documentation, zone files,
   configuration files.  There are notes in the doc/dev/copyrights file
   on how to add correct headers to the new files.

4. Handle the rest that can't be modified via .reuse/dep5 file.  The
   binary (or otherwise unmodifiable) files could have license places
   next to them in <foo>.license file, but this would lead to cluttered
   repository and most of the files handled in the .reuse/dep5 file are
   system test files.

(cherry picked from commit 58bd26b6cf)
2022-01-11 12:22:09 +01:00
Michal Nowak
f145b884a4
Make bullseye the base image
"buster" jobs are now only going to be run in scheduled pipelines.

"--without-gssapi" ./configure option of "bullseye" before it became
the base image is dropped from "bullseye"-the-base-image because it
reduces gcov coverage by 0.38 % (651 lines) and is used in Debian 9
"stretch".

(cherry picked from commit 910d595fbc)
2021-12-23 15:45:36 +01:00
Matthijs Mekking
8dd2038f13 Regenerate configure file
Commit 3c77a51f added a configure check for OPENSSL_cleanup. The
regenerated configure file should have been added to that commit.
2021-12-09 17:03:31 +01:00
Mark Andrews
91052ae29e Suppress OpenSSL deprecated warnings from OpensSSL 3.0.0
We are not back porting OpenSSL 3.0.0 fixes to this branch so there
is no point in emitting warnings about using deprecated code.
Additionally this impacts --enable-developer and --enable-warn-error.
2021-11-26 12:54:21 +00:00
Tinderbox User
274aae0cc7 prep 9.16.23 2021-11-18 09:19:02 +01:00
Mark Andrews
de801a5063 Look for xsltproc
xsltproc is used by the statistics system test
2021-10-30 10:24:45 +11:00
Ondřej Surý
36f97713a1 Use correct compiler version flag in the autoconf script
The autoconf script prints used compiler version at the end of the
configure script.  Solaris native compiler doesn't support --version,
and -V has to be used which in turn isn't supported by Gcc/Clang.
Detect which version flag has to be used and call $CC with it.

(cherry picked from commit 7eb208005f)
2021-10-18 15:27:18 +02:00
Ondřej Surý
38244fdf88 Add python3.8 to the autoconf search list
It was discovered that FreeBSD doesn't setup alias from default
Python version neither to python3 nor python, and thus the configure
step would fail to find working python installation.
2021-09-22 10:24:16 +02:00
Ondřej Surý
df7646785e Fix has->have typo in DLZ drivers deprecation message
We fixed the CHANGES and release notes and missed this one.
2021-09-22 09:37:04 +02:00
Ondřej Surý
c3b3dd3229 Add deprecation warning about DLZ drivers
DLZ drivers are going to be removed from the next major BIND 9 release,
this commit adds a deprecation warning to inform the users about the
need to migrate to DLZ modules.
2021-09-21 10:44:41 +02:00
Ondřej Surý
c3546531f7 Call krb5-config with just one argument at the time
The autoconf script would call the krb5-config with both gssapi and krb5
libraries as arguments in a single call.  It turned out that this is
actually not supported and it breaks some platforms.  This commit splits
the call into two separate calls - one for gssapi and one for krb5
library.
2021-09-14 20:58:22 +02:00
Ondřej Surý
6cf86cc75b Add deprecation notice about --enable-native-pkcs11 to configure.ac
The native PKCS#11 feature has been removed in BIND 9.18, so we need to
add a deprecation notice (warning at ./configure time) to the next 9.16
release.
2021-09-09 22:35:03 +02:00
Matthijs Mekking
514eccf730 Move checkds system test to checkdstool
There is a checkds system test in v9_16 that does not exist in the
main branch. This existing checkds system test checks the behaviour of
the dnssec-checkds tool. Before backporting the new checkds system
test, that tests the feature where BIND checks periodically the
parental agents if the DS for a given KSK has been published, move the
existing checkds system test to checkdstool.
2021-07-01 14:48:23 +02:00
Tinderbox User
13b9f23cce prep 9.16.17 2021-06-16 22:29:27 +02:00
Ondřej Surý
ce0083474e Cleanup the remaining of HAVE_UV_<func> macros
While cleaning up the usage of HAVE_UV_<func> macros, we forgot to
cleanup the HAVE_UV_UDP_CONNECT in the actual code and
HAVE_UV_TRANSLATE_SYS_ERROR and this was causing Windows build to fail
on uv_udp_send() because the socket was already connected and we were
falsely assuming that it was not.

The platforms with autoconf support were not affected, because we were
still checking for the functions from the configure.

(cherry picked from commit 67afea6cfc)
2021-06-02 12:01:29 +02:00
Ondřej Surý
4db28d79b1 Add uv_os_getenv() and uv_os_setenv() compatibility shims
The uv_os_getenv() and uv_os_setenv() functions were introduced in the
libuv >= 1.12.0.  Add simple compatibility shims for older versions.

(cherry picked from commit 7477d1b2ed)
2021-05-31 16:57:19 +02:00
Ondřej Surý
0ce462ab8e Add uv_req_get_data() and uv_req_set_data() compatibility shims
The uv_req_get_data() and uv_req_set_data() functions were introduced in
libuv >= 1.19.0, so we need to add compatibility shims with older libuv
versions.

(cherry picked from commit f752840db3)
2021-05-31 16:57:19 +02:00
Ondřej Surý
68cb38fc60 Cleanup the uv_import check
The uv_import() is not needed anymore, so we can remove the autoconf
check for it.

(cherry picked from commit 7b02848865)
2021-05-31 16:57:19 +02:00
Diego Fronza
4ed22937d8 Add malloc attribute to memory allocation functions
The malloc attribute allows compiler to do some optmizations on
functions that behave like malloc/calloc, like assuming that the
returned pointer do not alias other pointers.
2021-05-27 15:42:36 +02:00
Michal Nowak
cfb8cf5294
Add py.test to the list of tested pytest names
OpenBSD changed the name of the pytest script from py.test-3 in OpenBSD
6.8 to py.test in OpenBSD 6.9.

The py.test-3 name which was added in d5562a3e for the sake of OpenBSD
and CentOS is still required for CentOS.

(cherry picked from commit 510b4b70e9)
2021-05-17 11:28:31 +02:00
Ondřej Surý
4d027ab945 Remove TLSDNS, TLS and HTTP protocols from netmgr
For further stabilization of the 9.16 branch, we are removing the unused
protocols from the netmgr.
2021-05-14 12:52:48 +02:00
Evan Hunt
ef1d909fa9 backport of netmgr/taskmgr to 9.16
this rolls up numerous changes that have been applied to the
main branch, including moving isc_task operations into the
netmgr event loops, and other general stabilization.
2021-05-14 12:52:48 +02:00
Michał Kępień
41d18279e4 Regenerate configure 2021-04-29 11:39:56 +02:00
Tinderbox User
b0f44204fa prep 9.16.15 2021-04-29 11:12:38 +02:00
Tinderbox User
4999118246 prep 9.16.14 2021-04-29 11:12:38 +02:00
Evan Hunt
28511bfcfd move samples/resolve.c to bin/tests/system
"resolve" is used by the resolver system tests, and I'm not
certain whether delv exercises the same code, so rather than
remove it, I moved it to bin/tests/system.

(cherry picked from commit d0ec7d1f33)
2021-04-19 14:32:53 +02:00
Mark Andrews
6b0b0c6aba Request krb5 CFLAGS and LIBS from $KRB5_CONFIG
The GSSAPI now needs both gssapi and krb5 libraries, so we need to
request both CFLAGS and LIBS from the configure script.
2021-04-01 10:42:32 +02:00
Mark Andrews
a875dcc669 Remove custom ISC SPNEGO implementation
The custom ISC SPNEGO mechanism implementation is no longer needed on
the basis that all major Kerberos 5/GSSAPI (mit-krb5, heimdal and
Windows) implementations support SPNEGO mechanism since 2006.

This commit removes the custom ISC SPNEGO implementation, and removes
the option from both autoconf and win32 Configure script.  Unknown
options are being ignored, so this doesn't require any special handling.
2021-04-01 10:42:32 +02:00
Ondřej Surý
2f0f531ee8 Use library constructor/destructor to initialize OpenSSL
Instead of calling isc_tls_initialize()/isc_tls_destroy() explicitly use
gcc/clang attributes on POSIX and DLLMain on Windows to initialize and
shutdown OpenSSL library.

This resolves the issue when isc_nm_create() / isc_nm_destroy() was
called multiple times and it would call OpenSSL library destructors from
isc_nm_destroy().

At the same time, since we now have introduced the ctor/dtor for libisc,
this commit moves the isc_mem API initialization (the list of the
contexts) and changes the isc_mem_checkdestroyed() to schedule the
checking of memory context on library unload instead of executing the
code immediately.
2021-02-26 17:18:06 +01:00
Ondřej Surý
effe3ee595 Refactor TLSDNS module to work with libuv/ssl directly
* Following the example set in 634bdfb16d, the tlsdns netmgr
  module now uses libuv and SSL primitives directly, rather than
  opening a TLS socket which opens a TCP socket, as the previous
  model was difficult to debug.  Closes #2335.

* Remove the netmgr tls layer (we will have to re-add it for DoH)

* Add isc_tls API to wrap the OpenSSL SSL_CTX object into libisc
  library; move the OpenSSL initialization/deinitialization from dstapi
  needed for OpenSSL 1.0.x to the isc_tls_{initialize,destroy}()

* Add couple of new shims needed for OpenSSL 1.0.x

* When LibreSSL is used, require at least version 2.7.0 that
  has the best OpenSSL 1.1.x compatibility and auto init/deinit

* Enforce OpenSSL 1.1.x usage on Windows

(cherry picked from commit e493e04c0f)
2021-02-26 16:14:50 +01:00
Michal Nowak
04aff208fb
Use BIND 9.17 preprocessor macro to skip unit test
BIND 9.17 changed exit code of skipped test to meet Automake
expectations in fa505bfb0e. BIND 9.16 was
not rewritten to Automake, but for consistency reasons, the same
SKIPPED_TEST_EXIT_CODE preprocessor macro is used (though the actual
exit code differs from the one in BIND 9.17).

(cherry picked from commit fa505bfb0e)
2021-02-17 12:09:25 +01:00
Ondřej Surý
0e25af628c Use -release instead of -version-info for internal library SONAMEs
The BIND 9 libraries are considered to be internal only and hence the
API and ABI changes a lot.  Keeping track of the API/ABI changes takes
time and it's a complicated matter as the safest way to make everything
stable would be to bump any library in the dependency chain as in theory
if libns links with libdns, and a binary links with both, and we bump
the libdns SOVERSION, but not the libns SOVERSION, the old libns might
be loaded by binary pulling old libdns together with new libdns loaded
by the binary.  The situation gets even more complicated with loading
the plugins that have been compiled with few versions old BIND 9
libraries and then dynamically loaded into the named.

We are picking the safest option possible and usable for internal
libraries - instead of using -version-info that has only a weak link to
BIND 9 version number, we are using -release libtool option that will
embed the corresponding BIND 9 version number into the library name.

That means that instead of libisc.so.1608 (as an example) the library
will now be named libisc-9.16.10.so.

(cherry picked from commit c605d75ea5)
2021-01-25 15:28:09 +01:00
Tinderbox User
536bc1163a prep 9.16.11 2021-01-21 09:11:54 +01:00
Mark Andrews
cafb021b2a Fix 'configure --with-maxminddb=<path>' 2021-01-06 17:53:10 +11:00
Witold Kręcicki
012946eadc autoconf: link with libssl
This is prerequisite to adding DoT and DoH support to BIND 9.
2020-12-09 10:46:16 +01:00