]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
4 years agoRemove redundant recursion quota pointer checks
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Remove redundant recursion quota pointer checks

When the client->recursionquota pointer was overloaded by different
features, each of those features had to be aware of that fact and handle
any updates of that pointer gracefully.  Example: prefetch code
initiates recursion, attaching to client->recursionquota, then query
processing restarts due to a CNAME being encountered, then that CNAME is
not found in the cache, so another recursion is triggered, but
client->recursionquota is already attached to; even though it is not
CNAME chaining code that attached to that pointer, that code still has
to handle such a situation gracefully.

However, all features that can initiate recursion have now been updated
to use separate slots in the 'recursions' array, so keeping the old
checks in place means masking future programming errors that could
otherwise be caught - and should be caught because each feature needs to
properly maintain its own quota reference.

Remove outdated recursion quota pointer checks to enable the assertions
in isc_quota_*() functions to detect programming errors in code paths
that can start recursion.  Remove an outdated comment to prevent
confusion.

4 years agoDrop the 'fetchhandle' and 'fetch' fields
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Drop the 'fetchhandle' and 'fetch' fields

Drop the 'fetchhandle' field from ns_client_t as all code using it has
been migrated to use the recursion-type-specific HANDLE_RECTYPE_*()
macros.

Drop the 'fetch' field from ns_query_t as all code using it has been
migrated to use the recursion-type-specific FETCH_RECTYPE_*() macros.

4 years agoMake prefetch code use the 'recursions' array
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Make prefetch code use the 'recursions' array

Replace:

  - client->prefetchhandle with HANDLE_RECTYPE_PREFETCH(client)
  - client->query.prefetch with FETCH_RECTYPE_PREFETCH(client)

This is preparatory work for separating prefetch code from RPZ code.

4 years agoAdd recursionquota_detach()
Ondřej Surý [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Add recursionquota_detach()

Add a new helper function for detaching from the recursion quota in
order to reduce code duplication and to ensure that detaching from that
quota is always accompanied by decreasing the recursive clients counter.

4 years agoAdd helper function for recursive-clients logging
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Add helper function for recursive-clients logging

Reduce code duplication in check_recursionquota() by extracting its
parts responsible for logging to a separate helper function.

Remove result text from the "no more recursive clients" message because
it always says "quota reached" (as the relevant branch is only evaluated
when 'result' is set to ISC_R_QUOTA) and therefore brings no additional
value.

4 years agoCheck recursions at the end of request processing
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Check recursions at the end of request processing

ns_client_endrequest() currently contains code that looks for
outstanding quota references and cleans them up if necessary.  This
approach masks programming errors because ns_client_endrequest() is only
called from ns__client_reset_cb(), which in turn is only called when all
references to the client's netmgr handle are released, which in turn
only happens after all recursion completion callbacks are invoked
(because isc_nmhandle_attach() is called before every call to
dns_resolver_createfetch() in lib/ns/query.c and the completion callback
is expected to detach from the handle), which in turn is expected to
happen for all recursions attempts, even those that get canceled.

Furthermore, declaring the prototype of ns_client_endrequest() at the
top of lib/ns/client.c is redundant because the definition of that
function is placed before its first use in that file.  Remove the
redundant function prototype.

Finally, remove INSIST assertions ensuring quota pointers are NULL in
ns__client_reset_cb() because the latter calls ns_client_endrequest() a
few lines earlier.

4 years agoMake async hooks code use the 'recursions' array
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Make async hooks code use the 'recursions' array

Async hooks are the last feature using the client->fetchhandle and
client->query.fetch pointers.  Update ns_query_hookasync() and
query_hookresume() so that they use a dedicated slot in the 'recursions'
array.  Note that async hooks are still not expected to initiate
recursion if one was already started by a prior ns_query_recurse() call,
so the REQUIRE assertion in ns_query_hookasync() needs to check the
RECTYPE_NORMAL slot rather than the RECTYPE_HOOK one.

4 years agoEnable ns_query_t to track multiple recursions
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Enable ns_query_t to track multiple recursions

When a client waits for a prefetch- or RPZ-triggered recursion to
complete, its netmgr handle is attached to client->prefetchhandle and a
reference to the resolver fetch is stored in client->query.prefetch.
Both of these features use the same fields mentioned above.  This makes
the code fragile and hard to follow as its logically distinct parts
become intertwined for no obvious reason.

Furthermore, storing pointers related to a specific recursion process in
two different structures makes their purpose harder to grasp than it has
to be.

To alleviate the problem, extend ns_query_t with an array of structures
containing recursion-related pointers.  Each feature able to initiate
recursion is supposed to use its own slot in that array, allowing
logically unrelated code paths to be untangled.  Prefetch and RPZ will
be the first users of that array.

Define helper macros for accessing specific recursion-related pointers
in order to improve code readability.

4 years agoAdjust recursion quota when starting a fetch fails
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Adjust recursion quota when starting a fetch fails

Some functions fail to detach from the recursion quota if an error
occurs while initiating recursion.  This causes the recursive client
counter to be off.  Add missing recursionquota_detach() calls, reworking
cleanup code where appropriate.

4 years agoMake resolver glue code use the 'recursions' array
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Make resolver glue code use the 'recursions' array

With prefetch and RPZ code updated to use separate slots in the
'recursions' array, the code responsible for starting recursion in
ns_query_recurse() and resuming query handling in fetch_callback()
should follow suit, so that it does not need to explicitly cooperate
with other code paths that may initiate recursion.

Replace:

  - client->fetchhandle with HANDLE_RECTYPE_NORMAL(client)
  - client->query.fetch with FETCH_RECTYPE_NORMAL(client)

Also update other functions using client->fetchhandle and
client->query.fetch (ns_query_cancel(), query_usestale()) so that those
two fields can shortly be dropped altogether.

4 years agoSimplify client->query initialization
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Simplify client->query initialization

Initialize client->query using a compound literal in order to make the
ns_query_init() function shorter and more readable.  This also prevents
the need to explicitly initialize any newly added fields in the future.

4 years agoAttach to separate recursion quota pointers
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Attach to separate recursion quota pointers

Similarly to how different code paths reused common client handle
pointers and fetch references despite being logically unrelated, they
also reuse client->recursionquota, the field in which a reference to the
recursion quota is stored.  This unnecessarily forces all code using
that field to be aware of the fact that it is overloaded by different
features.

Overloading client->recursionquota also causes inconsistent behavior.
For example, if prefetch code triggers recursion and then delegation
handling code also triggers recursion, only one of these code paths will
be able to attach to the recursion quota, but both recursions will be
started anyway.  In other words, each code path only checks whether the
recursion quota has not been exceeded if the quota has not yet been
attached to by another code path.  This behavior theoretically allows
the configured recursion quota to be slightly exceeded; while it is not
expected to be a real-world operational issue, it is still confusing and
should therefore be fixed.

Extend the structures comprising the 'recursions' array with a new field
holding a pointer to the recursion quota that a given recursion process
attached to.  Update all code paths using client->recursionquota so that
they use the appropriate slot in the 'recursions' array.  Drop the
'recursionquota' field from ns_client_t.

4 years agoUse common code to start prefetches & RPZ fetches
Michał Kępień [Tue, 14 Jun 2022 11:13:32 +0000 (13:13 +0200)] 
Use common code to start prefetches & RPZ fetches

query_prefetch() and query_rpzfetch() contain a lot of duplicated code.
Extract the common bits into a separate function whose name clearly
suggests its purpose.

4 years agoMerge branch 'pspacek/dnssec-guide-keymgr-removal' into 'main'
Petr Špaček [Tue, 14 Jun 2022 11:12:33 +0000 (11:12 +0000)] 
Merge branch 'pspacek/dnssec-guide-keymgr-removal' into 'main'

Remove description of dnssec-keymgr from DNSSEC Guide

See merge request isc-projects/bind9!6410

4 years agoRemove description of dnssec-keygmr from DNSSEC Guide
Petr Špaček [Thu, 9 Jun 2022 12:21:05 +0000 (14:21 +0200)] 
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.

4 years agoMerge branch '3400-gracefully-handle-the-errors-from-uv_start_read' into 'main'
Ondřej Surý [Tue, 14 Jun 2022 09:46:54 +0000 (09:46 +0000)] 
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

4 years agoAdd CHANGES and release note for [GL #3400]
Ondřej Surý [Tue, 14 Jun 2022 07:23:32 +0000 (09:23 +0200)] 
Add CHANGES and release note for [GL #3400]

4 years agoGracefully handle uv_read_start() failures
Ondřej Surý [Tue, 14 Jun 2022 07:17:08 +0000 (09:17 +0200)] 
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().

4 years agoMerge branch 'mnowak/fix-statistics-system-test-on-ol7' into 'main'
Michal Nowak [Tue, 14 Jun 2022 07:40:39 +0000 (07:40 +0000)] 
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

4 years agoFix statistics system test on Oracle Linux 7
Michal Nowak [Fri, 3 Jun 2022 11:12:22 +0000 (13:12 +0200)] 
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.

4 years agoMerge branch '3395-dnssec-signzone-default-0-iterations' into 'main'
Petr Špaček [Tue, 14 Jun 2022 07:05:47 +0000 (07:05 +0000)] 
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

4 years agoSet default number of additional NSEC3 iterations to 0 in dnssec-signzone
Petr Špaček [Fri, 10 Jun 2022 07:42:35 +0000 (09:42 +0200)] 
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

4 years agoMerge branch 'typo-in-log-on-update-forward-opcode-mismatch' into 'main'
Mark Andrews [Tue, 14 Jun 2022 02:04:33 +0000 (02:04 +0000)] 
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

4 years agoAdd CHANGES note for [GL !6420]
Mark Andrews [Tue, 14 Jun 2022 00:31:47 +0000 (10:31 +1000)] 
Add CHANGES note for [GL !6420]

4 years agomake the fix more complete
JINMEI Tatuya [Mon, 13 Jun 2022 23:30:00 +0000 (16:30 -0700)] 
make the fix more complete

4 years agocorrected the opcode param to opcode_totext
JINMEI Tatuya [Mon, 13 Jun 2022 23:25:40 +0000 (16:25 -0700)] 
corrected the opcode param to opcode_totext

4 years agoMerge branch '3386-nxdomain-serve-stale' into 'main'
Evan Hunt [Mon, 13 Jun 2022 20:31:26 +0000 (20:31 +0000)] 
Merge branch '3386-nxdomain-serve-stale' into 'main'

don't keep stale NXDOMAIN cache entries

Closes #3386

See merge request isc-projects/bind9!6396

4 years agoCHANGES and release note for [GL #3386]
Evan Hunt [Sat, 4 Jun 2022 00:13:54 +0000 (17:13 -0700)] 
CHANGES and release note for [GL #3386]

4 years agodon't keep stale NXDOMAIN cache entries
Evan Hunt [Fri, 3 Jun 2022 23:22:01 +0000 (16:22 -0700)] 
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.

4 years agoMerge branch 'michal/remove-redundant-checks-for-ns-client-functions' into 'main'
Michał Kępień [Mon, 13 Jun 2022 12:23:52 +0000 (12:23 +0000)] 
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

4 years agoCheck for NULL before dereferencing qctx->rpz_st
Michał Kępień [Mon, 13 Jun 2022 12:03:16 +0000 (14:03 +0200)] 
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.

4 years agoRemove NULL checks for ns_client_getnamebuf()
Michał Kępień [Fri, 10 Jun 2022 12:30:23 +0000 (14:30 +0200)] 
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().

4 years agoRemove NULL checks for ns_client_newname()
Michał Kępień [Fri, 10 Jun 2022 12:30:23 +0000 (14:30 +0200)] 
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().

4 years agoRemove NULL checks for ns_client_newrdataset()
Michał Kępień [Fri, 10 Jun 2022 12:30:23 +0000 (14:30 +0200)] 
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().

4 years agoMerge branch 'pspacek/keyfromlabel-doc-alg-clarif' into 'main'
Petr Špaček [Fri, 10 Jun 2022 05:54:30 +0000 (05:54 +0000)] 
Merge branch 'pspacek/keyfromlabel-doc-alg-clarif' into 'main'

Clarify dnssec-keyfromlabel -a in man page

See merge request isc-projects/bind9!6412

4 years agoClarify dnssec-keyfromlabel -a in man page
Petr Špaček [Thu, 9 Jun 2022 12:48:53 +0000 (14:48 +0200)] 
Clarify dnssec-keyfromlabel -a in man page

4 years agoMerge branch 'pspacek/arm-statement-syntax' into 'main'
Petr Špaček [Thu, 9 Jun 2022 12:55:50 +0000 (12:55 +0000)] 
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

4 years agoAdd tag filter to .. statementlist:: RST directive
Petr Špaček [Fri, 13 May 2022 14:36:28 +0000 (16:36 +0200)] 
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.

4 years agoWarn about duplicate .. statement:: definitions
Petr Špaček [Thu, 12 May 2022 07:51:41 +0000 (09:51 +0200)] 
Warn about duplicate .. statement:: definitions

4 years agoRefactor and unite internal data structures for iscconf Sphinx extension
Petr Špaček [Thu, 12 May 2022 07:20:46 +0000 (09:20 +0200)] 
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.

4 years agoRender optional statement metadata in the ARM
Petr Špaček [Tue, 10 May 2022 14:00:57 +0000 (16:00 +0200)] 
Render optional statement metadata in the ARM

Optional values :short: and :tags: are now rendered right after the
statement heading.

4 years agoAdd table generator into Sphinx config extension
Petr Špaček [Tue, 10 May 2022 12:50:34 +0000 (14:50 +0200)] 
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.

4 years agoExtend .. statement:: directive with optional values
Petr Špaček [Tue, 10 May 2022 09:09:23 +0000 (11:09 +0200)] 
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.

4 years agoAdd Sphinx extension to help with ARM maintenance and cross-linking
Petr Špaček [Tue, 10 May 2022 13:00:06 +0000 (15:00 +0200)] 
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.

4 years agoMerge branch '2506-catz-member-zone-vs-configured-forward-zone' into 'main'
Arаm Sаrgsyаn [Thu, 9 Jun 2022 11:10:26 +0000 (11:10 +0000)] 
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

4 years agoCleanup dns_fwdtable_delete()
Aram Sargsyan [Wed, 4 May 2022 09:43:49 +0000 (09:43 +0000)] 
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.

4 years agoAdd CHANGES and release note for [GL #2506]
Aram Sargsyan [Tue, 3 May 2022 22:38:44 +0000 (22:38 +0000)] 
Add CHANGES and release note for [GL #2506]

4 years agoAdd forward zone checks in the catz system test
Aram Sargsyan [Tue, 3 May 2022 22:34:48 +0000 (22:34 +0000)] 
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.

4 years agoConvert some catz error messages from ISC_LOG_INFO to ISC_LOG_WARNING
Aram Sargsyan [Tue, 3 May 2022 22:28:45 +0000 (22:28 +0000)] 
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`.

4 years agoCheck that catz member zone is not a configured forward zone
Aram Sargsyan [Tue, 3 May 2022 22:24:32 +0000 (22:24 +0000)] 
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.

4 years agoMerge branch 'tkrizek/python-codestyle' into 'main'
Tom Krizek [Wed, 8 Jun 2022 10:48:09 +0000 (10:48 +0000)] 
Merge branch 'tkrizek/python-codestyle' into 'main'

Enforce Python codestyle with black

See merge request isc-projects/bind9!6404

4 years agoMove pylint CI job to precheck stage
Tom Krizek [Tue, 7 Jun 2022 15:27:25 +0000 (17:27 +0200)] 
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.

4 years agoRemove flake8 linter for Python from CI
Tom Krizek [Tue, 7 Jun 2022 14:29:52 +0000 (16:29 +0200)] 
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.

4 years agoAuto-format Python files with black
Tom Krizek [Tue, 7 Jun 2022 14:27:23 +0000 (16:27 +0200)] 
Auto-format Python files with black

This patch is strictly the result of:
$ black $(git ls-files '*.py')

There have been no manual changes.

4 years agoEnforce Python codestyle with black
Tom Krizek [Tue, 7 Jun 2022 14:06:05 +0000 (16:06 +0200)] 
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

4 years agoRemove trailing whitespace
Tom Krizek [Tue, 7 Jun 2022 14:04:26 +0000 (16:04 +0200)] 
Remove trailing whitespace

My editor doesn't like that!

4 years agoMerge branch '3392-cid-352554-null-pointer-dereference-dighost.c' into 'main'
Arаm Sаrgsyаn [Tue, 7 Jun 2022 10:26:49 +0000 (10:26 +0000)] 
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

4 years agoRemove unneded NULL-checking
Aram Sargsyan [Mon, 6 Jun 2022 15:12:46 +0000 (15:12 +0000)] 
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();

4 years agoMerge branch '3362-kasp-system-test-timing-issue' into 'main'
Matthijs Mekking [Tue, 7 Jun 2022 07:55:14 +0000 (07:55 +0000)] 
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

4 years agoRetry quiet to deal with kasp test timing issue
Matthijs Mekking [Wed, 1 Jun 2022 09:49:20 +0000 (11:49 +0200)] 
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.

4 years agoMerge branch 'marka-placeholder' into 'main'
Mark Andrews [Mon, 6 Jun 2022 01:09:24 +0000 (01:09 +0000)] 
Merge branch 'marka-placeholder' into 'main'

Placeholder for [GL #3367]

See merge request isc-projects/bind9!6397

4 years agoPlaceholder for [GL #3367]
Mark Andrews [Mon, 6 Jun 2022 01:07:37 +0000 (11:07 +1000)] 
Placeholder for [GL #3367]

4 years agoMerge branch 'pspacek/danger-log-level' into 'main'
Petr Špaček [Fri, 3 Jun 2022 10:11:11 +0000 (10:11 +0000)] 
Merge branch 'pspacek/danger-log-level' into 'main'

Flag new user-visible log messages for manual review

See merge request isc-projects/bind9!5980

4 years agoFlag new user-visible log messages for review
Petr Špaček [Tue, 15 Mar 2022 10:55:36 +0000 (11:55 +0100)] 
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.

4 years agoMerge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.3' into 'main'
Michał Kępień [Fri, 3 Jun 2022 09:26:58 +0000 (09:26 +0000)] 
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

4 years agoSet up release notes for BIND 9.19.3
Michał Kępień [Fri, 3 Jun 2022 09:01:13 +0000 (11:01 +0200)] 
Set up release notes for BIND 9.19.3

4 years agoUpdate BIND version to 9.19.3-dev
Michał Kępień [Fri, 3 Jun 2022 09:01:13 +0000 (11:01 +0200)] 
Update BIND version to 9.19.3-dev

4 years agoUpdate BIND 9 version for release v9.19.2
Michał Kępień [Thu, 2 Jun 2022 16:36:49 +0000 (18:36 +0200)] 
Update BIND 9 version for release

4 years agoAdd a CHANGES marker
Michał Kępień [Thu, 2 Jun 2022 16:36:49 +0000 (18:36 +0200)] 
Add a CHANGES marker

4 years agoMerge branch 'michal/prepare-documentation-for-bind-9.19.2' into 'v9_19_2-release'
Michał Kępień [Thu, 2 Jun 2022 16:34:50 +0000 (16:34 +0000)] 
Merge branch 'michal/prepare-documentation-for-bind-9.19.2' into 'v9_19_2-release'

Prepare documentation for BIND 9.19.2

See merge request isc-private/bind9!405

4 years agoAdd release note for GL #3327
Michał Kępień [Thu, 2 Jun 2022 16:27:40 +0000 (18:27 +0200)] 
Add release note for GL #3327

4 years agoReorder release notes
Michał Kępień [Thu, 2 Jun 2022 16:27:40 +0000 (18:27 +0200)] 
Reorder release notes

4 years agoTweak and reword release notes
Michał Kępień [Thu, 2 Jun 2022 16:27:40 +0000 (18:27 +0200)] 
Tweak and reword release notes

4 years agoPrepare release notes for BIND 9.19.2
Michał Kępień [Thu, 2 Jun 2022 16:27:40 +0000 (18:27 +0200)] 
Prepare release notes for BIND 9.19.2

4 years agoMerge branch 'pspacek/rtd-style-changes' into 'main'
Petr Špaček [Thu, 2 Jun 2022 15:22:56 +0000 (15:22 +0000)] 
Merge branch 'pspacek/rtd-style-changes' into 'main'

ReadTheDocs style changes

See merge request isc-projects/bind9!6385

4 years agoARM style change: render literals in black color
Petr Špaček [Fri, 6 May 2022 16:44:15 +0000 (18:44 +0200)] 
ARM style change: render literals in black color

After enormous amount of bikesheding about colors we decided to override
ReadTheDocs default style for literals (``literal`` in the RST markup).

Justification:
- The default RTD "light red literal on white background" is hard to
  read.  https://webaim.org/resources/contrastchecker/ reports that text
  colored as rgb(231, 76, 60) on white background has insufficient
  contrast.
- The ARM has enormous amount of literals all over the place and thus
  one sentence can contain several black/red/black color changes. This
  is distracting. As a consequence, the ARM looks like a Geronimo
  Stilton book.

What we experimented with as replacements for red:
- Green - way too distracting
- Blue - too similar to "usual clickable link"
- Violet - too Geronimo Stilton style
- Brown - better but still distracting

After all the bikesheding we settled on black, i.e. the same as all
"normal" text. I.e. the color is now the same and literals are denoted
by monospaced font and a box around the literal. This has best contrast
and is way less distracting than it used to be.

This lead to a new problem: Internal references to "term definitions"
defined using directives like .. option:: were rendered almost the same
as literals:
- References: monospaced + box + bold + clickable
- Literals: monospaced + box To distinguish these two we added black
  dotted underline to clickable references.

I hereby declare the bikeshed painted.

4 years agoAllow wrapping for ARM table content
Petr Špaček [Tue, 10 May 2022 14:53:40 +0000 (16:53 +0200)] 
Allow wrapping for ARM table content

RTD style default never wraps <th> and <td> elements and that just does
not work for real sentences or any other long lines.

We can reconsider styling some tables separately, but at the moment we
do not have use for tables with long but unwrappable lines so it's
easier to allow wrapping globally.

4 years agoMerge branch 'aram/catz-processing-skip-warnings-for-some-rrset-types' into 'main'
Arаm Sаrgsyаn [Thu, 2 Jun 2022 10:32:05 +0000 (10:32 +0000)] 
Merge branch 'aram/catz-processing-skip-warnings-for-some-rrset-types' into 'main'

catz: don't log failure warnings when failure is expected for the type

See merge request isc-projects/bind9!6373

4 years agoAdd CHANGES and release note for [GL #3380]
Aram Sargsyan [Thu, 2 Jun 2022 08:42:05 +0000 (08:42 +0000)] 
Add CHANGES and release note for [GL #3380]

4 years agoDon't process DNSSEC-related and ZONEMD records in catz
Aram Sargsyan [Wed, 1 Jun 2022 08:51:55 +0000 (08:51 +0000)] 
Don't process DNSSEC-related and ZONEMD records in catz

When processing a catalog zone update, skip processing records with
DNSSEC-related and ZONEMD types, because we are not interested in them
in the context of a catalog zone, and processing them will fail and
produce an unnecessary warning message.

4 years agoMerge branch '3388-missing-indent-call' into 'main'
Mark Andrews [Wed, 1 Jun 2022 22:26:07 +0000 (22:26 +0000)] 
Merge branch '3388-missing-indent-call' into 'main'

Resolve "Missing INDENT call"

Closes #3388

See merge request isc-projects/bind9!6379

4 years agoAdd missing INDENT call for UPDATE messages
Mark Andrews [Wed, 1 Jun 2022 22:05:39 +0000 (08:05 +1000)] 
Add missing INDENT call for UPDATE messages

Reported by Peter <pmc@citylink.dinoex.sub.org> on bind-users.

4 years agoMerge branch 'fanf-tests-build-deps' into 'main'
Ondřej Surý [Wed, 1 Jun 2022 15:46:33 +0000 (15:46 +0000)] 
Merge branch 'fanf-tests-build-deps' into 'main'

A few build fixes for the unit tests

See merge request isc-projects/bind9!6369

4 years agoProperly adjust the srcdir vs builddir paths
Ondřej Surý [Wed, 1 Jun 2022 11:10:37 +0000 (13:10 +0200)] 
Properly adjust the srcdir vs builddir paths

Affected unit tests load testdata from the srcdir.  Previously, there
was a kludge that chdir()ed to the tests srcdir, but that get removed
during refactoring.  Instead of introducing the kludge again, the paths
were fixed to be properly prefixed with TESTS_DIR as needed.

4 years agoDon't list libtest.la headers in HEADERS variable
Ondřej Surý [Wed, 1 Jun 2022 07:02:10 +0000 (09:02 +0200)] 
Don't list libtest.la headers in HEADERS variable

The libtest.la headers were installed in very weird place, in fact, we
don't need to list them in the HEADERS variable, listing them in SOURCES
is enough for autotools to figure out how to compile the convenience
library.

4 years agoFix the path to tsan files in the tsan unit test job
Ondřej Surý [Wed, 1 Jun 2022 06:52:28 +0000 (08:52 +0200)] 
Fix the path to tsan files in the tsan unit test job

The tsan unit test job still referenced lib/*/tests/tsan.*, change this
to the correct tests/*/tsan.*.

4 years agoAdd tests/isc/uv_wrap.h to Makefile.am
Ondřej Surý [Wed, 1 Jun 2022 06:47:00 +0000 (08:47 +0200)] 
Add tests/isc/uv_wrap.h to Makefile.am

The automake was missing reference to uv_wrap.h, so it was not added to
the distribution.  Add uv_wrap.h to SOURCES for both doh and netmgr unit
tests.

4 years agoAdd missing CFLAGS and LDADD to unit tests
Tony Finch [Tue, 31 May 2022 19:00:40 +0000 (20:00 +0100)] 
Add missing CFLAGS and LDADD to unit tests

A number of unit tests needed to be told where to find their libraries
and matching headers.

4 years agoMerge branch '3269-increase-server-start-timeout' into 'main'
Artem Boldariev [Wed, 1 Jun 2022 14:33:34 +0000 (14:33 +0000)] 
Merge branch '3269-increase-server-start-timeout' into 'main'

Resolve #3269: Increase server start timeout for unit tests

Closes #3269

See merge request isc-projects/bind9!6356

4 years agoIncrease server start timeout for system tests
Artem Boldariev [Wed, 25 May 2022 11:49:32 +0000 (14:49 +0300)] 
Increase server start timeout for system tests

This commit increases server start timeout from 60 to 90 seconds in
order to avoid system test failures on some platforms due to inability
to initialise TLS contexts in time.

4 years agoMerge branch 'fanf-compression-relic' into 'main'
Tony Finch [Wed, 1 Jun 2022 12:02:16 +0000 (12:02 +0000)] 
Merge branch 'fanf-compression-relic' into 'main'

Clean up the dns_compress API

See merge request isc-projects/bind9!6270

4 years agoCHANGES note for [GL !6270]
Tony Finch [Fri, 6 May 2022 07:19:54 +0000 (08:19 +0100)] 
CHANGES note for [GL !6270]

[cleanup] Simplify BIND's internal DNS name compression API. As
RFC 6891 explains, it isn't practical to deploy new
label types or compression methods, so it isn't
necessary to have an API designed to support them.
Remove compression terminology that refers to Internet
Drafts that expired in the 1990s.

4 years agoClean up remaining references to global compression
Tony Finch [Thu, 5 May 2022 17:36:48 +0000 (18:36 +0100)] 
Clean up remaining references to global compression

It is simply called "compression" now, without any qualifiers. Also,
improve some variable names in dns_name_towire2() so they are not two
letter abbreviations for global something.

4 years agoShrink decompression contexts
Tony Finch [Thu, 5 May 2022 15:36:52 +0000 (16:36 +0100)] 
Shrink decompression contexts

It's wasteful to use 20 bytes and a pointer indirection to represent
two bits of information, so turn the struct into an enum. And change
the names of the enumeration constants to make the intent more clear.

This change introduces some inline functions into another header,
which confuses `gcovr` when it is trying to collect code coverage
statistics. So, in the CI job, copy more header files into a directory
where `gcovr` looks for them.

4 years agoThere can no longer be multiple compression methods
Tony Finch [Thu, 5 May 2022 13:52:44 +0000 (14:52 +0100)] 
There can no longer be multiple compression methods

The aim is to get rid of the obsolete term "GLOBAL14" and instead just
refer to DNS name compression.

This is mostly mechanically renaming

from dns_(de)compress_(get|set)methods()
to dns_(de)compress_(get|set)permitted()

and replacing the related enum by a simple flag, because compression
is either on or off.

4 years agoDNS name compression does not depend on the EDNS version
Tony Finch [Wed, 4 May 2022 16:35:39 +0000 (17:35 +0100)] 
DNS name compression does not depend on the EDNS version

There was a proposal in the late 1990s that it might, but it turned
out to be unworkable. See RFC 6891, Extension Mechanisms for
DNS (EDNS(0)), section 5, Extended Label Types.

The remnants of the code that supported this in BIND are redundant.

4 years agoRemove obsolete notes on name compression
Tony Finch [Wed, 4 May 2022 08:38:54 +0000 (09:38 +0100)] 
Remove obsolete notes on name compression

These notes describe the initial compression design for BIND 9 in
1998/1999, when the IETF had some over-optimistic plans for using EDNS
to change the wire format of domain names. (Another example was
bitstring labels for IPv6 reverse DNS.) By the end of 2000 the EDNS
name compression schemes had been abandoned, and BIND 9's compression
code was rewritten to use a hash table.

There is nothing left of the implementation described here, and the
API functions are better described in `compress.h`, so these notes are
more misleading than helpful. Those who are interested in the past can
look at the version control history.

4 years agoMerge branch 'aram/update-top-level-gitignore-add-ide-files' into 'main'
Arаm Sаrgsyаn [Wed, 1 Jun 2022 10:19:14 +0000 (10:19 +0000)] 
Merge branch 'aram/update-top-level-gitignore-add-ide-files' into 'main'

Update top-level .gitignore to ignore files generated by some IDEs

See merge request isc-projects/bind9!6361

4 years agoUpdate top-level .gitignore to ignore files generated by some IDEs
Aram Sargsyan [Thu, 26 May 2022 11:11:52 +0000 (11:11 +0000)] 
Update top-level .gitignore to ignore files generated by some IDEs

4 years agoMerge branch '3345-fix-keyless-example-generation' into 'main'
Mark Andrews [Wed, 1 Jun 2022 00:36:15 +0000 (00:36 +0000)] 
Merge branch '3345-fix-keyless-example-generation' into 'main'

Resolve "Insecurity proof failed resolving 'a.b.keyless.example/A/IN' in dnssec test"

Closes #3345

See merge request isc-projects/bind9!6280