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

130 Commits

Author SHA1 Message Date
Ondřej Surý
21d751dfc7 Remove OpenSSL based SipHash 2-4 implementation
Creation of EVP_MD_CTX and EVP_PKEY is quite expensive, so until we fix the code
to reuse the OpenSSL contexts and keys we'll use our own implementation of
siphash instead of trying to integrate with OpenSSL.
2020-07-21 08:44:26 +02:00
Michał Kępień
fc6d0a932b Update BIND version to 9.17.3 2020-07-15 22:54:13 +02:00
Michał Kępień
a7982d14dd Fix libtool initialization
The LT_INIT() call in configure.ac is effectively a no-op because it is
preceded by a call to AC_PROG_LIBTOOL(), which is the previous name of
LT_INIT() used in older libtool versions.  Replace AC_PROG_LIBTOOL()
with AC_PATH_PROG() to look for libtool in PATH without initializing it,
which is the originally intended behavior.

Without this change, --enable-static is used by default, which causes a
plain ./configure invocation to fail because static linking is now
disallowed.  Drop --disable-static from the ./configure invocations used
in GitLab CI to test this scenario continuously.
2020-06-24 10:07:57 +02:00
Ondřej Surý
a7bed56845 Disable and disallow static linking
Linking BIND 9 programs and libraries statically disables several
important features:

  * dlopen() - relied on by dynamic loading of modules, dlz, and dyndb,

  * RELRO (read-only relocations) and ASLR (address space layout
    randomization) - security features which are important for any
    program interacting with the network and/or user input.

Disable and disallow linking BIND 9 binaries statically, thus enforcing
dlopen() support and allowing use of RELRO and ASLR by default.
2020-06-23 15:16:02 +02:00
Michal Nowak
c76c826fdb
Do not create gzip tarball
'make dist' does not need to create gzip tarball as we always ship the
XZ one.
2020-06-22 21:04:18 +02:00
Ondřej Surý
7ff77bb676 Enable maintainer mode by default only when building from git
When maintainer mode is enabled (./configure --enable-maintainer-mode)
it enables rebuild of documentation source files that require extra
tools to be installed or compiled.  For a convenience, those files are
already committed into the repository and their rebuild is not required
to build BIND 9 from sources.
2020-06-22 14:26:07 +02:00
Michał Kępień
3c213f96f3 Update BIND version to 9.17.2 2020-06-18 10:03:18 +02:00
Michał Kępień
ed212e9c63 Revise "srcid" file handling
The "srcid" file present in each BIND source tarball contains a
shortened hash of the Git commit corresponding to a given BIND release.
This allows a Git reference to be included in an archive that otherwise
lacks any Git information.

Before the move to Automake, if an "srcid" file was present in the root
source directory at the time ./configure was run, its contents were used
as the value of a compile-time constant which was then baked into BIND
binaries; otherwise, "git rev-parse" was used to determine the value of
that constant.

With Automake, a similar approach was attempted that required the
"srcid" file to be present at autoreconf time in order for it to be
used.  However, note that this means that even if that file is present
in a source tarball created using "make dist", its contents are not
going to influence the value of the aforementioned compile-time constant
because autoreconf hardcodes the output of "git rev-parse" into the
configure script at autoreconf time.

To make things more clear, always use "git rev-parse" for determining
the value of the PACKAGE_SRCID compile-time constant when running
autoreconf.  This causes "srcid" to be an empty string in source
tarballs built from other source tarballs, but that is not deemed to be
much of an issue as "make dist" is expected to be run from Git
repository clones.  Remove stderr redirections to /dev/null to ensure
errors caused e.g. by running "make dist" from outside a Git repository
clone are not hidden.  Trim the Git commit hash to 7 characters for
consistency between Unix and Windows systems.

Despite the above, ensure the "srcid" file is present in source tarballs
created using "make dist" as that file is used by the build process on
Windows.
2020-06-09 14:47:06 +02:00
Michal Nowak
5bbc6dd7f1 Fix "make dist"
Make various adjustments necessary to enable "make dist" to build a BIND
source tarball whose contents are complete enough to build binaries, run
unit & system tests, and generate documentation on Unix systems.

Known outstanding issues:

  - "make distcheck" does not work yet.
  - Tests do not work for out-of-tree source-tarball-based builds.
  - Source tarballs are not complete enough for building on Windows.

All of the above will be addressed in due course.
2020-06-05 13:19:49 +02:00
Ondřej Surý
bf60e445ed Stop using AC_C_FLEXIBLE_ARRAY_MEMBER, support for it is part of C99 2020-05-28 11:28:44 +02:00
Evan Hunt
249184e03e add a quick-and-dirty method of debugging a single query
when built with "configure --enable-singletrace", named will produce
detailed query logging at the highest debug level for any query with
query ID zero.

this enables monitoring of the progress of a single query by specifying
the QID using "dig +qid=0". the "client" logging category should be set
to a low severity level to suppress logging of other queries. (the
chance of another query using QID=0 at the same time is only 1 in 2^16.)

"--enable-singletrace" turns on "--enable-querytrace" as well, so if the
logging severity is not lowered, all other queries will be logged
verbosely as well. compiling with either of these options will impair
query performance; they should only be turned on when testing or
troubleshooting.
2020-05-26 00:47:18 -07:00
Michal Nowak
bfa6ecb796
Provide unit test driver
This adds a unit test driver for BIND with Automake.  It runs the unit
test program provided as its sole command line argument and then looks
for a core dump generated by that test program.  If one is found, the
driver prints the backtrace into the test log.
2020-05-21 12:13:01 +02:00
Michał Kępień
d5562a3e7e Add py.test-3 to the list of tested pytest names
Some operating systems (e.g. CentOS, OpenBSD) install the main pytest
script as "py.test-3".  Add that name to the list of names passed to
AC_PATH_PROGS() in order for pytest to be properly detected on a broader
range of operating systems.
2020-05-21 11:33:11 +02:00
Diego Fronza
6dffdc5372 Added test for rpz-passthru logging channel
This test ensures that all rpz-passthru activity will be redirected
to a dedicated log file following ns1/named.conf configuration.
2020-05-07 11:44:52 -03:00
Ondřej Surý
9fb6d11abb Convert the documentation to Sphinx documentation format
The ARM and the manpages have been converted into Sphinx documentation
format.

Sphinx uses reStructuredText as its markup language, and many of its
strengths come from the power and straightforwardness of
reStructuredText and its parsing and translating suite, the Docutils.
2020-05-07 16:02:56 +02:00
Evan Hunt
9cd76e1b8d fixed incorrect output from the configuration summary 2020-04-30 17:24:28 -07:00
Mark Andrews
82ab846f13 Force test for -fno-delete-null-pointer-checks to fail 2020-04-29 17:56:14 +02:00
Ondřej Surý
cf5105939c Add a pytest runner to run.sh
The system tests currently uses patchwork of shell scripts which doesn't
offer proper error handling.

This commit introduced option to write new tests in pytest framework
that also allows easier manipulation of DNS traffic (using dnspython),
native XML and JSON manipulation and proper error reporting.
2020-04-29 11:10:47 +02:00
Evan Hunt
17a1bafc08 Restore behaviour of "make test" and "make unit"
Add recursive "test" and "unit" rules, which execute "make check"
in specific directories - "make test" runs the system tests, and
"make unit" runs the unit tests.
2020-04-27 15:02:30 +02:00
Ondřej Surý
5813818036 Improve the LOG_DRIVER and LOG_COMPILER for the system tests
There are several improvements over the default/previous behaviour of
the test log driver and log compiler:

 * The system-test-driver.sh was dropped (it was used incorrectly)
 * The run.sh script is now both log compiler and cli script to run
   individual tests
 * The custom-test-driver was added as extended version of the automake
   test-driver with capability to tee the test output to stdout when
   `--verbose yes` is passed to it (you can use LOG_DRIVER_FLAGS to
   add the option by default)
 * Makefile.am has been extended to honor V=1 for the system tests
   test-driver (e.g. V=1 adds `--verbose yes` to AM_LOG_DRIVER_FLAGS)
2020-04-24 16:59:43 +02:00
Michał Kępień
51188b33f8 Ensure fstrm_capture is looked for
fstrm_capture is not an essential utility, but its corresponding
Makefile token needs to substituted even if it is not found in PATH or
else the "dnstap" system test will consistently fail.
2020-04-24 16:11:20 +02:00
Ondřej Surý
978c7b2e89 Complete rewrite the BIND 9 build system
The rewrite of BIND 9 build system is a large work and cannot be reasonable
split into separate merge requests.  Addition of the automake has a positive
effect on the readability and maintainability of the build system as it is more
declarative, it allows conditional and we are able to drop all of the custom
make code that BIND 9 developed over the years to overcome the deficiencies of
autoconf + custom Makefile.in files.

This squashed commit contains following changes:

- conversion (or rather fresh rewrite) of all Makefile.in files to Makefile.am
  by using automake

- the libtool is now properly integrated with automake (the way we used it
  was rather hackish as the only official way how to use libtool is via
  automake

- the dynamic module loading was rewritten from a custom patchwork to libtool's
  libltdl (which includes the patchwork to support module loading on different
  systems internally)

- conversion of the unit test executor from kyua to automake parallel driver

- conversion of the system test executor from custom make/shell to automake
  parallel driver

- The GSSAPI has been refactored, the custom SPNEGO on the basis that
  all major KRB5/GSSAPI (mit-krb5, heimdal and Windows) implementations
  support SPNEGO mechanism.

- The various defunct tests from bin/tests have been removed:
  bin/tests/optional and bin/tests/pkcs11

- The text files generated from the MD files have been removed, the
  MarkDown has been designed to be readable by both humans and computers

- The xsl header is now generated by a simple sed command instead of
  perl helper

- The <irs/platform.h> header has been removed

- cleanups of configure.ac script to make it more simpler, addition of multiple
  macros (there's still work to be done though)

- the tarball can now be prepared with `make dist`

- the system tests are partially able to run in oot build

Here's a list of unfinished work that needs to be completed in subsequent merge
requests:

- `make distcheck` doesn't yet work (because of system tests oot run is not yet
  finished)

- documentation is not yet built, there's a different merge request with docbook
  to sphinx-build rst conversion that needs to be rebased and adapted on top of
  the automake

- msvc build is non functional yet and we need to decide whether we will just
  cross-compile bind9 using mingw-w64 or fix the msvc build

- contributed dlz modules are not included neither in the autoconf nor automake
2020-04-21 14:19:48 +02:00
Ondřej Surý
98b3b93791 Remove python based tools (dnssec-keymgr, dnssec-coverage, dnssec-checkds)
With the introduction of dnssec-policy, the aforementioned tools were
either rendered obsolete, or they will be replaced with dnssec-policy
based tools.  Remove the tools and the requirement to have Python
installed.  Python 3 is still being used for tests, so keep the autoconf
test, but make it much simpler.
2020-04-21 14:19:30 +02:00
Ondřej Surý
9d979d7cd6 Only print warning when PKCS#11 dnssec-keygen fails from Edwards curves 2020-04-20 11:40:42 +02:00
Michał Kępień
17101fd093 Make ISC rwlock implementation the default again
Revert the change from ad03c22e976411cad743bc02746b803a2f119df7 as
further testing has shown that with hyper-threading disabled, named with
ISC rwlocks outperforms named with pthread rwlocks in cold cache testing
scenarios.  Since building named with pthread rwlocks might still be a
better choice for some workloads, keep the compile-time option which
enables that.
2020-04-17 08:36:24 +02:00
Ondřej Surý
fe85568604 Convert lmdb check to m4 macro 2020-03-16 09:38:15 +01:00
Ondřej Surý
e847591867 Improve the backtrace to print symbols when backtrace_symbols() is available
The previous commit removed the code related to the internal symbol
table.  On platforms where available, we can now use backtrace_symbols()
to print more verbose symbols table to the output.

As there's now general availability of backtrace() and
backtrace_symbols() functions (see below), the commit also removes the
usage of glibc internals and the custom stack tracing.

* backtrace(), backtrace_symbols(), and backtrace_symbols_fd() are
  provided in glibc since version 2.1.
* backtrace(), backtrace_symbols(), and backtrace_symbols_fd() first
  appeared in Mac OS X 10.5.
* The backtrace() library of functions first appeared in NetBSD 7.0 and
  FreeBSD 10.0.
2020-03-11 20:32:21 +01:00
Ondřej Surý
1628f5865a Remove configure option to compile without libtool
libtool is a requirement to use automake (see GL #4), so this commit
removes the ability to compile BIND 9 without libtool.
2020-03-11 10:31:51 +01:00
Ondřej Surý
c463808992 Remove the ability to generate internal symbol table
The internal symbol table cannot be generated when libtool is in use,
which is going to be a mandatory in the next commit.
2020-03-11 10:31:42 +01:00
Mark Andrews
a278b6bd84 test installed header files 2020-03-06 12:02:57 +11:00
Mark Andrews
fd0d4ba948 sort AC_CONFIG_FILES 2020-03-06 08:17:06 +11:00
Witold Kręcicki
ad03c22e97 Use pthread rwlocks by default 2020-03-04 10:28:22 +01:00
Evan Hunt
beda680f90 minor cosmetic fixes
- the configuration summary reported zlib compression was not
  supported even when it was.
- when bind.keys.h was regenerated it violated clang-format style.
2020-02-25 18:24:41 +00:00
Diego Fronza
9b4e28e155 Added a isc_glob() function that wraps glob() calls for POSIX systems
and implement a custom glob() function on Windows systems.
2020-02-24 13:46:39 -03:00
Michał Kępień
b273ed8a63 Bump version to 9.17.0 2020-02-24 10:56:47 +01:00
Michał Kępień
9ad9c98021 Fix broken link in configure.ac 2020-02-24 10:56:47 +01:00
Michał Kępień
a5fc3a6364 Clean up --with-tuning=large remnants
The change introduced by commit be159f556568abb9a5dbc494f8441eefdd304a7f
was not fully complete.  Adjust ./configure summary so that it reflects
the new way the --with-tuning switch works, fixing the Autoconf variable
used for determining the value of that switch.  Fix win32utils/Configure
so that it behaves the same way as its Unix counterpart.
2020-02-21 12:51:49 +01:00
Witold Kręcicki
093af1a609 Use libuv-provided uv_{export,import} if available.
We were using our own versions of isc_uv_{export,import} functions
for multithreaded TCP listeners. Upcoming libuv version will
contain proper uv_{export,import} functions - use them if they're
available.
2020-02-18 12:17:55 +01:00
Witold Kręcicki
737501b0d3 Allow --enable-pthread-rwlock even without developer mode 2020-02-07 08:54:54 +01:00
Witold Kręcicki
be159f5565 Set --with-tuning=large as a default, add --with-tuning=small. 2020-02-07 08:54:12 +01:00
Ondřej Surý
fc9c7025bc Fail the autoconf script early if pkg-config is not present. 2020-01-14 14:07:36 +01:00
Witold Kręcicki
5a65ec0aff Add uv_handle_{get,set}_data functions that's absent in pre-1.19 libuv to make code clearer.
This might be removed when we stop supporting older libuv versions.
2019-12-09 11:15:27 -08:00
Ondřej Surý
01731d4b1b Add and use ISC_THREAD_LOCAL macro
The new ISC_THREAD_LOCAL macro unifies usage of platform dependent
Thread Local Storage definition thread_local vs __thread vs
__declspec(thread) to a single macro.

The commit also unifies the required level of support for TLS as for
some parts of the code it was mandatory and for some parts of the code
it wasn't.
2019-12-03 16:27:24 +01:00
Mark Andrews
eed2aabc40 add AC_ARG_VAR([PYTHON], [path to python executable]) 2019-12-03 23:42:08 +11:00
Mark Andrews
d8fc544569 unset PYTHON on --without-python to prevent python still being used 2019-12-03 23:41:28 +11:00
Mark Andrews
50e1bf3800 check for 'distutils.core setup' 2019-11-25 22:46:48 +00:00
Mark Andrews
c7b20f3c40 specify the install name when building libwrap 2019-11-16 11:21:41 +08:00
Mark Andrews
b88faee181 MacOS portability
-Wl,-z,interpose is not supported.
-Wl,rpath=<path> is not supported use -Wl,rpath,<path> instead.
Use @SO@ for loadable extension.
Use -L <path> -l libwrap instead of libwrap.sa.
2019-11-16 11:21:41 +08:00
Witold Kręcicki
70397f9d92 netmgr: libuv-based network manager
This is a replacement for the existing isc_socket and isc_socketmgr
implementation. It uses libuv for asynchronous network communication;
"networker" objects will be distributed across worker threads reading
incoming packets and sending them for processing.

UDP listener sockets automatically create an array of "child" sockets
so each worker can listen separately.

TCP sockets are shared amongst worker threads.

A TCPDNS socket is a wrapper around a TCP socket, which handles the
the two-byte length field at the beginning of DNS messages over TCP.

(Other wrapper socket types can be implemented in the future to handle
DNS over TLS, DNS over HTTPS, etc.)
2019-11-07 11:55:37 -08:00
Witold Kręcicki
402969bf95 implement fetch-and-add array queue data structure
this is a lockless queue based on hazard pointers.
2019-11-07 11:55:37 -08:00