]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
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

4 years agoMake modifications to keyless.example deterministic
Mark Andrews [Wed, 11 May 2022 04:32:11 +0000 (14:32 +1000)] 
Make modifications to keyless.example deterministic

The perl modifation code for keyless.example was not deterministic
(/NXT/ matched part of signature) resulting in different error
strings being returned.  Replaced /NXT/ with /A RRSIG NSEC/ and
updated expected error string,

4 years agoMerge branch '3349-managed-keys' into 'main'
Evan Hunt [Tue, 31 May 2022 18:18:13 +0000 (18:18 +0000)] 
Merge branch '3349-managed-keys' into 'main'

don't create managed-keys zone unless dnssec-validation is "auto"

Closes #3349

See merge request isc-projects/bind9!6306

4 years agoCHANGES for [GL #3349]
Evan Hunt [Tue, 31 May 2022 17:55:31 +0000 (10:55 -0700)] 
CHANGES for [GL #3349]

4 years agodon't create managed-keys zone unless dnssec-validation is "auto"
Evan Hunt [Sat, 14 May 2022 03:55:23 +0000 (20:55 -0700)] 
don't create managed-keys zone unless dnssec-validation is "auto"

previously, a managed-keys zone was created for every view
regardless of whether rfc5011 was in use; when it was not in
use, the zone would be left empty. this made for some confusing
log messages.

we now only set up the managed-keys zone if dnssec-validation is
set to the default value of "auto".

certain system test servers have had their dnssec-validation settings
changed to auto because the tests depended on the existence of the
zone.

4 years agoMerge branch '1611-detect-insane-dnssec-policies' into 'main'
Matthijs Mekking [Tue, 31 May 2022 14:36:32 +0000 (14:36 +0000)] 
Merge branch '1611-detect-insane-dnssec-policies' into 'main'

Add some dnssec-policy configuration checks

Closes #1611 and #1601

See merge request isc-projects/bind9!6273

4 years agoOnly log "new successor in ..." if prepub != 0
Matthijs Mekking [Tue, 10 May 2022 08:25:27 +0000 (10:25 +0200)] 
Only log "new successor in ..." if prepub != 0

If 'prepub' is 0, this has the special meaning that no rollover is
scheduled. If so, don't log "new successor in x seconds".

4 years agoAdd CHANGE and release note for #1611
Matthijs Mekking [Mon, 9 May 2022 12:28:45 +0000 (14:28 +0200)] 
Add CHANGE and release note for #1611

Feature change.

4 years agoError if key lifetime is too short
Matthijs Mekking [Mon, 9 May 2022 11:56:45 +0000 (13:56 +0200)] 
Error if key lifetime is too short

The key lifetime should not be shorter than the time it costs to
introduce the successor key, otherwise keys will be created faster than
they are removed, resulting in a large key set.

The time it takes to replace a key is determined by the publication
interval (Ipub) of the successor key and the retire interval of the
predecessor key (Iret).

For the ZSK, Ipub is the sum of the DNSKEY TTL and zone propagation
delay (and publish safety). Iret is the sum of Dsgn, the maximum zone
TTL and zone propagation delay (and retire safety). The sign delay is
the signature validity period minus the refresh interval: The time to
ensure that all existing RRsets have been re-signed with the new key.
The ZSK lifetime should be larger than both values.

For the KSK, Ipub is the sum of the DNSKEY TTL and zone propagation
delay (and publish safety). Iret is the sum of the DS TTL and parent
zone propagation delay (and retire safety). The KSK lifetime should be
larger than both values.

4 years agoUpdate signatures-refresh documentation
Matthijs Mekking [Fri, 6 May 2022 14:56:13 +0000 (16:56 +0200)] 
Update signatures-refresh documentation

Mention in the ARM the new restriction about signatures-refresh.

4 years agoError if signatures-refresh is too high
Matthijs Mekking [Fri, 6 May 2022 14:54:49 +0000 (16:54 +0200)] 
Error if signatures-refresh is too high

The signatures-refresh should not near the signatures-validity value,
to prevent operational instability. Same is true when checking against
signatures-validity-dnskey.

4 years agoWarn if key lifetime is short
Matthijs Mekking [Fri, 6 May 2022 14:21:16 +0000 (16:21 +0200)] 
Warn if key lifetime is short

Log a warning if the key lifetime is less than 30 days.

4 years agoWarn if multiple keys have same role
Matthijs Mekking [Fri, 6 May 2022 14:08:39 +0000 (16:08 +0200)] 
Warn if multiple keys have same role

If a dnssec-policy has multiple keys configured with the
same algorithm and role.

4 years agoMerge branch 'ondrej-unit-tests-refactoring' into 'main'
Ondřej Surý [Tue, 31 May 2022 08:56:05 +0000 (08:56 +0000)] 
Merge branch 'ondrej-unit-tests-refactoring' into 'main'

Give the unit tests a big overhaul and move all the unit tests to /tests/<libname>/

See merge request isc-projects/bind9!6243

4 years agoAdd CHANGES note for [GL !6243]
Ondřej Surý [Tue, 3 May 2022 13:10:49 +0000 (15:10 +0200)] 
Add CHANGES note for [GL !6243]

4 years agoExclude unit tests from gcov
Evan Hunt [Mon, 16 May 2022 22:37:38 +0000 (15:37 -0700)] 
Exclude unit tests from gcov

Modify the .gitlab-ci.yml to match the previous lib/.*/tests/.* pattern
for excluding the unit tests from the gcov.

4 years agoStop the unit tests from running twice
Evan Hunt [Wed, 4 May 2022 02:43:23 +0000 (19:43 -0700)] 
Stop the unit tests from running twice

Move the libtest code into a 'libtest' subdirectory and make it
one of the SUBDIRS in the tests Makefile. having it at the top level
required having "." as one of the subdirs, and that caused the
unit tests to be executed twice.

4 years agoMove all the unit tests to /tests/<libname>/
Ondřej Surý [Tue, 3 May 2022 09:37:31 +0000 (11:37 +0200)] 
Move all the unit tests to /tests/<libname>/

The unit tests are now using a common base, which means that
lib/dns/tests/ code now has to include lib/isc/include/isc/test.h and
link with lib/isc/test.c and lib/ns/tests has to include both libisc and
libdns parts.

Instead of cross-linking code between the directories, move the
/lib/<foo>/test.c to /tests/<foo>.c and /lib/<foo>/include/<foo>test.h
to /tests/include/tests/<foo>.h and create a single libtest.la
convenience library in /tests/.

At the same time, move the /lib/<foo>/tests/ to /tests/<foo>/ (but keep
it symlinked to the old location) and adjust paths accordingly.  In few
places, we are now using absolute paths instead of relative paths,
because the directory level has changed.  By moving the directories
under the /tests/ directory, the test-related code is kept in a single
place and we can avoid referencing files between libns->libdns->libisc
which is unhealthy because they live in a separate Makefile-space.

In the future, the /bin/tests/ should be merged to /tests/ and symlink
kept, and the /fuzz/ directory moved to /tests/fuzz/.

4 years agoGive the unit tests a big overhaul
Ondřej Surý [Mon, 2 May 2022 08:56:42 +0000 (10:56 +0200)] 
Give the unit tests a big overhaul

The unit tests contain a lot of duplicated code and here's an attempt
to reduce code duplication.

This commit does several things:

1. Remove #ifdef HAVE_CMOCKA - we already solve this with automake
   conditionals.

2. Create a set of ISC_TEST_* and ISC_*_TEST_ macros to wrap the test
   implementations, test lists, and the main test routine, so we don't
   have to repeat this all over again.  The macros were modeled after
   libuv test suite but adapted to cmocka as the test driver.

   A simple example of a unit test would be:

    ISC_RUN_TEST_IMPL(test1) { assert_true(true); }

    ISC_TEST_LIST_START
    ISC_TEST_ENTRY(test1)
    ISC_TEST_LIST_END

    ISC_TEST_MAIN (Discussion: Should this be ISC_TEST_RUN ?)

   For more complicated examples including group setup and teardown
   functions, and per-test setup and teardown functions.

3. The macros prefix the test functions and cmocka entries, so the name
   of the test can now match the tested function name, and we don't have
   to append `_test` because `run_test_` is automatically prepended to
   the main test function, and `setup_test_` and `teardown_test_` is
   prepended to setup and teardown function.

4. Update all the unit tests to use the new syntax and fix a few bits
   here and there.

5. In the future, we can separate the test declarations and test
   implementations which are going to greatly help with uncluttering the
   bigger unit tests like doh_test and netmgr_test, because the test
   implementations are not declared static (see `ISC_RUN_TEST_DECLARE`
   and `ISC_RUN_TEST_IMPL` for more details.

NOTE: This heavily relies on preprocessor macros, but the result greatly
outweighs all the negatives of using the macros.  There's less
duplicated code, the tests are more uniform and the implementation can
be more flexible.

4 years agoMerge branch 'ondrej-make-all-tasks-bound-to-thread' into 'main'
Ondřej Surý [Wed, 25 May 2022 14:45:32 +0000 (14:45 +0000)] 
Merge branch 'ondrej-make-all-tasks-bound-to-thread' into 'main'

Make all tasks to be bound to a thread

See merge request isc-projects/bind9!6347

4 years agoMake all tasks to be bound to a thread
Ondřej Surý [Thu, 19 May 2022 09:20:21 +0000 (11:20 +0200)] 
Make all tasks to be bound to a thread

Previously, tasks could be created either unbound or bound to a specific
thread (worker loop).  The unbound tasks would be assigned to a random
thread every time isc_task_send() was called.  Because there's no logic
that would assign the task to the least busy worker, this just creates
unpredictability.  Instead of random assignment, bind all the previously
unbound tasks to worker 0, which is guaranteed to exist.