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

36356 Commits

Author SHA1 Message Date
Ondřej Surý
e8cc03f1df Merge branch '3400-gracefully-handle-the-errors-from-uv_start_read' into 'main'
Gracefully handle uv_read_start() failures

Closes #3400

See merge request isc-projects/bind9!6424
2022-06-14 09:46:54 +00:00
Ondřej Surý
646df5cbbc Add CHANGES and release note for [GL #3400] 2022-06-14 11:33:02 +02:00
Ondřej Surý
b432d5d3bc 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().
2022-06-14 11:33:02 +02:00
Michal Nowak
520cf01d56 Merge branch 'mnowak/fix-statistics-system-test-on-ol7' into 'main'
Fix statistics system test on Oracle Linux 7

See merge request isc-projects/bind9!6394
2022-06-14 07:40:39 +00:00
Michal Nowak
49cb896929
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.
2022-06-14 09:38:07 +02:00
Petr Špaček
a3731e9d06 Merge branch '3395-dnssec-signzone-default-0-iterations' into 'main'
Set default number of additional NSEC3 iterations to 0 in dnssec-signzone

Closes #3395

See merge request isc-projects/bind9!6416
2022-06-14 07:05:47 +00:00
Petr Špaček
d029d6374d
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
2022-06-14 08:30:32 +02:00
Mark Andrews
a8e7db0fd4 Merge branch 'typo-in-log-on-update-forward-opcode-mismatch' into 'main'
Typo in log on update forward opcode mismatch

See merge request isc-projects/bind9!6420
2022-06-14 02:04:33 +00:00
Mark Andrews
bd508194be Add CHANGES note for [GL !6420] 2022-06-14 11:41:07 +10:00
JINMEI Tatuya
a58647df6a make the fix more complete 2022-06-13 16:30:00 -07:00
JINMEI Tatuya
2b81a69659 corrected the opcode param to opcode_totext 2022-06-13 16:25:40 -07:00
Evan Hunt
765af0910f Merge branch '3386-nxdomain-serve-stale' into 'main'
don't keep stale NXDOMAIN cache entries

Closes #3386

See merge request isc-projects/bind9!6396
2022-06-13 20:31:26 +00:00
Evan Hunt
15f08ca961 CHANGES and release note for [GL #3386] 2022-06-13 12:53:51 -07:00
Evan Hunt
f1485ca145 don't keep stale NXDOMAIN cache entries
when serve-stale is enabled, NXDOMAIN cache entries are no longer
preserved after the normal negative cache TTL, in order to reduce
unnecessary cache memory consumption.
2022-06-13 12:53:37 -07:00
Michał Kępień
ae09f1d89f Merge branch 'michal/remove-redundant-checks-for-ns-client-functions' into 'main'
Remove NULL checks for ns_client_newrdataset()

See merge request isc-projects/bind9!6417
2022-06-13 12:23:52 +00:00
Michał Kępień
07592d1315 Check for NULL before dereferencing qctx->rpz_st
Commit 9ffb4a7ba11fae64a6ce2dd6390cd334372b7ab7 causes Clang Static
Analyzer to flag a potential NULL dereference in query_nxdomain():

    query.c:9394:26: warning: Dereference of null pointer [core.NullDereference]
            if (!qctx->nxrewrite || qctx->rpz_st->m.rpz->addsoa) {
                                    ^~~~~~~~~~~~~~~~~~~
    1 warning generated.

The warning above is for qctx->rpz_st potentially being a NULL pointer
when query_nxdomain() is called from query_resume().  This is a false
positive because none of the database lookup result codes currently
causing query_nxdomain() to be called (DNS_R_EMPTYWILD, DNS_R_NXDOMAIN)
can be returned by a database lookup following a recursive resolution
attempt.  Add a NULL check nevertheless in order to future-proof the
code and silence Clang Static Analyzer.
2022-06-13 14:03:16 +02:00
Michał Kępień
39fd8efbb7 Remove NULL checks for ns_client_getnamebuf()
ns_client_getnamebuf() cannot fail (i.e. return NULL) since commit
e31cc1eeb436095490c7caa120de148df82ecd6c.  Remove redundant NULL checks
performed on the pointer returned by ns_client_getnamebuf().
2022-06-10 14:30:23 +02:00
Michał Kępień
a229236019 Remove NULL checks for ns_client_newname()
ns_client_newname() cannot fail (i.e. return NULL) since commit
2ce0de699528c8d505adfde37a916b1742e5562f (though it was only made more
apparent by commit 33ba0057a7c44d4e5d63f7f55e1823279e996a19).  Remove
redundant NULL checks performed on the pointer returned by
ns_client_newname().
2022-06-10 14:30:23 +02:00
Michał Kępień
9ffb4a7ba1 Remove NULL checks for ns_client_newrdataset()
ns_client_newrdataset() cannot fail (i.e. return NULL) since commit
efb385ecdcfd3213b3bb739a3dcb9e431690e559 (though it was only made more
apparent by commit 33ba0057a7c44d4e5d63f7f55e1823279e996a19).  Remove
redundant NULL checks performed on the pointer returned by
ns_client_newrdataset().
2022-06-10 14:30:23 +02:00
Petr Špaček
189417c76b Merge branch 'pspacek/keyfromlabel-doc-alg-clarif' into 'main'
Clarify dnssec-keyfromlabel -a in man page

See merge request isc-projects/bind9!6412
2022-06-10 05:54:30 +00:00
Petr Špaček
5f53003dae
Clarify dnssec-keyfromlabel -a in man page 2022-06-09 15:00:08 +02:00
Petr Špaček
e93c2e9a0f Merge branch 'pspacek/arm-statement-syntax' into 'main'
Add Sphinx extension to help with ARM maintenance and cross-linking

See merge request isc-projects/bind9!6395
2022-06-09 12:55:50 +00:00
Petr Špaček
33931c97fa 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.
2022-06-09 14:44:33 +02:00
Petr Špaček
ff577462f9 Warn about duplicate .. statement:: definitions 2022-06-09 14:44:33 +02:00
Petr Špaček
2f2aa1d21c 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.
2022-06-09 14:44:33 +02:00
Petr Špaček
475f7a9603 Render optional statement metadata in the ARM
Optional values :short: and :tags: are now rendered right after the
statement heading.
2022-06-09 14:44:33 +02:00
Petr Špaček
976aef030a 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.
2022-06-09 14:44:33 +02:00
Petr Špaček
b12606cebe 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.
2022-06-09 14:44:33 +02:00
Petr Špaček
a23fa7edc9 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.
2022-06-09 14:44:29 +02:00
Arаm Sаrgsyаn
57b72ba1cd Merge branch '2506-catz-member-zone-vs-configured-forward-zone' into 'main'
Check that catz member zone is not a configured forward zone

Closes #2506

See merge request isc-projects/bind9!6256
2022-06-09 11:10:26 +00:00
Aram Sargsyan
887aa7a290 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.
2022-06-09 10:47:04 +00:00
Aram Sargsyan
3191eabbc7 Add CHANGES and release note for [GL #2506] 2022-06-09 10:46:35 +00:00
Aram Sargsyan
b27969ee0b 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.
2022-06-09 10:45:10 +00:00
Aram Sargsyan
8156c46bd2 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`.
2022-06-09 10:45:10 +00:00
Aram Sargsyan
2aff264fb1 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.
2022-06-09 10:45:10 +00:00
Tom Krizek
5712f97c24 Merge branch 'tkrizek/python-codestyle' into 'main'
Enforce Python codestyle with black

See merge request isc-projects/bind9!6404
2022-06-08 10:48:09 +00:00
Tom Krizek
c2275d9f6e
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.
2022-06-08 10:46:42 +02:00
Tom Krizek
dae340a4a5
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.
2022-06-08 10:46:38 +02: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
Tom Krizek
5d2b7cab08
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
2022-06-08 10:27:46 +02:00
Tom Krizek
5d64d05be9
Remove trailing whitespace
My editor doesn't like that!
2022-06-08 10:27:33 +02:00
Arаm Sаrgsyаn
2f88ce2d0d Merge branch '3392-cid-352554-null-pointer-dereference-dighost.c' into 'main'
Resolve "CID 352554: Null pointer dereferences (REVERSE_INULL) /bin/dig/dighost.c: 3056 in start_tcp()"

Closes #3392

See merge request isc-projects/bind9!6399
2022-06-07 10:26:49 +00:00
Aram Sargsyan
b7cb73160b Remove unneded NULL-checking
Fix an issue reported by Coverity by removing the unneded check.

    *** CID 352554:  Null pointer dereferences  (REVERSE_INULL)
    /bin/dig/dighost.c: 3056 in start_tcp()
    3050
    3051     	if (ISC_LINK_LINKED(query, link)) {
    3052     		next = ISC_LIST_NEXT(query, link);
    3053     	} else {
    3054     		next = NULL;
    3055     	}
    >>>    CID 352554:  Null pointer dereferences  (REVERSE_INULL)
    >>>    Null-checking "connectquery" suggests that it may be null, but it
           has already been dereferenced on all paths leading to the check.
    3056     	if (connectquery != NULL) {
    3057     		query_detach(&connectquery);
    3058     	}
    3059     	query_detach(&query);
    3060     	if (next == NULL) {
    3061     		clear_current_lookup();
2022-06-07 09:51:47 +00:00
Matthijs Mekking
215f89b669 Merge branch '3362-kasp-system-test-timing-issue' into 'main'
Fix another kasp test timing issue

Closes #3362

See merge request isc-projects/bind9!6375
2022-06-07 07:55:14 +00:00
Matthijs Mekking
827bba05a0 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.
2022-06-07 09:33:01 +02:00
Mark Andrews
17f6d1a052 Merge branch 'marka-placeholder' into 'main'
Placeholder for [GL #3367]

See merge request isc-projects/bind9!6397
2022-06-06 01:09:24 +00:00
Mark Andrews
d7e157a29e Placeholder for [GL #3367] 2022-06-06 11:07:37 +10:00
Petr Špaček
da101c1386 Merge branch 'pspacek/danger-log-level' into 'main'
Flag new user-visible log messages for manual review

See merge request isc-projects/bind9!5980
2022-06-03 10:11:11 +00:00
Petr Špaček
b0f59cb5cb
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.
2022-06-03 12:09:41 +02:00
Michał Kępień
ffc5ab9f5f Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.3' into 'main'
Set up version and release notes for BIND 9.19.3

See merge request isc-projects/bind9!6389
2022-06-03 09:26:58 +00:00