2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

2699 Commits

Author SHA1 Message Date
Ondřej Surý
091d738c72 Convert all categories and modules into static lists
Remove the complicated mechanism that could be (in theory) used by
external libraries to register new categories and modules with
statically defined lists in <isc/log.h>.  This is similar to what we
have done for <isc/result.h> result codes.  All the libraries are now
internal to BIND 9, so we don't need to provide a mechanism to register
extra categories and modules.
2024-08-20 12:50:39 +00:00
Nicki Křížek
3f1a843695
Remove changes job and related scripts
These are no longer needed, since changelog is generated using
gitchangelog.
2024-07-29 13:03:20 +02:00
Aydın Mercan
ca9a05f9ce Check for atomic operations consistency in checklibs.sh
isc/atomic.h and its defined macros should be preferred over
stdatomic.h and explicit atomic operations.

Fix the redundant stdatomic.h header in histo.c found by the introduced
check.
2024-01-03 17:04:31 +00:00
Tom Krizek
ff32421a64
util: script to get DNS Shotgun pipeline results
The shotgun performance tests are executed in a different repository, in
a couple of different pipelines. To hide away the complexity, this
script takes the pipeline ID of the triggered pipeline and then takes
care of the rest - waits for the pipeline to finish, locates the child
pipeline and the relevant results. The output from this script is a
convenient link to the charts with the results once they're available.

GitLab also has a mechanism which can wait for another pipeline.
However, it can't be utilized here, since there are variables which
need to be passed in when the pipeline is triggered (like protocol to be
tested, load, runtime etc.). This isn't currently supported by the
GitLab feature.
2023-11-01 09:47:20 +01:00
Ondřej Surý
f8e264ba6d
Remove the lock-file configuration and -X argument to named
The lock-file configuration (both from configuration file and -X
argument to named) has better alternatives nowadays.  Modern process
supervisor should be used to ensure that a single named process is
running on a given configuration.

Alternatively, it's possible to wrap the named with flock(1).
2023-10-26 22:42:37 +02:00
Tom Krizek
4cb8b13987
Reformat shell scripts with shfmt
All changes in this commit were automated using the command:

  shfmt -w -i 2 -ci -bn . $(find . -name "*.sh.in")

By default, only *.sh and files without extension are checked, so
*.sh.in files have to be added additionally. (See mvdan/sh#944)
2023-10-26 10:23:50 +02:00
Michal Nowak
35792b1700
Report hung system tests
At times, a problem might occur where a test is not responding,
especially in the CI, determining the specific test responsible can be
difficult. Fortunately, when running tests with the pytest runner,
pytest sets the PYTEST_CURRENT_TEST environment variable to the current
test nodeid and stage. Afterward, the variable can be examined to
identify the test that has stopped responding.

The monitoring script needs to be started in the background. Still, the
shell executor used for BSD and FIPS testing can't handle the background
process cleanly, and the script step will wait for the background
process for the entire duration of the background process (currently
3000 seconds). Therefore, run the monitoring script only when the Docker
executor is used where this is not a problem.
2023-10-05 14:57:26 +02:00
Michal Nowak
93dc606fa8
Simplify Sphinx tools installation
Pointing pip3 to the "requirements file" eliminates the necessity for
removing comments.
2023-09-08 10:18:58 +02:00
Mark Andrews
936b73cb57 Free evp_md_ctx and pkey at exit 2023-09-01 12:01:20 +10:00
Mark Andrews
8529be30bb Clear OpenSSL errors on EVP_MD_CTX_create failures 2023-09-01 12:01:19 +10:00
Michal Nowak
520e97e2fc
Install Sphinx tools versions from BIND 9 repository
The doc/arm/requirements.txt file is the single source of truth when it
comes to Sphinx tools versions used to build documentation via
util/release-tarball-comparison.sh.
2023-08-31 14:31:57 +02:00
Tom Krizek
92143fa960
Update sphinx_rtd_theme
To resolve the version select and search issue on readthedocs.org,
sphinx_rtd_theme>=1.2.1 is required.

Related https://github.com/readthedocs/sphinx_rtd_theme/issues/1452
2023-08-29 10:07:05 +02:00
Ondřej Surý
784d055809
Add support for User Statically Defined Tracing (USDT) probes
This adds support for User Statically Defined Tracing (USDT).  On
Linux, this uses the header from SystemTap and dtrace utility, but the
support is universal as long as dtrace is available.

Also add the required infrastructure to add probes to libisc, libdns and
libns libraries, where most of the probes will be.
2023-08-21 18:39:53 +02:00
Michal Nowak
2d18c57c54
Make Debian 12 "bookworm" the base image
Just replace "bullseye" with "bookworm" and reintroduce Debian 11
"bullseye" later.
2023-08-21 16:35:52 +02:00
Michał Kępień
7f0790c82f Fix entity renumbering in util/parse_tsan.py
util/parse_tsan.py builds tables of mutexes, threads, and pointers it
finds in the TSAN report provided to it as a command-line argument and
then replaces all mentions of each of these entities so that they are
numbered sequentially in the processed report.  For example, this line:

    Cycle in lock order graph: M0 (...) => M5 (...) => M9 (...) => M0

is expected to become:

    Cycle in lock order graph: M1 (...) => M2 (...) => M3 (...) => M1

Problems arise when the gaps between mutex/thread identifiers present on
a single line are smaller than the total number of mutexes/threads found
by the script so far.  For example, the following line:

    Cycle in lock order graph: M0 (...) => M1 (...) => M2 (...) => M0

first gets turned into:

    Cycle in lock order graph: M1 (...) => M1 (...) => M2 (...) => M1

and then into:

    Cycle in lock order graph: M2 (...) => M2 (...) => M2 (...) => M2

In other words, lines like this become garbled due to information loss.

The problem stems from the fact that the numbering scheme the script
uses for identifying mutexes and threads is exactly the same as the one
used by TSAN itself.  Update util/parse_tsan.py so that it uses
zero-padded numbers instead, making the "overlapping" demonstrated above
impossible.
2023-06-15 16:17:14 +02:00
Tom Krizek
034a32a4f3
Add utility script to detect trailing whitespace
Run the script in CI as well to ensure we don't accidentally add
trailing whitespace again.
2023-06-13 15:06:38 +02:00
Tom Krizek
5893debf46
Remove trailing whitespace from all text files
I've used the following command to remove the trailing whitespace for
all tracked text files:

git grep -Il '' | xargs sed -i 's/[ \t]*$//'
2023-06-13 15:05:40 +02:00
Petr Špaček
751062da3b
Update release comparison scripts with liburcu and new Sphinx 2023-05-02 15:35:25 +02:00
Mark Andrews
c51a39e97a Probe if ED448 and ED25519 are supported
ED448 and ED25519 may or may not be supported in FIPS mode depending
upon the implementation.
2023-04-03 12:06:04 +10:00
Evan Hunt
6e9fce7a02 revise branch format
backport branches are now called "bind-9.x" instead of "v9_x".
2023-03-24 20:46:34 +00:00
Michal Nowak
0031af6035
Adapt release-tarball-comparison.sh to dotted tag notation
Recently, the tag notation format changed:

    v9_19_9     -> v9.19.9
    v9_18_13-S1 -> v9.18.13-S1

release-tarball-comparison.sh needs to adapt.
2023-03-22 15:58:15 +01:00
Michal Nowak
0bc4fad065
Adapt tarball comparison to dropped pregenerated man pages
Since pregenerated manual pages were removed from the BIND 9 repository,
Sphinx must be present in the build environment for manual pages to be
created and placed to release tarball. release-tarball-comparison.sh
script needs to be adapted to keep up with how to release tarballs are
prepared.
2023-03-09 16:55:46 +01:00
Tony Finch
6927a30926 Remove do-nothing header <isc/print.h>
This one really truly did nothing. No lines added!
2023-02-15 16:44:47 +00:00
Michal Nowak
a708c2f93d
Start named as auth and recursive server in pairwise
The script will start the named process configured as both an
authoritative and recursive server for each pairwise ./configure
configuration. The test is considered successful if the named process
runs until the 5-second timeout is triggered, and there is no named.lock
file present, indicating that named did not crash on shutdown.
2023-02-13 12:45:20 +01:00
Evan Hunt
9bb46262af remove /etc/bind.keys
the built-in trust anchors in named and delv are sufficent for
validation. named still needs to be able to load trust anchors from
a bind.keys file for testing purposes, but it doesn't need to be
the default behavior.

we now only load trust anchors from a file if explicitly specified
via the "bindkeys-file" option in named or the "-a" command line
argument to delv. documentation has been cleaned up to remove references
to /etc/bind.keys.

Closes #3850.
2023-02-06 14:39:31 -08:00
Michal Nowak
5487226586
Add release tarball comparison script
The util/release-tarball-comparison.sh script compares a release-ready
BIND 9 tarball to a temporary BIND 9 tarball created from the same
signed Git tag to ensure that their content does not differ
(significantly).
2023-01-26 13:59:42 +01:00
Tony Finch
434e25c098 Auto-tag merge requests created by git-replay-merge
The target branch is added to the title of the MR, and a "Backport"
label is added. If the target branch starts with "v" a version label
is added too.

While I am here, clean up remnants of the old gitlab API (which has
been replaced by push options for our purposes) and improve the
command-line parsing.
2023-01-11 08:02:29 +00:00
Michał Kępień
5b28da7ea0
Detect "ignored yet tracked" files in GitLab CI
Ensure that no .gitignore file in the tree contains patterns matching
files tracked by Git by adding a simple script that detects such
situations and running that script as part of the "misc" job in the
"precheck" stage of every GitLab CI pipeline.
2022-12-23 13:44:18 +01:00
Michal Nowak
9e68997cbb Add shell interpreter line where missing
The checkbashisms script reports errors like this one:

    script util/check-line-length.sh does not appear to have a #! interpreter line;
    you may get strange results
2022-11-14 19:54:42 +00:00
Mark Andrews
edfbe5c30f Check that we can verify a signature at initialisation time
Fedora 33 doesn't support RSASHA1 in future mode.  There is no easy
check for this other than by attempting to perform a verification
using known good signatures.  We don't attempt to sign with RSASHA1
as that would not work in FIPS mode.  RSASHA1 is verify only.

The test vectors were generated using OpenSSL 3.0 and
util/gen-rsa-sha-vectors.c.  Rerunning will generate a new set of
test vectors as the private key is not preserved.

e.g.
	cc util/gen-rsa-sha-vectors.c -I /opt/local/include \
		-L /opt/local/lib -lcrypto
2022-07-25 10:32:13 -04:00
Tom Krizek
c9cb8ae9eb
Auto-format Python files with black
This patch is strictly the result of:
$ black $(git ls-files '*.py')

There have been no manual changes.
2022-06-08 10:28:08 +02:00
Petr Špaček
1322372a0c
Restructure includes for ARM chapters 1 (Intro) and 2 (Requirements)
We have had perpetual problem with Sphinx implicitly double-including
files. To avoid that problem all files with name suffix .inc.rst are now
ignored by Sphinx, and writter can conveniently include them without
modifying conf.py for each and every file.
2022-05-11 10:51:21 +02:00
Ondřej Surý
80582073a5 Save parsed tsan files with .txt extension
When the parse tsan files have text extension they can be viewed
directly in the GitLab web UI without downloading them locally.
2022-03-23 20:29:17 +01:00
Michal Nowak
48c44fe6d4
Run spatch jobs in parallel
Also make the script more verbose to identify which patch is being
processed and check for failures in spatch standard error output.
2022-02-14 19:38:17 +01:00
Ondřej Surý
e1d2e26360 Remove util/copyrights 2022-01-11 09:05:02 +01:00
Ondřej Surý
58bd26b6cf 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.
2022-01-11 09:05:02 +01:00
Ondřej Surý
09c32a8d75 Remove the copyright handling via util/copyrights
The copyright handling has been long obsolete, the works is covered as
whole by the COPYING/LICENSE file even if a specific file doesn't have
a copyright header.

The important thing to remember here is that any work is covered by a
copyright law and by explicitly giving it license we provide extra
rights to the users of the works.
2022-01-07 13:30:46 +01:00
Michał Kępień
ab49205af3 Check unsigned serial number in signed zone files
All signed zone files present in bin/tests/system/inline/ns8 should
contain the unsigned serial number in the raw-format header.  Add a
check to ensure that is the case.  Extend the dnssec-signzone command
line in ns8/sign.sh with the -L option to allow the zones initially
signed there to pass the newly added check.  Add another zone to the
configuration for the ns8 named instance to ensure the check also passes
when multiple zones are inline-signed by a single named instance.
2022-01-05 17:53:49 +01:00
Ondřej Surý
4f78f9d72a Add #define ISC_OS_CACHELINE_SIZE 64
Add library ctor and dtor for isc_os compilation unit which initializes
the numbers of the CPUs and also checks whether L1 cacheline size is
really 64 if the sysconf() call is available.
2022-01-05 17:07:35 +01:00
Michal Nowak
befd654e00
Update copyrights to 2022 2022-01-03 10:53:28 +01:00
Michal Nowak
9c013f37d0
Drop cppcheck workarounds
As cppcheck was removed from the CI, associated workarounds and
suppressions are not required anymore.
2021-12-14 15:03:56 +01:00
Mark Andrews
3faccb16cc
Add server christmas tree test
This sets as many server options as possible at once to detect
cut-and-paste bugs when implementing new server options in peer.c.
Most of the accessor functions are similar and it is easy to miss
updating a macro name or structure element name when adding new
accessor functions.

checkconf/setup.sh is there to minimise the difference to branches
with optional server options where the list is updated at runtime.
2021-12-02 14:27:18 +01:00
Ondřej Surý
5c17919019 Add TCP connection reset test
The TCP connection reset test starts mock UDP and TCP server which
always returns empty DNS answer with TC bit set over UDP and resets the
TCP connection after five seconds.

When tested without the fix, the DNS query to 10.53.0.2 times out and
the ns2 server hangs at shutdown.
2021-12-01 11:48:12 -08:00
Artem Boldariev
7f73e68730 Add transport-acl system test
This commit adds a new system-test: transport-acl system test. It is
intended to test the new, extended syntax for ACLs, the one where port
or transport protocol can be specified. Currently, it includes the
tests only using allow-transfer statement, as this extended syntax is
used only there, at least for now.
2021-11-30 12:21:19 +02:00
Petr Špaček
49da19c353
Add new system test for wildcard expansion
This is almost minimal prototype to show how to use python-hypothesis
library in a system test. It does not fully replace existing shell-based
system test for wildcards.
2021-11-08 13:23:05 +01:00
Evan Hunt
03564ba982 add a max-age test to doth system test
use curl, when available, to query for names that do and do not
exist; dump the response headers and check for the expected
max-age value.
2021-11-05 14:14:59 +02:00
Mark Andrews
0b83f1495d Handle truncating the request stream in isc_httpd
If we have had to truncate the request stream, don't resume
reading from it.
2021-11-04 17:06:36 -07:00
Aram Sargsyan
2563afb920 Use ERR_get_error_all() instead of deprecated ERR_get_error_line_data()
OpenSSL 3.0.0 deprecates the ERR_get_error_line_data() function.

Use ERR_get_error_all() instead of ERR_get_error_line_data() and create
a shim to use the old variant for the older OpenSSL versions which don't
have the newer ERR_get_error_all().
2021-10-28 07:38:56 +00:00
Aram Sargsyan
7101afa23c Add dst_key_pubcompare and dst_key_compare unit test
The dst_key_pubcompare() and dst_key_compare() didn't have a unit test,
add the unit tests which test comparing the same keys, different keys,
and, where possible, similar keys with a manually altered parameter.

dst_key_pubcompare() internally uses the *_todns() functions of the
lib/dns/openssl*_link.c modules.

dst_key_compare() internally uses the *_compare() functions of the
lib/dns/openssl*_link.c modules.
2021-10-27 22:23:03 +00:00
Evan Hunt
a55589f881 remove all references to isc_socket and related types
Removed socket.c, socket.h, and all references to isc_socket_t,
isc_socketmgr_t, isc_sockevent_t, etc.
2021-10-15 01:01:25 -07:00