Commit Graph

36126 Commits

Author SHA1 Message Date
Arаm Sаrgsyаn
2d85fda569 Merge branch '3401-race-condition-in-route_connected-v9_18' into 'v9_18'
[v9_18] Resolve "race condition in route_connected() leads to crash on startup/shutdown"

See merge request isc-projects/bind9!6433
2022-06-14 15:55:46 +00:00
Aram Sargsyan
7d5ec4b6a5 Add CHANGES note for [GL #3401]
(cherry picked from commit 4b0e7e41fc)
2022-06-14 14:57:32 +00:00
Aram Sargsyan
12aefe6ced Fix a race condition between shutdown and route_connected()
When shutting down, the interface manager can be destroyed
before the `route_connected()` callback is called, which is
unexpected for the latter and can cause a crash.

Move the interface manager attachment code from the callback
to the place before the callback is registered using
`isc_nm_routeconnect()` function, which will make sure that
the interface manager will live at least until the callback
is called.

Make sure to detach the interface manager if the
`isc_nm_routeconnect()` function is not implemented, or when
the callback is called with a result value which differs from
`ISC_R_SUCCESS`.

(cherry picked from commit f6e729635f)
2022-06-14 14:57:23 +00:00
Aram Sargsyan
e92b261235 Do not use the interface manager until it is ready
The `ns_interfacemgr_create()` function, when calling
`isc_nm_routeconnect()`, uses the newly created `ns_interfacemgr_t`
instance before initializing its reference count and the magic value.

Defer the `isc_nm_routeconnect()` call until the initializations
are complete.

(cherry picked from commit 1d93fe973b)
2022-06-14 14:55:57 +00:00
Arаm Sаrgsyаn
e781c394d8 Merge branch '3207-dig-nssearch-crash-fix-v9_18' into 'v9_18'
[v9_18]  Resolve "dig +nssearch org crashes when network is unreachable"

See merge request isc-projects/bind9!6432
2022-06-14 14:51:16 +00:00
Aram Sargsyan
cb25d5b80d Add CHANGES note for [GL #3207]
(cherry picked from commit 0450c9bd32)
2022-06-14 13:22:39 +00:00
Aram Sargsyan
7917e1866a Fix a crash in dig NS search mode
In special NS search mode, after the initial lookup, dig starts the
followup lookup with discovered NS servers in the queries list. If one
of those queries then fail, dig, as usual, tries to start the next query
in the list, which results in a crash, because the NS search mode is
special in a way that the queries are running in parallel, so the next
query is usually already started.

Apply some special logic in `recv_done()` function to deal with the
described situation when handling the query result for the NS search
mode. Particularly, print a warning message for the failed query,
and do not try to start the next query in the list. Also, set a non-zero
exit code if all the queries in the followup lookup fail.

(cherry picked from commit 1290863c22)
2022-06-14 13:21:47 +00:00
Michal Nowak
74ca068877 Merge branch '3138-capture-scripts-to-coverity-scan-v9_18' into 'v9_18'
[v9_18] Capture scripts for Coverity Scan analysis

See merge request isc-projects/bind9!6430
2022-06-14 12:24:17 +00:00
Michal Nowak
e1a463e98d Capture scripts for Coverity Scan analysis
With the recent Coverity Scan 2021.12 version, Python 3 scripts are
being analyzed in addition to C files. The --fs-capture-search option
scripts for Coverity Scan analysis should be added to leverage this
feature.

(cherry picked from commit b4a2674d98)
2022-06-14 14:19:26 +02:00
Michal Nowak
bed115211e Download Coverity Scan analysis tool to /tmp
Downloading and unpacking Coverity Scan analysis tool tarball
(cov-analysis-linux64.tgz) to $CI_PROJECT_DIR interferes with the
execution of the analysis tool when the --fs-capture-search option is
used because the tool starts to analyze some of its Javascript files.
(There's the --fs-capture-search-exclude-regex <path> option, but I
failed to find a way to make it work.)

(cherry picked from commit 1333bdf67e)
2022-06-14 14:19:21 +02:00
Michal Nowak
36780e07f6 Drop coverity cache feature
The coverity CI job cache feature is used to ensure that the 1 GB
cov-analysis-linux64.tgz file is being cached on GitLab CI runner, where
it was downloaded in the past. This feature does not seem to work
anymore; given that the proper solution to creating distributed cache is
complicated, better to drop the feature altogether.

(cherry picked from commit c966304e90)
2022-06-14 14:19:17 +02:00
Petr Špaček
5cc296bfb2 Merge branch 'pspacek/dnssec-guide-keymgr-removal-v9_18' into 'v9_18'
Remove description of dnssec-keymgr from DNSSEC Guide [v9_18]

See merge request isc-projects/bind9!6428
2022-06-14 11:32:57 +00:00
Petr Špaček
782f3b6845 Remove description of dnssec-keygmr from DNSSEC Guide
dnssec-keymgr is not included in the distribution since BIND 9.17 so
there is no point in keeping usage instructions around.

(cherry picked from commit 0e1306374e)
2022-06-14 13:12:59 +02:00
Ondřej Surý
f5405826f1 Merge branch '3400-gracefully-handle-the-errors-from-uv_start_read-v9_18' into 'v9_18'
Gracefully handle uv_read_start() failures [v9.18]

See merge request isc-projects/bind9!6426
2022-06-14 10:41:27 +00:00
Ondřej Surý
e644acbfae Add CHANGES and release note for [GL #3400]
(cherry picked from commit 646df5cbbc)
2022-06-14 11:54:11 +02:00
Ondřej Surý
579270509f Gracefully handle uv_read_start() failures
Under specific rare timing circumstances the uv_read_start() could
fail with UV_EINVAL when the connection is reset between the connect (or
accept) and the uv_read_start() call on the nmworker loop.  Handle such
situation gracefully by propagating the errors from uv_read_start() into
upper layers, so the socket can be internally closed().

(cherry picked from commit b432d5d3bc)
2022-06-14 11:54:11 +02:00
Michal Nowak
d3658fcb6f Merge branch 'mnowak/fix-statistics-system-test-on-ol7-v9_18' into 'v9_18'
[v9_18] Fix statistics system test on Oracle Linux 7

See merge request isc-projects/bind9!6425
2022-06-14 08:10:15 +00:00
Michal Nowak
152343e221 Fix statistics system test on Oracle Linux 7
The statistics system test fails on Oracle Linux 7 when libxml2, Curl,
and xsltproc are present:

    I:statistics:checking bind9.xsl vs xml (17)
    diff: curl.out.17.xsl: No such file or directory
    tests.sh: line 183: curl.out.17.xml: No such file or directory
    cp: cannot stat 'curl.out.17.xml': No such file or directory
    grep: xsltproc.out.17: No such file or directory

This is because the Oracle Linux 7 Curl does not know about the
--http1.1 option and silently fails with:

    + /usr/bin/curl --http1.1 http://10.53.0.3:7252
    curl: option --http1.1: is unknown
    curl: try 'curl --help' or 'curl --manual' for more information

The following test "checking bind9.xml socket statistics" then needs to
check for existence of stats.xml.out file which is artifact of the
previous test.

(cherry picked from commit 49cb896929)
2022-06-14 09:42:02 +02:00
Petr Špaček
6234936395 Merge branch '3395-dnssec-signzone-default-0-iterations-v9_18' into 'v9_18'
Set default number of additional NSEC3 iterations to 0 in dnssec-signzone [v9_18]

See merge request isc-projects/bind9!6423
2022-06-14 07:33:52 +00:00
Petr Špaček
47c214644b Set default number of additional NSEC3 iterations to 0 in dnssec-signzone
We forgot to update dnssec-signzone while updating KASP defaults.

Closes: #3395
Related: #2956
(cherry picked from commit d029d6374d)
2022-06-14 09:08:07 +02:00
Mark Andrews
0590dd43c7 Merge branch 'typo-in-log-on-update-forward-opcode-mismatch-v9_18' into 'v9_18'
corrected the opcode param to opcode_totext

See merge request isc-projects/bind9!6421
2022-06-14 02:57:34 +00:00
Mark Andrews
2a4bdcd8a3 Add CHANGES note for [GL !6420]
(cherry picked from commit bd508194be)
2022-06-14 12:07:21 +10:00
JINMEI Tatuya
5068ee73d6 make the fix more complete
(cherry picked from commit a58647df6a)
2022-06-14 12:06:54 +10:00
JINMEI Tatuya
430a52883d corrected the opcode param to opcode_totext
(cherry picked from commit 2b81a69659)
2022-06-14 12:06:54 +10:00
Petr Špaček
f64cbe3086 Merge branch 'pspacek/keyfromlabel-doc-alg-clarif-v9_18' into 'v9_18'
Clarify dnssec-keyfromlabel -a in man page [v9_18]

See merge request isc-projects/bind9!6414
2022-06-10 05:59:05 +00:00
Petr Špaček
4630d50f83 Clarify dnssec-keyfromlabel -a in man page
(cherry picked from commit 5f53003dae)
2022-06-10 07:55:12 +02:00
Petr Špaček
87ec530daa Merge branch 'pspacek/arm-statement-syntax-v9_18' into 'v9_18'
Add Sphinx extension to help with ARM maintenance and cross-linking [v9_18]

See merge request isc-projects/bind9!6411
2022-06-09 12:59:40 +00:00
Petr Špaček
e949ac7bbc Add tag filter to .. statementlist:: RST directive
Introduce a new syntax:
.. namedconf:statementlist::
   :filter_tags: acl, resolver

The resulting table contains only items tagged as acl OR resolver.

(cherry picked from commit 33931c97fa)
2022-06-09 14:56:21 +02:00
Petr Špaček
ed4634c5a4 Warn about duplicate .. statement:: definitions
(cherry picked from commit ff577462f9)
2022-06-09 14:56:21 +02:00
Petr Špaček
0078fa1058 Refactor and unite internal data structures for iscconf Sphinx extension
It turns out it is easier to regenerate Sphinx-mandated structure in
get_objects than to maintain two separate data structures. I should have
realized that before.

(cherry picked from commit 2f2aa1d21c)
2022-06-09 14:56:21 +02:00
Petr Špaček
851b513e45 Render optional statement metadata in the ARM
Optional values :short: and :tags: are now rendered right after the
statement heading.

(cherry picked from commit 475f7a9603)
2022-06-09 14:56:21 +02:00
Petr Špaček
90ced1c6a8 Add table generator into Sphinx config extension
New directive .. statementlist:: generates table of statements in a
the given domain (named.conf or rndc.conf). The table contains link to
definition, short description, and also list of tags.
Short description and tags have to be provided by user using optional
parameters. E.g.:

.. statement:: max-cache-size
   :tags: resolver, cache
   :short: Short description

.. statementlist:: is currently not parametrized.

This modification is based on Sphinx "tutorial" extension "TODO".
The main trick is to use placeholder node for .. statementlist:: and
replace it with table at later stage, when all source files were
processed and all cross-references can be resolved.

Beware, some details in Sphinx docs are not up-to-date, it's better
to read Sphinx and docutil sources.

(cherry picked from commit 976aef030a)
2022-06-09 14:56:21 +02:00
Petr Špaček
5919415e4a Extend .. statement:: directive with optional values
New and currently unused values can be provided using this syntax:

.. statement:: max-cache-size
   :tags: resolver, cache
   :short: Short description

The domain stores them in its internal structures for further use.

(cherry picked from commit b12606cebe)
2022-06-09 14:56:20 +02:00
Petr Špaček
29d78932ea Add Sphinx extension to help with ARM maintenance and cross-linking
The extension provides a "Sphinx domain factory". Each new Sphinx domain
defines a namespace for configuration statements so named.conf and
rndc.conf do not clash. Currently the Sphinx domains are instantiated
twice and resuling domains are named "namedconf" and "rndcconf".

This commit adds a single new directive:

.. statement:: max-cache-size

It is namespaced like this:

.. namedconf:statement:: max-cache-size

This directive generates a new anchor for configuration statement and it
can be referenced like :any:`max-cache-size` (if the identifier is
unique), or more specific :namedconf:ref:`max-cache-size`.

It is based on Sphinx "tutorial" extension "recipe".
Beware, some details in Sphinx docs are not up-to-date, it's better
to read Sphinx and docutil sources.

(cherry picked from commit a23fa7edc9)
2022-06-09 14:56:15 +02:00
Arаm Sаrgsyаn
130d54476e Merge branch '2506-catz-member-zone-vs-configured-forward-zone-v9_18' into 'v9_18'
[v9_18] Check that catz member zone is not a configured forward zone

See merge request isc-projects/bind9!6409
2022-06-09 12:38:21 +00:00
Aram Sargsyan
8e8b44649f Cleanup dns_fwdtable_delete()
The conversion of `DNS_R_PARTIALMATCH` into `DNS_R_NOTFOUND` is done
in the `dns_rbt_deletename()` function so there is no need to do that
in `dns_fwdtable_delete()`.

Add a possible return value of `ISC_R_NOSPACE` into the header file's
function description comment.

(cherry picked from commit 887aa7a290)
2022-06-09 10:52:04 +00:00
Aram Sargsyan
b870d52970 Add CHANGES and release note for [GL #2506]
(cherry picked from commit 3191eabbc7)
2022-06-09 10:51:45 +00:00
Aram Sargsyan
56cc6545dc Add forward zone checks in the catz system test
Add a new test to check that a catalog zone member zone does not
get processed when there is a pre-existing forward zone with that
same name.

(cherry picked from commit b27969ee0b)
2022-06-09 10:50:48 +00:00
Aram Sargsyan
1626f61815 Convert some catz error messages from ISC_LOG_INFO to ISC_LOG_WARNING
There is no reason for these two messages to be `ISC_LOG_INFO` while all
the other similar messages in `catz_addmodzone_taskaction()` and
`catz_delzone_taskaction()` functions are logged as `ISC_LOG_WARNING`.

(cherry picked from commit 8156c46bd2)
2022-06-09 10:50:41 +00:00
Aram Sargsyan
475e790e03 Check that catz member zone is not a configured forward zone
When processing a catalog zone member zone make sure that there is no
configured pre-existing forward zone with that name.

Refactor the `dns_fwdtable_find()` function to not alter the
`DNS_R_PARTIALMATCH` result (coming from `dns_rbt_findname()`) into
`DNS_R_SUCCESS`, so that now the caller can differentiate partial
and exact matches. Patch the calling sites to expect and process
the new return value.

(cherry picked from commit 2aff264fb1)
2022-06-09 10:50:32 +00:00
Tom Krizek
ea1744b55e Merge branch 'tkrizek/python-codestyle-v9_18' into 'v9_18'
Enforce Python codestyle with black [v9_18]

See merge request isc-projects/bind9!6405
2022-06-08 12:03:35 +00:00
Tom Krizek
3f902ea9a8 Move pylint CI job to precheck stage
Historically, some *.py files were generated, so Python checks required
running ./configure beforehand. This is no longer the case since v9_18,
so let's run the job ASAP without the unnecessary extra dependency on
autoconf job.

(cherry picked from commit c2275d9f6e)
2022-06-08 13:18:27 +02:00
Tom Krizek
2a2b939f1f Remove flake8 linter for Python from CI
Python codestyle is now handled by black and other issues are checked by
pylint. Flake8 checking has been made redundant and is thus removed as
obsolete.

(cherry picked from commit dae340a4a5)
2022-06-08 13:18:27 +02:00
Tom Krizek
e4bb3c3637 Auto-format Python files with black
This patch is strictly the result of:
$ black $(git ls-files '*.py')

There have been no manual changes.

(cherry picked from commit c9cb8ae9eb)
2022-06-08 13:18:27 +02:00
Tom Krizek
1af7372fc0 Enforce Python codestyle with black
Black is an opinionated tool for auto-formatting Python code so we no
longer have to worry about the codestyle.

For the codestyle decisions and discussion, refer to the upstream
documentation [1].

[1] https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html

(cherry picked from commit 5d2b7cab08)
2022-06-08 13:18:27 +02:00
Tom Krizek
d73ede61f6 Remove trailing whitespace
My editor doesn't like that!

(cherry picked from commit 5d64d05be9)
2022-06-08 13:18:27 +02:00
Matthijs Mekking
885199c807 Merge branch '3362-kasp-system-test-timing-issue-v9_18' into 'v9_18'
[v9_18] Fix another kasp test timing issue

See merge request isc-projects/bind9!6400
2022-06-07 09:22:47 +00:00
Matthijs Mekking
2174c566ff Retry quiet to deal with kasp test timing issue
In the cases where we test SOA serial updates and TTL updates, we check
if for "all zones loaded" to ensure the new zone content is loaded. But
this is the unsigned zone, the signed zone still needs to be produced.

There is thus a timing issue where the dig request comes in before
the signing process has finished.

Add a retry quiet to mitigate against it.

(cherry picked from commit 827bba05a0)
2022-06-07 09:35:40 +02:00
Petr Špaček
b442b9521b Merge branch 'pspacek/danger-log-level-v9_18' into 'v9_18'
Flag new user-visible log messages for manual review [v9_18]

See merge request isc-projects/bind9!6392
2022-06-03 10:12:24 +00:00
Petr Špaček
e716e51296 Flag new user-visible log messages for review
Messages with log levels INFO or higher are flagged for manual review.
Purpose of this check is to prevent debug logs to being released with
too-high log level.

(cherry picked from commit b0f59cb5cb)
2022-06-03 12:11:29 +02:00