Compare commits

..

2735 Commits

Author SHA1 Message Date
Michal Nowak
8e12227580 Update BIND 9 version for release 2022-05-09 11:01:20 +02:00
Michal Nowak
b17f6ce5af Add a CHANGES marker 2022-05-09 10:50:09 +02:00
Michal Nowak
d94addbb3b Merge branch 'mnowak/prepare-documentation-for-bind-9.19.1' into 'security-main'
Prepare documentation for BIND 9.19.1

See merge request isc-private/bind9!402
2022-05-09 08:41:49 +00:00
Michal Nowak
d25977e500 Reorder release notes 2022-05-09 10:10:22 +02:00
Michal Nowak
0cb80f7343 Tweak and reword release notes 2022-05-09 10:10:22 +02:00
Michal Nowak
7f1fbcb4e7 Prepare release notes for BIND 9.19.1 2022-05-06 17:00:40 +02:00
Michal Nowak
76b24ac081 Merge branch '3216-sslyze-crash-fix' into 'security-main'
[CVE-2022-1183] Fix a crash by avoiding destroying TLS stream socket too early

See merge request isc-private/bind9!400
2022-05-05 08:45:59 +00:00
Artem Boldariev
6791500e96 Add release note entry for [GL #3216] 2022-05-04 19:39:18 +02:00
Artem Boldariev
65c0de8e6f Add CHANGES entry for [GL #3216] 2022-05-04 19:39:03 +02:00
Artem Boldariev
a696be6a2d Fix a crash by avoiding destroying TLS stream socket too early
This commit fixes a crash in generic TLS stream code, which could be
reproduced during some runs of the 'sslyze' tool.

The intention of this commit is twofold.

Firstly, it ensures that the TLS socket object cannot be destroyed too
early. Now it is being deleted alongside the underlying TCP socket
object.

Secondly, it ensures that the TLS socket object cannot be destroyed as
a result of calling 'tls_do_bio()' (the primary function which
performs encryption/decryption during the IO) as the code did not
expect that. This code path is fixed now.
2022-05-04 19:38:16 +02:00
Michal Nowak
081f717c53 Merge branch 'mnowak/add-placeholder-for-issue-3216' into 'main'
Add placeholder entry for [GL #3216]

See merge request isc-projects/bind9!6264
2022-05-04 17:35:43 +00:00
Michal Nowak
6786ef6eba Add placeholder entry for [GL #3216] 2022-05-04 19:13:26 +02:00
Mark Andrews
268a8a470b Merge branch '3232-rpz-rpz-nsip-rules-seem-not-to-understand-stub-and-static-stub-zones-and-don-t-handle' into 'main'
Resolve "RPZ rpz-nsip rules seem not to understand stub and static-stub zones and don't handle DNS_R_GLUE result well ..."

Closes #3232

See merge request isc-projects/bind9!6037
2022-05-04 13:51:07 +00:00
Mark Andrews
63f420c89a Add CHANGES entry for [GL #3232] 2022-05-04 23:30:32 +10:00
Mark Andrews
f498d2db0d Allow DNS_RPZ_POLICY_ERROR to be converted to a string 2022-05-04 23:30:32 +10:00
Mark Andrews
8fb72012e3 Check the cache as well when glue NS are returned processing RPZ 2022-05-04 23:30:32 +10:00
Mark Andrews
07c828531c Process learned records as well as glue 2022-05-04 23:30:32 +10:00
Mark Andrews
cf97c61f48 Process the delegating NS RRset when checking rpz rules 2022-05-04 23:30:32 +10:00
Mark Andrews
30cb70c826 Add test cases using static and static-stub zones
RPZ NSIP and NSDNAME checks were failing with "unrecognized NS
rpz_rrset_find() failed: glue" when static or static-stub zones
where used to resolve the query name.

Add tests using stub and static-stub zones that are expected to
be filtered and not-filtered against NSIP and NSDNAME rules.

stub and static-stub queries are expected to be filtered

stub-nomatch and static-stub-nomatch queries are expected to be passed
2022-05-04 23:30:32 +10:00
Ondřej Surý
c9f9312f3f Merge branch 'ondrej-add-missing-void-in-named_config_default' into 'main'
Add missing void in named_config_getdefault() definition

See merge request isc-projects/bind9!6259
2022-05-04 11:05:26 +00:00
Ondřej Surý
94209ce947 Add missing void in named_config_getdefault() definition
The named_config_getdefault() was missing void in the function
definition.  This broke clang-15 that didn't match the declaration that
had the void in the argument with the definition that hadn't.
2022-05-04 13:01:22 +02:00
Ondřej Surý
1d1395a916 Merge branch '3321-libisc-so-undefined-reference-to-uv_os_getenv-on-stretch' into 'main'
Restore the implementation of uv_os_getenv() shim

Closes #3321

See merge request isc-projects/bind9!6258
2022-05-04 11:01:07 +00:00
Ondřej Surý
a0a102cc50 Restore the implementation of uv_os_getenv() shim
Somewhere in the move from netmgr/uv-compat.h to uv.c, the
uv_os_getenv() implementation was lost in the process.  Restore the
implementation, so we can support Debian stretch for couple more months.
2022-05-04 12:31:46 +02:00
Ondřej Surý
4e8d1207ff Merge branch 'ondrej-use--Wl,--export-dynamic' into 'main'
Add -Wl,--export-dynamic to AM_LDFLAGS

See merge request isc-projects/bind9!6196
2022-05-03 19:13:56 +00:00
Ondřej Surý
b05e20c968 Add -Wl,--export-dynamic to standard LDFLAGS if supported
From the ld man page:

  When creating a dynamically linked executable, using the -E option or
  the --export-dynamic option causes the linker to add all symbols to
  the dynamic symbol table.  The dynamic symbol table is the set of
  symbols which are visible from dynamic objects at run time.

This should allow the backtrace(3) to fully resolve the symbols when
creating backtrace on an assertion failure.
2022-05-03 21:13:33 +02:00
Arаm Sаrgsyаn
a229b81dda Merge branch 'aram/catz-schema-v2-release-note' into 'main'
Add release note for catalog zones schema version 2 support

See merge request isc-projects/bind9!6248
2022-05-03 17:05:55 +00:00
Aram Sargsyan
bc3dc2eb41 Add release note for catalog zones schema version 2 support 2022-05-03 16:41:55 +00:00
Petr Špaček
332fa62b37 Merge branch 'artem-rename-tls-hostname-to-tls-remote-hostname' into 'main'
Rename "hostname" to "remote-hostname" within "tls"

See merge request isc-projects/bind9!6252
2022-05-03 14:31:14 +00:00
Artem Boldariev
79c5cad7e5 Rename "hostname" to "remote-hostname" within "tls"
This commit renames "hostname" to "remote-hostname" within "tls"
options to avoid semantic conflicts with generic "options"
configuration.
2022-05-03 17:15:43 +03:00
Tony Finch
aa00590ee3 Merge branch 'fanf-string-hpux' into 'main'
Clean up #include <isc/string.h>

See merge request isc-projects/bind9!6220
2022-05-03 12:39:40 +00:00
Tony Finch
933f0bebe0 Clean up #include <isc/string.h>
It isn't just about HP/UX any more.
2022-05-03 12:38:59 +00:00
Tony Finch
31d210eea7 Merge branch 'fanf-adb-cleanup' into 'main'
A couple of small ADB cleanups

See merge request isc-projects/bind9!6219
2022-05-03 12:37:38 +00:00
Tony Finch
fb8b627d44 CHANGES entry for [GL !6219]
[cleanup]	Reduce struct padding in ADB address entries, and use a
		binary hash function to find addresses.
2022-05-03 12:36:48 +00:00
Tony Finch
c44d7c8034 Use a case-sensitive hash table for ADB address entries
The key for the ADB `entrybuckets` hash table is a binary `struct
isc_sockaddr` so it seems wrong to use a case-insensitive hash.
2022-05-03 12:36:48 +00:00
Tony Finch
8707cb7ad4 Reduce padding in ADB address entries
Saves a couple of bytes in `struct dns_adbentry`.
2022-05-03 12:36:48 +00:00
Artem Boldariev
38ad4d9a62 Merge branch 'artem-update-arm-tls-warnings' into 'main'
Update TLS-related warnings within ARM

See merge request isc-projects/bind9!6249
2022-05-03 11:17:29 +00:00
Artem Boldariev
2221cbffa5 Update TLS-related warnings within ARM
This commit updates TLS-related warnings so that the fact that Strict
and Mutual TLS are implemented is taken into consideration.
2022-05-03 13:55:07 +03:00
Tony Finch
d16e9117b0 Merge branch 'fanf-rdataslab-cpp' into 'main'
Two small preprocessor cleanups in rdataslab.c

See merge request isc-projects/bind9!6221
2022-05-03 09:30:48 +00:00
Tony Finch
8c26cd915b Tidy up some DNS_RDATASET_FIXED conditional compilation
Add a #if to make it clear that struct xrdata->order is only used
in DNS_RDATASET_FIXED mode.

Re-order some variable declarations to merge two #if blocks into one.
2022-05-03 09:30:28 +00:00
Tony Finch
7f4a4ec07c Ditch a couple of unused #defines
These were added by mistake in CHANGES 2349 and were not removed when
the mistake was corrected.
2022-05-03 09:30:28 +00:00
Ondřej Surý
476fef78a9 Merge branch 'ondrej-move-uv-compat.c-to-uv.c' into 'main'
Move netmgr/uv-compat.h to <isc/uv.h>

See merge request isc-projects/bind9!6199
2022-05-03 08:24:41 +00:00
Ondřej Surý
88b109514c Add CHANGES note for [GL !6199] 2022-05-03 10:04:23 +02:00
Ondřej Surý
b43812692d Move netmgr/uv-compat.h to <isc/uv.h>
As we are going to use libuv outside of the netmgr, we need the shims to
be readily available for the rest of the codebase.

Move the "netmgr/uv-compat.h" to <isc/uv.h> and netmgr/uv-compat.c to
uv.c, and as a rule of thumb, the users of libuv should include
<isc/uv.h> instead of <uv.h> directly.

Additionally, merge netmgr/uverr2result.c into uv.c and rename the
single function from isc__nm_uverr2result() to isc_uverr2result().
2022-05-03 10:02:19 +02:00
Ondřej Surý
24c3879675 Move socket related functions to netmgr/socket.c
Move the netmgr socket related functions from netmgr/netmgr.c and
netmgr/uv-compat.c to netmgr/socket.c, so they are all present all in
the same place.  Adjust the names of couple interal functions
accordingly.
2022-05-03 09:52:49 +02:00
Mark Andrews
f432a2b148 Merge branch 'fanf-rbt64-gone' into 'main'
Remove remaining checks for rbt64

See merge request isc-projects/bind9!6218
2022-05-03 01:57:26 +00:00
Tony Finch
dc233bdb3f Remove remaining checks for rbt64
These checks have been redundant since the `rbtdb64` implementation
was removed in 2018 (commit 784087390a). It isn't possible to create
a zone that uses `database "rbt64"` now that the `rbt64` database
implementation has been removed, so the checks will always fail.
2022-05-03 00:41:42 +01:00
Tony Finch
5cd1c3ad81 Merge branch 'fanf-log-no-newlines' into 'main'
Remove several superfluous newlines in log messages

See merge request isc-projects/bind9!6217
2022-05-02 23:37:53 +00:00
Tony Finch
66b3cb9732 Remove several superfluous newlines in log messages 2022-05-02 23:49:38 +01:00
Tony Finch
4e2ecdc18b Merge branch 'fanf-zt-comments' into 'main'
Clarify a few zonetree API comments

See merge request isc-projects/bind9!6216
2022-05-02 22:39:30 +00:00
Tony Finch
db7487dd35 Clarify a few zonetree API comments
Replace a load-bearing semicolon with some more explanatory words,
and correct a couple of parameter names.
2022-05-02 22:48:55 +01:00
Tony Finch
9980c8ad76 Merge branch 'fanf-zoneverify-boolinit' into 'main'
Eliminate a variable that can confuse the compiler

See merge request isc-projects/bind9!6212
2022-05-02 21:48:05 +00:00
Tony Finch
2dfe90a013 Eliminate a variable that can confuse the compiler
Sometimes the compiler is unable to see that the `empty` variable was
initialized by the call to is_empty(), which can cause a build
failure; I encountered this with CFLAGS=-Os. So get rid of it and use
the result from `is_empty()` instead.
2022-05-02 21:11:12 +01:00
Tony Finch
6ea045cd0d Merge branch 'fanf-unused-rbtnode-rpz' into 'main'
Remove unused rbtnode->rpz flag

See merge request isc-projects/bind9!6215
2022-05-02 20:09:36 +00:00
Tony Finch
cdd3d54bce Remove unused rbtnode->rpz flag
The rbtnode->rpz flag was left behind when rbt and rpz were disentangled
by CHANGES #4576. Removing it makes the comment above correct again.

This reduces the flags so they fit in a 32 bit word again. On 64
bit systems there is still padding so it doesn't change the size
of an rbtnode. On 32 bit systems it reduces an rbtnode by 4 bytes.
2022-05-02 19:47:58 +01:00
Petr Špaček
ac2295ef84 Merge branch 'pspacek/fix-rtd-file-path-substitution' into 'main'
Fix default file path substitution in the ARM and man pages

See merge request isc-projects/bind9!6189
2022-05-02 15:11:12 +00:00
Petr Špaček
cd31391294 Fix default file path substitution in the ARM and man pages
Default paths were not substituted correctly when Python-only build was
used, i.e. it affected only ReadTheDocs. The incorrect rst_epilog was
overriden by Makefile for all "ordinary" builds.

This error was introduced by 3f78c60539.

Related: !5815
2022-05-02 17:09:17 +02:00
Mark Andrews
9d3b108a16 Merge branch '3266-rndc-system-test-fails-due-to-rate-limit-of-built-in-_bind-view' into 'main'
improve forensics in rndc system test

See merge request isc-projects/bind9!6098
2022-05-02 14:16:02 +00:00
Mark Andrews
614cf5a030 Improve forensics for the querylog section of rndc system test
The dig commands appear to be failing unexpectedly on some platforms
when rate limiting kicks in and the response is dropped.  Correct
behaviour should be for dig to retry the query.  Set +qr and capture
stdout and stderr of each of the dig commands involved.
2022-05-02 13:57:49 +00:00
Mark Andrews
c1036021e1 Merge branch '3317-cid-352554-1-of-1-dereference-before-null-check-reverse_inull' into 'main'
Resolve "CID 352554 (#1 of 1): Dereference before null check (REVERSE_INULL)"

Closes #3317

See merge request isc-projects/bind9!6239
2022-05-02 13:56:57 +00:00
Mark Andrews
30f3d51368 Remove unnecessary NULL pointer check
3034                next = ISC_LIST_NEXT(query, link);
    3035        } else {
    3036                next = NULL;
    3037        }

    CID 352554 (#1 of 1): Dereference before null check (REVERSE_INULL)
    check_after_deref: Null-checking connectquery suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    3038        if (connectquery != NULL) {
    3039                query_detach(&connectquery);
    3040        }
2022-05-02 13:39:25 +00:00
Mark Andrews
2f488546d5 Merge branch 'bug/main/dlz-modules' into 'main'
Fix few warnings in DLZ modules

See merge request isc-projects/bind9!5778
2022-05-02 05:04:34 +00:00
Mark Andrews
c938d41976 Add CHANGES entry for [GL !5778] 2022-05-02 14:46:36 +10:00
Petr Mensik
be39b3d84c Fix few warnings in DLZ modules
Also make similar change to ldap module. Change few public functions in
module to dlz_<module> prefix, so they cannot collide with used library.
2022-05-02 04:36:13 +00:00
Mark Andrews
d96d231ef0 Merge branch '3318-typo-in-rndc-man-page' into 'main'
Resolve "typo in rndc man page"

Closes #3318

See merge request isc-projects/bind9!6240
2022-05-02 02:58:36 +00:00
Mark Andrews
22c2402393 Fix typo, withdraw should be withdrawn 2022-05-02 12:50:46 +10:00
Matthijs Mekking
9c12720f3d Merge branch 'matthijs-kasp-system-test-failure' into 'main'
Fix kasp system test failures

See merge request isc-projects/bind9!6223
2022-04-29 11:56:30 +00:00
Matthijs Mekking
3e1d09ac66 Fix a kasp system test bug
In '_check_apex_dnskey' we check for each key (KEY1 to KEY4) if they
are present in the DNSKEY RRset if they should be.

However, we only grep the dig output for the first seven fields (owner,
ttl, class, type, flags, protocol, algorithm). This can be the same
for different keys.

For example, KEY1 may be KSK predecessor and KEY2 a KSK successor,
both DNSKEY records for these keys are the same up to the public key
field. This can cause test failures if KEY1 needs to be present, but
KEY2 not, because when grepping for KEY2 we will falsely detect the
key to be present (because the grep matches KEY1).

Fix the function by grepping looking for the first seven fields in the
corresponding key file and retrieve the public key part. Grep for this
in the dig output.
2022-04-29 13:38:09 +02:00
Matthijs Mekking
2b34b326fc Minor fixes in kasp system test
Fix two typos and two grep calls.
2022-04-29 13:38:09 +02:00
Arаm Sаrgsyаn
c5c1aa9dbb Merge branch '3278-placeholder' into 'main'
Add placeholder for [GL #3278]

See merge request isc-projects/bind9!6234
2022-04-29 08:59:50 +00:00
Aram Sargsyan
fa108f52c6 Add placeholder for [GL #3278] 2022-04-29 08:44:15 +00:00
Petr Špaček
16dcc7741b Merge branch 'feature/main/default-config-print' into 'main'
Export built-in default configuration for named binary

See merge request isc-projects/bind9!6016
2022-04-29 08:06:43 +00:00
Petr Menšík
cf722d18b3 Export built-in default configuration for named binary
It might be useful to display built-in configuration with all its
values. It should make it easier to test what default values has changed
in a new release.

Related: #1326
2022-04-29 09:52:35 +02:00
Mark Andrews
177626c551 Merge branch '3241-cid-351290-control-flow-issues-deadcode' into 'main'
Resolve "CID 351290:  Control flow issues  (DEADCODE)"

Closes #3241

See merge request isc-projects/bind9!6232
2022-04-29 04:53:49 +00:00
Mark Andrews
648ee54752 Remove dead code, result cannot be ISC_R_SUSPEND
*** CID 351290:  Control flow issues  (DEADCODE)
    /lib/dns/client.c: 1027 in dns_client_resolve()
    1021     	if (!client->readydone) {
    1022     		WAIT(&client->ready, &client->readylock);
    1023     	}
    1024     	UNLOCK(&client->readylock);
    1025
    1026     	LOCK(&resarg->lock);
    >>>     CID 351290:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach the expression "result == ISC_R_SUSPEND" inside this statement: "if (result == ISC_R_SUCCESS...".
    1027     	if (result == ISC_R_SUCCESS || result == ISC_R_SUSPEND) {
    1028     		result = resarg->result;
    1029     	}
    1030     	if (result != ISC_R_SUCCESS && resarg->vresult != ISC_R_SUCCESS) {
    1031     		/*
    1032     		 * If this lookup failed due to some error in DNSSEC
2022-04-29 12:25:25 +10:00
Mark Andrews
043d4f0ae0 Merge branch 'bug/main/new-zones-dir-null' into 'main'
Assorted coverity fixes

See merge request isc-projects/bind9!5735
2022-04-29 01:42:02 +00:00
Petr Menšík
656a0f076f Additional safety check for negative array index
inet_ntop result should always protect against empty string accepted
without an error. Make additional check to satisfy coverity scans.
2022-04-29 11:22:40 +10:00
Petr Menšík
59132bd3ec Initialize printed buffer
- var_decl: Declaring variable "tbuf" without initializer
- assign: Assigning: "target.base" = "tbuf", which points to
  uninitialized data
- assign: Assigning: "r.base" = "target.base", which points to
  uninitialized data

I expect it would correctly initialize length always. Add simple
initialization to silent coverity.
2022-04-29 11:22:40 +10:00
Petr Menšík
67e773c93c Ensure diff variable is not read uninitialized
Coverity detected issues:
- var_decl: Declaring variable "diff" without initializer.
- uninit_use_in_call: Using uninitialized value "diff.tuples.head" when
  calling "dns_diff_clear".
2022-04-29 11:22:40 +10:00
Petr Menšík
0a7d04367a Don't test new-zones-directory argument validity
Parser ensures new-zones-directory has qstring parameter before it can
reach this place. dir == NULL then should never happen on any
configuration. Replace silent check with insist.
2022-04-29 11:22:40 +10:00
Mark Andrews
98c347c062 Merge branch '3306-undefined-macros-in-contrib-dlz-modules-wildcard-dlz_wildcard_dynamic-c' into 'main'
Resolve "Undefined macros in contrib/dlz/modules/wildcard/dlz_wildcard_dynamic.c"

Closes #3306

See merge request isc-projects/bind9!6203
2022-04-29 00:51:09 +00:00
Mark Andrews
c57363fb7d Add CHANGES note for [GL #3306] 2022-04-29 10:21:39 +10:00
Mark Andrews
6d68a22954 Define local instances of FALLTHROUGH and UNREACHABLE
FALLTHOUGH is a copy of how it is defined in <isc/util.h>

UNREACHABLE follows the model used in MacOS /usr/include/c++/v1/cstdlib
to determine if __builtin_ureachable is available
2022-04-29 10:12:46 +10:00
Mark Andrews
48882f6cb2 Merge branch '3296-check-the-algorithm-name-oid-for-privatedns-and-privateoid-signatures' into 'main'
Resolve "Check the algorithm name / oid for PRIVATEDNS and PRIVATEOID signatures."

Closes #3296

See merge request isc-projects/bind9!6149
2022-04-28 23:32:14 +00:00
Mark Andrews
ac5023bf66 Add release note entry for [GL #3296] 2022-04-28 15:54:44 -07:00
Mark Andrews
cb8474fab2 Add CHANGES entry for [GL #3296] 2022-04-28 15:54:44 -07:00
Mark Andrews
3e857065de Check that SIG and RRSIG records for private algorithms are valid
SIG and RRSIG records for private algorithms are supposed to contain
the name / OID of the algorithm used to generate them at the start
of the signature field.
2022-04-28 15:54:27 -07:00
Ondřej Surý
6d960743a6 Merge branch '2813-build-named-with-dlz-is-broken-with-MariaDB-10' into 'main'
Use MARIADB_BASE_VERSION instead of LIBMARIADB to detect Maria DB

Closes #2813

See merge request isc-projects/bind9!6213
2022-04-28 16:01:30 +00:00
Ondřej Surý
5835aae694 Use MARIADB_BASE_VERSION instead of LIBMARIADB to detect Maria DB
It was discovered that MariaDB 10 didn't define LIBMARIADB leading
to compilation errors of MySQL DLZ modules on Debian stretch.

Use MARIADB_BASE_VERSION instead which is defined in all tested MariaDB
versions.
2022-04-28 18:00:50 +02:00
Arаm Sаrgsyаn
f4139bbbc4 Merge branch '3225-catz-member-zone-reset' into 'main'
[5/5] Document catalog zones member zone reset by change of unique label

Closes #3225

See merge request isc-projects/bind9!6015
2022-04-28 15:27:05 +00:00
Aram Sargsyan
2f2e02ff0c Document catalog zones member zone reset by change of unique label
The DNS catalog zones draft version 5 document requires that catalog
zones consumers must reset the member zone's internal zone state when
its unique label changes (either within the same catalog zone or
during change of ownership performed using the "coo" property).

BIND already behaves like that, and, in fact, doesn't support keeping
the zone state during change of ownership even if the unique label
has been kept the same, because BIND always removes the member zone
and adds it back during unique label renaming or change of ownership.

Document the described behavior and add a log message to inform when
unique label renaming occurs.

Add a system test case with unique label renaming.
2022-04-28 14:04:28 +00:00
Arаm Sаrgsyаn
0f7dc7cbeb Merge branch '3224-catz-broken-catalog-zones-concept-support' into 'main'
[4/5] Introduce the concept of broken catalog zones

Closes #3224

See merge request isc-projects/bind9!6014
2022-04-28 13:19:12 +00:00
Aram Sargsyan
84d3aba4f3 Remove reduntant checks of 'rdclass' in catz.c
We check the `rdclass` to be of type IN in `dns_catz_update_process()`
function, and all the other static functions where similar checks exist
are called after (and in the result of) that function being called,
so they are effectively redundant.
2022-04-28 12:40:03 +00:00
Aram Sargsyan
5bfe655835 Add new catz system test to check a version property with invalid type
There is already a check for the missing version property case
(catalog-bad1.example), and this new test should result in the same
outcome, but differs in a way that there exists a version record in the
zone, but it is of a wrong type (A instead of the expected TXT).
2022-04-28 12:40:03 +00:00
Aram Sargsyan
247ae534a0 Add a system test to check catalog zones with non-IN rdata class fail
According to DNS catalog zones draft version 5 document, the CLASS field
of every RR in a catalog zone MUST be IN.

Add a new check in the catz system test to verify that a non-IN class
catalog zone (in this case CH) fails to load.

BIND does not support having a non-IN class RR in an IN class zone, or
non-IN class zone in an IN class view, so to verify that BIND respects
the mentioned restriction we must try to add a non-IN class catalog
zone and check that it didn't succeed.

The `named` configuration files had to be restructured to put all the
zones inside views, which also resulted in some corresponding changes
in the tests.sh script.
2022-04-28 12:40:03 +00:00
Aram Sargsyan
dfd5a01eba Add a new warning message when processing view configuration
When parsing the configuration file, log a warning message in
configure_view() function when encountering a `catalog-zones`
option in a view with non-IN rdata class.
2022-04-28 12:37:30 +00:00
Aram Sargsyan
92d1e1e347 Add CHANGES note for [GL #3224] 2022-04-28 12:37:29 +00:00
Aram Sargsyan
a8228d5f19 Introduce the concept of broken catalog zones
The DNS catalog zones draft version 5 document describes various
situations when a catalog zones must be considered as "broken" and
not be processed.

Implement those checks in catz.c and add corresponding system tests.
2022-04-28 12:36:58 +00:00
Matthijs Mekking
8b506335cc Merge branch '2267-extended-errors-stale-data' into 'main'
Add stale answer extended errors

Closes #2267

See merge request isc-projects/bind9!6148
2022-04-28 09:33:40 +00:00
Matthijs Mekking
a320f4ed04 Add CHANGES and release notes for #2267 2022-04-28 09:58:51 +02:00
Matthijs Mekking
c66b9abc0b Add stale answer extended errors
Add DNS extended errors 3 (Stale Answer) and 19 (Stale NXDOMAIN Answer)
to responses. Add extra text with the reason why the stale answer was
returned.

To test, we need to change the configuration such that for the first
set of tests the stale-refresh-time window does not interfer with the
expected extended errors.
2022-04-28 09:58:25 +02:00
Ondřej Surý
c5beb2b7d0 Merge branch 'ondrej-zone.c-refactor-me-into-__func__' into 'main'
In zone.c, use __func__ instead of hand-crafted me strings

See merge request isc-projects/bind9!6197
2022-04-28 07:28:59 +00:00
Ondřej Surý
196ec365c7 In zone.c, use __func__ instead of hand-crafted me strings
In zone.c, the "me" strings were defined for functions that could be
traced with "ENTER" macro.

Use the __func__ that's defined by the compiler and is less prone to
copy&paste errors.
2022-04-28 09:18:05 +02:00
Evan Hunt
fcb3373269 Merge branch '3272-shutdown-deadlock' into 'main'
prevent a deadlock in the shutdown system test

Closes #3272

See merge request isc-projects/bind9!6205
2022-04-28 06:56:20 +00:00
Evan Hunt
6bcf3e5c31 CHANGES for [GL #3272] 2022-04-27 23:26:09 -07:00
Evan Hunt
5c4cf3fcc4 prevent a deadlock in the shutdown system test
The shutdown test sends 'rdnc status' commands in parallel with
'rndc stop' A new rndc connection arriving will reference the ACL
environment to see whether the client is allowed to connect.
Commit c0995bc380 added a mutex lock to ns_interfacemgr_getaclenv(),
but if the new connection arrives while the interfaces are being
purged during shutdown, that lock is already being held. If the
the connection event slips in ahead of one of the netmgr's "stop
listening" events on a worker thread, a deadlock can occur.

The fix is not to hold the interfacemgr lock while shutting down
interfaces; only while actually traversing the interface list to
identify interfaces needing shutdown.
2022-04-27 23:25:57 -07:00
Mark Andrews
dbafb3bdd0 Merge branch 'marka-placeholder' into 'main'
Add placeholder for !6157

See merge request isc-projects/bind9!6206
2022-04-28 06:07:30 +00:00
Mark Andrews
f651b852f3 Add placeholder for !6157 2022-04-28 16:01:27 +10:00
Evan Hunt
85e362360a Merge branch '2969-refactor-fctx_done' into 'main'
refactor fctx_done() to set fctx to NULL

Closes #2969

See merge request isc-projects/bind9!6188
2022-04-27 20:30:00 +00:00
Evan Hunt
f8c0cabca1 CHANGES for [GL #2969] 2022-04-27 10:54:28 -07:00
Evan Hunt
7b2ea97e46 refactor resume_dsfetch()
clean up resume_dsfetch() so that the fctx reference counting is
saner and easier to follow.
2022-04-27 10:54:28 -07:00
Evan Hunt
d2f407cca3 refactor validated()
minor changes to ensure that fctx reference counting is clear and correct.
2022-04-27 10:54:28 -07:00
Evan Hunt
7c5afebcdc rename maybe_destroy() to maybe_cancel_validators()
the maybe_destroy() function no longer destroys the fctx,
so rename it and update the comments.
2022-04-27 10:54:28 -07:00
Evan Hunt
b4592d02a1 refactor fctx_done() to set fctx to NULL
previously fctx_done() detached the fctx but did not clear the pointer
passed into it from the caller.  in some conditions, when rctx_done()
was reached while waiting for a validator to complete, fctx_done()
could be called twice on the same fetch, causing a double detach.

fctx_done() now clears the fctx pointer, to reduce the chances of
such mistakes.
2022-04-27 10:54:28 -07:00
Artem Boldariev
02177be39b Merge branch '3274-fix-test-server-for-solaris' into 'main'
Rename yield() to the test_server_yield()

Closes #3274

See merge request isc-projects/bind9!6122
2022-04-27 17:05:51 +00:00
Artem Boldariev
6b56dc56c8 Rename yield() to the test_server_yield()
This commit ensures that the test_server binary will build on Solaris,
which has yield() definition within 'unistd.h'.
2022-04-27 19:58:38 +03:00
Arаm Sаrgsyаn
51edc7f5c0 Merge branch '3300-dispatch-udp_recv-handle-deactivated-resp-returning-success' into 'main'
Handle ISC_R_SUCCESS on a deactivated response in udp_recv()

Closes #3300

See merge request isc-projects/bind9!6194
2022-04-27 16:34:34 +00:00
Aram Sargsyan
bbdd139e20 Add CHANGES note for [GL #3300] 2022-04-27 15:53:52 +00:00
Aram Sargsyan
e3a88862c0 Handle ISC_R_SUCCESS on a deactivated response in udp_recv()
There is a possibility for `udp_recv()` to be called with `eresult`
being `ISC_R_SUCCESS`, but nevertheless with already deactivated `resp`,
which can happen when the request has been canceled in the meantime.
2022-04-27 15:53:14 +00:00
Artem Boldariev
f22094d485 Merge branch '3271-tlsdns-call-write-callbacks-after-send' into 'main'
TLSDNS: call send callbacks only after the data was sent

Closes #3271

See merge request isc-projects/bind9!6128
2022-04-27 15:37:04 +00:00
Artem Boldariev
978f97dcdd TLSDNS: call send callbacks after only the data was sent
This commit ensures that write callbacks are getting called only after
the data has been sent via the network.

Without this fix, a situation could appear when a write callback could
get called before the actual encrypted data would have been sent to
the network. Instead, it would get called right after it would have
been passed to the OpenSSL (i.e. encrypted).

Most likely, the issue does not reveal itself often because the
callback call was asynchronous, so in most cases it should have been
called after the data has been sent, but that was not guaranteed by
the code logic.

Also, this commit removes one memory allocation (netievent) from a hot
path, as there is no need to call this callback asynchronously
anymore.
2022-04-27 17:44:23 +03:00
Artem Boldariev
f83f8b065b Merge branch '3285-dig-do-not-hang-on-tlsctx-errors' into 'main'
Dig: do not hang on TLS context creation errors (Resolve #3285)

Closes #3285

See merge request isc-projects/bind9!6131
2022-04-27 14:02:03 +00:00
Artem Boldariev
1ec84f8d8d Update CHANGES [GL #3285]
Mention that dig hanging on TLS context creation errors has been
fixed.
2022-04-27 16:29:00 +03:00
Artem Boldariev
5db2838abb Dig: do not hang on TLS context creation errors
There was a query_detach() call missing in dig, which could lead to
dig hanging on TLS context creation errors. This commit fixes.

The error was introduced because the Strict TLS implementation was
initially made over an older version of the code, where this extra
query_detach() call was not needed.
2022-04-27 16:28:23 +03:00
Petr Špaček
19b9c2ecf7 Merge branch 'pspacek/pin-sphinx-packages-for-rtd' into 'main'
Pin Sphinx related package versions to match ReadTheDocs and our CI

See merge request isc-projects/bind9!6190
2022-04-27 12:34:38 +00:00
Petr Špaček
6088ba3837 Pin Sphinx related package versions to match ReadTheDocs and our CI
This seems to be most appropriate way to ensure consistency between
release tarballs and public presentation on ReadTheDocs.

Previous attempt with removing docutils constraint, which relied on pip
depedency solver to pick the same packages as in CI was flawed. RTD
installs a bit different set of packages so it was inherently
unreliable.

As a result RTD pulled in sphinx-rtd-theme==0.4.3 while CI
had 1.0.0, and this inconsistency caused Table of Contents in Release
Notes to render incorrectly. Previous solution was to downgrade
docutils to < 0.17, but I think we should rather pin exact versions.

For the long history of messing with versions read also
isc-projects/bind9@2a8eda0084
isc-projects/images@d4435b97be
isc-projects/bind9@6a2daddf5b
2022-04-27 14:33:45 +02:00
Tony Finch
4b7d86f5a9 Merge branch 'fanf-rbt-demacro' into 'main'
Reduce rbt macrology

See merge request isc-projects/bind9!6158
2022-04-27 12:05:30 +00:00
Tony Finch
a497858775 CHANGES note for [GL !6158]
[cleanup]	Remove redundant macros in the RBT implementation.
2022-04-27 11:05:53 +01:00
Tony Finch
72b23aafd2 Apply clang-format to rbt.c
Giving the code a proper spring cleaning
2022-04-27 11:05:05 +01:00
Tony Finch
b0bf49726e Clean up a few rbt comments
Avoid HTML entities, and describe what a function does
instead of explaining why it used to be a macro.
2022-04-27 11:05:05 +01:00
Tony Finch
084f146946 Fix style of a function name in rbt.c
Mechanically generated with:

:; spatch --no-show-diff --in-place --sp-file <<END lib/dns/rbt.c
@@ expression node, name; @@
- NODENAME(node, name)
+ node_name(node, name)
@@ parameter list params; @@
  static void
- NODENAME(params)
+ node_name(params)
  { ... }
END
2022-04-27 11:05:05 +01:00
Tony Finch
8adae2d813 Remove redundant rbt macro definitions
After the previous commit, these macros are no longer used.
2022-04-27 11:05:05 +01:00
Tony Finch
bee1c91b0a Remove do-nothing rbt macro calls
Pointer chasing reads better like left->right instead of RIGHT(left)

Mechanically generated with:

:; spatch --no-show-diff --in-place --sp-file <<END lib/dns/rbt.c
@@ expression node; @@
- PARENT(node)
+ node->parent
@@ expression node; @@
- LEFT(node)
+ node->left
@@ expression node; @@
- RIGHT(node)
+ node->right
@@ expression node; @@
- DOWN(node)
+ node->down
@@ expression node; @@
- UPPERNODE(node)
+ node->uppernode
@@ expression node; @@
- DATA(node)
+ node->data
@@ expression node; @@
- IS_EMPTY(node)
+ node->data == NULL
@@ expression node; @@
- HASHNEXT(node)
+ node->hashnext
@@ expression node; @@
- HASHVAL(node)
+ node->hashval
@@ expression node; @@
- COLOR(node)
+ node->color
@@ expression node; @@
- NAMELEN(node)
+ node->namelen
@@ expression node; @@
- OLDNAMELEN(node)
+ node->oldnamelen
@@ expression node; @@
- OFFSETLEN(node)
+ node->offsetlen
@@ expression node; @@
- ATTRS(node)
+ node->attributes
@@ expression node; @@
- IS_ROOT(node)
+ node->is_root
@@ expression node; @@
- FINDCALLBACK(node)
+ node->find_callback
@@ expression node; @@
- DIRTY(node)
+ node->dirty
@@ expression node; @@
- WILD(node)
+ node->wild
@@ expression node; @@
- LOCKNUM(node)
+ node->locknum
@@ expression node; @@
- MAKE_RED(node)
+ node->color = RED
@@ expression node; @@
- MAKE_BLACK(node)
+ node->color = BLACK
END
2022-04-27 11:05:05 +01:00
Ondřej Surý
fcab10a26e Merge branch '3299-fix-AX_PROG_CC_FOR_BUILD-macro' into 'main'
Fix the cached value of ac_cv_c_compiler_gnu

Closes #3299

See merge request isc-projects/bind9!6183
2022-04-26 13:47:11 +00:00
Ondřej Surý
4a9f899b5c Fix the cached value of ac_cv_c_compiler_gnu
There was an error in AX_PROG_CC_FOR_BUILD macro that cached literal
name of the cache variable `saved_ac_cv_c_compiler_gnu` instead of the
value of said variable breaking the consecutive runs of ./configure
script with caching enabled.
2022-04-26 15:45:47 +02:00
Petr Špaček
ba198b1979 Merge branch 'pspacek/rtd-requirements-update' into 'main'
Fix mismatch between docutils version in CI and ReadTheDocs

See merge request isc-projects/bind9!6182
2022-04-26 13:33:12 +00:00
Petr Špaček
2a8eda0084 Fix mismatch between docutils version in CI and ReadTheDocs
Currently our CI images we use to build docs (which subsequently get
into release tarballs) are using docutils 0.17.1, which is latest version
which fulfills Sphinx 4.5.0 requirement for docutils < 0.18.

The old requirement for docutils < 0.17 was causing discrepancy between
the way we build release artifacts and the docs on ReadTheDocs.org which
uses doc/arm/requirements.txt from our repo.

Remove the limit for RDT with hope that it will pull latest permissible
version of docutils.

For the long history of messing with docutils version read also
isc-projects/images@d4435b97be
isc-projects/bind9@6a2daddf5b
2022-04-26 14:28:11 +02:00
Ondřej Surý
31f1eab8be Merge branch '3288-adb-cancelfind-race' into 'main'
lock find when unlinking adbname->finds in dns_adb_cancelfind()

Closes #3288

See merge request isc-projects/bind9!6141
2022-04-26 11:34:44 +00:00
Evan Hunt
a1e9a59e2b lock find when unlinking adbname->finds in dns_adb_cancelfind()
In dns_adb_cancelfind(), we need to release the find lock and
then acquire the bucket and find locks in that order, for
consistency with locking hierarchy elsehwere. Previously we
were only acquiring the bucket lock.

Also rewrote the function for better readability.
2022-04-26 12:59:59 +02:00
Petr Špaček
227b488418 Merge branch '3301-support-sphinx-149' into 'main'
Split negative and positive dig/mdig/delv options to support Sphinx 1.4.9

Closes #3301

See merge request isc-projects/bind9!6175
2022-04-26 10:43:28 +00:00
Petr Špaček
ac0c2378ca Add hyperlinks to dig/mdig/delv +options 2022-04-26 12:43:13 +02:00
Petr Špaček
0342dddce7 Split negative and positive dig/mdig/delv options to support Sphinx 1.4.9
Man pages for dig/mdig/delv used `.. option:: +[no]bla` to describe two
options at once, and very old Sphinx does not support that [] in option
names.

Solution is to split negative and positive options into `+bla, +nobla`
form. In the end it improves readability because it transforms hard to
read strings with double brackets from
`+[no]subnet=addr[/prefix-length]` to
`+subnet=addr[/prefix-length], +nosubnet`.

As a side-effect it also allows easier linking to dig/mdig/delv options
using their name directly instead of always overriding the link target
to `+[no]bla` form.

Transformation was done using regex:
    s/:: +\[no\]\(.*\)/:: +\1, +no\1
... and manual review around occurences matching regex
    +no.*=

Fixes: #3301
2022-04-26 12:43:09 +02:00
Ondřej Surý
0d90b40bd2 Merge branch '835-use-UV_UDP_LINUX_RECVERR-to-detect-destination-unreachable' into 'main'
Set IP(V6)_RECVERR on connect UDP sockets (via libuv)

Closes #835

See merge request isc-projects/bind9!6171
2022-04-26 10:41:08 +00:00
Ondřej Surý
834a2ddb4e Add CHANGES note for [GL #4251] 2022-04-26 12:22:18 +02:00
Ondřej Surý
407b37c3f2 Set IP(V6)_RECVERR on connect UDP sockets (via libuv)
The connect()ed UDP socket provides feedback on a variety of ICMP
errors (eg port unreachable) which bind can then use to decide what to
do with errors (report them to the client, try again with a different
nameserver etc).  However, Linux's implementation does not report what
it considers "transient" conditions, which is defined as Destination
host Unreachable, Destination network unreachable, Source Route Failed
and Message Too Big.

Explicitly enable IP_RECVERR / IPV6_RECVERR (via libuv uv_udp_bind()
flag) to learn about ICMP destination network/host unreachable.
2022-04-26 12:22:18 +02:00
Ondřej Surý
7b506384f0 Merge branch 'ondrej-enforce-minimal-libuv-version' into 'main'
Abort when libuv at runtime mismatches libuv at compile time

See merge request isc-projects/bind9!6176
2022-04-26 10:21:43 +00:00
Ondřej Surý
eb8f2974b1 Abort when libuv at runtime mismatches libuv at compile time
When we compile with libuv that has some capabilities via flags passed
to f.e. uv_udp_listen() or uv_udp_bind(), the call with such flags would
fail with invalid arguments when older libuv version is linked at the
runtime that doesn't understand the flag that was available at the
compile time.

Enforce minimal libuv version when flags have been available at the
compile time, but are not available at the runtime.  This check is less
strict than enforcing the runtime libuv version to be same or higher
than compile time libuv version.
2022-04-26 11:40:40 +02:00
Ondřej Surý
ed4dd7bef7 Merge branch 'ondrej-fix-route_recv-use-after-free' into 'main'
The route socket and its storage was detached while still reading

See merge request isc-projects/bind9!6169
2022-04-25 15:42:38 +00:00
Ondřej Surý
9ae34a04e8 The route socket and its storage was detached while still reading
The interfacemgr and the .route was being detached while the network
manager had pending read from the socket.  Instead of detaching from the
socket, we need to cancel the read which in turn will detach the route
socket and the associated interfacemgr.
2022-04-25 17:19:33 +02:00
Tony Finch
2be07a4316 Merge branch 'fanf-random-failures' into 'main'
Revert "Move random number re-seeding out of the hot path"

See merge request isc-projects/bind9!6172
2022-04-25 15:13:51 +00:00
Tony Finch
b2950c96de Revert "Move random number re-seeding out of the hot path"
This reverts commit b1bb41603e.
2022-04-25 15:18:58 +01:00
Petr Špaček
eaaf59d1e6 Merge branch '3295-support-sphinx-185' into 'main'
Use unique program + option names for link anchors to support Sphinx 1.8.5

Closes #3295

See merge request isc-projects/bind9!6167
2022-04-25 12:45:59 +00:00
Petr Špaček
bbb24264bb Use unique program + option names for link anchors to support Sphinx 1.8.5
Sphinx "standard domain" provides directive types ".. program::" and
".. option::" to create link anchor for a program name + option combination.
These can be referenced using :ref:`program option` syntax.

The problem is that Sphinx 1.8.5 (e.g. in Ubuntu 18.04) generates
conflicting link targets if a page contains two option directives
starting with the same word, e.g.:

.. program:: dnssec-settime
.. option:: -P date
.. option:: -P ds date

The reason is that option directive consumes only first word as "option
name" (-P) and all the rest is considered "option argument" (date, ds
date). Newer versions of Sphinx (e.g. 4.5.0) handle this by creating
numbered link anchors, but older versions warn and BIND build system
turns the warning into a hard error.

To handle that we use method recommended by Sphinx maintainer:
https://github.com/sphinx-doc/sphinx/issues/10218#issuecomment-1059925508
As a bonus it provides more accurate link anchors for sub-options.

Alternatives considered:
- Replacing standard domain definition of .. option - causes more
  problems, see BIND issue #3294.
- Removing hyperlinks for options - that would be a step back.

Fixes: #3295
2022-04-25 14:27:34 +02:00
Tony Finch
870f785e49 Merge branch 'fanf-lemire-nearly-divisionless' into 'main'
Make isc_random_uniform() nearly divisionless

See merge request isc-projects/bind9!6161
2022-04-22 17:38:34 +00:00
Tony Finch
719638639e CHANGES note for [GL !6161]
[cleanup]	Use Daniel Lemire's "nearly divisionless" algorithm
		for unbiased bounded random numbers, and move
		re-seeding out of the hot path.
2022-04-22 16:41:19 +01:00
Tony Finch
b1bb41603e Move random number re-seeding out of the hot path
Instead of checking if we need to re-seed for every isc_random call,
seed the random number generator in the libisc global initializer
and the per-thread initializer.
2022-04-22 16:40:37 +01:00
Tony Finch
254d2abafb Clean up isc_random
Remove redundant comments and avoid implicit casts.
2022-04-22 16:40:37 +01:00
Tony Finch
d20ea4a703 Make isc_random_uniform() nearly divisionless
It used to require two 32-bit integer divisions to get a random number
less than some limit. Now we use Daniel Lemire's "nearly-divisionless"
algorithm for unbiased bounded random numbers, which requires one
64-bit integer multiply in the usual case, and one 32-bit integer
division in rare slow cases. Even the slow cases are faster than
before; there are also fewer branches.

I think this algorithm is exceptionally beautiful. It also has more
clever tricks than lines of code, so I have done my best to explain
how it works.
2022-04-22 16:40:37 +01:00
Ondřej Surý
5d76ac686a Merge branch '3298-dont-check-exiting-in-dns__adb_attach' into 'main'
Allow attaching to dns_adb which is shutting down

Closes #3298

See merge request isc-projects/bind9!6165
2022-04-22 15:29:43 +00:00
Ondřej Surý
b37c173cf8 Add CHANGES note for [GL #3298] 2022-04-22 17:00:10 +02:00
Ondřej Surý
b55e8a959f Allow attaching to dns_adb which is shutting down
The dns__adb_attach() had an assertion failure that prevented to attach
to dns_adb if the dns_adb was shutting down.  There was a race between
checking for .exiting in dns_adb_createfind and creating new_adbfind() -
other thread could have set the .exiting to true between the check.

Remove the assertion failure and allow attaching to dns_adb even while
shutting down.  The process of dns_adb shutting down would be noticed
only a moments later when any other callback is called.
2022-04-22 16:48:37 +02:00
Ondřej Surý
4d216e68ab Merge branch 'ondrej-use-correct-task-for-resume_dslookup' into 'main'
Use right task for the internal dns_resolver fetches

See merge request isc-projects/bind9!6163
2022-04-22 13:42:53 +00:00
Ondřej Surý
741a7096fc Run resume_dslookup() from the correct task
The rctx_chaseds() function calls dns_resolver_createfetch(), passing
fctx->task as the target task to run resume_dslookup() from.  This
breaks task-based serialization of events as fctx->task is the task that
the dns_resolver_createfetch() caller wants to receive its fetch
completion event in; meanwhile, intermediate fetches started by the
resolver itself (e.g. related to QNAME minimization) must use
res->buckets[bucketnum].task instead.  This discrepancy may cause
trouble if the resume_dslookup() callback happens to be run concurrently
with e.g. fctx_doshutdown().

Fix by passing the correct task to dns_resolver_createfetch() in
rctx_chaseds().
2022-04-22 14:25:32 +02:00
Michał Kępień
0136eb0450 Merge branch 'michal/fix-loading-plugins-using-just-their-filenames' into 'main'
Fix loading plugins using just their filenames

See merge request isc-projects/bind9!6142
2022-04-22 11:31:38 +00:00
Michał Kępień
5065c4686e Fix loading plugins using just their filenames
BIND 9 plugins are installed using Automake's pkglib_LTLIBRARIES stanza,
which causes the relevant shared objects to be placed in the
$(libdir)/@PACKAGE@/ directory, where @PACKAGE@ is expanded to the
lowercase form of the first argument passed to AC_INIT(), i.e. "bind".
Meanwhile, NAMED_PLUGINDIR - the preprocessor macro that the
ns_plugin_expandpath() function uses for determining the absolute path
to a plugin for which only a filename has been provided (rather than a
path) - is set to $(libdir)/named.  This discrepancy breaks loading
plugins using just their filenames.  Fix the issue (and also prevent it
from reoccurring) by setting NAMED_PLUGINDIR to $(pkglibdir).
2022-04-22 13:27:12 +02:00
Michał Kępień
966fbd1615 Merge branch 'michal/regenerate-man-pages-with-sphinx-4.5.0' into 'main'
Regenerate man pages with Sphinx 4.5.0

See merge request isc-projects/bind9!6159
2022-04-22 11:15:56 +00:00
Michał Kępień
e80ce6cfe2 Regenerate man pages with Sphinx 4.5.0
The Debian 11 (bullseye) Docker image, which GitLab CI uses for building
documentation, currently contains the following package versions:

  - Sphinx 4.5.0
  - sphinx-rtd-theme 1.0.0
  - docutils 0.17.1

Regenerate the man pages to match contents produced in a Sphinx
environment using the above package versions.  This is necessary to
prevent the "docs" GitLab CI job from failing.
2022-04-22 13:05:10 +02:00
Michał Kępień
cb42b9b400 Merge branch '3297-fix-a-pylint-2.13.7-error' into 'main'
Fix a PyLint 2.13.7 error

Closes #3297

See merge request isc-projects/bind9!6150
2022-04-22 10:13:40 +00:00
Michał Kępień
3f5318f094 Fix a PyLint 2.13.7 error
PyLint 2.13.7 reports the following error:

    bin/tests/system/doth/conftest.py:34:28: E0601: Using variable 'stderr' before assignment (used-before-assignment)

The reason the current code has not caused problems before is that
invoking gnutls-cli with just the --logfile=/dev/null argument causes it
to always return with a non-zero exit code, either due to the option not
being supported or due to the hostname argument not being provided.  In
other words, the 'except' branch has always been taken.  PyLint is
obviously right on a syntactical level, though.

Instead of relying on a less than obvious code flow (where the 'except'
branch is always taken), rework the flagged code by employing
subprocess.run(..., check=False) instead of subprocess.check_output(),
making exception handling redundant.

While this issue was investigated, it was also noticed that
subprocess.check_output() was incorrectly used as a context manager:
Popen objects are context managers, but subprocess.check_output() and
subprocess.run() are not.  Fix by dropping the relevant 'with'
statement.
2022-04-22 11:25:27 +02:00
Michał Kępień
aaa0223752 Fix "digdelv" system test requirements
Commit 3ec5d2d6ed added a Python-based
name server (bin/tests/system/digdelv/ans8/ans.py) to the "digdelv"
system test, but did not update bin/tests/system/Makefile.am to ensure
Python is present in the test environment before the "digdelv" system
test is run.  Update bin/tests/system/Makefile.am to enforce that
requirement.
2022-04-22 11:25:27 +02:00
Michał Kępień
beaaa7f4e2 Require Python 3.6+ for running Python-based tests
configure.ac currently requires Python 3.4 for running Python-based
system tests.  Meanwhile, there are some features in Python 3.6+ that we
would like to use for making our Python code cleaner (e.g. f-strings).
Update the minimum Python version required for running Python-based
system tests to 3.6, noting that:

  - Python 3.4 has reached end-of-life on March 18th, 2019.
  - Python 3.5 has reached end-of-life on September 5th, 2020.
2022-04-22 11:25:27 +02:00
Michał Kępień
7f3b559b04 Merge branch '3287-prevent-memory-bloat-caused-by-a-jemalloc-quirk' into 'main'
Prevent memory bloat caused by a jemalloc quirk

Closes #3287

See merge request isc-projects/bind9!6137
2022-04-21 12:21:24 +00:00
Michał Kępień
e33aef4e39 Add CHANGES entry for GL #3287 2022-04-21 14:19:39 +02:00
Michał Kępień
7aa7b6474b Prevent memory bloat caused by a jemalloc quirk
Since version 5.0.0, decay-based purging is the only available dirty
page cleanup mechanism in jemalloc.  It relies on so-called tickers,
which are simple data structures used for ensuring that certain actions
are taken "once every N times".  Ticker data (state) is stored in a
thread-specific data structure called tsd in jemalloc parlance.  Ticks
are triggered when extents are allocated and deallocated.  Once every
1000 ticks, jemalloc attempts to release some of the dirty pages hanging
around (if any).  This allows memory use to be kept in check over time.

This dirty page cleanup mechanism has a quirk.  If the first
allocator-related action for a given thread is a free(), a
minimally-initialized tsd is set up which does not include ticker data.
When that thread subsequently calls *alloc(), the tsd transitions to its
nominal state, but due to a certain flag being set during minimal tsd
initialization, ticker data remains unallocated.  This prevents
decay-based dirty page purging from working, effectively enabling memory
exhaustion over time. [1]

The quirk described above has been addressed (by moving ticker state to
a different structure) in jemalloc's development branch [2], but not in
any numbered jemalloc version released to date (the latest one being
5.2.1 as of this writing).

Work around the problem by ensuring that every thread spawned by
isc_thread_create() starts with a malloc() call.  Avoid immediately
calling free() for the dummy allocation to prevent an optimizing
compiler from stripping away the malloc() + free() pair altogether.

An alternative implementation of this workaround was considered that
used a pair of isc_mem_create() + isc_mem_destroy() calls instead of
malloc() + free(), enabling the change to be fully contained within
isc__trampoline_run() (i.e. to not touch struct isc__trampoline), as the
compiler is not allowed to strip away arbitrary function calls.
However, that solution was eventually dismissed as it triggered
ThreadSanitizer reports when tools like dig, nsupdate, or rndc exited
abruptly without waiting for all worker threads to finish their work.

[1] https://github.com/jemalloc/jemalloc/issues/2251
[2] c259323ab3
2022-04-21 14:19:39 +02:00
Michał Kępień
4a0dbc9faf Merge branch 'michal/revise-release-related-git-workflow' into 'main'
Revise release-related Git workflow

See merge request isc-projects/bind9!6124
2022-04-21 07:59:24 +00:00
Michał Kępień
eb83b1a79f Update release checklist 2022-04-21 09:57:14 +02:00
Mark Andrews
c70f34c218 Merge branch '2898-improve-functions-parameter-validation-in-lib-dns-message-c-to-prevent-accessing-the-1-index' into 'main'
Resolve "Improve functions parameter validation in lib/dns/message.c to prevent accessing the -1 index of an array"

Closes #2898

See merge request isc-projects/bind9!5824
2022-04-19 22:13:47 +00:00
Mark Andrews
d4892f7cdc Tighten DBC restrictions on message sections
dns_message_findname and dns_message_sectiontotext incorrectly accepted
DNS_SECTION_ANY.  If DNS_SECTION_ANY was passed the section array could
be incorrectly accessed at (-1).

dns_message_pseudosectiontotext and dns_message_pseudosectiontoyaml
incorrectly accepted DNS_PSEUDOSECTION_ANY.  These functions are
designed to process a single section.
2022-04-19 22:12:38 +00:00
Tony Finch
3358f712c9 Merge branch '3275-notify-test-fix' into 'main'
Avoid timeouts in the notify system test

Closes #3275

See merge request isc-projects/bind9!6121
2022-04-19 17:10:59 +00:00
Tony Finch
f4c2909353 Use wait_for_log_re in the autosign system test
Fix another occurrence of the mistake of passing a regex to
wait_for_log by using the new wait_for_log_re instead.
2022-04-19 17:00:31 +01:00
Tony Finch
4a30733ae5 Avoid timeouts in the notify system test
There were two problems in the notify system test when it waited for
log messages to appear: the shellcheck refactoring introduced a call
to `wait_for_log` with a regex, but `wait_for_log` only supports fixed
strings, so it always ran for the full 45 second timeout; and the new
test to ensure that notify messages time out failed to reset the
nextpart pointer, so if the notify messages timed out before the test
ran, it would fail to see them.

This change adds a `wait_for_log_re` helper that matches a regex, and
uses it where appropriate in the notify system test, which stops the
test from waiting longer than necessary; and it resets the nextpart
pointer so that the notify timeout test works reliably.

Closes #3275
2022-04-19 17:00:31 +01:00
Ondřej Surý
670b1598d5 Merge branch 'ondrej-improve-taskmgr-tracing' into 'main'
Add detailed tracing when TASKMGR_TRACE is define

See merge request isc-projects/bind9!6036
2022-04-19 13:14:03 +00:00
Ondřej Surý
b090cb95b2 Merge branch 'ondrej/remove-isc-task-sendto' into 'main'
Remove isc_task_sendto(anddetach) functions

See merge request isc-projects/bind9!6139
2022-04-19 12:25:59 +00:00
Ondřej Surý
d1d88a2895 Add detailed tracing when TASKMGR_TRACE is defined
When TASKMGR_TRACE=1 is defined, the task and event objects have
detailed tracing information about function, file, line, and
backtrace (to the extent tracked by gcc) where it was created.

At exit, when there are unfinished tasks, they will be printed along
with the detailed information.
2022-04-19 14:25:23 +02:00
Ondřej Surý
f0feaa3305 Remove isc_task_sendto(anddetach) functions
The only place where isc_task_sendto() was used was in dns_resolver
unit, where the "sendto" part was actually no-op, because dns_resolver
uses bound tasks.  Remove the isc_task_sendto() and
isc_task_sendtoanddetach() functions in favor of using bound tasks
create with isc_task_create_bound().

Additionally, cache the number of running netmgr threads (nworkers)
locally to reduce the number of function calls.
2022-04-19 14:24:36 +02:00
Ondřej Surý
861f25d930 Merge branch 'ondrej/remove-isc_event_constallocate' into 'main'
Remove isc_event_constallocate()

See merge request isc-projects/bind9!6138
2022-04-19 12:23:30 +00:00
Ondřej Surý
1eeb4c1121 Remove isc_event_constallocate()
The isc_event_constallocate() function was not used anywhere, thus
remove the isc_event_constallocate() macro, declaration and definition.
2022-04-19 13:46:26 +02:00
Ondřej Surý
30687fcbb3 Merge branch 'ondrej-listen-on-specified-number-of-threads' into 'main'
Allow listening on less than nworkers threads

See merge request isc-projects/bind9!6032
2022-04-19 10:36:51 +00:00
Ondřej Surý
317d9547a9 Add CHANGES note for [GL !6032] 2022-04-19 11:11:30 +02:00
Ondřej Surý
f55a4d3e55 Allow listening on less than nworkers threads
For some applications, it's useful to not listen on full battery of
threads.  Add workers argument to all isc_nm_listen*() functions and
convenience ISC_NM_LISTEN_ONE and ISC_NM_LISTEN_ALL macros.
2022-04-19 11:08:13 +02:00
Mark Andrews
dad43a128d Merge branch '3234-check-the-oid-in-privateoid-keys' into 'main'
Resolve "Check the OID in PRIVATEOID keys"

Closes #3234

See merge request isc-projects/bind9!6045
2022-04-19 04:53:59 +00:00
Mark Andrews
9597d30186 Add release note for [GL #3234] 2022-04-19 14:35:35 +10:00
Mark Andrews
5a1c2b0b59 Add CHANGES note for [GL #3234] 2022-04-19 14:34:12 +10:00
Mark Andrews
69d30f8974 Check PRIVATEDNS and PRIVATEOID key identifiers
dns_rdata_fromtext and dns_rdata_fromwire now checks that there is
a valid name or oid at the start of the keydata when the key algorithm
is PRIVATEDNS and PRIVATEOID respectively.

dns_rdata_totext now prints out the oid if the algorithm is PRIVATEOID.
2022-04-19 14:32:56 +10:00
Mark Andrews
746b3ac88c Merge branch '3279-lib-dns-ncache-c-rdataset_settrust-fails-to-set-trust-on-called-rdataset' into 'main'
Resolve "lib/dns/ncache.c:rdataset_settrust() fails to set trust on called rdataset"

Closes #3279

See merge request isc-projects/bind9!6129
2022-04-18 23:36:59 +00:00
Mark Andrews
14ca6270d3 Add CHANGES entry for [GL #3279] 2022-04-19 08:38:26 +10:00
Mark Andrews
d043a41499 Update the rdataset->trust field in ncache.c:rdataset_settrust
Both the trust recorded in the slab stucture and the trust on
rdataset need to be updated.
2022-04-19 08:38:26 +10:00
Mark Andrews
d2d9910da2 Check that pending negative cache entries for DS can be used successfully
Prime the cache with a negative cache DS entry then make a query for
name beneath that entry. This will cause the DS entry to be retieved
as part of the validation process.  Each RRset in the ncache entry
will be validated and the trust level for each will be updated.
2022-04-19 08:38:26 +10:00
Evan Hunt
76bb33fbd5 Merge branch '3235-dig-exitcode' into 'main'
ensure dig sets exitcode after local UDP connection failure

Closes #3235

See merge request isc-projects/bind9!6107
2022-04-15 18:08:10 +00:00
Evan Hunt
d646aca282 CHANGES for [GL #3235] 2022-04-15 10:32:45 -07:00
Evan Hunt
4eee6460ff ensure dig sets exitcode after local UDP connection failure
dig previously set an exit code of 9 when a TCP connection failed
or when a UDP connection timed out, but when the server address is
localhost it's possible for a UDP query to fail with ISC_R_CONNREFUSED.
that code path didn't update the exit code, causing dig to exit with
status 0. we now set the exit code to 9 in this failure case.
2022-04-15 10:32:31 -07:00
Arаm Sаrgsyаn
9fb812763a Merge branch '3223-catz-change-of-ownership-aka-coo-support' into 'main'
[3/5] Implement catalog zones change of ownership (coo) support

Closes #3223

See merge request isc-projects/bind9!6013
2022-04-14 22:48:41 +00:00
Aram Sargsyan
99d1ec6c4b Do not use REQUIRE in dns_catz_entry_detach() after other code
The REQUIRE checks should be at the top of the function before
any assignments or code.

Move the REQUIRE check to the top.
2022-04-14 20:41:52 +00:00
Aram Sargsyan
59c486391d Replace CATZ_OPT_MASTERS with CATZ_OPT_PRIMARIES
Update the enum entry in the continued effort of replacing some
DNS terminology.
2022-04-14 20:41:52 +00:00
Aram Sargsyan
1c33dbd27d Add CHANGES note for [GL #3223] 2022-04-14 20:41:52 +00:00
Aram Sargsyan
bb837db4ee Implement catalog zones change of ownership (coo) support
Catalog zones change of ownership is special mechanism to facilitate
controlled migration of a member zone from one catalog to another.

It is implemented using catalog zones property named "coo" and is
documented in DNS catalog zones draft version 5 document.

Implement the feature using a new hash table in the catalog zone
structure, which holds the added "coo" properties for the catalog zone
(containing the target catalog zone's name), and the key for the hash
table being the member zone's name for which the "coo" property is being
created.

Change some log messages to have consistent zone name quoting types.

Update the ARM with change of ownership documentation and usage
examples.

Add tests which check newly the added features.
2022-04-14 20:41:52 +00:00
Arаm Sаrgsyаn
e8ba18906b Merge branch '3222-catz-options-new-syntax-based-on-custom-properties' into 'main'
[2/5] Implement catalog zones options new syntax based on custom properties

Closes #3222

See merge request isc-projects/bind9!6012
2022-04-14 19:49:00 +00:00
Aram Sargsyan
0b2d5490cd Do not cancel processing record datasets in catalog zone after an error
When there are multiple record datasets in a database node of a catalog
zone, and BIND encounters a soft error during processing of a dataset,
it breaks from the loop and doesn't process the other datasets in the
node.

There are cases when this is not desired. For example, the catalog zones
draft version 5 states that there must be a TXT RRset named
`version.$CATZ` with exactly one RR, but it doesn't set a limitation
on possible non-TXT RRsets named `version.$CATZ` existing alongside
with the TXT one. In case when one exists, we will get a processing
error and will not continue the loop to process the TXT RRset coming
next.

Remove the "break" statement to continue processing all record datasets.
2022-04-14 10:56:24 +00:00
Aram Sargsyan
6035980bb1 Process the 'version' record of the catalog zone first
When processing a new or updated catalog zone, the record datasets
from the database are being processed in order. This creates a
problem because we need to know the version of the catalog zone
schema to process some of the records differently, but we do not
know the version until the 'version' record gets processed.

Find the 'version' record and process it first, only then iterate over
the database to process the rest, making sure not to process the
'version' record twice.
2022-04-14 10:56:24 +00:00
Aram Sargsyan
321c93c05d Add CHANGES note for [GL #3222] 2022-04-14 10:56:23 +00:00
Aram Sargsyan
cedfebc64a Implement catalog zones options new syntax based on custom properties
According to DNS catalog zones draft version 5 document, catalog
zone custom properties must be placed under the "ext" label.

Make necessary changes to support the new custom properties syntax in
catalog zones with version "2" of the schema.

Change the default catalog zones schema version from "1" to "2" in
ARM to prepare for the new features and changes which come starting
from this commit in order to support the latest DNS catalog zones draft
document.

Make some restructuring in ARM and rename the term catalog zone "option"
to "custom property" to better reflect the terms used in the draft.

Change the version of 'catalog1.zone.' catalog zone in the "catz" system
test to "2", and leave the version of 'catalog2.zone.' catalog zone at
version "1" to test both versions.

Add tests to check that the new syntax works only with the new schema
version, and that the old syntax works only with the legacy schema
version catalog zones.
2022-04-14 10:53:52 +00:00
Arаm Sаrgsyаn
99de681480 Merge branch '3144-dig-+trace-or-+nssearch-with-+tcp-always-crashes' into 'main'
Unify dig +nssearch next query starting code for TCP and UDP protocols

Closes #3144

See merge request isc-projects/bind9!6109
2022-04-14 10:46:16 +00:00
Aram Sargsyan
2a9867d512 Add CHANGES note for [GL #3144] 2022-04-14 09:35:59 +00:00
Evan Hunt
6bf8535542 detach unfinished query when canceling
when a query was canceled while still in the process of connecting,
tcp_connected() and udp_ready() didn't detach the query object.
2022-04-14 09:34:40 +00:00
Aram Sargsyan
b944bf4120 Unify dig +nssearch next query starting code for TCP and UDP protocols
In `+nssearch` mode `dig` starts the next query of the followup lookup
using `start_udp()` or `start_tcp()` calls without waiting for the
previous query to complete.

In UDP mode that happens in the `send_done()` callback of the previous
query, but in TCP mode that happens in the `start_tcp()` call of the
previous query (recursion) which doesn't work because `start_tcp()`
attaches the `lookup->current_query` to the query it is starting, so a
recursive call will result in an assertion failure.

Make the TCP mode to start the next query in `send_done()`, just like in
the UDP mode. During that time the `lookup->current_query` is already
detached by the `tcp_connected()`/`udp_ready()` callbacks.
2022-04-14 09:34:40 +00:00
Matthijs Mekking
3a9c82f749 Merge branch '2931-cds-delete-removed-on-signing' into 'main'
Don't delete CDS DELETE after zone sign

Closes #2931

See merge request isc-projects/bind9!5706
2022-04-13 12:37:39 +00:00
Matthijs Mekking
f088657eb1 Add CDS/CDNSKEY DELETE documentation
Mention in the DNSSEC guide in the "revert to unsigned" recipe that you
can publish CDS and CDNSKEY DELETE records to remove the corresponding
DS records from the parent zone.
2022-04-13 13:26:59 +02:00
Matthijs Mekking
ebbcf4c34f Add CHANGE and release note for #2931
Release note worthy.
2022-04-13 13:26:59 +02:00
Matthijs Mekking
3d05c99abb Update dns_dnssec_syncdelete() function
Update the function that synchronizes the CDS and CDNSKEY DELETE
records. It now allows for the possibility that the CDS DELETE record
is published and the CDNSKEY DELETE record is not, and vice versa.

Also update the code in zone.c how 'dns_dnssec_syncdelete()' is called.

With KASP, we still maintain the DELETE records our self. Otherwise,
we publish the CDS and CDNSKEY DELETE record only if they are added
to the zone. We do still check if these records can be signed by a KSK.

This change will allow users to add a CDS and/or CDNSKEY DELETE record
manually, without BIND removing them on the next zone sign.

Note that this commit removes the check whether the key is a KSK, this
check is redundant because this check is also made in
'dst_key_is_signing()' when the role is set to DST_BOOL_KSK.
2022-04-13 13:26:59 +02:00
Matthijs Mekking
f08277f9fb Test CDS DELETE persists after zone sign
Add a test case for a dynamically added CDS DELETE record and make
sure it is not removed when signing the zone. This happens because
BIND maintains CDS and CDNSKEY publishing and it will only allow
CDS DELETE records if the zone is transitioning to insecure. This is
a state that can be identified when using KASP through 'dnssec-policy',
but not when using 'auto-dnssec'.
2022-04-13 13:26:59 +02:00
Michał Kępień
d8473d8152 Merge branch 'michal/fix-forward-system-test-requirements' into 'main'
Fix "forward" system test requirements

See merge request isc-projects/bind9!6117
2022-04-12 13:30:06 +00:00
Michał Kępień
806f457147 Fix "forward" system test requirements
Commit bf3fffff67 added a Python-based
name server (bin/tests/system/forward/ans11/ans.py) to the "forward"
system test, but did not update bin/tests/system/Makefile.am to ensure
Python is present in the test environment before the "forward" system
test is run.  Update bin/tests/system/Makefile.am to enforce that
requirement.
2022-04-12 15:29:26 +02:00
Michał Kępień
aa99a554e4 Merge branch 'michal/set-up-release-notes-for-bind-9.19.1' into 'main'
Set up release notes for BIND 9.19.1

See merge request isc-projects/bind9!6118
2022-04-12 12:12:15 +00:00
Michał Kępień
058df60ee1 Set up release notes for BIND 9.19.1 2022-04-12 13:41:18 +02:00
Michał Kępień
6d8495f926 Merge branch 'michal/update-bind-version-to-9.19.1-dev' into 'main'
Update BIND version to 9.19.1-dev

See merge request isc-projects/bind9!6114
2022-04-12 11:10:32 +00:00
Michał Kępień
f7cf5603d0 Update BIND version to 9.19.1-dev 2022-04-12 11:15:13 +02:00
Evan Hunt
7f19cbbc90 Merge branch '3256-adb-crash' into 'main'
ADB entries could be unlinked too soon

Closes #3256

See merge request isc-projects/bind9!6113
2022-04-12 07:15:12 +00:00
Evan Hunt
06bf5f21d2 CHANGES for [GL #3256] 2022-04-11 17:32:55 -07:00
Evan Hunt
73ff8850bf ADB entries could be unlinked too soon
due to a typo in the code, ADB entries were unlinked from their entry
buckets during shutdown if they had a nonzero reference count. they
were only supposed to be unlinked if the reference count was exactly
one (that being the reference held by the bucket itself).
2022-04-11 17:29:03 -07:00
Michał Kępień
cab15392af Update BIND version to 9.19.0 2022-04-11 10:08:24 +02:00
Michał Kępień
cee8e4bf9b Add a CHANGES marker 2022-04-11 10:08:24 +02:00
Michał Kępień
ddb46ecff5 Merge branch 'michal/prepare-documentation-for-bind-9.19.0' into 'v9_19_0-release'
Prepare documentation for BIND 9.19.0

See merge request isc-private/bind9!396
2022-04-11 08:06:22 +00:00
Michał Kępień
8ce52b94f4 Prepare release notes for BIND 9.19.0 2022-04-11 10:05:50 +02:00
Michał Kępień
d43ab7059a Reorder release notes 2022-04-11 10:05:50 +02:00
Michał Kępień
2a3088e18d Tweak and reword release notes 2022-04-11 10:05:50 +02:00
Michał Kępień
63467cc192 Update BIND 9 versions mentioned in release notes 2022-04-11 10:05:50 +02:00
Michał Kępień
e4f775d1b3 Remove release notes applying to BIND 9.18.x 2022-04-11 10:05:50 +02:00
Michał Kępień
6c0bf20ed8 Remove release notes for BIND 9.17.x 2022-04-11 10:05:50 +02:00
Michał Kępień
7cabfd618b Fix CHANGES marker location for BIND 9.17.22 2022-04-11 10:05:50 +02:00
Michał Kępień
8e0c402115 Update release checklist 2022-04-11 10:05:50 +02:00
Michal Nowak
6cdc4114cb Merge branch '3129-test-check-fetch-shutting-down-in-resume_dslookup' into 'main'
[CVE-2022-0667] Add reproducer

Closes #3129

See merge request isc-projects/bind9!6063
2022-04-08 10:15:26 +00:00
Aram Sargsyan
848094d6f7 Add a hung fetch check while chasing DS in the forward system test
Implement TCP support in the `ans11` Python-based DNS server.

Implement a control command channel in `ans11` to support an optional
silent mode of operation, which, when enabled, will ignore incoming
queries.

In the added check, make the `ans11` the NS server of
"a.root-servers.nil." for `ns3`, so it uses `ans11` (in silent mode)
for the regular (non-forwarded) name resolutions.

This will trigger the "hung fetch" scenario, which was causing `named`
to crash.
2022-04-08 10:27:26 +02:00
Petr Špaček
84914a0610 Merge branch '2950-cache-acceptance-rules-test' into 'main'
[CVE-2021-25220] Add tests for forwarder cache poisoning scenarios

Closes #2950

See merge request isc-projects/bind9!6062
2022-04-07 17:29:34 +00:00
Mark Andrews
bf3fffff67 Add tests for forwarder cache poisoning scenarios
- Check that an NS in an authority section returned from a forwarder
  which is above the name in a configured "forward first" or "forward
  only" zone (i.e., net/NS in a response from a forwarder configured for
  local.net) is not cached.
- Test that a DNAME for a parent domain will not be cached when sent
  in a response from a forwarder configured to answer for a child.
- Check that glue is rejected if its name falls below that of zone
  configured locally.
- Check that an extra out-of-bailiwick data in the answer section is
  not cached (this was already working correctly, but was not explicitly
  tested before).
2022-04-07 18:43:23 +02:00
Ondřej Surý
0cc5d622f8 Merge branch '3226-fix-pools-cleaning-in-dns_zone' into 'main'
Don't destroy mctx and task pools until we are destroying zonemgr

Closes #3226

See merge request isc-projects/bind9!6102
2022-04-07 16:12:26 +00:00
Ondřej Surý
f981b52793 Don't destroy mctx and task pools until we are destroying zonemgr
The mctx, zonetask and loadtask pools were being destroyed in the
shutdown function where in theory a dangling zone could be still
attached to it.

Move the isc_mem_put() on the pools to the destroy() function.
2022-04-07 18:12:03 +02:00
Michal Nowak
e58d8f2acb Merge branch '3112-test-lingering-tcp-sockets-in-closewait' into 'main'
[CVE-2022-0396] Add system test lingering CLOSE_WAIT TCP sockets

Closes #3112

See merge request isc-projects/bind9!6046
2022-04-07 16:06:21 +00:00
Ondřej Surý
b6eb31a0e3 Add system test **/named.* modifier files to .reuse/dep5
There's couple of files that modify behaviour of named when started via
bin/tests/system/start.pl.  Add those files as CC-1.0 to .reuse/dep5 as
they are just empty placeholders.
2022-04-07 17:02:49 +02:00
Matthijs Mekking
b9ebde705b Add system test lingering CLOSE_WAIT TCP sockets
Add a test case to check for lingering TCP sockets stuck in the
CLOSE_WAIT state. This can happen if a client sends some garbage after
its first query.

The system test runs the reproducer script and then sends another TCP
query to the resolver. The resolver is configured to allow one TCP
client only. If BIND has its TCP socket stuck in CLOSE_WAIT, it does
not have the resources available to answer the second query.

Note: A better test would be to check if the named daemon does not
have a TCP socket stuck in CLOSE_WAIT for example with netstat. When
running this test locally you can examine named with netstat manually.
But since netstat is platform specific it is not a good candidate to do
this as a system test.

If you, if you could return, don't let it burn.
Do you have to let it linger?
- Cranberries
2022-04-07 17:02:48 +02:00
Michał Kępień
180f77dd9c Merge branch '3208-add-CHANGES-entry' into 'main'
Add CHANGES entry for GL #3208

Closes #3208

See merge request isc-projects/bind9!6099
2022-04-07 13:05:37 +00:00
Michał Kępień
059a602551 Add CHANGES entry for GL #3208 2022-04-07 15:01:16 +02:00
Petr Špaček
aa3a4a72f2 Merge branch 'pspacek/junit-report' into 'main'
Generate JUnit reports for unit & system tests

See merge request isc-projects/bind9!6088
2022-04-06 19:15:19 +00:00
Petr Špaček
d26d4f289f Generate JUnit reports for unit & system tests
This allows Gitlab to show nice summary for individual tests/test
directories and to expose the results in Gitlab API for consumption
elsewhere.

A catch: As of Gitlab 14.7.7, the detailed results are stored
only in artifacts and thus expire. All consumers (including API) need
to be "fast enough" to get the data before they disappear.
This also forces us to always store the artifacts intead of storing them
only on failure.
2022-04-06 21:14:38 +02:00
Tony Finch
f25e38b67e Merge branch '3242-notify-notimeout' into 'main'
Ensure that zone maintenance queries have a retry limit

Closes #3242

See merge request isc-projects/bind9!6051
2022-04-06 17:15:45 +00:00
Tony Finch
71ce8b0a51 Ensure that dns_request_createvia() has a retry limit
There are a couple of problems with dns_request_createvia(): a UDP
retry count of zero means unlimited retries (it should mean no
retries), and the overall request timeout is not enforced. The
combination of these bugs means that requests can be retried forever.

This change alters calls to dns_request_createvia() to avoid the
infinite retry bug by providing an explicit retry count. Previously,
the calls specified infinite retries and relied on the limit implied
by the overall request timeout and the UDP timeout (which did not work
because the overall timeout is not enforced). The `udpretries`
argument is also changed to be the number of retries; previously, zero
was interpreted as infinity because of an underflow to UINT_MAX, which
appeared to be a mistake. And `mdig` is updated to match the change in
retry accounting.

The bug could be triggered by zone maintenance queries, including
NOTIFY messages, DS parental checks, refresh SOA queries and stub zone
nameserver lookups. It could also occur with `nsupdate -r 0`.
(But `mdig` had its own code to avoid the bug.)
2022-04-06 17:12:48 +01:00
Tony Finch
5867c1b727 Make notify test shellcheck clean
Use POSIX shell syntax, and use functions to reduce repetition.
2022-04-06 17:12:08 +01:00
Artem Boldariev
a671fb34f6 Merge branch 'artem-tls-ctx-refcount' into 'main'
Implement reference counting for TLS contexts, Resolve #3122 DoT stops working after "rndc reconfigure" when running named as non-root

Closes #3122

See merge request isc-projects/bind9!6087
2022-04-06 16:09:04 +00:00
Artem Boldariev
8bec4a6bf6 Extend the doth system test
This commit adds simple checks that the TLS contexts in question are
indeed being updated on DoT and DoH listeners.
2022-04-06 18:45:57 +03:00
Artem Boldariev
a100c1ff7c Update CHANGES [GL #3122]
Add an entry that reloading TLS certificates without destroying
underlying TCP listening sockets.
2022-04-06 18:45:57 +03:00
Artem Boldariev
77b2db8246 Replace listener TLS contexts on reconfiguration
This commit makes use of isc_nmsocket_set_tlsctx(). Now, instead of
recreating TLS-enabled listeners (including the underlying TCP
listener sockets), only the TLS context in use is replaced.
2022-04-06 18:45:57 +03:00
Artem Boldariev
df317184eb Add isc_nmsocket_set_tlsctx()
This commit adds isc_nmsocket_set_tlsctx() - an asynchronous function
that replaces the TLS context within a given TLS-enabled listener
socket object. It is based on the newly added reference counting
functionality.

The intention of adding this function is to add functionality to
replace a TLS context without recreating the whole socket object,
including the underlying TCP listener socket, as a BIND process might
not have enough permissions to re-create it fully on reconfiguration.
2022-04-06 18:45:57 +03:00
Artem Boldariev
25609156a5 Maintain a per-thread TLS ctx reference in TLS stream code
This commit changes the generic TLS stream code to maintain a
per-worker thread TLS context reference.
2022-04-06 18:45:57 +03:00
Artem Boldariev
9256026d18 Use isc_tlsctx_attach() in TLS DNS code
This commit adds proper reference counting for TLS contexts into
generic TLS DNS (DoT) code.
2022-04-06 18:45:57 +03:00
Artem Boldariev
b52d46612f Use isc_tlsctx_attach() in TLS stream code
This commit adds proper reference counting for TLS contexts into
generic TLS stream code.
2022-04-06 18:45:57 +03:00
Artem Boldariev
a7a482c1b1 Add isc_tlsctx_attach()
The implementation is done on top of the reference counting
functionality found in OpenSSL/LibreSSL, which allows for avoiding
wrapping the object.

Adding this function allows using reference counting for TLS contexts
in BIND 9's codebase.
2022-04-06 18:45:57 +03:00
Ondřej Surý
09dccf29b4 Merge branch '3249-rename-configuration-option-to-reuseport' into 'main'
Rename the configuration option to load balance sockets to reuseport

Closes #3249

See merge request isc-projects/bind9!6093
2022-04-06 15:23:16 +00:00
Ondřej Surý
7e71c4d0cc Rename the configuration option to load balance sockets to reuseport
After some back and forth, it was decidede to match the configuration
option with unbound ("so-reuseport"), PowerDNS ("reuseport") and/or
nginx ("reuseport").
2022-04-06 17:03:57 +02:00
Mark Andrews
4216c72d13 Merge branch '3259-cid-351372-concurrent-data-access-violations-atomicity' into 'main'
Resolve "CID 351372:  Concurrent data access violations  (ATOMICITY)"

Closes #3259

See merge request isc-projects/bind9!6090
2022-04-06 07:53:59 +00:00
Mark Andrews
98718b3b4b Unlink the timer event before trying to purge it
as far as I can determine the order of operations is not important.

    *** CID 351372:  Concurrent data access violations  (ATOMICITY)
    /lib/isc/timer.c: 227 in timer_purge()
    221     		LOCK(&timer->lock);
    222     		if (!purged) {
    223     			/*
    224     			 * The event has already been executed, but not
    225     			 * yet destroyed.
    226     			 */
    >>>     CID 351372:  Concurrent data access violations  (ATOMICITY)
    >>>     Using an unreliable value of "event" inside the second locked section. If the data that "event" depends on was changed by another thread, this use might be incorrect.
    227     			timerevent_unlink(timer, event);
    228     		}
    229     	}
    230     }
    231
    232     void
2022-04-06 07:33:41 +00:00
Mark Andrews
6d94ac9f96 Merge branch '3258-cid-351370-cid-351371-after-adb-refactoring' into 'main'
Resolve "CID 351370 & CID 351371 after ADB refactoring"

Closes #3258

See merge request isc-projects/bind9!6089
2022-04-06 07:33:19 +00:00
Mark Andrews
ed1e480c53 Move lock to before label to prevent duplicate lock
*** CID 351370:  Program hangs  (LOCK)
    /lib/dns/adb.c: 2699 in dns_adb_cancelfind()
    2693
    2694     	LOCK(&nbucket->lock);
    2695     	ISC_LIST_UNLINK(adbname->finds, find, plink);
    2696     	UNLOCK(&nbucket->lock);
    2697
    2698     cleanup:
    >>>     CID 351370:  Program hangs  (LOCK)
    >>>     "pthread_mutex_lock" locks "find->lock" while it is locked.
    2699     	LOCK(&find->lock);
    2700     	if (!FIND_EVENTSENT(find)) {
    2701     		ev = &find->event;
    2702     		task = ev->ev_sender;
    2703     		ev->ev_sender = find;
    2704     		ev->ev_type = DNS_EVENT_ADBCANCELED;
2022-04-06 12:56:17 +10:00
Mark Andrews
05e08a21d1 Remove unnecessary NULL test leading to REVERSE_INULL false positive
*** CID 351371:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/adb.c: 2615 in dns_adb_createfind()
    2609     	/*
    2610     	 * Copy out error flags from the name structure into the find.
    2611     	 */
    2612     	find->result_v4 = find_err_map[adbname->fetch_err];
    2613     	find->result_v6 = find_err_map[adbname->fetch6_err];
    2614
    >>>     CID 351371:  Null pointer dereferences  (REVERSE_INULL)
    >>>     Null-checking "find" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    2615     	if (find != NULL) {
    2616     		if (want_event) {
    2617     			INSIST((find->flags & DNS_ADBFIND_ADDRESSMASK) != 0);
    2618     			isc_task_attach(task, &(isc_task_t *){ NULL });
    2619     			find->event.ev_sender = task;
    2620     			find->event.ev_action = action;
2022-04-06 12:54:08 +10:00
Artem Boldariev
4d57ef0c49 Merge branch 'artem-fix-return-value-x509_store_up_ref' into 'main'
Change X509_STORE_up_ref() shim return value

See merge request isc-projects/bind9!6084
2022-04-05 12:51:00 +00:00
Artem Boldariev
f0ac4c47b0 Change X509_STORE_up_ref() shim return value
X509_STORE_up_ref() must return 1 on success, while the previous
implementation would return the references count. This commit fixes
that.
2022-04-05 15:03:27 +03:00
Arаm Sаrgsyаn
0130ff96d5 Merge branch '3244-dig-use-after-free' into 'main'
Resolve "use-after-free in dighost.c/dig.c"

Closes #3244

See merge request isc-projects/bind9!6052
2022-04-05 11:52:00 +00:00
Aram Sargsyan
ef9bd8533a Add CHANGES note for [GL #3244] 2022-04-05 11:21:11 +00:00
Aram Sargsyan
5b2b3e589c Fix using unset pointer when printing a debug message in dighost.c
The used `query->handle` is always `NULL` at this point.

Change the code to use `handle` instead.
2022-04-05 11:20:42 +00:00
Aram Sargsyan
2771a5b64d Add a missing clear_current_lookup() call in recv_done()
The error code path handling the `ISC_R_CANCELED` code lacks a
`clear_current_lookup()` call, without which dig hangs indefinitely
when handling the error.

Add the missing call to account for all references of the lookup so
it can be destroyed.
2022-04-05 11:20:42 +00:00
Aram Sargsyan
f831e758d1 When using +qr in dig print the data of the current query
In `send_udp()` and `launch_next_query()` functions, when calling
`dighost_printmessage()` to print detailed information about the
sent query, dig always prints the data of the first query in the
lookup's queries list.

The first query in the list can be already finished, having its handles
freed, and accessing this information results in assertion failure.

Print the current query's information instead.
2022-04-05 11:20:41 +00:00
Michal Nowak
04e9b6060c Merge branch '3158-only-set-foundname-on-success-test' into 'main'
[CVE-2022-0635] Add regression test

Closes #3158

See merge request isc-projects/bind9!6060
2022-04-05 09:02:09 +00:00
Mark Andrews
56fbed2f0f Add regression test for CVE-2022-0635 2022-04-05 09:54:45 +02:00
Mark Andrews
ed9a4d9d71 Merge branch '3220-digdelv-test-uses-address-outside-of-our-control' into 'main'
Handle "network unreachable" error messages in digdelv system test

See merge request isc-projects/bind9!6010
2022-04-05 04:22:11 +00:00
Mark Andrews
9ef4d2b583 Use multiple fixed expressions for portable grep usage
Additionally add "network unreachable" as an expected error message.
2022-04-05 03:55:13 +00:00
Ondřej Surý
4bbc245e7e Merge branch 'ondrej-dont-use-shutdown-function-name' into 'main'
Rename shutdown() to test_shutdown() in timer_test.c

See merge request isc-projects/bind9!6078
2022-04-04 23:54:13 +00:00
Ondřej Surý
7868d8145b Rename shutdown() to test_shutdown() in timer_test.c
The shutdown() is part of standard library (POSIX-1), don't use such
name in the timer_test.c, but rather rename it to test_shutdown().
2022-04-05 01:49:04 +02:00
Ondřej Surý
141da70898 Merge branch '3249-add-configuration-option-to-disable-SO_REUSEPORT_LB-fix' into 'main'
Enable the load-balance-sockets configuration

Closes #3249

See merge request isc-projects/bind9!6076
2022-04-04 23:37:32 +00:00
Ondřej Surý
142c63dda8 Enable the load-balance-sockets configuration
Previously, HAVE_SO_REUSEPORT_LB has been defined only in the private
netmgr-int.h header file, making the configuration of load balanced
sockets inoperable.

Move the missing HAVE_SO_REUSEPORT_LB define the isc/netmgr.h and add
missing isc_nm_getloadbalancesockets() implementation.
2022-04-05 01:30:58 +02:00
Ondřej Surý
9217f1e200 Merge branch '3249-add-configuration-option-to-disable-SO_REUSEPORT_LB' into 'main'
Add option to configure load balance sockets

Closes #3249

See merge request isc-projects/bind9!6059
2022-04-04 21:37:54 +00:00
Ondřej Surý
855f49cfba Add CHANGES and release note for [GL #3249] 2022-04-04 23:10:04 +02:00
Ondřej Surý
85c6e797aa Add option to configure load balance sockets
Previously, the option to enable kernel load balancing of the sockets
was always enabled when supported by the operating system (SO_REUSEPORT
on Linux and SO_REUSEPORT_LB on FreeBSD).

It was reported that in scenarios where the networking threads are also
responsible for processing long-running tasks (like RPZ processing, CATZ
processing or large zone transfers), this could lead to intermitten
brownouts for some clients, because the thread assigned by the operating
system might be busy.  In such scenarious, the overall performance would
be better served by threads competing over the sockets because the idle
threads can pick up the incoming traffic.

Add new configuration option (`load-balance-sockets`) to allow enabling
or disabling the load balancing of the sockets.
2022-04-04 23:10:04 +02:00
Ondřej Surý
38f8716b1c Merge branch '3182-placeholder' into 'main'
Add placeholder for [GL #3182]

Closes #3182

See merge request isc-projects/bind9!6071
2022-04-04 19:47:27 +00:00
Ondřej Surý
910c6b9cef Add placeholder for [GL #3182] 2022-04-04 21:45:09 +02:00
Ondřej Surý
59f04a5d09 Merge branch '3190-offload-rpz-updates' into 'main'
Run the RPZ update as offloaded work

Closes #3190

See merge request isc-projects/bind9!5938
2022-04-04 19:44:15 +00:00
Ondřej Surý
23a4559b34 Add CHANGES and release note for [GL #3190] 2022-04-04 21:20:05 +02:00
Ondřej Surý
f106d0ed2b Run the RPZ update as offloaded work
Previously, the RPZ updates ran quantized on the main nm_worker loops.
As the quantum was set to 1024, this might lead to service
interruptions when large RPZ update was processed.

Change the RPZ update process to run as the offloaded work.  The update
and cleanup loops were refactored to do as little locking of the
maintenance lock as possible for the shortest periods of time and the db
iterator is being paused for every iteration, so we don't hold the rbtdb
tree lock for prolonged periods of time.
2022-04-04 21:20:05 +02:00
Ondřej Surý
b6e885c97f Refactor the dns_rpz_add/delete to use local rpz copy
Previously dns_rpz_add() were passed dns_rpz_zones_t and index to .zones
array.  Because we actually attach to dns_rpz_zone_t, we should be using
the local pointer instead of passing the index and "finding" the
dns_rpz_zone_t again.

Additionally, dns_rpz_add() and dns_rpz_delete() were used only inside
rpz.c, so make them static.
2022-04-04 21:20:05 +02:00
Ondřej Surý
840179a247 General cleanup of dns_rpz implementation
Do a general cleanup of lib/dns/rpz.c style:

 * Removed deprecated and unused functions
 * Unified dns_rpz_zone_t naming to rpz
 * Unified dns_rpz_zones_t naming to rpzs
 * Add and use rpz_attach() and rpz_attach_rpzs() functions
 * Shuffled variables to be more local (cppcheck cleanup)
2022-04-04 21:19:48 +02:00
Ondřej Surý
cadd1a0ab3 Merge branch '3229-remove-exclusive-mode-from-ns_interfacemgr' into 'main'
Remove exclusive mode from ns_interfacemgr

Closes #3229

See merge request isc-projects/bind9!6023
2022-04-04 19:16:50 +00:00
Ondřej Surý
70e58897c7 Add CHANGES note for [GL #3229] 2022-04-04 19:27:18 +02:00
Ondřej Surý
c0995bc380 Remove exclusive mode from ns_interfacemgr
Now that the dns_aclenv_t has now properly rwlocked .localhost and
.localnets member, we can remove the task exclusive mode use from the
ns_interfacemgr.  Some light related cleanup has been also done.
2022-04-04 19:27:00 +02:00
Ondřej Surý
8138a595d9 Add isc_rwlock around dns_aclenv .localhost and .localnets member
In order to modify the .localhost and .localnets members of the
dns_aclenv, all other processing on the netmgr loops needed to be
stopped using the task exclusive mode.  Add the isc_rwlock to the
dns_aclenv, so any modifications to the .localhost and .localnets can be
done under the write lock.
2022-04-04 19:27:00 +02:00
Arаm Sаrgsyаn
bd9707464c Merge branch '3248-dig-stuck-using-a-server-with-a-mapped-ip-address' into 'main'
Fix dig hanging issue in cases when the lookup's next query can't start

Closes #3248

See merge request isc-projects/bind9!6061
2022-04-04 09:37:40 +00:00
Aram Sargsyan
438e9b5587 Add CHANGES note for [GL #3248] 2022-04-04 09:16:15 +00:00
Aram Sargsyan
7e2f50c369 Fix dig hanging issue in cases when the lookup's next query can't start
In recv_done(), when dig decides to start the lookup's next query in
the line using `start_udp()` or `start_tcp()`, and for some reason,
no queries get started, dig doesn't cancel the lookup.

This can occur, for example, when there are two queries in the lookup,
one with a regular IP address, and another with a IPv4 mapped IPv6
address. When the regular IP address fails to serve the query, its
`recv_done()` callback starts the next query in the line (in this
case the one with a mapped IP address), but because `dig` doesn't
connect to such IP addresses, and there are no other queries in the
list, no new queries are being started, and the lookup keeps hanging.

After calling `start_udp()` or `start_tcp()` in `recv_done()`, check
if there are no pending/working queries then cancel the lookup instead
of only detaching from the current query.
2022-04-04 09:15:56 +00:00
Ondřej Surý
d4eef9e89a Merge branch '3252-stop-timer-before-detach' into 'main'
Don't use reference counting in isc_timer unit

Closes #3252

See merge request isc-projects/bind9!6067
2022-04-01 23:48:26 +00:00
Ondřej Surý
ae01ec2823 Don't use reference counting in isc_timer unit
The reference counting and isc_timer_attach()/isc_timer_detach()
semantic are actually misleading because it cannot be used under normal
conditions.  The usual conditions under which is timer used uses the
object where timer is used as argument to the "timer" itself.  This
means that when the caller is using `isc_timer_detach()` it needs the
timer to stop and the isc_timer_detach() does that only if this would be
the last reference.  Unfortunately, this also means that if the timer is
attached elsewhere and the timer is fired it will most likely be
use-after-free, because the object used in the timer no longer exists.

Remove the reference counting from the isc_timer unit, remove
isc_timer_attach() function and rename isc_timer_detach() to
isc_timer_destroy() to better reflect how the API needs to be used.

The only caveat is that the already executed event must be destroyed
before the isc_timer_destroy() is called because the timer is no longet
attached to .ev_destroy_arg.
2022-04-02 01:23:15 +02:00
Ondřej Surý
635fbc7f93 Merge branch 'ondrej-remove-task-privileged-mode' into 'main'
Remove task privileged mode

Closes #3253

See merge request isc-projects/bind9!6049
2022-04-01 23:01:48 +00:00
Ondřej Surý
e71e2d06f5 Add CHANGES note for [GL #3253] 2022-04-01 23:56:36 +02:00
Ondřej Surý
30e0fd942b Remove task privileged mode
Previously, the task privileged mode has been used only when the named
was starting up and loading the zones from the disk as the "first" thing
to do.  The privileged task was setup with quantum == 2, which made the
taskmgr/netmgr spin around the privileged queue processing two events at
the time.

The same effect can be achieved by setting the quantum to UINT_MAX (e.g.
practically unlimited) for the loadzone task, hence the privileged task
mode was removed in favor of just processing all the events on the
loadzone task in a single task_run().
2022-04-01 23:55:26 +02:00
Ondřej Surý
0519a5bfe9 Merge branch 'ondrej-cleanup-extra-memory-context-in-dns_zone' into 'main'
Cleanup the tasks and memory contexts in dns_zone

Closes #3226 and #3159

See merge request isc-projects/bind9!6004
2022-04-01 21:54:55 +00:00
Ondřej Surý
ae0898e328 Add CHANGES note for [GL #3226] 2022-04-01 23:51:12 +02:00
Ondřej Surý
62a72211aa Remove isc_pool API
Since the last user of the isc_pool API is gone, remove the whole
isc_pool API.
2022-04-01 23:50:34 +02:00
Ondřej Surý
2bc7303af2 Use isc_nm_getnworkers to manage zone resources
Instead of passing the number of worker to the dns_zonemgr manually,
get the number of nm threads using the new isc_nm_getnworkers() call.

Additionally, remove the isc_pool API and manage the array of memory
context, zonetasks and loadtasks directly in the zonemgr.
2022-04-01 23:50:34 +02:00
Ondřej Surý
2707d0eeb7 Set hard thread affinity for each zone
After switching to per-thread resources in the zonemgr, the performance
was decreased because the memory context, zonetask and loadtask was
picked from the pool at random.

Pin the zone to single threadid (.tid) and align the memory context,
zonetask and loadtask to be the same, this sets the hard affinity of the
zone to the netmgr thread.
2022-04-01 23:50:34 +02:00
Ondřej Surý
8b4ba366dd Remove the zone counting in the named
The zone counting in the named was used to properly size the zonemgr
resources (memory contexts, zonetasks and loadtasks).  Since this is no
longer the case, remove the whole zone counting from named.
2022-04-01 23:50:34 +02:00
Ondřej Surý
a94678ff77 Create per-thread task and memory context for zonemgr
Previously, the zonemgr created 1 task per 100 zones and 1 memory
context per 1000 zones (with minimum 10 tasks and 2 memory contexts) to
reduce the contention between threads.

Instead of reducing the contention by having many resources, create a
per-nm_thread memory context, loadtask and zonetask and spread the zones
between just per-thread resources.

Note: this commit alone does decrease performance when loading the zone
by couple seconds (in case of 1M zone) and thus there's more work in
this whole MR fixing the performance.
2022-04-01 23:50:34 +02:00
Ondřej Surý
abb5e9a575 Merge branch 'ondrej-repair-isc_task_purgeevent' into 'main'
Repair isc_task_purgeevent(), clean isc_task_unsend{,range}()

Closes #3252

See merge request isc-projects/bind9!6053
2022-04-01 21:50:04 +00:00
Ondřej Surý
a7cd0868a2 Add CHANGES note for [GL #3252] 2022-04-01 23:45:40 +02:00
Ondřej Surý
40971b22e7 Stop the zone timer before detaching the timer
Previously, the zone timer was not stopped before detaching the timer.
This could lead to a data race where the timer post_event() could fire
before the timer was detached, but then the event would be executed
after the zone was already destroyed.

This was not noticed before because the timing or the ordering of the
actions were different, but it was causing assertion failures in the
libns tests now.

Properly stop the zone timer before detaching the timer object from the
dns_zone.
2022-04-01 23:45:23 +02:00
Ondřej Surý
87c4c24cde Set quantum to infinity for the zone loading task
When we are loading the zones, set the quantum to UINT_MAX, which makes
task_run process all tasks at once.  After the zone loading is finished
the quantum will be dropped to 1 to not block server when we are loading
new zones after reconfiguration.
2022-04-01 23:45:23 +02:00
Ondřej Surý
15ea6f002f Add isc_task_setquantum() and use it for post-init zone loading
Add isc_task_setquantum() function that modifies quantum for the future
isc_task_run() invocations.

NOTE: The current isc_task_run() caches the task->quantum into a local
variable and therefore the current event loop is not affected by any
quantum change.
2022-04-01 23:45:23 +02:00
Ondřej Surý
c17eee034b Remove isc_task_purge() and isc_task_purgerange()
The isc_task_purge() and isc_task_purgerange() were now unused, so sweep
the task.c file.  Additionally remove unused ISC_EVENTATTR_NOPURGE event
attribute.
2022-04-01 23:45:23 +02:00
Ondřej Surý
9f7ba679ac Purge the .resched_event in dns_cache
Instead of sweeping the cache cleaner tasks, purge the more specific
cleaner.resched_event event.
2022-04-01 23:45:23 +02:00
Ondřej Surý
48b2a5df97 Keep the list of scheduled events on the timer
Instead of searching for the events to purge, keep the list of scheduled
events on the timer list and purge the events that we have scheduled.
2022-04-01 23:45:23 +02:00
Ondřej Surý
17aed2f895 Repair isc_task_purgeevent(), clean isc_task_unsend{,range}()
The isc_task_purgerange() was walking through all events on the task to
find a matching task.  Instead use the ISC_LINK_LINKED to find whether
the event is active.

Cleanup the related isc_task_unsend() and isc_task_unsendrange()
functions that were not used anywhere.
2022-04-01 23:45:23 +02:00
Ondřej Surý
fe4cd556b3 Merge branch '3243-mr-6035-fix' into 'main'
Turn isc_hash_bits32() into static online function

Closes #3243

See merge request isc-projects/bind9!6050
2022-04-01 21:32:48 +00:00
Ondřej Surý
96030f23a4 Help gcovr find isc/hash.h when included from lib/dns
Similar to other tweaks, copy the lib/isc/include/isc/hash.h to lib/dns
to help gcovr find the file.
2022-04-01 23:05:43 +02:00
Ondřej Surý
b84c9b2608 Turn isc_hash_bits32() into static online function
Adding extra val & 0xffff in the isc_hash_bits32() macros in the hotpath
has significantly reduced the performance.  Turn the macro into static
inline function matching the previous hash_32() function used to compute
hashval matching the hashtable->bits.
2022-04-01 23:04:24 +02:00
Evan Hunt
b1e966efaa Merge branch '3250-resolver-test-non-querytrace' into 'main'
fix resolver test when built without --enable-querytrace

Closes #3250

See merge request isc-projects/bind9!6064
2022-04-01 17:16:09 +00:00
Evan Hunt
5319d8adea fix resolver test when built without --enable-querytrace
a test case in the 'resolver' system test was reliant on
logged output that would only be present when query tracing
was enabled, as in developer builds. that test case is now
disabled when query tracing is not available. Thanks to
Anton Castelli.
2022-04-01 09:54:44 -07:00
Artem Boldariev
7dd8ab7336 Merge branch '3236-fix-debian9-no-SSL_CTX_set1_cert_store' into 'main'
Implement shim for SSL_CTX_set1_cert_store() (affects Debian 9)

Closes #3236

See merge request isc-projects/bind9!6054
2022-04-01 14:28:09 +00:00
Artem Boldariev
3edf7a9fe7 Implement shim for SSL_CTX_set1_cert_store() (affects Debian 9)
This commit implements a shim for SSL_CTX_set1_cert_store() for
OpenSSL/LibreSSL versions where it is not available.
2022-04-01 16:33:43 +03:00
Arаm Sаrgsyаn
d8cd4460bf Merge branch '3145-dig-+nssearch-does-not-exit-until-interrupted' into 'main'
Fix "dig +nssearch" indefinitely hanging issue

Closes #3145

See merge request isc-projects/bind9!6007
2022-04-01 11:51:17 +00:00
Aram Sargsyan
4477f71868 Synchronze udp_ready() and tcp_connected() functions entry behavior
The `udp_ready()` and `tcp_connected()` functions in dighost.c are
used for similar purposes for UDP and TCP respectively.

Synchronize the `udp_ready()` function entry code to behave like
`tcp_connected()` by adding input validation, debug messages and
early exit code when `cancel_now` is `true`.
2022-04-01 10:56:27 +00:00
Aram Sargsyan
3a5793ece2 Add CHANGES note for [GL #3145] 2022-04-01 10:56:27 +00:00
Aram Sargsyan
7d360bd05e Fix "dig +nssearch" indefinitely hanging issue
When finishing the NSSEARCH task and there is no more followup
lookups to start, dig does not destroy the last lookup, which
causes it to hang indefinitely.

Rename the unused `first_pass` member of `dig_query_t` to `started`
and make it `true` in the first callback after `start_udp()` or
`start_tcp()` of the query to indicate that the query has been
started.

Create a new `check_if_queries_done()` function to check whether
all of the queries inside a lookup have been started and finished,
or canceled.

Use the mentioned function in the TRACE code block in `recv_done()`
to check whether the current query is the last one in the lookup and
cancel the lookup in that case to free the resources.
2022-04-01 10:56:27 +00:00
Mark Andrews
5b76f0f80e Merge branch '3191-issue-45178-in-oss-fuzz-bind9-dns_master_load_fuzzer-integer-overflow-in-generate' into 'main'
Resolve "Issue 45178 in oss-fuzz: bind9:dns_master_load_fuzzer: Integer-overflow in generate"

Closes #3191

See merge request isc-projects/bind9!5928
2022-04-01 10:31:45 +00:00
Evan Hunt
bd814b79d4 add a system test for $GENERATE with an integer overflow
the line "$GENERATE 19-28/2147483645 $ CNAME x" should generate
a single CNAME with the owner "19.example.com", but prior to the
overflow bug it generated several CNAMEs, half of them with large
negative values.

we now test for the bugfix by using "named-checkzone -D" and
grepping for a single CNAME in the output.
2022-04-01 07:56:52 +00:00
Evan Hunt
2261c853b5 update shell syntax
clean up the shell syntax in the checkzone test prior to adding
a new test.
2022-04-01 07:56:52 +00:00
Mark Andrews
9039aad0f8 Add test case for issue-45178 2022-04-01 07:56:52 +00:00
Mark Andrews
5abdee9004 Prevent arithmetic overflow of 'i' in master.c:generate
the value of 'i' in generate could overflow when adding 'step' to
it in the 'for' loop.  Use an unsigned int for 'i' which will give
an additional bit and prevent the overflow.  The inputs are both
less than 2^31 and and the result will be less than 2^32-1.
2022-04-01 07:56:52 +00:00
Tony Finch
3dd8af9aa8 Merge branch '3209-notauth-subdomain' into 'main'
NOTAUTH errors should log the zone from the query not the nearest match

Closes #3209

See merge request isc-projects/bind9!5982
2022-03-30 12:12:08 +00:00
Tony Finch
84c4eb02e7 Log "not authoritative for update zone" more clearly
Ensure the update zone name is mentioned in the NOTAUTH error message
in the server log, so that it is easier to track down problematic
update clients. There are two cases: either the update zone is
unrelated to any of the server's zones (previously no zone was
mentioned); or the update zone is a subdomain of one or more of the
server's zones (previously the name of the irrelevant parent zone was
misleadingly logged).

Closes #3209
2022-03-30 12:50:30 +01:00
Ondřej Surý
8594cd00bc Merge branch '3230-remove-task-exclusive-mode-from-ns_clientmgr' into 'main'
Remove task exclusive mode from ns_clientmgr

Closes #3230

See merge request isc-projects/bind9!6024
2022-03-30 11:18:08 +00:00
Ondřej Surý
a243860562 Add CHANGES mode for [GL #3230] 2022-03-30 12:46:09 +02:00
Ondřej Surý
4f74e1010e Remove task exclusive mode from ns_clientmgr
The .lock, .exiting and .excl members were not using for anything else
than starting task exclusive mode, setting .exiting to true and ending
exclusive mode.

Remove all the stray members and dead code eliminating the task
exclusive mode use from ns_clientmgr.
2022-03-30 12:41:55 +02:00
Ondřej Surý
003e4b00c6 Merge branch '3213-remove-exclusive-task-mode-from-dns_adb' into 'main'
refactor ADB

Closes #3213

See merge request isc-projects/bind9!6033
2022-03-30 10:41:30 +00:00
Evan Hunt
2c419b7abc Add CHANGES note for [GL #3213] 2022-03-30 10:14:09 +02:00
Evan Hunt
199be183fa Add detailed ADB and entry attach/detach tracing
To turn on detailed debug tracing of dns_adb and dns_adbentry
reference counting, #define ADB_TRACE at the top of adb.c. This
is off by default.
2022-03-30 10:12:25 +02:00
Evan Hunt
d48d8e1cf0 Refactor ADB reference counting, shutdown and locking
The ADB previously used separate reference counters for internal
and external references, plus additional counters for ABD find
and namehook objects, and used all these counters to coordinate
its shutdown process, which was a multi-stage affair involving
a sequence of control events.

It also used a complex interlocking set of static functions for
referencing, deferencing, linking, unlinking, and cleaning up various
internal objects; these functions returned boolean values to their
callers to indicate what additional processing was needed.

The changes in the previous two commits destabilized this fragile
system in a way that was difficult to recover from, so in this commit
we refactor all of it. The dns_adb and dns_adbentry objects now use
conventional attach and detach functions for reference counting, and
the shutdown process is much more straightforward.  Instead of
handling shutdown asynchronously, we can just destroy the ADB when
references reach zero

In addition, ADB locking has been simplified. Instead of a
single `find_{name,entry}_and_lock()` function which searches for
a name or entry's hash bucket, locks it, and then searches for the
name or entry in the bucket, we now use one function to find the
bucket (leaving it to the caller to do the locking) and another
find the name or entry.  Instead of locking the entire ADB when
modifying hash tables, we now use read-write locks around the
specific hash table. The only remaining need for adb->lock
is when modifying the `whenshutdown` list.

Comments throughout the module have been improved.
2022-03-30 10:12:25 +02:00
Evan Hunt
76bcb4d16b Refactor how ADB names and entries are stored in the dns_adb
Replace adb->{names,entries} and related arrays (indexed by hashed
bucket) with a isc_ht hash tables storing the new struct
adb{name,entry}bucket_t that wraps all the variables that were
originally stored in arrays indexed by "bucket" number stored directly
in the struct dns_adb.

Previously, the task exclusive mode has been used to grow the internal
arrays used to store the named and entries objects.  The isc_ht hash
tables are now protected by the isc_rwlock instead and thus the usage of
the task exclusive mode has been removed from the dns_adb.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
2022-03-30 10:09:18 +02:00
Evan Hunt
6e11211ac6 minor pre-refactoring cleanups
the use of "result" as a variable name for a boolean return value
was confusing; all 'result' variables that are not isc_result_t
have been renamed to 'ret'.

The static function print_dns_name() was a duplicate of
dns_name_print(), so it has been replaced with that.

Changed INSIST to REQUIRE where appropriate, and added NULL
initialization for pointer variables.
2022-03-30 09:55:00 +02:00
Ondřej Surý
ddf051df65 Merge branch 'ondrej-remove-multiple-application-contexts' into 'main'
Remove isc_appctx_t use in dns_client

See merge request isc-projects/bind9!6041
2022-03-29 22:24:20 +00:00
Ondřej Surý
bbea0be767 Add CHANGES note for [GL !6041] 2022-03-29 14:14:49 -07:00
Ondřej Surý
3a650d973f Remove isc_appctx_t use in dns_client
The use of isc_appctx_t in dns_client was used to wait for
dns_client_startresolve() to finish the processing (the resolve_done()
task callback).

This has been replaced with standard bool+cond+lock combination removing
the need of isc_appctx_t altogether.
2022-03-29 14:14:49 -07:00
Tony Finch
a0d2c7cdb6 Merge branch 'fanf/macos-ifconfig' into 'main'
MacOS needs more IP addresses to run the system tests

See merge request isc-projects/bind9!5993
2022-03-29 16:52:30 +00:00
Tony Finch
29a3e77425 MacOS needs more IP addresses to run the system tests
The launchd script only counted up to 8 whereas ifconfig.sh went all
the way up to 10, and even a bit further than that.
2022-03-29 16:59:19 +01:00
Evan Hunt
bb61a3a90a Merge branch 'each-consolidate-fibonacci-hashing' into 'main'
consolidate fibonacci hashing and support case-insensitive hash tables

See merge request isc-projects/bind9!6035
2022-03-28 22:27:59 +00:00
Ondřej Surý
b05a991ad0 Make isc_ht optionally case insensitive
Previously, the isc_ht API would always take the key as a literal input
to the hashing function.  Change the isc_ht_init() function to take an
'options' argument, in which ISC_HT_CASE_SENSITIVE or _INSENSITIVE can
be specified, to determine whether to use case-sensitive hashing in
isc_hash32() when hashing the key.
2022-03-28 15:02:18 -07:00
Evan Hunt
e9ef3defa4 consolidate fibonacci hashing in one place
Fibonacci hashing was implemented in four separate places (rbt.c,
rbtdb.c, resolver.c, zone.c). This commit combines them into a single
implementation. The hash_32() function is now replaced with
isc_hash_bits32().
2022-03-28 14:44:21 -07:00
Ondřej Surý
f768c138b4 Merge branch 'ondrej/cleanup-unreachable-calls' into 'main'
Consistenly use UNREACHABLE() instead of ISC_UNREACHABLE()

See merge request isc-projects/bind9!6042
2022-03-28 21:40:52 +00:00
Ondřej Surý
4dceab142d Consistenly use UNREACHABLE() instead of ISC_UNREACHABLE()
In couple places, we have missed INSIST(0) or ISC_UNREACHABLE()
replacement on some branches with UNREACHABLE().  Replace all
ISC_UNREACHABLE() or INSIST(0) calls with UNREACHABLE().
2022-03-28 23:26:08 +02:00
Artem Boldariev
7dbc843496 Merge branch 'artem-strict-tls' into 'main'
Add remote TLS certificate verification support, implement Strict and Mutual TLS authentication in BIND and dig

Closes #3163

See merge request isc-projects/bind9!5837
2022-03-28 13:55:47 +00:00
Artem Boldariev
40db7dfcc1 Mention TLS certs verification in the CHANGES and Release Notes
This commit adds points to the CHANGES and the release notes about
supporting remote TLS certificates verification and support for Strict
and Mutual TLS transport connections verification.
2022-03-28 16:22:53 +03:00
Artem Boldariev
63532d6d81 Update the "Known Issues"
Mention that some old cryptographic library versions lack the
functionality to implement ignoring the Subject field (and thus the
Common Name) when establishing DoT connections.
2022-03-28 16:22:53 +03:00
Artem Boldariev
cfea9a3aec Extend the 'doth' system test with Strict/Mutual TLS checks
This commit extends the 'doth' system test with a set of Strict/Mutual
TLS related checks.

This commit also makes each doth NS instance use its own TLS
certificate that includes FQDN, IPv4, and IPv6 addresses, issued using
a common Certificate Authority, instead of ad-hoc certs.

Extend servers initialisation timeout to 60 seconds to improve the
tests stability in the CI as certain configurations could fail to
initialise on time under load.
2022-03-28 16:22:53 +03:00
Artem Boldariev
7b9318bf72 Add missing plain HTTP options to dig's help output
A couple of dig options were missing in the help output, while been
properly documented and supported. This commit fixes this overlook.
2022-03-28 16:22:53 +03:00
Artem Boldariev
a32ac8790c Document supported TLS authentication modes
This commit updates the reference manual with short descriptions of
different TLS authentication modes, as mentioned in the RFC 9103,
Section 9.3 (Opportunistic TLS, Strict TLS, Mutual TLS), and mentions
how these authentication modes can be achieved via BIND's
configuration file.
2022-03-28 16:22:53 +03:00
Artem Boldariev
57f0251713 Add support for Strict/Mutual TLS into BIND
This commit adds support for Strict/Mutual TLS into BIND. It does so
by implementing the backing code for 'hostname' and 'ca-file' options
of the 'tls' statement. The commit also updates the documentation
accordingly.
2022-03-28 16:22:53 +03:00
Artem Boldariev
89d7059103 Restore disabled unused 'tls' options: 'ca-file' and 'hostname'
This commit restores the 'tls' options disabled in
78b73d0865.
2022-03-28 16:22:53 +03:00
Artem Boldariev
fd38a4e1bf Add support for Strict/Mutual TLS to dig
This commit adds support for Strict/Mutual TLS to dig.

The new command-line options and their behaviour are modelled after
kdig (+tls-ca, +tls-hostname, +tls-certfile, +tls-keyfile) for
compatibility reasons. That is, using +tls-* is sufficient to enable
DoT in dig, implying +tls-ca

If there is no other DNS transport specified via command-line,
specifying any of +tls-* options makes dig use DoT. In this case, its
behaviour is the same as if +tls-ca is specified: that is, the remote
peer's certificate is verified using the platform-specific
intermediate CA certificates store. This behaviour is introduced for
compatibility with kdig.
2022-03-28 16:22:53 +03:00
Artem Boldariev
783663db80 Add ISC_R_TLSBADPEERCERT error code to the TLS related code
This commit adds support for ISC_R_TLSBADPEERCERT error code, which is
supposed to be used to signal for TLS peer certificates verification
in dig and other code.

The support for this error code is added to our TLS and TLS DNS
implementations.

This commit also adds isc_nm_verify_tls_peer_result_string() function
which is supposed to be used to get a textual description of the
reason for getting a ISC_R_TLSBADPEERCERT error.
2022-03-28 15:32:30 +03:00
Artem Boldariev
71cf8fa5ac Extend TLS context cache with CA certificates store
This commit adds support for keeping CA certificates stores associated
with TLS contexts. The intention is to keep one reusable store per a
set of related TLS contexts.
2022-03-28 15:31:22 +03:00
Artem Boldariev
c49a81e27d Add foundational functions to implement Strict/Mutual TLS
This commit adds a set of functions that can be used to implement
Strict and Mutual TLS:

* isc_tlsctx_load_client_ca_names();
* isc_tlsctx_load_certificate();
* isc_tls_verify_peer_result_string();
* isc_tlsctx_enable_peer_verification().
2022-03-28 15:31:22 +03:00
Artem Boldariev
32783d36c2 Add utility functions to manipulate X509 certificate stores
This commit adds a set of high-level utility functions to manipulate
the certificate stores. The stores are needed to implement TLS
certificates verification efficiently.
2022-03-28 15:31:22 +03:00
Arаm Sаrgsyаn
e759fa9847 Merge branch '3221-catz-lightweight-cleanup' into 'main'
[1/5] Catalog zones lightweight cleanup

Closes #3221

See merge request isc-projects/bind9!6011
2022-03-28 11:04:25 +00:00
Aram Sargsyan
7fd24ded90 Add CHANGES note for [GL #3221] 2022-03-28 10:18:48 +00:00
Aram Sargsyan
a5a6362e92 Use 'bname' in dns_catz_update_from_db() only when it is ready
There is a possible code path of using the uninitialized `bname`
character array while logging an error message.

Initialize the `bname` buffer earlier in the function.

Also, change the initialization routine to use a helper function.
2022-03-28 10:17:56 +00:00
Aram Sargsyan
f57c51fe05 Put some missing dns_rdata_freestruct() calls in catz.c
A successful call to `dns_rdata_tostruct()` expects an accompanying
call to `dns_rdata_freestruct()` to free up any memory that could have
been allocated during the first call.

In catz.c there are several places where `dns_rdata_freestruct()` call
is skipped.

Add the missing cleanup routines.
2022-03-28 10:17:56 +00:00
Aram Sargsyan
9b84bfb5f4 Cleanup the code to remove unnecessary indentation
Because of the "goto" in the "if" body the "else" part is unnecessary
and adds another level of indentation.

Cleanup the code to not have the "else" part.
2022-03-28 10:17:56 +00:00
Aram Sargsyan
d29e5f197b Log a warning when catz is told to modify a zone not added by catz
Catz logs a warning message when it is told to modify a zone which was
not added by the current catalog zone.

When logging a warning, distinguish the two cases when the zone
was not added by a catalog zone at all, and when the zone was
added by a different catalog zone.
2022-03-28 10:17:56 +00:00
Aram Sargsyan
e861224cf4 Fix invalid function name in the error log
The current function's name in one of the error logs in
catz_addmodzone_taskaction() function is invalid.

Fix the name.
2022-03-28 10:17:56 +00:00
Ondřej Surý
23cb022247 Merge branch 'u/fanf2/dnssec-settime-ctime' into 'main'
Teach dnssec-settime to read times that it writes

See merge request isc-projects/bind9!2947
2022-03-25 15:13:28 +00:00
Tony Finch
fcca62859d Add CHANGES note for [GL !2947] 2022-03-25 16:06:06 +01:00
Tony Finch
c38a323082 Teach dnssec-settime to read times that it writes
The dnssec-settime -p and -up options print times in asctime() and
UNIX time_t formats, respectively. The asctime() format can also be
found inside K*.key public key files. Key files also contain times in
the YYYYMMDDHHMMSS format that can be used in timing parameter
options.

The dnssec-settime -p and -up time formats are now acceptable in
timing parameter options to dnssec-settime and dnssec-keygen, so it is
no longer necessary to parse key files to retrieve times that are
acceptable in timing parameter options.
2022-03-25 16:05:43 +01:00
Ondřej Surý
745d9db746 Merge branch '3210-dns64-errors' into 'main'
More explicit dns64 prefix errors

Closes #3210

See merge request isc-projects/bind9!5985
2022-03-25 10:38:59 +00:00
Tony Finch
132f30b623 Add CHANGES note for [GL #3210] 2022-03-25 10:59:24 +01:00
Tony Finch
496c02d32a More explicit dns64 prefix errors
Quote the dns64 prefix in error messages that complain about
problems with it, to avoid confusion with the following ACLs.

Closes #3210
2022-03-25 10:59:15 +01:00
Ondřej Surý
96e9f59637 Merge branch 'ondrej-remove-nmhandle-extra' into 'main'
Remove extrahandle size from netmgr

Closes #3227

See merge request isc-projects/bind9!6018
2022-03-25 09:43:31 +00:00
Ondřej Surý
4c3a985a24 Merge branch 'ondrej-cleanup-ns_client-structure' into 'main'
Remove extra copies and stray members from ns_client_t

See merge request isc-projects/bind9!6017
2022-03-25 09:38:41 +00:00
Ondřej Surý
7939648378 Add CHANGES note for [GL #3227] 2022-03-25 10:38:35 +01:00
Ondřej Surý
1f35977423 Remove ns_client_t .shuttingdown member
The way the ns_client_t .shuttingdown member was practically dead code.
The .shuttingdown would be set to true only in ns__client_put() function
meaning that we have detached from all ns_client_t .*handles and the
ns_client_t object being freed:

    client->magic = 0;
    client->shuttingdown = true;
    [...]
    isc_mem_put(manager->ctx, client, sizeof(*client))

Meanwhile the ns_client_t object is accessed like this:

    isc_nmhandle_detach(&client->fetchhandle);

    client->query.attributes &= ~NS_QUERYATTR_RECURSING;
    client->state = NS_CLIENTSTATE_WORKING;

    qctx_init(client, &devent, 0, &qctx);

    client_shuttingdown = ns_client_shuttingdown(client);
    if (fetch_canceled || fetch_answered || client_shuttingdown) {
        [...]
    }

Even if the isc_nmhandle_detach(...) was the last handle detach, it
would mean that immediatelly, after calling the isc_nmhandle_detach(),
we would be causing use-after-free, because the ns_client_t is
immediatelly destroyed after setting .shuttingdown to true.

The similar code in the query_hookresume() already noticed this:

    /*
     * This event is running under a client task, so it's safe to detach
     * the fetch handle.  And it should be done before resuming query
     * processing below, since that may trigger another recursion or
     * asynchronous hook event.
     */
2022-03-25 10:38:35 +01:00
Ondřej Surý
9de10cd153 Remove extrahandle size from netmgr
Previously, it was possible to assign a bit of memory space in the
nmhandle to store the client data.  This was complicated and prevents
further refactoring of isc_nmhandle_t caching (future work).

Instead of caching the data in the nmhandle, allocate the hot-path
ns_client_t objects from per-thread clientmgr memory context and just
assign it to the isc_nmhandle_t via isc_nmhandle_set().
2022-03-25 10:38:35 +01:00
Ondřej Surý
23195f18bc Remove extra copies and stray members from ns_client_t
The ns_client_t is always attached to ns_clientmgr_t which has
associated memory context, server context, task and threadid.  Use those
directly from the ns_clientmgr_t instead of attaching it to an extra
copy in ns_client_t to make the ns_client_t more sleek and lean.

Additionally, remove some stray ns_client_t struct members that were not
used anywhere.
2022-03-25 10:18:11 +01:00
Ondřej Surý
dab22a54df Merge branch 'ondrej/statements-following-return-break-continue-or-goto-will-never-be-executed' into 'main'
Remove UNREACHABLE() statements after exit()

See merge request isc-projects/bind9!6027
2022-03-25 09:07:28 +00:00
Ondřej Surý
81fdc4a822 Remove UNREACHABLE() statements after exit()
Couple of UNREACHABLE() statements following exit() were found and
removed.
2022-03-25 09:25:11 +01:00
Ondřej Surý
b1eff7586d Merge branch 'ondrej/use-newer-compiler-features' into 'main'
Use modern C and modern compiler features

See merge request isc-projects/bind9!5480
2022-03-25 07:41:05 +00:00
Ondřej Surý
ae508c17bc Remove workaround for ancient clang versions (<< 3.2 and << 4.0.1)
Some ancient versions of clang reported uninitialized memory use false
positive (see https://bugs.llvm.org/show_bug.cgi?id=14461).  Since clang
4.0.1 has been long obsoleted, just remove the workarounds.
2022-03-25 08:33:43 +01:00
Ondřej Surý
20f0936cf2 Remove use of the inline keyword used as suggestion to compiler
Historically, the inline keyword was a strong suggestion to the compiler
that it should inline the function marked inline.  As compilers became
better at optimising, this functionality has receded, and using inline
as a suggestion to inline a function is obsolete.  The compiler will
happily ignore it and inline something else entirely if it finds that's
a better optimisation.

Therefore, remove all the occurences of the inline keyword with static
functions inside single compilation unit and leave the decision whether
to inline a function or not entirely on the compiler

NOTE: We keep the usage the inline keyword when the purpose is to change
the linkage behaviour.
2022-03-25 08:33:43 +01:00
Ondřej Surý
04d0b70ba2 Replace ISC_NORETURN with C11's noreturn
C11 has builtin support for _Noreturn function specifier with
convenience noreturn macro defined in <stdnoreturn.h> header.

Replace ISC_NORETURN macro by C11 noreturn with fallback to
__attribute__((noreturn)) if the C11 support is not complete.
2022-03-25 08:33:43 +01:00
Ondřej Surý
584f0d7a7e Simplify way we tag unreachable code with only ISC_UNREACHABLE()
Previously, the unreachable code paths would have to be tagged with:

    INSIST(0);
    ISC_UNREACHABLE();

There was also older parts of the code that used comment annotation:

    /* NOTREACHED */

Unify the handling of unreachable code paths to just use:

    UNREACHABLE();

The UNREACHABLE() macro now asserts when reached and also uses
__builtin_unreachable(); when such builtin is available in the compiler.
2022-03-25 08:33:43 +01:00
Ondřej Surý
fe7ce629f4 Add FALLTHROUGH macro for __attribute__((fallthrough))
Gcc 7+ and Clang 10+ have implemented __attribute__((fallthrough)) which
is explicit version of the /* FALLTHROUGH */ comment we are currently
using.

Add and apply FALLTHROUGH macro that uses the attribute if available,
but does nothing on older compilers.

In one case (lib/dns/zone.c), using the macro revealed that we were
using the /* FALLTHROUGH */ comment in wrong place, remove that comment.
2022-03-25 08:33:43 +01:00
Ondřej Surý
4a44e9dd36 Merge branch 'ondrej-save-tsan-files-with-txt-extension' into 'main'
Save parsed tsan files with .txt extension

See merge request isc-projects/bind9!6019
2022-03-23 19:31:02 +00:00
Ondřej Surý
80582073a5 Save parsed tsan files with .txt extension
When the parse tsan files have text extension they can be viewed
directly in the GitLab web UI without downloading them locally.
2022-03-23 20:29:17 +01:00
Matthijs Mekking
01fcc07a6b Merge branch 'matthijs-engine_pkcs11-save-error-output' into 'main'
Save keyfromlabel error output

See merge request isc-projects/bind9!6002
2022-03-21 09:47:31 +00:00
Matthijs Mekking
d6d107d804 Save keyfromlabel error output
Save the error output from pkcs11-tool and dnssec-keyfromlabel in the
engine_pkcs11 system test.
2022-03-21 10:11:02 +01:00
Ondřej Surý
8268526294 Merge branch 'ondrej/add-isc_nm_getnworkers' into 'main'
Make netmgr the authority on number of threads running

See merge request isc-projects/bind9!5999
2022-03-18 21:21:47 +00:00
Ondřej Surý
d70daa29f7 Make netmgr the authority on number of threads running
Instead of passing the "workers" variable back and forth along with
passing the single isc_nm_t instance, add isc_nm_getnworkers() function
that returns the number of netmgr threads are running.

Change the ns_interfacemgr and ns_taskmgr to utilize the newly acquired
knowledge.
2022-03-18 21:53:28 +01:00
Tony Finch
4761213e80 Merge branch '3201-no-vla' into 'main'
Avoid using C99 variable length arrays

Closes #3201

See merge request isc-projects/bind9!5956
2022-03-18 16:02:46 +00:00
Tony Finch
599c1d2a6b Avoid using C99 variable length arrays
From an attacker's point of view, a VLA declaration is essentially a
primitive for performing arbitrary arithmetic on the stack pointer. If
the attacker can control the size of a VLA they have a very powerful
tool for causing memory corruption.

To mitigate this kind of attack, and the more general class of stack
clash vulnerabilities, C compilers insert extra code when allocating a
VLA to probe the growing stack one page at a time. If these probes hit
the stack guard page, the program will crash.

From the point of view of a C programmer, there are a few things to
consider about VLAs:

  * If it is important to handle allocation failures in a controlled
    manner, don't use VLAs. You can use VLAs if it is OK for
    unreasonable inputs to cause an uncontrolled crash.

  * If the VLA is known to be smaller than some known fixed size,
    use a fixed size array and a run-time check to ensure it is large
    enough. This will be more efficient than the compiler's stack
    probes that need to cope with arbitrary-size VLAs.

  * If the VLA might be large, allocate it on the heap. The heap
    allocator can allocate multiple pages in one shot, whereas the
    stack clash probes work one page at a time.

Most of the existing uses of VLAs in BIND are in test code where they
are benign, but there was one instance in `named`, in the GSS-TSIG
verification code, which has now been removed.

This commit adjusts the style guide and the C compiler flags to allow
VLAs in test code but not elsewhere.
2022-03-18 15:11:48 +00:00
Tony Finch
eeead1cfe7 Remove a redundant variable-length array
In the GSS-TSIG verification code there was an alarming
variable-length array whose size came off the network, from the
signature in the request. It turned out to be safe, because the caller
had previously checked that the signature had a reasonable size.
However, the safety checks are in the generic TSIG implementation, and
the risky VLA usage was in the GSS-specific code, and they are
separated by the DST indirection layer, so it wasn't immediately
obvious that the risky VLA was in fact safe.

In fact this risky VLA was completely unnecessary, because the GSS
signature can be verified in place without being copied to the stack,
like the message covered by the signature. The `REGION_TO_GBUFFER()`
macro backwardly assigns the region in its left argument to the GSS
buffer in its right argument; this is just a pointer and length
conversion, without copying any data. The `gss_verify_mic()` call uses
both message and signature GSS buffers in a read-only manner.
2022-03-18 15:06:31 +00:00
Arаm Sаrgsyаn
ed22d12f10 Merge branch '3205-dig-tcp-next-server-on-connection-error-crash' into 'main'
Fix dig error when trying the next server after a TCP connection failure

Closes #3205

See merge request isc-projects/bind9!5976
2022-03-18 10:55:23 +00:00
Aram Sargsyan
ced79790b3 Add CHANGES note for [GL #3205] 2022-03-18 10:29:08 +00:00
Aram Sargsyan
03697f1bcc Add various dig/host tests for TCP/UDP socket error handling cases
Rework the "ans8" server in the "digdelv" system test to support various
modes of operations using a control channel.

The supported modes are:

1. `silent` (do not respond)
2. `close` (UDP: same as `silent`; TCP: also close the connection)
3. `servfail` (always respond with `SERVFAIL`)
4. `unstable` (constantly switch between `silent` and `servfail`)

Add multiple tests to check the handling of both TCP and UDP socket
error scenarios in dig/host.
2022-03-18 10:28:19 +00:00
Aram Sargsyan
0fb4fc1897 Fix dig error when trying the next server after a TCP connection failure
When encountering a TCP connection error while trying to initiate a
connection to a server, dig erroneously cancels the lookup even when
there are other server(s) to try, which results in an assertion failure.

Cancel the lookup only when there are no more queries left in the
lookup's queries list (i.e. `next` is NULL).
2022-03-18 10:28:19 +00:00
Arаm Sаrgsyаn
85870ad9ee Merge branch '3128-dig-does-not-recover-from-a-isc_nm_udpconnect-failure' into 'main'
After dig request errors, try to use other servers when they exist

Closes #3128

See merge request isc-projects/bind9!5967
2022-03-18 10:24:46 +00:00
Aram Sargsyan
b3a058e7bb Add CHANGES entry for [GL #3128] 2022-03-18 09:12:23 +00:00
Aram Sargsyan
e8a64d0cbe Add digdelv system test to check that dig tries other servers on error
Add a test to check whether dig tries the next query/server after
a connection error.

Add a test to check whether dig tries the next query/server after
a one or more (default is 3) connection/request timeouts.
2022-03-18 09:12:23 +00:00
Aram Sargsyan
bc203d6082 After dig request errors, try to use other servers when they exist
When timing-out or having other types of socket errors during a query,
dig isn't trying to perform the lookup using other servers which exist
in the lookup's queries list.

After configured amount of timeout retries, or after a socket error,
check if there are other queries/servers in the lookup's queries list,
and start the next one if it exists, instead of unconditionally failing.
2022-03-18 09:12:23 +00:00
Arаm Sаrgsyаn
da0d85d748 Merge branch '3020-dighost-servfail-bug' into 'main'
When resending a UDP request, insert the query to the lookup's list

Closes #3020

See merge request isc-projects/bind9!5954
2022-03-18 09:02:40 +00:00
Aram Sargsyan
3ec5d2d6ed Add digdelv system test to check timed-out result followed by a SERVFAIL
This test ensures that `dig` retries with another attempt after a
timed-out request, and that it does not crash when the retried
request returns a SERVFAIL result. See [GL #3020] for the latter
issue.
2022-03-18 08:24:39 +00:00
Aram Sargsyan
e353700189 Add CHANGES note for [GL #3020] 2022-03-18 08:24:38 +00:00
Aram Sargsyan
a962475948 When resending a UDP request, insert the query to the lookup's list
When a query times out, and `dig` (or `host`) creates a new query
to resend the request, it is being prepended to the lookup's queries
list, which can cause a confusion later, making `dig` (or `host`)
believe that there is another new query in the list, but that is
actually the old one, which was timed out. That mistake will result
in an assertion failure.

That can happen, in particular, when after a timed out request,
the retried request returns a SERVFAIL result, and the recursion
is enabled, and `+nofail` option was used with `dig` (that is the
default behavior in `host`, unless the `-s` option is provided).

Fix the problem by inserting the query just after the current,
timed-out query, instead of prepending to the list.

Before calling start_udp() detach `l->current_query`, like it is
done in another place in the function.

Slightly update a couple of debug messages to make them more
consistent.
2022-03-18 08:23:53 +00:00
Aram Sargsyan
e888c62fbd Fix an issue in dig when retrying with the next server after SERVFAIL
After a query results in a SERVFAIL result, and there is another
registered query in the lookup's queries list, `dig` starts the next
query to try another server, but for some reason, reports about that
also when the current query is in the head of the list, even if there
is no other query in the list to try.

Use the same condition for both decisions, and after starting the next
query, jump to the "detach_query" label instead of "next_lookup",
because there is no need to start the next lookup after we just started
a query in the current lookup.
2022-03-18 08:23:53 +00:00
Ondřej Surý
99906df09e Merge branch '3208-fix-xfrout-maxtimer-timer-log-message-log-level' into 'main'
Change xfer-out timer message log level to DEBUG(1)

Closes #3208

See merge request isc-projects/bind9!5995
2022-03-17 20:34:30 +00:00
Ondřej Surý
8f6e4dfa15 Change xfer-out timer message log level to DEBUG(1)
When max-transfer-*-out timeouts were reintroduced, the log message
about starting the timer was errorneously left as ISC_LOG_ERROR.
Change the log level of said message to ISC_LOG_DEBUG(1).
2022-03-17 21:28:29 +01:00
Ondřej Surý
4c008d20e6 Merge branch 'ondrej/add-missing-braces-clang-format-15' into 'main'
Add couple missing braces around single-line statements

See merge request isc-projects/bind9!5968
2022-03-17 17:50:42 +00:00
Ondřej Surý
ff22498849 Add couple missing braces around single-line statements
The clang-format-15 has new option InsertBraces that could add missing
branches around single line statements.  Use that to our advantage
without switching to not-yet-released LLVM version to add missing braces
in couple of places.
2022-03-17 18:27:45 +01:00
Ondřej Surý
8495edc31d Merge branch '3212-implement-incremental-rehashing-for-isc_ht-hashtables' into 'main'
Implement incremental hash table resizing in isc_ht

Closes #3212

See merge request isc-projects/bind9!5983
2022-03-17 07:35:00 +00:00
Ondřej Surý
5ccb28d6d8 Add CHANGES note for [GL #3212] 2022-03-17 08:16:24 +01:00
Ondřej Surý
cd52953f8a Update the isc_ht unit test to also tesh rehashing
As incremental rehashing has been added to isc_ht implementation, we
need to test whether the rehashing works.

Update the isc_ht unit test to test:

 * preinitialized hash table large enough to hold all the elements
 * smallest hash table that fully grows to hold all the elements
 * partially preinitialized hash table that grows
 * iterating while rehashing is in progress
2022-03-17 08:16:24 +01:00
Ondřej Surý
e42cb1f198 Implement incremental hash table resizing in isc_ht
Previously, an incremental hash table resizing was implemented for the
dns_rbt_t hash table implementation.  Using that as a base, also
implement the incremental hash table resizing also for isc_ht API
hashtables:

 1. During the resize, allocate the new hash table, but keep the old
    table unchanged.
 2. In each lookup, delete, or iterator operation, check both tables.
 3. Perform insertion operations only in the new table.
 4. At each insertion also move <r> elements from the old table to
    the new table.
 5. When all elements are removed from the old table, deallocate it.

To ensure that the old table is completely copied over before the new
table itself needs to be enlarged, it is necessary to increase the
size of the table by a factor of at least (<r> + 1)/<r> during resizing.

In our implementation <r> is equal to 1.

The downside of this approach is that the old table and the new table
could stay in memory for longer when there are no new insertions into
the hash table for prolonged periods of time as the incremental
rehashing happens only during the insertions.
2022-03-17 08:16:24 +01:00
Michał Kępień
7ba3a06935 Merge branch '3129-check-fetch-shutting-down-in-resume_dslookup' into 'main'
[CVE-2022-0667] Check if the fetch is shutting down in resume_dslookup()

See merge request isc-projects/bind9!5989
2022-03-16 22:05:26 +00:00
Michał Kępień
71dd44339f Merge branch '3158-confidential-issue-only-set-foundname-on-success' into 'main'
[CVE-2022-0635] DNAME lookups can trigger INSIST when synth-from-dnssec is enabled

See merge request isc-projects/bind9!5988
2022-03-16 21:42:28 +00:00
Michał Kępień
ae7fa0a308 Merge branch '3112-ensure-correct-ordering-in-isc__nm_process_sock_buffer' into 'main'
[CVE-2022-0396] Resolve #3112 TCP sockets stuck in CLOSE_WAIT

Closes #3112

See merge request isc-projects/bind9!5987
2022-03-16 21:36:53 +00:00
Michał Kępień
9c27a3b0e2 Merge branch '2950-confidential-cache-acceptance-rules' into 'main'
[CVE-2021-25220] prevent cache poisoning from forwarder responses

See merge request isc-projects/bind9!5986
2022-03-16 21:30:34 +00:00
Aram Sargsyan
9241363f36 Add CHANGES and release note for [GL #3129] 2022-03-16 22:11:49 +01:00
Mark Andrews
c9f28777f6 Add CHANGES and release note for [GL #3158] 2022-03-16 22:11:49 +01:00
Ondřej Surý
dcb6a0c4f8 Add CHANGES and release note for [GL #3112] 2022-03-16 22:11:49 +01:00
Petr Špaček
51546e8892 Add Release Note for [GL #2950] 2022-03-16 22:11:49 +01:00
Aram Sargsyan
f0f3370e14 Check if the fetch is shutting down in resume_dslookup()
The fetch can be in the shutting down state when resume_dslookup() is
trying to operate on it.

This is also a security issue, because a malicious actor can set up a
name server which delays certain queries in such a way that the fetch
will time out and shut down, which will cause named to crash.

Add a check to see if the fetch has the shutting down attribute set,
and cancel any further operations on it in such case.

A similar bug had been fixed earlier for the resume_qmin() function,
see [GL #966].
2022-03-16 22:11:49 +01:00
Mark Andrews
9fcc028f5c Skip calling find_coveringnsec if we found a DNAME
This is an optimisation as we can skip a lot of pointless work when we
know there is a DNAME there.

When we have a partial match and a DNAME above the QNAME, the closest
encloser has the same owner as the DNAME, will have the DNAME bit set
in the type map, and we wouldn't use it as we would return the
DNAME + RRSIG(DNAME) instead.

So there is no point in looking for it nor in attempting to check that
it is valid for the QNAME.
2022-03-16 22:11:49 +01:00
Ondřej Surý
bfa4b9c141 Run .closehandle_cb asynchrounosly in nmhandle_detach_cb()
When sock->closehandle_cb is set, we need to run nmhandle_detach_cb()
asynchronously to ensure correct order of multiple packets processing in
the isc__nm_process_sock_buffer().  When not run asynchronously, it
would cause:

  a) out-of-order processing of the return codes from processbuffer();

  b) stack growth because the next TCP DNS message read callback will
     be called from within the current TCP DNS message read callback.

The sock->closehandle_cb is set to isc__nm_resume_processing() for TCP
sockets which calls isc__nm_process_sock_buffer().  If the read callback
(called from isc__nm_process_sock_buffer()->processbuffer()) doesn't
attach to the nmhandle (f.e. because it wants to drop the processing or
we send the response directly via uv_try_write()), the
isc__nm_resume_processing() (via .closehandle_cb) would call
isc__nm_process_sock_buffer() recursively.

The below shortened code path shows how the stack can grow:

 1: ns__client_request(handle, ...);
 2: isc_nm_tcpdns_sequential(handle);
 3: ns_query_start(client, handle);
 4:   query_lookup(qctx);
 5:     query_send(qctcx->client);
 6:       isc__nmhandle_detach(&client->reqhandle);
 7:         nmhandle_detach_cb(&handle);
 8:           sock->closehandle_cb(sock); // isc__nm_resume_processing
 9:             isc__nm_process_sock_buffer(sock);
10:               processbuffer(sock); // isc__nm_tcpdns_processbuffer
11:                 isc_nmhandle_attach(req->handle, &handle);
12:                 isc__nm_readcb(sock, req, ISC_R_SUCCESS);
13:                   isc__nm_async_readcb(NULL, ...);
14:                     uvreq->cb.recv(...); // ns__client_request

Instead, if 'sock->closehandle_cb' is set, we need to run detach the
handle asynchroniously in 'isc__nmhandle_detach', so that on line 8 in
the code flow above does not start this recursion. This ensures the
correct order when processing multiple packets in the function
'isc__nm_process_sock_buffer()' and prevents the stack growth.

When not run asynchronously, the out-of-order processing leaves the
first TCP socket open until all requests on the stream have been
processed.

If the pipelining is disabled on the TCP via `keep-response-order`
configuration option, named would keep the first socket in lingering
CLOSE_WAIT state when the client sends an incomplete packet and then
closes the connection from the client side.
2022-03-16 22:11:49 +01:00
Petr Špaček
612f277877 Add CHANGES note for [GL #2950] 2022-03-16 22:11:49 +01:00
Mark Andrews
5c271f91e1 Only update foundname if returning DNS_R_COVERINGNSEC
'setup_delegation' depends on 'foundname' being the value returned
by 'dns_rbt_findnode' in the cache and 'find_coveringnsec' was
modifying 'foundname' when a covering NSEC was not found.
2022-03-16 22:11:49 +01:00
Mark Andrews
fe1bbba259 Look for zones deeper than the current domain or forward name
When caching glue, we need to ensure that there is no closer
source of truth for the name. If the owner name for the glue
record would be answered by a locally configured zone, do not
cache.
2022-03-16 22:11:49 +01:00
Mark Andrews
c289913e5c Check cached names for possible "forward only" clause
When caching additional and glue data *not* from a forwarder, we must
check that there is no "forward only" clause covering the owner name
that would take precedence.  Such names would normally be allowed by
baliwick rules, but a "forward only" zone introduces a new baliwick
scope.
2022-03-16 22:11:49 +01:00
Mark Andrews
7e37b5e379 Check that the forward declaration is unchanged and not overridden
If we are using a fowarder, in addition to checking that names to
be cached are subdomains of the forwarded namespace, we must also
check that there are no subsidiary forwarded namespaces which would
take precedence. To be safe, we don't cache any responses if the
forwarding configuration has changed since the query was sent.
2022-03-16 22:11:49 +01:00
Mark Andrews
5dc3b25d03 Add additional name checks when using a forwarder
When using a forwarder, check that the owner name of response
records are within the bailiwick of the forwarded name space.
2022-03-16 22:11:49 +01:00
Matthijs Mekking
fd8dd9841d Merge branch '3185-follow-up-fix-zone-documentation' into 'main'
Fix zone named.conf man page documentation

Closes #3185

See merge request isc-projects/bind9!5977
2022-03-15 13:14:25 +00:00
Matthijs Mekking
01b125ff05 Fix named.conf man page documentation
Commit 4ca74eee49 update the zone grammar
such that the zone statement is printed with the valid options per
zone type.

This commit is a follow-up, putting back the ZONE heading and adding
a note that these zone statements may also be put inside the view
statement.

It is tricky to actually print the zone statements inside
the view statement, and so we decided that we would add a note to say
that this is possible.
2022-03-15 14:13:45 +01:00
Ondřej Surý
13b20ef411 Merge branch '3202-cleanup-isc_timer-API' into 'main'
Refactor and simplify isc_timer API

See merge request isc-projects/bind9!5966
2022-03-14 21:13:24 +00:00
Ondřej Surý
7f91f1ecaa Add CHANGES note for [GL #3202] 2022-03-14 13:00:05 -07:00
Ondřej Surý
79b5ccbf34 Implement isc_interval_t on top of isc_time_t
Change the isc_interval_t implementation from separate data type and
separate implementation to be shim implementation on top of isc_time_t.
The distinction between isc_interval_t and isc_time_t has been kept
because they are semantically different - isc_interval_t is relative and
isc_time_t is absolute, but this allows isc_time_t and isc_interval_t to
be freely interchangeable, f.e. this:

    isc_time_t *t1;
    isc_interval_t *interval;
    isc_time_t *t2;

    isc_interval_set(interval, isc_time_seconds(t2), isc_time_nanoseconds(t2);;
    isc_time_subtract(t1, interval, t2);
    isc_interval_set(interval, isc_time_seconds(t2), isc_time_nanoseconds(t2));

to just:

    isc_time_t *t1;
    isc_interval_t *interval;
    isc_time_t *t2;

    isc_time_subtract(t1, t2, interval);

without introducing a whole set of new functions.
2022-03-14 13:00:05 -07:00
Ondřej Surý
e6ca2a651f Refactor isc_timer_reset() use with semantic patch
Add and apply semantic patch to remove expires argument from the
isc_timer_reset() calls through the codebase.
2022-03-14 13:00:05 -07:00
Ondřej Surý
6437bcc488 Remove expires argument from isc_timer API
The isc_timer_reset() now works only with intervals for once timers.

This makes the API almost 1:1 compatible with the libuv timers making
the further refactoring possible.
2022-03-14 13:00:05 -07:00
Ondřej Surý
27850a5ad2 Change isc_timer_reset() usage to never use expires argument
There were two places where expires argument (absolute isc_time_t value)
was being used.  Both places has been converted to use relative interval
argument in preparation of simplification and refactoring of isc_timer
API.
2022-03-14 13:00:05 -07:00
Ondřej Surý
c259cecc90 Refactor isc_timer_create() to just create timer
The isc_timer_create() function was a bit conflated.  It could have been
used to create a timer and start it at the same time.  As there was a
single place where this was done before (see the previous commit for
nta.c), this was cleaned up and the isc_timer_create() function was
changed to only create new timer.
2022-03-14 13:00:05 -07:00
Ondřej Surý
514053f244 Change lib/dns/nta.c to create inactive timer and then reset it
In nta.c, it was the only place where the active timer was created
directly instead of first creating inactive timer and then starting it
with isc_timer_reset().

Change the code to create inactive timer first, so we can refactor the
isc_timer_create() function.
2022-03-14 13:00:05 -07:00
Ondřej Surý
8fbb42c49c Remove "a temporary hack, 'rndc timerpoke'"
In 2002, "a temporary hack, 'rndc timerpoke'" was added.  It's time
for it to go, so it was removed.
2022-03-14 13:00:05 -07:00
Ondřej Surý
f4751a91f7 Remove unused isc_timer_touch() function
The isc_timer_touch() was unused, just remove it.
2022-03-14 13:00:05 -07:00
Ondřej Surý
bbe1c06a8b Remove isc_timertype_limited from isc_timer API
The isc_timertype_limited timer type was never used (not even in tests).
Remove isc_timertype_limited timer type before planned refactoring.
2022-03-14 13:00:05 -07:00
Petr Špaček
c752dff3b4 Merge branch 'pspacek/manpage-hyperlinks-fix' into 'main'
Fix dig option hyperlinks in the TSIG section of the ARM

See merge request isc-projects/bind9!5979
2022-03-14 12:38:30 +00:00
Petr Špaček
f98a6a5308 Fix dig option hyperlinks in the TSIG section of the ARM
While backporting !5934 I noticed a copy&paste mistake in TSIG
chapter of the ARM.

The incorrect reference was introduced by "Add hyperlinks from
program options to definition in man pages" commit but it is not
worth creating separate MR for that when the backport is not merged
yet.

(cherry picked from commit 4daef4a2a7)
2022-03-14 13:22:40 +01:00
Petr Špaček
49d2a12e7c Merge branch 'pspacek/manpage-hyperlinks' into 'main'
Add hyperlinks to manual pages

See merge request isc-projects/bind9!5934
2022-03-14 09:53:02 +00:00
Tony Finch
ad5b0402c9 Regenerate the named.conf manual with hyperlinks
The named.conf grammar is exported to the manual via
doc/misc/rst-options.pl which is the ultimate source
for the non-grammar parts of the man page.
2022-03-14 10:47:45 +01:00
Petr Špaček
1d4d008fc9 Add internal hyperlinks to See Also section of manual pages
Replace :manpage: with :iscman: to generate internal hyperlinks. That
way reader can use links even when offline, and jumps to man pages
for the same version.

Formerly HTML version of man pages did not have links in See Also
section because :manpage: role in Sphinx can generate only external
hyperlinks - and we do not have that enabled.
Enabling the Sphinx :manpage: linking could reliably create hyperlinks
only to external URLs, but that would take users to another version
of docs.

Generated by:
    find bin -name '*.rst' | xargs sed -i -e 's/:manpage:`\([^(]\+\)(\([0-9]\))`/:iscman:`\1(\2) <\1>`/g'
+ hand-edit to revert change for mmencode reference which is
  not provided in our source tree.
2022-03-14 10:46:36 +01:00
Petr Špaček
420a71df57 Remove reference to ndc utility from BIND 8 2022-03-14 10:46:36 +01:00
Petr Špaček
53a5776025 Hyperlink program names to their manual pages
Use the new role :iscman: to replace all occurences or ``binary``
with :iscman:`binary`, creating a hyperlink to the manual page.

Generated using:
    find bin -name *.rst | xargs fgrep --files-with-matches '.. iscman' | xargs -I{} -n1 basename {} .rst > /tmp/progs
    for PROG in $(cat /tmp/progs); do find -name '*.rst' | xargs sed -i -e "s/\`\`$PROG\`\`/:iscman:\`$PROG\`/g"; done

Additional hand-edits were done mainly around filter-aaaa and
filter-a which are program names and and option names at the
same time. Couple more edits was neede to fix .rst syntax broken by
automatic replacement.
2022-03-14 10:46:36 +01:00
Petr Špaček
c7085be211 Use semantic markup for :program: self-references
Sphinx has it's own :program: syntax for refering to program names.
Use it for self-references in manual pages. These self-references are
not clickable and not as eye-cathing as links, which is a good thing.
There is no point in attracting attention to ``dig`` several times on a
single page dedicated to dig itself.

Substituted automatically using:
    find bin  -name *.rst | xargs fgrep --files-with-matches '.. program' | xargs -n1 bash /tmp/repl.sh

With /tmp/repl.sh being:
    BASE=$(basename "$1" .rst)
    sed -i -e "s/\`\`$BASE\`\`/:program:\`$BASE\`/g" "$1"
2022-03-14 10:46:36 +01:00
Petr Špaček
7e7a946d44 Introduce new Sphinx role iscman for ISC manual pages
The new directive and role "iscman" allow to tag & reference man pages in
our source tree. Essentially it is just namespacing for ISC man pages,
but it comes with couple benefits.

Differences from .. _man_program label we formerly used:
- Does not expand :ref:`man_program` into full text of the page header.
- Generates index entry with category "manual page".
- Rendering style is closer to ubiquitous to the one produced
  by ``named`` syntax.

Differences from Sphinx built-in :manpage: role:
- Supports all builders with support for cross-references.
- Generates internal links (unlike :manpage: which generates external
  URLs).
- Checks that target exists withing our source tree.
2022-03-14 10:46:36 +01:00
Tony Finch
ccc6378355 More man page option hyperlinks
The dig man page wanted -h option hyperlink and anchor, and there
were a couple of missing cross-references in the rndc man page.
2022-03-14 10:46:36 +01:00
Petr Špaček
a85df3ff9c Add hyperlinks from program options to definition in man pages
Side-effect of hyperlinking is that typos in program and option names
are now detected by Sphinx.

Candidate -options were detected using:
    find -name *.rst | xargs grep '``-[^`]'
and then modified from ``-o`` to :option:`-o` using regex
    s/``\(-[^`]\+\)``/:option:`\1`/
+ manual modifications where necessary.

Non-hyphenated options were detected by looking at context around
program names:
    find bin -name *.rst | xargs -I{} -n1 basename {} .rst | sort -u
and grepping for program name with trailing whitespace.

Stand-alone program names like ``named`` are not hyperlinked in this
commit.
2022-03-14 10:46:36 +01:00
Petr Špaček
5f0ee7c303 Fix rndc command in release notes for 9.17.12
rndc checkds does not exist, it should have been rndc dnssec

Related: #2488, !4813
2022-03-14 10:46:36 +01:00
Petr Špaček
8537878c01 Add semantic markup for program names into manual pages
It allows to cross-reference options in man pages from other
documents using :option:`named -g` syntax.
2022-03-14 10:46:36 +01:00
Petr Špaček
ec30944aa4 Denote all command line options using semantic markup (.. option::)
The markup allows referencing individual options, and also makes them
more legible (no more thin red text on gray background).

Most of the work was done using regexes:
    s/^``-\(.*\)``$/.. option:: -\1\r/
    s/^``+\(.*\)``$/.. option:: +\1\r/
on bin/**/*.rst files along with visual inspection and hand-edits,
mostly for positional arguments.

Regex for rndc.rst:
    s/^``\(.*\)``/.. option:: \1\r/
+ hand edits to remove extra asterisk and whitespace here and there.
2022-03-14 10:46:32 +01:00
Michał Kępień
e9f4d00bf0 Merge branch 'michal/tidy-setup-of-python-based-tests' into 'main'
Tidy setup of Python-based tests

See merge request isc-projects/bind9!5960
2022-03-14 08:30:05 +00:00
Michał Kępień
173ad9cf46 Tweak Automake conditionals for pytest-based tests
Since pytest itself skips tests using dnspython if the latter is not
available, also using Automake conditionals for silently skipping
pytest-based tests requiring dnspython is redundant and hides
information.  Allow all pytest-based tests requiring dnspython to be run
whenever pytest itself is available, in order to ensure test skipping is
done in a uniform manner.

Note that the above reasoning only applies to pytest-based tests, so
similar adjustments were not made for shell-based tests using Python
scripts that require dnspython ("chain", "cookie", "dnssec", "qmin").
2022-03-14 08:59:32 +01:00
Michał Kępień
00392921f0 Rework skipping long tests
The ability to conveniently mark tests which should only be run when the
CI_ENABLE_ALL_TESTS environment variable is set seems to be useful on a
general level and therefore it should not be limited to the "timeouts"
system test, where it is currently used.

pytest documentation [1] suggests to reuse commonly used test markers by
putting them all in a single Python module which then has to be imported
by test files that want to use the markers defined therein.  Follow that
advice by creating a new bin/tests/system/pytest_custom_markers.py
Python module containing the relevant marker definitions.

Note that "import pytest_custom_markers" works from a test-specific
subdirectory because pytest modifies sys.path so that it contains the
paths to all parent directories containing a conftest.py file (and
bin/tests/system/ is one).  PyLint does not like that, though, so add a
relevant PyLint suppression.

The above changes make bin/tests/system/timeouts/conftest.py redundant,
so remove it.

[1] https://docs.pytest.org/en/7.0.x/how-to/skipping.html#id1
2022-03-14 08:59:32 +01:00
Michał Kępień
49312d6bb2 Rework imports in dnspython-based system tests
Ensure all "import dns.*" statements are always placed after
pytest.importorskip('dns') calls, in order to allow the latter to
fulfill their purpose.  Explicitly import all dnspython modules used by
each dnspython-based test to avoid relying on nested imports.  Replace
function-scoped imports with global imports to reduce code duplication.
2022-03-14 08:59:32 +01:00
Michał Kępień
05c97f2329 Fix skipping tests requiring dnspython
The intended purpose of the @pytest.mark.dnspython{,2} decorators was to
cause dnspython-based tests to be skipped if dnspython is not available
(or not recent enough).  However, a number of system tests employing
those decorators contain global "import dns.resolver" statements which
trigger ImportError exceptions during test initialization if dnspython
is not available.  In other words, the @pytest.mark.dnspython{,2}
decorators serve no useful purpose.

Currently, whenever a Python-based test requires dnspython, that
requirement applies to all tests in a given *.py file.  Given that,
employ global pytest.importorskip() calls to ensure dnspython-based
parts of various system tests are skipped when dnspython is not
available.  Remove all occurrences of the @pytest.mark.dnspython{,2}
decorators (and all associated code) to prevent confusion.
2022-03-14 08:59:32 +01:00
Michał Kępień
704ad2907f Fix skipping tests requiring the requests module
The intended purpose of the @pytest.mark.requests decorator was to cause
Python-based parts of the "statschannel" system test to be skipped if
the requests Python module is not available.  However, both
tests-json.py and tests-xml.py contain a global "import requests"
statement which triggers ImportError exceptions during test
initialization if the requests module is not available.  In other words,
the @pytest.mark.requests decorator serves no useful purpose.

Since all tests in both tests-json.py and tests-xml.py depend on the
requests Python module, employ pytest.importorskip() to ensure the
Python-based parts of the "statschannel" system test are skipped when
the requests module is not available.  Remove all occurrences of the
@pytest.mark.requests decorator (and all associated code) to prevent
confusion.
2022-03-14 08:59:32 +01:00
Michał Kępień
286b57c7f1 Simplify skipping tests depending on libxml2
All tests in bin/tests/system/statschannel/tests-xml.py require libxml2
support to be enabled in BIND 9 at build-time.  Instead of applying the
same pytest.mark.skipif() decorator to every test in that file, set the
'pytestmark' global accordingly in order to immediately skip all tests
in tests-xml.py if libxml2 support is not compiled in.

Remove all occurrences of the @pytest.mark.xml decorator (and all
associated code) from the "statschannel" system test as the
xml.etree.ElementTree module is a part of the Python standard library
since Python 2.5 (so checking whether it is available is redundant) and
checking for libxml2 support in the tested BIND 9 build is already
handled by setting the 'pytestmark' global accordingly.
2022-03-14 08:59:32 +01:00
Michał Kępień
0a76f186a5 Simplify skipping tests depending on json-c
All tests in bin/tests/system/statschannel/tests-json.py require json-c
support to be enabled in BIND 9 at build-time.  Instead of applying the
same pytest.mark.skipif() decorator to every test in that file, set the
'pytestmark' global accordingly in order to immediately skip all tests
in tests-json.py if json-c support is not compiled in.

Remove all occurrences of the @pytest.mark.json decorator (and all
associated code) from the "statschannel" system test as the json module
is a part of the Python standard library since Python 2.6 (so checking
whether it is available is redundant) and checking for json-c support in
the tested BIND 9 build is already handled by setting the 'pytestmark'
global accordingly.

Also remove a related excerpt from bin/tests/system/rpzextra/conftest.py
as it is a copy-paste artifact that serves no purpose in the "rpzextra"
system test.
2022-03-14 08:59:32 +01:00
Michał Kępień
96b7f9f9aa Refactor "statschannel" test's helper modules
The "statschannel" system test contains two Python helper modules:

  - generic.py: test functions directly invoked by both tests-json.py
    and test-xml.py,

  - helper.py: helper functions invoked by test functions in generic.py.

The above logic for splitting helper functions into Python modules
prevents selective test skipping from working due to unconditional
import statements being present in both helper modules.  For example, if
dnspython is not available on the test host, tests-json.py imports
generic.py, which in turn imports helper.py, which in turn attempts to
import various dnspython modules, triggering ImportError exceptions
during test initialization.  Various decorators used for some tests
(like @pytest.mark.dnspython) suggest that such a scenario should be
handled gracefully, but that is not the case - modifying the test
collection in conftest.py does not prevent pytest from failing due to
import errors.

Fix by moving helper functions around to achieve a different split:

  - generic.py: helper functions only relying on the Python standard
    library,

  - generic_dnspython.py: helper functions requiring dnspython.

Only two tests in tests-{json,xml}.py need dnspython to work
(test_traffic_json(), test_traffic_xml()).  Since all
dnspython-dependent code is now present in generic_dnspython.py, employ
pytest.importorskip() in those two tests to ensure they can be
selectively skipped when dnspython is not available.  Adjust other code
to account for the revised Python helper module layout.  Remove all
occurrences of the @pytest.mark.dnspython decorator (and all associated
code) from the "statschannel" system test to prevent confusion.
2022-03-14 08:59:32 +01:00
Michał Kępień
4e0d576858 Improve test discovery logic in get_ports.sh
The find invocation used by the bin/tests/system/get_ports.sh script
("find . -maxdepth 1 -mindepth 1 -type d") assumes the list of
directories in bin/tests/system/ remains unchanged throughout the run
time of a single system test suite.  With pytest in use and the
conftest.py file now present in bin/tests/system/, that assumption is no
longer true as a __pycache__ directory may be created when the first
pytest-based test is started.  Since the list of names returned by the
above find invocation serves as a fixed-size array of "port range
slots", any changes to that list during a system test suite run may lead
to port assignment collisions [1].

Fix by making the find invocation more nuanced, so that it only returns
names of directories containing test code.  Squash a grep / cut pipeline
into a single awk invocation.

[1] see commit 31e5ca4bd9
2022-03-14 08:59:32 +01:00
Michał Kępień
53ef8835c1 Reuse common port-related test fixtures
Most Python-based system tests need to know which ports were assigned to
a given test by bin/tests/system/get_ports.sh.  This is currently
handled by inspecting the values of various environment variables (set
by bin/tests/system/run.sh) and passing the port numbers to Python
scripts via pytest fixtures.  However, this glue code has so far been
copy-pasted into each system test using it, rather than reused.

Since pytest also looks for conftest.py files in parent directories,
move commonly used fixtures to bin/tests/system/conftest.py.  Set the
scope of all the moved fixtures to "session" as their return values are
only based on environment variables, so there is no point in recreating
them for every test requesting them.  Adjust test code accordingly.
2022-03-14 08:59:32 +01:00
Ondřej Surý
342c06c335 Merge branch '3203-fix-the-build-flag-order' into 'main'
Fix the remaining cases of <prog>_CFLAGS -> <prog>_CPPFLAGS

Closes #3203

See merge request isc-projects/bind9!5971
2022-03-13 17:50:50 +00:00
Ondřej Surý
41a60a0e21 Fix the remaining cases of <prog>_CFLAGS -> <prog>_CPPFLAGS
Building BIND 9 with older version of BIND 9 installed would result in
build failure.  Fix the last two remaining cases where <prog>_CFLAGS was
being used leading to wrong order of the build flags on the command line.
2022-03-13 17:42:09 +01:00
Petr Špaček
b103f516d0 Merge branch '2799-doc-build-fixes' into 'main'
Fix docs build

See merge request isc-projects/bind9!5961
2022-03-11 11:20:50 +00:00
Petr Špaček
524fce77fe Fix docs build from tarball broken by MR !5254
Related: !5254
2022-03-11 10:54:39 +01:00
Petr Špaček
b0f6fc7f2f Shorten artifact retention for docs:tarball job to one day
We now run both docs and docs:tarball jobs at the same time and keeping
artifacts for longer period of time is a waste.

Artifacts for docs job has to be kept for long period of time because
they are used by scripts behind bind.isc.org web site.
2022-03-11 10:54:35 +01:00
Petr Špaček
188684a31d Always check if docs can be built from tarball
The docs:tarball job is deemed to be cheap enough to run all the time
and it catches omissions in dist targets of Makefiles.

MR !5254 was missing changes to dist target in Makefile and broke docs
build from tarball without us noticing during pipeline run on the MR,
and it manifested itself only on scheduled pipelines which include
docs:tarball job.
2022-03-11 10:52:28 +01:00
Ondřej Surý
53dd4f02c1 Merge branch '3200-add-per-send-timer' into 'main'
Change single write timer to per-send timers

Closes #3200

See merge request isc-projects/bind9!5955
2022-03-11 09:39:58 +00:00
Ondřej Surý
8ace9e0c62 Add CHANGES and release note for [GL #3200] 2022-03-11 09:58:02 +01:00
Ondřej Surý
49c804f8b7 Cleanup the nmhandle attach/detach in httpd.c
In httpd.c, the send callback can directly call read callback without
calling isc_nm_resumeread().  When per-send timeout was added, this
could lead to use-after-free when shutting down the named.

Cleanup the way how we attach to .readhandle and .sendhandle, so there's
assurance that .readhandle will be always non-NULL when reading and
.sendhandle will be always non-NULL when sending.

Additionally, it was found that the implementation ignored the
"Connection: close" header and it worked only accidentally by closing
the connection after the first read from the TCP socket.  This has been
also fixed.
2022-03-11 09:57:10 +01:00
Ondřej Surý
6ddac2d56d On shutdown, reset the established TCP connections
Previously, the established TCP connections (both client and server)
would be gracefully closed waiting for the write timeout.

Don't wait for TCP connections to gracefully shutdown, but directly
reset them for faster shutdown.
2022-03-11 09:56:57 +01:00
Ondřej Surý
a761aa59e3 Change single write timer to per-send timers
Previously, there was a single per-socket write timer that would get
restarted for every new write.  This turned out to be insufficient
because the other side could keep reseting the timer, and never reading
back the responses.

Change the single write timer to per-send timer which would in turn
reset the TCP connection on the first send timeout.
2022-03-11 09:56:57 +01:00
Petr Špaček
1357d44605 Merge branch '2799-documentation-for-administrative-tools-is-out-of-sync-with-manual-pages' into 'main'
Fix Administrative Tools section in the ARM

Closes #2799 and #2826

See merge request isc-projects/bind9!5254
2022-03-10 19:17:03 +00:00
Tony Finch
178aef5b8c Refer to RFC 4592 for DNS wildcards
The named-checkzone(1) and named-compilezone(1) manual pages used to
refer to the description of wildcards in RFC 1034.
2022-03-10 20:13:23 +01:00
Petr Špaček
785f6d470f Generate diffs in tarball-create CI job
Usually it is just nits and it is much easier to debug when you actually
can see what the differences were.
2022-03-10 20:13:22 +01:00
Suzanne Goldlust
2d2d87a615 Fix Tools for Use With the Name Server Daemon in the ARM
Remove outdated command references from ARM section
3.3.1. Tools for Use With the Name Server Daemon
and replace them with links to man pages.

Fixes: #2799
2022-03-10 20:13:22 +01:00
Tony Finch
315b3c3a1a In the ARM appendix, sort man page sections alphabetically 2022-03-10 20:13:22 +01:00
Petr Špaček
9992f7808c Split out named-compilezone and named-checkzone man pages
Both utilities were included as one man page, but this caused a problem:
Sphinx directive .. include was used twice on the same file, which
prevented us from using labels (or anything with unique identifier) in
the man pages. This effectivelly prevented linking to them.

Splitting man pages allows us to solve the linking problems and also
clearly make text easier to follow because it does not mention two tools
at the same time.

This change causes duplication of text, but given the frequecy of changes
to these tools I think it is acceptable. I've considered deduplication
using smaller .rst snippets which get included into both man pages,
but it would require more sed scripting to handle defaults etc. and
I think it would be way too complex solution for this problem.

Related: #2799
2022-03-10 20:13:22 +01:00
Petr Špaček
2e42414522 Split out ddns-confgen and tsig-keygen man pages
Both utilities were included as one man page, but this caused a problem:
Sphinx directive .. include was used twice on the same file, which
prevented us from using labels (or anything with unique identifier) in
the man pages. This effectivelly prevented linking to them.

Splitting man pages allows us to solve the linking problems and also
clearly make text easier to follow because it does not mention two tools
at the same time.

This change causes duplication of text, but given the frequecy of changes
to these tools I think it is acceptable.

Related: #2799
2022-03-10 20:13:22 +01:00
Petr Špaček
473d5a8d03 Remove nonexistent option -r from confgen man pages
Fixes omission in !269.

Fixes: #2826
2022-03-10 20:13:18 +01:00
Tony Finch
ca1da46ac1 Merge branch '3199-doc-dev' into 'main'
a few developer documentation nits

Closes #3199

See merge request isc-projects/bind9!5953
2022-03-10 14:08:38 +00:00
Tony Finch
e532d39146 Update the status of Python
There are no longer any Python utilities in BIND: like Perl it is now
used for test scripts and generating some documentation and source
files.
2022-03-09 18:01:28 +00:00
Tony Finch
037468f6a4 Drop references to Windows in doc/dev
Windows is not a supported platform any more.
2022-03-09 18:01:28 +00:00
Tony Finch
328d11297d Small developer documentation cleanups
GitLab replaced RT, we don't support 1990s operating systems, we
like wrapped paragraphs, and we don't need that extra comma.
2022-03-09 18:01:28 +00:00
Tony Finch
ec1e8e7001 Drop documents that have been folded into doc/dev/dev.md
There is no need to keep obsolete duplicate docs around.
2022-03-09 18:01:28 +00:00
Tony Finch
6be83f2eb7 Remove documentation for rndc keydone
This feature never made it through the 9.9 development cycle; it is
now covered by `rndc signing` which is adequately documented
elsewhere.
2022-03-09 18:01:28 +00:00
Tony Finch
1c77f55dc6 Merge branch '3189-version-stdout' into 'main'
Consistently print version numbers to stdout

Closes #3189

See merge request isc-projects/bind9!5940
2022-03-09 17:55:37 +00:00
Tony Finch
338df9e1ff Correct spelling of dnssec-signzone in output file
The version comment in the signed zone said "dnssec_signzone". To fix
it, use the same `program` variable as other warnings and messages.
2022-03-09 17:37:11 +00:00
Tony Finch
6bcfa0c4ec Consistently print version numbers to stdout
Since the user asked for the version number it is logical to make it a
non-error, i.e. print to stdout (not stderr) and exit(0).

Closes #3189
2022-03-09 17:37:07 +00:00
Tony Finch
bfaf88ce7d Merge branch '3188-dig-noidn' into 'main'
Stop dig complaining about +noidn when it can't IDN

Closes #3188

See merge request isc-projects/bind9!5927
2022-03-09 14:42:11 +00:00
Tony Finch
ae73a8d87a Stop dig complaining about +noidn when it can't IDN
When dig was built without IDN support, it reported an error if the
+noidnin and/or +noidnout options were used. This means the options
were not useful for a script that wants consistent lack of IDN
translation regardless of how BIND is built.

Make dig complain about lack of built-in IDN support only when the
user asks for IDN translation.

Closes #3188
2022-03-09 13:13:15 +00:00
Ondřej Surý
e369c90369 Merge branch 'ondrej/remove-ATOMIC_VAR_INIT' into 'main'
Remove usage of deprecated ATOMIC_VAR_INIT() macro

See merge request isc-projects/bind9!5949
2022-03-09 08:24:40 +00:00
Ondřej Surý
f251d69eba Remove usage of deprecated ATOMIC_VAR_INIT() macro
The C17 standard deprecated ATOMIC_VAR_INIT() macro (see [1]).  Follow
the suite and remove the ATOMIC_VAR_INIT() usage in favor of simple
assignment of the value as this is what all supported stdatomic.h
implementations do anyway:

  * MacOSX.plaform: #define ATOMIC_VAR_INIT(__v) {__v}
  * Gcc stdatomic.h: #define ATOMIC_VAR_INIT(VALUE)	(VALUE)

1. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1138r0.pdf
2022-03-08 23:55:10 +01:00
Ondřej Surý
0b68596c45 Merge branch 'ondrej/lib/isc/ht.c-cleanup' into 'main'
Make isc_ht_init() and isc_ht_iter_create() return void

See merge request isc-projects/bind9!5943
2022-03-08 18:20:49 +00:00
Ondřej Surý
d128656d2e Make dns_catz_get_iterator() return void
Previously, the function(s) in the commit subject could fail for various
reasons - mostly allocation failures, or other functions returning
different return code than ISC_R_SUCCESS.  Now, the aforementioned
function(s) cannot ever fail and they would always return ISC_R_SUCCESS.

Change the function(s) to return void and remove the extra checks in
the code that uses them.
2022-03-08 14:51:55 +01:00
Ondřej Surý
8fa27365ec Make isc_ht_init() and isc_ht_iter_create() return void
Previously, the function(s) in the commit subject could fail for various
reasons - mostly allocation failures, or other functions returning
different return code than ISC_R_SUCCESS.  Now, the aforementioned
function(s) cannot ever fail and they would always return ISC_R_SUCCESS.

Change the function(s) to return void and remove the extra checks in
the code that uses them.
2022-03-08 14:51:55 +01:00
Ondřej Surý
3db335bca0 Merge branch 'ondrej/lib/isc/heap.c-cleanup' into 'main'
Make isc_heap_create() and isc_heap_insert() return void

See merge request isc-projects/bind9!5756
2022-03-08 10:50:35 +00:00
Ondřej Surý
bbb4cdb92d Make isc_heap_create() and isc_heap_insert() return void
Previously, the function(s) in the commit subject could fail for various
reasons - mostly allocation failures, or other functions returning
different return code than ISC_R_SUCCESS.  Now, the aforementioned
function(s) cannot ever fail and they would always return ISC_R_SUCCESS.

Change the function(s) to return void and remove the extra checks in
the code that uses them.
2022-03-08 11:19:34 +01:00
Ondřej Surý
acf5986a7c Merge branch '2201-reimplement-set_tcp_maxseg-for-netmgr' into 'main'
Set TCP maximum segment size to minimum

Closes #2201

See merge request isc-projects/bind9!5468
2022-03-08 10:11:45 +00:00
Ondřej Surý
67dbe0ae4d Add CHANGES note for [GL #2201] 2022-03-08 10:27:22 +01:00
Ondřej Surý
8098a58581 Set TCP maximum segment size to minimum size of 1220
Previously the socket code would set the TCPv6 maximum segment size to
minimum value to prevent IP fragmentation for TCP.  This was not yet
implemented for the network manager.

Implement network manager functions to set and use minimum MTU socket
option and set the TCP_MAXSEG socket option for both IPv4 and IPv6 and
use those to clamp the TCP maximum segment size for TCP, TCPDNS and
TLSDNS layers in the network manager to 1220 bytes, that is 1280 (IPv6
minimum link MTU) minus 40 (IPv6 fixed header) minus 20 (TCP fixed
header)

We already rely on a similar value for UDP to prevent IP fragmentation
and it make sense to use the same value for IPv4 and IPv6 because the
modern networks are required to support IPv6 packet sizes.  If there's
need for small TCP segment values, the MTU on the interfaces needs to be
properly configured.
2022-03-08 10:27:05 +01:00
Ondřej Surý
5d34a14f22 Set minimum MTU (1280) on IPv6 sockets
The IPV6_USE_MIN_MTU socket option directs the IP layer to limit the
IPv6 packet size to the minimum required supported MTU from the base
IPv6 specification, i.e. 1280 bytes.  Many implementations of TCP
running over IPv6 neglect to check the IPV6_USE_MIN_MTU value when
performing MSS negotiation and when constructing a TCP segment despite
MSS being defined to be the MTU less the IP and TCP header sizes (60
bytes for IPv6).  This leads to oversized IPv6 packets being sent
resulting in unintended Path Maximum Transport Unit Discovery (PMTUD)
being performed and to fragmented IPv6 packets being sent.

Add and use a function to set socket option to limit the MTU on IPv6
sockets to the minimum MTU (1280) both for UDP and TCP.
2022-03-08 10:27:05 +01:00
Mark Andrews
b40d1e8467 Merge branch '3142-add-checkconf-check-for-dnssec-policy-keys-algorithm' into 'main'
Resolve "Add checkconf check for dnssec-policy keys algorithm"

Closes #3142

See merge request isc-projects/bind9!5836
2022-03-08 03:25:22 +00:00
Mark Andrews
e48af36981 Add release note for [GL #3142] 2022-03-08 13:24:49 +11:00
Mark Andrews
d4c2395fff Add CHANGES entry for [GL #3142] 2022-03-08 13:24:09 +11:00
Mark Andrews
9bcf45f4ce Check dnssec-policy key roles for validity
For each algorithm there must be a key performing the KSK and
ZSK rolls.  After reading the keys from named.conf check that
each algorithm present has both rolls.  CSK implicitly has both
rolls.
2022-03-08 13:23:14 +11:00
Mark Andrews
f23e86b96b Add test configurations with invalid dnssec-policy clauses
bad-ksk-without-zsk.conf only has a ksk defined without a
matching zsk for the same algorithm.

bad-zsk-without-ksk.conf only has a zsk defined without a
matching ksk for the same algorithm.

bad-unpaired-keys.conf has two keys of different algorithms
one ksk only and the other zsk only
2022-03-08 13:23:14 +11:00
Arаm Sаrgsyаn
18efcdc65f Merge branch 'aram-fix-dns_request_createraw-cleanup-bug' into 'main'
Fix a function cleanup bug in dns_request_createraw()

Closes #3195

See merge request isc-projects/bind9!5937
2022-03-07 12:42:25 +00:00
Aram Sargsyan
963f6a2203 Fix a function cleanup bug in dns_request_createraw
When get_dispatch() returns an error code, the dns_request_createraw()
function jumps to the `cleanup` label, which will leave a previous
attachment to the `request` pointer unattached.

Fix the issue by jumping to the `detach` label instead.
2022-03-07 11:24:09 +00:00
Ondřej Surý
e229d46a87 Merge branch '3193-null-pointer-dereferences-in-udp_ready' into 'main'
Fix null pointer dereferences in udp_ready()

Closes #3193

See merge request isc-projects/bind9!5935
2022-03-06 12:05:18 +00:00
Ondřej Surý
9d8e8a4fcc Fix null pointer dereferences in udp_ready()
The query pointer was detached too early leading to null pointer
reference.  Move the query_detach() after the query->canceled check.
2022-03-06 10:18:20 +01:00
Ondřej Surý
51147fa567 Merge branch 'ondrej/refactor-tooling-around-lib/gen/dns.c' into 'main'
Merge lib/dns/gen.h contents to lib/dns/gen.c

See merge request isc-projects/bind9!5755
2022-03-04 13:33:08 +00:00
Ondřej Surý
b5a5eed7a0 Replace AX_CC_FOR_BUILD with AX_PROG_CC_FOR_BUILD
The AX_PROG_CC_FOR_BUILD implementation to find a native CC compiler is
slightly better because it uses AC_PROG_CC and AC_PROG_CPP to find the
native compiler instead of just defaulting to `gcc` as AX_CC_FOR_BUILD
does.

AX_PROG_CC_FOR_BUILD also sets BUILD_EXEEXT that we already use in the
Makefile.am for `lib/dns/gen` while AX_CC_FOR_BUILD uses
EXEEXT_FOR_BUILD.
2022-03-04 14:13:58 +01:00
Ondřej Surý
f24b26188d Merge lib/dns/gen.h contents to lib/dns/gen.c
Formerly, the gen.h header contained a compatibility layer between Win32
and POSIX platforms.  Since we have already dropped the Win32 build, we
can merged gen.h into gen.c as the header file is not used elsewhere.
2022-03-04 14:13:58 +01:00
Ondřej Surý
d811cca3c6 Merge branch 'ondrej-use-locked-queue' into 'main'
Replace netievent lock-free queue with simple locked queue

Closes #3180

See merge request isc-projects/bind9!5914
2022-03-04 13:12:53 +00:00
Ondřej Surý
d75b953489 Add CHANGES note for [GL #3180] 2022-03-04 13:49:51 +01:00
Ondřej Surý
6bd025942c Replace netievent lock-free queue with simple locked queue
The current implementation of isc_queue uses Michael-Scott lock-free
queue that in turn uses hazard pointers.  It was discovered that the way
we use the isc_queue, such complicated mechanism isn't really needed,
because most of the time, we either execute the work directly when on
nmthread (in case of UDP) or schedule the work from the matching
nmthreads.

Replace the current implementation of the isc_queue with a simple locked
ISC_LIST.  There's a slight improvement - since copying the whole list
is very lightweight - we move the queue into a new list before we start
the processing and locking just for moving the queue and not for every
single item on the list.

NOTE: There's a room for future improvements - since we don't guarantee
the order in which the netievents are processed, we could have two lists
- one unlocked that would be used when scheduling the work from the
matching thread and one locked that would be used from non-matching
thread.
2022-03-04 13:49:51 +01:00
Ondřej Surý
1bb56bb0fc Merge branch '3105-assertion-failure-on-shutdown-in-req_senddone' into 'main'
Add attach/detach for the dns_dispatch_send()

Closes #3105

See merge request isc-projects/bind9!5926
2022-03-04 12:48:37 +00:00
Ondřej Surý
a53ed01d03 Add CHANGES file for [GL #3105] 2022-03-04 13:47:59 +01:00
Ondřej Surý
be34b1c535 Reorder the nsupdate shutdown code to shutdown managers early
If the dns_request send callback is delayed, the dst API would get
deinitialized and then the detach from the tsig key would cause an
assertion failure.

Shutdown the isc_managers early, and only then dereference the dst
objects when cleaning up the resources used by nsupdate.
2022-03-04 13:47:59 +01:00
Ondřej Surý
f3ca90a804 Add attach/detach for the dns_dispatch_send()
The order in which the netievents are processed on the network manager
loop is not guaranteed.  Therefore the recv/read callback can come
earlier than the send/write callback.

The dns_request API wasn't ready for this reordering and it was
destroying the dns_request_t object before the send callback has been
called.

Add additional attach/detach in the req_send()/req_senddone() functions
to make sure we don't destroy the dns_request_t while it's still being
references by asynchronous call.
2022-03-04 13:47:59 +01:00
Ondřej Surý
488b1a776c Merge branch '3184-query-context-management-issues-in-dighost-c' into 'main'
Fix query context management issues in dighost.c

Closes #3184

See merge request isc-projects/bind9!5921
2022-03-04 12:45:58 +00:00
Ondřej Surý
f3228df622 Add CHANGES note for [GL #3184] 2022-03-03 11:11:11 -08:00
Aram Sargsyan
4043fe9090 Fix query context management issues in dighost.c
For the reference, the _cancel_lookup() function iterates through
the lookup's queries list and detaches them. In the ideal scenario,
that should be the last reference and the query will be destroyed
after that, but it is also possible that we are still expecting a
callback, which also holds a reference (for example, _cancel_lookup()
could have been called from recv_done(), when send_done() was still
not executed).

The start_udp() and start_tcp() functions are currently designed in
slightly different ways: start_udp() creates a new query attachment
`connectquery`, to be called in the callback function, while
start_tcp() does not, which is a bug, but is hidden by the fact
that when the query is being erroneously destroyed prematurely (before
_cancel_lookup() is called) in the result of that, it also gets
de-listed from the lookup's queries' list, so _cancel_lookup() doesn't
even try to detach it.

For better understanding, here's an illustration of the query's
references count changes, and from where it was changed:

UDP
---
 1. _new_query()        -> refcount = 1 (initial)
 2. start_udp()         -> refcount = 2 (lookup->current_query)
 3. start_udp()         -> refcount = 3 (connectquery)
 4. udp_ready()         -> refcount = 4 (readquery)
 5. udp_ready()         -> refcount = 5 (sendquery)
 6. udp_ready()         -> refcount = 4 (lookup->current_query)
 7. udp_ready()         -> refcount = 3 (connectquery)
 8. send_done()         -> refcount = 2 (sendquery)
 9. recv_done()         -> refcount = 1 (readquery)
10. _cancel_lookup()    -> refcount = 0 (initial)
11. the query gets destroyed and removed from `lookup->q`

TCP, fortunate scenario
-----------------------

 1. _new_query()        -> refcount = 1 (initial)
 2. start_tcp()         -> refcount = 2 (lookup->current_query)
 3. launch_next_query() -> refcount = 3 (readquery)
 4. launch_next_query() -> refcount = 4 (sendquery)
 5. tcp_connected()     -> refcount = 3 (lookup->current_query)
 6. tcp_connected()     -> refcount = 2 (bug, there was no connectquery)
 7. send_done()         -> refcount = 1 (sendquery)
 8. recv_done()         -> refcount = 0 (readquery)
 9. the query gets prematurely destroyed and removed from `lookup->q`
10. _cancel_lookup()    -> the query is not in `lookup->q`

TCP, unfortunate scenario, revealing the bug
--------------------------------------------

 1. _new_query()        -> refcount = 1 (initial)
 2. start_tcp()         -> refcount = 2 (lookup->current_query)
 3. launch_next_query() -> refcount = 3 (readquery)
 4. launch_next_query() -> refcount = 4 (sendquery)
 5. tcp_connected()     -> refcount = 3 (lookup->current_query)
 6. tcp_connected()     -> refcount = 2 (bug, there was no connectquery)
 7. recv_done()         -> refcount = 1 (readquery)
 8. _cancel_lookup()    -> refcount = 0 (the query was in `lookup->q`)
 9. we hit an assertion here when trying to destroy the query, because
    sendhandle is not detached (which is done by send_done()).
10. send_done()         -> this never happens

This commit does the following:

1. Add a `connectquery` attachment in start_tcp(), like done in
   start_udp().
2. Add missing _cancel_lookup() calls for error scenarios, which
   were possibly missing because before fixing the bug, calling
   _cancel_lookup() and then calling query_detach() would cause
   an assertion.
3. Log a debug message and call isc_nm_cancelread(query->readhandle)
   for every query in the lookup from inside the _cancel_lookup()
   function, like it is done in _cancel_all().
4. Add a `canceled` property for the query which becomes `true` when
   the lookup (and subsequently, its queries) are canceled.
5. Use the `canceled` property in the network manager callbacks to
   know that the query was canceled, and act like `eresult` was equal
   to `ISC_R_CANCELED`.
2022-03-03 11:10:52 -08:00
Aram Sargsyan
98820aef7e Add a missing UNLOCK_LOOKUP
There was a missing UNLOCK_LOOKUP in the recv_done() callback when
the operation had been canceled. That omission could result in a
deadlock situation.
2022-03-03 11:10:52 -08:00
Michał Kępień
284b2ce106 Merge branch 'michal/add-placeholder-entries-to-CHANGES' into 'main'
Add placeholder entries to CHANGES

See merge request isc-projects/bind9!5925
2022-03-03 12:35:08 +00:00
Michał Kępień
6b52160a5b Add placeholder entries to CHANGES
Add placeholders for the following issues:

  - [GL #2950]
  - [GL #3112]
  - [GL #3129]
  - [GL #3158]
2022-03-03 12:18:55 +01:00
Arаm Sаrgsyаn
60f5f78b8d Merge branch '3172-libressl-3.5.0-compat' into 'main'
Resolve "BIND is not compatible with LibreSSL 3.5.0"

Closes #3172

See merge request isc-projects/bind9!5906
2022-03-02 11:07:53 +00:00
Aram Sargsyan
347ce4f590 Add CHANGES entry for [GL #3172] 2022-03-02 10:48:46 +00:00
Aram Sargsyan
117dac11d1 Use autoconf check for BN_GENCB_new()
BIND unconditionally uses shims for BN_GENCB_new(), BN_GENCB_free(),
and BN_GENCB_get_arg() for all LibreSSL versions and, correctly, for
OpenSSL <1.1.0 versions.

This breaks LibreSSL compilation starting with LibreSSL 3.5.0.

Use autoconf check instead to check whether the family of the functions
are available.
2022-03-02 10:48:09 +00:00
Aram Sargsyan
ef0d7177b6 Remove EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() shims
LibreSSL 3.5.0 fails to compile with these shims. We could have just
removed the LibreSSL check from the pre-processor condition, but it
seems that these shims are no longer needed because all the supported
versions of OpenSSL and LibreSSL have those functions.

According to EVP_ENCRYPTINIT(3) manual page in LibreSSL,
EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() first appeared in
OpenSSL 0.9.8b, and have been available since OpenBSD 4.5.
2022-03-02 10:48:09 +00:00
Evan Hunt
600b6abc05 Merge branch '3174-fix-zone-documentation' into 'main'
fix zone documentation in named.conf man page

Closes #3174

See merge request isc-projects/bind9!5907
2022-03-02 09:57:04 +00:00
Evan Hunt
4ca74eee49 document zone grammar more correctly
the "zone" clause can be documented using, for instance,
`cfg_test --zonegrammar primary", which prints only
options that are valid in primary zones. this was not
the method being used when generating the named.conf
man page; instead, "zone" was documented with all possible
options, and no zone types at all.

this commit removes "zone" from the generic documentation
and adds include statements in named.conf.rst so that
correct zone grammars will be included in the man page.
2022-03-02 01:53:24 -08:00
Mark Andrews
5bcac990dd Merge branch '3175-add-missing-grow-data-call-in-isc-lex-gettoken' into 'main'
Grow the lex token buffer in one more place

Closes #3175

See merge request isc-projects/bind9!5916
2022-03-02 00:35:16 +00:00
Mark Andrews
ce8703a79e Add CHANGES note for [GL #3175] 2022-03-01 16:05:39 -08:00
Mark Andrews
d36938321e Add seed that demonstrated INSIST triggered in isc_lex_gettoken
this is similar to the input found by ClusterFuzz Issue 45027 with
the 0xff characters replaced for readability.
2022-03-01 16:05:39 -08:00
Mark Andrews
4c356d2770 Grow the lex token buffer in one more place
when parsing key pairs, if the '=' character fell at max_token
a protective INSIST preventing buffer overrun could be triggered.
Attempt to grow the buffer immediately before the INSIST.

Also removed an unnecessary INSIST on the opening double quote
of key buffer pair.
2022-03-01 16:05:39 -08:00
Mark Andrews
ed3dd45da8 Merge branch '3176-issue-45110-by-clusterfuzz-external-bind9-dns_master_load_fuzzer-undefined-shift-in-soa_get' into 'main'
Resolve "Issue 45110 by ClusterFuzz-External: bind9:dns_master_load_fuzzer: Undefined-shift in soa_get"

Closes #3176

See merge request isc-projects/bind9!5909
2022-03-02 00:02:09 +00:00
Mark Andrews
b8b99603f1 Use unsigned arithmetic when shifting by 24
By default C promotes short unsigned values to signed int which
leads to undefined behaviour when the value is shifted by too much.
Force unsigned arithmetic to be perform by explicitly casting to a
unsigned type.
2022-03-01 23:36:00 +00:00
Ondřej Surý
f6453c1bc7 Merge branch '3177-add-missing-isc_nm_tcpsocket-to-isc__nmsocket_reset' into 'main'
Handle TCP sockets in isc__nmsocket_reset()

Closes #3177

See merge request isc-projects/bind9!5910
2022-02-28 10:14:01 +00:00
Ondřej Surý
b220fb32bd Handle TCP sockets in isc__nmsocket_reset()
The isc__nmsocket_reset() was missing a case for raw TCP sockets (used
by RNDC and DoH) which would case a assertion failure when write timeout
would be triggered.

TCP sockets are now also properly handled in isc__nmsocket_reset().
2022-02-28 02:06:03 -08:00
Evan Hunt
e2636b1de0 Merge branch 'each-mem-maybedup' into 'main'
mem_maybedup() can no longer fail

See merge request isc-projects/bind9!5835
2022-02-26 10:39:37 +00:00
Mark Andrews
26f817f574 Return ISC_R_NOTIMPLEMENTED rather than ISC_R_UNEXPECTEDEND
If the keydata rdata is shorter that 16 octets it is not out private
keydata type and we have not implemented a tostruct method for it.
2022-02-25 21:06:16 -08:00
Mark Andrews
48039fa25e Do not return ISC_R_UNEXPECTEDEND
All rdata passed to dns_rdata_tostruct is supposed to be well formed,
assert if it isn't.
2022-02-25 20:57:08 -08:00
Evan Hunt
bbaade23eb mem_maybedup() can no longer fail
mem_maybedup() calls isc_mem_allocate() if an mctx is supplied,
but that can no longer fail, so now the only way mem_maybedup()
could return NULL is if it was given a NULL source address by the
caller. this commit adds a REQUIRE to prevent that scenario, and
cleans up all the calling code that previously checked for NULL
return values.

this function is mostly used in rdata tostruct() implementations, so
the documentation for dns_rdata_tostruct() has been updated to
remove 'ISC_R_NOMEMORY' as a possible return value.
2022-02-25 20:57:08 -08:00
Evan Hunt
5e4580d479 Merge branch '2802-fix-missed-occurrences-of-renaming-masters-to-primaries' into 'main'
Resolve "Fix missed occurrences of renaming masters to primaries"

Closes #2802

See merge request isc-projects/bind9!5860
2022-02-26 00:51:05 +00:00
Evan Hunt
0bde07261b remove old zone type documentation
we now document zone type as either "primary" or "secondary",
omitting the old terms (though they are still accepted).
2022-02-25 16:33:37 -08:00
Evan Hunt
0e57fc160e add a CFG_CLAUSEFLAG_NODOC flag for use with outdated terms
"masters" and "default-masters" are now flagged so they will
not be included in the named.conf man page, despite being
accepted as valid options by the parser for backward
compatibiility.
2022-02-25 16:33:30 -08:00
Mark Andrews
9422a5da44 Merge branch '3170-tiny-typo-in-doc-build-script' into 'main'
Fix typo in exclude pattern in doc build configuration

Closes #3170

See merge request isc-projects/bind9!5899
2022-02-24 13:45:37 +00:00
Mark Andrews
0069a689a6 correctly exclude logging-categories.rst 2022-02-24 13:26:38 +00:00
Petr Špaček
53e1b41660 Merge branch 'pspacek/fuzz-rdata-from-text' into 'main'
Add dns_rdata_fromtext() fuzzer

See merge request isc-projects/bind9!4718
2022-02-24 10:30:59 +00:00
Petr Špaček
dc9ba2d3ef Add dns_rdata_fromtext() fuzzer
... along with dns_rdataclass_fromtext and dns_rdatatype_fromtext

Most of the test binary is modified named-rrchecker. Main differences:
- reads single RR and exists
- does not refuse meta classes and rr types
We actually do have some fromtext code for meta-things so erroring out
in named-rrchecker would prevent us from testing this code.

Corpus has examples of all currently supported RR types. I did not do
any minimization.

In future use command

    diff -U0 \
	<(sed -n -e 's/^.*fromtext_\(.*\)(.*$/\1/p' lib/dns/code.h | \
		sort) \
	<(ls fuzz/dns_rdata_fromtext.in/)

to check for missing RR types.
2022-02-24 11:12:06 +01:00
Petr Špaček
759ad04eb8 Fix configure options in FUZZING.md 2022-02-24 11:12:02 +01:00
Petr Špaček
7cef148b5a Merge branch 'pspacek/fuzz_zonefile' into 'main'
Add dns_master_loadbuffer() fuzzer

See merge request isc-projects/bind9!4719
2022-02-24 09:12:16 +00:00
Petr Špaček
5076355822 Add dns_master_loadbuffer() fuzzer
Corpus focuses on "extra" things in master files like $GENERATE etc.
Text encoding for RRs is thoroughly tested in dns_rdata_fromtext
fuzzer.
2022-02-24 10:02:56 +01:00
Ondřej Surý
40caf57cf5 Merge branch '3166-disable-inactivehandles-caching-with-address-sanitizer-fix' into 'main'
Disable inactive uvreqs caching when compiled with sanitizers

Closes #3166

See merge request isc-projects/bind9!5898
2022-02-23 23:45:18 +00:00
Ondřej Surý
ecf042991c Fix typo __SANITIZE_ADDRESS -> __SANITIZE_ADDRESS__
When checking for Address Sanitizer to disable the inactivehandles
caching, there was a typo in the macro.
2022-02-24 00:15:16 +01:00
Ondřej Surý
be339b3c83 Disable inactive uvreqs caching when compiled with sanitizers
When isc__nm_uvreq_t gets deactivated, it could be just put onto array
stack to be reused later to save some initialization time.
Unfortunately, this might hide some use-after-free errors.

Disable the inactive uvreqs caching when compiled with Address or
Thread Sanitizer.
2022-02-24 00:15:16 +01:00
Ondřej Surý
3b2d680c5b Merge branch '3166-disable-inactivehandles-caching-with-address-sanitizer' into 'main'
Disable inactive handles caching when compiled with sanitizers

Closes #3166

See merge request isc-projects/bind9!5879
2022-02-23 22:22:53 +00:00
Ondřej Surý
92cce1da65 Disable inactive handles caching when compiled with sanitizers
When isc_nmhandle_t gets deactivated, it could be just put onto array
stack to be reused later to safe some initialization time.
Unfortunately, this might hide some use-after-free errors.

Disable the inactive handles caching when compiled with Address or
Thread Sanitizer.
2022-02-23 23:21:29 +01:00
Ondřej Surý
be5be5aa39 Merge branch '3167-remove-isc__nmsocket_t-ah_handles' into 'main'
Remove active handles tracking from isc__nmsocket_t

Closes #3147 and #3167

See merge request isc-projects/bind9!5878
2022-02-23 22:13:31 +00:00
Ondřej Surý
e2555a306f Remove active handles tracking from isc__nmsocket_t
The isc__nmsocket_t has locked array of isc_nmhandle_t that's not used
for anything.  The isc__nmhandle_get() adds the isc_nmhandle_t to the
locked array (and resized if necessary) and removed when
isc_nmhandle_put() finally destroys the handle.  That's all it does, so
it serves no useful purpose.

Remove the .ah_handles, .ah_size, and .ah_frees members of the
isc__nmsocket_t and .ah_pos member of the isc_nmhandle_t struct.
2022-02-23 22:54:47 +01:00
Ondřej Surý
3268627916 Delay isc__nm_uvreq_t deallocation to connection callback
When the TCP, TCPDNS or TLSDNS connection times out, the isc__nm_uvreq_t
would be pushed into sock->inactivereqs before the uv_tcp_connect()
callback finishes.  Because the isc__nmsocket_t keeps the list of
inactive isc__nm_uvreq_t, this would cause use-after-free only when the
sock->inactivereqs is full (which could never happen because the failure
happens in connection timeout callback) or when the sock->inactivereqs
mechanism is completely removed (f.e. when running under Address or
Thread Sanitizer).

Delay isc__nm_uvreq_t deallocation to the connection callback and only
signal the connection callback should be called by shutting down the
libuv socket from the connection timeout callback.
2022-02-23 22:54:47 +01:00
Ondřej Surý
713444e51a Merge branch 'ondrej-cleanup-nm_destroy-dequeue' into 'main'
Properly free up enqueued netievents in nm_destroy()

See merge request isc-projects/bind9!5888
2022-02-23 21:52:49 +00:00
Ondřej Surý
88418c3372 Properly free up enqueued netievents in nm_destroy()
When the isc_netmgr is being destroyed, the normal and priority queues
should be dequeued and netievents properly freed.  This wasn't the case.
2022-02-23 22:51:12 +01:00
Michał Kępień
e42d5d8875 Merge branch '3147-fix-more-ns_statscounter_recursclients-underflows' into 'main'
Fix more ns_statscounter_recursclients underflows

Closes #3147

See merge request isc-projects/bind9!5870
2022-02-23 13:42:43 +00:00
Michał Kępień
600f9010d2 Add CHANGES entry for GL #3147 2022-02-23 14:39:11 +01:00
Michał Kępień
1c462a63ec Add release note for GL #3147 2022-02-23 14:39:11 +01:00
Michał Kępień
f7482b68b9 Fix more ns_statscounter_recursclients underflows
Commit aab691d512 did not fix all possible
scenarios in which the ns_statscounter_recursclients counter underflows.
The solution implemented therein can be ineffective e.g. when CNAME
chaining happens with prefetching enabled.

Here is an example recursive resolution scenario in which the
ns_statscounter_recursclients counter can underflow with the current
logic in effect:

 1. Query processing starts, the answer is not found in the cache, so
    recursion is started.  The NS_CLIENTATTR_RECURSING attribute is set.
    ns_statscounter_recursclients is incremented (Δ = +1).

 2. Recursion completes, returning a CNAME.  client->recursionquota is
    non-NULL, so the NS_CLIENTATTR_RECURSING attribute remains set.
    ns_statscounter_recursclients is decremented (Δ = 0).

 3. Query processing restarts.

 4. The current QNAME (the target of the CNAME from step 2) is found in
    the cache, with a TTL low enough to trigger a prefetch.

 5. query_prefetch() attaches to client->recursionquota.
    ns_statscounter_recursclients is not incremented because
    query_prefetch() does not do that (Δ = 0).

 6. Query processing restarts.

 7. The current QNAME (the target of the CNAME from step 4) is not found
    in the cache, so recursion is started.  client->recursionquota is
    already attached to (since step 5) and the NS_CLIENTATTR_RECURSING
    attribute is set (since step 1), so ns_statscounter_recursclients is
    not incremented (Δ = 0).

 8. The prefetch from step 5 completes.  client->recursionquota is
    detached from in prefetch_done().  ns_statscounter_recursclients is
    not decremented because prefetch_done() does not do that (Δ = 0).

 9. Recursion for the current QNAME completes.  client->recursionquota
    is already detached from, i.e. set to NULL (since step 8), and the
    NS_CLIENTATTR_RECURSING attribute is set (since step 1), so
    ns_statscounter_recursclients is decremented (Δ = -1).

Another possible scenario is that after step 7, recursion for the target
of the CNAME from step 4 completes before the prefetch for the CNAME
itself.  fetch_callback() then notices that client->recursionquota is
non-NULL and decrements ns_statscounter_recursclients, even though
client->recursionquota was attached to by query_prefetch() and therefore
not accompanied by an incrementation of ns_statscounter_recursclients.
The net result is also an underflow.

Instead of trying to properly handle all possible orderings of events
set into motion by normal recursion and prefetch-triggered recursion,
adjust ns_statscounter_recursclients whenever the recursive clients
quota is successfully attached to or detached from.  Remove the
NS_CLIENTATTR_RECURSING attribute altogether as its only purpose is made
obsolete by this change.
2022-02-23 14:39:11 +01:00
Petr Špaček
df0bc2b3b6 Merge branch 'pspacek/windows-bat-removal' into 'main'
Remove leftover .bat file

See merge request isc-projects/bind9!5875
2022-02-22 15:05:01 +00:00
Petr Špaček
653db956f0 Remove last .bat file from the source tree
This fixes an omission in !5739, "Remove leftover test code for Windows".
2022-02-22 15:53:25 +01:00
Matthijs Mekking
2070dcf99d Merge branch '3164-fix-parental-agents-documentation' into 'main'
Fix typo in DNSSEC guide parental-agents example

Closes #3164

See merge request isc-projects/bind9!5872
2022-02-22 13:20:46 +00:00
Matthijs Mekking
fd5e39cc76 Fix typo in DNSSEC guide parental-agents example
The example will not load because of the typo, the comma should be a
semicolon.
2022-02-22 11:48:28 +01:00
Michał Kępień
39730a503d Merge branch 'michal/handle-fctx-in-FCTXTRACE-macro-stubs' into 'main'
Add "UNUSED(fctx);" to FCTXTRACE*() macro stubs

See merge request isc-projects/bind9!5867
2022-02-21 09:53:26 +00:00
Michał Kępień
b645e28167 Add "UNUSED(fctx);" to FCTXTRACE*() macro stubs
Commit b6d40b3c4e removed most uses of the
'fctx' variable from the rctx_dispfail() function: it is now only needed
by the FCTXTRACE3() macro.  However, when --enable-querytrace is not in
effect, that macro evaluates to a list of UNUSED() macros that does not
include "UNUSED(fctx);".  This triggers the following compilation
warning when building without --enable-querytrace:

    resolver.c: In function 'rctx_dispfail':
    resolver.c:7888:21: warning: unused variable 'fctx' [-Wunused-variable]
     7888 |         fetchctx_t *fctx = rctx->fctx;
          |                     ^~~~

Fix by adding "UNUSED(fctx);" lines to all FCTXTRACE*() macros.  This is
safe to do because all of those macros use the 'fctx' local variable, so
there is no danger of introducing new errors caused by use of undeclared
identifiers.
2022-02-21 10:50:38 +01:00
Ondřej Surý
d0c2113693 Merge branch '3140-make-keep-response-order-obsolete' into 'main'
Declare the keep-response-order obsolete

Closes #3140

See merge request isc-projects/bind9!5852
2022-02-18 21:37:39 +00:00
Ondřej Surý
f216eb0d64 Add CHANGES and release note for [GL #3140] 2022-02-18 09:16:03 +01:00
Ondřej Surý
ddd5b0ff89 Downgrade -Wstringop-overread from error to warning
Due to a bug in gcc-11, the build fails when AddressSanitizer is
enabled.  Downgrading the -Wstringop-overread to just a warning in the
gcc:asan build allows the code to compile.
2022-02-18 09:16:03 +01:00
Ondřej Surý
30fda4cb52 Remove the keep-response-order system test
Remove the keep-response-order from the system test and cleanup the
pipelined system test to be shell check clean and use the helper
functions.
2022-02-18 09:16:03 +01:00
Ondřej Surý
d01562f22b Remove the keep-response-order ACL map
The keep-response-order option has been obsoleted, and in this commit,
remove the keep-response-order ACL map rendering the option no-op, the
call the isc_nm_sequential() and the now unused isc_nm_sequential()
function itself.
2022-02-18 09:16:03 +01:00
Ondřej Surý
30f4bdb17e Declare the keep-response-order obsolete
The keep-response-order option has been introduced when TCP pipelining
has been introduced to BIND 9 as a failsafe for possibly non-compliant
clients.

Declare the keep-response-order obsolete as all DNS clients should
either support out-of-order processing or don't send more DNS queries
until the DNS response for the previous one has been received.
2022-02-17 16:49:56 -08:00
Evan Hunt
b215018067 Merge branch '3141-remove-the-artificial-stream-clients-limit' into 'main'
Remove the limit on the number of simultaneous TCP queries

Closes #3141

See merge request isc-projects/bind9!5851
2022-02-18 00:40:45 +00:00
Ondřej Surý
2bcf5a5315 Add CHANGES and release note for [GL #3141] 2022-02-17 16:20:42 -08:00
Ondřej Surý
4f5b4662b6 Remove the limit on the number of simultaneous TCP queries
There was an artificial limit of 23 on the number of simultaneous
pipelined queries in the single TCP connection.  The new network
managers is capable of handling "unlimited" (limited only by the TCP
read buffer size ) queries similar to "unlimited" handling of the DNS
queries receive over UDP.

Don't limit the number of TCP queries that we can process within a
single TCP read callback.
2022-02-17 16:19:12 -08:00
Ondřej Surý
306a3c0803 Merge branch '1897-fix-max-transfer-timeouts' into 'main'
Reimplement the max-transfer-time-out and max-transfer-idle-out

Closes #1897

See merge request isc-projects/bind9!5850
2022-02-17 21:01:24 +00:00
Ondřej Surý
987ad32fac Add CHANGES and release note for [GL #1897] 2022-02-17 21:38:37 +01:00
Ondřej Surý
8fed1b6461 Add XFR max-transfer-time-out and max-tranfer-idle-out system tests
Extend the timeouts system test to ensure that the maximum outgoing
transfer time (max-transfer-time-out) and maximum outgoing transfer idle
time (max-transfer-idle-out) works as expected.  This is done by
lowering the limits to 5/1 minutes and testing that the connection has
been dropped while sleeping between the individual XFR messages.
2022-02-17 21:38:17 +01:00
Ondřej Surý
8643bbab84 Reimplement the max-transfer-time-out and max-transfer-idle-out
While refactoring the libns to use the new network manager, the
max-transfer-*-out options were not implemented and they were turned
non-operational.

Reimplement the max-transfer-idle-out functionality using the write
timer and max-transfer-time-out using the new isc_nm_timer API.
2022-02-17 21:38:17 +01:00
Ondřej Surý
037549c405 Remove unused client->shutdown and client->shutdown_arg
While refactoring the lib/ns/xfrout.c, it was discovered that .shutdown
and .shutdown_arg members of ns_client_t structure are unused.

Remove the unused members and associated code that was using in it in
the ns_xfrout.
2022-02-17 21:38:17 +01:00
Ondřej Surý
3c7b04d015 Add network manager based timer API
This commits adds API that allows to create arbitrary timers associated
with the network manager handles.
2022-02-17 21:38:17 +01:00
Evan Hunt
63f3ad3e3c Merge branch '2486-verify-journals' into 'main'
make dnssec-verify and dnssec-signzone read journal files

Closes #2486

See merge request isc-projects/bind9!5801
2022-02-17 20:28:12 +00:00
Evan Hunt
53bc8905ab CHANGES and release note for [GL #2486] 2022-02-17 12:03:18 -08:00
Evan Hunt
08c2728ed1 add a test for dnssec-signzone -J
generate a journal file, and load it in dnssec-signzone.
2022-02-17 12:03:05 -08:00
Evan Hunt
4d2f5754af add a test for dnssec-verify -J
generate a journal file and confirm that dnssec-verify is able
to load it.
2022-02-17 12:03:05 -08:00
Evan Hunt
d2597e3496 support $INCLUDE in makejournal
bin/tests/system/makejournal needs to ignore DNS_R_SEENINCLUDE
when calling dns_db_load(), otherwise it cannot generate a journal
for a zone file with a $INCLUDE statement.
2022-02-17 12:03:05 -08:00
Evan Hunt
c3fd94cd4d make dnssec-verify and dnssec-signzone read journal files
add a -J option to dnssec-verify and dnssec-signzone to read
a specified journal file when loading a zone.
2022-02-17 12:03:01 -08:00
Ondřej Surý
08026c7ded Merge branch '3149-drop-TCP-connection-when-garbage-is-received' into 'main'
Reset the TCP connection when garbage is received

Closes #3149

See merge request isc-projects/bind9!5849
2022-02-17 20:01:08 +00:00
Ondřej Surý
9f1c439335 Add CHANGES and release note for [GL #3149] 2022-02-17 20:39:55 +01:00
Ondřej Surý
ebfdb50ac7 Add TCP garbage system test
Test if the TCP connection gets reset when garbage instead of DNS
message is sent.

I'm only happy when it rains
Pour some misery down on me
- Garbage
2022-02-17 20:39:55 +01:00
Ondřej Surý
4716c56ebb Reset the TCP connection when garbage is received
When invalid DNS message is received, there was a handling mechanism for
DoH that would be called to return proper HTTP response.

Reuse this mechanism and reset the TCP connection when the client is
blackholed, DNS message is completely bogus or the ns_client receives
response instead of query.
2022-02-17 20:39:55 +01:00
Ondřej Surý
0697288b9d Merge branch '3133-tcp-error-handling' into 'main'
correct TCP error condition handling in dispatch

Closes #3133

See merge request isc-projects/bind9!5810
2022-02-17 10:41:14 +00:00
Evan Hunt
1b25b76921 Add CHANGES note for [GL #3133] 2022-02-17 10:02:38 +01:00
Evan Hunt
b6d40b3c4e correct TCP error handling in dispatch and resolver
- certain TCP result codes, including ISC_R_EOF and
  ISC_R_CONNECTIONRESET, were being mapped to ISC_R_SHUTTINGDOWN
  before calling the response handler in tcp_recv_cancelall().
  the result codes should be passed through to the response handler
  without being changed.

- the response handlers, resquery_response() and req_response(), had
  code to return immediately if encountering ISC_R_EOF, but this is
  not the correct behavior; that should only happen in the case of
  ISC_R_CANCELED when it was the caller that canceled the operation

- ISC_R_CONNECTIONRESET was not being caught in rctx_dispfail().

- removed code in rctx_dispfail() to retry queries without EDNS
  when receiving ISC_R_EOF; this is now treated the same as any
  other connection failure.
2022-02-17 09:59:12 +01:00
Ondřej Surý
ae4cd57ed5 Merge branch '3132-add-send-timeout' into 'main'
Add timeout when writing TCP data

Closes #3132

See merge request isc-projects/bind9!5848
2022-02-17 08:45:17 +00:00
Ondřej Surý
0c35bda762 Add CHANGES and release note for [GL #3132] 2022-02-17 09:07:43 +01:00
Ondřej Surý
ee359d6ffa Update writetimeout to be T_IDLE in netmgr_test.c
Use the isc_nmhandle_setwritetimeout() function in the netmgr unit test
to allow more time for writing and reading the responses because some of
the intervals that are used in the unit tests are really small leaving a
little room for any delays.
2022-02-17 09:06:58 +01:00
Ondřej Surý
a89d9e0fa6 Add isc_nmhandle_setwritetimeout() function
In some situations (unit test and forthcoming XFR timeouts MR), we need
to modify the write timeout independently of the read timeout.  Add a
isc_nmhandle_setwritetimeout() function that could be called before
isc_nm_send() to specify a custom write timeout interval.
2022-02-17 09:06:58 +01:00
Ondřej Surý
b735182ae0 Add TCP write timeout system test
Extend the timeouts system test that bursts the queries for large TXT
record and never read any responses back filling up the server TCP write
buffer.  The test should work with the default wmem_max value on
Linux (208k).
2022-02-17 09:06:58 +01:00
Ondřej Surý
408b362169 Add TCP, TCPDNS and TLSDNS write timer
When the outgoing TCP write buffers are full because the other party is
not reading the data, the uv_write() could wait indefinitely on the
uv_loop and never calling the callback.  Add a new write timer that uses
the `tcp-idle-timeout` value to interrupt the TCP connection when we are
not able to send data for defined period of time.
2022-02-17 09:06:58 +01:00
Ondřej Surý
cd3b58622c Add uv_tcp_close_reset compat
The uv_tcp_close_reset() function was added in libuv 1.32.0 and since we
support older libuv releases, we have to add a shim uv_tcp_close_reset()
implementation loosely based on libuv.
2022-02-17 09:06:58 +01:00
Ondřej Surý
45a73c113f Rename sock->timer to sock->read_timer
Before adding the write timer, we have to remove the generic sock->timer
to sock->read_timer.  We don't touch the function names to limit the
impact of the refactoring.
2022-02-17 09:06:58 +01:00
Evan Hunt
92338f2e29 Merge branch '3157-blackhole-request' into 'main'
negative match on the 'blackhole' ACL could be treated as positive

Closes #3157

See merge request isc-projects/bind9!5853
2022-02-17 06:19:51 +00:00
Evan Hunt
04361b0ad5 CHANGES and release note for [GL #3157] 2022-02-16 19:05:56 -08:00
Evan Hunt
4444b168db negative 'blackhole' ACL match could be treated as positive
There was a bug in the checking of the "blackhole" ACL in
dns_request_create*(), causing an address to be treated as included
in the ACL if it was explicitly *excluded*. Thus, leaving "blackhole"
unset had no effect, but setting it to "none" would cause any
destination addresses to be rejected for dns_request purposes. This
would cause zone transfer requests and SOA queries to fail, among
other things.

The bug has been fixed, and "blackhole { none; };" was added to the
xfer system test as a regression test.
2022-02-16 19:05:06 -08:00
Michał Kępień
5fbbc312a7 Merge branch '3139-log-the-result-of-each-resolver-priming-attempt' into 'main'
Log the result of each resolver priming attempt

Closes #3139

See merge request isc-projects/bind9!5812
2022-02-16 12:27:18 +00:00
Michał Kępień
39df399d9f Add CHANGES entry for [GL #3139] 2022-02-16 13:26:12 +01:00
Michał Kępień
f286c845b0 Log the result of each resolver priming attempt
When a resolver priming attempt completes, the following message is
currently logged:

    resolver priming query complete

This message is identical for both successful and failed priming
attempts.  Consider the following log excerpts:

  - successful priming attempt:

        10-Feb-2022 11:33:11.272 all zones loaded
        10-Feb-2022 11:33:11.272 running
        10-Feb-2022 11:33:19.722 resolver priming query complete

  - failed priming attempt:

        10-Feb-2022 11:33:29.978 all zones loaded
        10-Feb-2022 11:33:29.978 running
        10-Feb-2022 11:33:38.432 timed out resolving '_.org/A/IN': 2001:500:9f::42#53
        10-Feb-2022 11:33:38.522 timed out resolving './NS/IN': 2001:500:9f::42#53
        10-Feb-2022 11:33:42.132 timed out resolving '_.org/A/IN': 2001:500:12::d0d#53
        10-Feb-2022 11:33:42.285 timed out resolving './NS/IN': 2001:500:12::d0d#53
        10-Feb-2022 11:33:44.685 resolver priming query complete

Include the result of each priming attempt in the relevant log message
to give the administrator better insight into named's resolver priming
process.
2022-02-16 13:26:12 +01:00
Ondřej Surý
1e7d666bf5 Merge branch 'ondrej/add-UV_RUNTIME_CHECK-macro' into 'main'
Add UV_RUNTIME_CHECK() macro to print uv_strerror()

See merge request isc-projects/bind9!5838
2022-02-16 10:45:32 +00:00
Ondřej Surý
62bd5cb08c Add semantic patch to keep UV_RUNTIME_CHECK in sync
The UV_RUNTIME_CHECK() macro requires to keep the function name in sync
like this:

    r = func(...);
    UV_RUNTIME_CHECK(func, r);

Add semantic patch to keep the function name and return variable in sync
with the previous line.
2022-02-16 11:16:57 +01:00
Ondřej Surý
8715be1e4b Use UV_RUNTIME_CHECK() as appropriate
Replace the RUNTIME_CHECK() calls for libuv API calls with
UV_RUNTIME_CHECK() to get more detailed error message when
something fails and should not.
2022-02-16 11:16:57 +01:00
Ondřej Surý
62e15bb06d Add UV_RUNTIME_CHECK() macro to print uv_strerror()
When libuv functions fail, they return correct return value that could
be useful for more detailed debugging.  Currently, we usually just check
whether the return value is 0 and invoke assertion error if it doesn't
throwing away the details why the call has failed.  Unfortunately, this
often happen on more exotic platforms.

Add a UV_RUNTIME_CHECK() macro that can be used to print more detailed
error message (via uv_strerror() before ending the execution of the
program abruptly with the assertion.
2022-02-16 11:16:57 +01:00
Ondřej Surý
f4ae230d41 Merge branch 'ondrej/remove-dns_timer-API' into 'main'
Remove unused dns_timer API

See merge request isc-projects/bind9!5818
2022-02-16 09:51:36 +00:00
Ondřej Surý
cdce681cf7 Remove unused dns_timer API
The dns_timer API was unused, and this commit just removes it.
2022-02-16 10:49:48 +01:00
Matthijs Mekking
39004d3b33 Merge branch 'matthijs-document-dnssec-policy-keys-algorithm-match' into 'main'
Update documentation wrt key algorithms

See merge request isc-projects/bind9!5823
2022-02-16 09:40:08 +00:00
Matthijs Mekking
7365400610 Update documentation wrt key algorithms
Add a note to the DNSSEC guide and to the ARM reference that A ZSK/KSK
pair used for signing your zone should have the same algorithm.

This commit also updates the 'dnssec-policy/keys' example to use the
slightly more modern 'rsasha256' algorithm.
2022-02-16 10:21:42 +01:00
Michal Nowak
5fa60c1ce9 Merge branch 'mnowak/make-cocci-parallel' into 'main'
Run spatch jobs in parallel

See merge request isc-projects/bind9!4741
2022-02-14 18:47:39 +00:00
Michal Nowak
48c44fe6d4 Run spatch jobs in parallel
Also make the script more verbose to identify which patch is being
processed and check for failures in spatch standard error output.
2022-02-14 19:38:17 +01:00
Michal Nowak
fcc9ac7bd8 Merge branch 'mnowak/coverity-scan-2021.12' into 'main'
Update Coverity Scan CI job to 2021.12

See merge request isc-projects/bind9!5811
2022-02-14 16:37:07 +00:00
Michal Nowak
f0edf07fbc Update Coverity Scan CI job to 2021.12.1 2022-02-14 12:43:09 +01:00
Petr Špaček
6914a4cda3 Merge branch 'pspacek/rfc-nits' into 'main'
Update and deduplicate list of RFCs in documentation

Closes #1918

See merge request isc-projects/bind9!5813
2022-02-14 11:10:21 +00:00
Artem Boldariev
8058d64dda Mention DoT/DoH related RFCs in the ARM
Mention RFC 7858 (DoT), 8484 (DoH), and 8945 (XoT).
2022-02-14 11:54:39 +01:00
Petr Špaček
63989e98ac Remove rfc-compliance list in plaintext - ARM deduplication
The plaintext version is now fully replaced by the doc/arm/general.rst.
2022-02-14 11:54:39 +01:00
Petr Špaček
7fd61f9403 Reorder list of supported RFCs in more user-oriented manner
For users it's not really important if a RFC is Internet Standard,
Proposed Standard, or Experimental. RFCs are now regrouped by
"Protocol", Best Current Practice, and "catch all" category FYI.
2022-02-14 11:54:39 +01:00
Petr Špaček
4dbad65bfd Replace obsolete RFC2845 reference with RFC8945 (TSIG) 2022-02-14 11:54:39 +01:00
Petr Špaček
2774b497a6 Remove special chapter about IPv6 address formats from ARM
In 2022, IPv6 is not anything unusual, and it was really odd
to have it in a separate section next to a huge list of RFCs.

Fixes: #1918
2022-02-14 11:54:39 +01:00
Petr Špaček
3c83a9d503 Replace obsolete RFC6944 reference with RFC8624 (DNSSEC algorithm status) 2022-02-14 11:54:39 +01:00
Petr Špaček
bd3b310eae Replace obsolete RFC5966 reference with RFC7766 (TCP) 2022-02-14 11:54:39 +01:00
Petr Špaček
f8cb0ac141 Replace obsolete RFC4408 reference with RFC7208 (SPF) 2022-02-14 11:54:39 +01:00
Petr Špaček
16dec1ff58 Replace obsolete RFC2915 reference with RFC3403 (NAPTR) 2022-02-14 11:54:39 +01:00
Petr Špaček
f7225db822 Add link to RFC8749 (DLV is historic) 2022-02-14 11:54:39 +01:00
Petr Špaček
09d6cf89df Add newer version of IDNA RFC to docs 2022-02-14 11:54:39 +01:00
Petr Špaček
9437ea08e1 Remove obsolete RFCs from documentation
There is little point of listing all of the obsolete RFCs. I think it is
more likely confuse people than to do anything useful.
2022-02-14 11:54:39 +01:00
Petr Špaček
2b5b777c07 Replace obsolete RFC6488 reference with RFC8659 (CAA) 2022-02-14 11:54:39 +01:00
Petr Špaček
b686b5c161 Remove obsolete book reference from ARM 2022-02-14 11:54:39 +01:00
Petr Špaček
f713984886 Use Sphinx footnotes for DNS Reference Information
It limits risk of errors while doing updates, which are next in the
pipeline.
2022-02-14 11:54:34 +01:00
Ondřej Surý
98961e86b8 Merge branch '3151-bump-minimal-automake-version-to-1.14' into 'main'
Bump the required automake version to 1.14

Closes #3151

See merge request isc-projects/bind9!5825
2022-02-14 08:45:57 +00:00
Ondřej Surý
4abd58aa8f Bump the required automake version to 1.14
After the build system refactoring, we no longer call AM_PROG_CC_C_O
because it is obsolescent macro.  According to the automake manual the
`AC_PROG_CC` has been rewritten in automake 1.14 to not required the
call, thus we need to require at least automake version 1.14.
2022-02-14 09:17:41 +01:00
Ondřej Surý
f57585a599 Merge branch 'ondrej/change-bug-reporting-address' into 'main'
Change the bug reporting address from email to gitlab URI

See merge request isc-projects/bind9!5817
2022-02-11 07:52:19 +00:00
Ondřej Surý
bb60622250 Change the bug reporting address from email to gitlab URI
In autoconf, the AC_INIT() accepts bugreport address for reporting
issues (f.e. when the test suite fails).  Instead of providing generic
emails address, change this to the address where to report with the
default Bug template applied.
2022-02-11 08:50:57 +01:00
Ondřej Surý
62cf6a77cf Merge branch '3137-create-new-log-messages-when-entering-and-exiting-exlusive-task-mode' into 'main'
Log when entering and exiting task exclusive mode

Closes #3137

See merge request isc-projects/bind9!5814
2022-02-10 20:21:18 +00:00
Ondřej Surý
44aa8ef997 Add CHANGES and release note for [GL #3137] 2022-02-10 21:09:46 +01:00
Ondřej Surý
b9cb29076f Log when starting and ending task exclusive mode
The task exclusive mode stops all processing (tasks and networking IO)
except the designated exclusive task events.  This has impact on the
operation of the server.  Add log messages indicating when we start the
exclusive mode, and when we end exclusive task mode.
2022-02-10 21:09:06 +01:00
Ondřej Surý
47b6e5d038 Merge branch '1087-rrset-strict-stats' into 'main'
In developer mode assert if statistics counter underflows

Closes #1087

See merge request isc-projects/bind9!2453
2022-02-10 17:21:16 +00:00
Ondřej Surý
0893b5fb79 Assert if statistics counter underflows in the developer mode
There are reported occurences where the statitic counters underflows and
starts reporting non-sense.

Add a check for the underflow, when ``named`` is compiled in the
developer mode.
2022-02-10 17:18:09 +01:00
Ondřej Surý
89935864e9 Merge branch '2717-fix-sysconfdir-in-manpages' into 'main'
Use compile-time paths in the manual pages

Closes #2717

See merge request isc-projects/bind9!5749
2022-02-10 16:07:43 +00:00
Ondřej Surý
9e70c6887a Add CHANGES note for [GL #2717] 2022-02-10 16:50:46 +01:00
Ondřej Surý
b42681c4e9 Use compile-time paths in the manual pages
Replace the hard-coded paths for various BIND 9 files (configuration,
pid, etc.) in the man pages and ARM with compile-time values using the
sphinx-build replace system.

This is more complicated, because the restructured text specification
doesn't allow |substitions| inside ``code-blocks``, so for each specific
file we had to create own substition which is sub-optimal, but it is
only way how to do this without adding Sphinx extension.
2022-02-10 16:50:22 +01:00
Ondřej Surý
59c3b17ad0 Merge branch '3130-cleanup-pthread-api-usage' into 'main'
Remove unused functions from isc_thread API

Closes #3130

See merge request isc-projects/bind9!5805
2022-02-09 16:40:14 +00:00
Ondřej Surý
0500345513 Remove unused functions from isc_thread API
The isc_thread_setaffinity call was removed in !5265 and we are not
going to restore it because it was proven that the performance is better
without it.  Additionally, remove the already disabled cpu system test.

The isc_thread_setconcurrency function is unused and also calling
pthread_setconcurrency() on Linux has no meaning, formerly it was
added because of Solaris in 2001 and it was removed when taskmgr was
refactored to run on top of netmgr in !4918.
2022-02-09 17:22:06 +01:00
Michal Nowak
ecc920682e Merge branch '2599-run-less-stable-unit-tests-in-aws' into 'main'
Add CI job with unstable netmgr unit tests

Closes #2599

See merge request isc-projects/bind9!4841
2022-02-09 11:29:27 +00:00
Michal Nowak
1d8788464e Run unstable unit tests in CI
Running unstable unit tests in CI should help with making sure they
don't fail permanently without the fact being noticed in daily
pipelines.
2022-02-09 11:46:41 +01:00
Michal Nowak
927d5ff89c Merge branch 'mnowak/fix-lsan-suppression-file-path' into 'main'
Fix path to suppr-lsan.txt file

See merge request isc-projects/bind9!5791
2022-02-07 12:32:32 +00:00
Michal Nowak
3de17e9185 Fix path to suppr-lsan.txt file
The "suppr-lsan.txt" file needs to be referenced with GitLab-specific
variable, otherwise AddressSanitizer won't find it outside the
"isc-projects" project group.

This has been introduced in 8a4f098dee.
2022-02-07 12:45:06 +01:00
Matthijs Mekking
40652a8879 Merge branch 'matthijs-engine_pkcs11-system-test' into 'main'
Add engine_pkcs11 system test

See merge request isc-projects/bind9!5727
2022-02-04 13:48:38 +00:00
Matthijs Mekking
7845f51178 Fix keyfromlabel test, missing status update
Fix a missing status=$((status+ret)) in the keyfromlabel system test,
which would ignore the error if ZSK key creation failed.
2022-02-04 13:40:18 +01:00
Aram Sargsyan
a449709441 Use unique SoftHSMv2 token label for the "keyfromlabel" test
When there are more than one tokens initialized in SoftHSMv2,
care must be taken to correctly identify them.

Use a SoftHSMv2 token label which will uniquely identify the
token used for this test.

Use the "--token-label" parameter for the `pkcs11-tool` program
to make sure that it finds and uses the correct token.
2022-02-04 13:40:18 +01:00
Matthijs Mekking
468cf3cdc2 Fix keyfromlabel echo output
The 'id' variable is either keyfromlabel-ksk or keyfromlabel-zsk and is
set in the 'keygen' and 'keyfromlabel' functions. It should not be used
outside these functions.
2022-02-04 13:40:18 +01:00
Matthijs Mekking
bfe287f4a4 Add test for assertion failure in pk11_numbits
This test was originally in the pkcs11 system test. While this crash
happened in the native pkcs11 of BIND 9, and that code has been
removed in 9.17, there is no need for this test. Nevertheless, it
doesn't hurt having the test case persist.
2022-02-04 13:40:18 +01:00
Matthijs Mekking
11a0b41370 Add system test for engine_pkcs11
Add a system test for engine_pkcs11 interactions that replaces the
tests that are done in the native PKCS#11 system test.

The native PKCS#11 code was removed in 9.17 but without copying the
pkcs11 system test.
2022-02-04 13:40:18 +01:00
Evan Hunt
c586445894 Merge branch 'each-missing-relnotes' into 'main'
Release notes for [GL #5555] and [GL 5757]

See merge request isc-projects/bind9!5796
2022-02-02 20:00:31 +00:00
Evan Hunt
d45f0e1d9e Release notes for [GL #3082] and [GL #3111] 2022-02-02 11:59:40 -08:00
Petr Špaček
f998e7e3c2 Merge branch '2974-improve-directory-documentation' into 'main'
Clarify effect of "directory" configuration option

Closes #2974

See merge request isc-projects/bind9!5531
2022-02-02 11:27:30 +00:00
Ondřej Surý
00ba6967b1 Clarify effect of "directory" configuration option
The "directory" configuration options affects the configuration listed
after the directive but not before which may affect ``include``
directive with relative file paths.
2022-02-02 12:20:33 +01:00
Ondřej Surý
01bd7d1024 Merge branch '3125-log-hard-quota-when-not-accepting-the-connection' into 'main'
Add log message when hard quota is reached in TCP accept

Closes #3125

See merge request isc-projects/bind9!5788
2022-02-01 20:38:01 +00:00
Ondřej Surý
a321b28916 Add CHANGES and release notes for [GL #3125] 2022-02-01 21:10:47 +01:00
Ondřej Surý
2ae84702ad Add log message when hard quota is reached in TCP accept
When isc_quota_attach_cb() API returns ISC_R_QUOTA (meaning hard quota
was reached) the accept_connection() would return without logging a
message about quota reached.

Change the connection callback to log the quota reached message.
2022-02-01 21:00:05 +01:00
Petr Špaček
858e522b4e Merge branch '3120-recent-editions-9-17-22-onwards-of-arm-have-many-empty-grammar-descriptions' into 'main'
Fix empty grammar descriptions in the ARM

Closes #3120

See merge request isc-projects/bind9!5784
2022-02-01 17:15:08 +00:00
Petr Špaček
34a3b35b08 Add missing parental-agents grammar generation
Formerly parental-agents grammar was an exception and it did not
auto-generate itself from source code. From now on it is generated using
the same mechanism as other grammars.

For consistency with rest of the system, I've also renamed the grammar
file and the link anchors from "parentals" to "parental-agents".

Technically this is fixup for commit
0311705d4b.

Related: !5234
2022-02-01 17:35:10 +01:00
Mark Andrews
e97c35b3bc Regenerate .rst files with grammars after changes to rst generators
$ make -C doc/misc all
2022-02-01 17:35:06 +01:00
Mark Andrews
d975e6630f Fix grammar generators to produce renderable include files in rst format
The missing `::` in the .rst files caused grammar section in docs to
render empty.

The `::` was accidentally removed in an unrelated commit
58bd26b6cf which was supposed to update
only copyright headers.

Fixes: #3120
2022-02-01 17:34:58 +01:00
Mark Andrews
f5c66f311a Add missing rst-grammars.pl dependecy to config grammar build 2022-02-01 17:34:54 +01:00
Mark Andrews
a8ac23c73c Merge branch '3117-9-18-0-nslookup-debugging-output' into 'main'
Resolve "9.18.0 nslookup debugging output"

Closes #3117

See merge request isc-projects/bind9!5780
2022-01-31 23:20:12 +00:00
Mark Andrews
123b57db36 Check that no debugging / errors are reported normally 2022-01-31 14:18:55 -08:00
Evan Hunt
6de4dfcc8c make nslookup test shellcheck safe 2022-01-31 14:17:23 -08:00
Mark Andrews
c068c3c771 Remove spurious 'debugging = true;'
This appears to be left over from the developement phase while
adding reference counting to the lookup structure.
2022-01-31 13:55:00 -08:00
Evan Hunt
9c02bd1021 Merge branch '3088-cleanup-dns_dnsseckey_create' into 'main'
remove error handling code around dns_dnsseckey_create()

Closes #3088

See merge request isc-projects/bind9!5707
2022-01-31 19:12:12 +00:00
Evan Hunt
e8ac7cf6ec remove error handling code around dns_dnsseckey_create()
this function can no longer fail, so error checking is not necessary.
2022-01-31 10:39:04 -08:00
Evan Hunt
c2cf69fcc4 Merge branch 'each-dlz-pthreads' into 'main'
complete removal of !PTHREADS code from DLZ modules

See merge request isc-projects/bind9!5779
2022-01-31 18:37:00 +00:00
Evan Hunt
c3a715123b complete removal of !PTHREADS code from DLZ modules
DLZ modules no longer support being built without threads,
so the "#if PTHREADS" conditionals were no longer necessary,
and were also causing errors in some of the modules due to
PTHREADS no longer being defined in dlz_pthread.h.
2022-01-28 15:41:04 -08:00
Evan Hunt
46bd46f253 Merge branch 'each-fix-contrib-dlz' into 'main'
update dlz_minimal.h

See merge request isc-projects/bind9!5774
2022-01-28 00:01:29 +00:00
Evan Hunt
d3fed6f400 update dlz_minimal.h
the addition of support for ECS client information in DLZ
modules omitted some necessary changes to build modules
in contrib.
2022-01-27 15:48:50 -08:00
Evan Hunt
bba5a1780d Merge branch 'each-dns-clientinfo' into 'main'
allow dns_clientinfo to store client ECS data

Closes #3082

See merge request isc-projects/bind9!5555
2022-01-27 22:33:56 +00:00
Evan Hunt
e42f7d2722 CHANGES for [GL #3082] 2022-01-27 13:54:44 -08:00
Evan Hunt
79ddedabf8 test ECS information is passed in dlzexternal
the dlzexternal test driver now includes ECS, if present in the
query, in the TXT record returned for QNAME "source-addr".
2022-01-27 13:53:59 -08:00
Petr Špaček
f81debe1c8 extend DLZ interface and example with ECS support
Apparently we forgot about DLZ when updating DNS_CLIENTINFO_VERSION
constant for ECS, which is at value "3" since ECS was introduced.

The code in example drivers and tests now hardcodes version numbers
2 (without ECS) and 3 (with ECS) depending on what a given code path
requires.
2022-01-27 13:53:59 -08:00
Evan Hunt
737e658602 allow dns_clientinfo to store client ECS data
this brings DNS_CLIENTINFO_VERSION into line with the subscription
branch so that fixes applied to clientinfo processing can also be
applied to the main branch without diverging.
2022-01-27 13:53:59 -08:00
Michal Nowak
3b53680458 Merge branch 'mnowak/drop-some-system-test-scrips' into 'main'
Drop some system test scripts

See merge request isc-projects/bind9!5745
2022-01-27 14:45:42 +00:00
Michal Nowak
e97ed8d9b6 Clean up test.output.* references
test.output.* files are no longer created by the system test framework.
Remove all references to these files from the source tree.
2022-01-27 15:32:28 +01:00
Michal Nowak
f6b996f6fc Drop systests.output references from system test
Since "runall.sh" script removal systests.output file is not being
created and its references are useless.
2022-01-27 15:32:28 +01:00
Michal Nowak
8109e924b5 Drop support for sequential system tests
System test used to have sequential system tests, which can't run in
parallel with the rest of system tests. As there are no such tests
anymore the underlying infrastructure can be dropped.
2022-01-27 15:32:28 +01:00
Michal Nowak
9d398572f0 Drop bin/tests/system/parallel.sh
"parallel.sh" script was used on Windows to run system tests in
parallel. Since Windows support was removed from BIND 9, the script is
not needed anymore.
2022-01-27 15:32:28 +01:00
Michal Nowak
986b364fe6 Drop testsummary.sh
testsummary.sh was not updated after build system rewrite to Autotools,
and needs to be fixed to produce test summary and core dump, assertion
failures, and ThreadSanitizer reports.

Given that all of this is provided by Autotools and run.sh already,
there's little use to testsummary.sh script and should be dropped.
2022-01-27 15:32:27 +01:00
Ondřej Surý
d799d7358d Merge branch '3108-cacheline-detection-propagate' into 'main'
Actually use detected cache line size

Closes #3108

See merge request isc-projects/bind9!5758
2022-01-27 12:06:55 +00:00
Ondřej Surý
f386fab2e2 Add CHANGES note for [GL #3108] 2022-01-27 13:02:23 +01:00
Petr Menšík
f00f521e9c Use detected cache line size
IBM power architecture has L1 cache line size equal to 128.  Take
advantage of that on that architecture, do not force more common value
of 64.  When it is possible to detect higher value, use that value
instead.  Keep the default to be 64.
2022-01-27 13:02:23 +01:00
Ondřej Surý
bff7dbeef9 Merge branch '3115-qname-wait-recurse-typo' into 'main'
Fix typo in qname-wait-recurse

Closes #3115

See merge request isc-projects/bind9!5768
2022-01-27 11:53:54 +00:00
Ondřej Surý
1e711dcccb Fix typo in qname-wait-recurse
In the RPZ documentation, there's a mistake where it states that the
default behavior will be disabled by setting `qname-wait-recurse yes;`
while in fact it's opposite `qname-wait-recurse no;`.

This affects only the RST documentation.
2022-01-27 12:51:06 +01:00
Michal Nowak
9c81a45279 Merge branch '1729-remove-unused-helper-scripts-from-bin-tests-system' into 'main'
Resolve "Remove unused helper scripts from bin/tests/system/"

Closes #1729

See merge request isc-projects/bind9!4489
2022-01-27 11:48:11 +00:00
Michal Nowak
5d2dd94cf8 Drop runall.sh
runall.sh was mainly used on Windows and as it's support was removed
from the "main" branch the script is not needed anymore.

Also, remove bin/tests/system/README text on running multiple system
test suites simultaneously with runall.sh as that support was not
present in the script anyway.
2022-01-27 11:58:17 +01:00
Michal Nowak
b983df403a Drop unused @DNSTAP@ label in conf.sh.in
@DNSTAP@ label does not have adjacent AC_SUBST() call and is therefore
unused.
2022-01-27 11:57:27 +01:00
Michal Nowak
67092442d6 rrsetorder should use stop_server() in tests.sh 2022-01-27 11:57:27 +01:00
Michal Nowak
7ba786dedb Drop bin/tests/system/setup.sh
bin/tests/system/setup.sh just executes setup.sh script of a particular
system test in the directory of the system test. This does not seems to
be useful enough to maintain it.
2022-01-27 11:57:27 +01:00
Michal Nowak
4c03d814ed Drop stopall.sh
stopall.sh script takes almost 2 minutes to go thru all test
subdirectories (due to a sleep in stop.pl) and does not seems to be
efficient way to stop manually started tests.
2022-01-27 11:57:26 +01:00
Matthijs Mekking
31988745fc Merge branch 'matthijs-keyfromlabel-system-test' into 'main'
Add keyfromlabel system test

Closes #3092

See merge request isc-projects/bind9!5312
2022-01-27 10:07:57 +00:00
Matthijs Mekking
a90f4c4ffa Update pkcs11 documentation on openssl_conf
The user should make sure there are no other 'openssl_conf = ...' lines
in the file.
2022-01-27 10:49:48 +01:00
Matthijs Mekking
0af8bbd49b Create keys with pkcs11-tool --id
The keyfromlabel system ECDSA tests sometimes fail. When this happens
the ZSK and KSK key id values differ by 1, which is an indication that
the same key is used for both DNSKEY records.

When the private key is retrieved with 'ENGINE_load_private_key()', the
public key is already set. But sometimes that key differs from the key
which was retrieved with 'ENGINE_load_public_key()'.

The libp11 source code uses id to find the key and without IDs all the
keys are "equal", so it is returning the first key in the array of the
enumerated keys instead of the matching key. In our test we didn't use
'--id', just '--label'. With this change, the system test should no
longer fail intermittently.

Note this is only an issue for ECDSA keys, not RSA keys.
2022-01-27 10:49:47 +01:00
Matthijs Mekking
8a4f098dee Suppressing memory leaks procuded by LeakSanitizer
These memory leaks are a known issue in libp11: From Timo Teras:

The relevant code is:

  https://github.com/OpenSC/libp11/blob/master/src/eng_front.c#L114-L123

The authors of libp11 did not get the locking right and decided
that having intentional memory leaks is better than risking a deadlock.

The leak logs indicate that it is the cached structures that should
have been freed.

These are not a run-time leaks, so suppressing these leaks is probably
okay.
2022-01-27 10:49:47 +01:00
Matthijs Mekking
eba66665a5 Add system test for dnssec-keyfromlabel
Add missing system test for dnssec-keyfromlabel. Test for various
algorithms that we can generate key files from a key that is stored in a
HSM, and that those keys can be used for signing with dnssec-signzone.
2022-01-27 10:49:46 +01:00
Matthijs Mekking
221e1bc2a3 Update .gitlab-ci.yml with openssl setup
GitLab CI needs to know about some environment variables that will
tell where OpenSSL and SoftHSM2 is installed. This is done in the
image, making the prepare-softhsm2.sh script obsolete.

The SoftHSM2 module location is system specific.
2022-01-27 10:46:58 +01:00
Matthijs Mekking
0725fcad38 Remove prepare-softhsm2.sh from runtime test
This script is obsoleted because SoftHSM2 is now installed in the
image.
2022-01-27 10:46:58 +01:00
Matthijs Mekking
ad01bca9fd Add CHANGES for keyfromlabel test 2022-01-27 10:46:57 +01:00
Michal Nowak
3f16408405 Merge branch 'mnowak/remove-leftover-test-code-for-windows' into 'main'
Remove leftover test code for Windows

See merge request isc-projects/bind9!5739
2022-01-27 09:34:52 +00:00
Evan Hunt
1d706f328c Remove leftover test code for Windows
- Removed all code that only runs under CYGWIN, and made all
  code that doesn't run under CYGWIN non-optional.
- Removed the $TP variable which was used to add optional
  trailing dots to filenames; they're no longer optional.
- Removed references to pssuspend and dos2unix.
- No need to use environment variables for diff and kill.
- Removed uses of "tr -d '\r'"; this was a workaround for
  a cygwin regex bug that is no longer needed.
2022-01-27 09:08:29 +01:00
Michał Kępień
8a2305fe1a Merge branch 'michal/misc-test-framework-fixes' into 'main'
Miscellaneous test framework fixes

See merge request isc-projects/bind9!5759
2022-01-26 14:21:53 +00:00
Michał Kępień
a938db2170 Fix waiting for lock file removal upon exit
Commit c787a539d2 fixed a certain class of
intermittent system test failures caused by named instances unable to
restart.  The root cause was bin/tests/system/stop.pl returning without
waiting for a named instance to remove its lock file.

Later on, it turned out that the above change causes other issues on
Windows due to the way named handles signals on that platform.  Commit
761ba4514f intended to address those
issues by making the server_lock_file() subroutine in
bin/tests/system/stop.pl return an empty value on Windows, in order to
prevent the script for waiting for lock file cleanup on that platform.
Note, however, that Windows detection in that subroutine is limited to
checking whether the CYGWIN environment variable is set.

While that environment variable was not set on Unix-like systems before
commit 761ba4514f, another commit
(a33237f070, merged a few weeks later)
changed that by setting the CYGWIN environment variable to an empty
value on Unix-like systems.  This made the defined($ENV{'CYGWIN'}) check
in server_lock_file() return true, inadvertently preventing
bin/tests/system/stop.pl from waiting for lock file removal before
exiting on Unix-like systems and therefore reintroducing the original
issue.

Fix by making server_lock_file() only return an empty value when the
CYGWIN environment variable is set to a non-empty value (which is what
bin/tests/system/conf.sh.win32 does).  Adjust a similar check in the
pid_file_exists() subroutine in the same way for consistency.
2022-01-26 15:18:43 +01:00
Michał Kępień
fb87022115 Do not strip leading whitespace from test output
The echo_*() and cat_*() functions in bin/tests/system/conf.sh.common
call the "read" builtin command without specifying the field separator
to use.  This results in leading whitespace getting stripped from each
line of the texts passed to those functions, which mangles e.g. pytest
output, hindering test failure troubleshooting.

Address by setting IFS to an empty value for the "read" calls used in
the aforementioned helper functions.
2022-01-26 15:18:43 +01:00
Michał Kępień
65abbca79b Retain all named.run files from each test run
The bin/tests/system/start.pl script truncates the named.run file for a
given named instance unless it is invoked with the --restart
command-line option.  Ever since Python-based tests were introduced,
bin/tests/system/run.sh may start named instances used by a given system
test multiple times within a single run, causing the
bin/tests/system/start.pl script to truncate some of the log files
written during the test.  This makes troubleshooting certain test
failures hard or even impossible.

Fix by calling bin/tests/system/start.pl with the --restart command-line
option for every start_servers() invocation except the first one.
2022-01-26 15:18:43 +01:00
Arаm Sаrgsyаn
84878f18d2 Merge branch '3087-tls-ephemeral-certificate-set-not-before-in-past' into 'main'
Set the ephemeral certificate's "not before" a short time in the past

Closes #3087

See merge request isc-projects/bind9!5708
2022-01-25 09:33:30 +00:00
Aram Sargsyan
81d3584116 Set the ephemeral certificate's "not before" a short time in the past
TLS clients can have their clock a short time in the past which will
result in not being able to validate the certificate.

Setting the "not before" property 5 minutes in the past will
accommodate with some possible clock skew across systems.
2022-01-25 09:09:35 +00:00
Arаm Sаrgsyаn
27b709cc75 Merge branch '3060-revert-view-on-failed-reconfig' into 'main'
Improve the view configuration error handling and reverting logic

Closes #3060

See merge request isc-projects/bind9!5674
2022-01-25 08:40:08 +00:00
Aram Sargsyan
4a6c66288f Fix a memory leak in dns_dlzcreate()
dns_dlzcreate() fails to free the memory allocated for dlzname
when an error occurs.

Free dlzname's memory (acquired earlier with isc_mem_strdup())
by calling isc_mem_free() before returning an error code.
2022-01-25 08:21:50 +00:00
Aram Sargsyan
5f9d4b5db4 Fix invalid control port number in the catz system test
When failure is expected, the `rndc` command in the catz system test
is being called directly instead of using a function, i.e.:

    $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reconfig \
        > /dev/null 2>&1 && ret=1

... instead of:

    rndccmd 10.53.0.2 reconfig && ret=1

This is done to suppress messages like "lt-rndc: 'reconfig' failed:
failure" appearing in the message log of the test, because failure
is actually expected, and the appearance of that message can be
confusing.

The port value used in this case is not correct, making the
`rndc reload` command to fail.  This error was not detected earlier
only because the failure of the command is actually expected, but
the failure happens for a "wrong" reason, and the test still passes.

Fix the error by using the existing variable instead of the fixed
number.
2022-01-25 08:21:50 +00:00
Aram Sargsyan
62337d433f Add a system test for view reverting after a failed reconfiguration
Test the view reverting code by introducing a faulty dlz configuration
in named.conf and using `rndc reconfig` to check if named handles the
situation correctly.

We use "dlz" because the dlz processing code is located in an ideal
place in the view configuration function for the test to cover the
view reverting code.

This test is specifically added to the catz system test to additionally
cover the catz reconfiguration during the mentioned failed
reconfiguration attempt.
2022-01-25 08:21:50 +00:00
Aram Sargsyan
d7dfa2dc4b Add CHANGES and release notes for [GL #3060] 2022-01-25 08:21:50 +00:00
Aram Sargsyan
2fd967136a Improve the zones' view reverting logic when a zone is a catalog zone
When a zone is being configured with a new view, the catalog zones
structure will also be linked to that view. Later on, in case of some
error, should the zone be reverted to the previous view, the link
between the catalog zones structure and the view won't be reverted.

Change the dns_zone_setviewrevert() function so it calls
dns_zone_catz_enable() during a zone revert, which will reset the
link between `catzs` and view.
2022-01-25 08:20:52 +00:00
Aram Sargsyan
6b937ed5f6 Separate the locked parts of dns_zone_catz_enable/disable functions
Separate the locked parts of dns_zone_catz_enable() and
dns_zone_catz_disable() functions into static functions.  This will
let us perform those tasks from the other parts of the module while
the zone is locked, avoiding one pair of additional unlocking and
locking operations.
2022-01-25 08:20:52 +00:00
Aram Sargsyan
3697560f04 Improve the view configuration error handling and reverting logic
If a view configuration error occurs during a named reconfiguration
procedure, BIND can end up having twin views (old and new), with some
zones and internal structures attached to the old one, and others
attached to the new one, which essentially creates chaos.

Implement some additional view reverting mechanisms to avoid the
situation described above:

 1. Revert rpz configuration.

 2. Revert catz configuration.

 3. Revert zones to view attachments.
2022-01-25 08:20:52 +00:00
Petr Špaček
2941a480cd Merge branch 'pspacek/misc-doc-cleanups' into 'main'
Miscellaneous documentation cleanups

See merge request isc-projects/bind9!5752
2022-01-25 08:15:07 +00:00
Petr Špaček
ee3ba3cac9 Fix incorrect RFC footnote about A6 RR type in RFC4033
A6 type is not mentioned anywhere in RFC4033.
2022-01-24 21:39:38 +01:00
Petr Špaček
8c82b0f2d0 Remove RFCs not implemented in BIND from list in the ARM
This commit partially removes extra RFCs which are not listed in
file doc/misc/rfc-compliance.

Most of the removed RFCs are either outright obsolete, irrelevant,
or not implemented. Rationale:
- 974 - obsolete
- 1033 - ops info, hardly followed today
- 1464 - ops info
- 1591 - policy
- 1537 - obsolete
- 1713 - obsolete
- 1794 - notimp
- 2010 - ops info
- 2052 - obsolete
- 2065 - obsolete
- 2137 - obsolete
- 2168 - obsolete
- 2240 - obsolete
- 2345 - not dns
- 2352 - not dns
- 2540 - notimp
- 2825 - notimp, info, obsolete
- 2826 - notimp
- 2929 - obsolete
- 3071 - policy
- 3090 - obsolete
- 3258 - notimp
- 6594 - iana, SSHFP
- 7216 - not dns
- 8482 - notimp
- 8490 - notimp

Probably most notable RFCs removed are:
- 8482 for special ANY handling
- 8490 for Stateful Operations
As far as I can tell BIND does not implement those.
2022-01-24 21:39:38 +01:00
Petr Špaček
4379e16996 Reword RFC section in the ARM
Add couple links and caveant for uninitiated readers.
2022-01-24 21:39:38 +01:00
Petr Špaček
b1af79acc7 Add RFCs listed in doc/misc/rfc-compliance to doc/arm/general.rst
There were three RFCs listed in list of "RFCs we implement" but missing
in the ARM.

Command to compare lists in the two documents:

    diff <(grep -o '^  RFC[0-9]\+' doc/misc/rfc-compliance | sed -e 's/[^0-9]//g' | sort -n) <(grep  '^:rfc:`' doc/arm/general.rst | sed -e 's/^.*`\([0-9]*\)`.*$/\1/' | sort -n)
2022-01-24 21:39:38 +01:00
Petr Špaček
4b1c70de90 Rework doc/arm/build.rst
- Revise the list of required libraries.
  - Apply miscellaneous tweaks to style, formatting, and ordering.
2022-01-24 21:39:38 +01:00
Petr Špaček
2c81fa9013 Deduplicate text between Building BIND 9 / Supported Platforms in the ARM
Supported Platforms section is now really only about platforms and not
libraries. Libraries were moved to the Building BIND section.

We now have section for required libraries, and second with optional
features.  Wordy explanations were taken verbatim from the original
README.md.
2022-01-24 21:39:38 +01:00
Petr Špaček
933ed9d537 Replace Building BIND 9 section in README with reference to ARM 2022-01-24 21:39:38 +01:00
Petr Špaček
5c6b50027a Convert "Building BIND" section from README.md to reStructuredText
Converted using pandoc 2.14.2-9 on Arch Linux:

    $ pandoc --shift-heading-level-by=-1 -f markdown -t rst README.md > doc/arm/build.rst

Plus hand-edit to remove sections other than Building BIND 9, remove
misindentation in section headers, and add a standard copyright header.
2022-01-24 21:39:38 +01:00
Petr Špaček
3bd4318fcc Link to ISC KB for most up-to-date platform support statuses 2022-01-24 21:39:38 +01:00
Petr Špaček
920a2e730b Replace all occurences of PLATFORMS file with reference to the ARM
The conf.py exclude_patterns now includes platforms.rst to avoid
problems with redefining labels:
https://github.com/sphinx-doc/sphinx/issues/1668#issuecomment-71376208
2022-01-24 21:39:38 +01:00
Petr Špaček
f693c9b1a7 Replace duplicate Supported Operating Systems in the ARM by PLATFORMS.rst 2022-01-24 21:39:38 +01:00
Petr Špaček
d2bbd4d81c Convert PLATFORMS file from Markdown to reStructuredText
Converted using pandoc 2.14.2-9 on Arch Linux:

    $ pandoc -f markdown -t rst PLATFORMS.md > PLATFORMS.rst

The pandoc-generated copyright header was subsequently replaced with
usual one for .rst files.
2022-01-24 21:39:38 +01:00
Petr Špaček
49a32c076c Update BIND version number in PLATFORMS.md to 9.19 2022-01-24 21:39:38 +01:00
Petr Špaček
3b45759849 Document that tls statement is subject to change 2022-01-24 21:39:38 +01:00
Petr Špaček
ccfe682508 Clarify XoT usage and warn about the unauthenticated mode 2022-01-24 21:39:38 +01:00
Ondřej Surý
db82318477 Merge branch 'ondrej/use-utc-for-reproducible-builds' into 'main'
Use UTC datetime for reproducible builds

See merge request isc-projects/bind9!5750
2022-01-24 15:32:18 +00:00
Ondřej Surý
8c4d5d5623 Use UTC datetime for reproducible builds
For reproducible builds, we use last modification time of the CHANGES
file.  This works pretty well, unless the builds are made in different
timezones.

Use UTC option to date command to make the builds reproducible.
2022-01-24 16:09:48 +01:00
Michał Kępień
28350cd94f Merge branch '3108-bind9-fails-to-start-on-machines-where-glibc-does-not-provide-l1-cache-size' into 'main'
Ignore the invalid L1 cache line size returned by sysconf()

Closes #3108

See merge request isc-projects/bind9!5748
2022-01-24 08:24:12 +00:00
Ondřej Surý
f570e41ab8 Add CHANGES note for [GL #3108] 2022-01-22 17:04:17 +01:00
Ondřej Surý
b28327354d Ignore the invalid L1 cache line size returned by sysconf()
On some systems, the glibc can return 0 instead of cache-line size to
indicate the cache line sizes cannot be determined.  This is comment
from glibc source code:

    /* In general we cannot determine these values.  Therefore we
       return zero which indicates that no information is
       available.  */

As the goal of the check is to determine whether the L1 cache line size
is still 64 and we would use this value in case the sysconf() call is
not available, we can also ignore the invalid values returned by the
sysconf() call.
2022-01-22 16:59:50 +01:00
Petr Špaček
994297423e Merge branch 'pspacek/remove-duplicate-named.conf.rst' into 'main'
Remove duplicate named.conf.rst file

See merge request isc-projects/bind9!5731
2022-01-21 14:32:38 +00:00
Petr Špaček
0a5c2c23bb Remove duplicate named.conf.rst file
As far as I can tell, it is some leftover from the times when Sphinx
docs were introduced (commit 9fb6d11abb).
It seems like it is not referenced from anywhere.
2022-01-21 15:30:38 +01:00
Michał Kępień
370d54e3bb Merge branch 'michal/miscellaneous-text-tweaks-related-to-doh-and-dot' into 'main'
Miscellaneous text tweaks related to DNS-over-HTTPS and DNS-over-TLS

See merge request isc-projects/bind9!5743
2022-01-20 17:38:50 +00:00
Michał Kępień
e225c46376 Suggest --disable-doh when libnghttp2 is not found
Extend the error message displayed when support for DNS over HTTPS is
requested but libnghttp2 is unavailable at build time, in order to help
the user find a way out of such a situation.
2022-01-20 15:40:37 +01:00
Michał Kępień
279b048e34 Avoid use of the DoH acronym in ./configure output
Replace all uses of the DoH acronym in ./configure output with
"DNS-over-HTTPS support" in order to improve error message readability.
2022-01-20 15:40:37 +01:00
Michał Kępień
18db2269bf Fix spelling of "DNS over HTTPS" & "DNS over TLS"
The terms "DNS over HTTPS" and "DNS over TLS" should be hyphenated when
they are used as adjectives and non-hyphenated otherwise.  Ensure all
occurrences of these terms in the source tree follow the above rule.
(CHANGES and release notes are intentionally left intact.)

Tweak a related ARM snippet, fixing a typo in the process.
2022-01-20 15:40:37 +01:00
Michał Kępień
f74e2fb7fb Merge branch 'v9_17_22-release' into 'main'
Merge 9.17.22 release branch

See merge request isc-projects/bind9!5741
2022-01-20 10:26:54 +00:00
Michał Kępień
2559a9d2bd Prepare release notes for BIND 9.17.23 2022-01-20 11:20:03 +01:00
Michał Kępień
e0099f7887 Update BIND version to 9.17.22 2022-01-20 11:19:58 +01:00
Michał Kępień
4289c79fcc Add a CHANGES marker 2022-01-20 11:19:58 +01:00
Michał Kępień
9005d65287 Merge branch 'pspacek/prepare-documentation-for-bind-9.17.22' into 'v9_17_22-release'
Prepare documentation for BIND 9.17.22

See merge request isc-private/bind9!345
2022-01-20 11:19:58 +01:00
Michał Kępień
cb97395a8f Prepare release notes for BIND 9.17.22 2022-01-20 11:19:58 +01:00
Michał Kępień
cc26eb8961 Reorder release notes 2022-01-20 11:19:58 +01:00
Petr Špaček
c2ed72a324 Add release note for GL #2398 and GL #3048
Related: !5620
Fix the isc_hp initialization and memory usage

Related: !5646
Reduce freemax values for dns_message mempools
2022-01-20 11:19:58 +01:00
Petr Špaček
1acbf17cda Add release note for GL #2264
Related: !5627
Use ECDSA P-256 instead of 4096-bit RSA for 'tls ephemeral'
2022-01-20 11:19:58 +01:00
Petr Špaček
5b79ec4033 Tweak and reword release notes 2022-01-20 11:19:58 +01:00
Michał Kępień
d4f01d03d7 Remove release note for GL #3079 2022-01-20 11:19:58 +01:00
Michał Kępień
b82d315327 Merge branch '3080-rndc-catch-canceled' into 'main'
rndc: catch ISC_R_CANCELED in rndc_recvdone()

Closes #3080

See merge request isc-projects/bind9!5716
2022-01-20 08:03:18 +00:00
Evan Hunt
ce83b97099 CHANGES for [GL #3080] 2022-01-19 14:30:17 +01:00
Michał Kępień
d1d721aae1 rndc: prevent crashing after receiving a signal
If isc_app_run() gets interrupted by a signal, the global 'rndc_task'
variable may already be detached from (set to NULL) by the time the
outstanding netmgr callbacks are run.  This triggers an assertion
failure in isc_task_shutdown().  However, explicitly calling
isc_task_shutdown() from rndc code is redundant because it does not use
isc_task_onshutdown() and the task_shutdown() function gets
automatically called anyway when the task manager gets destroyed (after
isc_app_run() returns).  Remove the redundant isc_task_shutdown() calls
to prevent crashes after receiving a signal.
2022-01-19 14:30:17 +01:00
Evan Hunt
289c1d33ee rndc: sync ISC_R_CANCELED handling in callbacks
rndc_recvdone() is not treating the ISC_R_CANCELED result code as a
request to stop data processing, which may cause a crash when trying to
dereference ccmsg->buffer.  Fix by ensuring ISC_R_CANCELED results in an
early exit from rndc_recvdone().

Make sure the logic for handling ISC_R_CANCELED in rndc_recvnonce()
matches the one present in rndc_recvdone() to ensure consistent behavior
between these two sibling functions.
2022-01-19 14:30:17 +01:00
Petr Špaček
710f62bf39 Merge branch 'pspacek/doc-cleanup' into 'main'
Developer docs cleanup

See merge request isc-projects/bind9!4527
2022-01-18 16:20:55 +00:00
Petr Špaček
69d0fe9e72 Replace obsolete references to ATF with Cmocka
Fixup for MR!886.
2022-01-18 17:12:57 +01:00
Petr Špaček
631ee58010 Document new system test output format after build system rewrite
Fixup to MR !985.
2022-01-18 17:12:32 +01:00
Petr Špaček
dac41968a9 Fix command to run all unit tests in doc/dev/dev.md
Fixup for build system rewrite 978c7b2e89,
MR !985.
2022-01-18 17:12:27 +01:00
Artem Boldariev
3c5dbe5742 Merge branch 'artem-doth-test-fix-failure-after-reconfig' into 'main'
doth test: fix failure after reconfig

See merge request isc-projects/bind9!5720
2022-01-18 12:43:42 +00:00
Artem Boldariev
d3e7c0e647 doth test: fix failure after reconfig
Sometimes the serving a query or two might fail in the test due to the
listeners not being reinitialised on time. This commit makes the test
suite to wait for reconfiguration message in the log file to detect
the time when the reconfiguration request completed.
2022-01-18 14:25:43 +02:00
Michał Kępień
89260d6c86 Merge branch '3099-reimplement-the-gnutls-cli-check-in-python' into 'main'
Reimplement the gnutls-cli check in Python

Closes #3099

See merge request isc-projects/bind9!5732
2022-01-18 10:03:09 +00:00
Michał Kępień
29961bd741 Reimplement the gnutls-cli check in Python
gnutls-cli is tricky to script around as it immediately closes the
server connection when its standard input is closed.  This prevents
simple shell-based I/O redirection from being used for capturing the DNS
response sent over a TLS connection and the workarounds for this issue
employ non-standard utilities like "timeout".

Instead of resorting to clever shell hacks, reimplement the relevant
check in Python.  Exit immediately upon receiving a valid DNS response
or when gnutls-cli exits in order to decrease the test's run time.
Employ dnspython to avoid the need for storing DNS queries in binary
files and to improve test readability.  Capture more diagnostic output
to facilitate troubleshooting.  Use a pytest fixture instead of an
Autoconf macro to keep test requirements localized.
2022-01-18 11:00:46 +01:00
Ondřej Surý
17fca0ba96 Merge branch '3093-restore-setting-IPV6_V6ONLY-on-IPv6-sockets' into 'main'
Explicitly enable IPV6_V6ONLY on the netmgr sockets

Closes #3093

See merge request isc-projects/bind9!5714
2022-01-17 22:55:20 +00:00
Ondřej Surý
21c0cfd053 Add CHANGES and release notes for [GL #3093] 2022-01-17 22:16:27 +01:00
Ondřej Surý
7267c39323 Remove +mapped option from dig
The network manager doesn't have support for IPv4-mapped IPv6 addresses,
thus we are removing the +mapped option from dig command.
2022-01-17 22:16:27 +01:00
Ondřej Surý
b5e086257d Explicitly enable IPV6_V6ONLY on the netmgr sockets
Some operating systems (OpenBSD and DragonFly BSD) don't restrict the
IPv6 sockets to sending and receiving IPv6 packets only.  Explicitly
enable the IPV6_V6ONLY socket option on the IPv6 sockets to prevent
failures from using the IPv4-mapped IPv6 address.
2022-01-17 22:16:27 +01:00
Artem Boldariev
55a0d0880a Merge branch '3101-use-ext-regex-to-check-for-http2-support-in-curl' into 'main'
doth test: use extended reg. expression to check for HTTP/2 support

Closes #3101

See merge request isc-projects/bind9!5733
2022-01-17 17:14:45 +00:00
Artem Boldariev
4884ab0340 doth test: use extended reg. expression to check for HTTP/2 support
Using extended regular expressions to check for HTTP/2 support in curl
appears to be a more portable option, which also works on
e.g. OpenBSD.
2022-01-17 16:36:27 +02:00
Ondřej Surý
748b61554e Merge branch 'djt-update-cookie-secret-doc' into 'main'
Update docs to reflect changes to acceptable cookie-secret values

See merge request isc-projects/bind9!5628
2022-01-17 10:50:30 +00:00
Dan Theisen
acf1d502d6 docs: Update ARM to reflect changes to acceptable cookie-secret values 2022-01-17 11:48:25 +01:00
Ondřej Surý
b4ed35c946 Merge branch '3093-missing-libuv-code' into 'main'
add UV_ENOTSUP to isc___nm_uverr2result()

Closes #3093

See merge request isc-projects/bind9!5712
2022-01-17 10:46:35 +00:00
Evan Hunt
be0bc24c7f add UV_ENOTSUP to isc___nm_uverr2result()
This error code is now mapped to ISC_R_FAMILYNOSUPPORT.
2022-01-17 11:45:10 +01:00
Ondřej Surý
ec82226465 Merge branch 'ondrej/fix-missing-backtick-in-host.rst' into 'main'
Add missing backtick to host.rst

See merge request isc-projects/bind9!5724
2022-01-16 07:01:45 +00:00
Ondřej Surý
aaa31962d2 Add missing backtick to host.rst
The missing backtick was causing formatting problems in the host
manpage.
2022-01-16 07:56:17 +01:00
Artem Boldariev
e9942b3ba7 Merge branch 'artem-better-doh-error-logging' into 'main'
DoH: log bad HTTP/2 requests

See merge request isc-projects/bind9!5679
2022-01-14 14:23:43 +00:00
Artem Boldariev
ca9fe3559a DoH: ensure that server_send_error_response() is used properly
The server_send_error_response() function is supposed to be used only
in case of failures and never in case of legitimate requests. Ensure
that ISC_HTTP_ERROR_SUCCESS is never passed there by mistake.
2022-01-14 16:00:42 +02:00
Artem Boldariev
a38b4945c1 DoH: add bad HTTP/2 requests logging
Add some error logging when facing bad requests over HTTP/2. Log the
address and the error description.
2022-01-14 16:00:42 +02:00
Ondřej Surý
5630df8712 Merge branch '3069-increase-dig-timeout-in-resolver-test-v2' into 'main'
Increase the timeout to 15 seconds for the resolver test

Closes #3069

See merge request isc-projects/bind9!5721
2022-01-14 13:51:16 +00:00
Ondřej Surý
d3b975abb6 Increase the timeout to 15 seconds for the resolver test
1. 10 seconds is an unfortunate pick because that reintroduces the
   problem described in commit 5307bf64 (for an earlier check).

   Change the +tries=3 +timeout=10 to +tries=2 +time=15, so that we
   minimize the risk of dig missing any responses sent by the server in
   the first 15 seconds while also increasing our chances of the
   response arriving in time on machines under heavy load and allowing
   it a single retry in case things go awry.

2. The comment about TCP above was misleading: as painfully proven by
   GitLab CI, using TCP is no guarantee of receiving a response in a
   timely manner.  It may help a bit, but it is certainly not a 100%
   reliable solution.

   Change the dig invocation to just use UDP like in the two prior
   tests for consistency (and revise that comment accordingly).
2022-01-14 13:00:56 +01:00
Ondřej Surý
70596240c4 Merge branch '3069-increase-dig-timeout-in-resolver-test' into 'main'
Make resolver system test shellcheck clean

Closes #3069

See merge request isc-projects/bind9!5719
2022-01-14 11:16:11 +00:00
Ondřej Surý
29b9c8e7f5 Increase the dig timeout in resolver test to 10 seconds
The resolver system tests was exhibiting often intermitten failures,
increase the timeout from default 5 second to 10 seconds to give the dig
more leeway for providing an answer.
2022-01-14 11:13:26 +01:00
Ondřej Surý
6d9afd4cc0 Make resolver system test shellcheck clean
The resolver system test shell scripts were using legacy syntax.
Convert the script into POSIX shell syntax and make them shellcheck
clean.
2022-01-14 11:13:26 +01:00
Ondřej Surý
8d95c96b51 Merge branch '3095-detect-padding-in-struct_msghdr' into 'main'
Instead of detecting MUSL libc, detect padding in struct msghdr

Closes #3095

See merge request isc-projects/bind9!5718
2022-01-13 23:26:54 +00:00
Ondrej Sury
9da228dde6 Instead of detecting MUSL libc, detect padding in struct msghdr
The detection of MUSL libc via autoconf $host turned out to be
not reliable.

Convert the autoconf check from $host detection to actually detect
the padding used in the struct msghdr.
2022-01-13 23:06:09 +01:00
Ondřej Surý
5b7e5b1bd8 Merge branch '3095-invalid-recvmmsg-detection' into 'main'
Fix the UDP recvmmsg support

Closes #3095

See merge request isc-projects/bind9!5713
2022-01-13 18:43:00 +00:00
Ondřej Surý
8d778f758b Add CHANGES and release notes for [GL #3095] 2022-01-13 19:06:39 +01:00
Ondřej Surý
0a4e91ee47 Revert "Always enqueue isc__nm_tcp_resumeread()"
The commit itself is harmless, but at the same time it is also useless,
so we are reverting it.

This reverts commit 11c869a3d5.
2022-01-13 19:06:39 +01:00
Ondrej Sury
287ea095f1 Disable udp recvmmsg support on systems with MUSL libc
The Linux kernel diverts from the POSIX specification for two members of
struct msghdr making them size_t sized (instead of int and socklen_t).
In glibc, the developers have decided to use that.  However, the MUSL
developers used padding for the struct and kept the members defined
according to the POSIX.

This creates a problem, because libuv doesn't use recvmmsg() library
call where the padding members are correctly zeroed and instead calls
the syscall directly, the struct msghdr is passed to the kernel with
enormous values in those two members (because of the random junk in the
padding members) and the syscall thus fail with EMSGSIZE.

Disable udp recvmmsg support on systems with MUSL libc until the libuv
starts zeroing the struct msghdr before passing it to the syscall.
2022-01-13 19:06:39 +01:00
Ondřej Surý
7370725008 Fix the UDP recvmmsg support
Previously, the netmgr/udp.c tried to detect the recvmmsg detection in
libuv with #ifdef UV_UDP_<foo> preprocessor macros.  However, because
the UV_UDP_<foo> are not preprocessor macros, but enum members, the
detection didn't work.  Because the detection didn't work, the code
didn't have access to the information when we received the final chunk
of the recvmmsg and tried to free the uvbuf every time.  Fortunately,
the isc__nm_free_uvbuf() had a kludge that detected attempt to free in
the middle of the receive buffer, so the code worked.

However, libuv 1.37.0 changed the way the recvmmsg was enabled from
implicit to explicit, and we checked for yet another enum member
presence with preprocessor macro, so in fact libuv recvmmsg support was
never enabled with libuv >= 1.37.0.

This commit changes to the preprocessor macros to autoconf checks for
declaration, so the detection now works again.  On top of that, it's now
possible to cleanup the alloc_cb and free_uvbuf functions because now,
the information whether we can or cannot free the buffer is available to
us.
2022-01-13 19:06:39 +01:00
Ondřej Surý
abe466e5b3 Merge branch '2951-dont-schedule-zone-refresh-when-shutting-down' into 'main'
Refactor zone stub, refresh and notify event callbacks

Closes #2951

See merge request isc-projects/bind9!5715
2022-01-13 17:46:08 +00:00
Ondřej Surý
abe6d4ee04 Add CHANGES note for [GL #3084] 2022-01-13 17:58:33 +01:00
Ondřej Surý
c960236adb Don't schedule next zone events when shutting down
When the named is shutting down, the zone event callbacks could
re-schedule the stub and refresh events leading to assertion failure.

Handle the ISC_R_SHUTTINGDOWN event state gracefully by bailing out.
2022-01-13 17:58:33 +01:00
Ondřej Surý
efca93942c Refactor zone stub, refresh and notify event callbacks
This commit cleanups the way how we handle the revent->result in the
stub_callback(), refresh_callback() and notify_done() zone callbacks.
2022-01-13 17:58:33 +01:00
Ondřej Surý
28c8fb839c Merge branch '3086-remove-workaround-for-server-mishandling-notify-with-soa-record-in-answer-section' into 'main'
Remove the workaround for broken handling of NOTIFY with SOA

Closes #3086

See merge request isc-projects/bind9!5704
2022-01-13 16:56:19 +00:00
Ondřej Surý
e3379e1615 Add CHANGES note for [GL #3086] 2022-01-13 17:19:38 +01:00
Ondřej Surý
8a0c4355d2 Remove the workaround for broken handling of NOTIFY with SOA
In 2000, old BIND instances (BIND 8?) would return FORMERR if the SOA is
included in the NOTIFY.

Remove the workaround that detected the state and resent the NOTIFY
without SOA record.
2022-01-13 17:09:43 +01:00
Arаm Sаrgsyаn
6441646ead Merge branch '3087-tls-ephemeral-ecc-gnutls-nss-compat' into 'main'
Use uncompressed point conversion form for 'tls ephemeral' ECC keys

Closes #3087

See merge request isc-projects/bind9!5705
2022-01-13 13:11:14 +00:00
Aram Sargsyan
daf11421df Add a test to query DoT using gnutls-cli
Add a test to check BIND's DoT (DNS-over-TLS) implementation using
gnutls-cli to confirm that it is compatibe with the GnuTLS library.
2022-01-13 12:28:11 +00:00
Aram Sargsyan
6f457c5121 Generate a random serial number for 'tls ephemeral' certificates
Clients can cache the TLS certificates and refuse to accept
another one with the same serial number from the same issuer.

Generate a random serial number for the self-signed certificates
instead of using a fixed value.
2022-01-13 11:03:07 +00:00
Aram Sargsyan
0a19b5cd62 Use uncompressed point conversion form for 'tls ephemeral' ECC keys
GnuTLS, NSS, and possibly other TLS libraries currently fail to work
with compressed point conversion form supported by OpenSSL.

Use uncompressed point conversion form for better compatibility.
2022-01-13 11:03:06 +00:00
Ondřej Surý
2eee9242e3 Merge branch '3079-assertion-failure-on-TCP-read' into 'main'
Use ISC_R_SHUTTINGDOWN to detect netmgr shutting down

Closes #3079

See merge request isc-projects/bind9!5710
2022-01-13 09:26:31 +00:00
Ondřej Surý
86b9df1dd2 Update CHANGES and release notes for [GL #3079] 2022-01-13 09:49:58 +01:00
Ondřej Surý
dbd9c31354 Use ISC_R_SHUTTINGDOWN to detect netmgr shutting down
When the dispatch code was refactored in libdns, the netmgr was changed
to return ISC_R_SHUTTINGDOWN when the netmgr is shutting down, and the
ISC_R_CANCELED is now reserved only for situation where the callback was
canceled by the caller.

This change wasn't reflected in the controlconf.c channel which was
still looking for ISC_R_CANCELED as the shutdown event.
2022-01-13 09:14:12 +01:00
Ondřej Surý
a6a09385ee Merge branch 'ondrej/remove-util-copyrights' into 'main'
Remove the copyright handling via util/copyrights

See merge request isc-projects/bind9!5147
2022-01-11 08:58:14 +00:00
Ondřej Surý
e1d2e26360 Remove util/copyrights 2022-01-11 09:05:02 +01:00
Ondřej Surý
58bd26b6cf Update the copyright information in all files in the repository
This commit converts the license handling to adhere to the REUSE
specification.  It specifically:

1. Adds used licnses to LICENSES/ directory

2. Add "isc" template for adding the copyright boilerplate

3. Changes all source files to include copyright and SPDX license
   header, this includes all the C sources, documentation, zone files,
   configuration files.  There are notes in the doc/dev/copyrights file
   on how to add correct headers to the new files.

4. Handle the rest that can't be modified via .reuse/dep5 file.  The
   binary (or otherwise unmodifiable) files could have license places
   next to them in <foo>.license file, but this would lead to cluttered
   repository and most of the files handled in the .reuse/dep5 file are
   system test files.
2022-01-11 09:05:02 +01:00
Ondřej Surý
dbcff56043 Add reuse lint CI job
Instead of checking for the licenses in the misc step, add a separate
job that uses the upstream provided image that has reuse tool installed
and run `reuse lint` from the separate job.
2022-01-10 21:16:28 +01:00
Ondřej Surý
09c32a8d75 Remove the copyright handling via util/copyrights
The copyright handling has been long obsolete, the works is covered as
whole by the COPYING/LICENSE file even if a specific file doesn't have
a copyright header.

The important thing to remember here is that any work is covered by a
copyright law and by explicitly giving it license we provide extra
rights to the users of the works.
2022-01-07 13:30:46 +01:00
Mark Andrews
47a9915888 Merge branch '3025-document-how-rate-limiting-uses-dns-cookies' into 'main'
Document how rate limiting uses DNS cookies

Closes #3025

See merge request isc-projects/bind9!5700
2022-01-07 08:24:09 +00:00
Björn Persson
a59482b85c Document the interation of DNS COOKIE and RRL
Send back BADCOOKIE responses instead of TC=1 when slipping.

Skip rate limiting for UDP requests with valid server cookies.
2022-01-07 13:08:14 +11:00
Ondřej Surý
5d677c1b36 Merge branch '3079-always-enqueue-isc__nm_tcp_resumeread' into 'main'
Always enqueue isc__nm_tcp_resumeread()

Closes #3079

See merge request isc-projects/bind9!5695
2022-01-06 19:10:48 +00:00
Ondřej Surý
5563d06d62 Add CHANGES and release note for [GL #3079] 2022-01-06 10:34:04 -08:00
Ondřej Surý
11c869a3d5 Always enqueue isc__nm_tcp_resumeread()
The isc__nm_tcp_resumeread() was using maybe_enqueue function to enqueue
netmgr event which could case the read callback to be executed
immediately if there was enough data waiting in the TCP queue.

If such thing would happen, the read callback would be called before the
previous read callback was finished and the worker receive buffer would
be still marked "in use" causing a assertion failure.

This would affect only raw TCP channels, e.g. rndc and http statistics.
2022-01-06 10:34:04 -08:00
Petr Špaček
579247395d Merge branch 'vicky-main-patch-33672' into 'main'
Update preface.rst of DNSSEC Guide with new contact info for Josh Kuo

See merge request isc-projects/bind9!5696
2022-01-06 15:19:04 +00:00
Vicky Risk
896fa924f3 Update preface.rst of DNSSEC Guide with new contact info for Josh Kuo 2022-01-06 14:54:40 +00:00
Matthijs Mekking
ca1a664005 Merge branch '3035-dnssec-policy-stops-signing-when-removing-zsk' into 'main'
Fix autosign system test, allow expired zone signatures to be replaced with KSK RRSIGs

Closes #3049 and #3035

See merge request isc-projects/bind9!5617
2022-01-06 08:51:54 +00:00
Matthijs Mekking
6e9fed2d24 Replace RSASHA1 in autosign test with default alg
Change RSASHA1 to $DEFAULT_ALGORITHM to be FIPS compliant.

There is one RSASHA1 occurence left, to test that dynamically adding an
NSEC3PARAM record to an NSEC-only zone fails.
2022-01-06 09:33:36 +01:00
Matthijs Mekking
f3e668d630 Add CHANGES and release note for GL #3049
This is a bugfix worth mentioning.
2022-01-06 09:33:35 +01:00
Matthijs Mekking
fbd559ad0d Update autosign test
Update the autosign system test with new expected behavior.

The 'nozsk.example' zone should have its expired zone signatures
deleted and replaced with signatures generated with the KSK.

The 'inaczsk.example' zone should have its expired zone signatures
deleted and replaced with signatures generated with the KSK.

In both scenarios, signatures are deleted, not retained, so the
"retaining signatures" warning should not be logged.

Furthermore, thsi commit fixex a test bug where the 'awk' command
always returned 0.

Finally, this commit adds a test case for an offline KSK, for the zone
'noksk.example'. In this case the expired signatures should be retained
(despite the zone being bogus, but resigning the DNSKEY RRset with the
ZSK won't help here).
2022-01-06 09:32:32 +01:00
Matthijs Mekking
beeefe35c4 Fix bug introduced by #763 related to offline keys
In some cases we want to keep expired signatures. For example, if the
KSK is offline, we don't want to fall back to signing with the ZSK.
We could remove the signatures, but in any case we end up with a broken
zone.

The change made for GL #763 prevented the behavior to sign the DNSKEY
RRset with the ZSK if the KSK was offline (and signatures were expired).

The change causes the definition of "having both keys": if one key is
offline, we still consider having both keys, so we don't fallback
signing with the ZSK if KSK is offline.

That change also works the other way, if the ZSK is offline, we don't
fallback signing with the KSK.

This commit fixes that, so we only fallback signing zone RRsets with
the KSK, not signing key RRsets with the ZSK.
2022-01-06 09:32:32 +01:00
Matthijs Mekking
2d2858841a Only warn if we could not delete signature
BIND can log this warning:

    zone example.ch/IN (signed): Key example.ch/ECDSAP256SHA256/56340
      missing or inactive and has no replacement: retaining signatures.

This log can happen when BIND tries to remove signatures because the
are about to expire or to be resigned. These RRsets may be signed with
the KSK if the ZSK files has been removed from disk. When we have
created a new ZSK we can replace the signatures creeated by the KSK
with signatures from the new ZSK.

It complains about the KSK being missing or inactive, but actually it
takes the key id from the RRSIG.

The warning is logged if BIND detects the private ZSK file is missing.

The warning is logged even if we were able to delete the signature.

With the change from this commit it only logs this warning if it is not
okay to delete the signature.
2022-01-06 09:32:32 +01:00
Ondřej Surý
bb76fb1937 Merge branch '3071-signed-version-of-an-inline-signed-zone-may-be-dumped-without-unsigned-serial-number-fix' into 'main'
Check unsigned serial number in signed zone files

Closes #3071

See merge request isc-projects/bind9!5692
2022-01-05 16:57:20 +00:00
Ondřej Surý
ff8d37cbdb Add CHANGES and release note for [GL #3071] 2022-01-05 17:53:49 +01:00
Ondřej Surý
5f36948176 Revert "Add CHANGES and release note for [GL #3071]"
This reverts commit 7a6365d02875ca1344013ad16ae2d33a51307bec.
2022-01-05 17:53:49 +01:00
Michał Kępień
ef625f5f06 Do not detach raw zone until dumping is complete
When the signed version of an inline-signed zone is dumped to disk, the
serial number of the unsigned version of the zone is stored in the
raw-format header so that the contents of the signed zone can be
resynchronized after named restart if the unsigned zone file is modified
while named is not running.

In order for the serial number of the unsigned zone to be determined
during the dump, zone->raw must be set to a non-NULL value.  This should
always be the case as long as the signed version of the zone is used for
anything by named.

However, a scenario exists in which the signed version of the zone has
zone->raw set to NULL while it is being dumped:

 1. Zone dump is requested; zone_dump() is invoked.

 2. Another zone dump is already in progress, so the dump gets deferred
    until I/O is available (see zonemgr_getio()).

 3. The last external reference to the zone is released.
    zone_shutdown() gets queued to the zone's task.

 4. I/O becomes available for zone dumping.  zone_gotwritehandle() gets
    queued to the zone's task.

 5. The zone's task runs zone_shutdown().  zone->raw gets set to NULL.

 6. The zone's task runs zone_gotwritehandle().  zone->raw is determined
    to be NULL, causing the serial number of the unsigned version of the
    zone to be omitted from the raw-format dump of the signed zone file.

Note that the naïve solution - deferring the dns_zone_detach() call for
zone->raw until zone_free() gets called for the secure version of the
zone - does not work because it leads to a chicken-and-egg problem when
the inline-signed zone is about to get freed: the raw zone holds a weak
reference to the secure zone and that reference does not get released
until the reference count for the raw zone reaches zero, which in turn
would not happen until all weak references to the secure zone were
released.

Defer detaching from zone->raw in zone_shutdown() if the zone is in the
process of being dumped to disk.  Ensure zone->raw gets detached from
after the dump is finished if detaching gets deferred.  Prevent zone
dumping from being requeued upon failure if the zone is in the process
of being cleaned up as it opens up possibilities for the zone->raw
reference to leak, triggering a shutdown hang.
2022-01-05 17:53:49 +01:00
Ondřej Surý
1064b2fc47 Revert "Ensure the correct ordering zone_shutdown() vs zone_gotwritehandle()"
This reverts commit cc1d4e1aa6.
2022-01-05 17:53:49 +01:00
Michał Kępień
ab49205af3 Check unsigned serial number in signed zone files
All signed zone files present in bin/tests/system/inline/ns8 should
contain the unsigned serial number in the raw-format header.  Add a
check to ensure that is the case.  Extend the dnssec-signzone command
line in ns8/sign.sh with the -L option to allow the zones initially
signed there to pass the newly added check.  Add another zone to the
configuration for the ns8 named instance to ensure the check also passes
when multiple zones are inline-signed by a single named instance.
2022-01-05 17:53:49 +01:00
Ondřej Surý
b65b5dbade Merge branch 'ondrej/reduce-the-memory-used-by-hazard-pointers' into 'main'
Reduce the memory used by hazard pointers

See merge request isc-projects/bind9!5635
2022-01-05 16:36:04 +00:00
Ondřej Surý
d026ddde82 Add unit test of aligned isc_mem functions
Add unit test that checks whether all the aligned functions work and
that allocators return memory aligned at the specified boundary.
2022-01-05 17:17:39 +01:00
Ondřej Surý
6269fce0fe Use isc_mem_get_aligned() for isc_queue and cleanup max_threads
The isc_queue_new() was using dirty tricks to allocate the head and tail
members of the struct aligned to the cacheline.  We can now use
isc_mem_get_aligned() to allocate the structure to the cacheline
directly.

Use ISC_OS_CACHELINE_SIZE (64) instead of arbitrary ALIGNMENT (128), one
cacheline size is enough to prevent false sharing.

Cleanup the unused max_threads variable - there was actually no limit on
the maximum number of threads.  This was changed a while ago.
2022-01-05 17:10:58 +01:00
Ondřej Surý
c84eb55049 Reduce the memory used by hazard pointers
The hazard pointers implementation was bit of frivolous with memory
usage allocating memory based on maximum constants rather than on the
usage.

Make the retired list bit use exactly the memory needed for specified
number of hazard pointers.  This reduced the memory used by hazard
pointers to one quarter in our specific case because we only use single
HP in the queue implementation (as opposed to allocating memory for
HP_MAX_HPS = 4).

Previously, the alignment to prevent false sharing was double the
cacheline size.  This was copied from the ConcurrencyFreaks
implementation, but one cacheline size is enough to prevent false
sharing, so we are using this now to save few bits of memory.

The top level hazard pointers and retired list arrays are now not
aligned to the cacheline size - they are read-only for the whole
life-time of the isc_hp object.  Only hp (hazard pointer) and
rl (retired list) array members are allocated aligned to the cacheline
size to avoid false sharing between threads.

Cleanup HP_MAX_HPS and HP_THRESHOLD_R constants from the paper, because
we don't use them in the code.  HP_THRESHOLD_R was 0, so the check
whether the retired list size was smaller than the value was basically a
dead code.
2022-01-05 17:10:58 +01:00
Ondřej Surý
c917a2ca88 Add isc_mem_*_aligned() function that works with aligned memory
There are some situations where having aligned allocations would be
useful, so we don't have to play tricks with padding the data to the
cacheline sizes.

Add isc_mem_{get,put,reget,putanddetach}_aligned() functions that has
alignment and size as last argument mimicking the POSIX posix_memalign()
functions on systems with jemalloc (see the documentation on
MALLOX_ALIGN() for more details).  On systems without jemalloc, those
functions are same as non-aligned variants.
2022-01-05 17:10:56 +01:00
Ondřej Surý
4f78f9d72a Add #define ISC_OS_CACHELINE_SIZE 64
Add library ctor and dtor for isc_os compilation unit which initializes
the numbers of the CPUs and also checks whether L1 cacheline size is
really 64 if the sysconf() call is available.
2022-01-05 17:07:35 +01:00
Ondřej Surý
55aa182ae6 Merge branch '2979-lock-view-while-accessing-its-zone-table' into 'main'
Lock view while accessing its zone table

Closes #2979

See merge request isc-projects/bind9!5676
2022-01-05 15:58:02 +00:00
Ondřej Surý
7624dc3ee4 Merge branch 'ondrej/fix-taskmgr-exiting-access' into 'main'
Fixup code related to the taskmgr shutdown

See merge request isc-projects/bind9!5690
2022-01-05 15:56:31 +00:00
Ondřej Surý
ab5b2ef43c Add isc_refcount_destroy() for dns_zt reference counters
The zt_destroy() function was missing isc_refcount_destroy() on the two
reference counters.  The isc_refcount_destroy() adds proper memory
ordering on destroy and also ensures that the reference counters have
been zeroed before destroying the object.
2022-01-05 16:56:16 +01:00
Ondřej Surý
f326d45135 Lock view while accessing its zone table
Commit 308bc46a59 introduced a change to
the view_flushanddetach() function which makes the latter access
view->zonetable without holding view->lock.  As confirmed by TSAN, this
enables races between threads for view->zonetable accesses.

Swap the view->zonetable pointer under view lock and then detach the
local swapped dns_zt_t later when the view lock is already unlocked.

This commit also changes the dns_zt interfaces, so the setting the
zonetable "flush" flag is separate operation to dns_zt_detach,
e.g. instead of doing:

    if (view->flush) {
        dns_zt_flushanddetach(&zt);
    } else {
        dns_zt_detach(&zt);
    }

the code is now:

    if (view->flush) {
        dns_zt_flush(zt);
    }
    dns_zt_detach(&zt);

making the code more consistent with how we handle flushing and
detaching dns_zone_t pointers from the view.
2022-01-05 16:56:16 +01:00
Ondřej Surý
e705f213ca Remove taskmgr->excl_lock, fix the locking for taskmgr->exiting
While doing code review, it was found that the taskmgr->exiting is set
under taskmgr->lock, but accessed under taskmgr->excl_lock in the
isc_task_beginexclusive().

Additionally, before the change that moved running the tasks to the
netmgr, the task_ready() subrouting of isc_task_detach() would lock
mgr->lock, requiring the mgr->excl to be protected mgr->excl_lock
to prevent deadlock in the code.  After !4918 has been merged, this is
no longer true, and we can remove taskmgr->excl_lock and use
taskmgr->lock in its stead.

Solve both issues by removing the taskmgr->excl_lock and exclusively use
taskmgr->lock to protect both taskmgr->excl and taskmgr->exiting which
now doesn't need to be atomic_bool, because it's always accessed from
within the locked section.
2022-01-05 16:44:57 +01:00
Ondřej Surý
f9d90159b8 On shutdown, return ISC_R_SHUTTINGDOWN from isc_taskmgr_excltask()
The isc_taskmgr_excltask() would return ISC_R_NOTFOUND either when the
exclusive task was not set (yet) or when the taskmgr is shutting down
and the exclusive task has been already cleared.

Distinguish between the two states and return ISC_R_SHUTTINGDOWN when
the taskmgr is being shut down instead of ISC_R_NOTFOUND.
2022-01-05 13:41:12 +01:00
Ondřej Surý
b2c9543a6e Merge branch '3074-catz-excl-task' into 'main'
Prevent a shutdown race in catz_create_chg_task()

Closes #3074

See merge request isc-projects/bind9!5687
2022-01-05 12:37:27 +00:00
Evan Hunt
81c09b005b Add CHANGES note for [GL #3074] 2022-01-05 13:15:40 +01:00
Evan Hunt
973ac1d891 Prevent a shutdown race in catz_create_chg_task()
If a catz event is scheduled while the task manager was being
shut down, task-exclusive mode is unavailable. This needs to be
handled as an error rather than triggering an assertion.
2022-01-05 12:48:40 +01:00
Matthijs Mekking
c2aeda6c99 Merge branch '3023-auto-dnssec-documentation-bug' into 'main'
Update auto-dnssec documentation

Closes #3023

See merge request isc-projects/bind9!5598
2022-01-05 11:26:14 +00:00
Matthijs Mekking
447fa2a816 Add CHANGES for #3023 2022-01-05 11:48:50 +01:00
Matthijs Mekking
aac39647f3 Update auto-dnssec documentation
Explain that 'auto-dnssec' may only be activated at zone level.
2022-01-05 11:48:26 +01:00
Ondřej Surý
a71be346c4 Merge branch '3071-signed-version-of-an-inline-signed-zone-may-be-dumped-without-unsigned-serial-number' into 'main'
Do not detach raw zone until dumping is complete

Closes #3071

See merge request isc-projects/bind9!5680
2022-01-05 09:32:25 +00:00
Ondřej Surý
4d71a3b309 Add CHANGES and release note for [GL #3071] 2022-01-05 10:29:15 +01:00
Michał Kępień
cc1d4e1aa6 Ensure the correct ordering zone_shutdown() vs zone_gotwritehandle()
When the signed version of an inline-signed zone is dumped to disk, the
serial number of the unsigned version of the zone is written in the
raw-format header so that the contents of the signed zone can be
resynchronized after named restart if the unsigned zone file is
modified while named is not running (see RT #26676).

In order for the serial number of the unsigned zone to be determined
during the dump, zone->raw must be set to a non-NULL value.  This
should always be the case as long as the signed version of the zone is
used for anything by named.

However, under certain circumstances the zone->raw could be set to NULL
while the zone is being dumped.

Defer detaching from zone->raw in zone_shutdown() if the zone is in the
process of being dumped to disk.
2022-01-05 10:27:55 +01:00
Evan Hunt
99af3fbeda Merge branch '3075-fix-tlsctx-detach' into 'main'
Ensure that cache pointer is set to NULL by isc_tlsctx_cache_detach()

Closes #3075

See merge request isc-projects/bind9!5686
2022-01-05 07:07:47 +00:00
Evan Hunt
61c160c4a5 Clean up isc_tlsctx_cache_detach()
For consistency with similar functions, rename `pcache` to `cachep`,
call a separate destroy function when references reach 0, and add
a missing call to isc_refcount_destroy().
2022-01-04 23:07:12 -08:00
Evan Hunt
f5074c0c8e Ensure that cache pointer is set to NULL by isc_tlsctx_cache_detach()
If the reference count was higher than 1, detaching a tlsctx cache
didn't clear the pointer, which could trigger an assertion later.
2022-01-04 11:48:25 -08:00
Michał Kępień
a1db2347d4 Merge branch '3032-include-isc-logo-in-source-tarballs' into 'main'
Include doc/arm/isc-logo.pdf in source tarballs

Closes #3032

See merge request isc-projects/bind9!5678
2022-01-04 13:43:07 +00:00
Michał Kępień
62be4f6b0e Include doc/arm/isc-logo.pdf in source tarballs
The doc/arm/conf.py Sphinx configuration file specifies
doc/arm/isc-logo.pdf as the logo to use in the PDF files produced.
Since doc/arm/isc-logo.pdf is not currently included in source tarballs
produced using "make dist", attempting to build documentation in PDF
format using a source tarball results in the following error being
raised:

    Sphinx error:
    logo file 'isc-logo.pdf' does not exist

Ensure doc/arm/isc-logo.pdf is included in source tarballs produced
using "make dist", so that the BIND 9 ARM can be successfully built in
PDF format using just the source tarball.
2022-01-04 14:37:52 +01:00
Michał Kępień
0bca8f0b2a Add a tarball-based documentation-building job
The existing "docs" GitLab CI job operates on a Git repository rather
than a source tarball.  This prevents it from detecting issues caused by
files missing from source tarballs.  Add a new GitLab CI job similar to
the "docs" one, but using a source tarball rather than a Git repository.
Extract YAML bits used by multiple job definitions into anchors to avoid
code duplication.  Drop the "allow_failure: false" key in the process as
it is the implicit default for non-manual jobs.  Replace the
"artifacts:paths" key with "artifacts:untracked" in order to include all
untracked files in the artifact archive for each documentation-building
job; this allows tarball-based artifacts to be properly captured and
also facilitates troubleshooting failed jobs.
2022-01-04 14:37:52 +01:00
Mark Andrews
1515d39f8c Merge branch '3065-memory-leak-on-duplicately-named-dnssec-policy' into 'main'
Resolve "memory leak on duplicately named dnssec-policy"

Closes #3065

See merge request isc-projects/bind9!5669
2022-01-03 21:45:01 +00:00
Mark Andrews
6de041f19c Add CHANGES for [GL #3065] 2022-01-03 11:49:27 -08:00
Mark Andrews
b8845454c8 Report duplicate dnssec-policy names
Duplicate dnssec-policy names were detected as an error condition
but were not logged.
2022-01-03 11:48:26 -08:00
Mark Andrews
694440e614 Address memory leak when processing dnssec-policy clauses
A kasp structure was not detached when looking to see if there
was an existing kasp structure with the same name, causing memory
to be leaked.  Fixed by calling dns_kasp_detach() to release the
reference.
2022-01-03 11:47:33 -08:00
Michal Nowak
441b251207 Merge branch 'mnowak/drop-xmllint-check-from-misc-ci-job' into 'main'
Drop xmllint check from misc CI job

See merge request isc-projects/bind9!5684
2022-01-03 15:47:00 +00:00
Michal Nowak
1f64be2811 Drop xmllint check from misc CI job
There are no XML or docbook files in the "main" source tree to be
checked and the xmllint command just prints out a usage message.
2022-01-03 15:51:36 +01:00
Michal Nowak
a6bde9612b Merge branch 'mnowak/year-2022' into 'main'
Update copyrights to 2022

See merge request isc-projects/bind9!5681
2022-01-03 14:50:33 +00:00
Michal Nowak
befd654e00 Update copyrights to 2022 2022-01-03 10:53:28 +01:00
Michał Kępień
ae7ba926d4 Merge branch '2782-set-version-and-release-variables-in-conf.py' into 'main'
Set version and release variables in conf.py

Closes #2782

See merge request isc-projects/bind9!5205
2021-12-29 09:02:10 +00:00
Michał Kępień
e67cdb390a Clarify use of the "today" Sphinx variable
Add a comment explaining the purpose of setting the "today" variable in
Sphinx invocations to prevent confusion caused by the absence of that
variable from reStructuredText sources.

Drop the -A command-line option from the sphinx-build invocation for
EPUB output as "today" is already set in the ALLSPHINXOPTS variable.
2021-12-29 09:58:48 +01:00
Michał Kępień
38d251e11b Set version and release variables in conf.py
Some Sphinx variables used in the ARM are only set in Makefile.docs.
This works fine when building the ARM using "make", but does not work
with Read the Docs, which only looks at conf.py files.

Since Read the Docs does not run ./configure, renaming conf.py to
conf.py.in and using Autoconf output variables is not a feasible
solution.

Instead, extend doc/arm/conf.py with some Python code which processes
configure.ac using regular expressions and sets the relevant Sphinx
variables accordingly.  As this solution also works fine when building
the ARM using "make", drop the relevant -D options from the list of
sphinx-build options used for building the ARM in Makefile.docs.

Note that the man_SPHINXOPTS counterparts of the removed -D switches are
left intact because doc/man/conf.py is a separate Sphinx project which
is only processed using "make" and duplicating the Python code added to
doc/arm/conf.py by this commit would be inelegant.
2021-12-29 09:58:48 +01:00
Artem Boldariev
3addc36533 Merge branch 'artem-tlsctx-caching' into 'main'
Add TLS context cache

Closes #3067

See merge request isc-projects/bind9!5672
2021-12-29 08:58:10 +00:00
Artem Boldariev
cb330c432d Add a CHANGES entry [GL !5672]
Mention that TLS contexts reuse was implemented.
2021-12-29 10:25:16 +02:00
Artem Boldariev
64f7c55662 Use the TLS context cache for client-side contexts (XoT)
This commit enables client-side TLS contexts re-use for zone transfers
over TLS. That, in turn, makes it possible to use the internal session
cache associated with the contexts, allowing the TLS connections to be
established faster and requiring fewer resources by not going through
the full TLS handshake procedure.

Previously that would recreate the context on every connection, making
TLS session resumption impossible.

Also, this change lays down a foundation for Strict TLS (when the
client validates a server certificate), as the TLS context cache can
be extended to store additional data required for validation (like
intermediates CA chain).
2021-12-29 10:25:15 +02:00
Artem Boldariev
5b7d4341fe Use the TLS context cache for server-side contexts
Using the TLS context cache for server-side contexts could reduce the
number of contexts to initialise in the configurations when e.g. the
same 'tls' entry is used in multiple 'listen-on' statements for the
same DNS transport, binding to multiple IP addresses.

In such a case, only one TLS context will be created, instead of a
context per IP address, which could reduce the initialisation time, as
initialising even a non-ephemeral TLS context introduces some delay,
which can be *visually* noticeable by log activity.

Also, this change lays down a foundation for Mutual TLS (when the
server validates a client certificate, additionally to a client
validating the server), as the TLS context cache can be extended to
store additional data required for validation (like intermediates CA
chain).

Additionally to the above, the change ensures that the contexts are
not being changed after initialisation, as such a practice is frowned
upon. Previously we would set the supported ALPN tags within
isc_nm_listenhttp() and isc_nm_listentlsdns(). We do not do that for
client-side contexts, so that appears to be an overlook. Now we set
the supported ALPN tags right after server-side contexts creation,
similarly how we do for client-side ones.
2021-12-29 10:25:14 +02:00
Artem Boldariev
eb37d967c2 Add TLS context cache
This commit adds a TLS context object cache implementation. The
intention of having this object is manyfold:

- In the case of client-side contexts: allow reusing the previously
created contexts to employ the context-specific TLS session resumption
cache. That will enable XoT connection to be reestablished faster and
with fewer resources by not going through the full TLS handshake
procedure.

- In the case of server-side contexts: reduce the number of contexts
created on startup. That could reduce startup time in a case when
there are many "listen-on" statements referring to a smaller amount of
`tls` statements, especially when "ephemeral" certificates are
involved.

- The long-term goal is to provide in-memory storage for additional
data associated with the certificates, like runtime
representation (X509_STORE) of intermediate CA-certificates bundle for
Strict TLS/Mutual TLS ("ca-file").
2021-12-29 10:25:11 +02:00
Michał Kępień
c6dffa3e09 Merge branch 'michal/fix-error-codes-passed-to-connection-callbacks' into 'main'
Fix error codes passed to connection callbacks

See merge request isc-projects/bind9!5675
2021-12-28 15:14:11 +00:00
Michał Kępień
ea89ab80ae Fix error codes passed to connection callbacks
Commit 9ee60e7a17 erroneously introduced
duplicate conditions to several existing conditional statements
responsible for determining error codes passed to connection callbacks
upon failure.  Fix the affected expressions to ensure connection
callbacks are invoked with:

  - the ISC_R_SHUTTINGDOWN error code when a global netmgr shutdown is
    in progress,

  - the ISC_R_CANCELED error code when a specific operation has been
    canceled.

This does not fix any known bugs, it only adjusts the changes introduced
by commit 9ee60e7a17 so that they match
its original intent.
2021-12-28 15:09:50 +01:00
Michał Kępień
cb22ed0492 Merge branch '3068-fix-rare-control-channel-socket-reference-leak' into 'main'
Fix rare control channel socket reference leak

Closes #3068

See merge request isc-projects/bind9!5673
2021-12-28 12:42:45 +00:00
Michał Kępień
fc678b19d9 Fix rare control channel socket reference leak
Commit 9ee60e7a17 enabled netmgr shutdown
to cause read callbacks for active control channel sockets to be invoked
with the ISC_R_SHUTTINGDOWN result code.  However, control channel code
only recognizes ISC_R_CANCELED as an indicator of an in-progress netmgr
shutdown (which was correct before the above commit).  This discrepancy
enables the following scenario to happen in rare cases:

 1. A control channel request is received and responded to.  libuv
    manages to write the response to the TCP socket, but the completion
    callback (control_senddone()) is yet to be invoked.

 2. Server shutdown is initiated.  All TCP sockets are shut down, which
    i.a. causes control_recvmessage() to be invoked with the
    ISC_R_SHUTTINGDOWN result code.  As the result code is not
    ISC_R_CANCELED, control_recvmessage() does not set
    listener->controls->shuttingdown to 'true'.

 3. control_senddone() is called with the ISC_R_SUCCESS result code.  As
    neither listener->controls->shuttingdown is 'true' nor is the result
    code ISC_R_CANCELED, reading is resumed on the control channel
    socket.  However, this read can never be completed because the read
    callback on that socket was cleared when the TCP socket was shut
    down.  This causes a reference on the socket's handle to be held
    indefinitely, leading to a hang upon shutdown.

Ensure listener->controls->shuttingdown is also set to 'true' when
control_recvmessage() is invoked with the ISC_R_SHUTTINGDOWN result
code.  This ensures the send completion callback does not resume reading
after the control channel socket is shut down.
2021-12-28 08:36:01 +01:00
Michal Nowak
ab52c99843 Merge branch 'mnowak/make-debian-11-bullseye-base-image' into 'main'
Make bullseye the base image

See merge request isc-projects/bind9!5367
2021-12-23 14:41:45 +00:00
Michal Nowak
4d7e343813 Use /dev/urandom as BIND 9.11 randomness source
This prevents resolver timeouts for the reference (BIND 9.11) servers
used in respdiff tests run on Debian 11 "bullseye".
2021-12-23 11:37:59 +01:00
Michal Nowak
910d595fbc Make bullseye the base image
"buster" jobs are now only going to be run in scheduled pipelines.

"--without-gssapi" ./configure option of "bullseye" before it became
the base image is dropped from "bullseye"-the-base-image because it
reduces gcov coverage by 0.38 % (651 lines) and is used in Debian 9
"stretch".
2021-12-23 11:37:59 +01:00
Mark Andrews
3959776b02 Merge branch '3041-decide-what-to-do-with-reject-000-and-other-obscure-options-for-synth-from-dnssec-feature' into 'main'
remove reject-000 and broken-nsec options (related to synth-from-dnssec feature)

Closes #3041

See merge request isc-projects/bind9!5621
2021-12-23 05:14:50 +00:00
Mark Andrews
dc8595936c remove broken-nsec and reject-000-label options 2021-12-23 15:13:46 +11:00
Michał Kępień
7289896043 Merge branch 'rhbz/fedora/2032704' into 'main'
Avoid conflict with ldap_connect function of openldap

See merge request isc-projects/bind9!5665
2021-12-22 21:14:22 +00:00
Petr Mensik
7bce3e7791 Change all internal functions to dlz_ldap prefix
To prevent any conflict in the future, avoid ldap_ prefix in any
internal functions. Keep it reserved for openldap only.
2021-12-22 22:10:05 +01:00
Petr Mensik
49e523e56f Avoid conflict with ldap_connect function of openldap
ldap_connect is defined by OpenLDAP 2.6. Compiler complains there are
conflicting declarations. Use dlz_ldap prefix instead of ldap to avoid
conflict.
2021-12-22 22:10:05 +01:00
Michał Kępień
43d300ddaf Merge branch '2723-add-SSLKEYLOGFILE-support' into 'main'
Add SSLKEYLOGFILE support

Closes #2723

See merge request isc-projects/bind9!5661
2021-12-22 20:08:46 +00:00
Michał Kępień
35eca53647 Add CHANGES entry for GL #2723 2021-12-22 18:17:26 +01:00
Michał Kępień
9c7c48600a Add release note for GL #2723 2021-12-22 18:17:26 +01:00
Michał Kępień
e65f9b60dd Document SSLKEYLOGFILE handling
Add a section to the ARM explaining how to set the SSLKEYLOGFILE
environment variable in order to prepare a key log file for debugging
purposes.
2021-12-22 18:17:26 +01:00
Michał Kępień
9e81903171 Set up default logging for SSLKEYLOGFILE
A customary method of exporting TLS pre-master secrets used by a piece
of software (for debugging purposes, e.g. to examine decrypted traffic
in a packet sniffer) is to set the SSLKEYLOGFILE environment variable to
the path to the file in which this data should be logged.

In order to enable writing any data to a file using the logging
framework provided by libisc, a logging channel needs to be defined and
the relevant logging category needs to be associated with it.  Since the
SSLKEYLOGFILE variable is only expected to contain a path, some defaults
for the logging channel need to be assumed.  Add a new function,
named_log_setdefaultsslkeylogfile(), for setting up those implicit
defaults, which are equivalent to the following logging configuration:

    channel default_sslkeylogfile {
        file "${SSLKEYLOGFILE}" versions 10 size 100m suffix timestamp;
    };

    category sslkeylog {
    	default_sslkeylogfile;
    };

This ensures TLS pre-master secrets do not use up more than about 1 GB
of disk space, which should be enough to hold debugging data for the
most recent 1 million TLS connections.

As these values are arguably not universally appropriate for all
deployment environments, a way for overriding them needs to exist.
Suppress creation of the default logging channel for TLS pre-master
secrets when the SSLKEYLOGFILE variable is set to the string "config".
This enables providing custom logging configuration for the relevant
category via the "logging" stanza.  (Note that it would have been
simpler to only skip setting up the default logging channel for TLS
pre-master secrets if the SSLKEYLOGFILE environment variable is not set
at all.  However, libisc only logs pre-master secrets if that variable
is set.  Detecting a "magic" string enables the SSLKEYLOGFILE
environment variable to serve as a single control for both enabling TLS
pre-master secret collection and potentially also indicating where and
how they should be exported.)
2021-12-22 18:17:26 +01:00
Michał Kępień
7983d5fa7c Check for SSL_CTX_set_keylog_callback() support
The SSL_CTX_set_keylog_callback() function is a fairly recent OpenSSL
addition, having first appeared in version 1.1.1.  Add a configure.ac
check for the availability of that function to prevent build errors on
older platforms.  Sort similar checks alphabetically.

This makes the SSLKEYLOGFILE mechanism a silent no-op on unsupported
platforms, which is considered acceptable for a debugging feature.
2021-12-22 18:17:26 +01:00
Michał Kępień
060fed3097 Log TLS pre-master secrets when requested
Generate log messages containing TLS pre-master secrets when the
SSLKEYLOGFILE environment variable is set.  This only ensures such
messages are prepared using the right logging category and passed to
libisc for further processing.

The TLS pre-master secret logging callback needs to be set on a
per-context basis, so ensure it happens for both client-side and
server-side TLS contexts.
2021-12-22 18:17:26 +01:00
Michał Kępień
3081bda798 Add a logging category for TLS pre-master secrets
TLS pre-master secrets will be dumped to disk using the logging
framework provided by libisc.  Add a new logging category for this type
of debugging data in order to enable exporting it to a dedicated
channel.  Derive the name of the new category from the name of the
relevant environment variable, SSLKEYLOGFILE.
2021-12-22 18:17:26 +01:00
Michal Nowak
d7c5d09123 Merge branch 'mnowak/respdiff-job-dependency-fix' into 'main'
Execute respdiff jobs out-of-order

See merge request isc-projects/bind9!5664
2021-12-22 14:18:44 +00:00
Michal Nowak
87578efc71 Execute respdiff jobs out-of-order
Commit 2ececf2c dropped dependency of "respdiff" and
"respdiff-third-party" jobs on "tarball-create" job because these jobs
don't need to depend on in (e.g., for its artifacts). This, however,
caused that respdiff jobs weren't started out-of-order and artifacts
from all the "Build" stage jobs plus "unit:gcc:buster:amd64" job were
downloaded to project directory and caused problems with compilation:

Originally, the dependency on "tarball-create" has been added in
04f8b65a to indicate that respdiff "is meant to operate on two different
BIND versions". It seems that the intent didn't work out, and we better
make it obvious that respdiff jobs don't depend on any other job and
should be run out-of-order.
2021-12-22 14:44:51 +01:00
Michal Nowak
077f024c14 Merge branch 'mnowak/freebsd-12.3' into 'main'
Add FreeBSD 12.3

See merge request isc-projects/bind9!5619
2021-12-20 15:58:38 +00:00
Michal Nowak
a4d8571fa2 Add FreeBSD 12.3 2021-12-20 13:59:04 +01:00
Artem Boldariev
1413217fda Merge branch 'artem-doth-reconfig-fix' into 'main'
Fix flakiness in the doth reconfig test

See merge request isc-projects/bind9!5656
2021-12-20 12:46:44 +00:00
Artem Boldariev
84b2141e69 doth system test: reduce number of contexts in ns3
This commit removes unused listen-on statements from the ns3 instance
in order to reduce the startup time. That should help with occasional
system test initialisation hiccups in the CI which happen because the
required instances cannot initialise in time.
2021-12-20 14:28:53 +02:00
Artem Boldariev
2e5f9a0df5 Fix flakiness in the doth reconfig test
Due to the fact that the primary nameserver creates a lot of TLS
contexts, its reconfiguration could take too much time on the CI,
leading to spurious test failures, while in reality it works just
fine.

This commit adds a separate instance for this test which does not use
ephemeral keys (these are costly to generate) and creates minimal
amount of TLS contexts.
2021-12-20 14:28:53 +02:00
Arаm Sаrgsyаn
0ad79ab51c Merge branch '2264-tls-ephemeral-rsa-to-ecc' into 'main'
Use ECDSA P-256 instead of 4096-bit RSA for 'tls ephemeral'

Closes #2264

See merge request isc-projects/bind9!5627
2021-12-20 12:10:42 +00:00
Aram Sargsyan
7ae4bc7710 Add CHANGES for [GL #2264] 2021-12-20 10:09:40 +00:00
Aram Sargsyan
5d87725fdc Use ECDSA P-256 instead of 4096-bit RSA for 'tls ephemeral'
ECDSA P-256 performs considerably better than the previously used
4096-bit RSA (can be observed using `openssl speed`), and, according
to RFC 6605, provides a security level comparable to 3072-bit RSA.
2021-12-20 10:09:05 +00:00
Michal Nowak
4a33c43d1f Merge branch 'mnowak/add-fedora-35' into 'main'
Add Fedora 35

See merge request isc-projects/bind9!5554
2021-12-17 14:37:56 +00:00
Michal Nowak
668be42965 Add Fedora 35 2021-12-17 15:34:46 +01:00
Ondřej Surý
cbfd092f0d Merge branch 'ondrej/simplify-address-sanitizer-use-in-mem.c' into 'main'
Simplify Address Sanitizer tweaks in mem.c

See merge request isc-projects/bind9!5643
2021-12-17 14:25:54 +00:00
Ondřej Surý
ee1f8b60c5 Simplify Address Sanitizer tweaks in mem.c
Previously, whole isc_mempool_get() and isc_mempool_set() would be
replaced by simpler version when run with address sanitizer.

Change the code to limit the fillcount to 1 and freemax to 0.  This
change will make isc_mempool_get() to always allocate and use a single
new item and isc_mempool_put() will always return the item to the
allocator.
2021-12-17 14:43:05 +01:00
Michal Nowak
88bce03b93 Merge branch 'mnowak/drop-freebsd-11' into 'main'
Drop FreeBSD 11

See merge request isc-projects/bind9!5606
2021-12-17 11:48:34 +00:00
Michal Nowak
981579f379 Drop FreeBSD 11
Support for FreeBSD 11.4, the last FreeBSD 11.x release, ended on
September 30, 2021.

The "--with-readline" ./configure option has been added to gcc:sid:amd64
CI job; otherwise, it would be lost with the FreeBSD 11 removal.

Link: https://www.freebsd.org/security/unsupported/
2021-12-17 12:40:48 +01:00
Mark Andrews
7020e2b457 Merge branch '3057-evp_digestsignfinal-needs-the-buffer-length-passed-in' into 'main'
Resolve "EVP_DigestSignFinal needs the buffer length passed in"

Closes #3057

See merge request isc-projects/bind9!5642
2021-12-17 10:27:41 +00:00
Mark Andrews
7b4bff7947 Add CHANGES for [GL #3057] 2021-12-17 20:31:35 +11:00
Mark Andrews
a23507c4fa Pass the digest buffer length to EVP_DigestSignFinal
OpenSSL 3.0.1 does not accept 0 as a digest buffer length when
calling EVP_DigestSignFinal as it now checks that the digest buffer
length is large enough for the digest.  Pass the digest buffer
length instead.
2021-12-17 20:28:01 +11:00
Michal Nowak
9e77e51f72 Merge branch 'mnowak/alpine-3.15' into 'main'
Add Alpine Linux 3.15

See merge request isc-projects/bind9!5595
2021-12-16 15:52:18 +00:00
Michal Nowak
d43127a387 Add Alpine Linux 3.15 2021-12-16 16:43:00 +01:00
Petr Špaček
102c77d6ec Merge branch 'pspacek/ci-api-triggers' into 'main'
Enable regular pipeline jobs to be triggered from Gitlab API

See merge request isc-projects/bind9!5648
2021-12-16 15:00:29 +00:00
Petr Špaček
eb8c8753ad Enable regular pipeline jobs to be triggered from Gitlab API 2021-12-16 15:55:07 +01:00
Petr Špaček
5039a636f0 Merge branch 'v9_17_21-release' into 'main'
Merge 9.17.21 release branch

See merge request isc-projects/bind9!5644
2021-12-16 12:22:45 +00:00
Petr Špaček
3c21d8d499 Set up release notes for BIND 9.17.22 2021-12-16 13:17:13 +01:00
Petr Špaček
c0c023c49a Update BIND version to 9.17.21 2021-12-16 13:17:13 +01:00
Petr Špaček
884d86e754 Add a CHANGES marker 2021-12-16 13:17:13 +01:00
Petr Špaček
e7e18792ba Merge branch 'michal/prepare-documentation-for-bind-9.17.21' into 'v9_17_21-release'
Prepare documentation for BIND 9.17.21

See merge request isc-private/bind9!338
2021-12-16 13:17:12 +01:00
Michał Kępień
7d42bee183 Prepare release notes for BIND 9.17.21 2021-12-16 13:17:12 +01:00
Michał Kępień
513dfd4fcc Reorder release notes 2021-12-16 13:17:12 +01:00
Michał Kępień
a8d5fd88e3 Mention GL #3040 in the release notes 2021-12-16 13:17:12 +01:00
Michał Kępień
da1e73cd4d Add release note for GL #853 2021-12-16 13:17:12 +01:00
Michał Kępień
413e369137 Tweak and reword release notes 2021-12-16 13:17:12 +01:00
Michał Kępień
2c628b792c Tweak recent additions to the ARM 2021-12-16 13:17:07 +01:00
Michal Nowak
135c324311 Merge branch 'mnowak/respdiff-add-third-party-server-support' into 'main'
Add respdiff jobs with third-party recursors

See merge request isc-projects/bind9!5355
2021-12-16 11:51:46 +00:00
Michal Nowak
2ececf2c02 Add respdiff job with third-party recursors
The order of directories with reference and test BIND 9 are now reversed
for respdiff.sh.

Drop unnecessary dependency on the tarball-create job.

The data.mdb file has more than 10 GB and makes artifact download take
an unnecessarily long time.
2021-12-16 11:39:16 +01:00
Ondřej Surý
ce2cad5d65 Merge branch '2398-adjust-the-dns_message-mempools' into 'main'
Reduce freemax values for dns_message mempools

Closes #2398

See merge request isc-projects/bind9!5646
2021-12-15 20:43:00 +00:00
Ondřej Surý
72cc25465f Reduce freemax values for dns_message mempools
It was discovered that NAME_FREEMAX and RDATASET_FREEMAX was based on
the NAME_FILLCOUNT and RDATASET_FILLCOUNT respectively multiplied by 8
and then when used in isc_mempool_setfreemax, the value would be again
multiplied by 32.

Keep the 8 multiplier in the #define and remove the 32 multiplier as it
was kept in error.  The default fillcount can fit 99.99% of the requests
under normal circumstances, so we don't need to keep that many free
items on the mempool.
2021-12-15 21:25:00 +01:00
Artem Boldariev
ada8c28fd4 Merge branch '3055-examine-netlink-messages' into 'main'
Resolve #3055 by examining RTM_NEWADDR, RTM_DELADDR messages contents

Closes #3056 and #3055

See merge request isc-projects/bind9!5638
2021-12-15 18:04:25 +00:00
Artem Boldariev
923a9a33fe Modify CHANGES [GL #3055]
Mention that we try to avoid spurious interface re-scans on Linux.
2021-12-15 09:46:06 -08:00
Evan Hunt
df2ddc9e7e remove ns_interface reference counting
reference counting of ns_interface objects has not been used
since the clientmgr cleanup in #2433, and it no longer really
makes sense now - when we want to destroy an interface on a
rescan, we want it to be destroyed, not kept active by some
other caller. so ns_interface_attach() has been removed,
ns_interface_detach() has been replaced with a static
interface_destroy(), and do_scan() has been simplified
accordingly.
2021-12-15 09:46:06 -08:00
Evan Hunt
6df5cf1ee6 keep track of non-listening interfaces
previously, if "listen-on-v6" was set to "none", then every
time a scan saw an IPv6 address it would appear to be a new
one.  this commit retains all known interfaces in a list
and sets a flag in the ones that are listening, so that
configured interfaces that have been seen before will be
recognized as such.

as an incidental fix, the ns__interfacemgr_getif() and _nextif()
functions have been removed since they were never used.
2021-12-15 09:46:06 -08:00
Artem Boldariev
fb4e1ed5b2 Examine RTM_NEWADDR, RTM_DELADDR messages contents
This commit modifies the NetLink handling code in such a way
that the contents of the messages we are interested in is checked
for the local addresses changes only. This helps to avoid spurious
interface re-scans.

The 'route_recv' log messages are also reduced from DEBUG(3) to
DEBUG(9).
2021-12-15 09:46:06 -08:00
Ondřej Surý
4861f7d76e Merge branch 'ondrej/fix-isc_mem_setname-usage' into 'main'
Set the clientmgr isc_mem_t context name

See merge request isc-projects/bind9!5639
2021-12-14 19:46:00 +00:00
Ondřej Surý
ce75d4a96b Set the clientmgr isc_mem_t context name
The memory context created in the clientmgr context was missing a name,
so it was nameless in the memory context statistics.

Set the clientmgr memory context name to "clientmgr".
2021-12-14 19:15:58 +00:00
Michal Nowak
11ab4ffb42 Merge branch '2886-drop-cppcheck' into 'main'
Drop cppcheck

Closes #2886 and #2698

See merge request isc-projects/bind9!5574
2021-12-14 14:07:57 +00:00
Michal Nowak
7c88292e45 Add CHANGES note for [GL #2886] 2021-12-14 15:03:56 +01:00
Michal Nowak
9c013f37d0 Drop cppcheck workarounds
As cppcheck was removed from the CI, associated workarounds and
suppressions are not required anymore.
2021-12-14 15:03:56 +01:00
Michal Nowak
654cc61bb9 Drop cppcheck CI job
Every cppcheck update brings the cost of addressing new false positives
in the BIND 9 source code while not reaping any benefits in case of
identified issues with the code.
2021-12-14 15:03:55 +01:00
Arаm Sаrgsyаn
ec3f58eee0 Merge branch '3056-interface-scan-tls-https-recreate-only-when-reconfiguring' into 'main'
Recreate HTTPS and TLS interfaces only during reconfiguration

Closes #3056

See merge request isc-projects/bind9!5636
2021-12-14 13:28:54 +00:00
Aram Sargsyan
f595a75cd6 Recreate HTTPS and TLS interfaces only during reconfiguration
The 850e9e59bf commit intended to recreate
the HTTPS and TLS interfaces during reconfiguration, but they are being
recreated also during regular interface re-scans.

Make sure the HTTPS and TLS interfaces are being recreated only during
reconfiguration.
2021-12-14 09:28:01 +00:00
Arаm Sаrgsyаn
f999d8f3f5 Merge branch '3053-tls-listeners-recreate-on-reconfiguration' into 'main'
Recreate TLS interfaces during reconfiguration

Closes #3053

See merge request isc-projects/bind9!5634
2021-12-13 11:06:09 +00:00
Aram Sargsyan
1bc60caaa0 Add system test for checking TLS interfaces after a reconfiguration 2021-12-13 10:19:57 +00:00
Aram Sargsyan
e2460a1b58 Add CHANGES for [GL #3053] 2021-12-13 10:19:57 +00:00
Aram Sargsyan
850e9e59bf Recreate TLS interfaces during reconfiguration
For DoH and DoT listeners, a reconfiguration event triggers a creation
of a new 'SSL_CTX' TLS context, and a destruction of the old one.

The network manager, though, keeps using the old context which causes
errors.

During interface scanning, when a matching existing interface is found,
reuse it only when it doesn't have a TLS context, otherwise shut it down
and recreate with a new TLS context.
2021-12-13 10:19:57 +00:00
Matthijs Mekking
e256a17070 Merge branch 'matthijs/pemensik-bug-main-isdir-error-rhbz490837' into 'main'
Improve error message when directory name is given

See merge request isc-projects/bind9!5633
2021-12-10 10:24:54 +00:00
Petr Menšík
929bbe192d Improve error message when directory name is given
Surprising error IO error is returned when directory name
is given instead of named.conf file. It can be passed to named-checkconf
or include statement. Make a simple change to return Invalid file
instead. Still not precise, but much better error message is returned.

Fix of rhbz#490837.
2021-12-10 10:50:21 +01:00
Michał Kępień
a181b556f0 Merge branch 'michal/remove-mutex-profiling-code' into 'main'
Remove mutex profiling code

See merge request isc-projects/bind9!5629
2021-12-09 13:47:44 +00:00
Michał Kępień
eb4713c8e5 Remove mutex debugging code
Mutex debugging code (used when the ISC_MUTEX_DEBUG preprocessor macro
is set to 1 and PTHREAD_MUTEX_ERRORCHECK is defined) has been broken for
the past 3 years (since commit 2f3eee5a4f)
and nobody complained, which is a strong indication that this code is
not being used these days any more.  External tools for detecting
locking issues are already wired into various GitLab CI checks.  Drop
all code depending on the ISC_MUTEX_DEBUG preprocessor macro being set.
2021-12-09 14:02:36 +01:00
Michał Kępień
0964a94ad5 Remove mutex profiling code
Mutex profiling code (used when the ISC_MUTEX_PROFILE preprocessor macro
is set to 1) has been broken for the past 3 years (since commit
0bed9bfc28) and nobody complained, which
is a strong indication that this code is not being used these days any
more.  External tools for both measuring performance and detecting
locking issues are already wired into various GitLab CI checks.  Drop
all code depending on the ISC_MUTEX_PROFILE preprocessor macro being
set.
2021-12-09 12:25:21 +01:00
Evan Hunt
ea0b5dbd5d Merge branch '3042-tcp-hang' into 'main'
prevent a shutdown hang on non-matching TCP responses

Closes #3042

See merge request isc-projects/bind9!5616
2021-12-08 18:48:34 +00:00
Evan Hunt
2dd97e2c6a CHANGES for [GL #3042] 2021-12-08 10:22:25 -08:00
Evan Hunt
2f3ded7652 add system test for a no-questions reply over TCP 2021-12-08 10:22:03 -08:00
Evan Hunt
157d7bd0e9 incidental cleanups
the 'dipsatchmgr->state' was never set, so the MGR_IS_SHUTTINGDOWN
macro was always false. both of these have been removed.

renamed the 'dispatch->state' field to 'tcpstate' to make its purpose
less ambiguous.

changed an FCTXTRACE log message from "response did not match question"
to the more correctly descriptive "invalid question section".
2021-12-08 10:22:03 -08:00
Evan Hunt
5f82fc11a9 prevent a shutdown hang on non-matching TCP responses
When a non-matching DNS response is received by the resolver,
it calls dns_dispatch_getnext() to resume reading. This is necessary
for UDP but not for TCP, because TCP connections automatically
resume reading after any valid DNS response.

This commit adds a 'tcpreading' flag to TCP dispatches, so that
`dispatch_getnext()` can be called multiple times without subsequent
calls having any effect.
2021-12-08 10:22:03 -08:00
Ondřej Surý
0059433106 Merge branch '3051-missing-destroy-for-pthread-primitives' into 'main'
Stop leaking mutex in nmworker and cond in nm socket

Closes #3051

See merge request isc-projects/bind9!5622
2021-12-08 17:17:17 +00:00
Ondřej Surý
dff5888d9b Add CHANGES and release not for [GL #3051] 2021-12-08 17:58:53 +01:00
Ondřej Surý
57d0fabadd Stop leaking mutex in nmworker and cond in nm socket
On FreeBSD, the pthread primitives are not solely allocated on stack,
but part of the object lives on the heap.  Missing pthread_*_destroy
causes the heap memory to grow and in case of fast lived object it's
possible to run out-of-memory.

Properly destroy the leaking mutex (worker->lock) and
the leaking condition (sock->cond).
2021-12-08 17:58:53 +01:00
Ondřej Surý
9321481106 Merge branch '3048-fix-isc_hp-initialization' into 'main'
Fix the isc_hp initialization and memory usage

Closes #3048

See merge request isc-projects/bind9!5620
2021-12-08 16:33:40 +00:00
Ondřej Surý
c6f3e12fe7 Reduce the number of hazard pointers
Previously, we set the number of the hazard pointers to be 4 times the
number of workers because the dispatch ran on the old socket code.
Since the old socket code was removed there's a smaller number of
threads, namely:

 - 1 main thread
 - 1 timer thread
 - <n> netmgr threads
 - <n> threadpool threads

Set the number of hazard pointers to 2 + 2 * workers.
2021-12-07 21:12:53 +01:00
Ondřej Surý
15ce1737fa Fix the isc_hp initialization and memory usage
Previously, the isc_hp_init() could not lower the value of
isc__hp_max_threads, but because of a mistake the isc__hp_max_threads
would be set to HP_MAX_THREADS (e.g. 128 threads) thus it would be
always set to 128.  This would result in increased memory usage even
when small number of workers were in use.

Change the default value of isc__hp_max_threads to be 1.

Additionally, enforce the max_hps value in isc_hp_new() to be smaller or
equal to HP_MAX_HPS.  The only user is isc_queue which uses just 1
hazard pointer, so it's only theoretical issue.
2021-12-07 20:41:46 +01:00
Petr Špaček
5e69cd6329 Merge branch '1265-deprecate-broken-nsec' into 'main'
Mark broken-nsec option as deprecated

See merge request isc-projects/bind9!5618
2021-12-06 16:06:25 +00:00
Petr Špaček
74d83910d5 Mark broken-nsec option as deprecated
It's unclear if we are going to keep it or not, so let's mark it as
deprecated for a good measure. It's easier to un-deprecate it than the
other way around.
2021-12-06 16:55:55 +01:00
Michał Kępień
236a19ce40 Merge branch '3040-restore-the-fetch-context-expiry-timer' into 'main'
Restore the fetch context expiry timer

Closes #3040

See merge request isc-projects/bind9!5612
2021-12-03 09:07:27 +00:00
Evan Hunt
3a52250286 CHANGES for [GL #3040] 2021-12-03 09:51:06 +01:00
Evan Hunt
4d4cea243a restore the fetch lifetime timer
the lifetime expiry timer for the fetch context was removed
when we switched to using in-band netmgr timeouts. however,
it turns out some dependency loops can occur between a fetch
and the ADB the validator; these deadlocks were formerly broken
when the timer fired, and now there's no timer. we can fix these
errors individually, but in the meantime we don't want the server
to get hung at shutdown because of dangling fetches.

this commit puts back a single timer, which fires two seconds
after the fetch should have completed, and shuts it down. it also
logs a message at level INFO so we know about the problems when
they occur.
2021-12-03 09:49:24 +01:00
Petr Špaček
9f790f75b4 Merge branch '1265-bind-9-14-option-synth-from-dnssec-causing-high-cpu-consumption-and-degraded-client-experience' into 'main'
Rework rbtdb.c:find_coveringnsec to use shadow NSEC tree

Closes #1265

See merge request isc-projects/bind9!5446
2021-12-02 13:52:40 +00:00
Petr Špaček
d24dab6430 Clarify that NSEC3 is not supported by synth-from-dnssec yet 2021-12-02 14:27:18 +01:00
Mark Andrews
41d14210de Check reject-000-label 2021-12-02 14:27:18 +01:00
Mark Andrews
0aaaa8768f Reject NSEC records with next field with \000 label
A number of DNS implementation produce NSEC records with bad type
maps that don't contain types that exist at the name leading to
NODATA responses being synthesize instead of the records in the
zone.  NSEC records with these bad type maps often have the NSEC
NSEC field set to '\000.QNAME'.  We look for the first label of
this pattern.

e.g.
	example.com NSEC \000.example.com SOA NS NSEC RRSIG
	example.com RRRSIG NSEC ...
	example.com SOA ...
	example.com RRRSIG SOA ...
	example.com NS ...
	example.com RRRSIG NS ...
	example.com A ...
	example.com RRRSIG A ...

	A is missing from the type map.

This introduces a temporary option 'reject-000-label' to control
this behaviour.
2021-12-02 14:27:18 +01:00
Mark Andrews
8878adcd61 Check SOA without DNSKEY behaviour 2021-12-02 14:27:18 +01:00
Mark Andrews
dfe31e61d2 Check 'server { broken-nsec yes; };' 2021-12-02 14:27:18 +01:00
Mark Andrews
3faccb16cc Add server christmas tree test
This sets as many server options as possible at once to detect
cut-and-paste bugs when implementing new server options in peer.c.
Most of the accessor functions are similar and it is easy to miss
updating a macro name or structure element name when adding new
accessor functions.

checkconf/setup.sh is there to minimise the difference to branches
with optional server options where the list is updated at runtime.
2021-12-02 14:27:18 +01:00
Mark Andrews
733f58a7a5 Allow servers that emit broken NSEC records to be identified
'server <prefix> { broken-nsec yes; };' can now be used to stop
NSEC records from negative responses from servers in the given
prefix being cached and hence available to synth-from-dnssec.
2021-12-02 14:27:14 +01:00
Mark Andrews
454c29046f Check that SOA and DNSKEY are consistent in NSEC typemaps
If there is a SOA record present then there should also be a
DNSKEY record present as the DNSKEY is supposed to live at the
zone apex like the SOA.
2021-12-02 14:24:37 +01:00
Mark Andrews
d733eeba75 Add data lookups into nodata tests 2021-12-02 14:24:37 +01:00
Mark Andrews
b25ff302ac Check synthesis of wildcard NODATA with 2 NSEC 2021-12-02 14:24:37 +01:00
Mark Andrews
5252985a21 Look for covering NSEC under two more conditions
1) when after processing a node there where no headers that
   contained active records.

   When

       if (check_stale_header(node, header, &locktype, lock, &search,
			      &header_prev);

   succeeds or

       if (EXISTS(header) && !ANCIENT(header))

   fails for all entries in the list leading to 'empty_node' remaining
   true.

   If there is are no active records we know nothing about the
   current state of the name so we treat is as ISC_R_NOTFOUND.

2) when there was a covering NOQNAME proof found or all the
   active headers where negative.

   When

	if (header->noqname != NULL &&
	    header->trust == dns_trust_secure)

   succeeds or

	if (!NEGATIVE(header))

   never succeeds.  Under these conditions there could (should be for
   found_noqname) be a covering NSEC earlier in the tree.
2021-12-02 14:24:37 +01:00
Mark Andrews
94935e7e34 Check synthesis of wildcard NODATA with 1 NSEC 2021-12-02 14:24:37 +01:00
Mark Andrews
3fa3b11ef8 Add synthesis of NODATA at wildcard
The old code rejected NSEC that proved the wildcard name existed
(exists).  The new code rejects NSEC that prove that the wildcard
name exists and that the type exists (exists && data) but accept
NSEC that prove the wildcard name exists.

query_synthnxdomain (renamed query_synthnxdomainnodata) already
took the NSEC records and added the correct records to the message
body for NXDOMAIN or NODATA responses with the above change.  The
only additional change needed was to ensure the correct RCODE is
set.
2021-12-02 14:24:37 +01:00
Mark Andrews
12c64d55f2 Add CHANGES and release note for [GL #1265] 2021-12-02 14:24:31 +01:00
Mark Andrews
4bdd5a9953 Ignore NSEC records without RRSIG and NSEC present
dns_nsec_noexistnodata now checks that RRSIG and NSEC are
present in the type map.  Both types should be present in
a correctly constructed NSEC record.  This check is in
addition to similar checks in resolver.c and validator.c.
2021-12-02 14:18:42 +01:00
Mark Andrews
8ff2c133b5 Add dns_nsec_requiredtypespresent
checks an NSEC rdataset to ensure that both NSEC and RRSIG are
present in the type map.  These types are required for the NSEC
to be valid
2021-12-02 14:18:42 +01:00
Mark Andrews
571f3af6e8 Check 'rndc stats' output for 'cache NSEC auxiliary database nodes' 2021-12-02 14:18:41 +01:00
Mark Andrews
0e1048ff25 Check synth-from-dnssec JSON counters 2021-12-02 14:18:41 +01:00
Mark Andrews
6dcea1531d Check synth-from-dnssec XML counters 2021-12-02 14:18:41 +01:00
Mark Andrews
98cab76295 Check reported synthesized responses in named.stats 2021-12-02 14:18:41 +01:00
Mark Andrews
48bf5f143b Correct spelling of synthesized 2021-12-02 14:18:41 +01:00
Mark Andrews
fe8bc79f2b Check 'rndc stats' output for 'covering nsec returned' 2021-12-02 14:18:41 +01:00
Mark Andrews
43316a40a0 Record how often DNS_R_COVERINGNSEC is returned from the cache
reported as "covering nsec returned" when dumping cache stats
and as "CoveringNSEC" in json and xml cache statistics.
2021-12-02 14:18:41 +01:00
Mark Andrews
90dbdb2cb5 Restore 'synth-from-dnssec yes;' as the default 2021-12-02 14:18:41 +01:00
Mark Andrews
62dd9ec9c1 Report Cache NSEC auxilary database size 2021-12-02 14:18:41 +01:00
Mark Andrews
85bfcaeb2e Extend dns_db_nodecount to access auxilary rbt node counts
dns_db_nodecount can now be used to get counts from the auxilary
rbt databases.  The existing node count is returned by
tree=dns_dbtree_main.  The nsec and nsec3 node counts by dns_dbtree_nsec
and dns_dbtree_nsec3 respectively.
2021-12-02 14:18:41 +01:00
Mark Andrews
cad24b8dc4 Check Cloudflare "black lies" response
"black lies" with a different QTYPE should synthesis NODATA responses.
2021-12-02 14:18:41 +01:00
Mark Andrews
c8a7f92b9e Allow "black lies" to be cached
"black lies" differ from "white lies" in that the owner name of the
NSEC record matches the QNAME and the intent is to return NODATA
instead of NXDOMAIN for all types.  Caching this NSEC does not lead
to unexpected behaviour on synthesis when the QNAME matches the
NSEC owner which it does for the the general "white lie" response.

"black lie" QNAME NSEC \000.QNAME NSEC RRSIG

"white lie" QNAME- NSEC QNAME+ NSEC RRSIG

where QNAME- is a name that is close to QNAME but sorts before QNAME
and QNAME+ is a that is close to QNAME but sorts after QNAME.

Black lies are safe to cache as they don't bring into existence
names that are not intended to exist.  "Black lies" intentional change
NXDOMAIN to NODATA. "White lies" bring QNAME- into existence and named
would synthesis NODATA for QNAME+ if it is queried for that name
instead of discovering the, presumable, NXDOMAIN response.

Note rejection NSEC RRsets with NEXT names starting with the label
'\000' renders this change ineffective (see reject-000-label).
2021-12-02 14:18:41 +01:00
Mark Andrews
0d75ec9ee3 Check that minimal NSEC records are not cached
construct a test zone which contains a minimal NSEC record,
emit priming queries for this record, and then check that
a respose that would be synthesised from it isn't.
2021-12-02 14:18:41 +01:00
Mark Andrews
6fae151c9d Do not cache minimal NSEC records (NSEC + RRSIG only)
these are not useful for dnssec synthesis as they can result in
false NODATA responses and just consume cache memory
2021-12-02 14:18:41 +01:00
Mark Andrews
e906fefb7d Extend synthfromdnssec to test with dnssec validation disabled 2021-12-02 14:18:41 +01:00
Mark Andrews
10a05dc26a Extend synthfromdnssec to check insecure responses
add matching tests against a insecure zone to those which
which are synthesised.
2021-12-02 14:18:40 +01:00
Mark Andrews
27acf56ba3 Remove unnecessary dns_rbt_fullnamefromnode call
the results from dns_rbt_fullnamefromnode are not used.
2021-12-02 14:18:40 +01:00
Mark Andrews
48f1f51870 Extend checking of synthesised respones
add digcomp checks to cover wildcard and cname wildcard case
(nxdomain and nodata already covered)
2021-12-02 14:18:40 +01:00
Mark Andrews
89542b8a15 Count DNS_R_COVERINGNSEC as a cache {query}hit
Note when synthesising answer involving wildcards we look in the
cache multiple times, once for the QNAME and once for the wildcard
name which is constucted by looking at the names from the covering
NSEC return by the QNAME miss.
2021-12-02 14:18:40 +01:00
Mark Andrews
e5ce159b5b Add additional checks that upstream queries are not made
Check the named.run of authorative server that queries for the
synthesis target name are only made when expected and not when
unexpected.
2021-12-02 14:18:40 +01:00
Mark Andrews
67d4c783fa Check synthesis of CNAME record from wildcard CNAME 2021-12-02 14:18:40 +01:00
Mark Andrews
25915e81b4 Check synthesis of A record from wildcard A 2021-12-02 14:18:40 +01:00
Mark Andrews
b8563db96a Check whether soa responses are synthesised or not 2021-12-02 14:18:40 +01:00
Mark Andrews
95ec47a460 Add and use check_status 2021-12-02 14:18:40 +01:00
Mark Andrews
d06e8366b4 Add and use check_ad_flag 2021-12-02 14:18:40 +01:00
Mark Andrews
3a5652ccb1 Rework rbtdb.c:find_coveringnsec() to use the auxilary nsec rbt
this improves the performance of looking for NSEC and RRSIG(NSEC)
records in the cache by skipping lots of nodes in the main trees
in the cache without these records present.  This is a simplified
version of previous_closest_nsec() which uses the same underlying
mechanism to look for NSEC and RRSIG(NSEC) records in authorative
zones.

The auxilary NSEC tree was already being maintained as a side effect
of looking for the covering NSEC in large zones where there can be
lots of glue records that needed to be skipped.  Nodes are added
to the tree whenever a NSEC record is added to the primary tree.
They are removed when the corresponding node is removed from the
primary tree.

Having nodes in the NSEC tree w/o NSEC records in the primary tree
should not impact on synth-from-dnssec efficiency as that node would
have held the NSEC we would have been needed to synthesise the
response.  Removing the node when the NSEC RRset expires would only
cause rbtdb to return a NSEC which would be rejected at a higher
level.
2021-12-02 14:18:40 +01:00
Ondřej Surý
240b8a3afc Merge branch '2700-improve-failed-tcp-accept-logging' into 'main'
Improve the logging on failed TCP accept

Closes #2700

See merge request isc-projects/bind9!5611
2021-12-02 13:18:10 +00:00
Ondřej Surý
9d53471890 Add CHANGES and release note for [GL #2700] 2021-12-02 14:08:53 +01:00
Ondřej Surý
20ac73eb22 Improve the logging on failed TCP accept
Previously, when TCP accept failed, we have logged a message with
ISC_LOG_ERROR level.  One common case, how this could happen is that the
client hits TCP client quota and is put on hold and when resumed, the
client has already given up and closed the TCP connection.  In such
case, the named would log:

    TCP connection failed: socket is not connected

This message was quite confusing because it actually doesn't say that
it's related to the accepting the TCP connection and also it logs
everything on the ISC_LOG_ERROR level.

Change the log message to "Accepting TCP connection failed" and for
specific error states lower the severity of the log message to
ISC_LOG_INFO.
2021-12-02 13:50:00 +01:00
Evan Hunt
4ecbc3d09f Merge branch '3026-premature-tcp-connection-closure-leaks-fetch-contexts-hang-on-shutdown' into 'main'
Shutdown all active TCP connections on error

Closes #3026

See merge request isc-projects/bind9!5599
2021-12-01 20:10:44 +00:00
Ondřej Surý
4e779b11f6 Add CHANGES and release notes for [GL #3026] 2021-12-01 11:48:15 -08:00
Ondřej Surý
5c17919019 Add TCP connection reset test
The TCP connection reset test starts mock UDP and TCP server which
always returns empty DNS answer with TC bit set over UDP and resets the
TCP connection after five seconds.

When tested without the fix, the DNS query to 10.53.0.2 times out and
the ns2 server hangs at shutdown.
2021-12-01 11:48:12 -08:00
Evan Hunt
fa8f409af2 On non-matching answer, check for missed timeout
A TCP connection may be held open past its proper timeout if it's
receiving a stream of DNS responses that don't match any queries.
In this case, we now check whether the oldest query should have timed
out.
2021-12-01 11:45:55 -08:00
Ondřej Surý
ba1cadf14a Tear down the TCP connection on too many unexpected DNS messages
When the outgoing TCP dispatch times-out active response, we might still
receive the answer during the lifetime of the connection.  Previously,
we would just ignore any non-matching DNS answers, which would allow the
server to feed us with otherwise valid DNS answer and keep the
connection open.

Add a counter for timed-out DNS queries over TCP and tear down the whole
TCP connection if we receive unexpected number of DNS answers.
2021-12-01 11:45:55 -08:00
Ondřej Surý
c84ed5056e Refactor tcp_recv()
The tcp_recv() function used lot of gotos that made the function hard to
read.  Refactor the function by splitting it into smaller logical chunks.
2021-12-01 11:45:55 -08:00
Ondřej Surý
10f4f1a250 Shutdown all TCP connection on invalid DNS message
Previously, when invalid DNS message is received over TCP we throw the
garbage DNS message away and continued looking for valid DNS message
that would match our outgoing queries.  This logic makes sense for UDP,
because anyone can send DNS message over UDP.

Change the logic that the TCP connection is closed when we receive
garbage, because the other side is acting malicious.
2021-12-01 11:45:55 -08:00
Ondřej Surý
9230473324 Shutdown all active TCP connections on error
When outgoing TCP connection was prematurely terminated (f.e. with
connection reset), the dispatch code would not cleanup the resources
used by such connection leading to dangling dns_dispentry_t entries.
2021-12-01 11:45:55 -08:00
Ondřej Surý
081e18edc8 Merge branch '1610-disable-UseSTD3ASCIIRules-in-idn2' into 'main'
Disable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions

Closes #1610

See merge request isc-projects/bind9!5605
2021-12-01 15:32:29 +00:00
Ondřej Surý
1d42178c46 Add CHANGES and release note for [GL #1610] 2021-12-01 16:10:04 +01:00
Ondřej Surý
ce1256c066 Add an idna test that _ and * characters are preserved
Add a idna that checks whether non-character letters like _ and * are
preserved when IDN is enabled.  This wasn't the case when
UseSTD3ASCIIRules were enabled, f.e. _ from _tcp would get mangled to
tcp.
2021-12-01 16:10:04 +01:00
Ondřej Surý
70d8395ca3 Remove idna test for UseSTD3ASCIIRules=true
We had to disable UseSTD3ASCIIRules=true because it broke non-letter
domain names like _tcp or *.  Disable the idna test too.
2021-12-01 16:10:04 +01:00
Ondřej Surý
69cfc07d00 Disable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions
Disable IDN2_USE_STD3_ASCII_RULES to the libidn2 conversion because it
broke encoding some non-letter but valid domain names like _tcp or *.

This reverts commit ef8aa91740.
2021-12-01 16:10:04 +01:00
Artem Boldariev
71ee5f6148 Merge branch '2983-fix-doth-system-test' into 'main'
Resolve #2983: Increase startup timeout for servers in system tests

Closes #2983

See merge request isc-projects/bind9!5609
2021-12-01 14:06:16 +00:00
Artem Boldariev
3e7bcc2939 Increase startup timeout for servers in system tests
This change is made in particular to address the issue with 'doth'
system tests where servers are unable to iniitalise in time in CI
system under high load (that happened particularly often for Debian
Buster cross32 configuration).

The right solution, is, of course, to (re)use TLS context sparingly,
while right now we create too many of them.
2021-12-01 13:11:39 +02:00
Artem Boldariev
6436caa607 Merge branch 'artem-xot-tls-protocols-ciphers' into 'main'
XoT: add support client-side TLS parameters for incoming XFRs, add 'tls' name configuration validation on secondaries

See merge request isc-projects/bind9!5602
2021-12-01 11:05:51 +00:00
Artem Boldariev
f3e025643f Add CHANGES entry [GL !5602]
Mention that client-side 'tls' parameters are now supported for XoT.
2021-12-01 12:00:31 +02:00
Artem Boldariev
5f859d8a98 TLS context handling code: Fix an abort on ancient OpenSSL version
There was a logical bug when setting a list of enabled TLS protocols,
which may lead to a crash (an abort()) on systems with ancient OpenSSL
versions.

The problem was due to the fact that we were INSIST()ing on supporting
all of the TLS versions, while checking only for mentioned in the
configuration was implied.
2021-12-01 12:00:30 +02:00
Artem Boldariev
746052031a Extend the 'doth' system test with another XoT-enabled secondary
This commit extends the 'doth' system test to include an additional
XoT-enabled secondary which uses the supported client-side 'tls'
parameters.
2021-12-01 12:00:29 +02:00
Artem Boldariev
69cef39099 Add 'tls' validation for XoT enabled primaries
This commit ensure that the 'tls' name specified in the 'primaries'
clause of a 'zone' statement is a valid one.

Prior to that such a name would be silently accepted, leading to
silent XFRs-via-TLS failures.
2021-12-01 12:00:29 +02:00
Artem Boldariev
7843fb4ece XoT: add support for client-side TLS parameters
This commit adds support for client-side TLS parameters to XoT.

Prior to this commit all client-side TLS contexts were using default
parameters only, ignoring the options from the BIND's configuration
file.

Currently, the following 'tls' parameters are supported:

- protocols;
- ciphers;
- prefer-server-ciphers.
2021-12-01 12:00:28 +02:00
Mark Andrews
17d9a74681 Merge branch '2850-the-list-of-fetches-at-the-end-of-rndc-recursing-output-is-very-poorly-explained-in-the-arm' into 'main'
Resolve "The list of fetches at the end of 'rndc recursing' output is very poorly explained in the ARM - what does 'allowed' mean?"

Closes #2850

See merge request isc-projects/bind9!5388
2021-11-30 11:30:47 +00:00
Mark Andrews
65f6d8af75 Update the description of fetches-per-zone counters 2021-11-30 11:10:04 +00:00
Mark Andrews
db2aad0e96 Merge branch '853-dnssec-dsfromkey-doesn-t-omit-revoked-ksk' into 'main'
Resolve "dnssec-dsfromkey doesn't omit revoked KSK"

Closes #853

See merge request isc-projects/bind9!5460
2021-11-30 11:08:28 +00:00
Mark Andrews
d632df3c11 Add CHANGES for [GL #853] 2021-11-30 21:48:55 +11:00
Mark Andrews
e7a3ada1d2 Check dnssec-dsfromkey with revoked DNSKEY
Checks that there is a revoked key in the DNSKEY RRset then checks
that only the correct number of DS records are produced.
2021-11-30 21:48:17 +11:00
Tony Finch
04a5529c2d dnssec-dsfromkey should not convert revoked keys
it is pointless to convert revoked keys to DS or CDS records as
they cannot be used to provide a cryptographic link from the parent
zone.
2021-11-30 21:48:17 +11:00
Artem Boldariev
3443938b99 Merge branch '2776-allow-transfer-encrypted' into 'main'
Resolve #2776: Extend 'allow-transfer' with 'port' and 'transport' parameters

Closes #2776

See merge request isc-projects/bind9!5587
2021-11-30 10:44:11 +00:00
Artem Boldariev
7f73e68730 Add transport-acl system test
This commit adds a new system-test: transport-acl system test. It is
intended to test the new, extended syntax for ACLs, the one where port
or transport protocol can be specified. Currently, it includes the
tests only using allow-transfer statement, as this extended syntax is
used only there, at least for now.
2021-11-30 12:21:19 +02:00
Artem Boldariev
758f748d5e Modify CHANGES [GL #2776]
Mention in the CHANGES file that the allow-transfer options has been
extended with 'port' and 'transport' options.
2021-11-30 12:21:17 +02:00
Artem Boldariev
792ff02045 Mention that the allow-transfer option has been extended
This commit updates both the reference manual and release notes with
the information that 'allow-transfer' has been extended with
additional "port" and "transport" options.
2021-11-30 12:20:22 +02:00
Artem Boldariev
3cd2ffc01f Extend the 'doth' system test to test extended allow-transfer option
This commit extends the 'doth' system test to verify that the new
extended 'allow-transfer' option syntax featuring 'port' and
'transport' parameters is supported and works as expected. That is, it
restricts the primary server to allow zone transfers only via XoT.

Additionally to that, it extends the 'checkonf' test with more
configuration file examples featuring the new syntax.
2021-11-30 12:20:22 +02:00
Artem Boldariev
0ee6f66cbd Integrate extended ACLs syntax featuring 'port' and 'transport' opts
This commit completes the integration of the new, extended ACL syntax
featuring 'port' and 'transport' options.

The runtime presentation and ACL loading code are extended to allow
the syntax to be used beyond the 'allow-transfer' option (e.g. in
'acl' definitions and other 'allow-*' options) and can be used to
ultimately extend the ACL support with transport-only
ACLs (e.g. 'transport-acl tls-acl port 853 transport tls'). But, due
to fundamental nature of such a change, it has not been completed as a
part of 9.17.X release series due to it being close to 9.18 stable
release status. That means that we do not have enough time to fully
test it.

The complete integration is planned as a part of 9.19.X release
series.

The code was manually verified to work as expected by temporarily
enabling the extended syntax for 'acl' statements and 'allow-query'
options, including ACL merging, negated ACLs.
2021-11-30 12:20:22 +02:00
Artem Boldariev
af2d065c21 Extend ACL syntax handling code with 'port' and 'transport' options
This commit extends ACL syntax handling code with 'port' and
'transport' options. Currently, the extended syntax is available only
for allow-transfer options.
2021-11-30 12:20:22 +02:00
Artem Boldariev
f0e18f3927 Add isc_nm_has_encryption()
This commit adds an isc_nm_has_encryption() function intended to check
if a given handle is backed by a connection which uses encryption.
2021-11-30 12:20:22 +02:00
Artem Boldariev
07cf827b0b Add isc_nm_socket_type()
This commit adds an isc_nm_socket_type() function which can be used to
obtain a handle's socket type.

This change obsoletes isc_nm_is_tlsdns_handle() and
isc_nm_is_http_handle(). However, it was decided to keep the latter as
we eventually might end up supporting multiple HTTP versions.
2021-11-30 12:20:22 +02:00
Artem Boldariev
7d7513ccce Merge branch 'artem-disable-unused-tls-syntax' into 'main'
Remove unused 'tls' clause options: 'ca-file' and 'hostname'

See merge request isc-projects/bind9!5600
2021-11-29 12:23:37 +00:00
Artem Boldariev
afd53256a5 Modify CHANGES [GL !5600]
Mention that unused 'tls' clause options 'ca-file' and 'hostname' were
removed.
2021-11-29 14:03:58 +02:00
Artem Boldariev
78b73d0865 Disable unused 'tls' clause options: 'ca-file' and 'hostname'
This commit disables the unused 'tls' clause options. For these some
backing code exists, but their values are not really used anywhere,
nor there are sufficient syntax tests for them.

These options are only disabled temporarily, until TLS certificate
verification gets implemented.
2021-11-29 14:02:48 +02:00
Artem Boldariev
2fc4239ccb Merge branch '3022-doh-fix-dig-crash-on-unexpected-alpn' into 'main'
Resolve #3022: DoH: dig eventually aborts on ALPN negotiation failure when issuing a DoH query (because of dangling handles)

Closes #3022

See merge request isc-projects/bind9!5590
2021-11-26 08:53:24 +00:00
Artem Boldariev
44951f8cac Modify CHANGES [GL #3022]
Mention that [GL #3022] was resolved.
2021-11-26 10:24:24 +02:00
Artem Boldariev
babc2749b5 DoH: Extend 'doth' test with a check if dig can detect ALPN failure
This commit extends the 'doth' system test to verify if 'dig' can
detect an properly recover after ALPN negotiation failure when making
a DoH query.
2021-11-26 10:23:17 +02:00
Artem Boldariev
b211fff4cb TLS stream: disable TLS I/O debug log message by default
This commit makes the TLS stream code to not issue mostly useless
debug log message on error during TLS I/O. This message was cluttering
logs a lot, as it can be generated on (almost) any non-clean TLS
connection termination, even in the cases when the actual query
completed successfully. Nor does it provide much value for end-users,
yet it can occasionally be seen when using dig and quite often when
running BIND over a publicly available network interface.
2021-11-26 10:23:17 +02:00
Artem Boldariev
0b0c29dd51 DoH: Remove unneeded isc__nmsocket_prep_destroy() call
This commit removes unneeded isc__nmsocket_prep_destroy() call on ALPN
negotiation failure, which was eventually causing the TLS handle to
leak.

This call is not needed, as not attaching to the transport (TLS)
handle should be enough. At this point it seems like a kludge from
earlier days of the TLS code.
2021-11-26 10:23:17 +02:00
Matthijs Mekking
c52a383523 Merge branch 'matthijs-fix-openssl-init-ssl-leak' into 'main'
Add OPENSSL_cleanup to tls_shutdown function

See merge request isc-projects/bind9!5593
2021-11-26 07:41:02 +00:00
Matthijs Mekking
89f4f8f0c8 Add OPENSSL_cleanup to tls_shutdown function
This prevents a direct leak in OPENSSL_init_crypto (called from
OPENSSL_init_ssl).

Add shim version of OPENSSL_cleanup because it is missing in LibreSSL on
OpenBSD.
2021-11-26 08:20:10 +01:00
Mark Andrews
929e070a59 Merge branch '3021-dns_sdlz_putrr-does-not-auto-increase-buffer' into 'main'
Resolve "dns_sdlz_putrr does not auto increase buffer"

Closes #3021

See merge request isc-projects/bind9!5588
2021-11-25 20:08:02 +00:00
Mark Andrews
ed5d28088a Add CHANGES for [GL #3021] 2021-11-25 19:48:20 +00:00
Mark Andrews
6dc5248606 Exercise ISC_R_NOSPACE path in dns_sdlz_putrr
Use relative names when adding SOA record and a long domain
name to create SOA RR where the wire format is longer than
the initial buffer allocation in dns_sdlz_putrr.
2021-11-25 19:48:20 +00:00
Mark Andrews
08f1cba096 Do not convert ISC_R_NOSPACE to DNS_R_SERVFAIL too early
The parsing loop needs to process ISC_R_NOSPACE to properly
size the buffer.  If result is still ISC_R_NOSPACE at the end
of the parsing loop set result to DNS_R_SERVFAIL.
2021-11-25 19:48:20 +00:00
Michal Nowak
bf0fce265a Merge branch 'mnowak/warning-array-subscript-is-of-type-char-on-netbsd-9' into 'main'
Fix "array subscript is of type 'char'" on NetBSD 9

See merge request isc-projects/bind9!5591
2021-11-25 17:53:35 +00:00
Michal Nowak
d09447287f Fix "array subscript is of type 'char'" on NetBSD 9
In file included from rdata.c:602:
    In file included from ./code.h:88:
    ./rdata/in_1/svcb_64.c:259:9: warning: array subscript is of type 'char' [-Wchar-subscripts]
                            if (!isdigit(*region->base)) {
                                 ^~~~~~~~~~~~~~~~~~~~~~
    /usr/include/sys/ctype_inline.h:51:44: note: expanded from macro 'isdigit'
    #define isdigit(c)      ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_D))
                                                    ^~~~
2021-11-25 18:15:18 +01:00
Mark Andrews
0c2c7636f4 Merge branch '3024-doh_connect_makeuri-fails-on-illumos' into 'main'
Resolve "doh_connect_makeuri fails on illumos"

Closes #3024

See merge request isc-projects/bind9!5592
2021-11-25 12:58:21 +00:00
Mark Andrews
1092d8e25a use .s_addr to handle potential union in struct in_addr 2021-11-25 12:33:04 +00:00
Artem Boldariev
6bd1e6de94 Merge branch '3019-curl-check-http2-features' into 'main'
Fix doth test when curl without HTTP/2 support is unavailable

Closes #3019

See merge request isc-projects/bind9!5585
2021-11-25 09:19:30 +00:00
Artem Boldariev
f6ef74b196 Fix doth test when curl without HTTP/2 support is unavailable
This commit makes the 'doth' system test skip HTTP headers check when
curl version is new enough but was compiled without HTTP/2 support.

This should fix the 'doth' system test for macOS systems using
macports.
2021-11-25 10:51:12 +02:00
Artem Boldariev
5069b58dc9 Merge branch 'artem-fix-xot-crash-on-unexpected-incoming-message' into 'main'
Fix a crash on unexpected incoming DNS message during XoT xfer

Closes #3004

See merge request isc-projects/bind9!5567
2021-11-24 09:40:15 +00:00
Artem Boldariev
61d824cd41 Add an entry to CHANGES [GL #3004]
Mentions that there is a fix to a bug in DoT code leading to an abort
when a zone transfer over TLS ends with an unexpected DNS message.
2021-11-24 11:19:21 +02:00
Artem Boldariev
6c8a97c78f Fix a crash on unexpected incoming DNS message during XoT xfer
This commit fixes a peculiar corner case in the client-side DoT code
because of which a crash could occur during a zone transfer. A junk
DNS message should be sent at the end of a zone transfer via TLS to
trigger the crash (abort).

This commit, hopefully, fixes that.

Also, this commit adds similar changes to the TCP DNS code, as it
shares the same origin and most of the logic.
2021-11-24 11:18:36 +02:00
Michał Kępień
ce728098ab Merge branch '3002-fix-handling-of-mismatched-responses-past-timeout' into 'main'
Fix handling of mismatched responses past timeout

Closes #3002

See merge request isc-projects/bind9!5586
2021-11-23 14:40:40 +00:00
Michał Kępień
8f8a69aa0a Fix handling of mismatched responses past timeout
When a UDP dispatch receives a mismatched response, it checks whether
there is still enough time to wait for the correct one to arrive before
the timeout fires.  If there is not, the result code is set to
ISC_R_TIMEDOUT, but it is not subsequently used anywhere as 'response'
is set to NULL a few lines earlier.  This results in the higher-level
read callback (resquery_response() in case of resolver code) not being
called.  However, shortly afterwards, a few levels up the call chain,
isc__nm_udp_read_cb() calls isc__nmsocket_timer_stop() on the dispatch
socket, effectively disabling read timeout handling for that socket.
Combined with the fact that reading is not restarted in such a case
(e.g. by calling dispatch_getnext() from udp_recv()), this leads to the
higher-level query structure remaining referenced indefinitely because
the dispatch socket it uses will neither be read from nor closed due to
a timeout.  This in turn causes fetch contexts to linger around
indefinitely, which in turn i.a. prevents certain cache nodes (those
containing rdatasets used by fetch contexts, like fctx->nameservers)
from being cleaned.

Fix by making sure the higher-level callback does get invoked with the
ISC_R_TIMEDOUT result code when udp_recv() determines there is no more
time left to receive the correct UDP response before the timeout fires.
This allows the higher-level callback to clean things up, preventing the
reference leak described above.
2021-11-23 15:35:39 +01:00
Arаm Sаrgsyаn
87acddd760 Merge branch '1608-catz-reconfig-crash-fix' into 'main'
Fix catalog zone reconfiguration crash

Closes #1608

See merge request isc-projects/bind9!5481
2021-11-23 12:32:05 +00:00
Evan Hunt
bb411af31d Add a regression test
Reconfigure the server without catalog-zone configuration, and then
put it back and reconfigure again, to confirm that there's no crash.
2021-11-23 11:41:50 +00:00
Aram Sargsyan
e644738310 Add CHANGES and release notes for [GL #1608] 2021-11-23 11:41:48 +00:00
Aram Sargsyan
43ac2cd229 Fix catalog zone reconfiguration crash
The following scenario triggers a "named" crash:

1. Configure a catalog zone.
2. Start "named".
3. Comment out the "catalog-zone" clause.
4. Run `rndc reconfig`.
5. Uncomment the "catalog-zone" clause.
6. Run `rndc reconfig` again.

Implement the required cleanup of the in-memory catalog zone during
the first `rndc reconfig`, so that the second `rndc reconfig` could
find it in an expected state.
2021-11-23 11:39:37 +00:00
Evan Hunt
995d135b58 Merge branch '3013-resolver-test-failure' into 'main'
fix intermittent resolver test error

Closes #3013

See merge request isc-projects/bind9!5576
2021-11-22 23:18:57 +00:00
Evan Hunt
069625cccb fix intermittent resolver test error
the resolver test checks that the correct number of fetches have
been sent NS rrsets of a given size, but it formerly did so by
counting queries received by the authoritative server, which could
result in an off-by-one count if one of the queries had been resent
due to a timeout or a port number collision.

this commit changes the test to count fetches initiated by the
resolver, which should prevent the intermittent test failure, and
is the actual datum we were interested in anyway.
2021-11-22 14:59:02 -08:00
Mark Andrews
7991eb0bf8 Merge branch '3014-broken-ecdsa-signatures-may-be-generated-with-certain-private-keys' into 'main'
Resolve "Broken ECDSA signatures may be generated with certain private keys"

Closes #3014

See merge request isc-projects/bind9!5580
2021-11-22 22:04:30 +00:00
Mark Andrews
f584df4614 Add CHANGES for [GL #3014] 2021-11-23 08:45:21 +11:00
Mark Andrews
34f3240622 Reject too long ECDSA public keys
opensslecdsa_fromdns() already rejects too short ECDSA public keys.
Make it also reject too long ones.  Remove an assignment made redundant
by this change.
2021-11-23 08:44:47 +11:00
Michał Kępień
a9ab2bf60b Pass key length to raw_key_to_ossl() by value
As raw_key_to_ossl() no longer stores anything at the pointer passed to
it in the 'key_len' parameter, change the type of the latter to size_t.
2021-11-23 08:44:47 +11:00
Michał Kępień
a482a6b204 Fix parsing ECDSA keys
raw_key_to_ossl() assumes fixed ECDSA private key sizes (32 bytes for
ECDSAP256SHA256, 48 bytes for ECDSAP384SHA384).  Meanwhile, in rare
cases, ECDSAP256SHA256 private keys are representable in 31 bytes or
less (similarly for ECDSAP384SHA384) and that is how they are then
stored in the "PrivateKey" field of the key file.  Nevertheless,
raw_key_to_ossl() always calls BN_bin2bn() with a fixed length argument,
which in the cases mentioned above leads to erroneously interpreting
uninitialized memory as a part of the private key.  This results in the
latter being malformed and broken signatures being generated.  Address
by using the key length provided by the caller rather than a fixed one.
Apply the same change to public key parsing code for consistency, adding
an INSIST() to prevent buffer overruns.
2021-11-23 08:44:47 +11:00
Mark Andrews
dbeea1afa0 Don't use 'dnssec-signzone -P' unless necessary
Most of the test zones in the dnssec system test can be verified.
Use -z when only a single key is being used so that the verifier
knows that only a single key is in use.
2021-11-23 08:44:47 +11:00
Mark Andrews
77ca778377 Generate test zone with multiple NSEC and NSEC3 chains
The method used to generate a test zone with multiple NSEC and
NSEC3 chains was incorrect.  Multiple calls to dnssec-signzone
with multiple parameters is not additive.  Extract the chain on
each run then add them to the final signed zone instance.
2021-11-23 08:44:47 +11:00
Ondřej Surý
e3ca3156a5 Merge branch '3018-resolver-crash' into 'main'
fix a use-after-free in resolver

Closes #3018

See merge request isc-projects/bind9!5584
2021-11-22 10:38:15 +00:00
Evan Hunt
465353d9ca CHANGES for [GL #3018] 2021-11-22 11:35:34 +01:00
Evan Hunt
326a4fc13b fix a use-after-free in resolver
when processing a mismatched response, we call dns_dispatch_getnext().
If that fails, for example because of a timeout, fctx_done() is called,
which cancels all queries. This triggers a crash afterward when
fctx_cancelquery() is called, and is unnecessary since fctx_done()
would have been called later anyway.
2021-11-22 11:35:34 +01:00
Ondřej Surý
949c3919a8 Merge branch '2978-fix-data-race-in-adb.c' into 'main'
Fix the data race when shutting down dns_adb

Closes #2978

See merge request isc-projects/bind9!5569
2021-11-22 10:29:02 +00:00
Ondřej Surý
7e002d89b4 Fix the data race when shutting down dns_adb
When dns_adb is shutting down, first the adb->shutting_down flag is set
and then task is created that runs shutdown_stage2() that sets the
shutdown flag on names and entries.  However, when dns_adb_createfind()
is called, only the individual shutdown flags are being checked, and the
global adb->shutting_down flag was not checked.  Because of that it was
possible for a different thread to slip in and create new find between
the dns_adb_shutdown() and dns_adb_detach(), but before the
shutdown_stage2() task is complete.  This was detected by
ThreadSanitizer as data race because the zonetable might have been
already detached by dns_view shutdown process and simultaneously
accessed by dns_adb_createfind().

This commit converts the adb->shutting_down to atomic_bool to prevent
the global adb lock when creating the find.
2021-11-22 11:09:21 +01:00
Matthijs Mekking
9d94720735 Merge branch '1836-extended-dns_errors' into 'main'
Set Extended EDNS Error (EDE) Prohibited (18)

See merge request isc-projects/bind9!4793
2021-11-19 09:58:26 +00:00
Matthijs Mekking
4354047f97 Test for EDE option with non-EDNS query
Add a test case to make sure the EDE option is not set on an EDNS
disabled query.
2021-11-19 09:44:28 +01:00
Matthijs Mekking
842fa76cdd Add CHANGES and release notes for EDE:18
New feature.
2021-11-19 09:44:28 +01:00
Matthijs Mekking
f14964a1b1 Test for EDE option 18 in allow-query test
If a query is refused because of an ACL error, check that the extended
DNS error "Prohibited (18)" is set.
2021-11-19 09:44:28 +01:00
Matthijs Mekking
ca7f2fd903 Add EDE to query messages
Add extended DNS error on refused queries. All instances are related to
unauthorized clients, so set extended DNS error code 18 (Prohibited).
2021-11-19 09:44:28 +01:00
Matthijs Mekking
6c8fc2f4f0 Add method to set extended DNS error
Add a new parameter to 'ns_client_t' to store potential extended DNS
error. Reset when the client request ends, or is put back.

Add defines for all well-known info-codes.

Update the number of DNS_EDNSOPTIONS that we are willing to set.

Create a new function to set the extended error for a client reply.
2021-11-19 09:44:28 +01:00
Matthijs Mekking
36503721f2 Merge branch 'doc-fix-cookie-algorithm-desc' into 'main'
[ISC-support #19862] Update docs to reflect changes to acceptable cookie-algorithm values

See merge request isc-projects/bind9!5573
2021-11-18 12:57:52 +00:00
Dan Theisen
b29a748119 Update docs with correct cookie-algorithm values
The documentation was inconsistent with the code. The new description
for cookie-algorithm now reflects the current behavior.

The following two commits are the relevant code changes to this
section of docs: afa81ee4 a912f313
2021-11-18 13:26:12 +01:00
Michał Kępień
a814f72261 Merge branch 'v9_17_20-release' into 'main'
Merge 9.17.20 release branch

See merge request isc-projects/bind9!5581
2021-11-18 08:14:40 +00:00
Michał Kępień
d0940f87b6 Set up release notes for BIND 9.17.21 2021-11-18 09:00:07 +01:00
Michał Kępień
50ea1f5fc4 Update BIND version to 9.17.20 2021-11-18 09:00:07 +01:00
Michał Kępień
27abbbafeb Add a CHANGES marker 2021-11-18 09:00:07 +01:00
Michał Kępień
ac870ec6d6 Merge branch 'michal/prepare-documentation-for-bind-9.17.20' into 'v9_17_20-release'
Prepare documentation for BIND 9.17.20

See merge request isc-private/bind9!335
2021-11-18 09:00:07 +01:00
Michał Kępień
adf37a9d59 Prepare release notes for BIND 9.17.20 2021-11-18 09:00:07 +01:00
Michał Kępień
02b1a18db2 Reorder release notes 2021-11-18 09:00:07 +01:00
Michał Kępień
075f03d37f Tweak and reword release notes 2021-11-18 09:00:07 +01:00
Evan Hunt
00d379da8e Merge branch '2374-mdig-ephemeral' into 'main'
Make mdig use the OS-supplied ephemeral port range

Closes #2374

See merge request isc-projects/bind9!5552
2021-11-17 22:38:50 +00:00
Evan Hunt
0fecb10c17 Make mdig use the OS-supplied ephemeral port range
mdig was always using the default 1024-65535 range for outgoing
messages, instead of using the system's configured ephemeral ports.
2021-11-17 14:13:17 -08:00
Evan Hunt
f6fc9d8c61 Merge branch 'each-fix-warnings' into 'main'
address '--disable-doh' failures

See merge request isc-projects/bind9!5561
2021-11-17 22:11:36 +00:00
Evan Hunt
7f63ee3bae address '--disable-doh' failures
Change 5756 (GL #2854) introduced build errors when using
'configure --disable-doh'.  To fix this, isc_nm_is_http_handle() is
now defined in all builds, not just builds that have DoH enabled.

Missing code comments were added both for that function and for
isc_nm_is_tlsdns_handle().
2021-11-17 13:48:43 -08:00
Mark Andrews
a58859b197 Merge branch '3012-begin-end-dnssec-managed-keys-in-bin-named-config-c-are-mismatched' into 'main'
Resolve "BEGIN/END DNSSEC/MANAGED KEYS in bin/named/config.c are mismatched."

Closes #3012

See merge request isc-projects/bind9!5575
2021-11-16 21:44:21 +00:00
Mark Andrews
1d7b1f74c9 Embed NAMED_SYSCONFDIR contents in the bind.keys comment 2021-11-16 14:39:05 +11:00
Mark Andrews
43a7f3f532 Update comments around built in trust anchors
The comments now say "# BEGIN TRUST ANCHORS" and "# END TRUST ANCHORS".
2021-11-16 14:36:10 +11:00
Ondřej Surý
92823f9424 Merge branch 'ondrej/update-flycheck-configuration-on-Linux' into 'main'
Add flycheck configuration for libxml2 and json-c on Linux

See merge request isc-projects/bind9!5570
2021-11-15 11:33:37 +00:00
Ondřej Surý
41f86440c4 Add flycheck configuration for libxml2 and json-c on Linux 2021-11-15 12:31:48 +01:00
Mark Andrews
e8d1dd30bc Merge branch '3003-greedy-regular-expression-causes-intermittent-nsupdate-system-test-failures' into 'main'
Resolve "Greedy regular expression causes intermittent "nsupdate" system test failures"

Closes #3003

See merge request isc-projects/bind9!5559
2021-11-10 01:49:43 +00:00
Mark Andrews
c1df7884f0 Add CHANGES note for [GL #3003] 2021-11-10 12:13:34 +11:00
Mark Andrews
be879cda72 Replace incorrect sed expersion with awk
The sed expression could find the wrong instance of 10.
Use awk to replace the TTL field and also to specify the
server and issue the send command.
2021-11-10 12:09:51 +11:00
Petr Špaček
ed99c502b6 Merge branch 'pspacek/ci-jobs-interruptible' into 'main'
Automatically cancel CI jobs on outdated branches

See merge request isc-projects/bind9!5558
2021-11-09 10:54:39 +00:00
Petr Špaček
02b438fadf Automatically cancel CI jobs on outdated branches
Gitlab feature
https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-redundant-pipelines
can automatically cancel jobs which operate on an outdated code, i.e. on
branches which received new commits while jobs with an older set of
commits are still running. For this feature to work jobs have to be
configured with boolean interruptible: true.

I think practically all of our current CI jobs can be cancelled,
so the option is now on by default for all jobs.
2021-11-09 11:21:34 +01:00
Petr Špaček
a3ea4fec2a Merge branch 'pspacek/gitlab-ci-cleanup' into 'main'
Remove obsolete PYTHONPATH setting from .gitlab-ci.yaml

See merge request isc-projects/bind9!5563
2021-11-09 09:54:51 +00:00
Petr Špaček
310a15ac94 Remove obsolete PYTHONPATH setting from .gitlab-ci.yaml
It was leftover after removing Python tools in commit
98b3b93791.
2021-11-09 10:24:42 +01:00
Petr Špaček
05eab7cf8f Merge branch '2779-wildcard_test_property_based' into 'main'
Add property based test for wildcard expansion

See merge request isc-projects/bind9!5203
2021-11-08 13:20:50 +00:00
Petr Špaček
6495e59a4c Fix system test .status file cleanup 2021-11-08 13:23:22 +01:00
Petr Špaček
49da19c353 Add new system test for wildcard expansion
This is almost minimal prototype to show how to use python-hypothesis
library in a system test. It does not fully replace existing shell-based
system test for wildcards.
2021-11-08 13:23:05 +01:00
Petr Špaček
8ce4759c5c Use more liberal pylint for tests
Ignore wrong-import-position to enable use of pytest.importorskip.
2021-11-08 13:23:05 +01:00
Petr Špaček
1a80e641e9 Use more liberal flake8 for tests
Ignore rule W402 (wrong import order) to enable use of
pytest.importorskip.
2021-11-08 13:23:05 +01:00
Petr Špaček
b8829c801f Allow py.test system test to skip itself
Enable use of shortcuts like pytest.importorskip and other tricks
which can cause test to skip itself.
2021-11-08 13:23:03 +01:00
Artem Boldariev
4589146eb1 Merge branch '2854-cache-control-max-age' into 'main'
Resolve #2854: DoH:  Assign HTTP responses freshness lifetime according to the smallest TTL found in the Answer section

Closes #2854

See merge request isc-projects/bind9!5493
2021-11-05 13:02:52 +00:00
Artem Boldariev
2a340ee510 Modify the CHANGES file [GL #2854]
Mentions that we now assign HTTP freshness lifetime to responses sent
over DNS-over-HTTPS.
2021-11-05 14:14:59 +02:00
Evan Hunt
03564ba982 add a max-age test to doth system test
use curl, when available, to query for names that do and do not
exist; dump the response headers and check for the expected
max-age value.
2021-11-05 14:14:59 +02:00
Artem Boldariev
51a2c7aed3 DoH: Set the "max-age" "Cache-Control" HTTP header value
This commit makes BIND set the "max-age" value of the "Cache-Control"
HTTP header to the minimal TTL from the Answer section for positive
answers, as RFC 8484 advises in section 5.1.

We calculate the minimal TTL as a side effect of rendering the
response DNS message, so it does not change the code flow much, nor
should it have any measurable negative impact on the performance.

For negative answers, the "max-age" value is set using the TTL and
SOA-minimum values from an SOA record in the Authority section.
2021-11-05 14:14:59 +02:00
Artem Boldariev
80482f8d3e DoH: Add isc_nm_set_min_answer_ttl()
This commit adds an isc_nm_set_min_answer_ttl() function which is
intended to to be used to give a hint to the underlying transport
regarding the answer TTL.

The interface is intentionally kept generic because over time more
transports might benefit from this functionality, but currently it is
intended for DoH to set "max-age" value within "Cache-Control" HTTP
header (as recommended in the RFC8484, section 5.1 "Cache
Interaction").

It is no-op for other DNS transports for the time being.
2021-11-05 14:14:59 +02:00
Michał Kępień
b69dfd6a75 Merge branch 'pspacek/stats_version_fix' into 'main'
Fix incorrect version bump in statistics channels

See merge request isc-projects/bind9!5557
2021-11-05 06:42:33 +00:00
Petr Špaček
660d502c64 Fix incorrect version bump in statistics channels
The version number for the XML statistics channel was not incremented
correctly after removal of isc_socket code in
a55589f881, and the JSON version number
was not incremented at all.
2021-11-04 18:45:36 -07:00
Evan Hunt
b3aba19582 Merge branch '2973-http-buffer-fix' into 'main'
statschannel doesn't handle multiple reads correctly

Closes #2973

See merge request isc-projects/bind9!5530
2021-11-05 01:09:44 +00:00
Evan Hunt
5f05cf97c7 CHANGES for [GL #2973] 2021-11-04 17:08:53 -07:00
Mark Andrews
0b83f1495d Handle truncating the request stream in isc_httpd
If we have had to truncate the request stream, don't resume
reading from it.
2021-11-04 17:06:36 -07:00
Mark Andrews
49531e4582 Handle HTTP/1.1 pipelined requests
Check to see whether there are outstanding requests in the
httpd receive buffer after sending the response, and if so,
process them.

Test that pipelined requests are handled by sending multiple
minimal HTTP/1.1 using netcat (nc) and checking that we get
back the same number of responses.
2021-11-04 17:05:29 -07:00
Mark Andrews
e46c64bf42 Consume the HTTP headers after processing a request
Remember the amount of space consumed by the HTTP headers, then
move any trailing data to the start of the httpd->recvbuf once
we have finished processing the request.
2021-11-04 17:00:18 -07:00
Evan Hunt
cbf8c2e019 statschannel doesn't handle multiple reads correctly
if an incoming HTTP request is incomplete, but nothing else is clearly
wrong with it, the stats channel continues reading to see if there's
more coming.  the buffer length was not being processed correctly in
this case.  also, the server state was not reset correctly when the
request was complete, so that subsequent requests could be appended to
the first buffer instead of being treated as new.

in addition fixing the above problems, this commit also increases the
size of the httpd request buffer from 1024 to 4096, because some
browsers send a lot of headers.
2021-11-04 15:52:58 +11:00
Mark Andrews
76375797b5 Merge branch '2998-cid-340918-uninitialized-variables-uninit' into 'main'
Resolve "CID 340918: Uninitialized variables (UNINIT)"

Closes #2998

See merge request isc-projects/bind9!5556
2021-11-03 09:50:53 +00:00
Mark Andrews
6b6c89b3ea Silence Coverity false positive
Coverity if failing to determine that 'priv.elements[i].length' is
actually valid when 'buf[i]' is non-NULL.  Initialise 'priv' to
zeros.
2021-11-03 20:10:34 +11:00
Michal Nowak
4bebcd4503 Merge branch 'mnowak/fix-typo-in-dns_name_copy-with-result.spatch' into 'main'
Fix typo in dns_name_copy-with-result.spatch

See merge request isc-projects/bind9!5549
2021-11-02 18:27:34 +00:00
Michal Nowak
a0d0dee4af Fix typo in dns_name_copy-with-result.spatch
A typo introduced in f3f1cab05e prevents
execution of the dns_name_copy-with-result.spatch. The replacement
should end with semicolon not a colon:

    plus: parse error:
      File "cocci/dns_name_copy-with-result.spatch", line 28, column 23, charpos = 421
      around = ':',
      whole content = + dns_name_copy(E1, E2):
2021-11-02 19:16:41 +01:00
Mark Andrews
26a9c4fba9 Merge branch '2970-bind9-xsl-is-not-properly-transmitted-over-stats-channel' into 'main'
Resolve "bind9.xsl is not properly transmitted over stats channel"

Closes #2970

See merge request isc-projects/bind9!5522
2021-11-02 11:44:44 +00:00
Mark Andrews
04e3ba0b51 Check that bind9.xsl is properly transmitted 2021-11-02 11:18:45 +00:00
Mark Andrews
5bde56a4bb Add '\n' to the end of each line when generating xsl.c
This makes the bind9.xml more readable in a browser when debugging
and also ensures that the file is properly terminated in the HTTP
transaction.
2021-11-02 11:18:45 +00:00
Mark Andrews
d051de17de Merge branch '2993-replace-instances-of-arraysize-with-array_size' into 'main'
Resolve "Replace instances of ARRAYSIZE with ARRAY_SIZE"

Closes #2993

See merge request isc-projects/bind9!5551
2021-11-02 10:57:45 +00:00
Mark Andrews
22662fc28e Replace ARRAYSIZE with ARRAY_SIZE 2021-11-02 16:14:40 +11:00
Mark Andrews
a174dfb462 Merge branch '2991-address-reported-by-coverity-in-updated-openssl-code' into 'main'
Resolve "Address reports by Coverity in updated OpenSSL code"

Closes #2991

See merge request isc-projects/bind9!5547
2021-11-01 22:37:43 +00:00
Mark Andrews
7806615714 Address bugs in opensslrsa_tofile
1) if 'key->external' is set we just need to call
   dst__privstruct_writefile
2) the cleanup of 'bufs' was incorrect as 'i' doesn't reflect the
   the current index into 'bufs'.  Use a simple for loop.

This review was triggered by Coverity reporting a buffer overrun
on 'bufs'.
2021-11-01 21:50:47 +00:00
Mark Andrews
573a5858fa Address potential memory leak in openssldh_parse()
'dh' was being assigned to key->keydata.dh too soon which could
result in a memory leak on error.  Moved the assignement of
key->keydata.dh until after dh was correct.

Coverity was reporting dead code on the error path cleaning up 'dh'
which triggered this review.
2021-11-01 21:50:47 +00:00
Michal Nowak
dfd040a5aa Merge branch 'mnowak/dst-fix-unavailable-comparekeys' into 'main'
Add comparekeys to release tarball

See merge request isc-projects/bind9!5548
2021-11-01 17:48:12 +00:00
Michal Nowak
41c8bb0ad3 Add comparekeys to release tarball
'make dist' omits lib/dns/tests/comparekeys/ (added in
7101afa23c) from release tarball it
creates which makes the unit:gcc:tarball CI job permanently fail in the
dst unit test.
2021-11-01 15:17:31 +01:00
Artem Boldariev
17716214f4 Merge branch 'artem/tls-do-not-strictly-require-key-and-cert' into 'main'
Be less strict regarding "tls" statements in the configuration file by allowing both "key-file" and "cert-file" be omitted

See merge request isc-projects/bind9!5546
2021-10-30 09:13:59 +00:00
Artem Boldariev
a19a519224 Be less strict regarding "tls" statements in the configuration file
In the 9.17.19 release "tls" statements verification code was
added. The code was too strict and assumed that every such a statement
should have both "cert-file" and "key-file" specified. This turned out
to be a regression, as in some cases we plan to use the "tls"
statement to specify TLS connection parameters.

This commit fixes this behaviour; now a "tls" statement should either
have both "cert-file" and "key-file" specified, or both should be
omitted.
2021-10-30 11:54:33 +03:00
Petr Špaček
51bb008f4b Merge branch 'pspacek/reentrant-cleanup' into 'main'
remove last remaining reference to _REENTRANT macro and fix DLZ example

See merge request isc-projects/bind9!5544
2021-10-29 07:09:20 +00:00
Petr Špaček
ed7fe739c4 remove last remaining reference to _REENTRANT macro and fix DLZ example
It was used only as guard against unused variable declaration, but the
surrounding code depends on strtok_r being defined unconditionally, so
there is no point in guarding a variable.
Glibc documentation suggests it is obsolete anyway and e.g. Meson build
system decided to ignore it. It seems to be required only by old
Solaris compiler and OpenIndiana uses gcc.
2021-10-29 09:08:20 +02:00
Petr Špaček
b2eb166758 Merge branch 'pspacek/clang-format-gen-patch' into 'main'
retain diff output if clang-format changes something

See merge request isc-projects/bind9!5543
2021-10-29 07:07:09 +00:00
Petr Špaček
ca4393fc9f retain diff output if clang-format changes something
It's major PITA trying to guess what exactly clang-format has changed,
so how CI stores patch file with changes which can be applied locally if
needed.
2021-10-28 16:45:14 +02:00
Petr Špaček
f465fe8103 Merge branch 'pspacek/placeholder' into 'main'
Add placeholder for [GL !332P]

See merge request isc-projects/bind9!5542
2021-10-28 14:12:01 +00:00
Petr Špaček
2139d4cb85 Add placeholder for [GL !332P] 2021-10-28 16:00:58 +02:00
Michał Kępień
c52df1bd73 Merge branch 'michal/disable-pylint-warning-C0209' into 'main'
Disable PyLint warning C0209

See merge request isc-projects/bind9!5538
2021-10-28 13:37:37 +00:00
Michał Kępień
860ca4e0ef Disable PyLint warning C0209
PyLint 2.11 reports a new warning, C0209 (consider-using-f-string).
Since f-strings are only available in Python 3.6+, existing scripts
cannot be updated to use this feature just yet because they would stop
working with older Python versions.  Instead, disable PyLint warning
C0209 for the time being.  Sort all disabled warnings in .pylintrc.
2021-10-28 14:03:04 +02:00
Michał Kępień
11232eb500 Merge branch 'v9_17_19-release' into 'main'
Merge 9.17.19 release branch

See merge request isc-projects/bind9!5535
2021-10-28 10:10:20 +00:00
Michał Kępień
88dde4d0be Move CHANGES entry for GL #2308
GL #2308 was originally referenced by CHANGES entry 5727.  However, the
corresponding code change turned out to be flawed and had to be reverted
in BIND 9.17.19, causing CHANGES entry 5727 to be turned into a
placeholder on the release branch.

Commit 63145fb1d3 subsequently addressed
the flaw, so the fix for GL #2308 will be included in BIND 9.17.20.
Move the relevant CHANGES entry to reflect that.
2021-10-28 12:05:58 +02:00
Michał Kępień
8e8ce6d714 Set up release notes for BIND 9.17.20 2021-10-28 12:05:58 +02:00
Michał Kępień
aef124bddb Update BIND version to 9.17.19 2021-10-28 12:05:58 +02:00
Michał Kępień
0ee28766a2 Add a CHANGES marker 2021-10-28 12:05:58 +02:00
Michał Kępień
a330d6f76f Merge branch 'michal/prepare-documentation-for-bind-9.17.19' into 'security-main'
Prepare documentation for BIND 9.17.19

See merge request isc-private/bind9!325
2021-10-28 12:05:58 +02:00
Michał Kępień
b3e5134728 Merge branch '2899-security-disable-lame-cache' into 'security-main'
[CVE-2021-25219] Disable "lame-ttl" cache

See merge request isc-private/bind9!322
2021-10-28 12:05:58 +02:00
Michał Kępień
08a2f4c0b7 Prepare release notes for BIND 9.17.19 2021-10-28 12:05:58 +02:00
Ondřej Surý
88c6b4e7af Add CHANGES and release note for [GL #2899] 2021-10-28 12:05:58 +02:00
Michał Kępień
e22506337c Add release note for GL #2911 2021-10-28 12:05:58 +02:00
Ondřej Surý
af0b8d0ba8 Enable lame response detection even with disabled lame cache
Previously, when lame cache would be disabled by setting lame-ttl to 0,
it would also disable lame answer detection.  In this commit, we enable
the lame response detection even when the lame cache is disabled.  This
enables stopping answer processing early rather than going through the
whole answer processing flow.
2021-10-28 12:05:58 +02:00
Michał Kępień
9e36b5bf09 Reorder release notes 2021-10-28 12:05:58 +02:00
Ondřej Surý
011e9418ce Disable lame-ttl cache
The lame-ttl cache is implemented in ADB as per-server locked
linked-list "indexed" with <qname,qtype>.  This list has to be walked
every time there's a new query or new record added into the lame cache.
Determined attacker can use this to degrade performance of the resolver.

Resolver testing has shown that disabling the lame cache has little
impact on the resolver performance and it's a minimal viable defense
against this kind of attack.
2021-10-28 12:05:58 +02:00
Michał Kępień
3f8dcef5a8 Tweak and reword release notes 2021-10-28 12:05:58 +02:00
Michał Kępień
db7e727e28 Tweak and reword recent CHANGES entries 2021-10-28 12:05:58 +02:00
Michał Kępień
9af0b8dbf4 Minor tweaks to PKCS#11 docs and ARM formatting
Explain more clearly what engine_pkcs11 is.  Fix improperly rendered
pre-formatted text.
2021-10-28 12:05:58 +02:00
Michał Kępień
b964ec71eb Update release checklist 2021-10-28 12:05:58 +02:00
Arаm Sаrgsyаn
02940b71a3 Merge branch '2843-openssl-3-deprecations' into 'main'
Refactoring for OpenSSL 3.0.0 support

Closes #2843

See merge request isc-projects/bind9!5385
2021-10-28 09:42:42 +00:00
Mark Andrews
df1d8c9e9b Add release note for [GL #2843] 2021-10-28 07:40:10 +00:00
Mark Andrews
58d4326766 Add CHANGES note for [GL #2843] 2021-10-28 07:40:08 +00:00
Mark Andrews
60535fc5f7 The OpenSSL engine API is deprecated in OpenSSL 3.0.0
don't use the engine API unless the OpenSSL API is less
than 3.0.0 (OPENSSL_API_LEVEL < 30000)
2021-10-28 07:39:37 +00:00
Aram Sargsyan
965bdd9894 Use OpenSSL version macro instead of function check
Unless being configured with the `no-deprecated` option, OpenSSL 3.0.0
still has the deprecated APIs present and will throw warnings during
compilation, when using them.

Make sure that the old APIs are being used only with the older versions
of OpenSSL.
2021-10-28 07:39:37 +00:00
Aram Sargsyan
e18777c758 Refactor the OpenSSL DH usage to use newer APIs
OpenSSL 3 deprecates most of the DH* family and associated APIs.

Reimplement the existing functionality using a newer set of APIs
which will be used when compiling/linking with OpenSSL 3.0.0 or newer
versions.
2021-10-28 07:39:37 +00:00
Aram Sargsyan
aa9411f62b Use the special shims file for DH shims
Since we now have a separate `openssl_shim.{c,h}` files in the `dns`
library, we can place the exisintg shims there.
2021-10-28 07:39:37 +00:00
Aram Sargsyan
32fd3e5420 Refactor the OpenSSL RSA usage to use newer APIs
OpenSSL 3 deprecates most of the RSA* family and associated APIs.

Reimplement the existing functionality using a newer set of APIs
which will be used when compiling/linking with OpenSSL 3.0.0 or newer
versions.
2021-10-28 07:39:34 +00:00
Aram Sargsyan
08a8284e62 Use the special shims file for RSA shims
Since we now have a separate `openssl_shim.{c,h}` files in the `dns`
library, we can place the exisintg shims there.
2021-10-28 07:38:56 +00:00
Aram Sargsyan
d4eb6e0a57 Refactor the OpenSSL ECDSA usage to use newer APIs
OpenSSL 3 deprecates most of the EC* family and associated APIs.

Reimplement the existing functionality using a newer set of APIs
which will be used when compiling/linking with OpenSSL 3.0.0 or newer
versions.
2021-10-28 07:38:56 +00:00
Aram Sargsyan
612e5c0adc Use the special shims file for ECDSA shims
Since we now have a separate `openssl_shim.{c,h}` files in the `dns`
library, we can place the exisintg shims there.
2021-10-28 07:38:56 +00:00
Mark Andrews
76decb5353 Use EVP_PKEY_eq() instead of deprected EVP_PKEY_cmp()
EVP_PKEY_eq() is the replacement with a smaller result range (0, 1)
instead of (-1, 0, 1).  EVP_PKEY_cmp() is mapped to EVP_PKEY_eq() when
building with older versions of OpenSSL.
2021-10-28 07:38:56 +00:00
Mark Andrews
ebea7ee97b Use EVP_RSA_gen() if available
BN and other low level functions are deprecated in OpenSSL 3.0.0
the is one of the replacement methods for generating RSA keys.
2021-10-28 07:38:56 +00:00
Aram Sargsyan
15cb706f22 Refactor the OpenSSL HMAC usage to use newer APIs
OpenSSL 3 deprecates the HMAC* family and associated APIs.

Rewrite portions of OpenSSL library usage code to use a newer
set of HMAC APIs.
2021-10-28 07:38:56 +00:00
Aram Sargsyan
2a6febd5d2 Use thinner shims for OpenSSL's EVP_MD_CTX_new() and EVP_MD_CTX_free()
The EVP_MD_CTX_new() and EVP_MD_CTX_free() functions are renamed APIs
which were previously available as EVP_MD_CTX_create() and
EVP_MD_CTX_destroy() respectively, which means that we can use them
instead of providing our own shim functions.
2021-10-28 07:38:56 +00:00
Aram Sargsyan
2563afb920 Use ERR_get_error_all() instead of deprecated ERR_get_error_line_data()
OpenSSL 3.0.0 deprecates the ERR_get_error_line_data() function.

Use ERR_get_error_all() instead of ERR_get_error_line_data() and create
a shim to use the old variant for the older OpenSSL versions which don't
have the newer ERR_get_error_all().
2021-10-28 07:38:56 +00:00
Aram Sargsyan
c45d853f44 Use EVP_MD_CTX_get0_md() instead of deprecated EVP_MD_CTX_md()
OpenSSL 3.0.0 deprecates the EVP_MD_CTX_md() function.

Use EVP_MD_CTX_md() instead of EVP_MD_CTX_get0_md() and create a shim
to use the old variant for the older OpenSSL versions which don't have
the newer EVP_MD_CTX_get0_md().
2021-10-28 07:38:56 +00:00
Aram Sargsyan
8924046753 Make the configure.ac script compatible with OpenSSL 3.0.0
OpenSSL 3.0.0 deprecates many low level API functions.

In preparation for the future support of linking BIND with OpenSSL 3.0.0
without the deprecated API functions, change the configure.ac script to
use functions which are available on all supported versions of OpenSSL
and LibreSSL.
2021-10-28 07:38:56 +00:00
Arаm Sаrgsyаn
55e10b6152 Merge branch '2972-rsa-keys-compare-typo-bug' into 'main'
Fix a bug when comparing two RSA keys

Closes #2972

See merge request isc-projects/bind9!5529
2021-10-28 07:31:13 +00:00
Aram Sargsyan
7101afa23c Add dst_key_pubcompare and dst_key_compare unit test
The dst_key_pubcompare() and dst_key_compare() didn't have a unit test,
add the unit tests which test comparing the same keys, different keys,
and, where possible, similar keys with a manually altered parameter.

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

dst_key_compare() internally uses the *_compare() functions of the
lib/dns/openssl*_link.c modules.
2021-10-27 22:23:03 +00:00
Aram Sargsyan
1ceb1f7ab0 Add CHANGES note for [GL #2972] 2021-10-27 20:35:04 +00:00
Aram Sargsyan
930e4f52a5 Fix a bug when comparing two RSA keys
When comparing different parameters of two RSA keys there is a typo
which causes the "p" prime factors to not being compared.

Fix the typo.
2021-10-27 20:34:04 +00:00
Mark Andrews
ad57f03389 Merge branch '2916-duplicate-catalog-zones-is-fatal' into 'main'
Resolve "duplicate catalog-zones is fatal"

Closes #2916

See merge request isc-projects/bind9!5432
2021-10-26 14:54:03 +00:00
Mark Andrews
d2d47e8471 Add CHANGES note for [GL #2916] 2021-10-27 01:32:57 +11:00
Mark Andrews
ae62e704bc Handle duplicate catalog zone entries gracefully
Duplicate catalog zone entries caused an assertion failure
in named during configuration.  This is now a soft error
that is detected earlier by named and also by named-checkconf.
2021-10-27 01:32:57 +11:00
Mark Andrews
54f1ea64c1 Merge branch '1542-silent-failure-of-build-when-creating-a-new-rr-type-if-code-is-out-of-range' into 'main'
Resolve "Silent failure of build when creating a new RR Type if CODE is out of range"

Closes #1542

See merge request isc-projects/bind9!2895
2021-10-25 21:52:34 +00:00
Matthijs Mekking
e073b04605 Document typenumber and classnumber format
Document the typenumber and classnumber in doc/dev/rdata so that it
is clear what the expected format is.
2021-10-25 21:33:35 +00:00
Mark Andrews
d3d22502b4 Error out if gen finds a type or class that is greater than 65535 2021-10-25 21:33:35 +00:00
Matthijs Mekking
5f3ff44914 Merge branch '2956-nsec3param-no-salt-n-pepa' into 'main'
Change nsec3param default to iter 0 salt-length 0

Closes #2956

See merge request isc-projects/bind9!5513
2021-10-25 10:08:30 +00:00
Matthijs Mekking
e713b8548c Add release note and CHANGES for #2956
Feature change.
2021-10-25 11:28:09 +02:00
Matthijs Mekking
70872062eb Update tests to match new nsec3param default
Update the nsec3 system tests to use the new default values. Change
the policy for "nsec3-other" so that we still have a test case for
non-zero salt length.
2021-10-25 11:27:23 +02:00
Matthijs Mekking
8f324b4717 Change nsec3param default to iter 0 salt-length 0
When using 'nsec3param' in 'dnssec-policy' and no specific parameters
are provided, default to zero additional iterations and no salt, as
recommended by draft-ietf-dnsop-nsec3-guidance.
2021-10-25 11:27:23 +02:00
Matthijs Mekking
8c1fc49974 Merge branch '2742-serve-stale-is-confusing' into 'main'
Update rndc serve-stale status output

Closes #2742

See merge request isc-projects/bind9!5521
2021-10-25 09:26:33 +00:00
Matthijs Mekking
b3507207d4 Add release note and CHANGES for #2742
Feature change.
2021-10-25 10:42:10 +02:00
Matthijs Mekking
380ba47329 Update rndc serve-stale status output
Explicitly show if cache is enabled or disabled, and if answering stale
data is enabled or disabled.
2021-10-25 10:42:10 +02:00
Michal Nowak
cf37b01023 Merge branch '2458-run-asan-and-tsan-with-latest-stable-gcc' into 'main'
Use Fedora image for ASAN and TSAN CI jobs; drop TSan suppressions

Closes #2458

See merge request isc-projects/bind9!4709
2021-10-22 13:13:30 +00:00
Michal Nowak
6179011a50 Drop GCC ThreadSanitizer suppresion of fstrm-originated calls
With custom fstrm library in the Fedora image which uses mutexes instead
of barriers ThreadSanitizer suppression with GCC is not necessary
anymore.
2021-10-22 12:50:43 +02:00
Michal Nowak
1f4a56cb3e Rename ASAN_OPTIONS_COMMON to ASAN_OPTIONS
Renaming the variable removes some of the complexity.
2021-10-22 12:50:43 +02:00
Michal Nowak
6ab2d89686 Use Fedora image for GCC ASAN and TSAN CI jobs
For the sake of running ASAN and TSAN jobs with the latest stable GCC,
replace "base image" (Debian Buster with GCC 8.3.0) with Fedora 34 image
with GCC 11.
2021-10-22 12:50:43 +02:00
Michal Nowak
332f19994a Merge branch 'mnowak/debian-11-bullseye' into 'main'
Add Debian 11 (bullseye)

See merge request isc-projects/bind9!5330
2021-10-22 08:33:39 +00:00
Michal Nowak
1b9a9c2829 Do not spawn Debian 9 CI jobs in merge requests 2021-10-22 10:09:17 +02:00
Michal Nowak
2b5dfae5de Add Debian 11 (bullseye) 2021-10-22 10:09:16 +02:00
Michal Nowak
77358ba664 Merge branch 'mnowak/openbsd-7.0' into 'main'
Add OpenBSD 7.0

See merge request isc-projects/bind9!5519
2021-10-22 07:38:06 +00:00
Michal Nowak
75e873ed98 Add OpenBSD 7.0 2021-10-22 09:25:36 +02:00
Mark Andrews
af17112319 Merge branch '2966-logfileconfig-system-test-is-timing-sensitive' into 'main'
Resolve "logfileconfig system test is timing sensitive"

Closes #2966

See merge request isc-projects/bind9!5516
2021-10-21 20:46:12 +00:00
Mark Andrews
f485bb19c0 Accept either 2 or 3 old versions of log file
Depending upon when the directory is sampled there may be 2
(oldest version removed and rename / reopen is in progresss) or
3 old versions of the log file.
2021-10-21 20:26:09 +00:00
Ondřej Surý
d63fdfd79c Merge branch 'ondrej/fix-missing-DNS_ZONEFLG_DUMPING-in-setmodtime' into 'main'
Add missing DNS_ZONEFLG_DUMPING to setmodtime()

See merge request isc-projects/bind9!5512
2021-10-21 10:33:03 +00:00
Ondřej Surý
55ac6b7394 Add missing DNS_ZONEFLG_DUMPING to setmodtime()
It was found, that the original commit adding the setmodtime() was
incompletely squashed and there was double check for
DNS_ZONEFLG_NEEDDUMP instead of check for DNS_ZONEFLG_NEEDDUMP and
DNS_ZONEFLG_DUMPING.

Change the duplicate check to DNS_ZONEFLG_DUMPING.
2021-10-21 12:26:02 +02:00
Evan Hunt
5714682267 Merge branch '2927-lame-server-loop' into 'main'
check for loops in ADB finds

Closes #2927

See merge request isc-projects/bind9!5474
2021-10-21 09:26:44 +00:00
Evan Hunt
1ed928dad7 CHANGES and release note for [GL #2927] 2021-10-21 02:15:55 -07:00
Evan Hunt
61ac32a989 add a system test with an ADB loop
Add a lame delegation to lame.example.org with only an A record
in the additional section; on failure, this will trigger a retry
with AAAA, which will loop. Test that dig returns SERVFAIL, in
addition to confirming that named doesn't hang on shutdown.
2021-10-21 02:15:55 -07:00
Evan Hunt
128068fde2 check for loops in ADB finds
If an ADB find is started on behalf of a resolver fetch, and fails to
find any addresses but has a pending resolver fetch associated with it,
then we need to check whether the fetch it's waiting on is the one
that created it. If so, it can never finish and needs to be terminated.
2021-10-21 02:15:43 -07:00
Evan Hunt
93f5bc893e incidental cleanup
The NAME_FETCH_A and NAME_FETCH_AAAA macros were meant to be
boolean, indicating whether the pointers were set or not, while
the NAME_FETCH_V4 and NAME_FETCH_V6 macros were meant to return
the pointer values. The latter were only used as booleans, so
they've been removed in favor of the former.

Also did some style cleanup and removed an unreachable code block.
2021-10-21 01:39:30 -07:00
Evan Hunt
6ba91a07ff Merge branch '2963-gettcp-assert' into 'main'
don't set DNS_DISPATCHSTATE_CONNECTED until attaching handle

Closes #2963

See merge request isc-projects/bind9!5515
2021-10-21 08:39:03 +00:00
Evan Hunt
c5a8454436 don't set DNS_DISPATCHSTATE_CONNECTED until attaching handle
there was a race possible in which a dispatch was put into
the 'connected' state before it had a TCP handle attached,
which could cause an assertion failure in dns_dispatch_gettcp().
2021-10-21 08:28:14 +00:00
Ondřej Surý
d4e04abb73 Merge branch 'ondrej/fix-isc_time_add-overflow' into 'main'
Fix isc_time_add() overflow

See merge request isc-projects/bind9!5511
2021-10-21 07:50:50 +00:00
Ondřej Surý
04511736a0 Add isc_time_add and isc_time_subtract unit test
The isc_time_add() and isc_time_subtract() didn't have a unit test, add
the unit test with couple of edge case vectors to check whether overflow
and underflow is correctly handled.
2021-10-21 09:31:01 +02:00
Ondřej Surý
2b147ac358 Use __builtin_*_overflow for isc_time_{add,subtract}()
Use the __builtin_uadd_overflow() and __builtin_usub_overflow() for
overflow checks in isc_time_add() and isc_time_subtract().  This
generates more efficient and safe code.
2021-10-21 09:31:01 +02:00
Ondřej Surý
8c05f12bc8 Fix isc_time_add() overflow
The isc_time_add() could overflow when t.seconds + i.seconds == UINT_MAX
and t.nanoseconds + i.nanoseconds >= NS_PER_S.

Fix the overflow in isc_time_add(), and simplify the ISC_R_RANGE checks
both in isc_time_add() and isc_time_subtract() functions.
2021-10-21 09:31:01 +02:00
Mark Andrews
d09625423c Merge branch '2944-doth-system-test-fails-with-256-file-descriptors' into 'main'
Resolve "doth system test fails with 256 file descriptors"

Closes #2944

See merge request isc-projects/bind9!5477
2021-10-20 20:45:17 +00:00
Mark Andrews
5d1e6b036a Increase the number of file descriptors for stress_http_quota.py
stress_http_quota.py uses more than 256 file descriptors and fails
on some platforms.  Increase the available descriptors to 1024.
2021-10-20 19:41:25 +00:00
Evan Hunt
d48fa3b1c4 Merge branch 'each-cleanup-qmin-test' into 'main'
fix qmin system test

See merge request isc-projects/bind9!5509
2021-10-20 06:30:05 +00:00
Evan Hunt
ac3eb921fc fix qmin system test
The qmin system test was printing spurious output.  On investigation,
the test case turned out to be both broken and ineffective: its
expectations were wrong, and it was printing the output because its
wrong expectations were not met, and those failed expectations were
not causing a test failure. All of this has been corrected.
2021-10-19 11:34:52 -07:00
Michał Kępień
3693e2aafb Merge branch 'compat/main/arm-sphinx' into 'main'
Make backward compatibility for older python-sphinx

See merge request isc-projects/bind9!5501
2021-10-19 11:46:47 +00:00
Petr Mensik
8f8bbae3fc Enable building documentation with Sphinx < 2.0.0
The ReferenceRole class is only available in Sphinx >= 2.0.0, which
makes building BIND 9 documentation impossible with older Sphinx
versions:

    Running Sphinx v1.7.6

    Configuration error:
    There is a programable error in your configuration file:

    Traceback (most recent call last):
      File "/usr/lib/python3.6/site-packages/sphinx/config.py", line 161, in __init__
        execfile_(filename, config)
      File "/usr/lib/python3.6/site-packages/sphinx/util/pycompat.py", line 150, in execfile_
        exec_(code, _globals)
      File "conf.py", line 21, in <module>
        from sphinx.util.docutils import ReferenceRole
    ImportError: cannot import name 'ReferenceRole'

Work around the problem by defining a stub version of the ReferenceRole
class if the latter cannot be imported.  This allows documentation
(without GitLab hyperlinks in release notes) to be built with older
Sphinx versions.
2021-10-19 13:41:57 +02:00
Ondřej Surý
0c10fddedc Merge branch '2953-remove-mctx-from-fctxbucket_t' into 'main'
Remove isc_mem_t from fctxbucket_t

Closes #2953

See merge request isc-projects/bind9!5506
2021-10-19 07:43:58 +00:00
Ondřej Surý
ef831e9dfe Remove isc_mem_t from fctxbucket_t
The fctxbucket_t properly attaches to the fetchctx_t, so it can safely
use its memory context.  Save a little bit of memory by removing own
memory context from fctxbucket_t.
2021-10-19 09:18:14 +02:00
Evan Hunt
2b7037fa1b Merge branch '2953-rework-the-fetchctx_t-reference-counting' into 'main'
Rewrite the fetchctx_t reference counting

Closes #2953

See merge request isc-projects/bind9!5500
2021-10-18 22:08:45 +00:00
Evan Hunt
2336bb0d9e CHANGES for [GL #2953] 2021-10-18 14:35:50 -07:00
Evan Hunt
18cc459e05 Incidental cleanup
- there are several allocation functions in adb.c that can no
  longer return NULL.
- a macro in rbt.c was never used.
2021-10-18 14:35:50 -07:00
Ondřej Surý
b01d75be36 Use fibonacci hashing for zone counter buckets
Change the 'dbuckets' hash table in resolver.c to use fibonacci
hashing like the RBT.
2021-10-18 14:35:44 -07:00
Evan Hunt
09028dd38f Simplify fctx_unlink() and fctx_destroy()
These functions are always called together; this commit
combines them.
2021-10-18 14:27:13 -07:00
Ondřej Surý
d609425bf3 Rewrite fetchctx_t reference counting
Using proper attach/detach functions for the fetch context
instead of fctx_increference() and _decreference() makes
it easier to debug reference counting errors in the resolver.

Fixed several such errors that were found as a result.
2021-10-18 14:27:13 -07:00
Evan Hunt
8dd43a8fcd Merge branch 'each-route-socket-fixes' into 'main'
fix route socket errors

See merge request isc-projects/bind9!5505
2021-10-18 21:25:28 +00:00
Evan Hunt
32b50407bf check statichandle before attaching
it is possible for udp_recv_cb() to fire after the socket
is already shutting down and statichandle is NULL; we need to
create a temporary handle in this case.
2021-10-18 14:21:04 -07:00
Evan Hunt
75427139ad attach the interface manager when activating a route socket
it was possible for the route socket's udp_recv() callback to fire
after the interfacemgr was detached, causing an assertion failure.
this has now been fixed by referencing the interfacemgr when setting up
the route socket, and dereferencing it when shutting it down.
2021-10-18 14:21:03 -07:00
Evan Hunt
9e6ed31b91 Merge branch 'each-test-fixes' into 'main'
Fix test errors that caused intermittent failures

See merge request isc-projects/bind9!5504
2021-10-18 21:19:58 +00:00
Evan Hunt
c167feb1dc Fix statistics test error
The statistics system test sometimes needs a pause to wait for the
expected stats to be reported.

Also, the test for priming queries was ineffective; the result of
the grep was not being checked.
2021-10-18 14:14:33 -07:00
Evan Hunt
3ecaccb961 Fix cds test error
The margin of error (up to 2 seconds) allowed for the inception time
in the cds system test was a bit too small, and has been increased to 3
seconds.
2021-10-18 14:13:38 -07:00
Evan Hunt
9b6060c6c4 Fix catz test error
The catz system test included a test case that was looking for a single
answer record after an update, when it should have been looking for two.
The test usually passed because of timing - the first dig usually got a
response before the update was completed - but occasionally the update
processed fast enough for the test to fail. On investigation, it turned
out to be the test that was wrong.
2021-10-18 14:13:38 -07:00
Evan Hunt
2143120636 Fix digdelv test error
The digdelv system test has a test case in which stderr was
included in the dig output. When trace logging was in use,
this confused the grep and caused a spurious test failure.
2021-10-18 14:13:05 -07:00
Evan Hunt
07e84ae54e Merge branch 'each-dispatch-fixes' into 'main'
Dispatch manager fixes

Closes #2957

See merge request isc-projects/bind9!5503
2021-10-18 21:06:56 +00:00
Evan Hunt
94496635ff silence compiler warning
Silence a warning about a signed/unsigned integer comparison.
2021-10-18 12:49:40 -07:00
Ondřej Surý
a0bb05faf6 Lock dispatch when canceling connect
When canceling pending connections, the disp->pending list
was accessed unlocked.
2021-10-18 12:46:19 -07:00
Ondřej Surý
f0931c07e7 Merge branch '2873-configuration-issues-on-solaris' into 'main'
Use correct compiler version flag in the autoconf script.

Closes #2873

See merge request isc-projects/bind9!5482
2021-10-18 13:23:06 +00:00
Ondřej Surý
7eb208005f Use correct compiler version flag in the autoconf script
The autoconf script prints used compiler version at the end of the
configure script.  Solaris native compiler doesn't support --version,
and -V has to be used which in turn isn't supported by Gcc/Clang.
Detect which version flag has to be used and call $CC with it.
2021-10-18 12:45:25 +02:00
Evan Hunt
dbcc3cb19d Merge branch '2926-netmgr-netlink' into 'main'
Use netmgr for route sockets and remove isc_socket

Closes #2926

See merge request isc-projects/bind9!5455
2021-10-15 08:27:10 +00:00
Evan Hunt
4919c7a227 CHANGES and release note for [GL #2926] 2021-10-15 01:01:25 -07:00
Evan Hunt
ab98e95f4c Don't use route socket in unit tests
Some of the libns unit tests override the isc_nmhandle_attach() and
_detach() functions. This causes a failure in ns_interface_create()
if a route socket is being used, so we add a parameter to disable it.
2021-10-15 01:01:25 -07:00
Evan Hunt
a55589f881 remove all references to isc_socket and related types
Removed socket.c, socket.h, and all references to isc_socket_t,
isc_socketmgr_t, isc_sockevent_t, etc.
2021-10-15 01:01:25 -07:00
Evan Hunt
68e8b19ddc rewrite interfacemgr to use netmgr route sockets 2021-10-15 01:01:25 -07:00
Evan Hunt
075139f60e netmgr: refactor isc__nm_incstats() and isc__nm_decstats()
route/netlink sockets don't have stats counters associated with them,
so it's now necessary to check whether socket stats exist before
incrementing or decrementing them. rather than relying on the caller
for this, we now just pass the socket and an index, and the correct
stats counter will be updated if it exists.
2021-10-15 00:57:02 -07:00
Evan Hunt
8c51a32e5c netmgr: add isc_nm_routeconnect()
isc_nm_routeconnect() opens a route/netlink socket, then calls a
connect callback, much like isc_nm_udpconnect(), with a handle that
can then be monitored for network changes.

Internally the socket is treated as a UDP socket, since route/netlink
sockets follow the datagram contract.
2021-10-15 00:56:58 -07:00
Evan Hunt
a9e35ea936 Merge branch 'each-refactor-nm-stats' into 'main'
netmgr: refactor isc__nm_incstats() and isc__nm_decstats()

See merge request isc-projects/bind9!5498
2021-10-15 07:47:40 +00:00
Evan Hunt
8d6bf826c6 netmgr: refactor isc__nm_incstats() and isc__nm_decstats()
After support for route/netlink sockets is merged, not all sockets
will have stats counters associated with them, so it's now necessary
to check whether socket stats exist before incrementing or decrementing
them. rather than relying on the caller for this, we now just pass the
socket and an index, and the correct stats counter will be updated if
it exists.
2021-10-15 00:40:37 -07:00
Mark Andrews
5307b663b2 Merge branch '2947-unexpected-deletion-of-configured-catalog-zone' into 'main'
Resolve "unexpected deletion of configured catalog zone"

Closes #2947

See merge request isc-projects/bind9!5491
2021-10-15 05:24:00 +00:00
Mark Andrews
bf9c569852 Check that existing catalog zone entries are preserved
Update the 'catz' system test by adding tests that update an
catalog zone (catalog1.example) while preserving existing entries
(increase SOA serial) then check that catalog zone has transferred
and that the existing entries have not accidentally been removed
as a consequence (can return updated zone content).
2021-10-15 15:35:14 +11:00
Mark Andrews
63145fb1d3 Prevent existing catalog zone entries being incorrectly deleted
After receiving a new version of a catalog zone it is required
to merge it with the old version.

The algorithm walks through the new version's hash table and applies
the following logic:

1. If an entry from the new version does not exist in the old
   version, then it's a new entry, add the entry to the `toadd` hash
   table.
2. If the zone does not exist in the set of configured zones, because
   it was deleted via rndc delzone or it was removed from another
   catalog zone instance, then add into to the `toadd` hash table to
   be reinstantiated.
3. If an entry from the new version also exists in the old version,
   but is modified, then add the entry to the `tomod` hash table, then
   remove it from the old version's hash table.
4. If an entry from the new version also exists in the old version and
   is the same (unmodified) then just remove it from the old version's
   hash table.

The algorithm then deletes all the remaining zones which still exist
in the old version's hash table (because only the ones that don't
exist in the new version should now remain there), then adds the ones
that were added to the `toadd`, and modifies the ones that were added
to the `tomod`, completing the merge.

During a recent refactoring, the part when the entry should be
removed from the old version's hash table on condition (4.) above
was accidentally omitted, so the unmodified zones were remaining
in the old version's hash table and consequently being deleted.
2021-10-15 04:31:37 +00:00
Mark Andrews
e0e8ab6973 Merge branch 'marka-ms-subdomain-check-srv-ptr-targets' into 'main'
Add {krb5,ms}-subdomain-self-rhs rule types

See merge request isc-projects/bind9!5499
2021-10-15 01:14:54 +00:00
Mark Andrews
19819a1f02 Release note [GL #481] 2021-10-15 11:32:17 +11:00
Mark Andrews
fd8de9e8a8 CHANGES for [GL #481] 2021-10-15 11:32:17 +11:00
Mark Andrews
bf2cde0e8a Document {krb5,ms}-subdomain-self-rhs update policy rules
Add documentation for ms-subdomain-self-rhs and krb5-subdomain-self-rhs
update policy rules.
2021-10-15 11:32:17 +11:00
Mark Andrews
4202554871 Add tests for {krb5,ms}-subdomain-self-rhs update policy rules
check that updates are accepted and rejected as expected under the
following scenarios:

* check krb5-subdomain-self-rhs match PTR
* check krb5-subdomain-self-rhs no-match PTR
* check krb5-subdomain-self-rhs match SRV
* check krb5-subdomain-self-rhs no listed types match (SRV & TXT)
* check krb5-subdomain-self-rhs no-match RDATA (SRV)
* check krb5-subdomain-self-rhs no-match TYPE (TXT)
* check krb5-subdomain-self-rhs delete PTR (matching PTR)
* check krb5-subdomain-self-rhs delete PTR (matching PTR with non-matching
  PTR)
* check krb5-subdomain-self-rhs delete ANY (matching PTR)
* check krb5-subdomain-self-rhs delete ANY (matching PTR with non-matching
  PTR)
* check krb5-subdomain-self-rhs delete SRV (matching SRV)
* check krb5-subdomain-self-rhs delete SRV (matching SRV with non-matching
  SRV)
* check krb5-subdomain-self-rhs delete ANY (matching SRV)
* check krb5-subdomain-self-rhs delete ANY (matching SRV with non-matching
  SRV)

* check ms-subdomain-self-rhs match (PTR)
* check ms-subdomain-self-rhs no-match (PTR)
* check ms-subdomain-self-rhs match (SRV)
* check ms-subdomain-self-rhs no-match (SRV)
* check ms-subdomain-self-rhs delete SRV (matching SRV)
* check ms-subdomain-self-rhs delete SRV (matching SRV with non-matching
  SRV)
* check ms-subdomain-self-rhs delete PTR (matching PTR)
* check ms-subdomain-self-rhs delete PTR (matching PTR with non-matching
  PTR)
* check ms-subdomain-self-rhs delete ANY (matching PTR)
* check ms-subdomain-self-rhs delete ANY (matching PTR with non-matching
  PTR)
* check ms-subdomain-self-rhs delete ANY (matching SRV)
* check ms-subdomain-self-rhs delete ANY (matching SRV with non-matching
  SRV)
2021-10-15 11:30:51 +11:00
Mark Andrews
93279bb4b3 Add {krb5,ms}-subdomain-self-rhs update policy rules
The new rules compare the target name in PTR and SRV records against
the machine name embedded in the kerberos principal.  This can be
used to further restrict what PTR and SRV records can be added or
deleted via dynamic updates if desired.
2021-10-15 11:18:41 +11:00
Ondřej Surý
d10968936b Merge branch 'ondrej/use-system-ephemeral-ports-in-dispatch' into 'main'
Use system ephemeral ports for default portset

See merge request isc-projects/bind9!5457
2021-10-14 16:21:31 +00:00
Ondřej Surý
6cd548db0b Use system ephemeral ports for default portset
In dispatch, use system ephemeral ports for default portset instead of
hardcoded <1024,65535> range.
2021-10-14 18:20:08 +02:00
Ondřej Surý
e3ac2bd081 Merge branch '2952-remove-manual-branch-prediction-using-__builtin_expect' into 'main'
Stop providing branch prediction information

Closes #2952

See merge request isc-projects/bind9!5496
2021-10-14 13:25:36 +00:00
Ondřej Surý
3f8071af5f Add CHANGES note for [GL #2952] 2021-10-14 15:22:57 +02:00
Ondřej Surý
8be27b308f Remove unused LIBRPZ_(UN)LIKELY macros
The librpz.h defined LIRPZ_LIKELY() and LIBRPZ_UNLIKELY() macros that
were actually unused in the code.  Remove the macros and the autoconf
check for __builtin_expect().
2021-10-14 15:22:57 +02:00
Ondřej Surý
e603983ec9 Stop providing branch prediction information
The __builtin_expect() can be used to provide the compiler with branch
prediction information.  The Gcc manual says[1] on the subject:

    In general, you should prefer to use actual profile feedback for
    this (-fprofile-arcs), as programmers are notoriously bad at
    predicting how their programs actually perform.

Stop using __builtin_expect() and ISC_LIKELY() and ISC_UNLIKELY() macros
to provide the branch prediction information as the performance testing
shows that named performs better when the __builtin_expect() is not
being used.

1. https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fexpect
2021-10-14 10:33:24 +02:00
Mark Andrews
80fedf9231 Merge branch '2326-some-of-the-statschannel-system-test-cases-fail-if-i-build-bind-9-16-9' into 'main'
Resolve "Some of the statschannel system test cases fail if I build BIND 9.16.9"

Closes #2326

See merge request isc-projects/bind9!5424
2021-10-14 06:27:23 +00:00
Mark Andrews
10c01cba61 Don't tests stats channels that haven't been configured
pytest was failing because it was testing features that had
not been configured.  test to see if those features have been
configured before running the tests.
2021-10-13 22:30:45 -07:00
Evan Hunt
ee068e2c39 Merge branch 'each-silence-coverity' into 'main'
silence dead code warning from coverity

See merge request isc-projects/bind9!5494
2021-10-13 16:52:20 +00:00
Evan Hunt
4595536a0d Remove dead code
Remove code from dns_zone_setparentals() that cannot be reached
now that set_serverslist() returns void.
2021-10-13 09:27:46 -07:00
Evan Hunt
068ab04310 Merge branch '828-rewrite-logfileconfig' into 'main'
logfileconfig fixes

Closes #828

See merge request isc-projects/bind9!5411
2021-10-13 16:26:02 +00:00
Evan Hunt
96980adbad CHANGES and release note for [GL #828] 2021-10-13 08:34:36 -07:00
Evan Hunt
9a9e906306 fixed a bug in rolling timestamp logfiles
due to comparing logfile suffixes as 32 bit rather than 64 bit
integers, logfiles with timestamp suffixes that should have been
removed when rolling could be left in place. this has been fixed.
2021-10-13 08:31:47 -07:00
Evan Hunt
76baed3343 rewrite logfileconfig system test
the logfileconfig system test did not conform to the style of
other tests, and was difficult to read and maintain. it has
been cleaned up and simplifeid in several ways:

- named.args used when appropriate so that named can be started with
  specified command line arguments, instead of having it launched
  directly from tests.sh
- unused root zone removed from named configuration
- an existing directory used instead of using 'mkdir' to create one
- dnssec-validation disabled to stop the server sending unnecessary queries

incidental fix: removed leftover debugging printfs from logconf.c.
2021-10-13 08:31:47 -07:00
Artem Boldariev
e857191b20 Merge branch '2940-do-not-free-tlsctx-on-socket-creation-failure' into 'main'
Do not call isc_tlsctx_free() on TLS listener creation failure

Closes #2940

See merge request isc-projects/bind9!5478
2021-10-13 15:09:07 +00:00
Artem Boldariev
6bf0183b19 Do not call isc_tlsctx_free() on TLS listener creation failure
This commit removes a superfluous call to isc_tlsctx_free() which was
leading to double free() error in a case of a TLS listener creation
failure.

The call is superfluous because the TLS context object is supposed to
be destroyed in ns_listenelt_destroy() only.
2021-10-13 17:50:42 +03:00
Ondřej Surý
8a22461fc5 Merge branch 'ondrej/use-pragma-once-header-guards' into 'main'
Use #pragma once as header guards

See merge request isc-projects/bind9!5467
2021-10-13 11:13:57 +00:00
Evan Hunt
31825521b0 Use "pragma once" in automatically generated header files
Files created by gen.c were still using old-style include guards.
2021-10-13 12:44:05 +02:00
Ondřej Surý
2fe5541cb2 Add missing .clang-format in the named headers directory
The .clang-format was missing in bin/named/include/named, add the
symlink to .clang-format.headers to match the rest of the source tree.
2021-10-13 12:43:58 +02:00
Ondřej Surý
f3635bcc14 Use #pragma once as header guards
Unify the header guard style and replace the inconsistent include guards
with #pragma once.

The #pragma once is widely and very well supported in all compilers that
BIND 9 supports, and #pragma once was already in use in several new or
refactored headers.

Using simpler method will also allow us to automate header guard checks
as this is simpler to programatically check.

For reference, here are the reasons for the change taken from
Wikipedia[1]:

> In the C and C++ programming languages, #pragma once is a non-standard
> but widely supported preprocessor directive designed to cause the
> current source file to be included only once in a single compilation.
>
> Thus, #pragma once serves the same purpose as include guards, but with
> several advantages, including: less code, avoidance of name clashes,
> and sometimes improvement in compilation speed. On the other hand,
> #pragma once is not necessarily available in all compilers and its
> implementation is tricky and might not always be reliable.

1. https://en.wikipedia.org/wiki/Pragma_once
2021-10-13 00:49:15 -07:00
Ondřej Surý
46fc798e66 Merge branch '1432-dns_name_dup-post-cleanup' into 'main'
Return void when ISC_R_SUCCESS is only returned value

Closes #1432

See merge request isc-projects/bind9!5471
2021-10-13 04:19:46 +00:00
Ondřej Surý
edfae82c82 dns/resolver.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_zone_setprimaries()
 * dns_zone_setparentals()
 * dns_zone_setparentals()
 * dns_zone_setalsonotify()
2021-10-13 05:48:51 +02:00
Ondřej Surý
f51a9d834c dns/view.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_view_adddelegationonly()
 * dns_view_excludedelegationonly()
2021-10-13 05:47:48 +02:00
Ondřej Surý
8fb4c5bb7a dns/ssu.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_ssutable_addrule()
 * dns_ssutable_create()
 * dns_ssutable_createdlz()
2021-10-13 05:47:48 +02:00
Ondřej Surý
ecb74bae0d dns/resolver.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_resolver_addalternate()
2021-10-13 05:47:48 +02:00
Ondřej Surý
b0a665d947 dns/rdata.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * name_duporclone()
2021-10-13 05:47:48 +02:00
Ondřej Surý
ffd09ec5f0 dns/lookup.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * build_event()
2021-10-13 05:47:48 +02:00
Ondřej Surý
ee735ba79d dns/catz.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_catz_options_copy()
 * dns_catz_options_setdefault()
 * dns_catz_entry_new()
 * dns_catz_entry_copy()
2021-10-13 05:47:48 +02:00
Mark Andrews
e12240150d Merge branch '2905-autoconf-check-for-struct-stat-pulls-in-fcntl-h-not-stat-h' into 'main'
Resolve "autoconf check for struct stat pulls in fcntl.h not stat.h"

Closes #2905

See merge request isc-projects/bind9!5426
2021-10-13 00:21:40 +00:00
Mark Andrews
c177c33c27 Use '#include <sys/stat.h>' for the stat structure definition
POSIX.1-2008 changed the st_atim, st_mtim, and st_ctime members of the
struct stat from time_t to struct timespec and because not all operating
systems already implemented this version of the standard or historically
deviated to include own nanosecond precision in the structure.

The autoconf script used to include <sys/fcntl.h> which contradicts
POSIX.1 as it mandates <sys/stat.h> inclusion.  Change the autoconf
check to include <sys/stat.h>.

Also fix the missing AC_MSG_RESULT([yes/no]) in the check.
2021-10-12 23:50:07 +00:00
Evan Hunt
33035de1de Merge branch 'each-cleanup-ancient' into 'main'
cleanup references to ancient named.conf options

Closes #357

See merge request isc-projects/bind9!5407
2021-10-12 21:43:34 +00:00
Evan Hunt
69e25f41ae cleanup references to ancient named.conf options
some removed options were still referenced in config.c or the ARM.
2021-10-12 14:01:57 -07:00
Evan Hunt
c7a51d24f6 Merge branch '2929-remove-master-slave-keywords' into 'main'
Replace "master/slave" terminology

Closes #2929

See merge request isc-projects/bind9!5466
2021-10-12 20:55:53 +00:00
Matthijs Mekking
d109e4d953 Remove unused bin/tests/named.conf
This file serves no useful purpose anymore and can thus be removed.
2021-10-12 13:12:34 -07:00
Matthijs Mekking
2af05beafa Replace "master/slave" terms in code
Replace some "master/slave" terminology in the code with the preferred
"primary/secondary" keywords. This also changes user output such as
log messages, and fixes a typo ("seconary") in cfg_test.c.

There are still some references to "master" and "slave" for various
reasons:

- The old syntax can still be used as a synonym.
- The master syntax is kept when it refers to master files and formats.
- This commit replaces mainly keywords that are local. If "master" or
  "slave" is used in for example a structure that is all over the
  place, it is considered out of scope for the moment.
2021-10-12 13:11:13 -07:00
Matthijs Mekking
af17ca9704 Replace "master/slave" terms in documentation
Replace those terms with the preferred "primary/secondary" keywords.
2021-10-12 13:09:04 -07:00
Matthijs Mekking
71b92d4d19 Replace "master/slave" terms in code comments
Replace those terms with the preferred "primary/secondary" keywords.
2021-10-12 13:09:00 -07:00
Matthijs Mekking
f3d3a4ff6e Replace "master/slave" terminology in tests
Replace most "master/slave" terminology in tests with the preferred
"primary/secondary", with the following exceptions:

- When testing the old syntax
- When master is used in master file and master file format terms
- When master is used in hostmaster or postmaster terms
- When master used in legacy domain names (for example in dig.batch)
- When there is no replacement (for example default-masters)
2021-10-12 13:04:00 -07:00
Ondřej Surý
570554149f Merge branch '2941-implement-incremental-hashing-resize' into 'main'
Implement incremental hash table resizing

Closes #2941

See merge request isc-projects/bind9!5476
2021-10-12 14:35:37 +00:00
Ondřej Surý
89c41fbd03 Add CHANGES and release note for [GL #2941] 2021-10-12 15:08:23 +02:00
Ondřej Surý
8c819ec366 dns/rbt.c: Implement incremental hash table resizing
Originally, the hash table used in RBT database would be resized when it
reached certain number of elements (defined by overcommit).  This was
causing resolution brownouts for busy resolvers, because the rehashing
could take several seconds to complete.  This was mitigated by
pre-allocating the hash table in the RBT database used for caching to be
large-enough as determined by max-cache-size.  The downside of this
solution was that the pre-allocated hash table could take a significant
chunk of the memory even when the resolver cache would be otherwise
empty because the default value for max-cache-size is 90% of available
memory.

Implement incremental resizing[1] to perform the rehashing gradually:

 1. During the resize, allocate the new hash table, but keep the old
    table unchanged.
 2. In each lookup or delete operation, check both tables.
 3. Perform insertion operations only in the new table.
 4. At each insertion also move r elements from the old table to the new
    table.
 5. When all elements are removed from the old table, deallocate it.

To ensure that the old table is completely copied over before the new
table itself needs to be enlarged, it is necessary to increase the
size of the table by a factor of at least (r + 1)/r during resizing.

In our implementation r is equal to 1.

The downside of this approach is that the old table and the new table
could stay in memory for longer when there are no new insertions into
the hash table for prolonged periods of time as the incremental
rehashing happens only during the insertions.

The upside of this approach is that it's no longer necessary to
pre-allocate large hash table, because the RBT hash table rehashing
doesn't cause resolution brownouts anymore and thus we can use the
memory as needed.

1. https://en.m.wikipedia.org/wiki/Hash_table#Dynamic_resizing
2021-10-12 15:01:53 +02:00
Matthijs Mekking
0590d71977 Merge branch '1316-toggle-the-default-of-dnssec-dnskey-kskonly-to-yes' into 'main'
Change default of dnssec-dnskey-kskonly to yes

Closes #1316

See merge request isc-projects/bind9!5472
2021-10-12 12:38:16 +00:00
Matthijs Mekking
0870d666dc Add CHANGES and release note for [GL #1316] 2021-10-12 13:46:29 +02:00
Matthijs Mekking
2abad4d969 Change default of dnssec-dnskey-kskonly to yes
The extra RRSIG on DNSKEY, CDS and CDNSKEY RRsets add to the payload,
without having added value.
2021-10-12 13:45:44 +02:00
Ondřej Surý
bfabf5489e Merge branch '1610-enable-UseSTD3ASCIIRules-in-idn2' into 'main'
Enable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions

Closes #1610

See merge request isc-projects/bind9!5464
2021-10-12 11:05:19 +00:00
Ondřej Surý
092200bffd Add CHANGES and release note for [GL #1610] 2021-10-12 12:13:33 +02:00
Matthijs Mekking
f275d42a02 Correct --with-idn references to --with-libidn2
The documentation and feature-test were using '--with-idn' but the
configure script doesn't recognize this option. The correct option to
enable IDN support is '--with-libidn2'.
2021-10-12 12:13:33 +02:00
Ondřej Surý
08008c4409 Add idna test for UseSTD3ASCIIRules=true
Add test to encode unicode sequence that encodes differently with
UseSTD3ASCIIRules=false which is default with idn2 >= 2.0.3 and
UseSTD3ASCIIRules=true which is what should be used to encode hostnames
and domains.
2021-10-12 12:11:52 +02:00
Ondřej Surý
ef8aa91740 Enable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions
libidn2 defaults to UseSTD3ASCIIRules=false. That allows arbitrary ASCII
characters to show up in the toASCII output, including space and
underscore.  Enable IDN2_USE_STD3_ASCII_RULES to the libidn2 conversion
to disallow additional characters from the conversion (see Validity
Criteria[1]).
2021-10-12 12:11:52 +02:00
Ondřej Surý
efed341c2e Merge branch '2933-bump-the-default-clang-version-to-13' into 'main'
Change the LLVM tools version to 13

Closes #2933

See merge request isc-projects/bind9!5484
2021-10-12 09:29:13 +00:00
Ondřej Surý
ed95f9fba3 Update the source code formatting using clang-format-13
clang-format-13 fixed some of the formatting that clang-format-12 got
wrong.  Update the formatting.
2021-10-12 11:14:40 +02:00
Ondřej Surý
16916ab3e3 Change the LLVM tools version to 13
LLVM 13.0.0 was released on 4. October 2021, change the default version
to the current stable.
2021-10-12 11:14:40 +02:00
Michał Kępień
840e71eeae Merge branch 'michal/properly-handle-jemalloc-autoconf-variables' into 'main'
Properly handle JEMALLOC_* Autoconf variables

See merge request isc-projects/bind9!5486
2021-10-12 09:09:06 +00:00
Michał Kępień
5178ba4cf2 Properly handle JEMALLOC_* Autoconf variables
The AX_CHECK_JEMALLOC() m4 macro sets the JEMALLOC_CFLAGS variable, not
JEMALLOC_CPPFLAGS.  Furthermore, the JEMALLOC_CFLAGS and JEMALLOC_LIBS
variables should only be included in the build flags if jemalloc was
successfully configured.  Tweak lib/isc/Makefile.am accordingly.
2021-10-12 10:44:30 +02:00
Mark Andrews
60e444848c Merge branch '2935-cid-339035-1-of-1-explicit-null-dereferenced-forward_null' into 'main'
Resolve "CID 339035 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)"

Closes #2935

See merge request isc-projects/bind9!5470
2021-10-11 23:16:22 +00:00
Mark Andrews
c48ca52851 Add CHANGES for [GL #2935] 2021-10-12 09:57:24 +11:00
Mark Andrews
0378c05ba0 Fix cleanup of signature buffer in dns_dnssec_signmessage
A NULL pointer could be freed if error handling occured.
2021-10-12 09:56:44 +11:00
Michał Kępień
e112afa156 Merge branch '2899-placeholder' into 'main'
Add placeholder for GL #2899

See merge request isc-projects/bind9!5479
2021-10-08 10:07:46 +00:00
Michał Kępień
3b0b45c4bf Add placeholder for GL #2899 2021-10-08 12:04:04 +02:00
Ondřej Surý
e96e9bba10 Merge branch '719-make-isc_result-static-CHANGES' into 'main'
Update isc_result_t developer documentation and CHANGES

Closes #719

See merge request isc-projects/bind9!5475
2021-10-07 06:48:02 +00:00
Ondřej Surý
2737bca579 Add CHANGES notes for [GL #719] 2021-10-07 08:06:54 +02:00
Ondřej Surý
848fef4d4d Update isc_result_t developer documentation
There's no multiple result.{c,h} location to defining result codes,
update the documentation accordingly.
2021-10-07 08:05:16 +02:00
Ondřej Surý
3b9d9f5afb Merge branch '2934-cid-339111-memory-corruptions-use_after_free' into 'main'
Resolve "CID 339111:  Memory - corruptions  (USE_AFTER_FREE)"

Closes #2934

See merge request isc-projects/bind9!5469
2021-10-06 15:45:58 +00:00
Mark Andrews
b7c362738d Correctly call dns_dispatch_done() in dns_dispatch_cancel()
Pass '&resp' rather than 'respp' as we have already cleared '*respp'
when we took ownership of 'resp'.
2021-10-06 17:20:38 +02:00
Ondřej Surý
2705860bb3 Merge branch '719-make-isc_result-static' into 'main'
Make isc_result a static enum

Closes #719

See merge request isc-projects/bind9!5458
2021-10-06 09:40:47 +00:00
Ondřej Surý
2e3a2eecfe Make isc_result a static enum
Remove the dynamic registration of result codes.  Convert isc_result_t
from unsigned + #defines into 32-bit enum type in grand unified
<isc/result.h> header.  Keep the existing values of the result codes
even at the expense of the description and identifier tables being
unnecessary large.

Additionally, add couple of:

    switch (result) {
    [...]
    default:
        break;
    }

statements where compiler now complains about missing enum values in the
switch statement.
2021-10-06 11:22:20 +02:00
Ondřej Surý
804ec1bcaa Improve STATIC_ASSERT macro for older compilers
Previously, when using compiler without support for static assertions,
the STATIC_ASSERT() macro would be replaced with runtime assertion.
Change the STATIC_ASSERT() macro to a version that's compile time
assertion even when using pre-C11 compilers.

Courtesy of Joseph Quinsey: https://godbolt.org/z/K9RvWS
2021-10-05 22:13:29 +02:00
Ondřej Surý
9f5985bae5 Remove duplicate DE_CONST macro
Both <isccc/util.h> and <isc/util.h> defined DE_CONST() macro.  As
<isccc/util.h> header includes <isc/util.h>, remove the macro from
<isccc/util.h> header.
2021-10-05 22:13:29 +02:00
Ondřej Surý
4d85040df5 Change the ISC_R_SUCCESS to DNS_RRL_RESULT_OK in dns_rrl()
There's value mismatch between the return type of dns_rrl() that's
dns_rrl_result_t and ISC_R_SUCCESS which belongs to isc_result_t.  This
works incidentally, because DNS_RRL_RESULT_OK == ISC_R_SUCCESS.

This would break when we change isc_result_t to be static enum in
consecutive commit.  Change the value to match the type.
2021-10-05 22:13:29 +02:00
Evan Hunt
4445d0a7d6 Merge branch '2928-coverity-fixes' into 'main'
address coverity and sanitizer reports

Closes #2928

See merge request isc-projects/bind9!5456
2021-10-05 19:30:55 +00:00
Evan Hunt
436424c458 increment fctx references while waiting for validator
We need to ensure the fctx isn't freed while the validator
is pending.
2021-10-05 10:18:48 -07:00
Evan Hunt
24dbf9849e refactor dispatch cancellation
Renamed some functions for clarity and readability:

- dns_dispatch_addresponse() -> dns_dispatch_add()
- dns_dispatch_removeresponse() -> dns_dispatch_done()

The dns_dispatch_cancel() function now calls dns_dispatch_done()
directly, so it is no longer ever necessary to call both functions.

dns_dispatch_cancel() is used to terminate dispatch connections
that are still pending, while dns_dispatch_done() is used when they
are complete.
2021-10-05 10:18:48 -07:00
Evan Hunt
2653800e0b simplify sending request events
The function send_if_done() was just a front-end for req_sendevents().
2021-10-05 10:18:48 -07:00
Evan Hunt
5948aa7766 clarify fctx_cancelquery() behavior
Cleaned up dereferencing of query objects, and added a comment
explaining it better.
2021-10-05 10:18:48 -07:00
Ondřej Surý
931779b3f6 Merge branch 'ondrej/fix-missing-OPENSSL_CFLAGS-in-bind9' into 'main'
Add OPENSSL_CFLAGS to libbind9 Makefile.am

See merge request isc-projects/bind9!5465
2021-10-05 13:15:57 +00:00
Ondřej Surý
13dfc191c5 Add OPENSSL_CFLAGS to libbind9 Makefile.am
The build would fail if the OpenSSL libraries were not in default
include path because we include <openssl/opensslv.h> header in
lib/bind9/check.c.  Add $(OPENSSL_CFLAGS) to lib/bind9/Makefile.am.
2021-10-05 13:13:53 +00:00
Artem Boldariev
1af9d8d7bb Merge branch '2794-dot-alpn-for-xfrs' into 'main'
Resolve #2794, #2884: make "dot" ALPN token negotiation to be required for XoT

Closes #2884 and #2794

See merge request isc-projects/bind9!5391
2021-10-05 08:49:27 +00:00
Artem Boldariev
cdf39260a7 Add an entry to the release notes file [GL #2794]
Mention that "dot" ALPN tag is now required for XoT.
2021-10-05 11:30:22 +03:00
Artem Boldariev
d696f5dd83 Add an entry to the CHANGES [GL #2884]
Mention that the bug making dig abort during zone transfers sometimes
is resolved.
2021-10-05 11:30:22 +03:00
Artem Boldariev
abecfdc298 DoT: do not attempt to call read callback if it is not avaialble
This commit fixes a crash in DoT code when it was attempting to call a
read callback on the later stages of the connection when it is not
available.

It also fixes [GL #2884] (back-trace provided in the bug report is
exactly the same as was seen when fixing this problem).
2021-10-05 11:26:14 +03:00
Artem Boldariev
fc3a37a2ad Add an entry to the CHANGES file [GL #2794]
Mention in the CHANGES file that "dot" ALPN token is required to be
negotiated for XoT.
2021-10-05 11:26:08 +03:00
Artem Boldariev
8cd3b9ef66 Do not allow zone transfers in dig over TLS without ALPN
This commit makes dig fail with error in case a zone transfer is
attempted over a connections where ALPN was not negotiated. All other
request types will work fine.
2021-10-05 11:23:47 +03:00
Artem Boldariev
610bd2726e Add ALPN negotiation tests to TLS DNS test set
This commits adds a set of unit tests to ensure that ALPN happens over
the connections and that the result of the negotiation can be checked.
2021-10-05 11:23:47 +03:00
Artem Boldariev
79d8af7354 Require "dot" ALPN token for incoming xfrs over XoT
This commit make the code handling incoming zone transfers to verify
if they are allowed to be done over the underlying connections. As a
result the check ensures that the "dot" ALPN token has been negotiated
over the underlying connection.
2021-10-05 11:23:47 +03:00
Artem Boldariev
382098198e Make dig advertise the "dot" ALPN token for DoT connections
This commit makes dig advertise the "dot" ALPN token to make it
possible for ALPN to happen.
2021-10-05 11:23:47 +03:00
Artem Boldariev
25b2c6ad96 Require "dot" ALPN token for zone transfer requests over DoT (XoT)
This commit makes BIND verify that zone transfers are allowed to be
done over the underlying connection. Currently, it makes sense only
for DoT, but the code is deliberately made to be protocol-agnostic.
2021-10-05 11:23:47 +03:00
Artem Boldariev
eba3278e52 Add isc_nm_xfr_allowed() function
The intention of having this function is to have a predicate to check
if a zone transfer could be performed over the given handle. In most
cases we can assume that we can do zone transfers over any stream
transport except DoH, but this assumption will not work for zone
transfers over DoT (XoT), as the RFC9103 requires ALPN to happen,
which might not be the case for all deployments of DoT.
2021-10-05 11:23:47 +03:00
Artem Boldariev
56b3f5d832 Low level code to support ALPN in DoT
This commit adds low-level code necessary to support ALPN in DoT as
XoT requires "dot" ALPN token to be negotiated on a connection for
zone transfers.
2021-10-05 11:23:47 +03:00
Mark Andrews
c75d6afc1c Merge branch '2900-listenlist_test-notify_test-and-query_test-failing' into 'main'
Resolve "listenlist_test, notify_test, and query_test failing."

Closes #2900

See merge request isc-projects/bind9!5461
2021-10-05 06:44:43 +00:00
Mark Andrews
877f52b772 Increase the number of file descriptors available
The 'listenlist_test', 'notify_test', and 'query_test' tests failed
when the descriptor limit was 256 on MacOS 11.6 with 8 cpus. On the
test platform the limit needed to be increased to ~400.  Increase
the limit to at least 1024 to give some head room.
2021-10-05 17:21:30 +11:00
Evan Hunt
0261bad3df Merge branch '88-make-libs-private' into 'main'
remove libdns init/shutdown functions

Closes #88

See merge request isc-projects/bind9!5405
2021-10-04 21:16:34 +00:00
Evan Hunt
dfccfc9361 CHANGES for [GL #88] 2021-10-04 13:58:00 -07:00
Evan Hunt
e61b76292a Remove libns init/shutdown functions
as libraries are no longer exported, these functions served
no useful purpose.
2021-10-04 13:57:34 -07:00
Evan Hunt
cd8a081a4f Remove libdns init/shutdown functions
as libdns is no longer exported, it's not necessary to have
init and shutdown functions. the only purpose they served
was to create a private mctx and run dst_lib_init(), which
can be called directly instead.
2021-10-04 13:57:32 -07:00
Artem Boldariev
372d065eff Merge branch '2925-do-not-allow-default-http' into 'main'
Do not allow defining "http" clauses named "default"

Closes #2925

See merge request isc-projects/bind9!5453
2021-10-04 15:04:07 +00:00
Artem Boldariev
79ce4441e7 Modify CHANGES [GL #2925]
Mention that it is not allowed defining "http" clauses named "default"
2021-10-04 17:29:47 +03:00
Artem Boldariev
d45df0d923 Do not allow defining "http" clauses named "default"
This name is reserved for being used in 'listen-on' statements only.
2021-10-04 17:28:30 +03:00
Evan Hunt
d27d20e6d4 Merge branch '2401-use-netmgr-for-dispatch' into 'main'
Resolve "use netmgr for dispatch"

Closes #2401

See merge request isc-projects/bind9!4601
2021-10-02 19:04:03 +00:00
Evan Hunt
d596bd04b6 Add CHANGES and release note for [GL #2401] 2021-10-02 11:43:59 -07:00
Evan Hunt
ffbe6268f5 Corrected several system test issues
- serve-stale: dig wasn't always running in background when it should.
  some of the serve-stale test cases are based on groups of dig calls
  running simultaneously in the background: the test pauses and resumes
  running after 'wait'. in some cases the final call to dig in a group
  wasn't in the background, and this sometimes caused delays that
  affected later test results.  in another case, a test was simplified
  and made more reliable by running dig in the foreground removing a
  sleep.

- serve-stale: The extension of the dig timeout period from 10 to 11
  seconds in commit 5307bf64ce was left undone in a few places and has
  now been completed.

- serve-stale: Resolver-query-timeout was set incorrectly.  a comment
  above a test case in serve-stale/tests.sh says: "We configured a long
  value of 30 seconds for resolver-query-timeout," but
  resolver-query-timeout was actually set to 10, not 30. this is now
  fixed.

- rpz: Force retransfer of the fast-expire zone, to ensure it's fully
  loaded in ns3; previously it could have been left unloaded if ns5
  wasn't up yet when ns3 attempted the zone transfer.

- statistics: The TCP4SendErr counter is incremented when a TCP dispatch
  is canceled while sending. depending on test timing, this may have
  happened by the time the statistics are dumped. worked around by
  ignoring that stat couunter when checking for errors.

- hooks: Add a prereq.sh script to prevent running under TSAN.

- zero: Disabled the servfail cache so that SERVFAIL is reported only
  when there actually is a failure, not repeatedly every time the same
  query is sent.
2021-10-02 11:43:59 -07:00
Evan Hunt
dc1203b426 resolver: Fixed shutdown processing
- Prevent shutdown races: attach/detach to dns_resolver in dns_fetch_t
  and fctx_t; delay destruction of fctx when finds are still active;
  reference the fctx while canceling; reverse the order of
  fctx_destroy() and empty_bucket().

- Don't resend queries if fetches have been canceled.

- It's possible for fctx_doshutdown() to run before a TCP connection has
  completed. if the query is not on the queries list, then it is not
  canceled, but the adbaddrinfo is freed. when tcp_connected() runs
  later, the query is in an inconstent state. to fix this, we add the
  query to queries before running dns_dispatch_connect(), instead of in
  the connect callback.

- Combined the five fctx_cleanup* functions into a single one.

- Added comments and changed some names to make this code easier to
  understand.
2021-10-02 11:43:59 -07:00
Evan Hunt
f67f524405 dispatch: Enforce original timeout when calling _getnext()
udp_recv() will call dispatch_getnext() if the message received is
invalid or doesn't match; we need to reduce the timeout each time this
happens so we can't be starved forever by someone sending garbage
packets.
2021-10-02 11:43:52 -07:00
Evan Hunt
6ea7d59ad2 dispatch: Clean up connect and recv callbacks
- disp_connected() has been split into two functions,
  udp_connected() (which takes 'resp' as an argument) and
  tcp_connected() (which takes 'disp', and calls the connect callbacks
  for all pending resps).

- In dns_dispatch_connect(), if a connection is already open, we need to
  detach the dispentry immediately because we won't be running
  tcp_connected().

- dns_disptach_cancel() also now calls the connect callbacks for pending
  TCP responses, and the response callbacks for open TCP connections
  waiting on read.

- If udp_connected() runs after dns_dispatch_cancel() has been called,
  ensure that the caller's connect callback is run.

- If a UDP connection fails with EADDRINUSE, we try again up to five
  times with a different local port number before giving up.

- If a TCP connection is canceled while still pending connection, the
  connect timeout may still fire. we attach the dispatch before
  connecting to ensure that it won't be detached too soon in this case.

- The dispentry is no longer removed from the pending list when
  deactivating, so that the connect callback can still be run if
  dns_dispatch_removeresponse() was run while the connecting was
  pending.

- Rewrote dns_dispatch_gettcp() to avoid a data race.

- startrecv() and dispatch_getnext() can be called with a NULL resp when
  using TCP.

- Refactored udp_recv() and tcp_recv() and added result logging.

- EOF is now treated the same as CANCELED in response callbacks.

- ISC_R_SHUTTINGDOWN is sent to the reponse callbacks for all resps if
  tcp_recv() is triggered by a netmgr shutdown.  (response callbacks
  are *not* sent by udp_recv() in this case.)
2021-10-02 11:39:56 -07:00
Evan Hunt
8551ad026f dispatch: Fix several connect-related issues
- startrecv() and getnext() have been rewritten.

- Don't set TCP flag when connecting a UDP dispatch.

- Prevent TCP connections from trying to connect twice.

- dns_dispatch_gettcp() can now find a matching TCP dispatch that has
  not yet fully connected, and attach to it.  when the connection is
  completed, the connect callbacks are run for all of the pending
  entries.

- An atomic 'state' variable is now used for connection state instead of
  attributes.

- When dns_dispatch_cancel() is called on a TCP dispatch entry, only
  that one entry is canceled. the dispatch itself should not be shut
  down until there are no dispatch entries left associated with it.

- Other incidental cleanup, including removing DNS_DISPATCHATTR_IPV4 and
  _IPV6 (they were being set in the dispatch attributes but never used),
  cleaning up dns_requestmgr_create(), and renaming dns_dispatch_read()
  to the more descriptive dns_dispatch_resume().
2021-10-02 11:39:56 -07:00
Ondřej Surý
e317386090 dispatch: Remove 'timeout' callback
- It is no longer necessary to pass a 'timeout' callback to
  dns_dispatch_addresponse(); timeouts are handled directly by the
  'response' callback instead.

- The netmgr handle is no longer passed to dispatch callbacks, since
  they don't (and can't) use it. instead, dispatch_cb_t now takes a
  result code, region, and argument.

- Cleaned up timeout-related tests in dispatch_test.c
2021-10-02 11:39:56 -07:00
Evan Hunt
8b532d2e64 dispatch: Refactor to eliminate dns_dispatchevent
- Responses received by the dispatch are no longer sent to the caller
  via a task event, but via a netmgr-style recv callback.  the 'action'
  parameter to dns_dispatch_addresponse() is now called 'response' and
  is called directly from udp_recv() or tcp_recv() when a valid response
  has been received.

- All references to isc_task and isc_taskmgr have been removed from
  dispatch functions.

- All references to dns_dispatchevent_t have been removed and the type
  has been deleted.

- Added a task to the resolver response context, to be used for fctx
  events.

- When the caller cancels an operation, the response handler will be
  called with ISC_R_CANCELED; it can abort immediately since the caller
  will presumably have taken care of cleanup already.

- Cleaned up attach/detach in resquery and request.
2021-10-02 11:39:56 -07:00
Evan Hunt
81a22cbf5f Remove DISPATH_TRACE, RESOLVER_TRACE and REQ_TRACE logging
Remove the debugging printfs. (leaving this as a separate commit rather
than squashing it so we can restore it in the future if we ever need it
again.)
2021-10-02 11:39:56 -07:00
Evan Hunt
7dc54fa6f2 Refactor dispatch, resolver and request
Since every dispsock was associated with a dispentry anyway (though not
always vice versa), the members of dispsock have been combined into
dispentry, which is now reference-counted.  dispentry objects are now
attached before connecting and detached afterward to prevent races
between the connect callback and dns_dispatch_removeresponse().

Dispatch and dispatchmgr objects are now reference counted as well, and
the shutdown process has been simplified.  reference counting of
resquery and request objects has also been cleaned up significantly.

dns_dispatch_cancel() now flags a dispentry as having been canceled, so
that if the connect callback runs after cancellation, it will not
initiate a read.

The isblackholed() function has been simplified.
2021-10-02 11:39:56 -07:00
Evan Hunt
08ce69a0ea Rewrite dns_resolver and dns_request to use netmgr timeouts
- The `timeout_action` parameter to dns_dispatch_addresponse() been
  replaced with a netmgr callback that is called when a dispatch read
  times out.  this callback may optionally reset the read timer and
  resume reading.

- Added a function to convert isc_interval to milliseconds; this is used
  to translate fctx->interval into a value that can be passed to
  dns_dispatch_addresponse() as the timeout.

- Note that netmgr timeouts are accurate to the millisecond, so code to
  check whether a timeout has been reached cannot rely on microsecond
  accuracy.

- If serve-stale is configured, then a timeout received by the resolver
  may trigger it to return stale data, and then resume waiting for the
  read timeout. this is no longer based on a separate stale timer.

- The code for canceling requests in request.c has been altered so that
  it can run asynchronously.

- TCP timeout events apply to the dispatch, which may be shared by
  multiple queries.  since in the event of a timeout we have no query ID
  to use to identify the resp we wanted, we now just send the timeout to
  the oldest query that was pending.

- There was some additional refactoring in the resolver: combining
  fctx_join() and fctx_try_events() into one function to reduce code
  duplication, and using fixednames in fetchctx and fetchevent.

- Incidental fix: new_adbaddrinfo() can't return NULL anymore, so the
  code can be simplified.
2021-10-02 11:39:56 -07:00
Evan Hunt
308bc46a59 Convert dispatch to netmgr
The flow of operations in dispatch is changing and will now be similar
for both UDP and TCP queries:

1) Call dns_dispatch_addresponse() to assign a query ID and register
   that we'll be listening for a response with that ID soon. the
   parameters for this function include callback functions to inform the
   caller when the socket is connected and when the message has been
   sent, as well as a task action that will be sent when the response
   arrives. (later this could become a netmgr callback, but at this
   stage to minimize disruption to the calling code, we continue to use
   isc_task for the response event.) on successful completion of this
   function, a dispatch entry object will be instantiated.

2) Call dns_dispatch_connect() on the dispatch entry. this runs
   isc_nm_udpconnect() or isc_nm_tcpdnsconnect(), as needed, and begins
   listening for responses. the caller is informed via a callback
   function when the connection is established.

3) Call dns_dispatch_send() on the dispatch entry. this runs
   isc_nm_send() to send a request.

4) Call dns_dispatch_removeresponse() to terminate listening and close
   the connection.

Implementation comments below:

- As we will be using netmgr buffers now.  code to send the length in
  TCP queries has also been removed as that is handled by the netmgr.

- TCP dispatches can be used by multiple simultaneous queries, so
  dns_dispatch_connect() now checks whether the dispatch is already
  connected before calling isc_nm_tcpdnsconnect() again.

- Running dns_dispatch_getnext() from a non-network thread caused a
  crash due to assertions in the netmgr read functions that appear to be
  unnecessary now. the assertions have been removed.

- fctx->nqueries was formerly incremented when the connection was
  successful, but is now incremented when the query is started and
  decremented if the connection fails.

- It's no longer necessary for each dispatch to have a pool of tasks, so
  there's now a single task per dispatch.

- Dispatch code to avoid UDP ports already in use has been removed.

- dns_resolver and dns_request have been modified to use netmgr callback
  functions instead of task events. some additional changes were needed
  to handle shutdown processing correctly.

- Timeout processing is not yet fully converted to use netmgr timeouts.

- Fixed a lock order cycle reported by TSAN (view -> zone-> adb -> view)
  by by calling dns_zt functions without holding the view lock.
2021-10-02 11:39:56 -07:00
Ondřej Surý
9ee60e7a17 netmgr fixes needed for dispatch
- The read timer must always be stopped when reading stops.

- Read callbacks can now call isc_nm_read() again in TCP, TCPDNS and
  TLSDNS; previously this caused an assertion.

- The wrong failure code could be sent after a UDP recv failure because
  the if statements were in the wrong order. the check for a NULL
  address needs to be after the check for an error code, otherwise the
  result will always be set to ISC_R_EOF.

- When aborting a read or connect because the netmgr is shutting down,
  use ISC_R_SHUTTINGDOWN. (ISC_R_CANCELED is now reserved for when the
  read has been canceled by the caller.)

- A new function isc_nmhandle_timer_running() has been added enabling a
  callback to check whether the timer has been reset after processing a
  timeout.

- Incidental netmgr fix: always use isc__nm_closing() instead of
  referencing sock->mgr->closing directly

- Corrected a few comments that used outdated function names.
2021-10-02 11:39:56 -07:00
Evan Hunt
d9e1ad9e37 Remove reference count REQUIRE in isc_nm_read()
Previously isc_nm_read() required references on the handle to be at
least 2, under the assumption that it would only ever be called from a
connect or accept callback. however, it can also be called from a read
callback, in which case the reference count might be only 1.
2021-10-02 11:39:56 -07:00
Evan Hunt
e76a7f764e Move isc_socket_cancel() calls into dispatch
We now use dns_dispatch_cancel() for this purpose. NOTE: The caller
still has to track whether there are pending send or connect events in
the dispatch or dispatch entry; later this should be moved into the
dispatch module as well.

Also removed some public dns_dispatch_*() API calls that are no longer
used outside dispatch itself.
2021-10-02 11:39:56 -07:00
Evan Hunt
2523be1cbe Move isc_socket_sendto2() calls into dispatch
We now use dns_dispatch_send() for this purpose.
2021-10-02 11:39:56 -07:00
Evan Hunt
655e7fcacc Move isc_socket_getsockname() calls into dispatch
We now use dns_dispentry_getlocaladdress(). (this API is likely to be
cleaned up further later.)
2021-10-02 11:39:56 -07:00
Evan Hunt
9f9a327b22 Move isc_socket_connect() calls into dispatch
dns_dispatch_connect() connects a dispatch socket (for TCP) or a
dispatch entry socket (for UDP). This is the next step in moving all
uses of the isc_socket code into the dispatch module.

This API is temporary; it needs to be cleaned up further so that it can
be called the same way for both TCP and UDP.
2021-10-02 11:39:56 -07:00
Evan Hunt
2c7232d82f Temporarily move dns_tcpmsg functionality into dispatch
Continuing the effort to move all uses of the isc_socket API into
dispatch.c, this commit removes the dns_tcpmsg module entirely, as
dispatch was its only caller, and moves the parts of its functionality
that were being used into the dispatch module.

This code will be removed when we switch to using netmgr TCPDNS.
2021-10-02 11:39:56 -07:00
Evan Hunt
4f30b679e7 Creating TCP dispatch now creates/binds the socket
Previously, creation of TCP dispatches differed from UDP in that a TCP
dispatch was created to attach to an existing socket, whereas a UDP
dispatch would be created in a vacuum and sockets would be opened on
demand when a transaction was initiated.

We are moving as much socket code as possible into the dispatch module,
so that it can be replaced with a netmgr version as easily as
possible. (This will also have the side effect of making TCP and UDP
dispatches more similar.)

As a step in that direction, this commit changes
dns_dispatch_createtcp() so that it creates the TCP socket.
2021-10-02 11:39:34 -07:00
Evan Hunt
f439eb5d99 Dispatch API simplification
- Many dispatch attributes can be set implicitly instead of being passed
  in. we can infer whether to set DNS_DISPATCHATTR_TCP or _UDP from
  whether we're calling dns_dispatch_createtcp() or _createudp().  we
  can also infer DNS_DISPATCHATTR_IPV4 or _IPV6 from the addresses or
  the socket that were passed in.

- We no longer use dup'd sockets in UDP dispatches, so the 'dup_socket'
  parameter has been removed from dns_dispatch_createudp(), along with
  the code implementing it. also removed isc_socket_dup() since it no
  longer has any callers.

- The 'buffersize' parameter was ignored and has now been removed;
  buffersize is now fixed at 4096.

- Maxbuffers and maxrequests don't need to be passed in on every call to
  dns_dispatch_createtcp() and _createudp().

  In all current uses, the value for mgr->maxbuffers will either be
  raised once from its default of 20000 to 32768, or else left
  alone. (passing in a value lower than 20000 does not lower it.) there
  isn't enough difference between these values for there to be any need
  to configure this.

  The value for disp->maxrequests controls both the quota of concurrent
  requests for a dispatch and also the size of the dispatch socket
  memory pool. it's not clear that this quota is necessary at all. the
  memory pool size currently starts at 32768, but is sometimes lowered
  to 4096, which is definitely unnecessary.

  This commit sets both values permanently to 32768.

- Previously TCP dispatches allocated their own separate QID table,
  which didn't incorporate a port table. this commit removes
  per-dispatch QID tables and shares the same table between all
  dispatches. since dispatches are created for each TCP socket, this may
  speed up the dispatch allocation process. there may be a slight
  increase in lock contention since all dispatches are sharing a single
  QID table, but since TCP sockets are used less often than UDP
  sockets (which were already sharing a QID table), it should not be a
  substantial change.

- The dispatch port table was being used to determine whether a port was
  already in use; if so, then a UDP socket would be bound with
  REUSEADDR. this commit removes the port table, and always binds UDP
  sockets that way.
2021-10-02 10:21:49 +02:00
Evan Hunt
9fd375217d Remove DNS_DISPATCHATTR_MAKEQUERY
This attribute was set but was no longer being used.
2021-10-02 10:21:46 +02:00
Evan Hunt
5dcf55da03 Remove support for shared UDP dispatch sockets
Currently the netmgr doesn't support unconnected, shared UDP sockets, so
there's no reason to retain that functionality in the dispatcher prior
to porting to the netmgr.

In this commit, the DNS_DISPATCHATTR_EXCLUSIVE attribute has been
removed as it is now non-optional; UDP dispatches are alwasy exclusive.
Code implementing non-exclusive UDP dispatches has been removed.
dns_dispatch_getentrysocket() now always returns the dispsocket for UDP
dispatches and the dispatch socket for TCP dispatches.

There is no longer any need to search for existing dispatches from
dns_dispatch_getudp(), so the 'mask' option has been removed, and the
function renamed to the more descriptive dns_dispatch_createudp().
2021-10-02 10:21:43 +02:00
Evan Hunt
300392ae2f General code refactoring
- style cleanup
- removed NULL checks in places where they are not currently needed
- use isc_refcount for dispatch reference counting
- revised code flow for readability
- remove some #ifdefs that are no longer relevant
- remove unused struct members
- removed unnecessary function parameters
- use C99 struct initialization
2021-10-02 10:21:38 +02:00
Evan Hunt
5863acc907 Make sharing of pending TCP dispatches nonoptional
The DNS_REQUESTOPT_SHARE flag was added when client-side pipelining of
TCP queries was implemented. there was no need to make it optional;
forcing it to be in effect for all requests simplfiies the code.
2021-10-02 10:21:35 +02:00
Evan Hunt
ca11f68d61 Simplify dns_dispatchmgr_create with fixed buffersize
- UDP buffersize is now established when creating dispatch manager
  and is always set to 4096.

- Set up the default port range in dispatchmgr before setting the magic
  number.

- Magic is not set until dispatchmgr is fully created.
2021-10-02 10:21:32 +02:00
Evan Hunt
57fce0e895 Remove some DNS_DISPATCHATTR flags
- DNS_DISPATCHATTR_CANREUSE was never set. the code that implements it
  has been removed.

- DNS_DISPATCHOPT_FIXEDID and DNS_DISPATCHATTR_FIXEDID were both
  defined, but only the DISPATCHOPT was ever set; it appears the
  DISPATCHATTR was added accidentally.

- DNS_DISPATCHATTR_NOLISTEN was set but never used.
2021-10-02 10:21:25 +02:00
Evan Hunt
c69f2018a3 Remove unused code in dispatch.c
Some routines in dispatch.c are obsolete and unused; clean them up
before porting to netmgr.
2021-10-02 10:21:22 +02:00
Vicky Risk
a480522f6e Merge branch '2913-release-checklist-for-bind-is-missing-a-step-for-the-official-docker-image' into 'main'
Resolve "Release checklist for BIND + a step for the official docker image"

Closes #2913

See merge request isc-projects/bind9!5436
2021-10-01 15:41:23 +00:00
Vicky Risk
829d02fa3f Update Release.md to break out steps required to build and update packages 2021-10-01 15:21:59 +00:00
Artem Boldariev
39584a5226 Merge branch 'artem/tls-protocols-conf' into 'main'
Resolve #2795, #2796: implement TLS configuration options to make it possible to specify supported TLS versions and implement perfect forward secrecy for DoH and DoT

Closes #2796 and #2795

See merge request isc-projects/bind9!5444
2021-10-01 13:28:14 +00:00
Artem Boldariev
4369d94f68 Provide an example of forward secrecy enabled TLS configuration
This commit adds and example of a perfect forward secrecy enabled TLS
configuration intended to be used as a starting point.
2021-10-01 15:56:02 +03:00
Artem Boldariev
834bb4e52b Modify release notes [GL #2796]
Mention the new "tls" clause options in the release notes.
2021-10-01 15:56:02 +03:00
Artem Boldariev
503a9a56b2 Modify release notes [GL #2795]
Mention that it is now possible to specify supported TLS protocol
versions.
2021-10-01 15:56:02 +03:00
Artem Boldariev
bbf758a6fd Modify CHANGES [GL #2796]
Mention the new "tls" options in the CHANGES file.
2021-10-01 15:55:57 +03:00
Artem Boldariev
17d2b3c8db Modify CHANGES [GL #2795]
Mention in the CHANGES file that supported TLS versions can be
specified in the configuration file.
2021-10-01 15:51:40 +03:00
Artem Boldariev
9c34fa2896 Mention that "tls" options defaults are outside of our control
We have to mention that every option within a "tls" clause has
defaults out of our control as some platforms have means for defining
encryption policies globally for any application on the system.

In order to comply with these policies, we have not to modify TLS
contexts settings, unless we have to do so according to the options
specified within "tls" clauses.
2021-10-01 15:50:43 +03:00
Artem Boldariev
c759f25c7b Add "session-tickets" options to the "tls" clause
This commit adds the ability to enable or disable stateless TLS
session resumption tickets (see RFC5077). Having this ability is
twofold.

Firstly, these tickets are encrypted by the server, and the algorithm
might be weaker than the algorithm negotiated during the TLS session
establishment (it is in general the case for TLSv1.2, but the generic
principle applies to TLSv1.3 as well, despite it having better ciphers
for session tickets). Thus, they might compromise Perfect Forward
Secrecy.

Secondly, disabling it might be necessary if the same TLS key/cert
pair is supposed to be used by multiple servers to achieve, e.g., load
balancing because the session ticket by default gets generated in
runtime, while to achieve successful session resumption ability, in
this case, would have required using a shared key.

The proper alternative to having the ability to disable stateless TLS
session resumption tickets is to implement a proper session tickets
key rollover mechanism so that key rotation might be performed
often (e.g. once an hour) to not compromise forward secrecy while
retaining the associated performance benefits. That is much more work,
though. On the other hand, having the ability to disable session
tickets allows having a deployable configuration right now in the
cases when either forward secrecy is wanted or sharing the TLS
key/cert pair between multiple servers is needed (or both).
2021-10-01 15:50:43 +03:00
Artem Boldariev
16c6e2be06 Add "prefer-server-ciphers" options to the "tls" clause
This commit adds support for enforcing the preference of server
ciphers over the client ones. This way, the server attains control
over the ciphers priority and, thus, can choose more strong cyphers
when a client prioritises less strong ciphers over the more strong
ones, which is beneficial when trying to achieve Perfect Forward
Secrecy.
2021-10-01 15:50:43 +03:00
Artem Boldariev
3b88d783a2 Add "ciphers" options to the "tls" clause
This commit adds support for setting TLS cipher list string in the
format specified in the OpenSSL
documentation (https://www.openssl.org/docs/man1.1.1/man1/ciphers.html).

The syntax of the cipher list is verified so that specifying the wrong
string will prevent the configuration from being loaded.
2021-10-01 15:50:43 +03:00
Artem Boldariev
f2ae4c8480 DH-parameters loading support
This commit adds support for loading DH-parameters (Diffie-Hellman
parameters) via the new "dhparam-file" option within "tls" clause. In
particular, Diffie-Hellman parameters are needed to enable the range
of forward-secrecy enabled cyphers for TLSv1.2, which are getting
silently disabled otherwise.
2021-10-01 15:50:43 +03:00
Artem Boldariev
992f815770 Add "protocols" options to the "tls" clause
This commit adds the ability to specify allowed TLS protocols versions
within the "tls" clause. If an unsupported TLS protocol version is
specified in a file, the configuration file will not pass
verification.

Also, this commit adds strict checks for "tls" clauses verification,
in particular:

- it ensures that loading configuration files containing duplicated
"tls" clauses is not allowed;

- it ensures that loading configuration files containing "tls" clauses
missing "cert-file" or "key-file" is not allowed;

- it ensures that loading configuration files containing "tls" clauses
named as "ephemeral" or "none" is not allowed.
2021-10-01 15:50:43 +03:00
Artem Boldariev
9e039986cd TLS: set some common options both for client and server contexts
This commit makes the TLS context manipulation code set some of the
common protocol versions regardless of the OpenSSL version in use.
2021-10-01 15:50:42 +03:00
Arаm Sаrgsyаn
aae268b6c8 Merge branch '2308-catz-reload-when-missing-a-zone' into 'main'
Handle a missing zone when reloading a catalog zone

Closes #2308

See merge request isc-projects/bind9!5442
2021-09-30 19:52:00 +00:00
Aram Sargsyan
3edaa0bde6 Add CHANGES and release notes for [GL #2308] 2021-09-30 19:19:43 +00:00
Aram Sargsyan
94a5712801 Handle a missing zone when reloading a catalog zone
Previously a missing/deleted zone which was referenced by a catalog
zone was causing a crash when doing a reload.

This commit will make `named` to ignore the fact that the zone is
missing, and make sure to restore it later on.
2021-09-30 19:14:12 +00:00
Ondřej Surý
2b5d3f125c Merge branch '2921-replace-xmalloc_true-with-own-assertions' into 'main'
Use assertions to check for failed allocations

See merge request isc-projects/bind9!5449
2021-09-30 13:52:01 +00:00
Ondřej Surý
c3250a9b81 Use assertions to check for failed allocations
It was discovered that named could crash due to a segmentation fault
when jemalloc was in use and memory allocation failed.  This was not
intended to happen as jemalloc's "xmalloc" option was set to "true" in
the "malloc_conf" configuration variable.  However, that variable was
only set after jemalloc was already done with parsing it, which
effectively caused setting that variable to have no effect.

While investigating this issue, it was also discovered that enabling the
"xmalloc" option makes jemalloc use a slow processing path, decreasing
its performance by about 25%. [1]

Additionally, further testing (carried out after fixing the way
"malloc_conf" was set) revealed that the non-default configuration
options do not have any measurable effect on either authoritative or
recursive DNS server performance.

Replace code setting various jemalloc options to non-default values with
assertion checks of mallocx()/rallocx() return values.

[1] https://github.com/jemalloc/jemalloc/pull/523
2021-09-30 13:54:55 +02:00
Artem Boldariev
7b18cdc315 Merge branch '2924-fix-heap-user-after-free-when-checking-for-http-duplicates' into 'main'
Fix heap use after free when checking for "http" duplicates

Closes #2924

See merge request isc-projects/bind9!5452
2021-09-30 09:16:43 +00:00
Artem Boldariev
6499ae021c Modify CHANGES [GL #2924]
Mention that heap-use-after-free when checking for "http" duplicates
is fixed.
2021-09-30 11:56:10 +03:00
Artem Boldariev
ef65d32594 Fix heap use after free when checking for "http" duplicates
This commit fixes heap use after free when checking BIND's
configuration files for errors with http clauses.  The old code
was unnecessarially copying the http element name and freeing
it to early.  The name is now used directly.
2021-09-30 11:56:10 +03:00
Artem Boldariev
52f411b288 Merge branch '2923-validate-doh-path-in-dig' into 'main'
Validate HTTP path passed to dig

Closes #2923

See merge request isc-projects/bind9!5451
2021-09-30 08:36:58 +00:00
Artem Boldariev
b20a8c5065 Modify CHANGES [GL #2923]
Mention that the HTTP path is now validated.
2021-09-29 19:42:18 +03:00
Artem Boldariev
0d5e0b9922 Validate HTTP path passed to dig
The commit makes sure that the HTTP path passed to dig is a valid one.
2021-09-29 19:42:03 +03:00
Ondřej Surý
4ce5f94333 Merge branch '2908-rwlock-with-reader-and-writer-both-waiting' into 'main'
Resolve "rwlock with reader and writer both waiting"

Closes #2908

See merge request isc-projects/bind9!5421
2021-09-29 15:56:35 +00:00
Mark Andrews
c04bce278f Add CHANGES note for [GL #2908] 2021-09-29 17:36:19 +02:00
Mark Andrews
4e1faa35d5 Pause the dbiterator before calling dns_db_find
zone.c:integrity_checks() acquires a read lock while iterating the
zone database, and calls zone_check_mx() which acquires another
read lock. If another thread tries to acquire a write lock in the
meantime, it can deadlock. Calling dns_dbiterator_pause() to release
the first read lock prevents this.
2021-09-29 17:35:57 +02:00
Mark Andrews
214c985876 Merge branch '2911-9-16-21-regression-legacy-check-names-configuration-does-not-work-anymore' into 'main'
Resolve "9.16.21 Regression: Legacy check-names configuration does not work anymore"

Closes #2911

See merge request isc-projects/bind9!5425
2021-09-29 09:42:54 +00:00
Mark Andrews
14249ce9fe Add CHANGES note for [GL #2911] 2021-09-29 09:18:59 +00:00
Mark Andrews
0b0d400d7c Check that 'check-names {secondary|slave} ignore;' works 2021-09-29 09:18:59 +00:00
Mark Andrews
9107c8caeb Check that 'check-names master ignore;' works 2021-09-29 09:18:59 +00:00
Mark Andrews
a3c6516a75 Fix "check-names master" and "check-names slave"
check for type "master" / "slave" at the same time as checking
for "primary" / "secondary" as we step through the maps.

Checking "primary" then "master" or "master" then "primary" does
not work as the synomym is not checked for to stop the search.
Similarly with "secondary" and "slave".
2021-09-29 09:18:59 +00:00
Mark Andrews
cb16ba3a41 Merge branch '2909-pointers-used-before-validation' into 'main'
Resolve "Pointers used before validation"

Closes #2909

See merge request isc-projects/bind9!5443
2021-09-29 01:41:25 +00:00
Mark Andrews
06a69e03ac Address use before NULL check warning of obj
move deference of obj to after NULL check
2021-09-28 11:57:47 +10:00
Mark Andrews
8fc9bb8e8e Address use before NULL check warning of ievent->sock
Reorder REQUIRE checks to ensure ievent->sock is checked earlier
2021-09-28 11:57:47 +10:00
Mark Andrews
7079829b84 Address use before NULL check warning of uvreq
move dereference of uvreq until the after NULL check.
2021-09-28 11:57:47 +10:00
Mark Andrews
eeec53eb5d Merge branch '2910-unknown-system-test-doesn-t-leave-forensics' into 'main'
Resolve "unknown system test doesn't leave forensics"

Closes #2910

See merge request isc-projects/bind9!5422
2021-09-24 03:34:18 +00:00
Mark Andrews
96b7421f8c Preserve dig results in case of test failure 2021-09-24 03:07:31 +00:00
Ondřej Surý
4054ec87cd Merge branch '2917-preserve-the-contents-of-tcp-buffer' into 'main'
Preserve the contents of socket buffer on realloc

Closes #2917

See merge request isc-projects/bind9!5437
2021-09-23 21:21:38 +00:00
Ondřej Surý
d717975e3e Add CHANGES and release notes for [GL #2917] 2021-09-23 22:36:01 +02:00
Ondřej Surý
8248da3b83 Preserve the contents of socket buffer on realloc
On TCPDNS/TLSDNS read callback, the socket buffer could be reallocated
if the received contents would be larger than the buffer.  The existing
code would not preserve the contents of the existing buffer which lead
to the loss of the already received data.

This commit changes the isc_mem_put()+isc_mem_get() with isc_mem_reget()
to preserve the existing contents of the socket buffer.
2021-09-23 22:36:01 +02:00
Ondřej Surý
f0e5428f78 Merge branch 'ondrej/introduce-isc_mem_reget' into 'main'
Add isc_mem_reget() function to realloc isc_mem_get allocations

See merge request isc-projects/bind9!5440
2021-09-23 20:35:29 +00:00
Ondřej Surý
d72d0149b0 Add CHANGES note for [GL !5440] 2021-09-23 22:17:15 +02:00
Ondřej Surý
8edbd0929f Use isc_mem_reget() to handle the internal active handle cache
The netmgr, has an internal cache for freed active handles.  This cache
was allocated using isc_mem_allocate()/isc_mem_free() API because it was
simpler to reallocate the cache when we needed to grow it.  The new
isc_mem_reget() function could be used here reducing the need to use
isc_mem_allocate() API which is tad bit slower than isc_mem_get() API.
2021-09-23 22:17:15 +02:00
Ondřej Surý
15d6249260 Use isc_mem_reget() when growing buffer dynamically
Previously, we cannot use isc_mem_reallocate() for growing the buffer
dynamically, because the memory was allocated using the
isc_mem_get()/isc_mem_put() API.  With the introduction of the
isc_mem_reget() function, we can use grow/shrink the memory directly
without always moving the memory around as the allocator might have
reserved some extra space after the initial allocation.
2021-09-23 22:17:15 +02:00
Ondřej Surý
4cdb3abf27 Return non-NULL pointer on zero-sized allocations and reallocations
Previously, the zero-sized allocations would return NULL pointer and the
caller had to make sure to not dereference such pointer.  The C standard
defines the zero-sized calls to malloc() as implementation specific and
jemalloc mallocx() with zero size would be undefined behaviour.  This
complicated the code as it had to handle such cases in a special manner
in all allocator and deallocator functions.

Now, for realloc(), the situation is even more complicated.  In C
standard up to C11, the behavior would be implementation defined, and
actually some implementation would free to orig ptr and some would not.
Since C17 (via DR400) would deprecate such usage and since C23, the
behaviour would be undefined.

This commits changes helper mem_get(), mem_put() and mem_realloc()
functions to grow the zero-allocation from 0 to sizeof(void *).

This way we get a predicable behaviour that all the allocations will
always return valid pointer.
2021-09-23 22:17:15 +02:00
Ondřej Surý
aeb3d1cab3 Add isc_mem_reget() function to realloc isc_mem_get allocations
The isc_mem_get() and isc_mem_put() functions are leaving the memory
allocation size tracking to the users of the API, while
isc_mem_allocate() and isc_mem_free() would track the sizes internally.
This allowed to have isc_mem_rellocate() to manipulate the memory
allocations by the later set, but not the former set of the functions.

This commit introduces isc_mem_reget(ctx, old_ptr, old_size, new_size)
function that operates on the memory allocations with external size
tracking completing the API.
2021-09-23 11:18:07 -07:00
Matthijs Mekking
c5c6a76e8c Merge branch 'matthijs-fix-arm-typos' into 'main'
The s stands for security

See merge request isc-projects/bind9!5428
2021-09-23 07:52:09 +00:00
Matthijs Mekking
4e3ba81696 Remove copy paste error on zone-max-ttl
The "zone-max-ttl" option inside a "dnssec-policy" is not used to cap
the TTLs in a zone, only yo calculate key rollover timings.
2021-09-23 09:51:40 +02:00
Matthijs Mekking
9ddc23b2bf Add a note about salt length
Apparently it is confusing that you don't specify a specific salt,
but a salt length.
2021-09-23 09:51:40 +02:00
Matthijs Mekking
a73a07832e The s stands for security
So "hardware security modules" not "hardware service modules"
2021-09-23 09:51:40 +02:00
Ondřej Surý
db00265dec Merge branch '2814-DLZ-drivers-additional-cleanups' into 'main'
Remove the DLZ driver documentation

Closes #2814

See merge request isc-projects/bind9!5431
2021-09-21 09:37:33 +00:00
Ondřej Surý
c478c77763 Remove CONTRIB_DLZ traces from bin/named/main.c
The named main.c had leftovers guarded by CONTRIB_DLZ macro which
has been removed.  This commit removes the dead code surrounded
by ifdef CONTRIB_DLZ.
2021-09-21 11:16:53 +02:00
Ondřej Surý
5acac71f20 Remove the DLZ driver documentation
Remove the last traces of static DLZ drivers from ARM.
2021-09-21 11:16:53 +02:00
Ondřej Surý
0b983fe2e5 Merge branch 'ondrej/remove-cruft-from-contrib' into 'main'
Remove old-style DLZ drivers linked into named at compile time

Closes #2814

See merge request isc-projects/bind9!5427
2021-09-20 21:01:40 +00:00
Ondřej Surý
e543054d56 Add CHANGES and release note for [GL #2814] 2021-09-20 22:26:17 +02:00
Ondřej Surý
b9319fc998 Remove couple old and rusty scripts from contrib/
* dnssec-keyset.sh - obsoleted by dnssec-policy
* named-bootconf.sh - unmaintained script from NetBSD that would
		      generate named.conf
2021-09-20 22:26:17 +02:00
Ondřej Surý
57b8a12734 Remove scripts to convert KASP to old dnssec-keymgr policy
The dnssec-keymgr has been replaces with dnssec-policy in the named, so
there's no need to carry the conversion script in the contrib/ anymore.
2021-09-20 22:26:17 +02:00
Ondřej Surý
b964e7882b Remove dnspriv example from the contrib directory
BIND 9 has now native DoH support, so there's no need to have nginx
proxy example in the contrib/ directory.
2021-09-20 22:26:17 +02:00
Ondřej Surý
354c5a358b Remove the mkdane.sh script from contrib directory
Better and maintained alternatives exists, f.e. sshfp package contains a
dane tool: https://github.com/xelerance/sshfp/
2021-09-20 22:26:17 +02:00
Ondřej Surý
67f76b1269 Add static Makefile to mysql and mysqldyn DLZ modules
Previously, the Makefiles for mysql and mysqldyn DLZ modules were
generated from autoconf to get CFLAGS and LIBS for MariaDB or MySQL
libraries.  The static Makefiles uses a simpler method by calling
`mysql_config` directly from the Makefile.
2021-09-20 22:26:17 +02:00
Ondřej Surý
e0f84e22ed Remove old-style DLZ drivers linked into named at compile time
The old-style DLZ drivers were already marked as no longer actively
maintained and expected to be removed eventually.  With the new automake
build system, the old-style DLZ drivers were not updated, and instead of
putting an effort into something that's not being maintained, let's
rather remove the unmaintained code.

Closes: #2814
2021-09-20 22:26:16 +02:00
Ondřej Surý
be99fc92b6 Merge branch '2882-deprecate-and-remove-masterfile-map-option' into 'main'
Remove the masterfile-format type 'map'

Closes #2882

See merge request isc-projects/bind9!5417
2021-09-17 07:10:48 +00:00
Ondřej Surý
c6e5a4bbc3 Add CHANGES and release note for [GL #2882] (removal) 2021-09-17 07:09:50 +02:00
Ondřej Surý
edee9440d0 Remove the mastefile-format map option
As previously announced, this commit removes the masterfile-format
format 'map' from named, all the tools, the documentation and the
system tests.
2021-09-17 07:09:50 +02:00
Ondřej Surý
1cc866fdef Merge branch '2882-deprecate-masterfile-map-option' into 'main'
Mark the masterfile-format type 'map' as deprecated

Closes #2882

See merge request isc-projects/bind9!5418
2021-09-17 04:18:19 +00:00
Ondřej Surý
c518036988 Add CHANGES and releases notes for [GL #2882] 2021-09-17 05:58:02 +02:00
Ondřej Surý
f4e6348f29 Add masterfile-format checkconf tests
Add tests that check that masterfile-format map generate deprecation
warning and mastefile-formats text and raw doesn't.
2021-09-17 05:58:02 +02:00
Ondřej Surý
6b7a488cbc Mark the masterfile-format type 'map' as deprecated
The map masterfile-format is very fragile and it needs API bump every
time a RBTDB data structures changes.  Also while testing it, we found
out that files larger than 2GB weren't loading and nobody noticed, and
loading many map files were also failing (subject to kernel limits).

Thus we are marking the masterfile-format type 'map' as deprecated and
to be removed in the next stable BIND 9 release.
2021-09-17 05:58:02 +02:00
Michal Nowak
04e3983817 Merge branch 'mnowak/replace-centos-with-oraclelinux' into 'main'
Replace CentOS 7 & 8 with Oracle Linux

See merge request isc-projects/bind9!5179
2021-09-16 14:02:26 +00:00
Michal Nowak
3085edf1a0 Replace CentOS 7 & 8 with Oracle Linux 2021-09-16 15:33:32 +02:00
Michał Kępień
ba181fe83d Merge branch 'michal/regenerate-man-pages-with-docutils-0.17.1' into 'main'
Regenerate man pages with docutils 0.17.1

See merge request isc-projects/bind9!5415
2021-09-16 09:00:01 +00:00
Michał Kępień
ffd1e71fdf Regenerate man pages with docutils 0.17.1
The Debian 10 (buster) Docker image, which GitLab CI uses for building
documentation, currently contains the following package versions:

  - Sphinx 4.2.0
  - sphinx-rtd-theme 1.0.0
  - docutils 0.17.1

Regenerate the man pages to match contents produced in a Sphinx
environment using the above package versions.  This is necessary to
prevent the "docs" GitLab CI job from failing.
2021-09-16 10:57:04 +02:00
Mark Andrews
f735eead0a Merge branch '2906-sig-signing-type-breaks-named-checkconf-p-pretty-output' into 'main'
Resolve "sig-signing-type breaks `named-checkconf -p` pretty output"

Closes #2906

See merge request isc-projects/bind9!5410
2021-09-16 08:41:26 +00:00
Mark Andrews
1dbca07b5a Add CHANGES for [GL #2906] 2021-09-16 18:19:37 +10:00
Mark Andrews
da0991d93b Check that sig-signing-type works
* showprivate needed to be extended to support the alternate type

* checkprivate updated to error when expected records are not present
2021-09-16 18:17:22 +10:00
Mark Andrews
79d665e841 Test that sig-signing-type is accepted 2021-09-16 18:17:22 +10:00
Mark Andrews
7f5f7b2d7b Specifying sig-signing-type causes named to fail
the range check error was being applied unconditionally
2021-09-16 18:17:22 +10:00
Evan Hunt
06a4c1d068 Merge branch '2903-cache-file' into 'main'
deprecate and remove "cache-file"

Closes #2903

See merge request isc-projects/bind9!5404
2021-09-16 07:39:11 +00:00
Evan Hunt
a27860ba57 mark "cache-file" as ancient and remove all code implementing it
"cache-file" was already documented as intended for testing
purposes only and not to be used, so we can remove it without
waiting.  this commit marks the option as "ancient", and
removes all the documentation and implementing code, including
dns_cache_setfilename() and dns_cache_dump().

it also removes the documentation for the '-x cachefile`
parameter to named, which had already been removed, but the man
page was not updated at the time.
2021-09-16 00:19:02 -07:00
Evan Hunt
a67d008ba5 deprecate "cache-file"
this commit marks the "cache-file" option as deprecated.
2021-09-16 00:19:02 -07:00
Michał Kępień
b3542aec55 Merge branch '2907-address-pylint-2.10.2-warnings' into 'main'
Address PyLint 2.10.2 warnings

Closes #2907

See merge request isc-projects/bind9!5412
2021-09-16 06:51:05 +00:00
Michał Kępień
e5944bc610 Remove redundant prefix from Python 3 strings
Address the following warnings reported by PyLint 2.10.2:

    ************* Module conf
    doc/arm/conf.py:90:10: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/arm/conf.py:92:12: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/arm/conf.py:93:9: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/arm/conf.py:143:31: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/man/conf.py:33:10: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/man/conf.py:38:12: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
    doc/man/conf.py:39:9: W1406: The u prefix for strings is no longer necessary in Python >=3.0 (redundant-u-string-prefix)
2021-09-16 08:22:01 +02:00
Michał Kępień
6a4b8b1456 Explicitly specify encoding for open() calls
Address the following warnings reported by PyLint 2.10.2:

    ************* Module tests-checkds
    bin/tests/system/checkds/tests-checkds.py:70:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
    bin/tests/system/checkds/tests-checkds.py:120:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
    bin/tests/system/checkds/tests-checkds.py:206:17: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
    ************* Module yamlget
    bin/tests/system/digdelv/yamlget.py:22:5: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
    ************* Module stress_http_quota
    bin/tests/system/doth/stress_http_quota.py:131:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
    ************* Module tests-rpz-passthru-logging
    bin/tests/system/rpzextra/tests-rpz-passthru-logging.py:40:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
    bin/tests/system/rpzextra/tests-rpz-passthru-logging.py:44:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
2021-09-16 08:22:01 +02:00
Michał Kępień
acb7e61409 Remove redundant zone_keyid() function
The zone_keyid() helper function defined in
bin/tests/system/statschannel/helper.py is not used anywhere.  Remove
it.
2021-09-16 08:22:01 +02:00
Michał Kępień
8bc4e90b10 Merge branch 'v9_17_18-release' into 'main'
Merge 9.17.18 release branch

See merge request isc-projects/bind9!5408
2021-09-15 20:59:39 +00:00
Michał Kępień
81f18aa5c7 Set up release notes for BIND 9.17.19 2021-09-15 22:49:20 +02:00
Michał Kępień
4509a84dbe Update BIND version to 9.17.18 2021-09-15 22:49:20 +02:00
Michał Kępień
8415f87913 Add a CHANGES marker 2021-09-15 22:49:20 +02:00
Michał Kępień
93ac2af667 Merge branch 'michal/prepare-documentation-for-bind-9.17.18' into 'v9_17_18-release'
Prepare documentation for BIND 9.17.18

See merge request isc-private/bind9!320
2021-09-15 22:49:20 +02:00
Michał Kępień
3af61f9672 Prepare release notes for BIND 9.17.18 2021-09-15 22:49:20 +02:00
Michał Kępień
6705f0a280 Add release note for GL #2878 2021-09-15 22:49:20 +02:00
Michał Kępień
901eb7edae Add release note for GL #2844 2021-09-15 22:49:20 +02:00
Michał Kępień
fe86bac50c Add release note for GL #1944 2021-09-15 22:49:20 +02:00
Michał Kępień
7daf9aa5ac Reorder release notes 2021-09-15 22:49:20 +02:00
Michał Kępień
f2f672d69f Tweak and reword release notes 2021-09-15 22:49:20 +02:00
Michał Kępień
398e7c24bd Tweak and reword recent CHANGES entries 2021-09-15 22:49:20 +02:00
Michał Kępień
e7d625e288 Update release checklist
Add an item to the release checklist to make sure regression tests
reproducing publicly disclosed security issues are eventually merged
into each maintained branch.
2021-09-15 22:49:20 +02:00
Mark Andrews
097f589e40 Merge branch '2904-typo-in-nsupdate-1' into 'main'
Resolve "Typo in nsupdate(1)"

Closes #2904

See merge request isc-projects/bind9!5403
2021-09-15 08:28:03 +00:00
Mark Andrews
55fc57e244 Fix closing brackets in help message 2021-09-15 17:01:00 +10:00
Evan Hunt
6077080f12 Merge branch '2902-fix-httpport' into 'main'
use named_g_httpport correctly when creating listeners

Closes #2902

See merge request isc-projects/bind9!5397
2021-09-14 21:00:37 +00:00
Evan Hunt
7bf61a6d7f use named_g_httpport correctly when creating listeners
when the default http port was set on the command line, it was
not used correctly by listeners. [GL #2902]
2021-09-14 20:22:13 +00:00
Ondřej Surý
5a9b302e43 Merge branch '2866-placeholder' into 'main'
Add placeholder CHANGES for [GL #2866]

See merge request isc-projects/bind9!5395
2021-09-14 18:56:36 +00:00
Ondřej Surý
ece780a73f Add placeholder CHANGES for [GL #2866] 2021-09-14 20:41:10 +02:00
Ondřej Surý
c94ec610d9 Merge branch '2888-be-more-strict-about-clashing-source-ports' into 'main'
check port in *-source and *-source-v6 options in named.conf

Closes #2888

See merge request isc-projects/bind9!5399
2021-09-14 17:59:29 +00:00
Ondřej Surý
bba5e98734 Add CHANGES and release notes for [GL #2888] 2021-09-14 19:24:39 +02:00
Ondřej Surý
c9a17c878a Document caveats related to single source port in the ARM
Discourage the single source port on general level and document that the
source port cannot be same as the listening port.  This applies to
query-source, transfer-source, notify-source, parental-source, and their
respective IPv6 counterparts.
2021-09-14 19:24:39 +02:00
Evan Hunt
14c8d7dfb7 check port in *-source and *-source-v6 options in named.conf
- when transfer-source(-v6), query-source(-v6), notify-source(-v6)
  or parental-source(-v6) are specified with a port number, issue a
  warning.
- when the port specified is the same as the DNS listener port (i.e.,
  53, or whatever was specified as "port" in "options"), issue a fatal
  error.
- check that "port" is in range. (previously this was only checked
  by named, not by named-checkconf.)
- added checkconf tests.
- incidental fix: removed dead code in check.c:bind9_check_namedconf().

(note: if the DNS port is specified on the command line with "named -p",
that is not conveyed to libbind9, so these checks will not take it into
account.)
2021-09-14 19:24:33 +02:00
Ondřej Surý
24065a054a Merge branch '2852-remove-adjust_interfaces' into 'main'
Remove the code to adjust listening interfaces for *-source-v6

Closes #2852

See merge request isc-projects/bind9!5386
2021-09-14 14:24:25 +00:00
Ondřej Surý
23624a7adb Add CHANGES and release note for [GL #2852] 2021-09-14 14:51:31 +02:00
Ondřej Surý
8a4c44ca24 Adjust system forward test to also use IPv6 addresses
The ns3->ns2 forwarding is now done using the IPv6 addresses, so we also
test that the query-source-v6 address is still operational after removal
of interface adjustment.
2021-09-14 14:51:03 +02:00
Ondřej Surý
8ac1d4e0da Remove the code to adjust listening interfaces for *-source-v6
Previously, named would run with a configuration
where *-source-v6 (notify-source-v6, transfer-source-v6 and
query-source-v6) address and port could be simultaneously used for
listening.  This is no longer true for BIND 9.16+ and the code that
would do interface adjustments would unexpectedly disable listening on
TCP for such interfaces.

This commit removes the code that would adjust listening interfaces
for addresses/ports configured in *-source-v6 option.
2021-09-14 14:51:03 +02:00
Arаm Sаrgsyаn
7ab58883f6 Merge branch '2818-catz-config-synonyms' into 'main'
Add synonym configuration options for catalog zones

Closes #2818

See merge request isc-projects/bind9!5382
2021-09-14 08:36:11 +00:00
Aram Sargsyan
1b8c9fea7e Add a CHANGES entry [GL #2818] 2021-09-09 21:54:10 +00:00
Aram Sargsyan
ae9330b641 Fix an off-by-one error in catz_opt_cmp() function
This commit fixes an off-by-one error in catz_opt_cmp() function which
was resulting in ignoring the last character of the compared string.
2021-09-09 21:54:10 +00:00
Aram Sargsyan
ae53919154 Add synonym configuration options for catalog zones
This commit adds 'primaries' and 'default-primaries' catalog zones
configuration options synonyms for 'masters' and 'default-masters'
respectively.
2021-09-09 21:54:10 +00:00
Ondřej Surý
c50301f3c7 Merge branch '2691-remove-native-pkcs-11-support-from-bind-9-17-9-18' into 'main'
Remove native PKCS#11 support

Closes #2691

See merge request isc-projects/bind9!5074
2021-09-09 14:11:48 +00:00
Ondřej Surý
79de2ee528 Add CHANGES and release note for GL #2691 2021-09-09 15:35:39 +02:00
Ondřej Surý
b687c1d3af Disable softhsm2.4 and softhsm2.6 builds and tests from the CI
Until we have a system test that would directly test the engine_pkcs11
integration, we need to disable the system tests that enabled native
PKCS#11 in the CI because it's currently broken.
2021-09-09 15:35:39 +02:00
Ondřej Surý
8cb2ba5dd3 Remove native PKCS#11 support
The native PKCS#11 support has been removed in favour of better
maintained, more performance and easier to use OpenSSL PKCS#11 engine
from the OpenSC project.
2021-09-09 15:35:39 +02:00
Arаm Sаrgsyаn
ce081f310d Merge branch '2344-devpoll-lockid-dead-code' into 'main'
Remove dead code

Closes #2344

See merge request isc-projects/bind9!5384
2021-09-08 11:12:24 +00:00
Aram Sargsyan
74f50cd29f Remove dead code
Remove dead code from the USE_DEVPOLL branch in libisc's socket.c
2021-09-08 10:12:03 +00:00
Arаm Sаrgsyаn
7e4a1bef89 Merge branch '2635-default-iana-root-zone-primaries-update' into 'main'
Update the default IANA root zone primaries

Closes #2635

See merge request isc-projects/bind9!5383
2021-09-08 10:08:21 +00:00
Aram Sargsyan
0101f63bcd Update the default IANA root zone primaries list
The default IANA root zone primaries list was outdated, this commit
updates it.
2021-09-03 15:54:46 +00:00
Evan Hunt
3df71614c8 Merge branch '69-relax-fetchlimit-test' into 'main'
increase 1-second timeout in fetchlimit

Closes #69

See merge request isc-projects/bind9!5380
2021-09-03 06:24:26 +00:00
Evan Hunt
45f330339c increase 1-second timeout in fetchlimit
when "checking lame server clients are dropped below the hard limit",
periodically a query is sent for a name for which the server is
authoritative, to verify that legitimate queries can still be
processed while the server is dealing with a flood of lame delegation
queries. those queries used the same dig options as elsewhere in the
fetchlimit test, including "+tries=1 +timeout=1". on slow systems, a
1-second timeout may be insufficient to get an answer even if the server
is behaving well. this commit increases the timeout for the check
queries to 2 seconds in hopes that will be enough to eliminate test
failures in CI.
2021-09-03 06:23:46 +00:00
Mark Andrews
9d3d5a1d3f Merge branch '2890-update-documentation-with-respect-to-sig-validity-interval-and-update' into 'main'
Resolve "Update documentation with respect to sig-validity-interval and UPDATE"

Closes #2890

See merge request isc-projects/bind9!5371
2021-09-03 03:17:14 +00:00
Mark Andrews
e65ce00f11 Update sig-validity-interval description
Document that the interval on new RRSIG records is randomally
chosen between the limits specified by sig-validity-interval.
document the operatations when this occurs.
2021-09-03 13:16:33 +10:00
Evan Hunt
56d7d6d892 Merge branch '2878-large-map-file' into 'main'
map files over 2GB could not be loaded

Closes #2878

See merge request isc-projects/bind9!5356
2021-09-01 15:24:26 +00:00
Evan Hunt
1928ca5f91 CHANGES 2021-09-01 08:01:27 -07:00
Evan Hunt
a33222bd0e add a test for large map files
- a test has been added to 'masterformat', but disabled by default,
  because it takes several minutes to run and uses a lot of disk.
2021-09-01 08:01:27 -07:00
Evan Hunt
3b544d28bf map files over 2GB could not be loaded
- fixed a size comparison using "signed int" that failed if the file
  size was more than 2GB, since that was treated as a negative number.
- incidentally renamed deserialize32() to just deserialize(). we no
  longer have separate 32 and 64 bit rbtdb implementations.
2021-09-01 08:01:27 -07:00
Michał Kępień
113add8a9d Merge branch '2837-sync-isc-trampoline-in-main-with-v9_16' into 'main'
Synchronize the isc_trampoline API with changes needed in v9_16

Closes #2837

See merge request isc-projects/bind9!5373
2021-09-01 09:06:54 +00:00
Ondřej Surý
45726fc01f Synchronize the isc_trampoline API with changes needed in v9_16
This commit synchronizes the isc_trampoline API to match the changes
needed to fix Windows service in v9_16.
2021-09-01 10:44:21 +02:00
Artem Boldariev
87a289de00 Merge branch 'artem/reenable-some-tls-options-for-builds-without-doh' into 'main'
Dependencies regression: Re-enable some common TLS-related options for non-DoH builds, making DoT usable in them

See merge request isc-projects/bind9!5377
2021-09-01 08:39:31 +00:00
Artem Boldariev
c0906dd491 Re-enable some TLS-related options for non-DoH builds
This commit fixes a regression introduced at
ea80bcc41c. Some options, which are
common to both DoH and DoT were mistakenly disabled for non-DoH
builds. That is a mistake, because DoH does not imply DoT and vice
versa. Not fixing this would make DoT functionality not accessible
without DoH.
2021-09-01 10:42:05 +03:00
Mark Andrews
352ecc51c7 Merge branch 'marka-changes' into 'main'
add placeholder for [GL #2891]

See merge request isc-projects/bind9!5376
2021-09-01 07:29:12 +00:00
Mark Andrews
2b007aa2ca add placeholder for [GL #2891] 2021-09-01 17:25:38 +10:00
Artem Boldariev
2f008bdbf7 Merge branch '2860-fix-nodoh-build' into 'main'
Fix building BIND without DoH support

Closes #2860

See merge request isc-projects/bind9!5372
2021-08-31 13:41:10 +00:00
Artem Boldariev
42868c6f3e Fix building BIND without DoH support
The body of the listenelt_http() function was not properly wrapped in
ifdef ... endif, leading to build failures with DoH disabled.
2021-08-31 15:20:05 +02:00
Evan Hunt
35f2fa7fd5 Merge branch '1944-primary-secondary' into 'main'
update to primary/secondary terminology internally

Closes #1944

See merge request isc-projects/bind9!5366
2021-08-30 18:30:22 +00:00
Evan Hunt
18b878fb01 CHANGES 2021-08-30 11:07:17 -07:00
Evan Hunt
ae8cfa4683 switch to primary/secondary in config.c
some of the built-in configuration was still using outdated terms.
2021-08-30 11:06:12 -07:00
Evan Hunt
cd1bb82d34 use "primary" and "secondary" in statschannel output
zone statistics were still using the old terminology. NOTE: this
change may affect scripts that parse statistics output.
2021-08-30 11:06:12 -07:00
Evan Hunt
679f1c0dad change CFG_ZONE_MASTER and CFG_ZONE_SLAVE
these values have been renamed as CFG_ZONE_PRIMARY and
CFG_ZONE_SECONDARY.
2021-08-30 11:06:12 -07:00
Evan Hunt
916760ae46 rename dns_zone_master and dns_zone_slave
dns_zone_master and dns_zone_slave are renamed as dns_zone_primary
and dns_zone_secondary.
2021-08-30 11:06:12 -07:00
Petr Špaček
611995ada3 Merge branch '2856-CVE-2021-25218-regression-test' into 'main'
Add a regression test in the RRL system test

See merge request isc-projects/bind9!5360
2021-08-30 15:30:26 +00:00
Petr Špaček
d8363845b6 Lower loopback MTU size on other unix systems as well
This change should cover recent versions of:
Solaris, illumos, OpenBSD, FreeBSD, Dragonfly BSD, NetBSD.
2021-08-30 17:04:14 +02:00
Evan Hunt
cfd058d622 Add a regression test in the RRL system test
This commit modifies the MTU of the loopback interface on
Linux systems to 1500, so that oversized UDP packets can
trigger EMSGSIZE errors, and tests that named handles
such errors correctly.

Note that the loopback MTU size has not yet been modified
for other platforms.
2021-08-30 17:04:09 +02:00
Ondřej Surý
5e5f4bc851 Merge branch '2837-placeholder' into 'main'
Add CHANGES placeholder for [GL #2837]

See merge request isc-projects/bind9!5369
2021-08-30 09:17:35 +00:00
Ondřej Surý
18345f6474 Add CHANGES placeholder for [GL #2837] 2021-08-30 11:14:07 +02:00
Artem Boldariev
77b5764443 Merge branch '2860-generate-correct-uris-for-doh-in-dig' into 'main'
Unify DoH URI making throughout the codebase

Closes #2861 and #2860

See merge request isc-projects/bind9!5325
2021-08-30 07:52:29 +00:00
Artem Boldariev
0564d1ac98 Add a CHANGES entry [GL #2860]
Mention in the CHANGES file that the dig now can query IPv6 addresses
via DoH.
2021-08-30 10:32:17 +03:00
Artem Boldariev
db1ba15ff2 Replace multiple /dns-query constants with a global one
This commit replaces the constants defining /dns-query, the default
DoH endpoint, with a global definition.
2021-08-30 10:32:17 +03:00
Artem Boldariev
33fa1d5fb4 Extend the doth system test with IPv6 support [GL #2861]
This commit ensures that DoH (and DoT) functionality works well via
IPv6 as well.

The changes were made because it turned out that dig could not make
DoH queries against an IPv6 IP address. These tests ensure that such a
bug will not remain unnoticed.

The commit also increases the servers' startup timeout to 25 seconds
because the initial timeout of 14 seconds was too short to generate
(!) eight 4096 bit ephemeral RSA certificates on a heavily loaded CI
runner in some pipeline runs.
2021-08-30 10:21:59 +03:00
Artem Boldariev
0403ca1ac2 Make dig generate DoH URI using isc_nm_http_makeuri()
This commit replaces ad-hoc code for DoH connect URI construction with
isc_nm_http_makeuri(), making it handle IPv6 adresses properly (among
other things).
2021-08-30 10:21:59 +03:00
Artem Boldariev
530133c10f Unify DoH URI making throughout the codebase
This commit adds new function isc_nm_http_makeuri() which is supposed
to unify DoH URI construction throughout the codebase.

It handles IPv6 addresses, hostnames, and IPv6 addresses given as
hostnames properly, and replaces similar ad-hoc code in the codebase.
2021-08-30 10:21:58 +03:00
Ondřej Surý
2d36920d6a Merge branch 'ondrej/remove-lib_isc_register-function' into 'main'
Remove support for external applications to register libisc

See merge request isc-projects/bind9!2420
2021-08-30 07:20:03 +00:00
Evan Hunt
18ab2cc578 Add CHANGES note for [GL !2420] 2021-08-30 09:17:45 +02:00
Evan Hunt
556ffe3eea clean up dns_client API
- removed unused functions
- changed some public functions to static that are never called
  from outside client.c
- removed unused types and function prototypes
- renamed dns_client_destroy() to dns_client_detach()
2021-08-30 08:47:39 +02:00
Ondřej Surý
cdf9a1fd20 Remove support for external applications to register libisc
The previous versions of BIND 9 exported its internal libraries so that
they can be used by third-party applications more easily.  Certain
library functions were altered from specific BIND-only behavior to more
generic behavior when used by other applications.

This commit removes the function isc_lib_register() that was used by
external applications to enable the functionality.
2021-08-30 08:47:39 +02:00
Evan Hunt
5dd11a6aa4 Merge branch '2872-fix-map-zonefile-version-number' into 'main'
Fix crash while loading map zone files generated by BIND >= 9.17.0 && <= 9.17.16

Closes #2872

See merge request isc-projects/bind9!5345
2021-08-28 14:34:45 +00:00
Evan Hunt
351ed777c2 CHANGES, release note 2021-08-28 07:31:13 -07:00
Evan Hunt
4b61e74470 expand map file documentation
discuss map file compatibility issues in more detail.
2021-08-28 07:31:13 -07:00
Petr Špaček
4a68c7be22 increase MAPAPI
bump the map zonefile version number to avoid an assertion
failure when loading map files from versions of BIND prior to
the most recent change to the in-memory structure of zone
databases.
2021-08-27 21:44:04 -07:00
Evan Hunt
4ea73198c8 Merge branch '1927-fix-keepalive' into 'main'
Resolve "keepalive appears to be unused"

Closes #1927

See merge request isc-projects/bind9!4348
2021-08-27 19:55:47 +00:00
Evan Hunt
45752f9505 CHANGES 2021-08-27 10:02:46 -07:00
Evan Hunt
947e80066c add a test of the keepalive timeout
test server now has tcp-idle-timeout set to 5 seconds and
tcp-keepalive-timeout set to 7, so queries that follow a 6-second sleep
should either succeed or fail depending on whether the keepalive option
was sent.
2021-08-27 10:02:46 -07:00
Evan Hunt
fc6f751fbe replace per-protocol keepalive functions with a common one
this commit removes isc__nm_tcpdns_keepalive() and
isc__nm_tlsdns_keepalive(); keepalive for these protocols and
for TCP will now be set directly from isc_nmhandle_keepalive().

protocols that have an underlying TCP socket (i.e., TLS stream
and HTTP), now have protocol-specific routines, called by
isc_nmhandle_keeaplive(), to set the keepalive value on the
underlying socket.
2021-08-27 10:02:10 -07:00
Evan Hunt
7867b8b57d enable keepalive when the keepalive EDNS option is seen
previously, receiving a keepalive option had no effect on how
long named would keep the connection open; there was a place to
configure the keepalive timeout but it was never used. this commit
corrects that.

this also fixes an error in isc__nm_{tcp,tls}dns_keepalive()
in which the sense of a REQUIRE test was reversed; previously this
error had not been noticed because the functions were not being
used.
2021-08-27 09:56:51 -07:00
Evan Hunt
19e24e22f5 cleanup netmgr-int.h
- fix some duplicated and out-of-order prototypes declared in
  netmgr-int.h
- rename isc_nm_tcpdns_keepalive to isc__nm_tcpdns_keepalive as
  it's for internal use
2021-08-27 09:56:51 -07:00
Artem Boldariev
3f6f37c4a4 Merge branch '2858-fix-a-crash-when-closing-http-socket-with-unused-http-session' into 'main'
DoH: Fix a crash (in dig) when closing an HTTP socket with an unused HTTP/2 session

Closes #2858

See merge request isc-projects/bind9!5319
2021-08-27 09:38:30 +00:00
Artem Boldariev
5708446d85 Add changes for [GL #2858]
This commit adds information about the fix for the issue #2858 to the
CHANGES file.
2021-08-27 12:14:49 +03:00
Artem Boldariev
8a655320c8 Fix a crash (in dig) when closing HTTP socket with unused session
This commit fixes a crash (caused by an assert) when closing an HTTP/2
socket with unused HTTP/2 session.
2021-08-27 12:14:48 +03:00
Mark Andrews
d0399afd3a Merge branch '1805-save-failed-build-artifacts' into 'main'
Resolve "Save failed build artifacts."

Closes #1805

See merge request isc-projects/bind9!3458
2021-08-26 03:55:28 +00:00
Mark Andrews
221228572f always save build artifacts 2021-08-26 03:35:09 +00:00
Mark Andrews
ca0f737091 Merge branch '2880-timing-issues-with-rndc-system-test' into 'main'
Resolve "timing issues with rndc system test"

Closes #2880

See merge request isc-projects/bind9!5357
2021-08-26 03:16:21 +00:00
Mark Andrews
45b6b8199e wait for post 'rndc freeze' writes to complete 2021-08-26 10:57:08 +10:00
Evan Hunt
9a4a1bbe9b Merge branch '331-further-refactoring-of-functions-in-lib-dns-zoneverify-c' into 'main'
Resolve "Further refactoring of functions in lib/dns/zoneverify.c"

Closes #331

See merge request isc-projects/bind9!3718
2021-08-25 22:46:45 +00:00
Diego Fronza
bd0cc048d1 Replace literal 255 with a more descriptive macro name
More details on thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12186
2021-08-25 15:10:27 -07:00
Diego Fronza
90e724af45 Avoid an empty block under if condition
This commit doesn't change the logic flow from previous code, it only
makes the code more readable and consistent.

More details on thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12185
2021-08-25 15:10:27 -07:00
Diego Fronza
37f42d19a1 Remove redundant function 'newchain'
The removed function 'newchain(a, b)' was almost the same as calling
!chain_equal(a, b), varying only in the amount of data compared
in the non-fixed-length data portion of given chain nodes.

A third argument 'data_size' has been introduced into 'chain_equal'
function in order to allow it to know how many bytes to compare in the
variable-length data portion of the chain nodes.

A helper function 'chain_length(e)' has been introduced to allow
easy calculation of the total length of the non-fixed-length data part
of chain nodes.

Check the thread below for more details:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12184
2021-08-25 15:10:27 -07:00
Diego Fronza
6a12e37382 Use sizeof instead of arbitrary number to iterate fixed size array
More details on thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12180
2021-08-25 15:10:27 -07:00
Diego Fronza
87e970474f Initialize buffers with { 0 } instead of memset
More details on threads:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12178
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12181
2021-08-25 14:23:26 -07:00
Diego Fronza
98d1e40143 Minor refactoring on function match_nsec3
The logic for matching a set of nsec3 objects against an nsec3param
object was moved to a specific function.

For more details check thread:
https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/291#note_12176
2021-08-25 14:23:26 -07:00
Diego Fronza
966c06a9e6 Minor refactoring/cleanup
This commit moves the warning message to the logical block where it
belongs better.

For more details check thread comment:
https://gitlab.isc.org/isc-projects/bind9/merge_requests/291#note_12167
2021-08-25 14:23:26 -07:00
Artem Boldariev
e2d9faf09a Merge branch '2875-doh-do-not-assume-headers-order' into 'main'
Make no assumptions regarding HTTP headers processing order

Closes #2875

See merge request isc-projects/bind9!5350
2021-08-25 08:02:27 +00:00
Artem Boldariev
b0fc35d79c Add an entry to CHANGES [GL #2875]
Mention that we now do not rely on HTTP headers processing order in
BIND anymore.
2021-08-25 10:35:27 +03:00
Artem Boldariev
32cd4367a3 Make no assumptions regarding HTTP headers processing order
This commit changes the DoH code in such a way that it makes no
assumptions regarding which headers are expected to be processed
first. In particular, the code expected the :method: pseudo-header to
be processed early, which might not be true.
2021-08-25 10:32:56 +03:00
Mark Andrews
99f847d1e9 Merge branch '2461-named-checkconf-fails-to-detect-illegal-key-names-in-primaries-lists' into 'main'
Resolve "Named-checkconf fails to detect illegal key names in primaries lists"

Closes #2461

See merge request isc-projects/bind9!5314
2021-08-25 05:55:02 +00:00
Mark Andrews
5d2183c450 Add CHANGED for [GL #2461] 2021-08-25 15:22:25 +10:00
Mark Andrews
eb8c1ed3c5 Check that primary tls names are syntactically valid 2021-08-25 15:21:14 +10:00
Mark Andrews
4fa9d8389a Check that primary key names are syntactically valid 2021-08-25 15:21:14 +10:00
Mark Andrews
d66439b939 Merge branch '2842-clean-up-catalog-journal' into 'main'
Resolve "Clean up catalog journal"

Closes #2842

See merge request isc-projects/bind9!5313
2021-08-25 05:16:34 +00:00
Mark Andrews
53f9416176 Add CHANGES for [GL #2842] 2021-08-25 14:46:08 +10:00
Mark Andrews
0b83636648 Also delete journal file 2021-08-25 14:44:54 +10:00
Mark Andrews
1972300919 check that journal files are also removed 2021-08-25 14:44:54 +10:00
Mark Andrews
cd03e790ff Merge branch '2877-v9-17-cannot-be-compiled-on-a-system-without-libnghttp2-library' into 'main'
Resolve "v9.17 cannot be compiled on a system without libnghttp2 library"

Closes #2877

See merge request isc-projects/bind9!5353
2021-08-25 03:36:50 +00:00
Mark Andrews
aae53e2156 handle not configured with trailing flags 2021-08-25 00:14:50 +00:00
Mark Andrews
d425ee8097 Skip good-dot-*.conf when libnghttp2 is not available 2021-08-25 00:14:50 +00:00
Mark Andrews
ea80bcc41c More config element are not valid without DOH / DOT 2021-08-25 00:14:50 +00:00
Mark Andrews
71b7251009 Make doth system test conditional 2021-08-25 00:14:50 +00:00
Mark Andrews
c5ef2cc650 Protect #include <nghttp2/nghttp2.h> with #ifdef HAVE_LIBNGHTTP2 2021-08-25 00:14:50 +00:00
Matthijs Mekking
7a24c578bd Merge branch '1721-grow-shrink-dnssec-sign-stats' into 'main'
Grow and shrink dnssec-sign statistics on key rollover events

Closes #1721

See merge request isc-projects/bind9!5349
2021-08-24 07:27:26 +00:00
Matthijs Mekking
8224dc8e35 Add CHANGES for [GL #1721] 2021-08-24 09:07:54 +02:00
Matthijs Mekking
1a3c82f765 Add statschannel test case for key removal
Add a statschannel test case to confirm that when keys are removed
(in this case because of a dnssec-policy change), the corresponding
dnssec-sign stats are cleared and are no longer shown in the
statistics.
2021-08-24 09:07:15 +02:00
Matthijs Mekking
de15e07800 Clear dnssec-sign stats for removed keys
Clear the key slots for dnssec-sign statistics for keys that are
removed. This way, the number of slots will stabilize to the maximum
key usage in a zone and will not grow every time a key rollover is
triggered.
2021-08-24 09:07:15 +02:00
Matthijs Mekking
019a52a184 Add back the statschannel manykeys test case
Add a test case that has more than four keys (the initial number of
key slots that are created for dnssec-sign statistics). We shouldn't
be expecting weird values.

This fixes some errors in the manykeys zone configuration (keys
were created for algorithm RSASHA256, but the policy expected RSASHA1,
and the zone was not allowing dynamic updates).

This also fixes an error in the calls to 'zones-json.pl': The perl
script excepts an index number where the zone can be found, rather
than the zone name.
2021-08-24 09:07:15 +02:00
Matthijs Mekking
d9cca81d50 Grow dnssec-sign statistics instead of rotating
We have introduced dnssec-sign statistics to the zone statistics. This
introduced an operational issue because when using zone-statistics
full, the memory usage was going through the roof. We fixed this by
by allocating just four key slots per zone. If a zone exceeds the
number of keys for example through a key rollover, the keys will be
rotated out on a FIFO basis.

This works for most cases, and fixes the immediate problem of high
memory usage, but if you sign your zone with many, many keys, or are
sign with a ZSK/KSK double algorithm strategy you may experience weird
statistics. A better strategy is to grow the number of key slots per
zone on key rollover events.

That is what this commit is doing: instead of rotating the four slots
to track sign statistics, named now grows the number of key slots
during a key rollover (or via some other method that introduces new
keys).
2021-08-24 09:07:15 +02:00
Matthijs Mekking
9acce8a82a Add a function isc_stats_resize
Add a new function to resize the number of counters in a statistics
counter structure. This will be needed when we keep track of DNSSEC
sign statistics and new keys are introduced due to a rollover.
2021-08-24 09:07:15 +02:00
Matthijs Mekking
0bac9c7c5c Add stats unit test
Add a simple stats unit test that tests the existing library functions
isc_stats_ncounters, isc_stats_increment, isc_stats_decrement,
isc_stats_set, and isc_stats_update_if_greater.
2021-08-24 09:07:15 +02:00
Matthijs Mekking
042d206bf4 Merge branch '256-inline-signing-receive-secure-serial-unchanged' into 'main'
Change "receive_secure_serial: unchanged" log level

Closes #256

See merge request isc-projects/bind9!5333
2021-08-23 09:25:38 +00:00
Matthijs Mekking
1127b1f3eb Change "receive_secure_serial: unchanged" log lvl
After a reload, if the zone hasn't changed, this will log a
DNS_R_UNCHANGED error. This should not be at error level because it
happens on every reload.
2021-08-23 10:44:58 +02:00
Matthijs Mekking
2a651dcbff Merge branch '2857-migrate-csk-to-dnssec-policy' into 'main'
Test migrating CSK to dnssec-policy

Closes #2857

See merge request isc-projects/bind9!5328
2021-08-23 08:21:55 +00:00
Matthijs Mekking
a8d0d2feed Add a test case for non-SEP CSK migration
A zone with a single key without the SEP bit set must also be assumed
to be a CSK.
2021-08-23 09:55:28 +02:00
Matthijs Mekking
36ad0331e2 Changes to kasp script to deal with non-SEP CSK
In order to test cases with non-SEP CSK keys, the Flags Field needs to
be determined differently to deal with such exceptional scenarios.
2021-08-23 09:55:27 +02:00
Matthijs Mekking
c43faf44cd Add change and release note for [#2857] 2021-08-23 09:55:26 +02:00
Matthijs Mekking
3ea953512a Migrate a single key to CSK with dnssec-policy
When migrating keys to dnssec-policy, if a zone has only one key,
assume it is going to be a CSK.
2021-08-23 09:53:51 +02:00
Matthijs Mekking
96ee323622 Test migrating CSK to dnssec-policy
Add a test case for migrating CSK to dnssec-policy. The keymgr has no
way of telling that the key is used as a CSK, but if there is only one
key to migrate it is going to assume it must be a CSK.
2021-08-23 09:53:51 +02:00
Mark Andrews
00c376f34d Merge branch '2868-svbc-fromwire-should-reject-zero-length-alpn-elements' into 'main'
Resolve "SVBC fromwire should reject zero length ALPN elements"

Closes #2868

See merge request isc-projects/bind9!5336
2021-08-19 08:36:57 +00:00
Mark Andrews
8833d90292 Reject zero length ALPN elements in fromwire 2021-08-19 18:17:08 +10:00
Mark Andrews
3b720e7b09 Merge branch '2870-address-test-timing-false-positive-in-rndc-system-test' into 'main'
Resolve "Address test timing false positive in rndc system test."

Closes #2870

See merge request isc-projects/bind9!5341
2021-08-19 07:51:10 +00:00
Mark Andrews
8e189840b1 wait for each staged to complete 2021-08-19 07:30:56 +00:00
Mark Andrews
10e607e4ab Merge branch '2867-svbc-from-wire-needs-to-check-that-alpn-in-present-when-no-default-alpn-is-present' into 'main'
Resolve "SVBC fromwire needs to check that alpn in present when no-default-alpn is present"

Closes #2867

See merge request isc-projects/bind9!5334
2021-08-19 07:29:42 +00:00
Mark Andrews
2f51bb2d93 Check that ALPN is present when NO-DEFAULT-ALPN is present in fromwire 2021-08-19 07:10:00 +00:00
Evan Hunt
107e2478dd Merge branch 'each-fanf-dnssec-cds-no-sha1' into 'main'
Suppress SHA-1 DS records in dnssec-cds

See merge request isc-projects/bind9!5331
2021-08-19 05:42:48 +00:00
Tony Finch
9557d6f70f Add CHANGES and release note for [GL !2946] 2021-08-18 22:42:00 -07:00
Tony Finch
eabf898b36 Suppress SHA-1 DS records in dnssec-cds
Previously, when dnssec-cds copied CDS records to make DS records,
its -a algorithm option did not have any effect. This means that if
the child zone is signed with older software that generates SHA-1 CDS
records, dnssec-cds would (by default) create SHA-1 DS records in
violation of RFC 8624.

This change makes the dnssec-cds -a option apply to CDS records as
well as CDNSKEY records. In the CDS case, the -a algorithms are the
acceptable subset of possible CDS algorithms. If none of the CDS
records are acceptable, dnssec-cds tries to generate DS records from
CDNSKEY records.
2021-08-18 22:42:00 -07:00
Michał Kępień
2eac5781c9 Merge branch 'v9_17_17-release' into 'main'
Merge 9.17.17 release branch

See merge request isc-projects/bind9!5338
2021-08-19 05:13:43 +00:00
Michał Kępień
4b17dd17fa Set up release notes for BIND 9.17.18 2021-08-19 07:12:33 +02:00
Michał Kępień
54a2afa4eb Update BIND version to 9.17.17 2021-08-19 07:12:33 +02:00
Michał Kępień
29107bbd76 Add a CHANGES marker 2021-08-19 07:12:33 +02:00
Michał Kępień
208940523f Merge branch 'michal/prepare-documentation-for-bind-9.17.17' into 'security-main'
Prepare documentation for BIND 9.17.17

See merge request isc-private/bind9!312
2021-08-19 07:12:33 +02:00
Michal Nowak
513e58d53a Merge branch '2839-confidential-rrl-msgsize' into 'security-main'
[CVE-2021-25218]: assertion failure in RRL after EMSGSIZE error

See merge request isc-private/bind9!313
2021-08-19 07:12:33 +02:00
Michał Kępień
80d76c47e1 Prepare release notes for BIND 9.17.17 2021-08-19 07:12:33 +02:00
Evan Hunt
265fae928a Add CHANGES and release notes for [GL #2839] 2021-08-19 07:12:33 +02:00
Michał Kępień
c0d3a0b7d6 Add release note for GL #2756 2021-08-19 07:12:33 +02:00
Ondřej Surý
87d5c8ab7c Disable the Path MTU Discover on UDP Sockets
Instead of disabling the fragmentation on the UDP sockets, we now
disable the Path MTU Discovery by setting IP(V6)_MTU_DISCOVER socket
option to IP_PMTUDISC_OMIT on Linux and disabling IP(V6)_DONTFRAG socket
option on FreeBSD.  This option sets DF=0 in the IP header and also
ignores the Path MTU Discovery.

As additional mitigation on Linux, we recommend setting
net.ipv4.ip_no_pmtu_disc to Mode 3:

    Mode 3 is a hardend pmtu discover mode. The kernel will only accept
    fragmentation-needed errors if the underlying protocol can verify
    them besides a plain socket lookup. Current protocols for which pmtu
    events will be honored are TCP, SCTP and DCCP as they verify
    e.g. the sequence number or the association. This mode should not be
    enabled globally but is only intended to secure e.g. name servers in
    namespaces where TCP path mtu must still work but path MTU
    information of other protocols should be discarded. If enabled
    globally this mode could break other protocols.
2021-08-19 07:12:33 +02:00
Michał Kępień
20e5cf075d Reorder release notes 2021-08-19 07:12:33 +02:00
Evan Hunt
69243a0f56 ns_client_error() could assert if rcode was overridden to NOERROR
The client->rcode_override was originally created to force the server
to send SERVFAIL in some cases when it would normally have sent FORMERR.

More recently, it was used in a3ba95116e
commit (part of GL #2790) to force the sending of a TC=1 NOERROR
response, triggering a retry via TCP, when a UDP packet could not be
sent due to ISC_R_MAXSIZE.

This ran afoul of a pre-existing INSIST in ns_client_error() when
RRL was in use. the INSIST was based on the assumption that
ns_client_error() could never result in a non-error rcode. as
that assumption is no longer valid, the INSIST has been removed.
2021-08-19 07:12:33 +02:00
Michał Kępień
876ca54af5 Tweak and reword release notes 2021-08-19 07:12:33 +02:00
Michał Kępień
fcd0e218ff Tweak and reword recent CHANGES entries 2021-08-19 07:12:33 +02:00
Michał Kępień
5b796b4bc2 Tweak library requirements in PLATFORMS.md 2021-08-19 07:12:33 +02:00
Michał Kępień
b541677c4e Tweak jemalloc warning text in configure.ac 2021-08-19 07:12:33 +02:00
Michal Nowak
d3d32683c0 Fix typos in lib/isc/trampoline_p.h 2021-08-19 07:12:33 +02:00
Mark Andrews
0a30e17b48 Merge branch 'marka-fix-format' into 'main'
Use %d for enum values

See merge request isc-projects/bind9!5335
2021-08-19 05:09:58 +00:00
Mark Andrews
89fe8e920c Use %d for enum values 2021-08-19 10:19:32 +10:00
Mark Andrews
4d435eb02b Merge branch '1132-wip-httpssvc-record' into 'main'
Resolve "HTTPS and SVCB records"

Closes #1132

See merge request isc-projects/bind9!2135
2021-08-18 04:35:11 +00:00
Mark Andrews
8ebb05b0b7 Add CHANGES and release notes 2021-08-18 13:51:38 +10:00
Mark Andrews
f6bfc685aa Add check-names for svbc (https) server name examples 2021-08-18 13:49:48 +10:00
Mark Andrews
f46a0c27df Check that the hostname of the server is legal 2021-08-18 13:49:48 +10:00
Mark Andrews
26b22a1445 add tests for string and qstring 2021-08-18 13:49:48 +10:00
Mark Andrews
a6357d8b5c Add unit test for keypair 2021-08-18 13:49:48 +10:00
Mark Andrews
cd985d96e3 Add additional processing to HTTPS and SVBC records
The additional processing method has been expanded to take the
owner name of the record, as HTTPS and SVBC need it to process "."
in service form.

The additional section callback can now return the RRset that was
added.  We use this when adding CNAMEs.  Previously, the recursion
would stop if it detected that a record you added already exists.  With
CNAMEs this rule doesn't work, as you ultimately care about the RRset
at the target of the CNAME and not the presence of the CNAME itself.
Returning the record allows the caller to restart with the target
name.  As CNAMEs can form loops, loop protection was added.

As HTTPS and SVBC can produce infinite chains, we prevent this by
tracking recursion depth and stopping if we go too deep.
2021-08-18 13:49:48 +10:00
Mark Andrews
baaa5492ee add svcb fuzzing seed 2021-08-18 13:49:48 +10:00
Mark Andrews
bc21015438 Add invalid test vectors 2021-08-18 13:49:48 +10:00
Mark Andrews
3e459b4808 add text vs unknown test vectors 2021-08-18 13:49:48 +10:00
Mark Andrews
36f34a3e79 Parse and print HTTPS and SVCB records 2021-08-18 13:49:48 +10:00
Mark Andrews
42c22670b3 Add support for parsing <tag>[=<value>]
where <value> may be a quoted string.  Previously quoted string
only supported opening quotes at the start of the string.
2021-08-18 13:49:48 +10:00
Mark Andrews
f0265b8fa6 Make whether to follow additional data records generic
Adds dns_rdatatype_followadditional() and
DNS_RDATATYPEATTR_FOLLOWADDITIONAL
2021-08-18 13:49:48 +10:00
Mark Andrews
b5b6c1f6d8 Merge branch '2319-add-the-ability-to-display-the-badcookie-message-to-dig-when-badcookie-is-active' into 'main'
Resolve "Add the ability to display the BADCOOKIE message to dig when +badcookie is active"

Closes #2319

See merge request isc-projects/bind9!4443
2021-08-18 02:51:02 +00:00
Mark Andrews
e690b4dfad Add CHANGES for [GL #2319] 2021-08-18 09:44:50 +10:00
Mark Andrews
85a639f5fb Test dig +showbadcookie 2021-08-18 09:44:50 +10:00
Mark Andrews
4f9a1b03dc Add the ability to display the BADCOOKIE message in dig when
+badcookie is in effect.
2021-08-18 09:44:50 +10:00
Matthijs Mekking
f6999fb0ff Merge branch '2845-rndc-freeze-edit-include-file-thaw' into 'main'
Add test for in-view zone edits

Closes #2845

See merge request isc-projects/bind9!5316
2021-08-16 15:06:09 +00:00
Matthijs Mekking
598bf1c29b Add test for in-view zone edits
Add a test case for GL #2845 where a zone is in two views, one base
view and one "in-view" and that zone is using an $INCLUDE. Make sure
that there is a jnl file (have ixfr-from-differences enabled and do a
dynamic update). Then freeze and make updates in the included file
(this requires the test.db file also to be updated because 'rndc freeze'
causes the zone file to be overwritten). Finally reload and ensure that
the edit in the included file has been loaded.
2021-08-16 15:05:46 +00:00
Matthijs Mekking
b98594e048 Merge branch '2665-qname-minimization-disabled-after-first-resolution' into 'main'
QNAME minimization is bypassed with stale zonecut in cache

Closes #2665

See merge request isc-projects/bind9!5327
2021-08-16 14:41:40 +00:00
Mark Andrews
f79876b2d5 More correctly implement ends with label sequence check
string.endswith("label.sequence") doesn't check for the implict
period before "label.sequence" when matching longer strings.

"foo.label.sequence" should match but "foolabel.sequence shouldn't".
2021-08-16 14:15:17 +10:00
Matthijs Mekking
192329d3c6 Add change entry and release note for GL #2665 2021-08-13 11:37:52 +02:00
Matthijs Mekking
bc448fb3b1 Don't use stale nodes when looking up a zonecut
When looking up a zonecut in cache, we use 'dns_rbt_findnode' to find
the closest matching node. This function however does not take into
account stale nodes. When we do find a stale node and use it, this
has implications for subsequent lookups. For example, this may break
QNAME minimization because we are using a deeper zonecut than we should
have.

Check the header for staleness and if so, and stale entries are not
accepted, look for the deepest zonecut from this node up.
2021-08-13 11:37:52 +02:00
Matthijs Mekking
e2d4896864 Add extra checks for !ANCIENT(header)
There are some occurrences where we check if a header exists in the
rbtdb. These cases require that the header is also not marked as
ancient (aka ready for cleanup). These cases involve finding certain
data in cache.
2021-08-13 09:42:34 +02:00
Matthijs Mekking
322626ab5b Add qmin test cases when RRset has expired
Add test cases for GL #2665: The QNAME minimization (if enabled) should
also occur on the second query, after the RRsets have expired from
cache. BIND will still have the entries in cache, but marked stale.
These stale entries should not prevent the resolver from minimizing
the QNAME. We query for the test domain a.b.stale. in all cases (QNAME
minimization off, strict mode, and relaxed mode) and expect it to
behave the same the second time we have a stale delegation structure in
cache.
2021-08-13 09:42:34 +02:00
Evan Hunt
502f48aad0 Merge branch 'feature/master/dig-return-codes' into 'main'
Document return codes of dig

See merge request isc-projects/bind9!2688
2021-08-12 17:33:16 +00:00
Petr Menšík
f20cc30a6a Document return codes of dig
The dig tool reports some states as exit status. Document them briefly
in the manual page.
2021-08-12 10:27:24 -07:00
Evan Hunt
5f9d312868 Merge branch '2785-resconf-timeout-retry.conf' into 'main'
Parse timeout and attempts from resolv.conf

Closes #2785

See merge request isc-projects/bind9!5273
2021-08-12 17:19:15 +00:00
Petr Menšík
abfbb575a5 CHANGES [GL #2785] 2021-08-12 09:53:35 -07:00
Petr Menšík
48d5b50313 Check parsed resconf values
Add 'attempts' check, fix 'ndots' data. Create a bunch of verification
functions and check parsed values, not just return codes.
2021-08-12 09:52:52 -07:00
Petr Menšík
dbf71b3f68 Parse 'timeout' and 'attempts' from resolv.conf
It was supported by lwres in BIND 9.11, and is still mentioned in
the manual page. Restore support for it by adding it to libirs.
2021-08-12 09:52:52 -07:00
Artem Boldariev
47cf5c1787 Merge branch 'artem/doh-mem-alloc-optimisations' into 'main'
Optimise memory usage in the DoH code and fix a hard-to-reproduce crash

See merge request isc-projects/bind9!5309
2021-08-12 11:53:54 +00:00
Artem Boldariev
f85d899f55 Add a CHANGES entry for the crash fix [GL #2851]
This commit adds a CHANGES entry for the fixed crash, caused by
detaching from the session->handle too early when sending HTTP/2
session data.
2021-08-12 14:31:44 +03:00
Artem Boldariev
d72b1fa5cd Fix the doh_recv_send() logic in the doh_test
The commit fixes the doh_recv_send() because occasionally it would
fail because it did not wait for all responses to be sent, making the
check for ssends value to nit pass.
2021-08-12 14:28:17 +03:00
Artem Boldariev
e639957b58 Optimise TLS stream for small write size (>= 512 bytes)
This commit changes TLS stream behaviour in such a way, that it is now
optimised for small writes. In the case there is a need to write less
or equal to 512 bytes, we could avoid calling the memory allocator at
the expense of possibly slight increase in memory usage. In case of
larger writes, the behviour remains unchanged.
2021-08-12 14:28:17 +03:00
Artem Boldariev
e301e1e3b8 Avoid memory copying during send in TLS stream
At least at this point doing memory copying is not required. Probably
it was a workaround for some problem in the earlier days of DoH, at
this point it appears to be a waste of CPU cycles.
2021-08-12 14:28:17 +03:00
Artem Boldariev
bd69c7c57c Simplify buffering code logic in http_send_outgoing()
This commit significantly simplifies the code in http_send_outgoing()
as it was unnecessary complicated, because it was dealing with
multiple statically and dynamically allocated buffers, making it
extremely hard to follow, as well as making it to do unnecessary
memory copying in some situations. This commit fixes these issues,
while retaining the high level buffering logic.
2021-08-12 14:28:17 +03:00
Artem Boldariev
a32faa20b4 DoH: replace a custom buffer code for POST data with isc_buffer_t
This commit replaces the custom buffer code in client-side DoH code
intended to keep track of POST data, with isc_buffer_t.
2021-08-12 14:28:17 +03:00
Artem Boldariev
5b52a7e37e When terminating a client session, mark it as closing
When an HTTP/2 client terminates a session it means that it is about
to close the underlying connection. However, we were not doing that.
As a result, with the latest changes to the test suite, which made it
to limit amount of requests per a transport connection, the tests
using quota would hang for quite a while. This commit fixes that.
2021-08-12 14:28:17 +03:00
Artem Boldariev
dbca22877a Limit the number of requests sent per connection in DoH tests
This commit ensures that only a limited number of requests is going to
be sent over a single HTTP/2 connection. Before that change was
introduced, it was possible to complete all of the planned sends via
only one transport connection, which undermines the purpose of the
tests using the quota facility.
2021-08-12 14:28:16 +03:00
Artem Boldariev
a05728beb0 Do not call http_do_bio() in isc__nm_http_request()
The function should not be called here because it is, in general,
supposed to be called at the end of the transport level callbacks to
perform I/O, and thus, calling it here is clearly a mistake because it
breaks other code expectations. As a result of the call to
http_do_bio() from within isc__nm_http_request() the unit tests were
running slower than expected in some situations.

In this particular situation http_do_bio() is going to be called at
the end of the transport_connect_cb() (initially), or http_readcb(),
sending all of the scheduled requests at once.

This change affects only the test suite because it is the only place
in the codebase where isc__nm_http_request() is used in order to
ensure that the server is able to handle multiple HTTP/2 streams at
once.
2021-08-12 14:28:16 +03:00
Artem Boldariev
849d38b57b Fix a crash by attach to the transport socket as early as possible
This commit fixes a crash in DoH caused by transport handle to be
detached too early when sending outgoing data.

We need to attach to the session->handle earlier because as an
indirect result of the nghttp2_session_mem_send() the session might
get closed and the handle detached. However, there is still might be
some outgoing data to handle. Besides, even when the underlying socket
was closed via the handle, we still should try to attempt to send
outgoing data via isc_nm_send() to let it call write callback, passed
to the http_send_outgoing().
2021-08-12 14:28:16 +03:00
Artem Boldariev
e0704f2e5d Use isc_buffer_t to keep track of outgoing response
This commit gets rid of custom code taking care of response buffering
by replacing the custom code with isc_buffer_t. Also, it gets rid of
an unnecessary memory copying when sending a response.
2021-08-12 14:28:16 +03:00
Artem Boldariev
6fe4ab39b9 Use isc_buffer_t to keep track of incoming POST data
This commit replaces the ad-hoc 64K buffer for incoming POST data with
isc_buffer_t backed by dynamically allocated buffer sized accordingly
to the value in the "Content-Length" header.
2021-08-12 14:28:16 +03:00
Artem Boldariev
0ca790d9bf DoH: isc__buffer_usedregion->isc_buffer_usedregion in client_send()
This commit replaces wrong usage of  isc__buffer_usedregion() instead
of implied  isc_buffer_usedregion().
2021-08-12 14:28:16 +03:00
Artem Boldariev
2733cca3ac Replace ad-hoc DNS message buffer in client code with isc_buffer_t
The commit replaces an ad-hoc incoming DNS-message buffer in the
client-side DoH code with isc_buffer_t.

The commit also fixes a timing issue in the unit tests revealed by the
change.
2021-08-12 14:28:16 +03:00
Artem Boldariev
c819caa3a1 Replace the HTTP/2 session's ad-hoc buffer with isc_buffer_t
This commit replaces a static ad-hoc HTTP/2 session's temporary buffer
with a realloc-able isc_buffer_t object, which is being allocated on
as needed basis, lowering the memory consumption somewhat. The buffer
is needed in very rare cases, so allocating it prematurely is not
wise.

Also, it fixes a bug in http_readcb() where the ad-hoc buffer appeared
to be improperly used, leading to a situation when the processed data
from the receiving regions can be processed twice, while unprocessed
data will never be processed.
2021-08-12 14:28:16 +03:00
Mark Andrews
83b1d3b49b Merge branch 'marka-remove-print0-run.sh' into 'main'
Use 'find ... -exec ... {} +' run.sh

See merge request isc-projects/bind9!5315
2021-08-12 01:09:25 +00:00
Mark Andrews
de88d83a78 replace '-print0 | xargs -0' with '-exec ... {} +' 2021-08-12 10:41:27 +10:00
Mark Andrews
ce8527252c Merge branch '2844-rndc-freeze-command-always-fails-perhaps-due-to-in-view' into 'main'
Resolve "`rndc freeze` command always fails, perhaps due to `in-view`"

Closes #2844

See merge request isc-projects/bind9!5311
2021-08-12 00:13:32 +00:00
Mark Andrews
1f8ef7cfe2 Add CHANGES not for [GL #2844] 2021-08-12 09:52:45 +10:00
Mark Andrews
dcdd9a403a Don't freeze / thaw non-explict in-view zones 2021-08-12 09:52:03 +10:00
Mark Andrews
ebc92b799b Check 'rndc freeze' with in-view zones works 2021-08-12 09:52:03 +10:00
Matthijs Mekking
812d1027f7 Merge branch '1551-dnssec-signzone-prepublish-zsk-support' into 'main'
dnssec-signzone ZSK smooth rollover

Closes #1551

See merge request isc-projects/bind9!5285
2021-08-11 13:35:44 +00:00
Matthijs Mekking
1befaa5d45 Add release note and change entry for [#1551] 2021-08-11 15:15:48 +02:00
Matthijs Mekking
94bb545087 Fix bug in dst_key_copymetadata
When copying metadata from one dst_key to another, when the source
dst_key has a boolean metadata unset, the destination dst_key will
have a numeric metadata unset instead.

This means that if a key has KSK or ZSK unset, we may be clearing the
Predecessor or Successor metadata in the destination dst_key.
2021-08-11 15:15:25 +02:00
Matthijs Mekking
35efbc270f Add test for dnssec-signzone smooth ZSK roll
Add a test case to the dnssec system test to check that:
- a zone with a prepublished key is only signed with the active key.
- a zone with an inactive key but valid signatures retains those
  signatures and does not add signatures from successor key.
- signatures are swapped in a zone when signatures of predecessor
  inactive key are within the refresh interval.
2021-08-11 15:15:25 +02:00
Matthijs Mekking
837adb93d3 dnssec-signzone ZSK smooth rollover
When signing with a ZSK, check if it has a predecessor. If so, and if
the predecessor key is sane (same algorithm, key id matches predecessor
value, is zsk), check if the RRset is signed with this key. If so, skip
signing with this successor key. Otherwise, do sign with the successor
key.

This change means we also need to apply the interval to keys that are
not actively signing. In other words, 'expired' is always
'isc_serial_gt(now + cycle, rrsig.timeexpire)'.

Fix a print style issue ("removing signature by ..." was untabbed).
2021-08-11 15:15:25 +02:00
Matthijs Mekking
efb1f1c5b8 Merge branch 'matthijs-iterations-typo-dnssec-guide' into 'main'
Fix missing iterations value in dnssec-guide

See merge request isc-projects/bind9!5317
2021-08-11 08:39:48 +00:00
Matthijs Mekking
9e109191cc Fix missing iterations value in dnssec-guide
In the "Migrating from NSEC to NSEC3" section, it says:

    dnssec-policy "standard" {
        nsec3param iterations optout no salt-length 16;
    };

There should be an integer after "iterations". Based on the following
text, the number of iterations should be 10.
2021-08-11 08:39:34 +00:00
Michał Kępień
c3689e6d2c Merge branch '2839-placeholder' into 'main'
Add placeholder for GL #2839

See merge request isc-projects/bind9!5318
2021-08-09 19:45:31 +00:00
Michał Kępień
50ee7f930a Add placeholder for GL #2839 2021-08-09 21:41:59 +02:00
Artem Boldariev
0bb2fa307c Merge branch 'artem/doh-no-rwlocks' into 'main'
Get rid of RW locks in the DoH code

See merge request isc-projects/bind9!5278
2021-08-04 07:59:42 +00:00
Artem Boldariev
170cc41d5c Get rid of some HTTP/2 related types when NGHTTP2 is not available
This commit removes definitions of some DoH-related types when
libnghttp2 is not available.
2021-08-04 10:32:27 +03:00
Artem Boldariev
f388b71378 Get rid of RW locks in the DoH code
This commit gets rid of RW locks in a hot path of the DoH code. In the
original design, it was implied that we add new endpoints after the
HTTP listener was created. Such a design implies some locking. We do
not need such flexibility, though. Instead, we could build a set of
endpoints before the HTTP listener gets created. Such a design does
not need RW locks at all.
2021-08-04 10:32:25 +03:00
Mark Andrews
ebb670c8f8 Merge branch '2830-statistics-system-tests-needs-to-save-named-stats-files' into 'main'
Resolve "statistics system tests needs to save named.stats files"

Closes #2830

See merge request isc-projects/bind9!5290
2021-08-03 00:52:15 +00:00
Mark Andrews
53afccf42b save named.stats files 2021-08-02 17:05:06 +10:00
Matthijs Mekking
f563cd570c Merge branch '2836-parental-agents-documentation-missing-string-net' into 'main'
Fix parental-agents documentation

Closes #2836

See merge request isc-projects/bind9!5302
2021-07-27 12:11:05 +00:00
Matthijs Mekking
8d75ec8300 Fix parental-agents documentation
There is a missing string "net" in the ARM in the parental-agents
example.
2021-07-27 14:10:16 +02:00
Artem Boldariev
ca29677200 Merge branch '2809-doh-quota-systest-fix-on-fbsd11' into 'main'
Resolve "Fix the DoH quota stress test on FreeBSD 11"

Closes #2809

See merge request isc-projects/bind9!5304
2021-07-27 07:53:45 +00:00
Artem Boldariev
9e8ff1d6ad Increase the initial TCP timeout for the DoH quota test
This commit increases the idle TCP timeout to let the DoH quota system
test pass on some platforms (namely FreeBSD 11). It turned out to run
slow enough on the CI under load for the idle TCP timeout to kick in.
2021-07-27 10:30:12 +03:00
Artem Boldariev
ae26a1ec75 Refactor the DoH quota stress test to make it more reliable
This commit refactors the DoH quota system test to make it more
reliable.

The test tries to establish dummy TCP connections to stress the quota
one by one instead of in bulk until the BIND instance cannot answer
queries anymore. This design is better because the test itself does
not need to be aware of the actual quota size.
2021-07-27 10:30:11 +03:00
Michal Nowak
fb982dbdea Merge branch 'v9_17_16-release' into 'main'
Merge 9.17.16 release branch

See merge request isc-projects/bind9!5296
2021-07-23 07:28:30 +00:00
Michal Nowak
109bb0db47 Set up release notes for BIND 9.17.17 2021-07-23 09:19:37 +02:00
Michał Kępień
4b18384e60 Drop Windows zips from release tarballs 2021-07-23 09:19:37 +02:00
Michał Kępień
7aa7b0b419 Update BIND version to 9.17.16 2021-07-23 09:19:37 +02:00
Michał Kępień
c5fc7c22f0 Add a CHANGES marker 2021-07-23 09:19:36 +02:00
Michał Kępień
8600f0fa14 Merge branch 'mnowak/prepare-documentation-for-bind-9.17.16' into 'v9_17_16-release'
Prepare documentation for BIND 9.17.16

See merge request isc-private/bind9!307
2021-07-23 09:19:36 +02:00
Michał Kępień
3cc71752d9 Prepare release notes for BIND 9.17.16 2021-07-23 09:19:36 +02:00
Michał Kępień
565ed6f76a Add release note for GL #2758 2021-07-23 09:19:36 +02:00
Michał Kępień
db2e1de052 Add release note for GL #2686 2021-07-23 09:19:36 +02:00
Michał Kępień
8371f13b4e Reorder release notes 2021-07-23 09:19:36 +02:00
Michal Nowak
0048006114 Tweak and reword release notes 2021-07-23 09:19:36 +02:00
Michal Nowak
16d2d922ef Tweak and reword recent CHANGES entries 2021-07-23 09:19:36 +02:00
Michał Kępień
7c61550435 Restore release note for GL #2780 2021-07-23 09:19:36 +02:00
Mark Andrews
8a7e19c4f9 Merge branch '2735-bind-9-16-must-stop-named-delete-jnl-files-for-signed-zones-to-be-updated' into 'main'
Order the diff from dns_db_diffx so that deletes proceed adds

Closes #2735

See merge request isc-projects/bind9!5284
2021-07-22 22:26:54 +00:00
Mark Andrews
ba950cf193 Add CHANGES note for [GL #2735] 2021-07-23 07:53:15 +10:00
Mark Andrews
cf8aadfeb6 Check that reload with deleted journal works 2021-07-23 07:52:44 +10:00
Mark Andrews
163fb0b825 Check that restart with zone changes and deleted journal works 2021-07-23 07:52:44 +10:00
Mark Andrews
76453961bd Order the diff from dns_db_diffx so that deletes proceed adds
for the same rdataset.  This allows the diff when passed to
dns_diff_apply to succeed.
2021-07-23 07:52:44 +10:00
Mark Andrews
c7fc13a9fa Check reload of dnssec-policy zone works 2021-07-23 07:52:44 +10:00
Mark Andrews
9c9ee59fa7 Remove spurious early exit 2021-07-23 07:52:44 +10:00
Mark Andrews
af9a3f4e5f Merge branch '2542-inline-loadtime-not-recorded' into 'main'
Record load time of touched inline zones

Closes #2542

See merge request isc-projects/bind9!5289
2021-07-22 21:46:55 +00:00
Mark Andrews
10d3a48e2f Add CHANGES for [GL #2542] 2021-07-23 07:24:25 +10:00
Mark Andrews
b84c057130 Check that load time was recorded for unchanged inline zone
subsequent reloads should not report 'ixfr-from-differences: unchanged'
2021-07-23 07:23:53 +10:00
Mark Andrews
194e47cb0d Record load time when a inline zone file has been touched 2021-07-23 07:23:52 +10:00
Michal Nowak
4f84f0d3b9 Merge branch '2473-run-respdiff-as-part-of-daily-runs' into 'main'
Run respdiff CI job for scheduled and web pipelines

Closes #2473

See merge request isc-projects/bind9!4710
2021-07-22 12:15:24 +00:00
Michal Nowak
561b58196b Run respdiff also for scheduled and web pipelines
respdiff needs to be run regularly to identify problems with query
responses discrepancies sooner than after tagging a release.

MAX_DISAGREEMENTS_PERCENTAGE variable is set to 0.5 on the main branch
to make room for a greater number of response disagreements between a
relatively old baseline version and the Development Version.
2021-07-22 13:15:55 +02:00
Ondřej Surý
64f8852e6c Merge branch '2831-use-static-storage-for-ctx-water' into 'main'
Use static storage for isc_mem water_t

Closes #2831

See merge request isc-projects/bind9!5295
2021-07-22 10:19:50 +00:00
Ondřej Surý
22db2705cd Use static storage for isc_mem water_t
On the isc_mem water change the old water_t structure could be used
after free.  Instead of introducing reference counting on the hot-path
we are going to introduce additional constraints on the
isc_mem_setwater.  Once it's set for the first time, the additional
calls have to be made with the same water and water_arg arguments.
2021-07-22 11:51:46 +02:00
Evan Hunt
240f9d2037 Merge branch '2833-notify-delay-doc' into 'main'
clarify 'notify-delay' documentation

Closes #2833

See merge request isc-projects/bind9!5293
2021-07-22 02:57:36 +00:00
Evan Hunt
dcf2d48674 clarify 'notify-delay' documentation
- the explanation was unclear
- the reference to 'serial-query-rate' was outdated
2021-07-21 14:39:48 -07:00
Ondřej Surý
2e6b1afdb3 Merge branch 'ondrej/reduce-the-node-lock-count' into 'main'
Reduce the nodelock count for both cache and regular rbtdb

Closes #2829

See merge request isc-projects/bind9!5282
2021-07-21 15:36:27 +00:00
Ondřej Surý
28a684953d Add CHANGES note for [GL #2829] 2021-07-21 17:02:30 +02:00
Ondřej Surý
6b24460a40 Reduce the nodelock count for both cache and regular rbtdb
Increasing the nodelock count had major impact on the memory footprint
in scenarios where multiple rbtdb structure would be created like
hosting many zones in a single server.

This reverts commit 0344684385 and sets
the nodelock count to previously used values.
2021-07-21 17:00:15 +02:00
Michal Nowak
5a04b5bb1a Merge branch 'mnowak/support-cross-compilation-on-buster' into 'main'
Add 32-bit cross-compiled builds on Debian Buster

See merge request isc-projects/bind9!4516
2021-07-21 09:26:00 +00:00
Michal Nowak
bfcaa2a8f1 Add 32-bit cross-compiled CI jobs on Debian Buster
Since the forced removal of gcc:sid:i386 in 0aacabc6, we lacked a 32-bit
environment to build and test BIND 9 in the CI. gcc:buster:amd64cross32
adds an environment to cross-compile BIND 9 to 32-bits on Debian Buster
amd64 image with 32-bit BIND 9 dependencies. Commit also adds sanity
checks to ensure that compiled objects are not of the build platform
triplet type.
2021-07-21 10:03:12 +02:00
Mark Andrews
adb1ca6d54 Merge branch '2762-check-opcode' into 'main'
check returned opcodes

Closes #2762

See merge request isc-projects/bind9!5286
2021-07-21 02:38:13 +00:00
Mark Andrews
36720fb4a6 add release note for [GL #2762] 2021-07-20 15:18:14 +10:00
Mark Andrews
466db0f49e Add CHANGES for [GL #2762] 2021-07-20 15:18:13 +10:00
Mark Andrews
0bba0ab10d check nsupdate handles UPDATE response to QUERY 2021-07-20 15:17:32 +10:00
Mark Andrews
e97249e012 dns_rdata_tostruct() should reject rdata with DNS_RDATA_UPDATE set 2021-07-20 15:17:32 +10:00
Mark Andrews
ed4e00713f Check opcode of messages returned by dns_request_getresponse 2021-07-20 15:17:32 +10:00
Michal Nowak
42492890a7 Merge branch 'mnowak/process-core-dumps-when-named-fails-to-start' into 'main'
Process core dump from named which failed to start

See merge request isc-projects/bind9!4987
2021-07-16 16:13:54 +00:00
Michal Nowak
a39697635b Fix handling of restart option in run.sh
The support for stat.pl's --restart option was incomplete in run.sh.
This change makes sure it's handled properly and that named.run file is
not being removed by clean.sh when the --restart option is used.
2021-07-16 16:37:57 +02:00
Michal Nowak
bc097d3358 Process core dump from named which failed to start
When named failed to start and produced core dump, the core file wasn't
processed by GDB because of run.sh script exiting immediately. This
remedies the limitation, simplifies the surrounding code, and makes the
script shellcheck clean.
2021-07-16 16:37:57 +02:00
Michal Nowak
4339831e54 Merge branch 'mnowak/replace-literal-blocks-with-anchors' into 'main'
Use anchors instead of literal blocks in .gitlab-ci.yml

See merge request isc-projects/bind9!4742
2021-07-16 14:21:36 +00:00
Michal Nowak
c22008629e Use anchors instead of literal blocks in .gitlab-ci.yml
Anchor lets the user see the full command logged in GitLab CI:

    ${CONFIGURE} --disable-maintainer-mode --enable-developer ...

Instead of a folded multi-line when literal block is used:

    ${CONFIGURE} \ # collapsed multi-line command
2021-07-16 12:15:01 +02:00
Artem Boldariev
5f2b69a038 Merge branch 'artem/doh-quota-integration' into 'main'
Make DoH-quota separate and configurable, make it possible to limit the number of HTTP/2 streams per connection

See merge request isc-projects/bind9!5036
2021-07-16 09:41:01 +00:00
Artem Boldariev
87f79a67f2 Add a missing break on error when adding a DoH endpoint
The break on error when adding a DoH endpoint was implied but somehow
gotten missed. This commit fixes that.
2021-07-16 11:50:22 +03:00
Artem Boldariev
f5614be9df Update documentation to include the new HTTP configuration options
Documentation for the new DoH options has been added.
2021-07-16 11:50:22 +03:00
Artem Boldariev
3773802f20 Add a system test that tests connections quota for DoH
The system tests stress out the DoH quota by opening many TCP
connections and then running dig instances against the "overloaded"
server to perform some queries. The processes cannot make any
resolutions because the quota is exceeded. Then the opened connections
are getting closed in random order allowing the queries to proceed.
2021-07-16 11:50:22 +03:00
Artem Boldariev
ac9ce6f446 modify CHANGES [GL #2809]
Document the new HTTP specific options in the CHANGES file.
2021-07-16 11:50:22 +03:00
Artem Boldariev
147da54e13 Update grammar reference documentation
This commit updates the named grammar reference according to the
latest changes.
2021-07-16 11:50:22 +03:00
Artem Boldariev
590e8e0b86 Make max number of HTTP/2 streams configurable
This commit makes number of concurrent HTTP/2 streams per connection
configurable as a mean to fight DDoS attacks. As soon as the limit is
reached, BIND terminates the whole session.

The commit adds a global configuration
option (http-streams-per-connection) which can be overridden in an
http <name> {...} statement like follows:

http local-http-server {
    ...
    streams-per-connection 100;
    ...
};

For now the default value is 100, which should be enough (e.g. NGINX
uses 128, but it is a full-featured WEB-server). When using lower
numbers (e.g. ~70), it is possible to hit the limit with
e.g. flamethrower.
2021-07-16 11:50:22 +03:00
Artem Boldariev
03a557a9bb Add (http-)listener-clients option (DoH quota mechanism)
This commit adds support for http-listener-clients global options as
well as ability to override the default in an HTTP server description,
like:

http local-http-server {
    ...
    listener-clients 100;
    ...
};

This way we have ability to specify per-listener active connections
quota globally and then override it when required. This is exactly
what AT&T requested us: they wanted a functionality to specify quota
globally and then override it for specific IPs. This change
functionality makes such a configuration possible.

It makes sense: for example, one could have different quotas for
internal and external clients. Or, for example, one could use BIND's
internal ability to serve encrypted DoH with some sane quota value for
internal clients, while having un-encrypted DoH listener without quota
to put BIND behind a load balancer doing TLS offloading for external
clients.

Moreover, the code no more shares the quota with TCP, which makes
little sense anyway (see tcp-clients option), because of the nature of
interaction of DoH clients: they tend to keep idle opened connections
for longer periods of time, preventing the TCP and TLS client from
being served. Thus, the need to have a separate, generally larger,
quota for them.

Also, the change makes any option within "http <name> { ... };"
statement optional, making it easier to override only required default
options.

By default, the DoH connections are limited to 300 per listener. I
hope that it is a good initial guesstimate.
2021-07-16 11:50:20 +03:00
Artem Boldariev
0aac2d094a Merge branch 'artem/doh-http-path-validation' into 'main'
Verify HTTP paths both in incoming requests and in config file

See merge request isc-projects/bind9!5231
2021-07-16 07:51:43 +00:00
Artem Boldariev
dac3e4abc9 Update CHANGES
The CHANGES file was updated to include information that configuration
checking code now verifies HTTP paths properly.
2021-07-16 10:28:28 +03:00
Artem Boldariev
954240467d Verify HTTP paths both in incoming requests and in config file
This commit adds the code (and some tests) which allows verifying
validity of HTTP paths both in incoming HTTP requests and in BIND's
configuration file.
2021-07-16 10:28:08 +03:00
Michał Kępień
40aba825ae Merge branch '2759-extend-tests-for-signed-cname-sourced-delegations' into 'main'
Extend tests for signed, CNAME-sourced delegations

Closes #2759

See merge request isc-projects/bind9!5272
2021-07-16 05:23:15 +00:00
Michał Kępień
a14efdf54c Extend tests for signed, CNAME-sourced delegations
Extend the "chain" system test with AUTHORITY section checks for signed,
secure delegations.  This complements the checks for signed, insecure
delegations added by commit 26ec4b9a89.

Extend the existing AUTHORITY section checks for signed, insecure
delegations to ensure nonexistence of DS RRsets in such responses.
Adjust comments accordingly.

Ensure dig failures cause the "chain" system test to fail.
2021-07-16 07:20:15 +02:00
Michał Kępień
29d8d35869 Tweak query_addds() comments to avoid confusion
It has been noticed that commit 7a87bf468b
did not only fix NSEC record handling in signed, insecure delegations
prepared using both wildcard expansion and CNAME chaining - it also
inadvertently fixed DS record handling in signed, secure delegations
of that flavor.  This is because the 'rdataset' variable in the relevant
location in query_addds() can be either a DS RRset or an NSEC RRset.
Update a code comment in query_addds() to avoid confusion.

Update the comments describing the purpose of query_addds() so that they
also mention NSEC(3) records.
2021-07-16 07:20:15 +02:00
Mark Andrews
ddacc7e1b2 Merge branch '2820-rndc-reconfig-does-not-act-on-change-to-zone-statistics' into 'main'
Resolve "rndc reconfig does not act on change to zone-statistics"

Closes #2820

See merge request isc-projects/bind9!5271
2021-07-16 04:09:53 +00:00
Mark Andrews
f2461afff7 Add CHANGES for [GL #2820] 2021-07-16 13:49:22 +10:00
Mark Andrews
616896d735 zone->requeststats_on was not being set at the correct point 2021-07-16 13:49:22 +10:00
Mark Andrews
592f9ff6bc Test that 'zone-statistics full;' is properly processed 2021-07-16 13:49:22 +10:00
Matthijs Mekking
02c3a2decc Merge branch '2710-multisigner-cds' into 'main'
Allow update CDS/CDNSKEY records that do not match DNSKEY

Closes #2710

See merge request isc-projects/bind9!5270
2021-07-15 07:24:09 +00:00
Matthijs Mekking
ba5869943d Add change and release notes [#2710] 2021-07-15 08:32:16 +02:00
Matthijs Mekking
577bf913b9 Relax zone_cdscheck function
If we have a CDS or CDNSKEY we at least need to have a DNSKEY with the
same algorithm published and signing the CDS RRset. Same for CDNSKEY
of course.

This relaxes the zone_cdscheck function, because before the CDS or
CDNSKEY had to match a DNSKEY, now only the algorithm has to match.

This allows a provider in a multisigner model to update the CDS/CDNSKEY
RRset in the zone that is served by the other provider.
2021-07-14 12:10:11 -07:00
Matthijs Mekking
6b79db1fdd Add test for allowing update CDS/CDNSKEY
Add tests to the nsupdate system test to make sure that CDS and/or
CDNSKEY that match an algorithm in the DNSKEY RRset are allowed. Also
add tests that updates are rejected if the algorithm does not match.

Remove the now redundant test cases from the dnssec system test.

Update the checkzone system test: Change the algorithm of the CDS and
CDNSKEY records so that the zone is still rejected.
2021-07-14 12:10:11 -07:00
Evan Hunt
2292b48c2a Merge branch 'each-doc-trampoline' into 'main'
document isc__trampoline

See merge request isc-projects/bind9!5116
2021-07-14 17:59:28 +00:00
Evan Hunt
4f6e2317e9 document isc__trampoline
Added some header file documentation to the isc__trampoline
implementation in trampoline_p.h.
2021-07-14 10:55:12 -07:00
Artem Boldariev
9a7d2000e6 Merge branch 'artem/doh-empty-query-string-crash-fix' into 'main'
Fix crash in DoH on empty query string in GET requests

See merge request isc-projects/bind9!5268
2021-07-13 13:55:30 +00:00
Artem Boldariev
3e3c944d2e Add CHANGES for [GL !5268]
The commit updates the CHANGES file adding a note about a crash caused
by improper handling of DoH GET requests.
2021-07-13 16:54:25 +03:00
Artem Boldariev
64cd7e8a7f Fix crash in DoH on empty query string in GET requests
An unhandled code path left GET query string data uninitialised (equal
to NULL) and led to a crash during the requests' base64 data
decoding. This commit fixes that.
2021-07-13 16:53:51 +03:00
Ondřej Surý
1c5d033576 Merge branch '2822-inconsistent-recursive-performance' into 'main'
Disable setting the thread affinity

Closes #2822

See merge request isc-projects/bind9!5265
2021-07-13 13:50:53 +00:00
Ondřej Surý
41afe6bc5e Add CHANGES and release notes for [GL #2822] 2021-07-13 15:44:08 +02:00
Ondřej Surý
4c5dc1904b Disable the cpu system test
As we don't set the thread affinity, the cpu test would consistently
fail.  Disable it, but don't remove it as we might restore setting the
affinity in the future versions of BIND 9.
2021-07-13 14:48:29 +02:00
Ondřej Surý
a9e6a7ae57 Disable setting the thread affinity
It was discovered that setting the thread affinity on both the netmgr
and netthread threads lead to inconsistent recursive performance because
sometimes the netmgr and netthread threads would compete over single
resource and sometimes not.

Removing setting the affinity causes a slight dip in the authoritative
performance around 5% (the measured range was from 3.8% to 7.8%), but
the recursive performance is now consistently good.
2021-07-13 14:48:29 +02:00
Ondřej Surý
a92a89f4fa Merge branch '2815-increase-sizeinfo-memory-alignment-on-OpenBSD' into 'main'
Use max_align_t for memory sizeinfo alignment on OpenBSD

Closes #2815

See merge request isc-projects/bind9!5267
2021-07-13 12:00:01 +00:00
Ondrej Sury
6eca4b402e Use max_align_t for memory sizeinfo alignment on OpenBSD
On OpenBSD and more generally on platforms without either jemalloc or
malloc_(usable_)size, we need to increase the alignment for the memory
to sizeof(max_align_t) as with plain sizeof(void *), the compiled code
would be crashing when accessing the returned memory.
2021-07-13 13:48:33 +02:00
Matthijs Mekking
97e1a1f929 Merge branch '2811-checkds-memleak-shutdown' into 'main'
Fix leak in checkds code

Closes #2811

See merge request isc-projects/bind9!5262
2021-07-13 09:50:33 +00:00
Matthijs Mekking
2ccf342690 Add change entry for [#2811] 2021-07-13 11:12:37 +02:00
Matthijs Mekking
b676163933 Fix leak in checkds code
In 'checkds_send_toaddr' there is a goto bug that causes the TSIG key
and DNS message to not be detached. Remove the offending goto statement.
2021-07-13 11:12:37 +02:00
Ondřej Surý
ef467a5a7c Merge branch '2819-cache-the-isc_os_ncpu-result' into 'main'
Cache the isc_os_ncpu() result

Closes #2819

See merge request isc-projects/bind9!5263
2021-07-13 07:55:51 +00:00
Ondrej Sury
23751fe252 Cache the isc_os_ncpu() result
It was discovered that on some platforms (f.e. Alpine Linux with MUSL)
the result of isc_os_ncpus() call differ when called before and after we
drop privileges.  This commit changes the isc_os_ncpus() call to cache
the result from the first call and thus always return the same value
during the runtime of the named.  The first call to isc_os_ncpus() is
made as soon as possible on the library initalization.
2021-07-13 09:12:04 +02:00
Ondřej Surý
e04d69533d Merge branch '2816-mem-c-739-2-runtime-error-null-pointer-returned-from-function-declared-to-never-return-null' into 'main'
Remove nonnull attribute from isc_mem_{get,allocate,reallocate}

Closes #2816

See merge request isc-projects/bind9!5261
2021-07-12 08:23:40 +00:00
Ondřej Surý
b9722ce98f Merge branch '2815-crashes-related-to-memory-reallocation-on-openbsd' into 'main'
Fix the real allocation size in OpenBSD rallocx shim

Closes #2815

See merge request isc-projects/bind9!5260
2021-07-12 08:06:09 +00:00
Ondřej Surý
ce03015d48 Remove nonnull attribute from isc_mem_{get,allocate,reallocate}
The isc_mem_get(), isc_mem_allocate() and isc_mem_reallocate() can
return NULL ptr in case where the allocation size is NULL.  Remove the
nonnull attribute from the functions' declarations.

This stems from the following definition in the C11 standard:

> If the size of the space requested is zero, the behavior is
> implementation-defined: either a null pointer is returned, or the
> behavior is as if the size were some nonzero value, except that the
> returned pointer shall not be used to access an object.

In this case, we return NULL as it's easier to detect errors when
accessing pointer from zero-sized allocation which should obviously
never happen.
2021-07-12 10:02:18 +02:00
Ondřej Surý
d1a9e549b1 Fix the real allocation size in OpenBSD rallocx shim
In the rallocx() shim for OpenBSD (that's the only platform that doesn't
have malloc_size() or malloc_usable_size() equivalent), the newly
allocated size was missing the extra size_t member for storing the
allocation size leading to size_t sized overflow at the end of the
reallocated memory chunk.
2021-07-12 08:43:14 +02:00
Mark Andrews
592a4bc456 Merge branch '2703-gcc-10-fanalyzer-reports-dereference-of-null-text-in-server-c-14721' into 'main'
Resolve "gcc-10+ -fanalyzer reports dereference of NULL ‘text’ in server.c:14721"

Closes #2703

See merge request isc-projects/bind9!5047
2021-07-12 04:28:50 +00:00
Mark Andrews
ac0fc3c2de Add DBC REQUIRE to check that 'text' is non NULL
for all control channel commands.  This should silence
gcc-10-analyzer reporting NULL pointer dereference of 'text'.
2021-07-12 03:55:37 +00:00
Mark Andrews
7301ab8b47 Merge branch '2753-timer_test-subtests-are-not-independent' into 'main'
Resolve "timer_test subtests are not independent"

Closes #2753

See merge request isc-projects/bind9!5146
2021-07-12 03:55:00 +00:00
Mark Andrews
3945c289bb Reset errcnt at the start of each subtest 2021-07-12 03:47:11 +00:00
Mark Andrews
1e84ebd2f8 Merge branch '2808-v9_16-unchecked-returns-in-rbtdb_test-c-and-dnssec-signzone-c-main' into 'main'
Fix unchecked return of isc_rwlock_lock and isc_rwlock_unlock

Closes #2808

See merge request isc-projects/bind9!5257
2021-07-12 03:46:15 +00:00
Mark Andrews
9528ba5a22 Fix unchecked returns of dns_name_fromtext
(cherry picked from commit 8538c762cb)
2021-07-12 13:26:29 +10:00
Mark Andrews
ce5207699d Fix unchecked return of isc_rwlock_lock and isc_rwlock_unlock
(cherry picked from commit bcaf23dd27)
2021-07-12 13:26:29 +10:00
Mark Andrews
70a7973135 Merge branch '2249-stop-falling-back-to-plain-dns-on-formerr-opt' into 'main'
Resolve "Stop falling back to plain DNS on FORMERR+OPT"

Closes #2249

See merge request isc-projects/bind9!4634
2021-07-12 02:59:19 +00:00
Mark Andrews
e9c72ca95c Add release note for [GL #2249] 2021-07-12 12:33:46 +10:00
Mark Andrews
5ab0c9fdfe Add CHANGES note for [GL #2249] 2021-07-12 12:33:46 +10:00
Mark Andrews
3c942a3e3a Update out of date comment 2021-07-12 12:33:46 +10:00
Mark Andrews
0477938e2f Adjust expected queries for no fallback to plain DNS 2021-07-12 12:30:03 +10:00
Mark Andrews
a3fda086f7 Check that there was no OPT record before falling back
to plain DNS on FORMERR.
2021-07-12 12:30:03 +10:00
Mark Andrews
fb4b9d690f Merge branch '2810-silence-untrusted-loop-bound' into 'main'
Resolve "Silence untrusted loop bound"

Closes #2810

See merge request isc-projects/bind9!5251
2021-07-12 02:09:41 +00:00
Mark Andrews
c5e1c35e45 Silence untrusted loop bound on nsec3param.iterations
630
   	    1. tainted_argument: Calling function dns_rdata_tostruct taints argument nsec3param.iterations. [show details]
    631        result = dns_rdata_tostruct(nsec3rdata, &nsec3param, NULL);
   	    2. Condition !!(result == 0), taking true branch.
   	    3. Condition !!(result == 0), taking true branch.
    632        RUNTIME_CHECK(result == ISC_R_SUCCESS);
    633
    634        dns_fixedname_init(&fixed);

            CID 281425 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
            4. tainted_data: Passing tainted expression nsec3param.iterations to dns_nsec3_hashname, which uses it as a loop boundary. [show details]
   	    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    635        result = dns_nsec3_hashname(&fixed, rawhash, &rhsize, vctx->origin,
    636                                    vctx->origin, nsec3param.hash,
    637                                    nsec3param.iterations, nsec3param.salt,
    638                                    nsec3param.salt_length);
2021-07-12 00:48:13 +00:00
Mark Andrews
ad17419313 Merge branch '2807-coverity-reports-use-of-tainted-scalar' into 'main'
Resolve "Coverity reports use of tainted scalar"

Closes #2807

See merge request isc-projects/bind9!5249
2021-07-12 00:42:27 +00:00
Mark Andrews
f0fdca90f2 Silence tainted scalar on rdlen
2042        ttl = isc_buffer_getuint32(&j->it.source);
    	    13. tainted_data_transitive: Call to function isc_buffer_getuint16 with tainted argument *j->it.source.base returns tainted data. [show details]
    	    14. var_assign: Assigning: rdlen = isc_buffer_getuint16(&j->it.source), which taints rdlen.
    2043        rdlen = isc_buffer_getuint16(&j->it.source);
    2044
    2045        /*
    2046         * Parse the rdata.
    2047         */
    	    15. Condition j->it.source.used - j->it.source.current != rdlen, taking false branch.
    2048        if (isc_buffer_remaininglength(&j->it.source) != rdlen) {
    2049                FAIL(DNS_R_FORMERR);
    2050        }
    	    16. var_assign_var: Assigning: j->it.source.active = j->it.source.current + rdlen. Both are now tainted.
    2051        isc_buffer_setactive(&j->it.source, rdlen);
    2052        dns_rdata_reset(&j->it.rdata);
    	    17. lower_bounds: Checking lower bounds of unsigned scalar j->it.source.active by taking the true branch of j->it.source.active > j->it.source.current.

    CID 316506 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
    18. tainted_data: Passing tainted expression j->it.source.active to dns_rdata_fromwire, which uses it as a loop boundary. [show details]
    	    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    2053        CHECK(dns_rdata_fromwire(&j->it.rdata, rdclass, rdtype, &j->it.source,
    2054                                 &j->it.dctx, 0, &j->it.target));
2021-07-12 00:22:07 +00:00
Mark Andrews
83fd38dd2c Silence use of tainted scalar
2607
            43. tainted_argument: Calling function journal_read_xhdr taints argument xhdr.size. [show details]
    2608                        result = journal_read_xhdr(j1, &xhdr);
            44. Condition rewrite, taking true branch.
            45. Condition result == 29, taking false branch.
    2609                        if (rewrite && result == ISC_R_NOMORE) {
    2610                                break;
    2611                        }
            46. Condition result != 0, taking false branch.
    2612                        CHECK(result);
    2613
            47. var_assign_var: Assigning: size = xhdr.size. Both are now tainted.
    2614                        size = xhdr.size;

            CID 331088 (#3 of 3): Untrusted allocation size (TAINTED_SCALAR)
            48. tainted_data: Passing tainted expression size to isc__mem_get, which uses it as an allocation size. [show details]
            Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    2615                        buf = isc_mem_get(mctx, size);
2021-07-12 00:22:07 +00:00
Ondřej Surý
d7aa979a6c Merge branch '2812-fix-get-realloc-put-mismatch-in-netmgr' into 'main'
Revert the allocate/free -> get/put change from jemalloc change

Closes #2812

See merge request isc-projects/bind9!5252
2021-07-09 16:57:05 +00:00
Ondřej Surý
29a285a67d Revert the allocate/free -> get/put change from jemalloc change
In the jemalloc merge request, we missed the fact that ah_frees and ah_handles
are reallocated which is not compatible with using isc_mem_get() for allocation
and isc_mem_put() for deallocation.  This commit reverts that part and restores
use of isc_mem_allocate() and isc_mem_free().
2021-07-09 18:19:57 +02:00
Ondřej Surý
2ceca6f24d Merge branch '2433-improve-memory-contention' into 'main'
Reduce the contention of the memory allocator

Closes #2433

See merge request isc-projects/bind9!5012
2021-07-09 14:27:24 +00:00
Artem Boldariev
c55a747704 Merge branch 'artem/doh-ignore-accept-header' into 'main'
DoH: Improve compatiblity by ignoring an "Accept" HTTP header value

See merge request isc-projects/bind9!5246
2021-07-09 14:00:32 +00:00
Evan Hunt
d40d1fd590 Add CHANGES and release notes for [GL #2433] 2021-07-09 15:59:03 +02:00
Ondřej Surý
9c3bebc26f Properly disable the "water" in isc_mem
The proper way how to disable the water limit in the isc_mem context is
to call:

    isc_mem_setwater(ctx, NULL, NULL, 0, 0);

this ensures that the old water callback is called with ISC_MEM_LOWATER
if the callback was called with ISC_MEM_HIWATER before.

Historically, there were some places where the limits were disabled by
calling:

    isc_mem_setwater(ctx, water, water_arg, 0, 0);

which would also call the old callback, but it also causes the water_t
to be allocated and extra check to be executed because water callback is
not NULL.

This commits unifies the calls to disable water to the preferred form.
2021-07-09 15:58:02 +02:00
Ondřej Surý
ca228ec3e5 Disable jemalloc for Address and Thread Sanitizers
The Address and Thread Sanitizers both intercept the malloc calls and
using the extended jemalloc API interferes with that.  This commit
disables the use of jemalloc for both ASAN and TSAN enabled builds to
eliminate both false positives and false negatives.
2021-07-09 15:58:02 +02:00
Artem Boldariev
3673abc53c Use restrict and const in isc_mempool_t
This commit makes add restrict and const modifiers to some variables
to aid compiler to do its optimizations.
2021-07-09 15:58:02 +02:00
Artem Boldariev
c11a401add Do not use atomic variables in isc_mempool_t
As now mempool objects intended to be used in a thread-local manner,
there is no point in using atomic here.
2021-07-09 15:58:02 +02:00
Ondřej Surý
63b06571b9 Use isc_mem_get() and isc_mem_put() in isc_mem_total test
Previously, the isc_mem_allocate() and isc_mem_free() would be used for
isc_mem_total test, but since we now use the real allocation
size (sallocx, malloc_size, malloc_usable_size) to track the allocation
size, it's impossible to get the test value right.  Changing the test to
use isc_mem_get() and isc_mem_put() will use the exact size provided, so
the test would work again on all the platforms even when jemalloc is not
being used.
2021-07-09 15:58:02 +02:00
Ondřej Surý
d3676a1fc5 Disable jemalloc on softhsm2.4 branch
It was discovered that softhsm2.4 has a bug that causes invalid free()
call to be called when unloading libsofthsm.so.2 library.  The native
PKCS#11 API is scheduled to removed in the 9.17+ release, we could
safely just disable jemalloc for this particular build.
2021-07-09 15:58:02 +02:00
Ondřej Surý
6f162e8aa4 Rewrite isc_mem water to use single atomic exchange operation
This commit refactors the water mechanism in the isc_mem API to use
single pointer to a water_t structure that can be swapped with
atomic_exchange operation instead of having four different
values (water, water_arg, hi_water, lo_water) in the flat namespace.

This reduces the need for locking and prevents a race when water and
water_arg could be desynchronized.
2021-07-09 15:58:02 +02:00
Ondřej Surý
798333d456 Allow size == 0 in isc_mem_{get,allocate,reallocate}
Calls to jemalloc extended API with size == 0 ends up in undefined
behaviour.  This commit makes the isc_mem_get() and friends calls
more POSIX aligned:

  If size is 0, either a null pointer or a unique pointer that can be
  successfully passed to free() shall be returned.

We picked the easier route (which have been already supported in the old
code) and return NULL on calls to the API where size == 0.
2021-07-09 15:58:02 +02:00
Ondřej Surý
e20cc41e56 Use system allocator when jemalloc is unavailable
This commit adds support for systems where the jemalloc library is not
available as a package, here's the quick summary:

  * On Linux - the jemalloc is usually available as a package, if
    configured --without-jemalloc, the shim would be used around
    malloc(), free(), realloc() and malloc_usable_size()

  * On macOS - the jemalloc is available from homebrew or macports, if
    configured --without-jemalloc, the shim would be used around
    malloc(), free(), realloc() and malloc_size()

  * On FreeBSD - the jemalloc is *the* system allocator, we just need
    to check for <malloc_np.h> header to get access to non-standard API

  * On NetBSD - the jemalloc is *the* system allocator, we just need to
    check for <jemalloc/jemalloc.h> header to get access to non-standard
    API

  * On a system hostile to users and developers (read OpenBSD) - the
    jemalloc API is emulated by using ((size_t *)ptr)[-1] field to hold
    the size information.  The OpenBSD developers care only for
    themselves, so why should we care about speed on OpenBSD?
2021-07-09 15:58:02 +02:00
Evan Hunt
68a28cbc0a update the "memory" section of the developer doc
Information about memory allocation was outdated.
2021-07-09 15:58:02 +02:00
Evan Hunt
6591786102 document the dependency on jemalloc
updated README and PLATFORMS with new text on build requirements.
2021-07-09 15:58:02 +02:00
Evan Hunt
2ce0de6995 Remove error checks in dns_message for mem allocations
Removed error checks for several functions that can no longer fail due
to failed memory allocation.
2021-07-09 15:58:02 +02:00
Ondřej Surý
e754360170 Remove atomic thread synchronization from the memory hot-path
This commit refactors the hi/lo-water related code to remove contention
on the hot path in the memory allocator.
2021-07-09 15:58:02 +02:00
Ondřej Surý
efb385ecdc Clean up isc_mempool API
- isc_mempool_get() can no longer fail; when there are no more objects
  in the pool, more are always allocated. checking for NULL return is
  no longer necessary.
- the isc_mempool_setmaxalloc() and isc_mempool_getmaxalloc() functions
  are no longer used and have been removed.
2021-07-09 15:58:02 +02:00
Evan Hunt
62d06a4987 initialize state object in test-async driver
the hooks system test was failing due to a block of
memory not having been zeroed after allocation.
2021-07-09 15:58:02 +02:00
Ondřej Surý
7cbfbc8faa Clean up the dns_dispatch_getudp API
Cleanup unused parts of dns_dispatch_getudp API, remove
dns_dispatch_getudp_dup() function and related code.
2021-07-09 15:58:02 +02:00
Ondřej Surý
f487c6948b Replace locked mempools with memory contexts
Current mempools are kind of hybrid structures - they serve two
purposes:

 1. mempool with a lock is basically static sized allocator with
    pre-allocated free items

 2. mempool without a lock is a doubly-linked list of preallocated items

The first kind of usage could be easily replaced with jemalloc small
sized arena objects and thread-local caches.

The second usage not-so-much and we need to keep this (in
libdns:message.c) for performance reasons.
2021-07-09 15:58:02 +02:00
Ondřej Surý
fd3ceec475 Add debug tracing capability to isc_mempool_create/destroy
Previously, we only had capability to trace the mempool gets and puts,
but for debugging, it's sometimes also important to keep track how many
and where do the memory pools get created and destroyed.  This commit
adds such tracking capability.
2021-07-09 15:58:02 +02:00
Ondřej Surý
5ab05d1696 Replace isc_mem_allocate() usage with isc_mem_get() in netmgr.c
The isc_mem_allocate() comes with additional cost because of the memory
tracking.  In this commit, we replace the usage with isc_mem_get()
because we track the allocated sizes anyway, so it's possible to also
replace isc_mem_free() with isc_mem_put().
2021-07-09 15:58:02 +02:00
Ondřej Surý
fcc6814776 Replace internal memory calls with non-standard jemalloc API
The jemalloc non-standard API fits nicely with our memory contexts, so
just rewrite the memory context internals to use the non-public API.

There's just one caveat - since we no longer track the size of the
allocation for isc_mem_allocate/isc_mem_free combination, we need to use
sallocx() to get real allocation size in both allocator and deallocator
because otherwise the sizes would not match.
2021-07-09 15:58:02 +02:00
Ondřej Surý
4b3d0c6600 Remove ISC_MEM_DEBUGSIZE and ISC_MEM_DEBUGRECORD
The ISC_MEM_DEBUGSIZE and ISC_MEM_DEBUGCTX did sanity checks on matching
size and memory context on the memory returned to the allocator.  Those
will no longer needed when most of the allocator will be replaced with
jemalloc.
2021-07-09 15:58:02 +02:00
Ondřej Surý
692fd2a216 Remove default_memalloc and default_memfree
Now that we have xmalloc:true enabled, we can remove our xmalloc-like
wrappers around malloc and free.
2021-07-09 15:58:02 +02:00
Ondřej Surý
5184384efd Add recommended jemalloc configuration for our load
There's global variable called `malloc_conf` that can be used to
configure jemalloc behaviour at the program startup.  We use following
configuration:

  * xmalloc:true - abort-on-out-of-memory enabled.

  * background_thread:true - Enable internal background worker threads
    to handle purging asynchronously.

  * metadata_thp:auto - allow jemalloc to use transparent huge page
    (THP) for internal metadata initially, but may begin to do so when
    metadata usage reaches certain level.

  * dirty_decay_ms:30000 - Approximate time in milliseconds from the
    creation of a set of unused dirty pages until an equivalent set of
    unused dirty pages is purged and/or reused.

  * muzzy_decay_ms:30000 - Approximate time in milliseconds from the
    creation of a set of unused muzzy pages until an equivalent set of
    unused muzzy pages is purged and/or reused.

More information about the specific meaning can be found in the jemalloc
manpage or online at http://jemalloc.net/jemalloc.3.html
2021-07-09 15:58:02 +02:00
Ondřej Surý
7f1c525625 Compile with jemalloc to reduce memory allocator contention
The jemalloc allocator is scalable high performance allocator, this is
the first in the series of commits that will add jemalloc as a memory
allocator for BIND 9.

This commit adds configure.ac check and Makefile modifications to use
jemalloc as BIND 9 allocator.
2021-07-09 15:58:02 +02:00
Ondřej Surý
63924968d1 Add debug tracing capability to isc_mem_create/isc_mem_destroy
Previously, we only had capability to trace the memory gets and puts,
but for debugging, it's sometimes also important to keep track how many
and where do the memory contexts get created and destroyed.  This commit
adds such tracking capability.
2021-07-09 15:58:02 +02:00
Artem Boldariev
c6d0e3d3a7 Return HTTP status code for small/malformed requests
This commit makes BIND return HTTP status codes for malformed or too
small requests.

DNS request processing code would ignore such requests. Such an
approach works well for other DNS transport but does not make much
sense for HTTP, not allowing it to complete the request/response
sequence.

Suppose execution has reached the point where DNS message handling
code has been called. In that case, it means that the HTTP request has
been successfully processed, and, thus, we are expected to respond to
it either with a message containing some DNS payload or at least to
return an error status code. This commit ensures that BIND behaves
this way.
2021-07-09 16:37:08 +03:00
Artem Boldariev
debd0241f7 modify CHANGES
Add a note to changes regarding ignoring the "Accept" HTTP header.
2021-07-09 16:27:45 +03:00
Artem Boldariev
fedff2cd6c Return "Bad Request" (400) in a case of Base64 decoding error
This error code fits better than the more generic "Internal Server
Error" (500) which implies that the problem is on the server.

Also, do not end the whole HTTP/2 session on a bad request.
2021-07-09 16:26:46 +03:00
Artem Boldariev
1792740075 Ignore an "Accept" HTTP header value
We were too strict regarding the value and presence of "Accept" HTTP
header, slightly breaking compatibility with the specification.

According to RFC8484 client SHOULD add "Accept" header to the requests
but MUST be able to handle "application/dns-message" media type
regardless of the value of the header. That basically suggests we
ignore its value.

Besides, verifying the value of the "Accept" header is a bit tricky
because it could contain multiple media types, thus requiring proper
parsing. That is doable but does not provide us with any benefits.

Among other things, not verifying the value also fixes compatibility
with clients, which could advertise multiple media types as supported,
which we should accept. For example, it is possible for a perfectly
valid request to contain "application/dns-message", "application/*",
and "*/*" in the "Accept" header value. Still, we would treat such a
request as invalid.
2021-07-09 16:26:46 +03:00
Artem Boldariev
4bf1bd4da5 Merge branch 'artem/doh-hang-on-stop-fix' into 'main'
Fix BIND hanging when browsers end HTTP/2 streams prematurely

See merge request isc-projects/bind9!5245
2021-07-09 13:03:40 +00:00
Artem Boldariev
751c5744c4 Modify CHANGES
Document that BIND hanging in a case HTTP/2 streams been ended
prematurely is fixed.
2021-07-09 15:43:37 +03:00
Artem Boldariev
7b6945fb60 Fix BIND hanging when browsers end HTTP/2 streams prematurely
The commit fixes BIND hanging when browsers end HTTP/2 streams
prematurely (for example, by sending RST_STREAM). It ensures that
isc__nmsocket_prep_destroy() will be called for an HTTP/2 stream,
allowing it to be properly disposed.

The problem was impossible to reproduce using dig or DoH benchmarking
software (e.g. flamethrower) because these do not tend to end HTTP/2
streams prematurely.
2021-07-09 15:42:44 +03:00
Artem Boldariev
094fcc10e7 Move the code which calls server read callback into a separate func
This commit moves the code which calls server read callback into a
separate function to avoid code repetition.
2021-07-09 15:42:44 +03:00
Ondřej Surý
6302fdd196 Merge branch '2478-consider-making-the-build-time-dependency-on-nghttp2-optional' into 'main'
Make the DNS over HTTPS support optional

Closes #2478

See merge request isc-projects/bind9!4926
2021-07-07 08:15:26 +00:00
Ondřej Surý
29843bcde8 Add CHANGES and release notes for [GL #2478] 2021-07-07 09:50:53 +02:00
Ondřej Surý
2bb454182b Make the DNS over HTTPS support optional
This commit adds two new autoconf options `--enable-doh` (enabled by
default) and `--with-libnghttp2` (mandatory when DoH is enabled).

When DoH support is disabled the library is not linked-in and support
for http(s) protocol is disabled in the netmgr, named and dig.
2021-07-07 09:50:53 +02:00
Evan Hunt
390a522366 Merge branch '2756-rndc-multiple-algorithm' into 'main'
allow multiple key algorithms in the same control listener

Closes #2756

See merge request isc-projects/bind9!5153
2021-07-06 18:43:53 +00:00
Evan Hunt
a605a84b08 CHANGES 2021-07-06 10:54:13 -07:00
Evan Hunt
841b557df8 allow multiple key algorithms in the same control listener
if a control channel listener was configured with more than one
key algorithm, message verification would be attempted with each
algorithm in turn. if the first key failed due to the wrong
signature length, the entire verification process was aborted,
rather than continuing on to try with another key.
2021-07-06 10:54:13 -07:00
Ondřej Surý
f663701b1d Merge branch 'ondrej/remove-platform.h-header' into 'main'
Remove isc/platform.h

See merge request isc-projects/bind9!5162
2021-07-06 05:53:30 +00:00
Ondřej Surý
29c2e52484 The isc/platform.h header has been completely removed
The isc/platform.h header was left empty which things either already
moved to config.h or to appropriate headers.  This is just the final
cleanup commit.
2021-07-06 05:33:48 +00:00
Ondřej Surý
bf4a0e26dc Move NAME_MAX and PATH_MAX from isc/platform.h to isc/dir.h
The last remaining defines needed for platforms without NAME_MAX and
PATH_MAX (I'm looking at you, GNU Hurd) were moved to isc/dir.h where
it's prevalently used.
2021-07-06 05:33:48 +00:00
Ondřej Surý
4da0c49e80 Move ISC_STRERRORSIZE to isc/strerr.h header
The ISC_STRERRORSIZE was defined in isc/platform.h header as the
value was different between Windows and POSIX platforms.  Now that
Windows is gone, move the define to where it belongs.
2021-07-06 05:33:48 +00:00
Ondřej Surý
d881e30b0a Remove LIB<*>_EXTERNAL_DATA defines
After Windows has been removed, the LIB<*>_EXTERNAL_DATA defines
were just dummy leftovers.  Remove them.
2021-07-06 05:33:48 +00:00
Mark Andrews
e204b5c413 Merge branch 'marka-xmllint-html' into 'main'
Check for errors in html files

See merge request isc-projects/bind9!5242
2021-07-02 02:06:56 +00:00
Mark Andrews
ea0624b214 Check for errors in html files
xmllint doesn't know about the HTML 5 <section> tag so filter
those out.
2021-07-02 11:45:59 +10:00
Matthijs Mekking
b53c2416d6 Merge branch '1126-checkds-followup-cid332468' into 'main'
Fix CID 332468: Memory - illegal accesses (UNINIT)

Closes #1126

See merge request isc-projects/bind9!5241
2021-07-01 14:27:36 +00:00
Matthijs Mekking
b4a0e19290 Fix CID 332468: Memory - illegal accesses (UNINIT)
*** CID 332468:  Memory - illegal accesses  (UNINIT)
/lib/dns/zone.c: 6613 in dns_zone_getdnsseckeys()
6607                 ISC_LIST_UNLINK(dnskeys, k1, link);
6608                 ISC_LIST_APPEND(*keys, k1, link);
6609             }
6610         }
6611     6612     failure:
>>>     CID 332468:  Memory - illegal accesses  (UNINIT)
>>>     Using uninitialized value "keyset.methods" when calling
>>>     "dns_rdataset_isassociated".
6613         if (dns_rdataset_isassociated(&keyset)) {
6614             dns_rdataset_disassociate(&keyset);
6615         }
6616         if (node != NULL) {
6617             dns_db_detachnode(db, &node);
6618         }

Fix by initializing the 'keyset' with 'dns_rdataset_init'.
2021-07-01 15:49:43 +02:00
Matthijs Mekking
5e8cebb2e5 Merge branch '2786-keyfile-locking-race-condition-deadlock' into 'main'
Fix possible deadlock when locking key files

Closes #2786

See merge request isc-projects/bind9!5210
2021-07-01 09:27:54 +00:00
Matthijs Mekking
be87edd249 Add release note and change for [#2786] 2021-07-01 10:20:15 +02:00
Mark Andrews
68c4908292 Merge branch '2769-journal-rollforward-failed-journal-out-of-sync-with-zone' into 'main'
Resolve "journal rollforward failed: journal out of sync with zone"

Closes #2769, #2728, and #2686

See merge request isc-projects/bind9!5177
2021-07-01 04:54:11 +00:00
Mark Andrews
4b2b6fc42c Add CHANGES note for [GL #2769] 2021-07-01 14:34:57 +10:00
Mark Andrews
c6fa8a1d45 Handle placeholder KEYDATA record
A placeholder keydata record can appear in a zone file.  Allow them
to be read back in.
2021-07-01 14:34:28 +10:00
Matthijs Mekking
f3bce65661 Merge branch '1126-checkds' into 'main'
checkds

Closes #1126

See merge request isc-projects/bind9!5234
2021-06-30 15:49:42 +00:00
Matthijs Mekking
c92128eada Move private_type_record() to conf.sh.common
The function 'private_type_record()' is now used in multiple system
setup scripts and should be moved to the common configuration script
conf.sh.common.
2021-06-30 17:29:14 +02:00
Matthijs Mekking
22cd63bf81 Add change and release note for [#1126]
Seems pretty newsworthy.
2021-06-30 17:29:13 +02:00
Matthijs Mekking
b4c1f3b832 Update documentation
Update ARM and DNSSEC guide with the new checkds feature.
2021-06-30 17:28:49 +02:00
Matthijs Mekking
39df3f0475 Protect dst key metadata with lock
The DST key metadata can be written by several threads in parralel.
Protect the dst_key_get* and dst_key_set* functions with a mutex.
2021-06-30 17:28:49 +02:00
Matthijs Mekking
28c5179904 Replace zone keyflock with zonemgr keymgmt
The old approach where each zone structure has its own mutex that
a thread needs to obtain multiple locks to do safe keyfile I/O
operations lead to a race condition ending in a possible deadlock.

Consider a zone in two views. Each such zone is stored in a separate
zone structure. A thread that needs to read or write the key files for
this zone needs to obtain both mutexes in seperate structures. If
another thread is working on the same zone in a different view, they
race to get the locks. It would be possible that thread1 grabs the
lock of the zone in view1, while thread2 wins the race for the lock
of the zone in view2. Now both threads try to get the other lock,  both
of them are already locked.

Ideally, when a thread wants to do key file operations, it only needs
to lock a single mutex. This commit introduces a key management hash
table, stored in the zonemgr structure. Each time a zone is being
managed, an object is added to the hash table (and removed when the
zone is being released). This object is identified by the zone name
and contains a mutex that needs to be locked prior to reading or
writing key files.

(cherry-picked from commit ef4619366d49efd46f9fae5f75c4a67c246ba2e6)
2021-06-30 17:28:49 +02:00
Matthijs Mekking
f7872dbd20 Add checkds code
Similar to notify, add code to send and keep track of checkds requests.

On every zone_rekey event, we will check the DS at parental agents
(but we will only actually query parental agents if theree is a DS
scheduled to be published/withdrawn).

On a zone_rekey event, we will first clear the ongoing checkds requests.
Reset the counter, to avoid continuing KSK rollover premature.

This has the risk that if zone_rekey events happen too soon after each
other, there are redundant DS queries to the parental agents. But
if TTLs and the configured durations in the dnssec-policy are sane (as
in not ridiculous short) the chance of this happening is low.
2021-06-30 17:28:49 +02:00
Matthijs Mekking
1a50554963 Add checkds log notice
When the checkds published/withdrawn is activated, log a notice. Can
be used for testing, but also operationally useful.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
6e2c24be7c Add key metadata for DS published/withdrawn
In order to keep track of how many parents have the DS for a given key
published or withdrawn, keep a counter.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
4c337a8e72 Add missing VERIFY export
This makes the 'dnssec-verify' tool visible to the test environment.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
71d5932a14 Slightly improved dnssec tools fatal message
Return the offending key state identifier.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
40331a20c4 Add helpful function 'dns_zone_getdnsseckeys'
This code gathers DNSSEC keys from key files and from the DNSKEY RRset.
It is used for the 'rndc dnssec -status' command, but will also be
needed for "checkds". Turn it into a function.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
2872d6a12e Add "parental-source[-v6]" config option
Similar to "notify-source" and "transfer-source", add options to
set the source address when querying parental agents for DS records.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
c9b7f62767 Add dst_key_role function
Change the static function 'get_ksk_zsk' to a library function that
can be used to determine the role of a dst_key. Add checks if the
boolean parameters to store the role are not NULL. Rename to
'dst_key_role'.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
6f92d4b9a5 Parse "parental-agents" configuration
Parse the new "parental-agents" configuration and store it in the zone
structure.
2021-06-30 17:28:48 +02:00
Matthijs Mekking
6040c71478 Make "primaries" config parsing generic
Make the code to parse "primaries" configuration more generic so
it can be reused for "parental-agents".
2021-06-30 17:28:48 +02:00
Matthijs Mekking
8327cb7839 Remove stray "setup zone" in kasp system setup 2021-06-30 17:28:48 +02:00
Matthijs Mekking
56262db9cd Add checkds system test
Add a Pytest based system test for the 'checkds' feature. There is
one nameserver (ns9, because it should be started the latest) that
has configured several zones with dnssec-policy. The zones are set
in such a state that they are waiting for DS publication or DS
withdrawal.

Then several other name servers act as parent servers that either have
the DS for these published, or not. Also one server in the mix is
to test a badly configured parental-agent.

There are tests for DS publication, DS publication error handling,
DS withdrawal and DS withdrawal error handling.

The tests ensures that the zone is DNSSEC valid, and that the
DSPublish/DSRemoved key metadata is set (or not in case of the error
handling).

It does not test if the rollover continues, this is already tested in
the kasp system test (that uses 'rndc -dnssec checkds' to set the
DSPublish/DSRemoved key metadata).
2021-06-30 17:28:48 +02:00
Matthijs Mekking
1e763e582b Check parental-agents config
Add checks for "parental-agents" configuration, checking for the option
being at wrong type of zone (only allowed for primaries and
secondaries), duplicate definitions, duplicate references, and
undefined parental clauses (the name referenced in the zone clause
does not have a matching "parental-agent" clause).
2021-06-30 17:28:48 +02:00
Matthijs Mekking
0311705d4b Add parental-agents configuration
Introduce a way to configure parental agents that can be used to
query DS records to be used in automatic key rollovers.
2021-06-30 17:28:47 +02:00
Matthijs Mekking
39a961112f Change primaries objects to remote-servers
Change the primaries configuration objects to the more generic
remote-servers, that we can reuse for other purposes (such as
parental-agents).
2021-06-30 17:21:11 +02:00
Petr Špaček
f4c4217eec Merge branch '2797-cfg-net-buf-sizes' into 'main'
fix tcp-send-buffer, udp-receive-buffer, udp-send-buffer limits

Closes #2797

See merge request isc-projects/bind9!5235
2021-06-28 10:15:12 +00:00
Petr Špaček
9290d9752d fix tcp-send-buffer, udp-receive-buffer, udp-send-buffer limits 2021-06-28 11:16:00 +02:00
Matthijs Mekking
6f84024cb5 Merge branch '2791-busy-wait-setnsec3param-shutdown-hang' into 'main'
Fix setnsec3param shutdown hang

Closes #2791

See merge request isc-projects/bind9!5219
2021-06-28 09:01:02 +00:00
Matthijs Mekking
2f270428fc Add changes for [#2791] 2021-06-28 10:38:31 +02:00
Matthijs Mekking
10055d44e3 Fix setnsec3param hang on shutdown
When performing the 'setnsec3param' task, zones that are not loaded will have
their task rescheduled. We should do this only if the zone load is still
pending, this prevents zones that failed to load get stuck in a busy wait and
causing a hang on shutdown.
2021-06-28 10:35:34 +02:00
Matthijs Mekking
3631a23c7f Add configuration that causes setnsec3param hang
Add a zone to the configuration file that uses NSEC3 with dnssec-policy
and fails to load. This will cause setnsec3param to go into a busy wait
and will cause a hang on shutdown.
2021-06-28 10:34:19 +02:00
Ondřej Surý
33394f11c3 Merge branch 'ondrej/fix-the-CFLAGS-order-in-tests' into 'main'
Move the include Makefile.tests to the bottom of Makefile.am(s)

See merge request isc-projects/bind9!4927
2021-06-24 13:49:03 +00:00
Ondřej Surý
e59a359929 Move the include Makefile.tests to the bottom of Makefile.am(s)
The Makefile.tests was modifying global AM_CFLAGS and LDADD and could
accidentally pull /usr/include to be listed before the internal
libraries, which is known to cause problems if the headers from the
previous version of BIND 9 has been installed on the build machine.
2021-06-24 15:33:52 +02:00
Ondřej Surý
5c82f7c71b Merge branch 'ondrej/remove-the-cvs-cruft' into 'main'
Remove unused or outdated utils, developer and design documentation

Closes #2745

See merge request isc-projects/bind9!5131
2021-06-24 09:45:48 +00:00
Matthijs Mekking
71c6d40942 Remove HISTORY file
We should drop the HISTORY file because it's confusing and the same
information is covered by the release notes for .0 releases (or at
least they should be).

Remove references to the HISTORY file, update the README to tell
people go look somewhere else.
2021-06-24 11:44:13 +02:00
Matthijs Mekking
717a39d5b9 Add steps to update copyrights
This was written down in the outdated doc/dev/release documentation.
Since the rest of that file can go, add these steps to a separate file
and update it to current standards (e.g. use git commands).
2021-06-24 11:14:27 +02:00
Ondřej Surý
df4d072c72 Remove unused or outdated utils, developer and design documentation
The util/, doc/design/, and doc/dev/ directories included couple of
tools or documents there were completely outdated because they either
refered the the VCS we no longer use (cvs) or described processes that
have been redesigned and they are documented elsewhere.
2021-06-24 11:14:27 +02:00
Matthijs Mekking
da8b5d7947 Merge branch '2780-checkconf-dnssec-policy-inheritance' into 'main'
Fix checkconf dnssec-policy inheritance bug

Closes #2780

See merge request isc-projects/bind9!5199
2021-06-24 08:40:52 +00:00
Matthijs Mekking
d0668bd4cc Add change and release note for [#2780] 2021-06-24 09:32:28 +02:00
Matthijs Mekking
75ec7d1d9f Fix checkconf dnssec-policy inheritance bug
Similar to #2778, the check for 'dnssec-policy' failed to account for
it being inheritable.
2021-06-24 09:31:59 +02:00
Ondřej Surý
30b23706d6 Merge branch '2183-tweak-the-safe-edns-udp-size-to-1432' into 'main'
Change the safe edns-udp-size from 1400 to 1432

Closes #2183

See merge request isc-projects/bind9!5228
2021-06-23 19:00:59 +00:00
Ondřej Surý
4266f6dd2b Change the safe edns-udp-size from 1400 to 1432
When backporting the Don't Fragment UDP socket option, it was noticed
that the edns-udp-size probing uses 1432 as one of the values to be
probed and the documentation would be recommending 1400 as the safe
value.  As the safe value can be from the 1400-1500 interval, the
documentation has been changed to match the probed value, so we do not
skip it.
2021-06-23 20:57:05 +02:00
Evan Hunt
cc39e4c8cf Merge branch '2758-nsupdate-refused' into 'main'
nsupdate: try next server on REFUSED

Closes #2758

See merge request isc-projects/bind9!5158
2021-06-23 16:01:55 +00:00
Evan Hunt
693eb67af9 CHANGES 2021-06-23 09:01:04 -07:00
Evan Hunt
d02210607d add test for server failover on REFUSED
- add an 'nsupdate -C' option to override resolv.conf file for nsupdate
- set resolv.conf to use two test servers, the first one of which will
  return REFUSED for a query for 'example'.
2021-06-23 09:00:29 -07:00
Evan Hunt
2100331307 nsupdate: try next server on REFUSED
when nsupdate sends an SOA query to a resolver, if it fails
with REFUSED, nsupdate will now try the next server rather than
aborting the update completely.
2021-06-23 09:00:29 -07:00
Ondřej Surý
f391a5edf9 Merge branch '2790-properly-handle-oversized-messages-in-isc_nm_send' into 'main'
Handle `UV_EMSGSIZE` in the uv_udp_send() callback

Closes #2790

See merge request isc-projects/bind9!5212
2021-06-23 15:55:52 +00:00
Ondřej Surý
5d9c0a3721 Add CHANGES and release note for [GL #2790] 2021-06-23 17:41:34 +02:00
Ondřej Surý
b941411072 Disable IP fragmentation on the UDP sockets
In DNS Flag Day 2020, we started setting the DF (Don't Fragment socket
option on the UDP sockets.  It turned out, that this code was incomplete
leading to dropping the outgoing UDP packets.

This has been now remedied, so it is possible to disable the
fragmentation on the UDP sockets again as the sending error is now
handled by sending back an empty response with TC (truncated) bit set.

This reverts commit 66eefac78c.
2021-06-23 17:41:34 +02:00
Evan Hunt
a3ba95116e Handle UDP send errors when sending DNS message larger than MTU
When the fragmentation is disabled on UDP sockets, the uv_udp_send()
call can fail with UV_EMSGSIZE for messages larger than path MTU.
Previously, this error would end with just discarding the response.  In
this commit, a proper handling of such case is added and on such error,
a new DNS response with truncated bit set is generated and sent to the
client.

This change allows us to disable the fragmentation on the UDP
sockets again.
2021-06-23 17:41:34 +02:00
Matthijs Mekking
e7e48414e0 Merge branch 'matthijs-2778-more-tests' into 'main'
Add more test cases for #2778

See merge request isc-projects/bind9!5198
2021-06-23 15:30:04 +00:00
Matthijs Mekking
9bd6c96b78 Add more test cases for #2778
Add three more test cases that detect a configuration error if the
key-directory is inherited but has the same value for a zone in a
different view with a deviating DNSSEC policy.
2021-06-23 17:28:06 +02:00
Ondřej Surý
38d42bb5be Merge branch '2788-add-rbtdb-ownercase-unittest' into 'main'
Add rbtdb setownercase/getownercase unit test

Closes #2788

See merge request isc-projects/bind9!5223
2021-06-23 15:13:09 +00:00
Ondřej Surý
c7a11bd5b4 Add rbtdb setownercase/getownercase unit test
This commit adds a unittest that tests private rdataset_getownercase()
and rdataset_setownercase() methods from rbtdb.c.  The test setups
minimal mock dns_rbtdb_t and dns_rbtdbnode_t data structures.

As the rbtdb methods are generally hidden behind layers and layers, we
include the "rbtdb.c" directly from rbtdb_test.c, and thus we can use
the private methods and data structures directly.  This also opens up
opportunity to add more unittest for the rbtdb private functions without
going through all the layers.
2021-06-23 16:38:46 +02:00
Matthijs Mekking
4db35fce0b Merge branch '2765-servestale-intermittent-test-failure-144' into 'main'
Resolve intermittent serve-stale test failure (144)

Closes #2765

See merge request isc-projects/bind9!5167
2021-06-23 13:10:28 +00:00
Matthijs Mekking
05e73a24f0 Bump wait time in servestale test with 1 second
This check intermittently failed:

I:serve-stale:check not in cache longttl.example times out...
I:serve-stale:failed

This corresponds to this query in the test:

$DIG -p ${PORT} +tries=1 +timeout=3  @10.53.0.3 longttl.example TXT

Looking at the dig output for a failed test, the query actually got a
response from the authoritative server (in one specific example the
query time was 2991 msec, close to 3 seconds).

After doing the query for the test, we enable the authoritative
server after a sleep of three seconds. If we bump this sleep to 4
seconds, the race will be more in favor of the query timing out,
making it unlikely that this test will fail intermittently.

Bump the subsequent wait_for_log checks also with one second.
2021-06-23 13:09:59 +00:00
Michał Kępień
3939385c13 Merge branch 'v9_17_15-release' into 'main'
Merge 9.17.15 release branch

See merge request isc-projects/bind9!5220
2021-06-23 11:02:05 +00:00
Michał Kępień
41de9ad84a Set up release notes for BIND 9.17.16 2021-06-23 12:56:35 +02:00
Michał Kępień
b16f9d5f0e Update BIND version to 9.17.15 2021-06-23 12:56:35 +02:00
Michał Kępień
eeb626d75c Add CHANGES annotations 2021-06-23 12:56:35 +02:00
Michał Kępień
0a75cd47bb Merge branch 'michal/prepare-documentation-for-bind-9.17.15' into 'v9_17_15-release'
Prepare documentation for BIND 9.17.15

See merge request isc-private/bind9!304
2021-06-23 12:56:35 +02:00
Michał Kępień
7b7dea04a3 Prepare release notes for BIND 9.17.15 2021-06-23 12:56:35 +02:00
Michał Kępień
7bfedd8c73 Tweak and reword release notes 2021-06-23 12:56:35 +02:00
Michał Kępień
4e3a5c83fe Tweak and reword recent CHANGES entries 2021-06-23 12:56:35 +02:00
Ondřej Surý
b813ea196a Merge branch '2788-use-tolower-toupper-isupper-from-ctype-h' into 'main'
Use tolower(), toupper() and isupper() from ctype.h

Closes #2788

See merge request isc-projects/bind9!5209
2021-06-23 09:45:28 +00:00
Ondřej Surý
7ccbe52060 Use POSIX tolower(), toupper() and isupper() functions
In the code that rdataset_setownercase() and rdataset_getownercase() we
now use tolower()/toupper()/isupper() functions appropriately instead of
rolling our own code.
2021-06-23 11:12:00 +02:00
Ondřej Surý
0d35b3f1a9 Don't set locale globally, just use it when needed
Previously, we would set the locale on a global level and that could
possibly lead to different behaviour in underlying functions.  In this
commit, we change to code to use the system locale only when calling the
libidn2 functions and reset the locale back to "POSIX" when exiting the
libidn2 code.
2021-06-23 11:12:00 +02:00
Michał Kępień
7e9e0ae195 Merge branch '1802-improve-description-of-mirror-zone-validation' into 'main'
Improve description of mirror zone validation

Closes #1802

See merge request isc-projects/bind9!5207
2021-06-22 20:53:48 +00:00
Michał Kępień
d877aa9adf Improve description of mirror zone validation
Expand the description of mirror zones in the ARM by adding a brief
discussion of how the validation process works for AXFR and IXFR.  Move
the paragraph mentioning the "file" option higher up.  Apply minor
stylistic and whitespace-related tweaks to the relevant section of the
ARM.
2021-06-22 22:49:36 +02:00
Michał Kępień
2fcd63cb35 Merge branch '2784-improve-descriptions-of-buffering-related-options' into 'main'
Improve descriptions of buffering-related options

Closes #2784

See merge request isc-projects/bind9!5215
2021-06-22 20:31:59 +00:00
Michał Kępień
a43cafe77d Tweak descriptions of buffering-related options
Apply minor stylistical and whitespace-related tweaks to the
descriptions of the "tcp-receive-buffer", "udp-receive-buffer",
"tcp-send-buffer", and "udp-send-buffer" options in the ARM.
2021-06-22 22:26:46 +02:00
Michał Kępień
3ee62883e3 Fix typos in buffering-related option names
The ARM contains typos in the names of the following two options:

  - "tcp-receive-buffer"
  - "udp-receive-buffer"

Fix the ARM so that it contains proper option names.
2021-06-22 22:26:46 +02:00
Michał Kępień
61bbfe208e Merge branch '2279-expand-description-of-the-max-cache-size-option' into 'main'
Expand description of the "max-cache-size" option

Closes #2279

See merge request isc-projects/bind9!5173
2021-06-22 19:37:59 +00:00
Petr Špaček
a67ceb8dda Rework description of the "max-cache-size" option
Improve the description of the "max-cache-size" option in the ARM by
focusing on its meaning for multiple views and default values.
Add mention of a hash table preallocation.
2021-06-22 21:33:08 +02:00
Artem Boldariev
4b813a80d6 Merge branch '2787-assertion-failure-handling-non-zero-opcodes-in-dot-and-doh' into 'main'
Replace netmgr per-protocol sequential function with a common one

Closes #2787

See merge request isc-projects/bind9!5208
2021-06-22 14:45:23 +00:00
Ondřej Surý
dd0e3b0213 Add CHANGES and release notes for [GL #2787] 2021-06-22 17:23:02 +03:00
Artem Boldariev
ef9f09252c System tests to check named behaviour for unexpected opcodes
This commit adds a set of tests to verify that BIND will not crash
when some opcodes are sent over DoT or DoH, leading to marking network
handle in question as sequential.
2021-06-22 17:21:44 +03:00
Ondřej Surý
ec86759401 Replace netmgr per-protocol sequential function with a common one
Previously, each protocol (TCPDNS, TLSDNS) has specified own function to
disable pipelining on the connection.  An oversight would lead to
assertion failure when opcode is not query over non-TCPDNS protocol
because the isc_nm_tcpdns_sequential() function would be called over
non-TCPDNS socket.  This commit removes the per-protocol functions and
refactors the code to have and use common isc_nm_sequential() function
that would either disable the pipelining on the socket or would handle
the request in per specific manner.  Currently it ignores the call for
HTTP sockets and causes assertion failure for protocols where it doesn't
make sense to call the function at all.
2021-06-22 17:21:44 +03:00
Michał Kępień
48256df57c Merge branch '2777-use-minimal-sized-caches-for-non-recursive-views' into 'main'
Use minimal-sized caches for non-recursive views

Closes #2777

See merge request isc-projects/bind9!5189
2021-06-22 13:31:03 +00:00
Michał Kępień
f9500f824d Add CHANGES entry 2021-06-22 15:28:31 +02:00
Michał Kępień
86698ded32 Hardcode "max-cache-size" for the "_bind" view
The built-in "_bind" view does not allow recursion and therefore does
not need a large cache database.  However, as "max-cache-size" is not
explicitly set for that view in the default configuration, it inherits
that setting from global options.  Set "max-cache-size" for the built-in
"_bind" view to a fixed value (2 MB, i.e. the smallest allowed value) to
prevent needlessly preallocating memory for its cache RBT hash table.
2021-06-22 15:28:31 +02:00
Michał Kępień
86541b39d3 Use minimal-sized caches for non-recursive views
Currently the implicit default for the "max-cache-size" option is "90%".
As this option is inherited by all configured views, using multiple
views can lead to memory exhaustion over time due to overcommitment.
The "max-cache-size 90%;" default also causes cache RBT hash tables to
be preallocated for every configured view, which does not really make
sense for views which do not allow recursion.

To limit this problem's potential for causing operational issues, use a
minimal-sized cache for views which do not allow recursion and do not
have "max-cache-size" explicitly set (either in global configuration or
in view configuration).

For configurations which include multiple views allowing recursion,
adjusting "max-cache-size" appropriately is still left to the operator.
2021-06-22 15:28:31 +02:00
Matthijs Mekking
a02710a476 Merge branch '2783-in-view-dnssec-policy-deadlock' into 'main'
Fix in-view /w dnssec-policy deadlock at startup

Closes #2783

See merge request isc-projects/bind9!5202
2021-06-22 07:23:59 +00:00
Matthijs Mekking
dae42dc9d4 Add changes and notes for [#2783] 2021-06-22 09:04:11 +02:00
Matthijs Mekking
42c601ae14 Fix deadlock issue with key-directory and in-view
When locking key files for a zone, we iterate over all the views and
lock a mutex inside the zone structure. However, if we envounter an
in-view zone, we will try to lock the key files twice, one time for
the home view and one time for the in-view view. This will lead to
a deadlock because one thread is trying to get the same lock twice.
2021-06-22 09:04:11 +02:00
Matthijs Mekking
acd83881ff Add test case for in-view with dnssec-policy
Add a test case for a zone that uses 'in-view' and 'dnssec-policy'.
BIND should not deadlock.
2021-06-21 16:03:35 +02:00
Mark Andrews
fb335e4b47 Merge branch '2778-unique-key-directories-reported-as-reused-in-9-16-17-regression-vs-9-16-16' into 'main'
Resolve "Unique key directories reported as reused in 9.16.17, regression vs 9.16.16"

Closes #2778

See merge request isc-projects/bind9!5195
2021-06-18 07:21:27 +00:00
Mark Andrews
85033788d3 Add release note for [GL #2778] 2021-06-18 16:46:02 +10:00
Mark Andrews
bd1419a9e8 Add CHANGES for [GL #2778] 2021-06-18 16:46:02 +10:00
Mark Andrews
d1e283ede1 Checking of key-directory and dnssec-policy was broken
the checks failed to account for key-directory being inheritable.
2021-06-18 16:46:02 +10:00
Mark Andrews
721237efb3 Merge branch '2779-name-in-answer-doesn-t-match-the-name-in-query' into 'main'
Resolve "name in answer doesn't match the name in query"

Closes #2779

See merge request isc-projects/bind9!5194
2021-06-18 06:27:22 +00:00
Mark Andrews
7372e9a60d Add release note for [GL #2779] 2021-06-18 15:51:37 +10:00
Mark Andrews
8c60debc18 Add CHANGES note for [GL #2779] 2021-06-18 15:51:37 +10:00
Mark Andrews
c65dc2f7dc Check wild card expansions by code point 2021-06-18 15:51:36 +10:00
Mark Andrews
08eeebb6a7 Add w and W to maptoupper and maptolower tables 2021-06-18 11:29:45 +10:00
Michal Nowak
7abde2c1d7 Merge branch 'mnowak/alpine-3.14' into 'main'
Add Alpine Linux 3.14

See merge request isc-projects/bind9!5183
2021-06-17 16:17:06 +00:00
Michal Nowak
80f828bc37 Add Alpine Linux 3.14 2021-06-17 18:16:00 +02:00
Michał Kępień
992b900557 Merge branch '2770-allow-hash-tables-for-cache-rbts-to-be-grown' into 'main'
Allow hash tables for cache RBTs to be grown

Closes #2770

See merge request isc-projects/bind9!5172
2021-06-17 15:16:38 +00:00
Michał Kępień
0c59f1362c Add CHANGES entry 2021-06-17 17:09:37 +02:00
Michał Kępień
6b77583f54 Allow resetting hash table size limits for DNS DBs
When "max-cache-size" is changed to "unlimited" (or "0") for a running
named instance (using "rndc reconfig"), the hash table size limit for
each affected cache DB is not reset to the maximum possible value,
preventing those hash tables from being allowed to grow as a result of
new nodes being added.

Extend dns_rbt_adjusthashsize() to interpret "size" set to 0 as a signal
to remove any previously imposed limits on the hash table size.  Adjust
API documentation for dns_db_adjusthashsize() accordingly.  Move the
call to dns_db_adjusthashsize() from dns_cache_setcachesize() so that it
also happens when "size" is set to 0.
2021-06-17 17:09:37 +02:00
Michał Kępień
c096f91451 Allow hash tables for cache RBTs to be grown
Upon creation, each dns_rbt_t structure has its "maxhashbits" field
initialized to the value of the RBT_HASH_MAX_BITS preprocessor macro,
i.e. 32.  When the dns_rbt_adjusthashsize() function is called for the
first time for a given RBT (for cache RBTs, this happens when they are
first created, i.e. upon named startup), it lowers the value of the
"maxhashbits" field to the number of bits required to index the
requested number of hash table slots.  When a larger hash table size is
subsequently requested, the value of the "maxhashbits" field should be
increased accordingly, up to RBT_HASH_MAX_BITS.  However, the loop in
the rehash_bits() function currently ensures that the number of bits
necessary to index the resized hash table will not be larger than
rbt->maxhashbits instead of RBT_HASH_MAX_BITS, preventing the hash table
from being grown once the "maxhashbits" field of a given dns_rbt_t
structure is set to any value lower than RBT_HASH_MAX_BITS.

Fix by tweaking the loop guard condition in the rehash_bits() function
so that it compares the new number of bits used for indexing the hash
table against RBT_HASH_MAX_BITS rather than rbt->maxhashbits.
2021-06-17 17:09:37 +02:00
Michał Kępień
64acd7c8c8 Merge branch '2763-increase-timeout-in-the-rndc-deadlock-test' into 'main'
Increase timeout in the rndc deadlock test

Closes #2763

See merge request isc-projects/bind9!5163
2021-06-17 10:40:31 +00:00
Michał Kępień
ac4c58e8ce Increase timeout in the rndc deadlock test
The timeout originally picked for "rndc status" invocations (2 seconds)
in the test attempting to reproduce a deadlock caused by running
multiple "rndc addzone", "rndc modzone", and "rndc delzone" commands
concurrently causes intermittent failures of the "addzone" system test
in GitLab CI.  Increase the timeout to 10 seconds to make such failures
less probable.  Adjust code comments accordingly.
2021-06-17 12:39:32 +02:00
Ondřej Surý
023fcf3365 Merge branch 'ondrej/fix-some-spelling' into 'main'
Fix various typos in the documentation

See merge request isc-projects/bind9!4498
2021-06-17 09:39:15 +00:00
Ondřej Surý
4ab9bb63ee Fix various typos in the documentation
Generally, the issues fixed here are missing articles, wrong articles
and double articles.  We especially like "the the".
2021-06-17 11:32:04 +02:00
Ondřej Surý
2cd6ec4857 Merge branch '2606-remove-support-for-builtin-atomics-on-legacy-clang-compilers' into 'main'
Resolve "Remove support for builtin atomics on legacy clang compilers"

Closes #2606

See merge request isc-projects/bind9!4854
2021-06-17 08:52:10 +00:00
Diego Fronza
20e968b70c Add CHANGES note for [GL #2606] 2021-06-17 09:51:05 +02:00
Ondřej Surý
54c389dbc0 Drop support for clang atomic and gcc __sync builtins
The requirements for BIND 9.17+ now requires C11 support from the
compiler, so we can safely drop most of the stdatomic.h shims from
lib/isc/unix/include/stdatomic.h.

This commit removes support for clang atomic builtins (clang >= 3.6.0
includes stdatomic.h header) and for Gcc __sync builtins.

The only compatibility shim that remains is support for __atomic
builtins for Gcc >= 4.7.0 since CentOS 7 still includes only Gcc 4.8.1
and the proper stdatomic.h header was only introduced in Gcc >= 4.9.
2021-06-17 09:51:04 +02:00
Ondřej Surý
4677bb28d1 Remove atomics emulated by a mutex-locked variable
Mutex atomics were intended to be used as a debugging tool only
and it has already served its purpose and it's not needed anymore.
2021-06-17 09:51:04 +02:00
Michał Kępień
aa626c6499 Merge branch 'v9_17_14-release' into 'main'
Merge 9.17.14 release branch

See merge request isc-projects/bind9!5186
2021-06-16 20:24:43 +00:00
Michał Kępień
f9e8c8057d Set up release notes for BIND 9.17.15 2021-06-16 22:18:12 +02:00
Michał Kępień
7e0e2dd667 Update BIND version to 9.17.14 2021-06-16 22:18:12 +02:00
Michał Kępień
2f3b74dec9 Add a CHANGES marker 2021-06-16 22:18:12 +02:00
Michał Kępień
1408f3572d Merge branch 'michal/prepare-documentation-for-bind-9.17.14' into 'v9_17_14-release'
Prepare documentation for BIND 9.17.14

See merge request isc-private/bind9!298
2021-06-16 22:18:12 +02:00
Michał Kępień
652d4a74fe Prepare release notes for BIND 9.17.14 2021-06-16 22:18:12 +02:00
Michał Kępień
54842d6349 Reorder release notes 2021-06-16 22:18:12 +02:00
Michał Kępień
451b29cbbf Tweak and reword release notes 2021-06-16 22:18:12 +02:00
Michał Kępień
59a9fa4863 Tweak and reword recent CHANGES entries 2021-06-16 22:18:12 +02:00
Michał Kępień
0439e92fa0 Remove leftover release note for GL #2603 2021-06-16 22:18:12 +02:00
Artem Boldariev
3549eed088 Merge branch 'artem/doh-memmove-null-asan-fix' into 'main'
Fix undefined behaviour in DoH (passing NULL to memmove())

See merge request isc-projects/bind9!5182
2021-06-16 15:51:02 +00:00
Artem Boldariev
dc356bb196 Fix ASAN error in DoH (passing NULL to memmove())
The warning was produced by an ASAN build:

runtime error: null pointer passed as argument 2, which is declared to
never be null

This commit fixes it by checking if nghttp2_session_mem_send() has
actually returned anything.
2021-06-16 17:46:10 +03:00
Mark Andrews
629d8a3096 Merge branch '2755-bad-tkey-samples-in-genzone-sh-comment' into 'main'
Resolve "Bad TKEY samples in genzone.sh comment"

Closes #2755

See merge request isc-projects/bind9!5152
2021-06-16 05:54:30 +00:00
Mark Andrews
47ca495108 make it clear algorithm field is a domain name 2021-06-16 05:26:00 +00:00
Mark Andrews
f035a22c42 Merge branch '2739-threadsanitizer-data-race-lib-isc-task-c-435-in-task_send-unprotected-access-to-task-threadid' into 'main'
Resolve "ThreadSanitizer: data race lib/isc/task.c:435 in task_send (unprotected access to `task->threadid`)"

Closes #2739

See merge request isc-projects/bind9!5149
2021-06-15 00:39:03 +00:00
Mark Andrews
234ad2d075 Lock access to task->threadid 2021-06-15 00:01:58 +00:00
Artem Boldariev
8d36cac81a Merge branch 'artem/dig-large-doh-responses-support' into 'main'
Fix BIND and dig to support large DNS messages over DoH, disable XFRs over DoH

See merge request isc-projects/bind9!5148
2021-06-14 09:22:40 +00:00
Evan Hunt
f8caebe152 CHANGES
Mention that XFRs over DoH are explicitly disabled for now.
2021-06-14 11:38:35 +03:00
Artem Boldariev
ccd2267b1c Set sock->iface and sock->peer properly for layered connection types
This change sets the mentioned fields properly and gets rid of klusges
added in the times when we were keeping pointers to isc_sockaddr_t
instead of copies. Among other things it helps to avoid a situation
when garbage instead of an address appears in dig output.
2021-06-14 11:37:36 +03:00
Artem Boldariev
b84fa122ce Make BIND refuse to serve XFRs over DoH
We cannot use DoH for zone transfers.  According to RFC8484 a DoH
request contains exactly one DNS message (see Section 6: Definition of
the "application/dns-message" Media Type,
https://datatracker.ietf.org/doc/html/rfc8484#section-6).  This makes
DoH unsuitable for zone transfers as often (and usually!) these need
more than one DNS message, especially for larger zones.

As zone transfers over DoH are not (yet) standardised, nor discussed
in RFC8484, the best thing we can do is to return "not implemented."

Technically DoH can be used to transfer small zones which fit in one
message, but that is not enough for the generic case.

Also, this commit makes the server-side DoH code ensure that no
multiple responses could be attempted to be sent over one HTTP/2
stream. In HTTP/2 one stream is mapped to one request/response
transaction. Now the write callback will be called with failure error
code in such a case.
2021-06-14 11:37:36 +03:00
Artem Boldariev
009752cab0 Pass an HTTP handle to the read callback when finishing a stream
This commit fixes a leftover from an earlier version of the client-side
DoH code when the underlying transport handle was used directly.
2021-06-14 11:37:36 +03:00
Artem Boldariev
d5d20cebb2 Fix a crash in the client-side DoH code (header processing callback)
Support a situation in header processing callback when client side
code could receive a belated response or part of it. That could
happen when the HTTP/2 session was already closed, but there were some
response data from server in flight. Other client-side nghttp2
callbacks code already handled this case.

The bug became apparent after HTTP/2 write buffering was supported,
leading to rare unit test failures.
2021-06-14 11:37:33 +03:00
Artem Boldariev
2dfc0d9afc Nullify connect.cstream in time and keep track of all client streams
This commit ensures that sock->h2.connect.cstream gets nullified when
the object in question is deleted. This fixes a nasty crash in dig
exposed when receiving large responses leading to double free()ing.

Also, it refactors how the client-side code keeps track of client
streams (hopefully) preventing from similar errors appearing in the
future.
2021-06-14 11:37:29 +03:00
Artem Boldariev
5b507c1136 Fix BIND to serve large HTTP responses
This commit makes NM code to report HTTP as a stream protocol. This
makes it possible to handle large responses properly. Like:

dig +https @127.0.0.1 A cmts1-dhcp.longlines.com
2021-06-14 11:37:17 +03:00
Ondřej Surý
b68121adbf Merge branch 'ondrej/bump-clang-dependency-to-llvm-12' into 'main'
Change the LLVM tools version to 12

See merge request isc-projects/bind9!5174
2021-06-13 08:51:12 +00:00
Ondřej Surý
b3de93e54c Update the source code formatting using clang-format-12
clang-format now tries to keep the type-cast on the same line as the
variable.  Update the formatting.
2021-06-13 08:46:28 +02:00
Ondřej Surý
9f7855322c Change the LLVM tools version to 12
LLVM 12 stable was released on 15. April 2021, change the default
version to the current stable.
2021-06-12 08:56:37 +02:00
Michał Kępień
e5673b89e3 Merge branch '2759-fix-no-ds-proofs-for-wildcard-cname-delegations' into 'main'
Fix "no DS" proofs for wildcard+CNAME delegations

Closes #2759

See merge request isc-projects/bind9!5155
2021-06-10 08:37:37 +00:00
Michał Kępień
16708682ad Add release note 2021-06-10 10:13:23 +02:00
Michał Kępień
c223d81691 Add CHANGES entry 2021-06-10 10:13:23 +02:00
Michał Kępień
7a87bf468b Fix "no DS" proofs for wildcard+CNAME delegations
When answering a query requires wildcard expansion, the AUTHORITY
section of the response needs to include NSEC(3) record(s) proving that
the QNAME does not exist.

When a response to a query is an insecure delegation, the AUTHORITY
section needs to include an NSEC(3) proof that no DS record exists at
the parent side of the zone cut.

These two conditions combined trip up the NSEC part of the logic
contained in query_addds(), which expects the NS RRset to be owned by
the first name found in the AUTHORITY section of a delegation response.
This may not always be true, for example if wildcard expansion causes an
NSEC record proving QNAME nonexistence to be added to the AUTHORITY
section before the delegation is added to the response.  In such a case,
named incorrectly omits the NSEC record proving nonexistence of QNAME
from the AUTHORITY section.

The same block of code is affected by another flaw: if the same NSEC
record proves nonexistence of both the QNAME and the DS record at the
parent side of the zone cut, this NSEC record will be added to the
AUTHORITY section twice.

Fix by looking for the NS RRset in the entire AUTHORITY section and
adding the NSEC record to the delegation using query_addrrset() (which
handles duplicate RRset detection).
2021-06-10 10:13:23 +02:00
Michał Kępień
26ec4b9a89 Add AUTHORITY tests for CNAME-sourced delegations
Add a set of system tests which check the contents of the AUTHORITY
section for signed, insecure delegation responses constructed from CNAME
records and wildcards, both for zones using NSEC and NSEC3.
2021-06-10 10:13:23 +02:00
Michał Kępień
439efc6e55 Merge branch 'michal/fix-the-variable-checked-by-a-post-load-assertion' into 'main'
Fix the variable checked by a post-load assertion

See merge request isc-projects/bind9!5164
2021-06-10 08:03:50 +00:00
Mark Andrews
098639dc59 Fix the variable checked by a post-load assertion
Instead of checking the value of the variable modified two lines earlier
(the number of SOA records present at the apex of the old version of the
zone), one of the RUNTIME_CHECK() assertions in zone_postload() checks
the number of SOA records present at the apex of the new version of the
zone, which is already checked before.  Fix the assertion by making it
check the correct variable.
2021-06-10 10:01:34 +02:00
Michał Kępień
9ec886bc53 Merge branch 'michal/update-release-checklist' into 'main'
Update release checklist

See merge request isc-projects/bind9!5165
2021-06-10 06:58:54 +00:00
Michał Kępień
d0886bd9c3 Update release checklist
Add two items to the release checklist to ensure that the start and the
end of the code freeze for each release cycle is announced on
Mattermost.
2021-06-10 08:49:38 +02:00
Mark Andrews
b3ef45127b Merge branch '2760-db-unit-test-failure' into 'main'
Resolve "db unit test failure"

Closes #2760

See merge request isc-projects/bind9!5156
2021-06-09 22:29:46 +00:00
Mark Andrews
2bc454dc2d Adjust acceptable count values
usleep(100000) can be slightly less than 10ms so allow the count
to reach 11.
2021-06-09 22:05:55 +00:00
Mark Andrews
efacee3d09 Merge branch '2720-threadsanitizer-data-race-lib-isc-unix-time-c-110-in-isc_time_isepoch' into 'main'
Resolve "ThreadSanitizer: data race lib/isc/unix/time.c:110 in isc_time_isepoch"

Closes #2720

See merge request isc-projects/bind9!5124
2021-06-09 13:51:10 +00:00
Mark Andrews
3d66e97a28 Address race between zone_settimer and set_key_expiry_warning by
adding missing lock.

    WARNING: ThreadSanitizer: data race
    Read of size 4 at 0x000000000001 by thread T1 (mutexes: read M1, write M2):
    #0 isc_time_isepoch lib/isc/unix/time.c:110
    #1 zone_settimer lib/dns/zone.c:14649
    #2 dns_zone_maintenance lib/dns/zone.c:6281
    #3 dns_zonemgr_forcemaint lib/dns/zone.c:18190
    #4 view_loaded server.c:9654
    #5 call_loaddone lib/dns/zt.c:301
    #6 doneloading lib/dns/zt.c:575
    #7 zone_asyncload lib/dns/zone.c:2259
    #8 task_run lib/isc/task.c:845
    #9 isc_task_run lib/isc/task.c:938
    #10 isc__nm_async_task lib/isc/netmgr/netmgr.c:855
    #11 process_netievent lib/isc/netmgr/netmgr.c:934
    #12 process_queue lib/isc/netmgr/netmgr.c:1003
    #13 process_all_queues lib/isc/netmgr/netmgr.c:775
    #14 async_cb lib/isc/netmgr/netmgr.c:804
    #15 <null> <null>
    #16 isc__trampoline_run lib/isc/trampoline.c:191
    #17 <null> <null>

    Previous write of size 4 at 0x000000000001 by thread T2:
    #0 isc_time_set lib/isc/unix/time.c:93
    #1 set_key_expiry_warning lib/dns/zone.c:6430
    #2 del_sigs lib/dns/zone.c:6711
    #3 zone_resigninc lib/dns/zone.c:7113
    #4 zone_maintenance lib/dns/zone.c:11111
    #5 zone_timer lib/dns/zone.c:14588
    #6 task_run lib/isc/task.c:845
    #7 isc_task_run lib/isc/task.c:938
    #8 isc__nm_async_task lib/isc/netmgr/netmgr.c:855
    #9 process_netievent lib/isc/netmgr/netmgr.c:934
    #10 process_queue lib/isc/netmgr/netmgr.c:1003
    #11 process_all_queues lib/isc/netmgr/netmgr.c:775
    #12 async_cb lib/isc/netmgr/netmgr.c:804
    #13 <null> <null>
    #14 isc__trampoline_run lib/isc/trampoline.c:191
    #15 <null> <null>

    SUMMARY: ThreadSanitizer: data race lib/isc/unix/time.c:110 in isc_time_isepoch
2021-06-09 13:31:05 +00:00
Ondřej Surý
0f47ad87c2 Merge branch '2690-remove-windows-support-for-bind-9-17-9-18' into 'main'
Completely remove BIND 9 Windows support

Closes #2690

See merge request isc-projects/bind9!5073
2021-06-09 12:59:33 +00:00
Ondřej Surý
0b5f205b57 Add CHANGES and release note for GL #2690 2021-06-09 14:35:35 +02:00
Ondřej Surý
440fb3d225 Completely remove BIND 9 Windows support
The Windows support has been completely removed from the source tree
and BIND 9 now no longer supports native compilation on Windows.

We might consider reviewing mingw-w64 port if contributed by external
party, but no development efforts will be put into making BIND 9 compile
and run on Windows again.
2021-06-09 14:35:14 +02:00
Matthijs Mekking
ad130e4509 Merge branch '2725-nsec3param-changes-on-restart' into 'main'
Fix NSEC3 resalt on restart

Closes #2725

See merge request isc-projects/bind9!5126
2021-06-09 08:29:51 +00:00
Matthijs Mekking
d51aed7112 Add release note and change entry for [#2725] 2021-06-09 09:14:51 +02:00
Matthijs Mekking
0ae3ffdc1c Fix NSEC3 resalting upon restart
When named restarts, it will examine signed zones and checks if the
current denial of existence strategy matches the dnssec-policy. If not,
it will schedule to create a new NSEC(3) chain.

However, on startup the zone database may not be read yet, fooling
BIND that the denial of existence chain needs to be created. This
results in a replacement of the previous NSEC(3) chain.

Change the code such that if the NSEC3PARAM lookup failed (the result
did not return in ISC_R_SUCCESS or ISC_R_NOTFOUND), we will try
again later. The nsec3param structure has additional variables to
signal if the lookup is postponed. We also need to save the signal
if an explicit resalt was requested.

In addition to the two added boolean variables, we add a variable to
store the NSEC3PARAM rdata. This may have a yet to be determined salt
value. We can't create the private data yet because there may be a
mismatch in salt length and the NULL salt value.
2021-06-09 09:14:09 +02:00
Matthijs Mekking
08a9e7add1 Add test for NSEC3PARAM not changed after restart
Add a test case where 'named' is restarted and ensure that an already
signed zone does not change its NSEC3 parameters.

The test case first tests the current zone and saves the used salt
value. Then after restart it checks if the salt (and other parameters)
are the same as before the restart.

This test case changes 'set_nsec3param'. This will now reset the salt
value, and when checking for NSEC3PARAM we will store the salt and
use it when testing the NXDOMAIN response. This does mean that for
every test case we now have to call 'set_nsec3param' explicitly (and
can not omit it because it is the same as the previous zone).

Finally, slightly changed some echo output to make debugging friendlier.
2021-06-09 09:14:09 +02:00
Ondřej Surý
be01f589d9 Merge branch '2732-pause-the-dbiterator-in-dumptostream' into 'main'
Pause the dbiterator when dumping the zone to the disk

Closes #2732

See merge request isc-projects/bind9!5150
2021-06-04 09:05:52 +00:00
Ondřej Surý
7e59b8a4a1 Pause the dbiterator when dumping the zone to the disk
When we rewrote the zone dumping to use the separate threadpool, the
dumping would acquire the read lock for the whole time the zone dumping
process is dumping the zone.

When combined with incoming IXFR that tries to acquire the write lock on
the same rwlock, we would end up blocking all the other readers.

In this commit, we pause the dbiterator every time we get next record
and before start dumping it to the disk.
2021-06-04 08:25:05 +00:00
Mark Andrews
7fef01201d Merge branch '2751-serve-stale-tests-false-negative' into 'main'
Resolve "serve-stale tests false negative"

Closes #2751

See merge request isc-projects/bind9!5143
2021-06-03 08:40:38 +00:00
Mark Andrews
af95cb8ccc Address test race condition in serve-stale
the dig.out.test# files could still be being written when the
content greps where being made.
2021-06-03 18:20:14 +10:00
Mark Andrews
d242ccfbdf Merge branch '2750-provide-more-insight-into-why-the-timer_test-is-failing' into 'main'
Resolve "Provide more insight into why the timer_test is failing."

Closes #2750

See merge request isc-projects/bind9!5142
2021-06-03 07:31:26 +00:00
Mark Andrews
66d1df57cb Report which assertion failed when calling set_global_error 2021-06-03 11:55:31 +10:00
Mark Andrews
5bd7caba9c Merge branch '2724-statschannel-system-test-sometimes-hangs' into 'main'
Resolve "statschannel system test sometimes hangs"

Closes #2724

See merge request isc-projects/bind9!5123
2021-06-02 22:37:10 +00:00
Mark Andrews
02726cb66e Add timeout to url get requests
to prevent the system test taking forever on failures.
2021-06-02 22:18:21 +00:00
Ondřej Surý
0dded90ae4 Merge branch '2746-fix-the-typo-in-setsockopt_off' into 'main'
Fix copy&paste error in setsockopt_off

Closes #2746

See merge request isc-projects/bind9!5138
2021-06-02 16:09:48 +00:00
Ondřej Surý
22aa929aac Add CHANGES and release note for [GL #2746] 2021-06-02 17:47:14 +02:00
Ondřej Surý
f14d870d15 Fix copy&paste error in setsockopt_off
Because of copy&paste error the setsockopt_off macro would enable
the socket option instead of disabling it.
2021-06-02 17:47:14 +02:00
Michał Kępień
5e1a48a605 Merge branch '2540-check-dname-resolution-via-itself' into 'main'
Check DNAME resolution via itself

Closes #2540

See merge request isc-projects/bind9!5135
2021-06-02 12:49:05 +00:00
Mark Andrews
cbdea694e8 Check DNAME resolution via itself 2021-06-02 14:20:35 +02:00
Michał Kępień
715dc196e2 Merge branch '2467-add-a-system-test-checking-a-malformed-ixfr' into 'main'
Add a system test checking a malformed IXFR

Closes #2467

See merge request isc-projects/bind9!5132
2021-06-02 11:35:55 +00:00
Mark Andrews
5547003a3d Add a system test checking a malformed IXFR
Make sure an incoming IXFR containing an SOA record which is not placed
at the apex of the transferred zone does not result in a broken version
of the zone being served by named and/or a subsequent crash.
2021-06-02 13:15:25 +02:00
Ondřej Surý
c70d9c4e9a Merge branch 'ondrej/fix-uv_udp_connect-detection' into 'main'
Cleanup the remaining of HAVE_UV_<func> macros

See merge request isc-projects/bind9!5127
2021-06-02 09:56:20 +00:00
Ondřej Surý
67afea6cfc Cleanup the remaining of HAVE_UV_<func> macros
While cleaning up the usage of HAVE_UV_<func> macros, we forgot to
cleanup the HAVE_UV_UDP_CONNECT in the actual code and
HAVE_UV_TRANSLATE_SYS_ERROR and this was causing Windows build to fail
on uv_udp_send() because the socket was already connected and we were
falsely assuming that it was not.

The platforms with autoconf support were not affected, because we were
still checking for the functions from the configure.
2021-06-02 11:23:36 +02:00
Ondřej Surý
479dc58877 Merge branch 'ondrej/add-libnghttp2-dev-to-lgtm.yml' into 'main'
Add libnghttp2-dev to .lgtm.yml

See merge request isc-projects/bind9!5125
2021-06-02 07:35:39 +00:00
Ondřej Surý
d67e16ae3c Add libnghttp2-dev to .lgtm.yml
The LGTM.com configuration was missing required library, so the
"Extraction" step of the analysis was failing.
2021-06-02 09:33:27 +02:00
Artem Boldariev
2fc89e0353 Merge branch 'artem-http-write-buffering' into 'main'
HTTP/2 write buffering

See merge request isc-projects/bind9!5121
2021-06-01 18:28:34 +00:00
Artem Boldariev
35d0027f36 HTTP/2 write buffering
This commit adds the ability to consolidate HTTP/2 write requests if
there is already one in flight. If it is the case, the code will
consolidate multiple subsequent write request into a larger one
allowing to utilise the network in a more efficient way by creating
larger TCP packets as well as by reducing TLS records overhead (by
creating large TLS records instead of multiple small ones).

This optimisation is especially efficient for clients, creating many
concurrent HTTP/2 streams over a transport connection at once.  This
way, the code might create a small amount of multi-kilobyte requests
instead of many 50-120 byte ones.

In fact, it turned out to work so well that I had to add a work-around
to the code to ensure compatibility with the flamethrower, which, at
the time of writing, does not support TLS records larger than two
kilobytes. Now the code tries to flush the write buffer after 1.5
kilobyte, which is still pretty adequate for our use case.

Essentially, this commit implements a recommendation given by nghttp2
library:

https://nghttp2.org/documentation/nghttp2_session_mem_send.html
2021-06-01 21:07:45 +03:00
Ondřej Surý
5a8a21a88d Merge branch '2732-zone-dumping-is-blocking-the-networking-io' into 'main'
Improve the zone dumping impact on the networking

Closes #2732

See merge request isc-projects/bind9!5107
2021-05-31 13:51:48 +00:00
Ondřej Surý
3e433b87fb Add CHANGES and release note for [GL #2732] 2021-05-31 14:52:05 +02:00
Ondřej Surý
e83b6569da Indicate to the kernel that we won't be needing the zone dumps
Add a call to posix_fadvise() to indicate to the kernel, that `named`
won't be needing the dumped zone files any time soon with:

 * POSIX_FADV_DONTNEED - The specified data will not be accessed in the
   near future.

Notes:

 POSIX_FADV_DONTNEED attempts to free cached pages associated with the
 specified region. This is useful, for example, while streaming large
 files. A program may periodically request the kernel to free cached
 data that has already been used, so that more useful cached pages are
 not discarded instead.
2021-05-31 14:52:05 +02:00
Ondřej Surý
8a5c62de83 Refactor zone dumping code to use netmgr async threadpools
Previously, dumping the zones to the files were quantized, so it doesn't
slow down network IO processing.  With the introduction of network
manager asynchronous threadpools, we can move the IO intensive work to
use that API and we don't have to quantize the work anymore as it the
file IO won't block anything except other zone dumping processes.
2021-05-31 14:52:05 +02:00
Ondřej Surý
7670f98377 Add isc_task_getnetmgr() function
Add a function to pull the attached netmgr from inside the executed
task.  This is needed for any task that needs to call the netmgr API.
2021-05-31 14:52:05 +02:00
Ondřej Surý
87fe97ed91 Add asynchronous work API to the network manager
The libuv has a support for running long running tasks in the dedicated
threadpools, so it doesn't affect networking IO.

This commit adds isc_nm_work_enqueue() wrapper that would wraps around
the libuv API and runs it on top of associated worker loop.

The only limitation is that the function must be called from inside
network manager thread, so the call to the function should be wrapped
inside a (bound) task.
2021-05-31 14:52:05 +02:00
Ondřej Surý
211bfefbaa Use UV_VERSION_HEX to decide whether we need libuv shim functions
Instead of having a configure check for every missing function that has
been added in later version of libuv, we now use UV_VERSION_HEX to
decide whether we need the shim or not.
2021-05-31 14:52:05 +02:00
Ondřej Surý
7477d1b2ed Add uv_os_getenv() and uv_os_setenv() compatibility shims
The uv_os_getenv() and uv_os_setenv() functions were introduced in the
libuv >= 1.12.0.  Add simple compatibility shims for older versions.
2021-05-31 14:52:05 +02:00
Ondřej Surý
f752840db3 Add uv_req_get_data() and uv_req_set_data() compatibility shims
The uv_req_get_data() and uv_req_set_data() functions were introduced in
libuv >= 1.19.0, so we need to add compatibility shims with older libuv
versions.
2021-05-31 14:52:05 +02:00
Ondřej Surý
7b02848865 Cleanup the uv_import check
The uv_import() is not needed anymore, so we can remove the autoconf
check for it.
2021-05-31 14:52:05 +02:00
Michał Kępień
db8ff45f0b Merge branch 'michal/regenerate-man-pages-with-docutils-0.16' into 'main'
Regenerate man pages with docutils 0.16

See merge request isc-projects/bind9!5119
2021-05-31 12:34:45 +00:00
Michał Kępień
6a2daddf5b Regenerate man pages with docutils 0.16
Commit bdb777b2a2 updated the man pages
to contents produced using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.17.1

However, sphinx-rtd-theme 0.5.2 is incompatible with versions 0.17+ of
the docutils package.  This problem was addressed in the Docker image
used for building man pages by downgrading the docutils package to
version 0.16.

Regenerate the man pages again, this time using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.16

This is necessary to prevent the "docs" GitLab CI job from failing.
2021-05-31 11:22:52 +02:00
Evan Hunt
6702f23dcd Merge branch 'kchen-servestale-fix' into 'main'
Several serve-stale fixes

See merge request isc-projects/bind9!199
2021-05-30 19:28:59 +00:00
Matthijs Mekking
f7f543d99b Reuse rdatset->ttl when dumping ancient RRsets
Rather than having an expensive 'expired' (fka 'stale_ttl') in the
rdataset structure, that is only used to be printed in a comment on
ancient RRsets, reuse the TTL field of the RRset.
2021-05-30 11:48:36 -07:00
Kevin Chen
0cdf85d204 Several serve-stale improvements
Commit a83c8cb0af updated masterdump so
that stale records in "rndc dumpdb" output no longer shows 0 TTLs.  In
this commit we change the name of the `rdataset->stale_ttl` field to
`rdataset->expired` to make its purpose clearer, and set it to zero in
cases where it's unused.

Add 'rbtdb->serve_stale_ttl' to various checks so that stale records
are not purged from the cache when they've been stale for RBTDB_VIRTUAL
(300) seconds.

Increment 'ns_statscounter_usedstale' when a stale answer is used.

Note: There was a question of whether 'overmem_purge' should be
purging ancient records, instead of stale ones.  It is left as purging
stale records, since stale records could take up the majority of the
cache.

This submission is copyrighted Akamai Technologies, Inc. and provided
under an MPL 2.0 license.

This commit was originally authored by Kevin Chen, and was updated by
Matthijs Mekking to match recent serve-stale developments.
2021-05-30 11:45:35 -07:00
Evan Hunt
fc1e3efc41 Merge branch '2733-serve-stale-prefetch-crash' into 'main'
Fix crash with serve-stale in combination with prefetch

Closes #2733

See merge request isc-projects/bind9!5111
2021-05-30 07:31:38 +00:00
Matthijs Mekking
7ca253818e Add CHANGES and notes for [#2733] 2021-05-30 00:04:01 -07:00
Evan Hunt
8c047feb3a add a system test for the prefetch bug
Ensure that if prefetch is triggered as a result of a query
restart, it won't have the TRYSTALE_ONTIMEOUT flag set.
2021-05-30 00:04:01 -07:00
Matthijs Mekking
c0dc5937c7 Reset DNS_FETCHOPT_TRYSTALE_ONTIMEOUT on resume
Once we resume a query, we should clear DNS_FETCHOPT_TRYSTALE_ONTIMEOUT
from the options to prevent triggering the stale-answer-client-timeout
on subsequent fetches.

If we don't this may cause a crash when for example when prefetch is
triggered after a query restart.
2021-05-30 00:03:51 -07:00
Michal Nowak
9fbe80d646 Merge branch 'mnowak/add-fedora-34' into 'main'
Add Fedora 34

See merge request isc-projects/bind9!5075
2021-05-28 10:50:51 +00:00
Michal Nowak
5f27aaa0ff Add Fedora 34 2021-05-28 11:57:31 +02:00
Evan Hunt
5ca27cc33d Merge branch '2731-servestale-dns64' into 'main'
fix a crash when using stale data with dns64

Closes #2731

See merge request isc-projects/bind9!5102
2021-05-27 18:52:31 +00:00
Evan Hunt
d8b793760c CHANGES, release note 2021-05-27 10:37:16 -07:00
Matthijs Mekking
c64589bf46 Test with stale timeout cache miss, then fetch completes
Add a test case where a client request is received and the stale
timeout occurs, but it is not served stale data because there is no entry
in the cache, then is served an authoritative answer once the background
fetch completes. This ensures that a stale timeout only affects a
subsequent response if the client was answered.
2021-05-27 10:35:48 -07:00
Evan Hunt
8bd8e995f1 clean up query correctly if already answered by serve-stale
when a serve-stale answer has been sent, the client continues waiting
for a proper answer. if a final completion event for the client does
arrive, it can just be cleaned up without sending a response, similar
to a canceled fetch.
2021-05-27 10:35:48 -07:00
Evan Hunt
453e905d7e add a test of DNS64 processing with a stale negative response
- send a query for an AAAA which will be resolved as a mapped A
- disable authoritative responses
- wait for the negative AAAA response to become stale
- send another query, wait for the stale answer
- re-enable authorative responses so that a real answer arrives
- currently, this triggers an assertion in query.c
2021-05-27 10:33:31 -07:00
Ondřej Surý
e7f5c9582a Merge branch '2708-named-doesn-t-compile-with-gcc-10' into 'main'
Resolve "named doesn't compile with GCC 10."

Closes #2708

See merge request isc-projects/bind9!5057
2021-05-27 06:22:14 +00:00
Mark Andrews
d68b009cfe Remove priority from attribute constructor/destructor
On some platforms, the __attribute__ constructor and destructor won't
take priorities and the compilation failed.  On such platform would be
macOS.  For this reason, the constructor/destructor in the libisc was
reworked to not use priorities, but have a single constructor and
destructor that calls the appropriate routines in correct order.

This commit removes the extra priority because it's now not needed and
it also breaks a compilation on macOS with GCC 10.
2021-05-27 08:02:21 +02:00
Mark Andrews
728422d939 Merge branch '2282-shutdown-system-test-needs-to-be-tweaked-to-account-for-recent-netmgr-changes' into 'main'
Resolve ""shutdown" system test needs to be tweaked to account for recent netmgr changes"

Closes #2282

See merge request isc-projects/bind9!4923
2021-05-27 02:56:57 +00:00
Diego Fronza
b19cd2d83b Handling NoNameservers exception
In the shutdown system test multiple queries are sent to a resolver
instance, in the meantime we terminate the same resolver process for
which the queries were sent to, either via rndc stop or a SIGTERM
signal, that means the resolver may not be able to answer all those
queries, since it has initiated the shutdown process.

The dnspython library raises a dns.resolver.NoNameservers exception when
a resolver object fails to receive an answer from the specified list
of nameservers (resolver.nameservers list), we need to handle this
exception as this is something that may happen since we asked the
resolver to terminate, as a result it may not answer clients even if
an answer is available, as the operation will be canceled.
2021-05-27 12:37:49 +10:00
Ondřej Surý
91cd1ef9ff Merge branch 'ondrej/revert-OpenBSD-system-wide-connection-timeout' into 'main'
Revert "Configure the system-wide TCP connection timeout on OpenBSD"

See merge request isc-projects/bind9!5100
2021-05-26 14:24:58 +00:00
Ondřej Surý
a0f6275ef8 Revert "Configure the system-wide TCP connection timeout on OpenBSD"
This reverts commit 8ff15fc028.
2021-05-26 16:16:00 +02:00
Mark Andrews
d3a8aa4daa Merge branch 'marka-missing-initialisations' into 'main'
Add missing initialisations

See merge request isc-projects/bind9!5097
2021-05-26 08:52:46 +00:00
Mark Andrews
715a2c7fc1 Add missing initialisations
configuring with --enable-mutex-atomics flagged these incorrectly
initialised variables on systems where pthread_mutex_init doesn't
just zero out the structure.
2021-05-26 08:15:08 +00:00
Ondřej Surý
5a10cde89a Merge branch '2722-bad-sizeof-declaration-in-main' into 'main'
Fix the sizeof() for array holding the pointers to clientmgr

Closes #2722

See merge request isc-projects/bind9!5098
2021-05-26 08:10:45 +00:00
Ondřej Surý
2db5290579 Fix the sizeof() for array holding the pointers to clientmgr
The size of the array holding the pointers to clientmgr was created so
big it could hold the actual clientmgr objects, not just the pointer.
This commit fixes the size to be just the ncpus * sizeof(pointer).
2021-05-26 10:03:52 +02:00
Ondřej Surý
da282bad6a Merge branch '2721-shutdown-race-in-interfacemgr-cleanup' into 'main'
Cleanup the struct isc_nmiface

Closes #2721

See merge request isc-projects/bind9!5096
2021-05-26 08:00:25 +00:00
Ondřej Surý
a227562f13 Cleanup the struct isc_nmiface
In previous MR, I forgot to remove the `struct isc_nmiface`, this commit
rectifies that.
2021-05-26 09:55:10 +02:00
Ondřej Surý
5d325e952d Merge branch '2721-shutdown-race-in-interfacemgr' into 'main'
Make a local copy of interface address when creating new socket

Closes #2721

See merge request isc-projects/bind9!5094
2021-05-26 07:48:00 +00:00
Ondřej Surý
50270de8a0 Refactor the interface handling in the netmgr
The isc_nmiface_t type was holding just a single isc_sockaddr_t,
so we got rid of the datatype and use plain isc_sockaddr_t in place
where isc_nmiface_t was used before.  This means less type-casting and
shorter path to access isc_sockaddr_t members.

At the same time, instead of keeping the reference to the isc_sockaddr_t
that was passed to us when we start listening, we will keep a local
copy. This prevents the data race on destruction of the ns_interface_t
objects where pending nmsockets could reference the sockaddr of already
destroyed ns_interface_t object.
2021-05-26 09:43:12 +02:00
Mark Andrews
bef3a9b01f Merge branch '2685-max-ixfr-ratio-appears-to-be-forcing-axfr-very-prematurely-on-bind-9-16-15' into 'main'
Resolve "max-ixfr-ratio appears to be forcing AXFR very prematurely on BIND 9.16.15"

Closes #2685

See merge request isc-projects/bind9!5011
2021-05-25 22:46:52 +00:00
Mark Andrews
80ca95a95c Add release note for [GL #2685] 2021-05-26 08:16:35 +10:00
Mark Andrews
d99c312938 Add CHANGES note for [GL #2685] 2021-05-26 08:16:35 +10:00
Mark Andrews
0a45af2e2f Consolidate xhdr fixups 2021-05-26 08:16:35 +10:00
Mark Andrews
68d203ff1c Check that IXFR delta size is correct 2021-05-25 22:27:54 +10:00
Mark Andrews
00609f5094 Correct size calculation in dns_journal_iter_init()
* dns_journal_next() leaves the read point in the journal after the
transaction header so journal_seek() should be inside the loop.
* we need to recover from transaction header inconsistencies

Additionally when correcting for <size, serial0, serial1, 0> the
correct consistency check is isc_serial_gt() rather than
isc_serial_ge().  All instances updated.
2021-05-25 22:27:54 +10:00
Michal Nowak
b6bdeb06be Merge branch '2629-man-pages-aren-t-installed-when-building-9-17-x' into 'main'
Install man pages when sphinx-build tool is missing

Closes #2629

See merge request isc-projects/bind9!4945
2021-05-25 09:34:11 +00:00
Michal Nowak
823bf3e79b Install BIND with "make DESTDIR=<PATH> install"
BIND installation should be done by setting DESTDIR during "make
install" not by setting prefix via ./configure.

Make sure that installation with DESTDIR=<PATH> works by checking that
named binary and it's respective man page were installed and that
well-known BIND9 directories - and only them - are present in DESTDIR.

Also rename install path variable from BIND_INSTALL_PATH to
INSTALL_PATH to avoid namespace clash in stress tests which use
BIND_INSTALL_PATH variable to configure path to BIND9 binaries.
2021-05-25 11:21:33 +02:00
Michal Nowak
c0566dd8d7 Install man pages when sphinx-build tool is missing
The exclusion of doc/man/ when the sphinx-build tool is missing was
excessive as some targets in doc/man/ are necessary to install man
pages.
2021-05-25 11:21:32 +02:00
Ondřej Surý
9359e1a8c0 Merge branch 'ondrej/dont-set-mctx-name-in-resolver' into 'main'
Don't set memory context name in resolver.c

See merge request isc-projects/bind9!5090
2021-05-25 05:27:59 +00:00
Ondřej Surý
d0d37aa6d1 Don't set memory context name in resolver.c
We now attach to existing memory context instead of creating a new
memory context, so we should not set its name.
2021-05-25 07:25:44 +02:00
Ondřej Surý
a778db3b7d Merge branch 'ondrej/replace-ubuntu-xenial-with-ubuntu-bionic' into 'main'
Replace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI

See merge request isc-projects/bind9!4800
2021-05-24 19:43:15 +00:00
Ondřej Surý
4402a90bb7 Replace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI
Ubuntu 16.04 (Xenial Xerus) is reaching End of Standard Support in April
2021 thus we are removing it from the list of supported platforms and
replacing it with Ubuntu 18.04 LTS (Bionic Beaver).
2021-05-24 21:34:09 +02:00
Ondřej Surý
664d8c1d24 Merge branch '2433-reduce-clientmgr-memory-contexts-and-tasks' into 'main'
Reduce the number of clientmgr objects created

Closes #2433

See merge request isc-projects/bind9!5085
2021-05-24 19:20:15 +00:00
Ondřej Surý
a7241bb5b3 Add CHANGES and release note for GL #2433 2021-05-24 20:45:19 +02:00
Ondřej Surý
a1c6fd5ede Adjust the fillcount and freemax for dns_message mempools
According to the measurements (recorded on GL!5085), the fillcount of 2
for namepool and fillcount of 4 for rdspool can fit 99.99% of request
for tested scenarios.

This was discovered by perf recording the single second recursive test
using flamethrower where the initial malloc lit up like a flare.
2021-05-24 20:44:58 +02:00
Ondřej Surý
28b65d8256 Reduce the number of clientmgr objects created
Previously, as a way of reducing the contention between threads a
clientmgr object would be created for each interface/IP address.

We tasks being more strictly bound to netmgr workers, this is no longer
needed and we can just create clientmgr object per worker queue (ncpus).

Each clientmgr object than would have a single task and single memory
context.
2021-05-24 20:44:54 +02:00
Ondřej Surý
aad7856b8e Don't create per bucket memory contexts in resolver
Similarly, the resolver code would create hundreds of memory contexts
just on the resolver setup.  The contention will be reduced directly in
the allocator, so for now just attach to the view memory instead of
creating separate memory context for each bucket.
2021-05-24 20:02:20 +02:00
Ondřej Surý
4db5e30177 Run shutdown events with the task's existing threadid
Previously, task->threadid was reassigned to 0 while shutting
down, which caused an assertion.
2021-05-24 20:02:20 +02:00
Ondřej Surý
0be7ea78be Reduce the number of client tasks and bind them to netmgr queues
Since a client object is bound to a netmgr handle, each client
will always be processed by the same netmgr worker, so we can
simplify the code by binding client->task to the same thread as
the client. Since ns__client_request() now runs in the same event
loop as client->task events, is no longer necessary to pause the
task manager before launching them.

Also removed some functions in isc_task that were not used.
2021-05-24 20:02:20 +02:00
Ondřej Surý
c07f8c5a43 Reduce the number of tasks in the clientmgr
We now use one task per CPU per dispatchmgr (that's still a lot).
2021-05-24 20:02:20 +02:00
Ondřej Surý
0719f032e1 Reduce the number of mctx created in clientmgr
The number of memory contexts created in the clientmgr was enormous.  It
could easily create thousands of memory contexts because the formula was:

    nprotocols * ncpus * ninterfaces * CLIENT_NMCTXS_PERCPU (8)

The original goal was to reduce the contention when allocating the
memory, but after a while nobody noticed that the amount of memory
context allocated would not reduce contention at all.

This commit removes the whole mctxpool and just uses the mctx from
clientmgr as the contention will be reduced directly in the allocator.
2021-05-24 20:02:20 +02:00
Michal Nowak
9f5a7a2ca4 Merge branch 'mnowak/freebsd-13' into 'main'
Add FreeBSD 13.0

See merge request isc-projects/bind9!4814
2021-05-24 16:15:35 +00:00
Michal Nowak
83617cea9a Run gcc:tarball CI job for merge requests
Running gcc:tarball CI job for merge requests is consistent with how we
run gcc:out-of-tree CI job and should help identify problems with the
build system during the review process, not once merged during daily
runs. For the sake of time, unit and system tests associated with the
gcc:tarball CI job are excluded from merge requests.
2021-05-24 17:57:53 +02:00
Michal Nowak
70eccd2952 Do not spawn FreeBSD 11 CI jobs in merge requests 2021-05-24 17:57:53 +02:00
Michal Nowak
e4f88c359c Create an anchor for schedules, tags, and web rules
It's a common pattern to spawn CI jobs only for pipelines triggered by
schedules, tags, and web. There should be an anchor so that the rules
are not repeated.
2021-05-24 17:57:53 +02:00
Michal Nowak
0714fe6f40 Add FreeBSD 13.0 2021-05-24 17:54:05 +02:00
Ondřej Surý
fd0f3c0af4 Merge branch '2643-fix-rndc-timeout' into 'main'
extend rndc timeout to 60 seconds

Closes #2643

See merge request isc-projects/bind9!5082
2021-05-22 09:46:27 +00:00
Evan Hunt
3ed35b3035 extend rndc timeout to 60 seconds
the idle timeout for rndc connections was set to 10 seconds, but this
caused intermittent system failures of the 'rndc' system test on slow
platforms, since 'rndc reconfig' could time out before reconfiguration
was complete.

this commit restores the original timeout value of 60 seconds, which was
changed inadvertently after rndc was updated to use the network manager.

even with this change, however, the test can still time out under
TSAN because loading the huge zone can take a very long time (upwards
of two minutes). so the test is modified here to generate a smaller zone
file when running under TSAN.
2021-05-22 01:11:31 -07:00
Evan Hunt
c819762dde Merge branch 'each-rename-copynf' into 'main'
rename dns_name_copynf() to dns_name_copy()

See merge request isc-projects/bind9!5081
2021-05-22 08:10:10 +00:00
Evan Hunt
d06b1ed11f CHANGES 2021-05-22 00:37:27 -07:00
Evan Hunt
1fa6f8662e update dev.md with name copying information
revise the Developer Information document with updated information
about copying names.
2021-05-22 00:37:27 -07:00
Evan Hunt
f3f1cab05e clean up coccinelle patches for dns_name_copy()
no need for semantic patches to use dns_name_copynf() any longer.
2021-05-22 00:37:27 -07:00
Evan Hunt
b0aadaac8e rename dns_name_copynf() to dns_name_copy()
dns_name_copy() is now the standard name-copying function.
2021-05-22 00:37:27 -07:00
Evan Hunt
ea7b28f101 remove dns_name_copy() implementation
Remove dns_name_copy() and refactor the underlying code since
it will only be called by dns_name_copynf() now, and can't fail.
2021-05-22 00:22:32 -07:00
Evan Hunt
b1fe1b8ae3 remove the remaining uses of dns_name_copy()
dns_name_copy() has been replaced nearly everywhere with
dns_name_copynf().  this commit changes the last two uses of
the original function.  afterward, we can remove the old
dns_name_copy() implementation, and replace it with _copynf().
2021-05-22 00:22:32 -07:00
Evan Hunt
6803f394c5 Merge branch '2713-intermittent-crashes-in-the-tkey-system-test-caused-by-broken-dns_name_t-structures' into 'main'
Use dns_name_copy() to hold the copied name

Closes #2713

See merge request isc-projects/bind9!5079
2021-05-22 04:30:19 +00:00
Ondřej Surý
ce3e1abc1d Use dns_name_copynf() with dns_message_gettempname() when needed
dns_message_gettempname() returns an initialized name with a dedicated
buffer, associated with a dns_fixedname object.  Using dns_name_copynf()
to write a name into this object will actually copy the name data
from a source name. dns_name_clone() merely points target->ndata to
source->ndata, so it is faster, but it can lead to a use-after-free if
the source is freed before the target object is released via
dns_message_puttempname().

In a few places, clone was being used where copynf should have been;
this is now fixed.

As a side note, no memory was lost, because the ndata buffer used in
the dns_fixedname_t is internal to the structure, and is freed when
the dns_fixedname_t is freed regardless of the .ndata contents.
2021-05-21 21:28:10 -07:00
Brian Conry
10ced46739 Merge branch '2662-fix-broken-SYSTEMTEST_NO_CLEAN' into 'main'
Preserve SYSTEMTEST_NO_CLEAN when run.sh calls make.

Closes #2662

See merge request isc-projects/bind9!5003
2021-05-21 13:38:25 +00:00
Brian Conry
44cadaf31b Preserve additional environment variables with run.sh
When executed in "legacy mode" (i.e. without the '-r' parameter)
run.sh invokes make with a modified environment.

SYSTEMTEST_FORCE_COLOR is now preserved for use by the individual test
scripts.

CYGWIN is now preserved for named, as it controls behavior relating to
crash reporting.
2021-05-21 13:07:28 +00:00
Brian Conry
516de44c9f Preserve SYSTEMTEST_NO_CLEAN when run.sh calls make
This restores legacy behavior in bin/tests/system where running:
  SYSTEMTEST_NO_CLEAN=1 ./run.sh <testname>
would run the test and preserve the output files.

This has been broken since the change that has run.sh invoke "make",
due to SYSTEMTEST_NO_CLEAN not being preserved in the environment
that's set up for "make".

Another option would be to completely remove SYSTEMTEST_NO_CLEAN.

This seems to be the only behavior-changing environment variable
not accounted for in the call to "make".

I don't think this needs a CHANGES entry.
2021-05-21 13:07:28 +00:00
Michał Kępień
97a821399b Merge branch 'michal/regenerate-man-pages-with-sphinx-4.0.2' into 'main'
Regenerate man pages with Sphinx 4.0.2

See merge request isc-projects/bind9!5077
2021-05-21 09:26:16 +00:00
Michał Kępień
9ec83d1f63 Explicitly set "man_make_section_directory"
The default value of the "man_make_section_directory" Sphinx option was
changed in Sphinx 4.0.1, which broke building man pages in maintainer
mode as the shell code in doc/man/Makefile.am expects man pages to be
built in doc/man/_build/man/, not doc/man/_build/man/<section_number>/.
The aforementioned change in defaults was reverted in Sphinx 4.0.2, but
this issue should still be prevented from reoccurring in the future.
Ensure that by explicitly setting the "man_make_section_directory"
option to False.
2021-05-21 10:29:02 +02:00
Michał Kępień
bdb777b2a2 Regenerate man pages with Sphinx 4.0.2
The man pages produced by Sphinx 4.0.2 are slightly different than those
produced by Sphinx 3.5.4.  As Sphinx 4.0.2 is now used in GitLab CI,
update all doc/man/*in files so that they reflect what that version of
Sphinx produces, in order to prevent GitLab CI job failures.
2021-05-21 10:29:02 +02:00
Ondřej Surý
596a3442a3 Merge branch '2515-improve-glue-cache-performance' into 'main'
use a fixedname buffer in dns_message_gettempname()

Closes #2515

See merge request isc-projects/bind9!5071
2021-05-20 19:04:35 +00:00
Ondřej Surý
5ee9edc4ce Optimize rdataset_getownercase not to use bitshifts
The last rdataset_getownercase() left it in a state where the code was
mix of microoptimizations (manual loop unrolling, complicated bitshifts)
with a code that would always rewrite the character even if it stayed
the same after transformation.

This commit makes sure that we modify only the characters that actually
need to change, removes the manual loop unrolling, and replaces the
weird bit arithmetics with a simple shift and bit-and.
2021-05-20 20:41:29 +02:00
Evan Hunt
e31cc1eeb4 use a fixedname buffer in dns_message_gettempname()
dns_message_gettempname() now returns a pointer to an initialized
name associated with a dns_fixedname_t object. it is no longer
necessary to allocate a buffer for temporary names associated with
the message object.
2021-05-20 20:41:29 +02:00
Michał Kępień
869e0feec7 Merge branch 'v9_17_13-release' into 'main'
Merge 9.17.13 release branch

See merge request isc-projects/bind9!5068
2021-05-20 10:10:37 +00:00
Michał Kępień
5a71af44b1 Set up release notes for BIND 9.17.14 2021-05-20 12:03:47 +02:00
Michał Kępień
f73d41d0a0 Update BIND version to 9.17.13 2021-05-20 12:03:47 +02:00
Michał Kępień
39b739b867 Add a CHANGES marker 2021-05-20 12:03:47 +02:00
Michał Kępień
c14a91f06e Merge branch 'michal/prepare-documentation-for-bind-9.17.13' into 'v9_17_13-release'
Prepare documentation for BIND 9.17.13

See merge request isc-private/bind9!293
2021-05-20 12:03:47 +02:00
Michał Kępień
8113dbe5bb Prepare release notes for BIND 9.17.13 2021-05-20 12:03:47 +02:00
Michał Kępień
e49bd0906e Add release note for GL #2626 2021-05-20 12:03:47 +02:00
Michał Kępień
620cccc3fc Reorder release notes 2021-05-20 12:03:47 +02:00
Michał Kępień
ced6c9b23a Tweak and reword release notes 2021-05-20 12:03:47 +02:00
Michał Kępień
43cbc773a7 Tweak and reword recent CHANGES entries 2021-05-20 12:03:47 +02:00
Michal Nowak
ab6060c538 Drop duplicate release note for GL #2347 2021-05-20 12:03:47 +02:00
Michal Nowak
15a345626a Fix typo in doc/dnssec-guide/recipes.rst 2021-05-20 12:03:47 +02:00
Matthijs Mekking
3ecd951da8 Merge branch '1875-kasp-views-keyfile-race' into 'main'
Lock key files when looking for zone keys

Closes #1875

See merge request isc-projects/bind9!4919
2021-05-20 07:55:26 +00:00
Matthijs Mekking
fa1cd0a1f1 Release notes and changes for [#1875] 2021-05-20 09:23:46 +02:00
Matthijs Mekking
252a1ae0a1 Lock kasp when looking for zone keys
We should also lock kasp when reading key files, because at the same
time the zone in another view may be updating the key file.
2021-05-20 09:15:43 +02:00
Michal Nowak
8de2d8137c Merge branch 'mnowak/openbsd-6.9' into 'main'
Add OpenBSD 6.9

See merge request isc-projects/bind9!5031
2021-05-19 17:10:53 +00:00
Michal Nowak
315b8522ba Add OpenBSD 6.9 2021-05-19 17:21:23 +02:00
Michal Nowak
38bc6c8aa3 Merge branch '2694-drop-seq-command-from-views-tests-sh' into 'main'
Replace seq command with POSIX-compliant shell code

Closes #2694

See merge request isc-projects/bind9!5061
2021-05-19 13:55:53 +00:00
Michal Nowak
a4b7eb7188 Make views system test ShellCheck-clean
Also, add "set -e" to all shell scripts of the views test to exit when
any command fails or is unknown, e.g., this on OpenBSD:

    tests.sh[174]: seq: not found
2021-05-19 14:04:48 +02:00
Michal Nowak
a08487ec3d Replace seq command with POSIX-compliant shell code
The seq command is not defined in the POSIX standard and is missing on
OpenBSD. Given that the system test code is meant to be POSIX-compliant
replace it with a shell construct.
2021-05-19 14:04:48 +02:00
Michał Kępień
7d6bcef66e Merge branch '2709-placeholder' into 'main'
Add placeholder for GL #2709

See merge request isc-projects/bind9!5060
2021-05-19 12:00:02 +00:00
Michał Kępień
6962335678 Add placeholder for GL #2709 2021-05-19 13:57:21 +02:00
Artem Boldariev
1a298b28e2 Merge branch 'artem/doh-quota-tests' into 'main'
Add DoH quota tests

See merge request isc-projects/bind9!5024
2021-05-19 08:30:17 +00:00
Artem Boldariev
67c50abe5a Add DoH quota tests
This commit adds unit tests which ensure that DoH code is compatible
with quota functionality.
2021-05-19 10:28:47 +03:00
Mark Andrews
c2c2b0da9a Merge branch '2688-cid331478-forwardnull' into 'main'
Fix possible null dereference (coverity issue 331478)

Closes #2688

See merge request isc-projects/bind9!5034
2021-05-19 01:55:53 +00:00
Matthijs Mekking
19395fd168 Fix coverity issue 331478
Move the "cannot start rollover" warning into code block that checks
if 'active_key' is not NULL.
2021-05-19 00:45:54 +00:00
Mark Andrews
954eb15052 Merge branch '2550-remove-dns_zone_setflag' into 'main'
Resolve "Remove dns_zone_setflag"

Closes #2550

See merge request isc-projects/bind9!4762
2021-05-18 23:54:35 +00:00
Mark Andrews
314b5362a8 Remove dns_zone_setflag()
This function has never been used since it was added to the source tree
by commit 686b27bfd3 back in 1999.  As
the dns_zoneflg_t type is only defined in lib/dns/zone.c, no function
external to that file would be able to use dns_zone_setflag() properly
anyway - the DNS_ZONE_SETFLAG() and DNS_ZONE_CLRFLAG() macros should be
used instead. Zone options that can be set from outside zone.c are set
using dns_zone_setoption().
2021-05-18 16:02:18 -07:00
Matthijs Mekking
b6f806e023 Merge branch '2463-kasp-views-different-policy-same-keydirectory' into 'main'
Check key-directory duplicates for kasp zones

Closes #2463

See merge request isc-projects/bind9!4989
2021-05-18 14:40:26 +00:00
Matthijs Mekking
a9f4b074c4 Release notes and changes for [GL #2463]
Mention the bugfix.
2021-05-18 15:47:02 +02:00
Matthijs Mekking
df1aecd5ff Add checkconf tests for [#2463]
Add two tests to make sure named-checkconf catches key-directory issues
where a zone in multiple views uses the same directory but has
different dnssec-policies. One test sets the key-directory specifically,
the other inherits the default key-directory (NULL, aka the working
directory).

Also update the good.conf test to allow zones in different views
with the same key-directory if they use the same dnssec-policy.

Also allow zones in different views with different key-directories if
they use different dnssec-policies.

Also allow zones in different views with the same key-directories if
only one view uses a dnssec-policy (the other is set to "none").

Also allow zones in different views with the same key-directories if
no views uses a dnssec-policy (zone in both views has the dnssec-policy
set to "none").
2021-05-18 15:47:02 +02:00
Matthijs Mekking
494e8b2cbd Check key-directory duplicates for kasp zones
Don't allow the same zone with different dnssec-policies in separate
views have the same key-directory.

Track zones plus key-directory in a symtab and if there is a match,
check the offending zone's dnssec-policy name. If the name is "none"
(there is no kasp for the offending zone), or if the name is the same
(the zone shares keys), it is fine, otherwise it is an error (zones
in views using different policies cannot share the same key-directory).
2021-05-18 15:47:02 +02:00
Mark Andrews
8a90139c2c Merge branch '2696-misleading-diagnostic-in-update_soa_serial-indicates-bind-will-use-increment-but-it-doesn-t' into 'main'
Resolve "Misleading diagnostic in update_soa_serial indicates BIND will use increment but it doesn't"

Closes #2696

See merge request isc-projects/bind9!5029
2021-05-18 12:51:00 +00:00
Mark Andrews
5d21042ed8 Adjust returned method from dns_updatemethod_date
if dns_updatemethod_date is used do that the returned method is only
set to dns_updatemethod_increment if the new serial does not encode
the current day (YYYYMMDDXX).
2021-05-18 12:30:22 +00:00
Michał Kępień
3dc094c8e0 Merge branch 'michal/use-context-managers-as-suggested-by-pylint-2.8.2' into 'main'
Use context managers as suggested by PyLint 2.8.2

See merge request isc-projects/bind9!5041
2021-05-18 08:56:50 +00:00
Michał Kępień
a8163551ed Use context managers as suggested by PyLint 2.8.2
PyLint 2.8.2 reports the following suggestions for two Python scripts
used in the system test suite:

    ************* Module tests_rndc_deadlock
    bin/tests/system/addzone/tests_rndc_deadlock.py:71:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    ************* Module tests-shutdown
    bin/tests/system/shutdown/tests-shutdown.py:68:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    bin/tests/system/shutdown/tests-shutdown.py:154:8: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)

Implement the above suggestions by using
concurrent.futures.ThreadPoolExecutor() and subprocess.Popen() as
context managers.
2021-05-18 10:53:17 +02:00
Mark Andrews
71284cb496 Merge branch '2706-worker-cond_prio-needs-to-be-initialised' into 'main'
Resolve "worker->cond_prio needs to be initialised"

Closes #2706

See merge request isc-projects/bind9!5048
2021-05-18 08:39:28 +00:00
Mark Andrews
7e83c6df94 initialise worker->cond_prio 2021-05-18 07:47:42 +00:00
Mark Andrews
cdb8c9bd35 Merge branch '2701-gcc-10-fanalyzer-reports-dereference-of-null-label-in-lib-dns-name-c-1167' into 'main'
Resolve "gcc-10+ -fanalyzer reports: dereference of NULL ‘label’ in lib/dns/name.c:1167"

Closes #2701

See merge request isc-projects/bind9!5046
2021-05-18 06:41:56 +00:00
Mark Andrews
29f1c1e677 Silence gcc-10-fanalyzer false positive
If 'state == ft_ordinary' then 'label' can't be NULL. Add
INSIST to reflect this.
2021-05-18 15:51:51 +10:00
Mark Andrews
ea305a4877 Merge branch '2702-gcc-10-fanalyzer-reports' into 'main'
Resolve "gcc-10+ -fanalyzer reports:"

Closes #2702

See merge request isc-projects/bind9!5043
2021-05-18 05:45:26 +00:00
Mark Andrews
683ad6e4bd Silence gcc-10-fanalyzer false positive
Add REQUIRE(type == dns_rdatatype_nsec3 || firstp != NULL); so
that dereferences of *firstp is not flagged as a NULL pointer
dereference.
2021-05-18 15:19:28 +10:00
Mark Andrews
3b0d6450db Merge branch '2689-cid-331477-resource-leaks-resource_leak' into 'main'
Resolve "CID 331477: Resource leaks (RESOURCE_LEAK)"

Closes #2689

See merge request isc-projects/bind9!5016
2021-05-18 00:53:38 +00:00
Mark Andrews
d24ea068c8 Add CHANGES for [GL #2689] 2021-05-18 10:34:10 +10:00
Mark Andrews
8eed392add Address potential resource leak in dst_key_fromnamedfile 2021-05-18 10:33:43 +10:00
Evan Hunt
27386db7fe Merge branch 'each-bufsize-doc' into 'main'
clarify buffer size options

See merge request isc-projects/bind9!5037
2021-05-17 17:02:18 +00:00
Evan Hunt
05985f6889 clarify buffer size options
the documentation for {udp,tcp}-{send,receive}-buffer options
was not complete. also revised for grammar.
2021-05-17 09:34:08 -07:00
Michał Kępień
e3b442e538 Merge branch 'michal/tweak-cve-handling-checklists' into 'main'
Tweak security incident handling checklists

See merge request isc-projects/bind9!5017
2021-05-17 12:09:44 +00:00
Michał Kępień
ba1145c017 Tweak security incident handling checklists
Add an item to the CVE issue template which calls for drafting the
security advisory early in the security incident handling process.  The
intention is to ensure there is enough time to review and polish ISC
security advisories before they get published.

Tweak the release checklist to make sure we carefully consider all
confidential issues before opening them up to the public.  This change
is intended as a safeguard against accidentally disclosing too much
information about a security vulnerability before our users get a chance
to patch it.
2021-05-17 14:07:27 +02:00
Ondřej Surý
f2b297a37d Merge branch 'ondrej/remove-netmgr-quantum' into 'main'
Replace netmgr quantum with loop-preventing barrier

See merge request isc-projects/bind9!5028
2021-05-17 10:05:11 +00:00
Ondřej Surý
9e3cb396b2 Replace netmgr quantum with loop-preventing barrier
Instead of using fixed quantum, this commit adds atomic counter for
number of items on each queue and uses the number of netievents
scheduled to run as the limit of maximum number of netievents for a
single process_queue() run.

This prevents the endless loops when the netievent would schedule more
netievents onto the same loop, but we don't have to pick "magic" number
for the quantum.
2021-05-17 11:59:19 +02:00
Michal Nowak
9e21b80cbd Merge branch '2693-add-py-test-to-the-list-of-tested-pytest-names' into 'main'
Add py.test to the list of tested pytest names

Closes #2693

See merge request isc-projects/bind9!5022
2021-05-17 09:23:25 +00:00
Michal Nowak
510b4b70e9 Add py.test to the list of tested pytest names
OpenBSD changed the name of the pytest script from py.test-3 in OpenBSD
6.8 to py.test in OpenBSD 6.9.

The py.test-3 name which was added in d5562a3e for the sake of OpenBSD
and CentOS is still required for CentOS.
2021-05-17 11:12:43 +02:00
Ondřej Surý
d34672796c Merge branch '2313-set-RCVBUF-SNDBUF' into 'main'
Resolve "Set reasonable values to SO_RCVBUF and SO_SNDBUF"

Closes #2313

See merge request isc-projects/bind9!4460
2021-05-17 07:42:37 +00:00
Ondřej Surý
3733b4f101 Add CHANGES and release note for GL #2313 2021-05-17 08:47:09 +02:00
Ondřej Surý
4509089419 Add configuration option to set send/recv buffers on the nm sockets
This commit adds a new configuration option to set the receive and send
buffer sizes on the TCP and UDP netmgr sockets.  The default is `0`
which doesn't set any value and just uses the value set by the operating
system.

There's no magic value here - set it too small and the performance will
drop, set it too large, the buffers can fill-up with queries that have
already timeouted on the client side and nobody is interested for the
answer and this would just make the server clog up even more by making
it produce useless work.

The `netstat -su` can be used on POSIX systems to monitor the receive
and send buffer errors.
2021-05-17 08:47:09 +02:00
Michal Nowak
089bfe20f9 Merge branch '2386-check-correct-copyright-dates-in-man-pages' into 'main'
Set copyright year to the current year

Closes #2386

See merge request isc-projects/bind9!4869
2021-05-14 12:46:33 +00:00
Michal Nowak
7eb44b05c5 Set copyright year to the current year
To ensure that a release with outdated copyright year is not produced at
the beginning of a year, set copyright year to the current year.
2021-05-14 14:21:58 +02:00
Michal Nowak
6f9ac0e997 Merge branch 'mnowak/add-unit-gcc-out-of-tree-ci-job' into 'main'
Add unit:gcc:out-of-tree CI job

See merge request isc-projects/bind9!4740
2021-05-14 12:21:06 +00:00
Michal Nowak
741fdd4fe1 Add unit:gcc:out-of-tree CI job
Also extract the workspace save-and-retrieve logic to YAML anchors.
2021-05-14 13:22:09 +02:00
Michal Nowak
c628f2c71b Make masterXX.data.in reachable by out-of-tree builds
Unit test run for out-of-tree builds used to fail to find
masterXX.data.in files:

    /usr/bin/perl -w /builds/mnowak/bind9/lib/dns/tests/mkraw.pl < testdata/master/master12.data.in > testdata/master/master12.data
    /bin/bash: testdata/master/master12.data.in: No such file or directory
    make[4]: *** [Makefile:1910: testdata/master/master12.data] Error 1
2021-05-14 13:22:09 +02:00
Ondřej Surý
1c5de1aa43 Merge branch 'ondrej/fix-outgoing-udp-socket-selection-on-windows' into 'main'
Fix the outgoing UDP socket selection on Windows

See merge request isc-projects/bind9!5021
2021-05-13 14:05:22 +00:00
Ondřej Surý
cd413234f7 Fix the outgoing UDP socket selection on Windows
The outgoing UDP socket selection would pick unintialized children
socket on Windows, because we have more netmgr workers than we have
listening sockets.  This commit fixes the selection by keeping the
outgoing socket the same, so it's always run on existing socket.
2021-05-13 15:04:48 +02:00
Artem Boldariev
d7689d8dbc Merge branch 'artem-flamethrower-fixes' into 'main'
DoH flamethrower fixes

See merge request isc-projects/bind9!5019
2021-05-13 10:01:26 +00:00
Artem Boldariev
bab9309231 Fix DoH unit tests logic
This commit fixes logic bugs in DoH test suite revealed by making DoH
not to call nghttp2_session_terminate_session() in server-side code.
2021-05-13 10:42:25 +03:00
Artem Boldariev
6816a741ca Fix crash in TLS caused by improper handling of shutdown messages
The problem was found when flamethrower was accidentally run in DoT
mode against DoH port.
2021-05-13 10:42:25 +03:00
Artem Boldariev
1947f6372d Limit the number of active concurrent HTTP/2 streams
The initial intent was to limit the number of concurrent streams by
the value of 100 but due to the error when reading the documentation
it was set to the maximum possible number of streams per session.

This could lead to security issues, e.g. a remote attacker could have
taken down the BIND instance by creating lots of sessions via low
number of transport connections. This commit fixes that.
2021-05-13 10:42:25 +03:00
Artem Boldariev
d80d1b0dd9 Do not allow empty DoH endpoints to be added
It was possible to specify empty DoH endpoint in BIND's configuration
file: that was an error, we should not allow doing so.
2021-05-13 10:42:25 +03:00
Artem Boldariev
9155a87528 Do not call nghttp2_session_terminate_session() in server-side code
We should not call nghttp2_session_terminate_session() in server-side
code after all of the active HTTP/2 streams are processed. The
underlying transport connection is expected to remain opened at least
for some time in this case for new HTTP/2 requests to arrive. That is
what flamethrower was expecting and it makes perfect sense from the
HTTP/2 perspective.
2021-05-13 10:42:25 +03:00
Mark Andrews
4d888458ab Merge branch '2528-check-soa-rdata' into 'main'
Check SOA rdata for consistency in AXFR.

Closes #2528

See merge request isc-projects/bind9!5014
2021-05-13 05:17:39 +00:00
Evan Hunt
4d94f82232 system test
Attempt a zone transfer with mismatched SOA records.
2021-05-13 03:36:50 +00:00
Mark Andrews
7e54d8d2cb Add CHANGES entry for [GL #2528] 2021-05-13 03:36:50 +00:00
Mark Andrews
e86508708d Check that the first and last SOA of an AXFR are consistent 2021-05-13 03:36:50 +00:00
Mark Andrews
72da25f31f Merge branch '2656-resolver-system-test-fails-on-macos' into 'main'
Resolve "resolver system test fails on macOS"

Closes #2656

See merge request isc-projects/bind9!4947
2021-05-12 03:40:52 +00:00
Mark Andrews
a83afc10f9 Add missing call to isc_app_ctxstart 2021-05-12 03:01:15 +00:00
Ondřej Surý
0860ed6f5b Merge branch 'marka/add-missing-isc_condition_init' into 'main'
initalise sock->cond

See merge request isc-projects/bind9!5013
2021-05-11 13:03:13 +00:00
Mark Andrews
0f6ae9000a initalise sock->cond 2021-05-11 14:06:26 +02:00
Ondřej Surý
4efd1e2ac8 Merge branch 'ondrej/increase-netmgr-quantum' into 'main'
Bump the netmgr quantum to 1024

See merge request isc-projects/bind9!5009
2021-05-10 20:04:10 +00:00
Ondřej Surý
3713a38689 Bump the netmgr quantum to 1024
During the stress testing, it was discovered that the default netmgr
quantum of 128 is not enough and there was a performance drop for TCP on
FreeBSD.  Bumping the default quantum to 1024 solves the performance
issue and is still enough to prevent the endless loops.
2021-05-10 21:32:31 +02:00
Evan Hunt
ee6e540004 Merge branch 'each-taskmgr-setmode' into 'main'
reset taskmgr immediately after loading zones

See merge request isc-projects/bind9!5010
2021-05-10 19:32:00 +00:00
Evan Hunt
220ada9422 reset taskmgr mode immediately after returning from zone load
all privileged tasks are complete by the time we return from
isc_task_endexclusive(), so it makes sense to reset the taskmgr
mode to non-privileged right then.
2021-05-10 12:26:27 -07:00
Ondřej Surý
1639bcb59e Merge branch 'ondrej/dereference-taskmgr-after-all-tasks-are-done' into 'main'
Destroy reference to taskmgr after all tasks are done

See merge request isc-projects/bind9!5008
2021-05-10 19:24:53 +00:00
Ondřej Surý
e623c12757 Destroy reference to taskmgr after all tasks are done
We were clearing the pointer to taskmgr as soon as isc_taskmgr_destroy()
would be called and before all tasks were finished.  Unfortunately, some
tasks would use global named_g_taskmgr objects from inside the events
and this would cause either a data race or NULL pointer dereference.

This commit fixes the data race by moving the destruction of the
referenced pointer to the time after all tasks are finished.
2021-05-10 12:13:27 -07:00
Ondřej Surý
d3ebd19e23 Merge branch 'ondrej/fix-missing-isc_taskmgr_detach-on-exiting' into 'main'
Add isc_taskmgr_detach when task is created while shutting down

See merge request isc-projects/bind9!5006
2021-05-10 11:33:46 +00:00
Ondřej Surý
6c57a6cc3d Add isc_taskmgr_detach when task is created while shutting down
When taskmgr is shutting down, the creating the task would attach
to the taskmgr, but don't detach on error condition.
2021-05-10 11:39:51 +02:00
Evan Hunt
0e92060833 Merge branch '2654-create-isc_managers-api' into 'main'
Destroy netmgr before destroying taskmgr

Closes #2654

See merge request isc-projects/bind9!4983
2021-05-07 21:37:01 +00:00
Evan Hunt
19431b1c83 CHANGES 2021-05-07 14:28:33 -07:00
Ondřej Surý
0133096c88 improvements to socket_test
- be more strict, but patient, waiting for event completion.
- use an atomic pointer for the socket to silence TSAN warnings.
2021-05-07 14:28:33 -07:00
Ondřej Surý
365c6a9851 ensure interlocked netmgr events run on worker[0]
Network manager events that require interlock (pause, resume, listen)
are now always executed in the same worker thread, mgr->workers[0],
to prevent races.

"stoplistening" events no longer require interlock.
2021-05-07 14:28:32 -07:00
Evan Hunt
c44423127d fix shutdown deadlocks
- ensure isc_nm_pause() and isc_nm_resume() work the same whether
  run from inside or outside of the netmgr.
- promote 'stop' events to the priority event level so they can
  run while the netmgr is pausing or paused.
- when pausing, drain the priority queue before acquiring an
  interlock; this prevents a deadlock when another thread is waiting
  for us to complete a task.
- release interlock after pausing, reacquire it when resuming, so
  that stop events can happen.

some incidental changes:
- use a function to enqueue pause and resume events (this was part of a
  different change attempt that didn't work out; I kept it because I
  thought was more readable).
- make mgr->nworkers a signed int to remove some annoying integer casts.
2021-05-07 14:28:32 -07:00
Ondřej Surý
4c8f6ebeb1 Use barriers for netmgr synchronization
The netmgr listening, stoplistening, pausing and resuming functions
now use barriers for synchronization, which makes the code much simpler.

isc/barrier.h defines isc_barrier macros as a front-end for uv_barrier
on platforms where that works, and pthread_barrier where it doesn't
(including TSAN builds).
2021-05-07 14:28:32 -07:00
Ondřej Surý
2eae7813b6 Run isc__nm_http_stoplistening() synchronously in netmgr
When isc__nm_http_stoplistening() is run from inside the netmgr, we need
to make sure it's run synchronously.  This commit is just a band-aid
though, as the desired behvaior for isc_nm_stoplistening() is not always
the same:

  1. When run from outside user of the interface, the call must be
     synchronous, e.g. the calling code expects the call to really stop
     listening on the interfaces.

  2. But if there's a call from listen<proto> when listening fails,
     that needs to be scheduled to run asynchronously, because
     isc_nm_listen<proto> is being run in a paused (interlocked)
     netmgr thread and we could get stuck.

The proper solution would be to make isc_nm_stoplistening()
behave like uv_close(), i.e., to have a proper callback.
2021-05-07 14:28:32 -07:00
Evan Hunt
5c08f97791 only run tasks as privileged if taskmgr is in privileged mode
all zone loading tasks have the privileged flag, but we only want
them to run as privileged tasks when the server is being initialized;
if we privilege them the rest of the time, the server may hang for a
long time after a reload/reconfig. so now we call isc_taskmgr_setmode()
to turn privileged execution mode on or off in the task manager.

isc_task_privileged() returns true if the task's privilege flag is
set *and* the taskmgr is in privileged execution mode. this is used
to determine in which netmgr event queue the task should be run.
2021-05-07 14:28:30 -07:00
Ondřej Surý
29a208aaf7 Fix crash when allocating UDP socket fails on OpenBSD
When socket() call fails, the UDP connect code would call the connectcb
with empty req->handle.  This has been fixed.
2021-05-07 14:28:30 -07:00
Ondřej Surý
0b491913df Don't clear dig lookup if it was already cleared
This workarounds couple of races where the current_lookup would be
already detached during shutting down the dig, but still processing the
pending reads.
2021-05-07 14:28:30 -07:00
Ondřej Surý
2836bc1854 Fix wrong query accounting in the connect function in dighost.c
The start_udp() function didn't properly attach to the query and thus
a callback with ISC_R_CANCELED would end with wrong accounting on the
query object.

Usually, this doesn't happen because underlying libuv API
uv_udp_connect() is synchronous, but isc_nm_udpconnect() could return
ISC_R_CANCELED in case it's called while the netmgr is shutting down.
2021-05-07 14:28:30 -07:00
Ondřej Surý
dacf586e18 Make the netmgr queue processing quantized
There was a theoretical possibility of clogging up the queue processing
with an endless loop where currently processing netievent would schedule
new netievent that would get processed immediately.  This wasn't such a
problem when only netmgr netievents were processed, but with the
addition of the tasks, there are at least two situation where this could
happen:

 1. In lib/dns/zone.c:setnsec3param() the task would get re-enqueued
    when the zone was not yet fully loaded.

 2. Tasks have internal quantum for maximum number of isc_events to be
    processed, when the task quantum is reached, the task would get
    rescheduled and then immediately processed by the netmgr queue
    processing.

As the isc_queue doesn't have a mechanism to atomically move the queue,
this commit adds a mechanism to quantize the queue, so enqueueing new
netievents will never stop processing other uv_loop_t events.
The default quantum size is 128.

Since the queue used in the network manager allows items to be enqueued
more than once, tasks are now reference-counted around task_ready()
and task_run(). task_ready() now has a public API wrapper,
isc_task_ready(), that the netmgr can use to reschedule processing
of a task if the quantum has been reached.

Incidental changes: Cleaned up some unused fields left in isc_task_t
and isc_taskmgr_t after the last refactoring, and changed atomic
flags to atomic_bools for easier manipulation.
2021-05-07 14:28:30 -07:00
Ondřej Surý
b5bf58b419 Destroy netmgr before destroying taskmgr
With taskmgr running on top of netmgr, the ordering of how the tasks and
netmgr shutdown interacts was wrong as previously isc_taskmgr_destroy()
was waiting until all tasks were properly shutdown and detached.  This
responsibility was moved to netmgr, so we now need to do the following:

  1. shutdown all the tasks - this schedules all shutdown events onto
     the netmgr queue

  2. shutdown the netmgr - this also makes sure all the tasks and
     events are properly executed

  3. Shutdown the taskmgr - this now waits for all the tasks to finish
     running before returning

  4. Shutdown the netmgr - this call waits for all the netmgr netievents
     to finish before returning

This solves the race when the taskmgr object would be destroyed before
all the tasks were finished running in the netmgr loops.
2021-05-07 14:28:30 -07:00
Ondřej Surý
a011d42211 Add new isc_managers API to simplify <*>mgr create/destroy
Previously, netmgr, taskmgr, timermgr and socketmgr all had their own
isc_<*>mgr_create() and isc_<*>mgr_destroy() functions.  The new
isc_managers_create() and isc_managers_destroy() fold all four into a
single function and makes sure the objects are created and destroy in
correct order.

Especially now, when taskmgr runs on top of netmgr, the correct order is
important and when the code was duplicated at many places it's easy to
make mistake.

The former isc_<*>mgr_create() and isc_<*>mgr_destroy() functions were
made private and a single call to isc_managers_create() and
isc_managers_destroy() is required at the program startup / shutdown.
2021-05-07 10:19:05 -07:00
Artem Boldariev
f23afce683 Merge branch 'artem/doh-tests-fix' into 'main'
Fix flawed DoH unit tests logic and some corner cases in the DoH code. Fix doh_test failure on FreeBSD 13.0

Closes #2632

See merge request isc-projects/bind9!5005
2021-05-07 13:25:56 +00:00
Artem Boldariev
8c0ea01f34 DoH: close active server streams when finishing session
Under some circumstances a situation might occur when server-side
session gets finished while there are still active HTTP/2
streams. This would lead to isc_nm_httpsocket object leaks.

This commit fixes this behaviour as well as refactors failed_read_cb()
to allow better code reuse.
2021-05-07 15:47:24 +03:00
Artem Boldariev
a9e97f28b7 Fix crash in client side DoH code
This commit fixes a situation when a cstream object could get unlinked
from the list as a result of a cstream->read_cb call. Thus, unlinking
it after the call could crash the program.
2021-05-07 15:47:24 +03:00
Artem Boldariev
cd178043d9 Make some TLS tests actually use quota
A directive to check quota was missing from some of the TLS tests
which were supposed to test TLS code with quotas.
2021-05-07 15:47:24 +03:00
Artem Boldariev
22376fc69a TLS: cancel reading on the underlying TCP socket after (see below)
... the last handle has been detached after calling write
callback. That makes it possible to detach from the underlying socket
and not to keep the socket object alive for too long. This issue was
causing TLS tests with quota to fail because quota might not have been
detached on time (because it was still referenced by the underlying
TCP socket).

One could say that this commit is an ideological continuation of:

513cdb52ec.
2021-05-07 15:47:24 +03:00
Artem Boldariev
3bf331c453 Fix crashes in TLS when handling TLS shutdown messages
This commit fixes some situations which could appear in TLS code when
dealing with shutdown messages and lead to crashes.
2021-05-07 15:47:24 +03:00
Artem Boldariev
0d3f503dc9 Avoid creating connect netievents during low level failures in HTTP
This way we create less netievent objects, not bombarding NM with the
messages in case of numerous low-level errors (like too many open
files) in e.g. unit tests.
2021-05-07 15:47:24 +03:00
Artem Boldariev
0e8ac61d6e Avoid creating httpclose netievents in case of low level failures
This way we create less load on NM workers by avoiding netievent
creation.
2021-05-07 15:47:24 +03:00
Artem Boldariev
8510c5cd59 Always call TCP connect callback from within a worker context
This change ensures that a TCP connect callback is called from within
the context of a worker thread in case of a low-level error when
descriptors cannot be created (e.g. when there are too many open file
descriptors).
2021-05-07 15:47:24 +03:00
Artem Boldariev
1349142333 Got rid of tlsconnect event and corresponding code
We do not need it since we decided to not return values from connect
functions.
2021-05-07 15:47:24 +03:00
Artem Boldariev
39448c1581 Finish HTTP session on write failure
Not doing so caused client-side code to not free file descriptors as
soon as possible, that was causing unit tests to fail.
2021-05-07 15:47:24 +03:00
Artem Boldariev
4c5b36780b Fix flawed DoH unit tests logic
This commit fixes some logical mistakes in DoH unit tests logic,
causing them either to fail or not to do what they are intended to do.
2021-05-07 15:47:24 +03:00
Michal Nowak
b31b29d166 Merge branch 'mnowak/add-placeholder-for-issue-2671' into 'main'
Add placeholder for #2671

See merge request isc-projects/bind9!5004
2021-05-07 11:15:42 +00:00
Michal Nowak
8cc6725280 Add placeholder for #2671
Issue #2671 was merged to 9.16 but a respective placeholder was not
added to "main".
2021-05-07 12:08:40 +02:00
Matthijs Mekking
cf99c1dc85 Merge branch '2603-test-dnssec-policy-none' into 'main'
Check zonefile is untouched if dnssec-policy none

Closes #2603

See merge request isc-projects/bind9!4888
2021-05-05 17:15:58 +00:00
Matthijs Mekking
66f2cd228d Use isdigit instead of checking character range
When looking for key files, we could use isdigit rather than checking
if the character is within the range [0-9].

Use (unsigned char) cast to ensure the value is representable in the
unsigned char type (as suggested by the isdigit manpage).

Change " & 0xff" occurrences to the recommended (unsigned char) type
cast.
2021-05-05 19:15:33 +02:00
Matthijs Mekking
0c09867e96 Changes and release notes for [#2603] 2021-05-05 19:15:32 +02:00
Matthijs Mekking
511bc1b882 Check for filename clashes /w dnssec-policy zones
Just like with dynamic and/or inline-signing zones, check if no two
or more zone configurations set the same filename. In these cases,
the zone files are not read-only and named-checkconf should catch
a configuration where multiple zone statements write to the same file.

Add some bad configuration tests where KASP zones reference the same
zone file.

Update the good-kasp test to allow for two zones configure the same
file name, dnssec-policy none.
2021-05-05 19:13:55 +02:00
Matthijs Mekking
2d1b3a9899 Check zonefile is untouched if dnssec-policy none
Make sure no DNSSEC contents are added to the zonefile if dnssec-policy
is set to "none" (and no .state files exist for the zone).
2021-05-05 19:13:55 +02:00
Mark Andrews
d8cc16a659 Merge branch '2670-always-set-rewrite-when-compacting-a-version-1-journal' into 'main'
Resolve "Always set 'rewrite' when compacting a version 1 journal."

Closes #2670

See merge request isc-projects/bind9!4985
2021-05-05 13:33:55 +00:00
Mark Andrews
a60b54e1df Add release note for [GL #2670] 2021-05-05 23:13:55 +10:00
Mark Andrews
79da175a76 Add CHANGES note for [GL #2670] 2021-05-05 23:13:09 +10:00
Mark Andrews
ae1ae07b03 Check journal compaction 2021-05-05 23:12:37 +10:00
Mark Andrews
4a8e33b9f0 Always perform a re-write when processing a version 1 journal
version 1 journals may have a mix of type 1 and type 2 transaction
headers so always use the recovery code.
2021-05-05 23:12:37 +10:00
Mark Andrews
71df4fb84c Allow named-journalprint to compact journals at a given serial 2021-05-05 23:12:37 +10:00
Matthijs Mekking
cecc905b46 Merge branch 'matthijs-follow-up-2596' into 'main'
Remove double "insecure" check

See merge request isc-projects/bind9!4997
2021-05-05 10:48:38 +00:00
Matthijs Mekking
22243ac804 Remove double "insecure" check
This was a conflict between dba13d280a
and 636ff1e15c.
2021-05-05 12:45:47 +02:00
Matthijs Mekking
09ed248f60 Merge branch '2596-dnssec-policy-keys-inaccessible' into 'main'
Don't roll keys when the private key file is offline

Closes #2596

See merge request isc-projects/bind9!4885
2021-05-05 10:33:46 +00:00
Matthijs Mekking
636ff1e15c No longer need to strcmp for "none"
When we introduced "dnssec-policy insecure" we could have removed the
'strcmp' check for "none", because if it was set to "none", the 'kasp'
variable would have been set to NULL.
2021-05-05 11:23:53 +02:00
Matthijs Mekking
366ed047dd Changes and release notes for [#2596] 2021-05-05 11:14:35 +02:00
Matthijs Mekking
4a8ad0a77f Add kasp tests for offline keys
Add a test for default.kasp that if we remove the private key file,
no successor key is created for it. We need to update the kasp script
to deal with a missing private key. If this is the case, skip checks
for private key files.

Add a test with a zone for which the private key of the ZSK is missing.

Add a test with a zone for which the private key of the KSK is missing.
2021-05-05 11:14:02 +02:00
Matthijs Mekking
6a60bf637d Update smart signing when key is offline
BIND 9 is smart about when to sign with what key. If a key is offline,
BIND will delete the old signature anyway if there is another key to
sign the RRset with.

With KASP we don't want to fallback to the KSK if the ZSK is missing,
only for the SOA RRset. If the KSK is missing, but we do have a ZSK,
deleting the signature is fine. Otherwise it depends on if we use KASP
or not. Update the 'delsig_ok' function to reflect that.
2021-05-05 11:13:19 +02:00
Matthijs Mekking
3e6fc49c16 Don't roll offline keys
When checking the current DNSSEC state against the policy, consider
offline keys. If we didn't found an active key, check if the key is
offline by checking the public key list. If there is a match in the
public key list (the key data is retrieved from the .key and the
.state files), treat the key as offline and don't create a successor
key for it.
2021-05-05 11:13:19 +02:00
Matthijs Mekking
b3a5859a9b rndc dnssec -status should include offline keys
The rndc command 'dnssec -status' only considered keys from
'dns_dnssec_findmatchingkeys' which only includes keys with accessible
private keys. Change it so that offline keys are also listed in the
status.
2021-05-05 11:13:19 +02:00
Matthijs Mekking
7ed089576f Try to read state when reading keylist from rdata
The function 'dns_dnssec_keylistfromrdataset()' creates a keylist from
the DNSKEY RRset. If we attempt to read the private key, we also store
the key state. However, if the private key is offline, the key state
will not be stored. To fix this, first attempt to read the public key
file. If then reading the private key file fails, and we do have a
public key, add that to the keylist, with appropriate state. If we
also failed to read the public key file, add the DNSKEY to the keylist,
as we did before.
2021-05-05 11:13:19 +02:00
Matthijs Mekking
fa05c1b8da When reading public key from file, also read state
The 'dst_key_fromnamedfile()' function did not read and store the
key state from the .state file when reading a public key file.
2021-05-05 11:13:19 +02:00
Matthijs Mekking
cf17698f87 Fix a kasp lock issue
The kasp lock would stay locked if 'dns_keymgr_run' failed.
2021-05-05 11:13:19 +02:00
Mark Andrews
2be319b759 Merge branch '2678-named-checkconf-doesn-t-catch-redefinition-of-dnssec-policy-insecure' into 'main'
Resolve "named-checkconf doesn't catch redefinition of dnssec-policy insecure"

Closes #2678

See merge request isc-projects/bind9!4994
2021-05-05 07:03:12 +00:00
Mark Andrews
dba13d280a named-checkconf now detects redefinition of dnssec-policy 'insecure' 2021-05-05 16:23:19 +10:00
Mark Andrews
0f53872542 Merge branch '2536-inline-signing-documentation-doesn-t-match-reality' into 'main'
Resolve "inline-signing documentation doesn't match reality"

Closes #2536

See merge request isc-projects/bind9!4751
2021-05-05 00:17:40 +00:00
Matthijs Mekking
a548a450b3 checkconf tests for inline-signing at options/view 2021-05-04 23:35:59 +00:00
Mark Andrews
03978a7881 Add Release note for [GL #2536] 2021-05-04 23:35:59 +00:00
Mark Andrews
475a553e37 Add CHANGES note for [GL #2536] 2021-05-04 23:35:59 +00:00
Mark Andrews
b3301da262 inline-signing should have been in zone_only_clauses 2021-05-04 23:35:59 +00:00
Ondřej Surý
74d9a917eb Merge branch '2675-wrong-rfc-reference-in-name-c' into 'main'
Fix RFC292 -> RFC952 typo

Closes #2675

See merge request isc-projects/bind9!4990
2021-05-04 15:22:49 +00:00
Ondřej Surý
d2dba352cb Fix RFC292 -> RFC952 typo 2021-05-04 17:21:52 +02:00
Matthijs Mekking
38a422ed81 Merge branch '2624-kasp-test-failure-job-1630205' into 'main'
Fix intermittent kasp test failure

Closes #2624

See merge request isc-projects/bind9!4884
2021-05-04 08:24:43 +00:00
Matthijs Mekking
572f421df4 Fix intermittent kasp test failure
The kasp system test performs for each zone a couple of checks to make
sure the zone is signed correctly. To avoid test failures caused by
timing issues, there is first a check to ensure the zone is done
signing, 'wait_for_done_signing'. This function waits with the DNSSEC
checks until a "zone_rekey done" log message is seen for a specific
key.

Unfortunately this is not sufficient to avoid test failures due to
timing issues, because there is a small amount of time in between this
log message and the newly signed zone actually being served.

Therefore, in 'check_apex', retry for three seconds the DNSKEY query
check. After that, additional checks should pass without retries,
because at that point we know for sure the zone has been resigned with
the expected keys.

Also reduce the number of redundant 'check_signatures'
2021-05-04 04:50:01 +00:00
Mark Andrews
33fd1a8437 Merge branch '2621-pull-request-to-fix-rdnc-addzone-doc' into 'main'
Resolve "Pull request to fix rdnc-addzone doc"

Closes #2621

See merge request isc-projects/bind9!4882
2021-05-04 02:37:51 +00:00
Mark Andrews
205d1bb762 Remove spurious $ and \ in addzone example 2021-05-04 02:18:34 +00:00
Ondřej Surý
44c6a69c9c Merge branch 'ondrej/add-backtrace-support-for-Windows' into 'main'
Add support for generating backtraces on Windows

See merge request isc-projects/bind9!4982
2021-05-03 18:40:30 +00:00
Ondřej Surý
dfd56b84f5 Add support for generating backtraces on Windows
This commit adds support for generating backtraces on Windows and
refactors the isc_backtrace API to match the Linux/BSD API (without
the isc_ prefix)

 * isc_backtrace_gettrace() was renamed to isc_backtrace(), the third
   argument was removed and the return type was changed to int
 * isc_backtrace_symbols() was added
 * isc_backtrace_symbols_fd() was added and used as appropriate
2021-05-03 20:31:52 +02:00
Ondřej Surý
c3ee539463 Merge branch 'ondrej/add-nanosleep-and-usleep-windows-shims' into 'main'
Add nanosleep and usleep Windows shims

See merge request isc-projects/bind9!4981
2021-05-03 18:25:55 +00:00
Ondřej Surý
c58dc55c82 Merge branch 'ondrej/replace-CreateThreads-with-isc_thread_create' into 'main'
Add trampoline around iocompletionport_createthreads()

See merge request isc-projects/bind9!4980
2021-05-03 18:24:06 +00:00
Ondřej Surý
37c0d196e3 Use uv_sleep in the netmgr code
libuv added uv_sleep(unsigned int msec) to the API since 1.34.0.  Use that in
the netmgr code and define usleep based shim for libuv << 1.34.0.
2021-05-03 20:22:54 +02:00
Ondřej Surý
c37ff5d188 Add nanosleep and usleep Windows shims
This commit adds POSIX nanosleep() and usleep() shim implementation for
Windows to help implementors use less #ifdef _WIN32 in the code.
2021-05-03 20:22:54 +02:00
Ondřej Surý
cd54bbbd9a Add trampoline around iocompletionport_createthreads()
On Windows, the iocompletionport_createthreads() didn't use
isc_thread_create() to create new threads for processing IO, but just a
simple CreateThread() function that completely circumvent the
isc_trampoline mechanism to initialize global isc_tid_v.  This lead to
segmentation fault in isc_hp API because '-1' isn't valid index to the
hazard pointer array.

This commit changes the iocompletionport_createthreads() to use
isc_thread_create() instead of CreateThread() to properly initialize
isc_tid_v.
2021-05-03 20:21:15 +02:00
Diego dos Santos Fronza
9dedfcdda6 Merge branch '2627-tlsstream-c-warning-comparison-of-integer-expressions-of-different-signedness' into 'main'
Resolve "tlsstream.c: warning: comparison of integer expressions of different signedness"

Closes #2627

See merge request isc-projects/bind9!4906
2021-05-03 17:03:44 +00:00
Diego Fronza
7729844150 Address comparison of integers with different signedess 2021-05-03 06:54:30 +00:00
Matthijs Mekking
7a3b6a7fb0 Merge branch 'matthijs-nsupdate-update_test' into 'main'
Update nsupdate test

See merge request isc-projects/bind9!4975
2021-04-30 12:26:12 +00:00
Matthijs Mekking
5b31811b5f Update nsupdate test
The nsupdate system test did not record failures from the
'update_test.pl' Perl script. This was because the 'ret' value was
not being saved outside the '{ $PERL ... || ret=1 } cat_i' scope.

Change this piece to store the output in a separate file and then
cat its contents. Now the 'ret' value is being saved.

Also record failures in 'update_test.pl' if sending the update
failed.

Add missing 'n' incrementals to 'nsupdate/test.sh' to keep track of
test numbers.
2021-04-30 12:25:25 +00:00
Petr Špaček
9d04a731ba Merge branch 'pspacek/rtd-sphinx-fix' into 'main'
Fix ARM build on readthedocs.org

See merge request isc-projects/bind9!4968
2021-04-30 10:57:30 +00:00
Petr Špaček
7df913aa3a Fix ARM build on readthedocs.org
By default readthedocs.org uses Sphinx 1.8.5, but MR !4563 has
introduced depedency on ReferenceRole class which is available only in
Sphinx 2.0.0.

Path to doc/arm/requirements.txt needs to be configured in
readthedocs.org.
2021-04-30 12:56:56 +02:00
Matthijs Mekking
968b9b5697 Merge branch '2645-dnssec-polic-insecure' into 'main'
Add built-in dnssec-policy "insecure"

Closes #2645

See merge request isc-projects/bind9!4929
2021-04-30 10:10:32 +00:00
Matthijs Mekking
287428e0aa Add kasp test policy goes straight to "none"
Add a test case when a dnssec-policy is reconfigured to "none",
without setting it to "insecure" first. This is unsupported behavior,
but we want to make sure the behavior is somewhat expected. The
zone should remain signed (but will go bogus once the signatures
expire).
2021-04-30 11:20:41 +02:00
Matthijs Mekking
75024736a4 Release notes and changes for [#2645]
The feature "going insecure gracefully" has been changed.
2021-04-30 11:20:40 +02:00
Matthijs Mekking
fadc57d3d0 Update documentation with "insecure" policy
Update the ARM to mention the new built-in "insecure" policy.  Update
the DNSSEC guide recipe "Revert to unsigned" to add the additional
step of reconfiguring the zone to "insecure" (instead of immediately
set it to "none").
2021-04-30 11:18:38 +02:00
Matthijs Mekking
9c6ff463fd Add test for "insecure" policy
While it is meant to be used for transitioning a zone to insecure,
add a test case where a zone uses the "insecure" policy immediately.

The zone will go through DNSSEC maintenance, but the outcome should
be the same as 'dnssec-policy none;', that is the zone should be
unsigned.
2021-04-30 11:18:38 +02:00
Matthijs Mekking
17e3b056c8 Update kasp tests to "insecure" policy
The tests for going insecure should be changed to use the built-in
"insecure" policy.

The function that checks dnssec status output should again check
for the special case "none".
2021-04-30 11:18:38 +02:00
Matthijs Mekking
2710d9a11d Add built-in dnssec-policy "insecure"
Add a new built-in policy "insecure", to be used to gracefully unsign
a zone. Previously you could just remove the 'dnssec-policy'
configuration from your zone statement, or remove it.

The built-in policy "none" (or not configured) now actually means
no DNSSEC maintenance for the corresponding zone. So if you
immediately reconfigure your zone from whatever policy to "none",
your zone will temporarily be seen as bogus by validating resolvers.

This means we can remove the functions 'dns_zone_use_kasp()' and
'dns_zone_secure_to_insecure()' again. We also no longer have to
check for the existence of key state files to figure out if a zone
is transitioning to insecure.
2021-04-30 11:18:38 +02:00
Mark Andrews
1f4234ec89 Merge branch '2668-handle-net-dns-versions-that-don-t-support-nsec3param' into 'main'
Resolve "Handle Net::DNS versions that don't support NSEC3PARAM"

Closes #2668

See merge request isc-projects/bind9!4971
2021-04-30 06:25:39 +00:00
Mark Andrews
044933756a NSEC3PARAM support was added to Net::DNS in 1.00_06
Require 1.01 or later to when adding a NSEC3PARAM records.
2021-04-30 15:59:30 +10:00
Mark Andrews
7b62af4e0e Merge branch '2658-update-zonemd-now-that-rfc-8976-has-been-issued' into 'main'
Resolve "Update ZONEMD now that RFC 8976 has been issued."

Closes #2658

See merge request isc-projects/bind9!4946
2021-04-30 01:08:46 +00:00
Mark Andrews
8510ccaa54 Update ZONEMD to match RFC 8976
* The location of the digest type field has changed to where the
  reserved field was.
* The reserved field is now called scheme and is where the digest
  type field was.
* Digest type 2 has been defined (SHA256).
2021-04-30 10:43:37 +10:00
Michal Nowak
c922608333 Merge branch 'mnowak/configure-with-enable-dnstap-by-default' into 'main'
Configure with --enable-dnstap by default

See merge request isc-projects/bind9!4618
2021-04-29 13:58:33 +00:00
Michal Nowak
c97c6fbfea Suppress TSAN errors from libfstrm.so
dnstap_test produces TSAN errors which originate in libfstrm.so. Unless
libfstrm is TSAN clean or a workaround is placed in libfstrm sources,
suppressing TSAN coming from libfstrm is necessary to test DNSTAP under
TSAN.
2021-04-29 15:57:07 +02:00
Michal Nowak
deff0ae317 Configure with --enable-dnstap by default
All platforms but OpenBSD have dnstap dependencies readily in their
respective repositories, and dnstap thus can be tested there. Given that
majority of images have dnstap dependencies available, it seems fitting
to make dnstap enabled by default.
2021-04-29 15:57:07 +02:00
Michal Nowak
f11f7d0086 Merge branch 'mnowak/disable-pytest-cacheprovider-plugin' into 'main'
Disable pytest cacheprovider plugin in CI

See merge request isc-projects/bind9!4961
2021-04-29 13:43:10 +00:00
Michal Nowak
e1c3034107 Disable pytest cacheprovider plugin in CI
The pytest "cacheprovider" plugin produces a .cache/v/cache/lastfailed
file, which holds a Python dictionary structure with failed tests.
However, on Ubuntu 16.04 (Xenial) the file is created even though the
test passed and the file contains just an empty dictionary ("{}").

Given that we are not interested in this feature, disabling the
"cacheprovider" plugin globally and removing per-test removals of the
.cache directory seems like the best course of action.
2021-04-29 15:29:18 +02:00
Matthijs Mekking
c2f43e9516 Merge branch '2445-nsec3-iterations-resolver' into 'main'
Resolve "NSEC3 iterations"

Closes #2445

See merge request isc-projects/bind9!4957
2021-04-29 13:09:30 +00:00
Mark Andrews
ad236976fc Add release note for [GL #2445] 2021-04-29 13:43:40 +02:00
Mark Andrews
fd1f7b6480 Add CHANGES for [GL #2445] 2021-04-29 13:43:40 +02:00
Mark Andrews
e6e0e29fbb Check insecure responses returned with too many NSEC3 iterations 2021-04-29 13:43:40 +02:00
Mark Andrews
af02bbcdd6 Mark DNSSEC responses with NSEC3 records that exceed 150 as insecure 2021-04-29 13:43:40 +02:00
Michał Kępień
b189defb6a Merge branch '2372-add-hyperlink-to-gl-xxxx-labels-in-documentation' into 'main'
Resolve "Add hyperlink to [GL XXXX] labels in documentation"

Closes #2372

See merge request isc-projects/bind9!4563
2021-04-29 11:35:33 +00:00
Michal Nowak
fe1dea6572 Update Danger check for GitLab references
Release notes now employ a custom :gl: Sphinx role for linking to GitLab
issues/MRs.  Tweak the relevant Danger checks to account for that.
2021-04-29 13:24:21 +02:00
Michał Kępień
2fadf29e6b Add a Sphinx role for linking GitLab issues/MRs
Define a :gl: Sphinx role that takes a GitLab issue/MR number as an
argument and creates a hyperlink to the relevant ISC GitLab URL.  This
makes it easy to reach ISC GitLab pages directly from the release notes.

Make all GitLab references in the release notes use the new Sphinx role.
2021-04-29 13:24:21 +02:00
Michal Nowak
aeb43a45ac Make use of the :rfc: role in the ARM consistent
Make sure all RFC references in the ARM use the stock :rfc: Sphinx role.
2021-04-29 13:24:21 +02:00
Ondřej Surý
9c3fac706e Merge branch 'ondrej/use-sigabrt-from-start.pl' into 'main'
Use SIGABRT instead of SIGKILL to produce cores on failed start

See merge request isc-projects/bind9!4928
2021-04-29 10:44:26 +00:00
Ondřej Surý
861a236937 Use SIGABRT instead of SIGKILL to produce cores on failed start
When the `named` would hang on startup it would be killed with SIGKILL
leaving us with no information about the state the process was in.
This commit changes the start.pl script to send SIGABRT instead, so we
can properly collect and process the coredump from the hung named
process.
2021-04-29 12:03:50 +02:00
Matthijs Mekking
d8355d197d Merge branch 'matthijs-follow-up-2642-nsec3-iter-kasp' into 'main'
dnssec-policy: reduce NSEC3 iterations to 150

See merge request isc-projects/bind9!4952
2021-04-29 09:32:20 +00:00
Matthijs Mekking
efa5d84dcf dnssec-policy: reduce NSEC3 iterations to 150
When reducing the number of NSEC3 iterations to 150, commit
aa26cde2ae added tests for dnssec-policy
to check that a too high iteration count is a configuration failure.

The test is not sufficient because 151 was always too high for
ECDSAP256SHA256. The test should check for a different algorithm.

There was an existing test case that checks for NSEC3 iterations.
Update the test with the new maximum values.

Update the code in 'kaspconf.c' to allow at most 150 iterations.
2021-04-29 10:41:16 +02:00
Michał Kępień
0fd3c8e48b Merge branch 'v9_17_12-release' into 'main'
Merge 9.17.12 release branch

See merge request isc-projects/bind9!4953
2021-04-29 08:37:11 +00:00
Michał Kępień
0c4694277f Set up release notes for BIND 9.17.13 2021-04-29 10:30:00 +02:00
Michał Kępień
3ea6421c49 Update BIND version to 9.17.12 2021-04-29 10:30:00 +02:00
Michał Kępień
a0618507c4 Add a CHANGES marker 2021-04-29 10:30:00 +02:00
Michał Kępień
628ed23b7c Merge branch 'michal/prepare-documentation-for-bind-9.17.12' into 'security-main'
Prepare documentation for BIND 9.17.12

See merge request isc-private/bind9!280
2021-04-29 10:30:00 +02:00
Michał Kępień
9879d2a6b4 Merge branch '2540-confidential-issue-existing-dname' into 'security-main'
[CVE-2021-25215] Properly answer queries for DNAME records that require the DNAME to be processed to resolve itself

See merge request isc-private/bind9!253
2021-04-29 10:30:00 +02:00
Michał Kępień
a051dd65e2 Prepare release notes for BIND 9.17.12 2021-04-29 10:30:00 +02:00
Michał Kępień
df2edd67da Merge branch '2467-confidential-issue-ixfr-checks' into 'security-main'
[CVE-2021-25214] Prevent malformed incoming zone transfers from producing a zone without an SOA record

See merge request isc-private/bind9!239
2021-04-29 10:30:00 +02:00
Mark Andrews
f1d81d4e89 Add Release Notes entry for [GL #2540] 2021-04-29 10:30:00 +02:00
Michał Kępień
e8d9de39ac Add release note for GL #2490 2021-04-29 10:30:00 +02:00
Mark Andrews
bd8a4a46df Add release note for [GL #2467] 2021-04-29 10:30:00 +02:00
Mark Andrews
a2954c3b57 Add CHANGES entry for [GL #2540] 2021-04-29 10:30:00 +02:00
Michał Kępień
4ac14c4a83 Reorder release notes 2021-04-29 10:30:00 +02:00
Mark Andrews
83ab536a30 Add CHANGES entry for [GL #2467] 2021-04-29 10:30:00 +02:00
Mark Andrews
c1190a3fe0 Handle DNAME lookup via itself
When answering a query, named should never attempt to add the same RRset
to the ANSWER section more than once.  However, such a situation may
arise when chasing DNAME records: one of the DNAME records placed in the
ANSWER section may turn out to be the final answer to a client query,
but there is no way to know that in advance.  Tweak the relevant INSIST
assertion in query_respond() so that it handles this case properly.
qctx->rdataset is freed later anyway, so there is no need to clean it up
in query_respond().
2021-04-29 10:30:00 +02:00
Michał Kępień
3270ac7d9b Tweak and reword release notes 2021-04-29 10:30:00 +02:00
Mark Andrews
5318627227 Unload a zone if a transfer breaks its SOA record
If a zone transfer results in a zone not having any NS records, named
stops serving it because such a zone is broken.  Do the same if an
incoming zone transfer results in a zone lacking an SOA record at the
apex or containing more than one SOA record.
2021-04-29 10:30:00 +02:00
Michał Kępień
d9011c2a4d Tweak and reword recent CHANGES entries 2021-04-29 10:30:00 +02:00
Mark Andrews
2ca0bd882d Address inconsistencies in checking added RRsets
loading_addrdataset() rejects SOA RRsets which are not at top of zone.
addrdataset() should similarly reject such RRsets.
2021-04-29 10:30:00 +02:00
Mark Andrews
01209dfa49 Check SOA owner names in zone transfers
An IXFR containing SOA records with owner names different than the
transferred zone's origin can result in named serving a version of that
zone without an SOA record at the apex.  This causes a RUNTIME_CHECK
assertion failure the next time such a zone is refreshed.  Fix by
immediately rejecting a zone transfer (either an incremental or
non-incremental one) upon detecting an SOA record not placed at the apex
of the transferred zone.
2021-04-29 10:30:00 +02:00
Mark Andrews
0695a42adb Merge branch '2642-reduce-the-maximum-nsec3-iterations-that-can-be-configured' into 'main'
Resolve "Reduce the maximum NSEC3 iterations that can be configured"

Closes #2642

See merge request isc-projects/bind9!4925
2021-04-29 07:39:10 +00:00
Mark Andrews
ca07b8e414 Add Release Note for [GL #2642] 2021-04-29 17:18:26 +10:00
Mark Andrews
e04f06873f Add CHANGES for [GL #2642]
5625.   [func]          Reduce the supported maximum number of iterations
                        that can be configured in an NSEC3 zones to 150.
                        [GL #2642]
2021-04-29 17:18:26 +10:00
Mark Andrews
46eb21c546 Check that excessive iterations in logged by named when
loading an existing zone or transfering from the primary.
2021-04-29 17:18:26 +10:00
Mark Andrews
8ec16c378d Check NSEC3 iterations with dnssec-signzone 2021-04-29 17:18:26 +10:00
Mark Andrews
4ce8437a6e Check that named rejects excessive iterations via UPDATE 2021-04-29 17:18:26 +10:00
Mark Andrews
3fe75d9809 nsupdate: reject attempts to add NSEC3PARAM with excessive iterations 2021-04-29 17:18:26 +10:00
Mark Andrews
c9f5f8a059 Warn if there is excessive NSEC3 iterations 2021-04-29 17:18:26 +10:00
Mark Andrews
aa26cde2ae Check dnssec-policy nsec3param iterations limit 2021-04-29 17:18:26 +10:00
Mark Andrews
29126500d2 Reduce nsec3 max iterations to 150 2021-04-29 17:18:26 +10:00
Matthijs Mekking
51f94b8c7c Merge branch 'matthijs-nit-serve-stale-fixes' into 'main'
Serve-stale nit fixes

See merge request isc-projects/bind9!4940
2021-04-28 10:43:49 +00:00
Matthijs Mekking
104b676235 Serve-stale nit fixes
While working on the serve-stale backports, I noticed the following
oddities:

1. In the serve-stale system test, in one case we keep track of the
   time how long it took for dig to complete. In commit
   aaed7f9d8c, the code removed the
   exception to check for result == ISC_R_SUCCESS on stale found
   answers, and adjusted the test accordingly. This failed to update
   the time tracking accordingly. Move the t1/t2 time track variables
   back around the two dig commands to ensure the lookups resolved
   faster than the resolver-query-timeout.

2. We can remove the setting of NS_QUERYATTR_STALEOK and
   DNS_RDATASETATTR_STALE_ADDED on the "else if (stale_timeout)"
   code path, because they are added later when we know we have
   actually found a stale answer on a stale timeout lookup.

3. We should clear the NS_QUERYATTR_STALEOK flag from the client
   query attributes instead of DNS_RDATASETATTR_STALE_ADDED (that
   flag is set on the rdataset attributes).

4. In 'bin/named/config.c' we should set the configuration options
   in alpabetical order.

5. In the ARM, in the backports we have added "(stale)" between
   "cached" and "RRset" to make more clear a stale RRset may be
   returned in this scenario.
2021-04-28 12:24:24 +02:00
Michał Kępień
7c7b97b916 Merge branch 'michal/limit-logging-for-verbose-system-tests' into 'main'
Limit logging for verbose system tests

See merge request isc-projects/bind9!4812
2021-04-28 06:58:34 +00:00
Michał Kępień
241e85ef0c Warn when log files grow too big in system tests
Exerting excessive I/O load on the host running system tests should be
avoided in order to limit the number of false positives reported by the
system test suite.  In some cases, running named with "-d 99" (which is
the default for system tests) results in a massive amount of logs being
generated, most of which are useless.  Implement a log file size check
to draw developers' attention to overly verbose named instances used in
system tests.  The warning threshold of 200,000 lines was chosen
arbitrarily.
2021-04-28 07:56:47 +02:00
Michał Kępień
17e5c2a50e Prevent useless logging in the "tcp" system test
The regression test for CVE-2020-8620 causes a lot of useless messages
to be logged.  However, globally decreasing the log level for the
affected named instance would be a step too far as debugging information
may be useful for troubleshooting other checks in the "tcp" system test.
Starting a separate named instance for a single check should be avoided
when possible and thus is also not a good solution.  As a compromise,
run "rndc trace 1" for the affected named instance before starting the
regression test for CVE-2020-8620.
2021-04-28 07:56:47 +02:00
Michał Kępień
4a8d404876 Limit logging for verbose system tests
The system test framework starts all named instances with the "-d 99"
command line option (unless it is overridden by a named.args file in a
given instance's working directory).  This causes a lot of log messages
to be written to named.run files - currently over 5 million lines for a
single test suite run.  While debugging information preserved in the log
files is essential for troubleshooting intermittent test failures, some
system tests involve sending hundreds or even thousands of queries,
which causes the relevant log files to explode in size.  When multiple
tests (or even multiple test suites) are run in parallel, excessive
logging contributes considerably to the I/O load on the test host,
increasing the odds of intermittent test failures getting triggered.

Decrease the debug level for the seven most verbose named instances:

  - use "-d 3" for ns2 in the "cacheclean" system test (it is the lowest
    logging level at which the test still passes without the need to
    apply any changes to tests.sh),

  - use "-d 1" for the other six named instances.

This roughly halves the number of lines logged by each test suite run
while still leaving enough information in the logs to allow at least
basic troubleshooting in case of test failures.

This approach was chosen as it results in a greater decrease in the
number of lines logged than running all named instances with "-d 3",
without causing any test failures.
2021-04-28 07:56:47 +02:00
Diego dos Santos Fronza
99a4f6119a Merge branch '2529-add-__attribute__-malloc-for-isc_mempool_get' into 'main'
Resolve "Add __attribute__((malloc)) for isc_mempool_get"

Closes #2529

See merge request isc-projects/bind9!4858
2021-04-26 14:50:15 +00:00
Diego Fronza
54aa60eef8 Add malloc attribute to memory allocation functions
The malloc attribute allows compiler to do some optmizations on
functions that behave like malloc/calloc, like assuming that the
returned pointer do not alias other pointers.
2021-04-26 11:32:17 -03:00
Diego Fronza
efb9c540cd Removed unnecessary check (mpctx->items == NULL)
There is no possibility for mpctx->items to be NULL at the point where
the code was removed, since we enforce that fillcount > 0, if
mpctx->items == NULL when isc_mempool_get is called, then we will
allocate fillcount more items and add to the mpctx->items list.
2021-04-26 11:32:17 -03:00
Diego dos Santos Fronza
19df09d225 Merge branch '2564-nslookup-segfaults-for-servfail' into 'main'
Add workaround for "nslookup segfaults for SERVFAIL"

See merge request isc-projects/bind9!4796
2021-04-26 14:30:46 +00:00
Mark Andrews
f2d00069c3 Add CHANGES note for [GL #2564] 2021-04-26 11:15:25 -03:00
Diego Fronza
4d6408b823 Fix following up lookup failure if more resolvers are available
_query_detach function was incorrectly unliking the query object from
the lookup->q query list, this made it impossible to follow a query
lookup failure with the next one in the list (possibly using a separate
resolver), as the link to the next query in the list was dissolved.

Fix by unliking the node only when the query object is about to be
destroyed, i.e. there is no more references to the object.
2021-04-26 11:14:14 -03:00
Michał Kępień
3793733704 Merge branch '2650-handle-soa-rrsigs-not-at-zone-apex' into 'main'
Handle RRSIG(SOA) RRsets not at zone apex

Closes #2650

See merge request isc-projects/bind9!4936
2021-04-26 11:06:00 +00:00
Matthijs Mekking
a64dd511f4 Merge branch '2628-kasp-create-multiple-key-keyid-conflict' into 'main'
Check for keyid conflicts between new keys

Closes #2628

See merge request isc-projects/bind9!4886
2021-04-26 09:29:19 +00:00
Matthijs Mekking
b99ec65745 Changes and release notes for [#2628] 2021-04-26 10:43:39 +02:00
Matthijs Mekking
668301f138 Check for keyid conflicts between new keys
When the keymgr needs to create new keys, it is possible it needs to
create multiple keys. The keymgr checks for keyid conflicts with
already existing keys, but it should also check against that it just
created.
2021-04-26 10:42:46 +02:00
Michał Kępień
c84399df64 Merge branch '2634-test-tkey-gssapi-credential-conditionally' into 'main'
Test "tkey-gssapi-credential" conditionally

Closes #2634

See merge request isc-projects/bind9!4938
2021-04-26 07:17:12 +00:00
Michał Kępień
a3957af864 Test "--without-gssapi" in GitLab CI
GitLab CI pipelines do not currently include a Linux job that would have
GSSAPI support disabled.  Add the "--without-gssapi" option to the
./configure invocation on Debian 9 to address that deficiency and also
to continuously test that build-time switch.
2021-04-26 07:16:38 +02:00
Michał Kępień
6feac68b50 Test "tkey-gssapi-credential" conditionally
If "tkey-gssapi-credential" is set in the configuration and GSSAPI
support is not available, named will refuse to start.  As the test
system framework does not support starting named instances
conditionally, ensure that "tkey-gssapi-credential" is only present in
named.conf if GSSAPI support is available.
2021-04-26 07:16:38 +02:00
Mark Andrews
a26e29896a Merge branch 'marka-shutdown-sync' into 'main'
shutdown: wait for named to start

See merge request isc-projects/bind9!4921
2021-04-24 04:36:45 +00:00
Mark Andrews
8d5870f9df Wait for named to start
If we don't wait for named to finish starting, 'rndc stop' may
fail due to the listen limit being reached in named leading
to a false negative test
2021-04-24 01:19:47 +00:00
Evan Hunt
f8275c30da Merge branch 'each-timeout-recovery' into 'main'
ensure read timeouts are recoverable

See merge request isc-projects/bind9!4930
2021-04-23 17:26:05 +00:00
Artem Boldariev
62033110b9 Use a constant for timeouts in soft-timeout tests
It makes it easier to change the value should the need arise.
2021-04-23 10:01:42 -07:00
Evan Hunt
7f367b0c7f use the correct handle when calling the read callback
when calling isc_nm_read() on an HTTP socket, the read callback
was being run with the incorrect handle. this has been corrected.
2021-04-23 10:01:42 -07:00
Evan Hunt
f0d75ee7c3 fix DOH timeout recovery
as with TLS, the destruction of a client stream on failed read
needs to be conditional: if we reached failed_read_cb() as a
result of a timeout on a timer which has subsequently been
reset, the stream must not be closed.
2021-04-23 10:01:42 -07:00
Michał Kępień
47a7b042e5 Add CHANGES entry 2021-04-23 14:26:48 +02:00
Michał Kępień
24bf4b946a Test handling of non-apex RRSIG(SOA) RRsets
Add a check to the "dnssec" system test which ensures that RRSIG(SOA)
RRsets present anywhere else than at the zone apex are automatically
removed after a zone containing such RRsets is loaded.
2021-04-23 14:26:48 +02:00
Mark Andrews
b7cdc3583e Be more precise with the stopping conditions in zone_resigninc
If there happens to be a RRSIG(SOA) that is not at the zone apex
for any reason it should not be considered as a stopping condition
for incremental zone signing.
2021-04-23 14:26:48 +02:00
Evan Hunt
b258df8562 add HTTP timeout recovery test
NOTE: this test currently fails
2021-04-22 12:40:04 -07:00
Evan Hunt
23ec011298 fix TLS timeout recovery
the destruction of the socket in tls_failed_read_cb() needs to be
conditional; if reached due to a timeout on a timer that has
subsequently been reset, the socket must not be destroyed.
2021-04-22 12:08:04 -07:00
Evan Hunt
c90da99180 fix TCP timeout recovery
removed an unnecessary assert in the failed_read_cb() function.
also renamed to isc__nm_tcp_failed_read_cb() to match the practice
in other modules.
2021-04-22 12:08:04 -07:00
Evan Hunt
25ef0547a9 add TCP and TLS timeout recovery tests
NOTE: currently these tests fail
2021-04-22 12:08:04 -07:00
Evan Hunt
52f256f9ae add TCPDNS and TLSDNS timeout recovery tests
this is similar in structure to the UDP timeout recovery test.

this commit adds a new mechanism to the netmgr test allowing the
listen socket to accept incoming TCP connections but never send
a response. this forces the client to time out on read.
2021-04-22 12:08:04 -07:00
Evan Hunt
bcf5b2a675 run read callbacks synchronously on timeout
when running read callbacks, if the event result is not ISC_R_SUCCESS,
the callback is always run asynchronously. this is a problem on timeout,
because there's no chance to reset the timer before the socket has
already been destroyed. this commit allows read callbacks to run
synchronously for both ISC_R_SUCCESS and ISC_R_TIMEDOUT result codes.
2021-04-22 12:08:04 -07:00
Evan Hunt
609975ad20 add a UDP timeout recovery test
this test sets up a server socket that listens for UDP connections
but never responds. the client will always time out; it should retry
five times before giving up.
2021-04-22 12:08:04 -07:00
Evan Hunt
1f41d59a5e allow client read callback to be assignable
allow netmgr client tests to choose the function that will be
used as a read callback, without having to write a different
connect callback handler.
2021-04-22 12:08:04 -07:00
Diego dos Santos Fronza
289d7c2acc Merge branch '2626-deadlock-with-concurrent-rndc-addzone-rndc-delzone-commands' into 'main'
Resolve "Deadlock with concurrent `rndc addzone`/`rndc delzone` commands"

Closes #2626

See merge request isc-projects/bind9!4904
2021-04-22 15:47:16 +00:00
Diego Fronza
6646655067 Add CHANGES note for GL #2626 2021-04-22 15:45:55 +00:00
Diego Fronza
d6224035d8 Add system test for the deadlock fix
The test spawns 4 parallel workers that keep adding, modifying and
deleting zones, the main thread repeatedly checks wheter rndc
status responds within a reasonable period.

While environment and timing issues may affect the test, in most
test cases the deadlock that was taking place before the fix used to
trigger in less than 7 seconds in a machine with at least 2 cores.
2021-04-22 15:45:55 +00:00
Diego Fronza
9298dcebbd Fix deadlock between rndc addzone/delzone/modzone
It follows a description of the steps that were leading to the deadlock:

1. `do_addzone` calls `isc_task_beginexclusive`.

2. `isc_task_beginexclusive` waits for (N_WORKERS - 1) halted tasks,
   this blocks waiting for those (no. workers -1) workers to halt.
...
isc_task_beginexclusive(isc_task_t *task0) {
    ...
	while (manager->halted + 1 < manager->workers) {
		wake_all_queues(manager);
		WAIT(&manager->halt_cond, &manager->halt_lock);
	}
```

3. It is possible that in `task.c / dispatch()` a worker is running a
   task event, if that event blocks it will not allow this worker to
   halt.

4. `do_addzone` acquires `LOCK(&view->new_zone_lock);`,

5. `rmzone` event is called from some worker's `dispatch()`, `rmzone`
   blocks waiting for the same lock.

6. `do_addzone` calls `isc_task_beginexclusive`.

7. Deadlock triggered, since:
	- `rmzone` is wating for the lock.
	- `isc_task_beginexclusive` is waiting for (no. workers - 1) to
	   be halted
	- since `rmzone` event is blocked it won't allow the worker to halt.

To fix this, we updated do_addzone code to call isc_task_beginexclusive
before the lock is acquired, we postpone locking to the nearest required
place, same for isc_task_beginexclusive.

The same could happen with rndc modzone, so that was addressed as well.
2021-04-22 15:45:55 +00:00
Petr Špaček
fa6b277b8d Merge branch '2634-test-tkey-gssapi-credential' into 'main'
Add tests for the "tkey-gssapi-credential" option

See merge request isc-projects/bind9!4905
2021-04-22 15:25:36 +00:00
Petr Špaček
1746d2e84a Add tests for the "tkey-gssapi-credential" option
Four named instances in the "nsupdate" system test have GSS-TSIG support
enabled.  All of them currently use "tkey-gssapi-keytab".  Configure two
of them with "tkey-gssapi-credential" to test that option.

As "tkey-gssapi-keytab" and "tkey-gssapi-credential" both provide the
same functionality, no test modifications are required.  The difference
between the two options is that the value of "tkey-gssapi-keytab" is an
explicit path to the keytab file to acquire credentials from, while the
value of "tkey-gssapi-credential" is the name of the principal whose
credentials should be used; those credentials are looked up in the
keytab file expected by the Kerberos library, i.e. /etc/krb5.keytab by
default.  The path to the default keytab file can be overridden using by
setting the KRB5_KTNAME environment variable.  Utilize that variable to
use existing keytab files with the "tkey-gssapi-credential" option.

The KRB5_KTNAME environment variable should not interfere with the
"tkey-gssapi-keytab" option.  Nevertheless, rename one of the keytab
files used with "tkey-gssapi-keytab" to something else than the contents
of the KRB5_KTNAME environment variable in order to make sure that both
"tkey-gssapi-keytab" and "tkey-gssapi-credential" are actually tested.
2021-04-22 16:15:22 +02:00
Ondřej Surý
c38bcb6968 Merge branch 'ondrej/autoconf-2.71-fixes' into 'main'
Update the configure.ac for autoconf >= 2.71 compatibility

See merge request isc-projects/bind9!4899
2021-04-22 12:41:11 +00:00
Ondřej Surý
f52872c3ed Update the configure.ac for autoconf >= 2.71 compatibility
This mostly removes stuff that's either deprecated, obsolete or not used
at all:

* Update the minimal autoconf version to 2.69
* AC_PROG_CC_C99 is deprecated, just use AC_PROG_CC as we require C11
  anyway
* AC_HEADER_TIME is deprecated, both <sys/time.h> and <time.h> can be
  included at the same time, and we don't use the macros that
  AC_HEADER_TIME defines anywhere
* AC_HEADER_STDC checks for ISO C90 and we require at least C11
* Replace AC_TRY_*([]) with AC_*_IFELSE([AC_LANG_PROGRAM()])
* Update m4/ax_check_openssl.m4 from serial 10 to serial 11
* Update m4/ax_gcc_func_attribute.m4 from serial 10 to serial 13
* Update m4/ax_pthread.m4 from serial 24 to serial 30
* Add early AC_CANONICAL_TARGET call to prevent warning from AX_PTHREAD
2021-04-22 13:52:40 +02:00
Mark Andrews
fdf5184bf5 Merge branch '2625-the-shutdown-system-test-is-not-capturing-enough' into 'main'
Resolve "The shutdown system test is not capturing enough"

Closes #2625

See merge request isc-projects/bind9!4883
2021-04-22 06:47:21 +00:00
Mark Andrews
c3c7f5849c Abort named if 'rndc stop' or 'kill TERM' has failed to shutdown 2021-04-22 05:43:00 +00:00
Ondřej Surý
60bf42b3e1 Merge branch '2638-run-internal-tasks-on-top-of-network-manager-worker-loops' into 'main'
Refactor taskmgr to run on top of netmgr

Closes #2638

See merge request isc-projects/bind9!4918
2021-04-20 22:16:42 +00:00
Ondřej Surý
f022d2db8c Add CHANGES and release note for [GL #2638] 2021-04-20 23:22:28 +02:00
Ondřej Surý
b540722bc3 Refactor taskmgr to run on top of netmgr
This commit changes the taskmgr to run the individual tasks on the
netmgr internal workers.  While an effort has been put into keeping the
taskmgr interface intact, couple of changes have been made:

 * The taskmgr has no concept of universal privileged mode - rather the
   tasks are either privileged or unprivileged (normal).  The privileged
   tasks are run as a first thing when the netmgr is unpaused.  There
   are now four different queues in in the netmgr:

   1. priority queue - netievent on the priority queue are run even when
      the taskmgr enter exclusive mode and netmgr is paused.  This is
      needed to properly start listening on the interfaces, free
      resources and resume.

   2. privileged task queue - only privileged tasks are queued here and
      this is the first queue that gets processed when network manager
      is unpaused using isc_nm_resume().  All netmgr workers need to
      clean the privileged task queue before they all proceed normal
      operation.  Both task queues are processed when the workers are
      finished.

   3. task queue - only (traditional) task are scheduled here and this
      queue along with privileged task queues are process when the
      netmgr workers are finishing.  This is needed to process the task
      shutdown events.

   4. normal queue - this is the queue with netmgr events, e.g. reading,
      sending, callbacks and pretty much everything is processed here.

 * The isc_taskmgr_create() now requires initialized netmgr (isc_nm_t)
   object.

 * The isc_nm_destroy() function now waits for indefinite time, but it
   will print out the active objects when in tracing mode
   (-DNETMGR_TRACE=1 and -DNETMGR_TRACE_VERBOSE=1), the netmgr has been
   made a little bit more asynchronous and it might take longer time to
   shutdown all the active networking connections.

 * Previously, the isc_nm_stoplistening() was a synchronous operation.
   This has been changed and the isc_nm_stoplistening() just schedules
   the child sockets to stop listening and exits.  This was needed to
   prevent a deadlock as the the (traditional) tasks are now executed on
   the netmgr threads.

 * The socket selection logic in isc__nm_udp_send() was flawed, but
   fortunatelly, it was broken, so we never hit the problem where we
   created uvreq_t on a socket from nmhandle_t, but then a different
   socket could be picked up and then we were trying to run the send
   callback on a socket that had different threadid than currently
   running.
2021-04-20 23:22:28 +02:00
Ondřej Surý
ae9edb1861 Merge branch '2630-tsan-error-in-xfrin-c' into 'main'
Prevent the double xfrin_fail() call

Closes #2630

See merge request isc-projects/bind9!4898
2021-04-20 12:13:35 +00:00
Ondřej Surý
30252aed88 Add CHANGES note for [GL #2630] 2021-04-20 14:12:26 +02:00
Ondřej Surý
6cf6de55bc Prevent the double xfrin_fail() call
When we are reading from the xfrin socket, and the transfer would be
shutdown, the shutdown function would call `xfrin_fail()` which in turns
calls `xfrin_cancelio()` that causes the read callback to be invoked
with `ISC_R_CANCELED` status code and that caused yet another
`xfrin_fail()` call.

The fix here is to ensure the `xfrin_fail()` would be run only once
properly using better synchronization on xfr->shuttingdown flag.
2021-04-20 14:12:26 +02:00
Ondřej Surý
27960e4208 Merge branch '2637-threadsanitizer-lock-order-inversion-potential-deadlock-in-zone_refreshkeys' into 'main'
Fix lock-order-inversion (potential deadlock) in dns_resolver_createfetch

Closes #2637

See merge request isc-projects/bind9!4909
2021-04-19 20:29:56 +00:00
Ondřej Surý
25d27851d8 Fix lock-order-inversion (potential deadlock) in dns_resolver_createfetch
There's a lock-order-inversion when running `zone_maintenance()` from
the timer while shutting down the server `shutdown_server()`.  This only
happens when the taskmgr scheduling is more relaxed and paralellized,
but the issue is real nevertheless.

The associated ThreadSanitizer warning:

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
      Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000000) => M1

      Mutex M2 acquired here while holding mutex M1 in thread T1:
	#0 pthread_mutex_lock <null>
	#1 dns_view_findzonecut lib/dns/view.c:1326:2
	#2 fctx_create lib/dns/resolver.c:5144:13
	#3 dns_resolver_createfetch lib/dns/resolver.c:10977:12
	#4 zone_refreshkeys lib/dns/zone.c:10830:13
	#5 zone_maintenance lib/dns/zone.c:11065:5
	#6 zone_timer lib/dns/zone.c:14652:2
	#7 task_run lib/isc/task.c:857:5
	#8 isc_task_run lib/isc/task.c:944:10
	#9 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#10 process_netievent lib/isc/netmgr/netmgr.c
	#11 process_queue lib/isc/netmgr/netmgr.c:885:8
	#12 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#13 process_queues lib/isc/netmgr/netmgr.c:772:7
	#14 async_cb lib/isc/netmgr/netmgr.c:671:2
	#15 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#16 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#17 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#18 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#19 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M1 previously acquired by the same thread here:
	#0 pthread_mutex_lock <null>
	#1 zone_refreshkeys lib/dns/zone.c:10717:2
	#2 zone_maintenance lib/dns/zone.c:11065:5
	#3 zone_timer lib/dns/zone.c:14652:2
	#4 task_run lib/isc/task.c:857:5
	#5 isc_task_run lib/isc/task.c:944:10
	#6 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#7 process_netievent lib/isc/netmgr/netmgr.c
	#8 process_queue lib/isc/netmgr/netmgr.c:885:8
	#9 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#10 process_queues lib/isc/netmgr/netmgr.c:772:7
	#11 async_cb lib/isc/netmgr/netmgr.c:671:2
	#12 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#13 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#14 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#15 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#16 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M1 acquired here while holding mutex M2 in thread T2:
	#0 pthread_mutex_lock <null>
	#1 dns_zone_flush lib/dns/zone.c:11443:2
	#2 view_flushanddetach lib/dns/view.c:657:5
	#3 dns_view_flushanddetach lib/dns/view.c:690:2
	#4 shutdown_server bin/named/server.c:10056:4
	#5 task_run lib/isc/task.c:857:5
	#6 isc_task_run lib/isc/task.c:944:10
	#7 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#8 process_netievent lib/isc/netmgr/netmgr.c
	#9 process_queue lib/isc/netmgr/netmgr.c:885:8
	#10 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#11 process_queues lib/isc/netmgr/netmgr.c:772:7
	#12 async_cb lib/isc/netmgr/netmgr.c:671:2
	#13 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#14 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#15 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#16 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#17 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M2 previously acquired by the same thread here:
	#0 pthread_mutex_lock <null>
	#1 view_flushanddetach lib/dns/view.c:645:3
	#2 dns_view_flushanddetach lib/dns/view.c:690:2
	#3 shutdown_server bin/named/server.c:10056:4
	#4 task_run lib/isc/task.c:857:5
	#5 isc_task_run lib/isc/task.c:944:10
	#6 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#7 process_netievent lib/isc/netmgr/netmgr.c
	#8 process_queue lib/isc/netmgr/netmgr.c:885:8
	#9 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#10 process_queues lib/isc/netmgr/netmgr.c:772:7
	#11 async_cb lib/isc/netmgr/netmgr.c:671:2
	#12 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#13 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#14 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#15 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#16 isc__trampoline_run lib/isc/trampoline.c:184:11

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:79:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:303:3
	#3 create_managers bin/named/main.c:957:15
	#4 setup bin/named/main.c:1267:11
	#5 main bin/named/main.c:1558:2

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:79:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:303:3
	#3 create_managers bin/named/main.c:957:15
	#4 setup bin/named/main.c:1267:11
	#5 main bin/named/main.c:1558:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in __interceptor_pthread_mutex_lock
2021-04-19 22:29:14 +02:00
Ondřej Surý
3f0c8189e7 Merge branch 'ondrej/cleanup-ISCAPI-remnants' into 'main'
Cleanup the public vs private ISCAPI remnants

See merge request isc-projects/bind9!4911
2021-04-19 11:48:14 +00:00
Ondřej Surý
16fe0d1f41 Cleanup the public vs private ISCAPI remnants
Since all the libraries are internal now, just cleanup the ISCAPI remnants
in isc_socket, isc_task and isc_timer APIs.  This means, there's one less
layer as following changes have been done:

 * struct isc_socket and struct isc_socketmgr have been removed
 * struct isc__socket and struct isc__socketmgr have been renamed
   to struct isc_socket and struct isc_socketmgr
 * struct isc_task and struct isc_taskmgr have been removed
 * struct isc__task and struct isc__taskmgr have been renamed
   to struct isc_task and struct isc_taskmgr
 * struct isc_timer and struct isc_timermgr have been removed
 * struct isc__timer and struct isc__timermgr have been renamed
   to struct isc_timer and struct isc_timermgr
 * All the associated code that dealt with typing isc_<foo>
   to isc__<foo> and back has been removed.
2021-04-19 13:18:24 +02:00
Ondřej Surý
5937c1f787 Merge branch 'ondrej/fixup-bin/tests/system/resolve-win32-directories' into 'main'
Fixup win32 paths for moved bin/tests/system/resolve

See merge request isc-projects/bind9!4916
2021-04-19 11:15:12 +00:00
Ondřej Surý
f14e678624 Fixup win32 paths for moved bin/tests/system/resolve
When resolve.c was moved from lib/samples to bin/tests/system, the
resolve.vcxproj.in would still contain old paths to the directory
root. This commit adds one more ..\ to match the directory depth.

Additionally, fixup the path in BINDInstall.vcxproj.in to be
bin/tests/system and not bin/tests/samples.
2021-04-19 12:51:33 +02:00
Ondřej Surý
11d3c475bd Merge branch '2636-timing-race-in-setnsec3param-task' into 'main'
Fix task timing race in setnsec3param()

Closes #2636

See merge request isc-projects/bind9!4908
2021-04-19 09:22:31 +00:00
Ondřej Surý
0127ba6472 Fix task timing race in setnsec3param()
When setnsec3param() is schedule from zone_postload() there's no
guarantee that `zone->db` is not `NULL` yet.  Thus when the
setnsec3param() is called, we need to check for `zone->db` existence and
reschedule the task, because calling `rss_post()` on a zone with empty
`.db` ends up with no-op (the function just returns).
2021-04-19 11:16:51 +02:00
Ondřej Surý
c216ace42a Merge branch 'ondrej/cleanup-double-createinctx-constructors' into 'main'
Cleanup the isc_<*>mgr_createinc() constructors

See merge request isc-projects/bind9!4910
2021-04-19 08:26:32 +00:00
Ondřej Surý
3388ef36b3 Cleanup the isc_<*>mgr_createinc() constructors
Previously, the taskmgr, timermgr and socketmgr had a constructor
variant, that would create the mgr on top of existing appctx.  This was
no longer true and isc_<*>mgr was just calling isc_<*>mgr_create()
directly without any extra code.

This commit just cleans up the extra function.
2021-04-19 10:22:56 +02:00
Mark Andrews
eb32677de5 Merge branch 'marka-initialise-resarg-lock' into 'main'
properly initialise resarg->lock

See merge request isc-projects/bind9!4907
2021-04-19 04:59:39 +00:00
Mark Andrews
eadb829dac properly initialise resarg->lock 2021-04-19 14:32:40 +10:00
Ondřej Surý
48c703e3d6 Merge branch 'each-cleanup-dns_client' into 'main'
clean up dns_client and related samples

See merge request isc-projects/bind9!4835
2021-04-16 13:35:44 +00:00
Evan Hunt
07e349de3c Add CHANGES note for [GL !4835] 2021-04-16 14:31:10 +02:00
Evan Hunt
d0ec7d1f33 move samples/resolve.c to bin/tests/system
"resolve" is used by the resolver system tests, and I'm not
certain whether delv exercises the same code, so rather than
remove it, I moved it to bin/tests/system.
2021-04-16 14:29:43 +02:00
Evan Hunt
056afe7bdc remove sample-async
sample code for export libraries is no longer needed and
this code is not used for any internal tests. also, sample-gai.c
had already been removed but there were some dangling references.
2021-04-16 14:29:43 +02:00
Evan Hunt
568d455c99 rename dns_client_createx() to dns_client_create()
there's no longer a need to use an alternate name.
2021-04-16 14:29:43 +02:00
Evan Hunt
1beb05f3e2 remove dns_client_request() and related code
continues the cleanup of dns_client started in the previous commit.
2021-04-16 14:29:43 +02:00
Evan Hunt
fb2a352e7c remove dns_client_update() and related code
the libdns client API is no longer being maintained for
external use, we can remove the code that isn't being used
internally, as well as the related tests.
2021-04-16 14:29:43 +02:00
Michał Kępień
409883adbd Merge branch '2634-placeholder' into 'main'
Add placeholder for GL #2634

See merge request isc-projects/bind9!4901
2021-04-16 12:20:37 +00:00
Michał Kępień
cd91f1c189 Add placeholder for GL #2634 2021-04-16 14:16:57 +02:00
Ondřej Surý
1ab099aa3b Merge branch '2623-9-16-13-overwrites-master-files-if-old-format-jnl-files-are-present' into 'main'
Resolve "9.16.13 overwrites master files if old format .jnl files are present"

Closes #2623

See merge request isc-projects/bind9!4880
2021-04-16 11:12:19 +00:00
Mark Andrews
3df637fb83 Add CHANGES and release note for [GL #2623] 2021-04-16 12:04:06 +02:00
Ondřej Surý
55b942b4a0 Refactor dns_journal_rollforward() to work over opened journal
Too much logic was cramped inside the dns_journal_rollforward() that
made it harder to follow.  The dns_journal_rollforward() was refactored
to work over already opened journal and some of the previous logic was
moved to new static zone_journal_rollforward() that separates the
journal "rollforward" logic from the "zone" logic.
2021-04-16 12:04:06 +02:00
Mark Andrews
ec7a9af381 Fixing a recoverable journal should not result in the zone being written
when dns_journal_rollforward returned ISC_R_RECOVERABLE the distintion
between 'up to date' and 'success' was lost, as a consequence
zone_needdump() was called writing out the zone file when it shouldn't
have been.   This change restores that distintion.  Adjust system
test to reflect visible changes.
2021-04-16 11:15:46 +02:00
Artem Boldariev
10ba2a40e2 Merge branch 'artem/move-tls-tests-into-netmgr-tests' into 'main'
Merge the tls_test.c into netmgr_test.c and extend the tests suite

See merge request isc-projects/bind9!4893
2021-04-15 14:03:14 +00:00
Artem Boldariev
66432dcd65 Handle a situation when SSL shutdown messages were sent and received
It fixes a corner case which was causing dig to print annoying
messages like:

14-Apr-2021 18:48:37.099 SSL error in BIO: 1 TLS error (errno:
0). Arguments: received_data: (nil), send_data: (nil), finish: false

even when all the data was properly processed.
2021-04-15 15:49:36 +03:00
Artem Boldariev
513cdb52ec TLS: try to close TCP socket descriptor earlier when possible
Before this fix underlying TCP sockets could remain opened for longer
than it is actually required, causing unit tests to fail with lots of
ISC_R_TOOMANYOPENFILES errors.

The change also enables graceful SSL shutdown (before that it  would
happen only in the case when isc_nm_cancelread() were called).
2021-04-15 15:49:36 +03:00
Ondřej Surý
202b1d372d Merge the tls_test.c into netmgr_test.c and extend the tests suite
This commit merges TLS tests into the common Network Manager unit
tests suite and extends the unit test framework to include support for
additional "ping-pong" style tests where all data could be sent via
lesser number of connections (the behaviour of the old test
suite). The tests for TCP and TLS were extended to make use of the new
mode, as this mode better translates to how the code is used in DoH.

Both TLS and TCP tests now share most of the unit tests' code, as they
are expected to function similarly from a users's perspective anyway.

Additionally to the above, the TLS test suite was extended to include
TLS tests using the connections quota facility.
2021-04-15 15:49:36 +03:00
Matthijs Mekking
2aad659550 Merge branch 'matthijs-keymgr2kasp-rework' into 'main'
Update keymgr2kasp system test

Closes #2631

See merge request isc-projects/bind9!4894
2021-04-15 12:45:25 +00:00
Matthijs Mekking
0de5a576c5 Fix view-related issues in the "keymgr2kasp" test
Due to the lack of "match-clients" clauses in ns4/named2.conf.in, the
same view is incorrectly chosen for all queries received by ns4 in the
"keymgr2kasp" system test.  This causes only one version of the
"view-rsasha256.kasp" zone to actually be checked.  Add "match-clients"
clauses to ns4/named2.conf.in to ensure the test really checks what it
claims to.

Use identical view names ("ext", "int") in ns4/named.conf.in and
ns4/named2.conf.in so that it is easier to quickly identify the
differences between these two files.

Update tests.sh to account for the above changes.  Also fix a copy-paste
error in a comment to prevent confusion.
2021-04-15 10:05:52 +02:00
Matthijs Mekking
ee02453a2e Merge branch '1100-inline-signing-include' into 'main'
Resolve "Test inline-signing with $INCLUDE"

Closes #1100

See merge request isc-projects/bind9!4825
2021-04-14 09:35:35 +00:00
Matthijs Mekking
bad5c3cf7c Document relative path of $INCLUDE
Add to the ARM from where relative paths are searched.
2021-04-14 10:04:40 +02:00
Matthijs Mekking
96583e7c40 Fix inline test with missing $INCLUDE
The test case for a zone with a missing include file was wrong for two
reasons:
1. It was loading the wrong file (master5 instead of master6)
2. It did actually not set the $ret variable to 1 if the test failed
   (it should default to ret=1 and clear the variable if the
   appropriate log is found).
2021-04-14 10:04:40 +02:00
Matthijs Mekking
6463ee0f40 Add inline-signing with $INCLUDE test
Add a test case for inline-signing for a zone with an $INCLUDE
statement. There is already a test for a missing include file, this
one adds a test for a zone with an include file that does exist.

Test if the record in the included file is loaded.
2021-04-14 10:04:40 +02:00
Matthijs Mekking
bb01030252 Merge branch '2347-draft-vandijk-dnsop-nsec-ttl' into 'main'
Implement draft-vandijk-dnsop-nsec-ttl

Closes #2347

See merge request isc-projects/bind9!4506
2021-04-13 12:14:53 +00:00
Matthijs Mekking
8fcbef2423 Small refactor lib/dns/zone.c
Introduce some macros that can be reused in 'zone_load_soa_rr()' and
'zone_get_from_db()' to make those functions more readable.
2021-04-13 11:26:26 +02:00
Matthijs Mekking
032110bd2e Use designated initializer in dns_zone_create
Shorten the code and make it less prone to initialisation errors
(it is still easy to forget adding an initializer, but it now defaults
to 0).
2021-04-13 11:26:26 +02:00
Matthijs Mekking
3b68dd426f Add change entry and release note for [#2347] 2021-04-13 11:26:26 +02:00
Matthijs Mekking
9af8caa733 Implement draft-vandijk-dnsop-nsec-ttl
The draft says that the NSEC(3) TTL must have the same TTL value
as the minimum of the SOA MINIMUM field and the SOA TTL. This was
always the intended behaviour.

Update the zone structure to also track the SOA TTL. Whenever we
use the MINIMUM value to determine the NSEC(3) TTL, use the minimum
of MINIMUM and SOA TTL instead.

There is no specific test for this, however two tests need adjusting
because otherwise they failed: They were testing for NSEC3 records
including the TTL. Update these checks to use 600 (the SOA TTL),
rather than 3600 (the SOA MINIMUM).
2021-04-13 11:26:26 +02:00
Matthijs Mekking
8ffb4b0a13 Merge branch '2289-cache-dump-stale-ttl-weird-values' into 'main'
Fix nonsensical stale TTL values in cache dump

Closes #2289

See merge request isc-projects/bind9!4799
2021-04-13 08:54:49 +00:00
Matthijs Mekking
a83c8cb0af Use stale TTL as RRset TTL in dumpdb
It is more intuitive to have the countdown 'max-stale-ttl' as the
RRset TTL, instead of 0 TTL. This information was already available
in a comment "; stale (will be retained for x more seconds", but
Support suggested to put it in the TTL field instead.
2021-04-13 09:48:20 +02:00
Matthijs Mekking
debee6157b Check staleness in bind_rdataset
Before binding an RRset, check the time and see if this record is
stale (or perhaps even ancient). Marking a header stale or ancient
happens only when looking up an RRset in cache, but binding an RRset
can also happen on other occasions (for example when dumping the
database).

Check the time and compare it to the header. If according to the
time the entry is stale, but not ancient, set the STALE attribute.
If according to the time is ancient, set the ANCIENT attribute.

We could mark the header stale or ancient here, but that requires
locking, so that's why we only compare the current time against
the rdh_ttl.

Adjust the test to check the dump-db before querying for data. In the
dumped file the entry should be marked as stale, despite no cache
lookup happened since the initial query.
2021-04-13 09:48:20 +02:00
Matthijs Mekking
2a5e0232ed Fix nonsensical stale TTL values in cache dump
When introducing change 5149, "rndc dumpdb" started to print a line
above a stale RRset, indicating how long the data will be retained.

At that time, I thought it should also be possible to load
a cache from file. But if a TTL has a value of 0 (because it is stale),
stale entries wouldn't be loaded from file. So, I added the
'max-stale-ttl' to TTL values, and adjusted the $DATE accordingly.

Since we actually don't have a "load cache from file" feature, this
is premature and is causing confusion at operators. This commit
changes the 'max-stale-ttl' adjustments.

A check in the serve-stale system test is added for a non-stale
RRset (longttl.example) to make sure the TTL in cache is sensible.

Also, the comment above stale RRsets could have nonsensical
values. A possible reason why this may happen is when the RRset was
marked a stale but the 'max-stale-ttl' has passed (and is actually an
RRset awaiting cleanup). This would lead to the "will be retained"
value to be negative (but since it is stored in an uint32_t, you would
get a nonsensical value (e.g. 4294362497).

To mitigate against this, we now also check if the header is not
ancient. In addition we check if the stale_ttl would be negative, and
if so we set it to 0. Most likely this will not happen because the
header would already have been marked ancient, but there is a possible
race condition where the 'rdh_ttl + serve_stale_ttl' has passed,
but the header has not been checked for staleness.
2021-04-13 09:48:20 +02:00
Mark Andrews
1941ce99d4 Merge branch '2622-command-line-option-l-not-shown-with-usage-message' into 'main'
Resolve "Command-line option -L not shown with usage message"

Closes #2622

See merge request isc-projects/bind9!4881
2021-04-13 01:33:28 +00:00
Mark Andrews
38449de93b Update named's usage description 2021-04-12 12:07:44 +10:00
Michał Kępień
b64af491bf Merge branch 'michal/add-placeholder-entries-to-CHANGES' into 'main'
Add placeholders for GL #2467, GL #2540, GL #2604

See merge request isc-projects/bind9!4878
2021-04-08 11:10:54 +00:00
Michał Kępień
0874242db6 Add placeholders for GL #2467, GL #2540, GL #2604 2021-04-08 13:06:57 +02:00
Michał Kępień
b517108cbc Merge branch '2578-rework-get_ports.sh-to-make-it-not-use-a-lock-file' into 'main'
Rework get_ports.sh to make it not use a lock file

Closes #2578

See merge request isc-projects/bind9!4801
2021-04-08 09:37:51 +00:00
Michał Kępień
c3718b926b Use the same port selection method on all systems
When system tests are run on Windows, they are assigned port ranges that
are 100 ports wide and start from port number 5000.  This is a different
port assignment method than the one used on Unix systems.  Drop the "-p"
command line option from bin/tests/system/run.sh invocations used for
starting system tests on Windows to unify the port assignment method
used across all operating systems.
2021-04-08 11:12:37 +02:00
Michał Kępień
31e5ca4bd9 Rework get_ports.sh to make it not use a lock file
The get_ports.sh script is used for determining the range of ports a
given system test should use.  It first determines the start of the port
range to return (the base port); it can either be specified explicitly
by the caller or chosen randomly.  Subsequent ports are picked
sequentially, starting from the base port.  To ensure no single port is
used by multiple tests, a state file (get_ports.state) containing the
last assigned port is maintained by the script.  Concurrent access to
the state file is protected by a lock file (get_ports.lock); if one
instance of the script holds the lock file while another instance tries
to acquire it, the latter retries its attempt to acquire the lock file
after sleeping for 1 second; this retry process can be repeated up to 10
times before the script returns an error.

There are some problems with this approach:

  - the sleep period in case of failure to acquire the lock file is
    fixed, which leads to a "thundering herd" type of problem, where
    (depending on how processes are scheduled by the operating system)
    multiple system tests try to acquire the lock file at the same time
    and subsequently sleep for 1 second, only for the same situation to
    likely happen the next time around,

  - the lock file is being locked and then unlocked for every single
    port assignment made, not just once for the entire range of ports a
    system test should use; in other words, the lock file is currently
    locked and unlocked 13 times per system test; this increases the
    odds of the "thundering herd" problem described above preventing a
    system test from getting one or more ports assigned before the
    maximum retry count is reached (assuming multiple system tests are
    run in parallel); it also enables the range of ports used by a given
    system test to be non-sequential (which is a rather cosmetic issue,
    but one that can make log interpretation harder than necessary when
    test failures are diagnosed),

  - both issues described above cause unnecessary delays when multiple
    system tests are started in parallel (due to high lock file
    contention among the system tests being started),

  - maintaining a state file requires ensuring proper locking, which
    complicates the script's source code.

Rework the get_ports.sh script so that it assigns non-overlapping port
ranges to its callers without using a state file or a lock file:

  - add a new command line switch, "-t", which takes the name of the
    system test to assign ports for,

  - ensure every instance of get_ports.sh knows how many ports all
    system tests which form the test suite are going to need in total
    (based on the number of subdirectories found in bin/tests/system/),

  - in order to ensure all instances of get_ports.sh work on the same
    global port range (so that no port range collisions happen), a
    stable (throughout the expected run time of a single system test
    suite) base port selection method is used instead of the random one;
    specifically, the base port, unless specified explicitly using the
    "-p" command line switch, is derived from the number of hours which
    passed since the Unix Epoch time,

  - use the name of the system test to assign ports for (passed via the
    new "-t" command line switch) as a unique index into the global
    system test range, to ensure all system tests use disjoint port
    ranges.
2021-04-08 11:12:37 +02:00
Michal Nowak
a2484f2673 Merge branch 'mnowak/fix-missing-fromhex.pl-in-out-of-tree' into 'main'
Move fromhex.pl script to bin/tests/system/

See merge request isc-projects/bind9!4875
2021-04-08 09:07:07 +00:00
Michal Nowak
cd0a34df1b Move fromhex.pl script to bin/tests/system/
The fromhex.pl script needs to be copied from the source directory to
the build directory before any test is run, otherwise the out-of-tree
fails to find it. Given that the script is used only in system test,
move it to bin/tests/system/.
2021-04-08 11:04:26 +02:00
Michał Kępień
e01b3ccfaa Merge branch '2620-free-resources-when-gss_accept_sec_context-fails' into 'main'
Free resources when gss_accept_sec_context() fails

Closes #2620

See merge request isc-projects/bind9!4873
2021-04-08 08:40:27 +00:00
Michał Kępień
7eb87270a4 Add CHANGES entry 2021-04-08 10:33:44 +02:00
Michał Kępień
d954e152d9 Free resources when gss_accept_sec_context() fails
Even if a call to gss_accept_sec_context() fails, it might still cause a
GSS-API response token to be allocated and left for the caller to
release.  Make sure the token is released before an early return from
dst_gssapi_acceptctx().
2021-04-08 10:33:44 +02:00
Ondřej Surý
3c5267cc5c Merge branch '2600-general-error-managed-keys-zone-dns_journal_compact-failed-no-more' into 'main'
Resolve "general: error: managed-keys-zone: dns_journal_compact failed: no more"

Closes #2600

See merge request isc-projects/bind9!4849
2021-04-07 19:28:39 +00:00
Mark Andrews
0174098aca Add CHANGES and release note for [GL #2600] 2021-04-07 21:02:10 +02:00
Mark Andrews
bb6f0faeed Check that upgrade of managed-keys.bind.jnl succeeded
Update the system to include a recoverable managed.keys journal created
with <size,serial0,serial1,0> transactions and test that it has been
updated as part of the start up process.
2021-04-07 20:27:22 +02:00
Mark Andrews
0fbdf189c7 Rewrite managed-key journal immediately
Both managed keys and regular zone journals need to be updated
immediately when a recoverable error is discovered.
2021-04-07 20:23:46 +02:00
Mark Andrews
83310ffd92 Update dns_journal_compact() to handle bad transaction headers
Previously, dns_journal_begin_transaction() could reserve the wrong
amount of space.  We now check that the transaction is internally
consistent when upgrading / downgrading a journal and we also handle the
bad transaction headers.
2021-04-07 20:23:46 +02:00
Mark Andrews
520509ac7e Compute transaction size based on journal/transaction type
previously the code assumed that it was a new transaction.
2021-04-07 20:20:57 +02:00
Mark Andrews
5a6112ec8f Use journal_write_xhdr() to write the dummy transaction header
Instead of journal_write(), use correct format call journal_write_xhdr()
to write the dummy transaction header which looks at j->header_ver1 to
determine which transaction header to write instead of always writing a
zero filled journal_rawxhdr_t header.
2021-04-07 20:18:44 +02:00
Ondřej Surý
81c5f5e6a8 Merge branch '2401-ISC_R_TIMEDOUT-is-recoverable' into 'main'
netmgr: Make it possible to recover from ISC_R_TIMEDOUT

Closes #2401

See merge request isc-projects/bind9!4845
2021-04-07 14:34:46 +00:00
Evan Hunt
5496e51a80 Add CHANGES note for GL #2401 2021-04-07 15:38:16 +02:00
Artem Boldariev
8da12738f1 Use T_CONNECT timeout constant for TCP tests (instead of 1 ms)
The netmgr_test would be failing on heavily loaded systems because the
connection timeout was set to 1 ms.  Use the global constant instead.
2021-04-07 15:37:10 +02:00
Evan Hunt
d2ea8f4245 Ensure dig lookup is detached on UDP connect failure
dig could hang when UDP connect failed due to a dangling lookup object.
2021-04-07 15:36:59 +02:00
Ondřej Surý
72ef5f465d Refactor async callbacks and fix the double tlsdnsconnect callback
The isc_nm_tlsdnsconnect() call could end up with two connect callbacks
called when the timeout fired and the TCP connection was aborted,
but the TLS handshake was not complete yet.  isc__nm_connecttimeout_cb()
forgot to clean up sock->tls.pending_req when the connect callback was
called with ISC_R_TIMEDOUT, leading to a second callback running later.

A new argument has been added to the isc__nm_*_failed_connect_cb and
isc__nm_*_failed_read_cb functions, to indicate whether the callback
needs to run asynchronously or not.
2021-04-07 15:36:59 +02:00
Ondřej Surý
58e75e3ce5 Skip long tls_tests in the CI
We already skip most of the recv_send tests in CI because they are
too timing-related to be run in overloaded environment.  This commit
adds a similar change to tls_test before we merge tls_test into
netmgr_test.
2021-04-07 15:36:59 +02:00
Artem Boldariev
340235c855 Prevent short TLS tests from hanging in case of errors
The tests in tls_test.c could hang in the event of a connect
error.  This commit allows the tests to bail out when such an
error occurs.
2021-04-07 15:36:59 +02:00
Evan Hunt
426c40c96d rearrange nm_teardown() to check correctness after shutting down
if a test failed at the beginning of nm_teardown(), the function
would abort before isc_nm_destroy() or isc_tlsctx_free() were reached;
we would then abort when nm_setup() was run for the next test case.
rearranging the teardown function prevents this problem.
2021-04-07 15:36:59 +02:00
Ondřej Surý
86f4872dd6 isc_nm_*connect() always return via callback
The isc_nm_*connect() functions were refactored to always return the
connection status via the connect callback instead of sometimes returning
the hard failure directly (for example, when the socket could not be
created, or when the network manager was shutting down).

This commit changes the connect functions in all the network manager
modules, and also makes the necessary refactoring changes in places
where the connect functions are called.
2021-04-07 15:36:59 +02:00
Evan Hunt
a70cd026df move UDP connect retries from dig into isc_nm_udpconnect()
dig previously ran isc_nm_udpconnect() three times before giving
up, to work around a freebsd bug that caused connect() to return
a spurious transient EADDRINUSE. this commit moves the retry code
into the network manager itself, so that isc_nm_udpconnect() no
longer needs to return a result code.
2021-04-07 15:36:59 +02:00
Ondřej Surý
ca12e25bb0 Use generic functions for reading and timers in TCP
The TCP module has been updated to use the generic functions from
netmgr.c instead of its own local copies.  This brings the module
mostly up to par with the TCPDNS and TLSDNS modules.
2021-04-07 15:36:59 +02:00
Ondřej Surý
7df8c7061c Fix and clean up handling of connect callbacks
Serveral problems were discovered and fixed after the change in
the connection timeout in the previous commits:

  * In TLSDNS, the connection callback was not called at all under some
    circumstances when the TCP connection had been established, but the
    TLS handshake hadn't been completed yet.  Additional checks have
    been put in place so that tls_cycle() will end early when the
    nmsocket is invalidated by the isc__nm_tlsdns_shutdown() call.

  * In TCP, TCPDNS and TLSDNS, new connections would be established
    even when the network manager was shutting down.  The new
    call isc__nm_closing() has been added and is used to bail out
    early even before uv_tcp_connect() is attempted.
2021-04-07 15:36:59 +02:00
Ondřej Surý
5a87c7372c Make it possible to recover from connect timeouts
Similarly to the read timeout, it's now possible to recover from
ISC_R_TIMEDOUT event by restarting the timer from the connect callback.

The change here also fixes platforms that missing the socket() options
to set the TCP connection timeout, by moving the timeout code into user
space.  On platforms that support setting the connect timeout via a
socket option, the timeout has been hardcoded to 2 minutes (the maximum
value of tcp-initial-timeout).
2021-04-07 15:36:58 +02:00
Ondřej Surý
33c00c281f Make it possible to recover from read timeouts
Previously, when the client timed out on read, the client socket would
be automatically closed and destroyed when the nmhandle was detached.
This commit changes the logic so that it's possible for the callback to
recover from the ISC_R_TIMEDOUT event by restarting the timer. This is
done by calling isc_nmhandle_settimeout(), which prevents the timeout
handling code from destroying the socket; instead, it continues to wait
for data.

One specific use case for multiple timeouts is serve-stale - the client
socket could be created with shorter timeout (as specified with
stale-answer-client-timeout), so we can serve the requestor with stale
answer, but keep the original query running for a longer time.
2021-04-07 15:36:58 +02:00
Ondřej Surý
0aad979175 Disable netmgr tests only when running under CI
The full netmgr test suite is unstable when run in CI due to various
timing issues.  Previously, we enabled the full test suite only when
CI_ENABLE_ALL_TESTS environment variable was set, but that went against
original intent of running the full suite when an individual developer
would run it locally.

This change disables the full test suite only when running in the CI and
the CI_ENABLE_ALL_TESTS is not set.
2021-04-07 15:36:58 +02:00
Matthijs Mekking
ad25ca8bc6 Merge branch '2608-stale-answer-client-timeout-default-off' into 'main'
Change default stale-answer-client-timeout to off

Closes #2608

See merge request isc-projects/bind9!4862
2021-04-07 12:45:48 +00:00
Matthijs Mekking
e443279bbf Change default stale-answer-client-timeout to off
Using "stale-answer-client-timeout" turns out to have unforeseen
negative consequences, and thus it is better to disable the feature
by default for the time being.
2021-04-07 14:10:31 +02:00
Diego dos Santos Fronza
e8313d91ea Merge branch '2582-threadsanitizer-data-race-lib-dns-zone-c-10272-7-in-zone_maintenance' into 'main'
Resolve "ThreadSanitizer: data race lib/dns/zone.c:10272:7 in zone_maintenance"

Closes #2582

See merge request isc-projects/bind9!4864
2021-04-07 12:05:05 +00:00
Diego Fronza
6e08307bc8 Resolve TSAN data race in zone_maintenance
Fix race between zone_maintenance and dns_zone_notifyreceive functions,
zone_maintenance was attempting to read a zone flag calling
DNS_ZONE_FLAG(zone, flag) while dns_zone_notifyreceive was updating
a flag in the same zone calling DNS_ZONE_SETFLAG(zone, ...).

The code reading the flag in zone_maintenance was not protected by the
zone's lock, to avoid a race the zone's lock is now being acquired
before an attempt to read the zone flag is made.
2021-04-07 12:04:01 +00:00
Michał Kępień
2e5a6ab7fc Merge branch '2579-enforce-a-run-time-limit-on-unit-test-binaries' into 'main'
Enforce a run time limit on unit test binaries

Closes #2579

See merge request isc-projects/bind9!4802
2021-04-07 09:46:40 +00:00
Michał Kępień
6bdd55a9b3 Enforce a run time limit on unit test binaries
When a unit test binary hangs, the GitLab CI job in which it is run is
stuck until its run time limit is exceeded.  Furthermore, it is not
trivial to determine which test(s) hung in a given GitLab CI job based
on its log.  To prevent these issues, enforce a run time limit on every
binary executed by the lib/unit-test-driver.sh script.  Use a timeout of
5 minutes for consistency with older BIND 9 branches, which employed
Kyua for running unit tests.  Report an exit code of 124 when the run
time limit is exceeded for a unit test binary, for consistency with the
"timeout" tool included in GNU coreutils.
2021-04-07 11:41:45 +02:00
Artem Boldariev
d1bb1b01b9 Merge branch '2611-doth-failure' into 'main'
Fix "doth" system test failure with SSL_ERROR_SYSCALL (5)

See merge request isc-projects/bind9!4863
2021-04-07 08:44:38 +00:00
Artem Boldariev
ee10948e2d Remove dead code which was supposed to handle TLS shutdowns nicely
Fixes Coverity issue CID 330954 (See #2612).
2021-04-07 11:21:08 +03:00
Artem Boldariev
e6062210c7 Handle buggy situations with SSL_ERROR_SYSCALL
See "BUGS" section at:

https://www.openssl.org/docs/man1.1.1/man3/SSL_get_error.html

It is mentioned there that when TLS status equals SSL_ERROR_SYSCALL
AND errno == 0 it means that underlying transport layer returned EOF
prematurely.  However, we are managing the transport ourselves, so we
should just resume reading from the TCP socket.

It seems that this case has been handled properly on modern versions
of OpenSSL. That being said, the situation goes in line with the
manual: it is briefly mentioned there that SSL_ERROR_SYSCALL might be
returned not only in a case of low-level errors (like system call
failures).
2021-04-07 11:21:08 +03:00
Mark Andrews
6b121171a5 Merge branch '2613-lib-dns-gen-is-not-deleted-on-make-clean' into 'main'
Resolve "lib/dns/gen is not deleted on make clean"

Closes #2613

See merge request isc-projects/bind9!4865
2021-04-07 07:18:53 +00:00
Mark Andrews
9c28df2204 remove lib/dns/gen when running 'make clean' 2021-04-07 08:06:49 +10:00
Matthijs Mekking
8556c7f854 Merge branch '2594-servestale-staleonly-recursion-race' into 'main'
Serve-stale "staleonly" recursion race condition

See merge request isc-projects/bind9!4859
2021-04-02 11:26:57 +00:00
Matthijs Mekking
3d3a6415f7 If RPZ config'd, bail stale-answer-client-timeout
When we are recursing, RPZ processing is not allowed. But when we are
performing a lookup due to "stale-answer-client-timeout", we are still
recursing. This effectively means that RPZ processing is disabled on
such a lookup.

In this case, bail the "stale-answer-client-timeout" lookup and wait
for recursion to complete, as we we can't perform the RPZ rewrite
rules reliably.
2021-04-02 10:02:40 +02:00
Matthijs Mekking
839df94190 Rename "staleonly"
The dboption DNS_DBFIND_STALEONLY caused confusion because it implies
we are looking for stale data **only** and ignore any active RRsets in
the cache. Rename it to DNS_DBFIND_STALETIMEOUT as it is more clear
the option is related to a lookup due to "stale-answer-client-timeout".

Rename other usages of "staleonly", instead use "lookup due to...".
Also rename related function and variable names.
2021-04-02 10:02:40 +02:00
Matthijs Mekking
3f81d79ffb Restore the RECURSIONOK attribute after staleonly
When doing a staleonly lookup we don't want to fallback to recursion.
After all, there are obviously problems with recursion, otherwise we
wouldn't do a staleonly lookup.

When resuming from recursion however, we should restore the
RECURSIONOK flag, allowing future required lookups for this client
to recurse.
2021-04-02 10:02:40 +02:00
Matthijs Mekking
aaed7f9d8c Remove result exception on staleonly lookup
When implementing "stale-answer-client-timeout", we decided that
we should only return positive answers prematurely to clients. A
negative response is not useful, and in that case it is better to
wait for the recursion to complete.

To do so, we check the result and if it is not ISC_R_SUCCESS, we
decide that it is not good enough. However, there are more return
codes that could lead to a positive answer (e.g. CNAME chains).

This commit removes the exception and now uses the same logic that
other stale lookups use to determine if we found a useful stale
answer (stale_found == true).

This means we can simplify two test cases in the serve-stale system
test: nodata.example is no longer treated differently than data.example.
2021-04-02 10:02:40 +02:00
Matthijs Mekking
e44bcc6f53 Add notes and changes for [#2594]
Pretty newsworthy.
2021-04-02 10:02:40 +02:00
Matthijs Mekking
3d5429f61f Remove INSIST on NS_QUERYATTR_ANSWERED
The NS_QUERYATTR_ANSWERED attribute is to prevent sending a response
twice. Without the attribute, this may happen if a staleonly lookup
found a useful answer and sends a response to the client, and later
recursion ends and also tries to send a response.

The attribute was also used to mask adding a duplicate RRset. This is
considered harmful. When we created a response to the client with a
stale only lookup (regardless if we actually have send the response),
we should clear the rdatasets that were added during that lookup.

Mark such rdatasets with the a new attribute,
DNS_RDATASETATTR_STALE_ADDED. Set a query attribute
NS_QUERYATTR_STALEOK if we may have added rdatasets during a stale
only lookup. Before creating a response on a normal lookup, check if
we can expect rdatasets to have been added during a staleonly lookup.
If so, clear the rdatasets from the message with the attribute
DNS_RDATASETATTR_STALE_ADDED set.
2021-04-02 09:15:07 +02:00
Matthijs Mekking
48b0dc159b Simplify when to detach the client
With stale-answer-client-timeout, we may send a response to the client,
but we may want to hold on to the network manager handle, because
recursion is going on in the background, or we need to refresh a
stale RRset.

Simplify the setting of 'nodetach':
* During a staleonly lookup we should not detach the nmhandle, so just
  set it prior to 'query_lookup()'.
* During a staleonly "stalefirst" lookup set the 'nodetach' to true
  if we are going to refresh the RRset.

Now there is no longer the need to clear the 'nodetach' if we go
through the "dbfind_stale", "stale_refresh_window", or "stale_only"
paths.
2021-04-02 09:14:09 +02:00
Matthijs Mekking
92f7a67892 Refactor stale lookups, ignore active RRsets
When doing a staleonly lookup, ignore active RRsets from cache. If we
don't, we may add a duplicate RRset to the message, and hit an
assertion failure in query.c because adding the duplicate RRset to the
ANSWER section failed.

This can happen on a race condition. When a client query is received,
the recursion is started. When 'stale-answer-client-timeout' triggers
around the same time the recursion completes, the following sequence
of events may happen:
1. Queue the "try stale" fetch_callback() event to the client task.
2. Add the RRsets from the authoritative response to the cache.
3. Queue the "fetch complete" fetch_callback() event to the client task.
4. Execute the "try stale" fetch_callback(), which retrieves the
   just-inserted RRset from the database.
5. In "ns_query_done()" we are still recursing, but the "staleonly"
   query attribute has already been cleared. In other words, the
   query will resume when recursion ends (it already has ended but is
   still on the task queue).
6. Execute the "fetch complete" fetch_callback(). It finds the answer
   from recursion in the cache again and tries to add the duplicate to
   the answer section.

This commit changes the logic for finding stale answers in the cache,
such that on "stale_only" lookups actually only stale RRsets are
considered. It refactors the code so that code paths for "dbfind_stale",
"stale_refresh_window", and "stale_only" are more clear.

First we call some generic code that applies in all three cases,
formatting the domain name for logging purposes, increment the
trystale stats, and check if we actually found stale data that we can
use.

The "dbfind_stale" lookup will return SERVFAIL if we didn't found a
usable answer, otherwise we will continue with the lookup
(query_gotanswer()). This is no different as before the introduction of
"stale-answer-client-timeout" and "stale-refresh-time".

The "stale_refresh_window" lookup is similar to the "dbfind_stale"
lookup: return SERVFAIL if we didn't found a usable answer, otherwise
continue with the lookup (query_gotanswer()).

Finally the "stale_only" lookup.

If the "stale_only" lookup was triggered because of an actual client
timeout (stale-answer-client-timeout > 0), and if database lookup
returned a stale usable RRset, trigger a response to the client.
Otherwise return and wait until the recursion completes (or the
resolver query times out).

If the "stale_only" lookup is a "stale-anwer-client-timeout 0" lookup,
preferring stale data over a lookup. In this case if there was no stale
data, or the data was not a positive answer, retry the lookup with the
stale options cleared, a.k.a. a normal lookup. Otherwise, continue
with the lookup (query_gotanswer()) and refresh the stale RRset. This
will trigger a response to the client, but will not detach the handle
because a fetch will be created to refresh the RRset.
2021-04-02 09:14:09 +02:00
Matthijs Mekking
fee164243f Keep track of allow client detach
The stale-answer-client-timeout feature introduced a dependancy on
when a client may be detached from the handle. The dboption
DNS_DBFIND_STALEONLY was reused to track this attribute. This overloads
the meaning of this database option, and actually introduced a bug
because the option was checked in other places. In particular, in
'ns_query_done()' there is a check for 'RECURSING(qctx->client) &&
(!QUERY_STALEONLY(&qctx->client->query) || ...' and the condition is
satisfied because recursion has not completed yet and
DNS_DBFIND_STALEONLY is already cleared by that time (in
query_lookup()), because we found a useful answer and we should detach
the client from the handle after sending the response.

Add a new boolean to the client structure to keep track of client
detach from handle is allowed or not. It is only disallowed if we are
in a staleonly lookup and we didn't found a useful answer.
2021-04-02 09:14:09 +02:00
Artem Boldariev
e7fe606020 Merge branch 'artem/tls-tests-and-fixes' into 'main'
TLS transport code refactoring and unit tests

See merge request isc-projects/bind9!4851
2021-04-01 15:41:52 +00:00
Artem Boldariev
fa062162a7 Fix crash (regression) in DIG when handling non-DoH responses
This commit fixes crash in dig when it encounters non-expected header
value. The bug was introduced at some point late in the last DoH
development cycle. Also, refactors the relevant code a little bit to
ensure better incoming data validation for client-side DoH
connections.
2021-04-01 17:31:29 +03:00
Artem Boldariev
11ed7aac5d TLS code refactoring, fixes and unit-tests
This commit fixes numerous stability issues with TLS transport code as
well as adds unit tests for it.
2021-04-01 17:31:29 +03:00
Ondřej Surý
01cd310407 Merge branch '2607-remove-custom-spnego' into 'main'
Remove custom ISC SPNEGO implementation

Closes #2607

See merge request isc-projects/bind9!4856
2021-04-01 14:14:00 +00:00
Ondřej Surý
66bd47a129 Add CHANGES and release note for GL #2607 2021-04-01 16:08:19 +02:00
Mark Andrews
1febea6d7c Merge branch '2538-bind-9-17-build-process-leaving-files-in-unexpected-locations' into 'main'
Resolve "BIND 9.17 build process leaving files in unexpected locations?"

Closes #2538

See merge request isc-projects/bind9!4757
2021-04-01 09:34:17 +00:00
Mark Andrews
35e8f56b49 Test dynamic libraries should not be installed
Tag the libraries with check_ to prevent them being installed
by "make install".  Additionally make check requires .so to be
create which requires .lai files to be constructed which, in
turn, requires -rpath <dir> as part of "linking" the .la file.
2021-04-01 19:11:54 +11:00
Michal Nowak
b34fd6d4f2 Merge branch 'mnowak/web-run-gcc-tarball-ci-job' into 'main'
Run gcc:tarball CI job in web-triggered pipelines

See merge request isc-projects/bind9!4850
2021-03-31 14:37:15 +00:00
Michal Nowak
4d5d3b75da Run gcc:tarball CI job in web-triggered pipelines
The gcc:tarball CI job may identify problems with tarballs created by
"make dist" of the tarball-create CI job. Enabling the gcc:tarball CI
job in web-triggered pipelines provides developers with a test vector.
2021-03-31 16:35:59 +02:00
Michał Kępień
aaac9345eb Merge branch 'michal/include-all-pre-generated-man-pages-in-make-dist' into 'main'
Include all pre-generated man pages in "make dist"

See merge request isc-projects/bind9!4838
2021-03-29 11:08:00 +00:00
Michał Kępień
490e5cb1f1 Include all pre-generated man pages in "make dist"
Some man pages (e.g. dnstap-read.1, named-nzd2nzf.1) should only be
installed conditionally (when the relevant features are enabled in a
given BIND 9 build).  This is achieved using Automake conditionals.
However, while all source reStructuredText files are included in
tarballs produced by "make dist" (distribution tarballs) as they should
be, the list of pre-generated man pages included in distribution
tarballs incorrectly depends on the ./configure switches used for the
build for which "make dist" is run.  Meanwhile, distribution tarballs
should always contain all the files necessary to build any flavor of
BIND 9.

Here is an example scenario which fails to work as intended:

    autoreconf -i
    ./configure --disable-maintainer-mode
    make dist
    tar --extract --file bind-9.17.11.tar.xz
    cd bind-9.17.11
    ./configure --disable-maintainer-mode --enable-dnstap
    make

Fix by always including pre-generated versions of all conditionally
installed man pages in EXTRA_DIST.  While this may cause some of them to
appear in EXTRA_DIST more than once (depending on the ./configure
switches used for the build for which "make dist" is run), it seems to
not be a problem for Automake.
2021-03-29 13:06:39 +02:00
Mark Andrews
99ff8f285c Merge branch '2597-make-calling-generic-rdata-methods-consistent' into 'main'
Resolve "Make calling generic rdata methods consistent"

Closes #2597

See merge request isc-projects/bind9!4834
2021-03-26 22:27:51 +00:00
Mark Andrews
a88d3963e2 Make calling generic rdata methods consistent
add matching macros to pass arguments from called methods
to generic methods.  This will reduce the amount of work
required when extending methods.

Also cleanup unnecessary UNUSED declarations.
2021-03-26 22:04:42 +00:00
Ondřej Surý
19b69e9a3b Merge branch 'bind-dyndb-ldap-v9.16.13' into 'main'
Do not require config.h to use isc/util.h

See merge request isc-projects/bind9!4840
2021-03-26 18:43:18 +00:00
Petr Mensik
81eb3396bf Do not require config.h to use isc/util.h
util.h requires ISC_CONSTRUCTOR definition, which depends on config.h
inclusion. It does not include it from isc/util.h (or any other header).
Using isc/util.h fails hard when isc/util.h is used without including
bind's config.h.

Move the check to c file, where ISC_CONSTRUCTOR is used. Ensure config.h
is included there.
2021-03-26 11:41:22 +01:00
Diego dos Santos Fronza
f38069cdf8 Merge branch '2490-dig-tcp-does-not-honor-tries-1-nor-retry-0' into 'main'
Resolve "dig +tcp does not honor +tries=1 nor +retry=0"

Closes #2490

See merge request isc-projects/bind9!4682
2021-03-25 17:30:24 +00:00
Diego Fronza
04537633a7 Add CHANGES note for [GL #2490] 2021-03-25 14:12:16 -03:00
Diego Fronza
3b98c4d311 Update dig's man page
Adjusted man page entries for +tries and +retry options to reflect the
fact that now those options apply to TCP as well.
2021-03-25 14:08:40 -03:00
Diego Fronza
4f82cc41cc Added tests for tries=1 and retry=0 on TCP EOF
Added tests to ensure that dig won't retry sending a query over tcp
(+tcp) when a TCP connection is closed prematurely (EOF is read) if
either +tries=1 or retry=0 is specified on the command line.
2021-03-25 14:08:40 -03:00
Diego Fronza
e680896003 Adjusted dig system tests
Now that premature EOF on tcp connections take +tries and +retry into
account, the dig system tests handling TCP EOF with +tries=1 were
expecting dig to do a second attempt in handling the tcp query, which
doesn't happen anymore.

To make the test work as expected +tries value was adjusted to 2, to
make it behave as before after the new update on dig.
2021-03-25 14:08:40 -03:00
Diego Fronza
78f6ead480 Don't retry +tcp queries on failure if tries=1 or retries=0
Before this commit, a premature EOF (connection closed) on tcp queries
was causing dig to automatically attempt to send the query again, even
if +tries=1 or +retries=0 was provided on command line.

This commit fix the problem by taking into account the no. of retries
specified by the user when processing a premature EOF on tcp
connections.
2021-03-25 14:08:39 -03:00
Michał Kępień
8bb1547208 Merge branch 'matthijs-configure-kaspsh' into 'main'
Configure kasp.sh

See merge request isc-projects/bind9!4836
2021-03-24 09:07:33 +00:00
Matthijs Mekking
93ed215065 Add kasp.sh to run.sh.in script
Add kasp.sh to the list of scripts copied from the source directory to
the build directory before any test is run. This will fix
the out-of-tree test failures introduced in commit
ecb073bdd6 on the 'main' branch.
2021-03-24 08:55:24 +01:00
Matthijs Mekking
c2c5701dfe Merge branch '2488-refresh-keys-after-rndc-rollover' into 'main'
Rekey immediately after rndc checkds/rollover

Closes #2488

See merge request isc-projects/bind9!4813
2021-03-22 13:35:12 +00:00
Matthijs Mekking
82d667e1d5 Fix some intermittent kasp failures
When calling "rndc dnssec -checkds", it may take some milliseconds
before the appropriate changes have been written to the state file.
Add retry_quiet mechanisms to allow the write operation to finish.

Also retry_quiet the check for the next key event. A "rndc dnssec"
command may trigger a zone_rekey event and this will write out
a new "next key event" log line, but it may take a bit longer than
than expected in the tests.
2021-03-22 11:58:26 +01:00
Matthijs Mekking
82f72ae249 Rekey immediately after rndc checkds/rollover
Call 'dns_zone_rekey' after a 'rndc dnssec -checkds' or 'rndc dnssec
-rollover' command is received, because such a command may influence
the next key event. Updating the keys immediately avoids unnecessary
rollover delays.

The kasp system test no longer needs to call 'rndc loadkeys' after
a 'rndc dnssec -checkds' or 'rndc dnssec -rollover' command.
2021-03-22 11:58:26 +01:00
Matthijs Mekking
28923bc695 Merge branch '2517-cds-dnskey-delete-records-prevent-loading-unsigned-zone' into 'main'
Resolve "CDS and CDNSKEY DELETE records prevent (re-)loading unsigned zone"

Closes #2517

See merge request isc-projects/bind9!4810
2021-03-22 10:06:45 +00:00
Matthijs Mekking
841e90c6fc Add CHANGES and notes for [#2517] 2021-03-22 10:31:23 +01:00
Matthijs Mekking
6f31f62d69 Delete CDS/CDNSKEY records when zone is unsigned
CDS/CDNSKEY DELETE records are only useful if they are signed,
otherwise the parent cannot verify these RRsets anyway. So once the DS
has been removed (and signaled to BIND), we can remove the DNSKEY and
RRSIG records, and at this point we can also remove the CDS/CDNSKEY
records.
2021-03-22 10:30:59 +01:00
Matthijs Mekking
f211c7c2a1 Allow CDS/CDNSKEY DELETE records in unsigned zone
While not useful, having a CDS/CDNSKEY DELETE record in an unsigned
zone is not an error and "named-checkzone" should not complain.
2021-03-22 10:25:30 +01:00
Matthijs Mekking
052ec16a44 Merge branch 'matthijs-test-keymgr2kasp' into 'main'
Test migrating to dnssec-policy

Closes #2544

See merge request isc-projects/bind9!4758
2021-03-22 09:09:06 +00:00
Matthijs Mekking
d5531df79a Retry quiet check keys
Change the 'check_keys' function to try three times. Some intermittent
kasp test failures are because we are inspecting the key files
before the actual change has happen. The 'retry_quiet' approach allows
for a bit more time to let the write operation finish.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
923c2a07bf Update copyrights for keymgr2kasp
This MR introduces a new system test 'keymgr2kasp' to test
migration to 'dnssec-policy'. It moves some existing tests from
the 'kasp' system test to here.

Also a common script 'kasp.sh', to be used in kasp specific tests,
is introduced.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
27e7d5f698 Fix keymgr key init bug
The 'keymgr_key_init()' function initializes key states if they have
not been set previously. It looks at the key timing metadata and
determines using the given times whether a state should be set to
RUMOURED or OMNIPRESENT.

However, the DNSKEY and ZRRSIG states were mixed up: When looking
at the Activate timing metadata we should set the ZRRSIG state, and
when looking at the Published timing metadata we should set the
DNSKEY state.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
c40c1ebcb1 Test keymgr2kasp state from timing metadata
Add two test zones that migrate to dnssec-policy. Test if the key
states are set accordingly given the timing metadata.

The rumoured.kasp zone has its Publish/Active/SyncPublish times set
not too long ago so the key states should be set to RUMOURED. The
omnipresent.kasp zone has its Publish/Active/SyncPublish times set
long enough to set the key states to OMNIPRESENT.

Slightly change the init_migration_keys function to set the
key lifetime to "none" (legacy keys don't have lifetime). Then in the
test case set the expected key lifetime explicitly.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
f6fa254256 Editorial commit keymgr2kasp test
This commit is somewhat editorial as it does not introduce something
new nor fixes anything.

The layout in keymgr2kasp/tests.sh has been changed, with the
intention to make more clear where a test scenario ends and begins.

The publication time of some ZSKs has been changed. It makes a more
clear distinction between publication time and activation time.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
ecb073bdd6 Introduce kasp.sh
Add a script similar to conf.sh to include common functions and
variables for testing KASP. Currently used in kasp, keymgr2kasp, and
nsec3.
2021-03-22 09:50:05 +01:00
Matthijs Mekking
5389172111 Move kasp migration tests to different directory
The kasp system test was getting pretty large, and more tests are on
the way. Time to split up. Move tests that are related to migrating
to dnssec-policy to a separate directory 'keymgr2kasp'.
2021-03-22 09:50:05 +01:00
Michał Kępień
ea26306eba Merge branch '1946-man-page-fixes' into 'main'
Man page fixes

See merge request isc-projects/bind9!4817
2021-03-22 08:39:38 +00:00
Michał Kępień
185a1a5643 Install man page for named-compilezone
The named-checkzone tool can also be invoked as named-compilezone.  Make
sure a man page is installed for that alias.  Move and rename the
"man_named-checkzone" label to prevent a Sphinx duplicate label warning
from being raised (see commit 84862e96c1
for more information).
2021-03-22 09:36:48 +01:00
Michał Kępień
dcab218adc Install named-nzd2nzf man page conditionally
The named-nzd2nzf utility is only built and installed for LMDB-enabled
builds.  Adjust the relevant Makefile.am file to make sure the
named-nzd2nzf.1 man page is also only built and installed for
LMDB-enabled builds.
2021-03-22 09:36:48 +01:00
Michał Kępień
ceedee0785 Install dnstap-read man page conditionally
The dnstap-read utility is only built and installed for dnstap-enabled
builds.  Adjust the relevant Makefile.am file to make sure the
dnstap-read.1 man page is also only built and installed for
dnstap-enabled builds.
2021-03-22 09:36:48 +01:00
Evan Hunt
d04aa1d44e Merge branch 'placeholder' into 'main'
placeholder for #2575

See merge request isc-projects/bind9!4828
2021-03-20 19:16:16 +00:00
Evan Hunt
c452c0a0a5 placeholder for #2575
Issue #2575 was merged to 9.16 only as change 5603, but a placeholder
was not added to CHANGES in the main branch. This commit adds the
placeholder and renumbers the two subsequent changes.
2021-03-20 12:11:11 -07:00
Evan Hunt
8e0902b731 Merge branch '2592-dig-clock-realtime' into 'main'
Resolve "dig -u is extremely inaccurate, especially on machines with the kernel timer tick set at 100Hz"

Closes #2592

See merge request isc-projects/bind9!4826
2021-03-20 18:58:16 +00:00
Evan Hunt
1933bcf1d3 CHANGES 2021-03-20 11:25:55 -07:00
Patrick McLean
56cef1495f dig: Use high resolution clocks when microsecond accuracy is requested
The TIME_NOW macro calls isc_time_now which uses CLOCK_REALTIME_COARSE
for getting the current time. This is perfectly fine for millisecond,
however when the user request microsecond resolutiuon, they are going
to get very inaccurate results. This is especially true on a server
class machine where the clock ticks may be set to 100HZ.

This changes dig to use the new TIME_NOW_HIRES macro that uses the
CLOCK_MONOTONIC_RAW that is more expensive, but gets the *actual*
current time rather than the at the last kernel time tick.
2021-03-20 11:25:55 -07:00
Patrick McLean
ebced74b19 Add isc_time_now_hires function to get current time with high resolution
The current isc_time_now uses CLOCK_REALTIME_COARSE which only updates
on a timer tick. This clock is generally fine for millisecond accuracy,
but on servers with 100hz clocks, this clock is nowhere near accurate
enough for microsecond accuracy.

This commit adds a new isc_time_now_hires function that uses
CLOCK_REALTIME, which gives the current time, though it is somewhat
expensive to call. When microsecond accuracy is required, it may be
required to use extra resources for higher accuracy.
2021-03-20 11:25:55 -07:00
Ondřej Surý
bee4ee931f Merge branch '2416-improve-netmgr-unit-tests-reliability' into 'main'
Improve reliability of the netmgr unit tests

Closes #2455 and #2416

See merge request isc-projects/bind9!4628
2021-03-19 16:22:22 +00:00
Ondřej Surý
d96c94d754 Require CMocka >= 1.1.3 to run the unit tests
In CMocka versions << 1.1.3, the skip() function would cause the whole
unit test to abort when CMOCKA_TEST_ABORT is set.  As this is problem
only in Debian 9 Stretch and Ubuntu 16.04 Xenial, we just require the
CMocka >= 1.1.3 and disable the unit testing on Debian 9 Stretch until
we can pull the libcmocka-dev from stretch-backports and remove the
Ubuntu 16.04 Xenial from the CI as it is reaching End of Standard
Support at the end of April 2021.
2021-03-19 16:25:28 +01:00
Ondřej Surý
d016ea745f Fix compilation with NETMGR_TRACE(_VERBOSE) enabled on non-Linux
When NETMGR_TRACE(_VERBOSE) is enabled, the build would fail on some
non-Linux non-glibc platforms because:

  * Use <stdint.h> print macros because uint_fast32_t is not always
    unsigned long

  * The header <execinfo.h> is not available on non-glibc, thus commit
    adds dummy backtrace() and backtrace_symbols_fd() functions for
    platforms without HAVE_BACKTRACE
2021-03-19 16:25:28 +01:00
Ondřej Surý
42e4e3b843 Improve reliability of the netmgr unit tests
The netmgr unit tests were designed to push the system limits to maximum
by sending as many queries as possible in the busy loop from multiple
threads.  This mostly works with UDP, but in the stateful protocol where
establishing the connection takes more time, it failed quite often in
the CI.  On FreeBSD, this happened more often, because the socket() call
would fail spuriosly making the problem even worse.

This commit does several things to improve reliability:

* return value of isc_nm_<proto>connect() is always checked and retried
  when scheduling the connection fails

* The busy while loop has been slowed down with usleep(1000); so the
  netmgr threads could schedule the work and get executed.

* The isc_thread_yield() was replaced with usleep(1000); also to allow
  the other threads to do any work.

* Instead of waiting on just one variable, we wait for multiple
  variables to reach the final value

* We are wrapping the netmgr operations (connects, reads, writes,
  accepts) with reference counting and waiting for all the callbacks to
  be accounted for.

  This has two effects:

  a) the isc_nm_t is always clean of active sockets and handles when
     destroyed, so it will prevent the spurious INSIST(references == 1)
     from isc_nm_destroy()

  b) the unit test now ensures that all the callbacks are always called
     when they should be called, so any stuck test means that there was
     a missing callback call and it is always a real bug

These changes allows us to remove the workaround that would not run
certain tests on systems without port load-balancing.
2021-03-19 16:25:28 +01:00
Ondřej Surý
e8cd3d3cf7 Merge branch 'ondrej/call-failed_read-from-tls_error' into 'main'
Call isc__nm_tlsdns_failed_read on tls_error to cleanup the socket

See merge request isc-projects/bind9!4824
2021-03-19 14:57:53 +00:00
Ondřej Surý
e4e0e9e3c1 Call isc__nm_tlsdns_failed_read on tls_error to cleanup the socket
In tls_error(), we now call isc__nm_tlsdns_failed_read() instead of just
stopping timer and reading from the socket.  This allows us to properly
cleanup any pending operation on the socket.
2021-03-19 15:28:52 +01:00
Matthijs Mekking
085c2e3249 Merge branch 'treysis-filter-a' into 'main'
filter-a plugin

Closes #2585

See merge request isc-projects/bind9!4816
2021-03-19 09:41:02 +00:00
Matthijs Mekking
9a256347ab Add changes for filter-a plugin 2021-03-19 08:06:55 +01:00
treysis
6b2ea00621 Add filter-a plugin for IPv6-dominant environments
(cherry picked from commit 78f6cd57e1cc166823415438fe2d19a324cf7a67)
2021-03-19 08:06:55 +01:00
Ondřej Surý
6ae0a90583 Merge branch '2581-oldsize-assertion' into 'main'
Fix memory accounting bug in TLSDNS

Closes #2581

See merge request isc-projects/bind9!4809
2021-03-18 22:03:25 +00:00
Ondřej Surý
e4b0730387 Call the isc__nm_failed_connect_cb() early when shutting down
When shutting down, calling the isc__nm_failed_connect_cb() was delayed
until the connect callback would be called.  It turned out that the
connect callback might not get called at all when the socket is being
shut down.  Call the failed_connect_cb() directly in the
tlsdns_shutdown() instead of waiting for the connect callback to call it.
2021-03-18 14:31:15 -07:00
Ondřej Surý
73c574e553 Fix typo in processbuffer() - tcpdns vs tlsdns
The processbuffer() would call isc__nm_tcpdns_processbuffer() instead of
isc__nm_tlsdns_processbuffer() for the isc_nm_tlsdnssocket type of
socket.
2021-03-18 21:35:13 +01:00
Ondřej Surý
1d64d4cde8 Fix memory accounting bug in TLSDNS
After a partial write the tls.senddata buffer would be rearranged to
contain only the data tha wasn't sent and the len part would be made
shorter, which would lead to attempt to free only part of a socket's
tls.senddata buffer.
2021-03-18 18:14:38 +01:00
Ondřej Surý
15f676f111 Merge branch 'ondrej/fix-dangling-uvreq-in-tlsdns' into 'main'
Fix dangling uvreq when data is sent from tlsdns_cycle()

See merge request isc-projects/bind9!4820
2021-03-18 17:02:18 +00:00
Ondřej Surý
5cc406a920 Fix dangling uvreq when data is sent from tlsdns_cycle()
The tlsdns_cycle() might call uv_write() to write data to the socket,
when this happens and the socket is shutdown before the callback
completes, the uvreq structure was not freed because the callback would
be called with non-zero status code.
2021-03-18 17:58:56 +01:00
Ondřej Surý
06913d3d74 Merge branch '2573-dont-timeout-when-sending-data' into 'main'
Resolve "Fix TCPDNS and TLSDNS timers"

Closes #2583 and #2573

See merge request isc-projects/bind9!4807
2021-03-18 16:01:01 +00:00
Michal Nowak
2edba8777f Merge branch 'v9_17_11-release' into 'main'
Merge 9.17.11 release branch

See merge request isc-projects/bind9!4818
2021-03-18 15:38:54 +00:00
Ondřej Surý
98f7495426 Add CHANGES and release note for GL #2573 2021-03-18 16:37:57 +01:00
Ondřej Surý
36ddefacb4 Change the isc_nm_(get|set)timeouts() to work with milliseconds
The RFC7828 specifies the keepalive interval to be 16-bit, specified in
units of 100 milliseconds and the configuration options tcp-*-timeouts
are following the suit.  The units of 100 milliseconds are very
unintuitive and while we can't change the configuration and presentation
format, we should not follow this weird unit in the API.

This commit changes the isc_nm_(get|set)timeouts() functions to work
with milliseconds and convert the values to milliseconds before passing
them to the function, not just internally.
2021-03-18 16:37:57 +01:00
Ondřej Surý
1ef232f93d Merge the common parts between udp, tcpdns and tlsdns protocol
The udp, tcpdns and tlsdns contained lot of cut&paste code or code that
was very similar making the stack harder to maintain as any change to
one would have to be copied to the the other protocols.

In this commit, we merge the common parts into the common functions
under isc__nm_<foo> namespace and just keep the little differences based
on the socket type.
2021-03-18 16:37:57 +01:00
Ondřej Surý
caa5b6548a Fix TCPDNS and TLSDNS timers
After the TCPDNS refactoring the initial and idle timers were broken and
only the tcp-initial-timeout was always applied on the whole TCP
connection.

This broke any TCP connection that took longer than tcp-initial-timeout,
most often this would affect large zone AXFRs.

This commit changes the timeout logic in this way:

  * On TCP connection accept the tcp-initial-timeout is applied
    and the timer is started
  * When we are processing and/or sending any DNS message the timer is
    stopped
  * When we stop processing all DNS messages, the tcp-idle-timeout
    is applied and the timer is started again
2021-03-18 16:37:57 +01:00
Ondřej Surý
64cff61c02 Add TCP timeouts system test
The system tests were missing a test that would test tcp-initial-timeout
and tcp-idle-timeout.

This commit adds new "timeouts" system test that adds:

  * Test that waits longer than tcp-initial-timeout and then checks
    whether the socket was closed

  * Test that sends and receives DNS message then waits longer than
    tcp-initial-timeout but shorter time than tcp-idle-timeout than
    sends DNS message again than waits longer than tcp-idle-timeout
    and checks whether the socket was closed

  * Similar test, but bursting 25 DNS messages than waiting longer than
    tcp-initial-timeout and shorter than tcp-idle-timeout than do second
    25 DNS message burst

  * Check whether transfer longer than tcp-initial-timeout succeeds
2021-03-18 16:37:57 +01:00
Michal Nowak
3265dfa929 Set up release notes for BIND 9.17.12 2021-03-18 15:58:15 +01:00
Michal Nowak
8853ec09a5 Update BIND version to 9.17.11 2021-03-18 15:55:36 +01:00
Michal Nowak
9d4da23850 Add a CHANGES marker 2021-03-18 15:55:32 +01:00
Michal Nowak
a8b525290f Merge branch 'mnowak/prepare-documentation-for-bind-9.17.11' into 'v9_17_11-release'
Prepare documentation for BIND 9.17.11

See merge request isc-private/bind9!252
2021-03-18 15:55:11 +01:00
Michal Nowak
924f8ceb06 Prepare release notes for BIND 9.17.11 2021-03-18 15:55:11 +01:00
Michal Nowak
e6ca82b2c4 Add release notes for GL #2472 2021-03-18 15:55:10 +01:00
Michal Nowak
566b8ab85e Add release note for GL #2504 2021-03-18 15:55:10 +01:00
Michal Nowak
baf79279f0 Add release note for GL #2041 2021-03-18 15:55:10 +01:00
Michal Nowak
70076fb7c8 Reorder release notes 2021-03-18 15:55:10 +01:00
Michal Nowak
b66bb0c89e Tweak and reword release notes 2021-03-18 15:54:41 +01:00
Michal Nowak
188d605c2a Tweak and reword recent CHANGES entries 2021-03-18 15:53:30 +01:00
Michal Nowak
68128f2092 Release template: update the -S edition delivery tickets
Change requested by the Support team.
2021-03-18 15:53:30 +01:00
Mark Andrews
ffea605679 Merge branch '2580-does-not-compile-without-deprecated-openssl-apis' into 'main'
Resolve "Does not compile without deprecated OpenSSL APIs"

Closes #2580

See merge request isc-projects/bind9!4806
2021-03-17 20:10:11 +00:00
Mark Andrews
a9f883cbc2 Stop using deprecated calls in lib/isc/tls.c
from Rosen Penev @neheb
2021-03-17 20:05:47 +00:00
Matthijs Mekking
8d8373c21c Merge branch '2523-thaw-dnssec-policy-zone' into 'main'
Resolve "Unable to thaw a frozen dynamic zone when KASP is configured."

Closes #2523

See merge request isc-projects/bind9!4777
2021-03-17 10:11:13 +00:00
Matthijs Mekking
0cae3249e3 Add test for thaw dynamic kasp zone
Add a test for freezing, manually updating, and then thawing a dynamic
zone with "dnssec-policy". In the kasp system test we add parameters
to the "update_is_signed" check to signal the indicated IP addresses
for the labels "a" and "d". If set to '-', the test is skipped.

After nsupdating the dynamic.kasp zone, we revert the update (with
nsupdate) and update the zone again, but now with the freeze/thaw
approach.
2021-03-17 08:24:17 +01:00
Matthijs Mekking
b90846f222 Fully sign a thawed zone
When thawing a zone, we don't know what changes have been made. If we
do DNSSEC maintenance on this zone, schedule a full sign.
2021-03-17 08:24:17 +01:00
Matthijs Mekking
b518ed9f46 Fix "unable to thaw dynamic kasp zone"
Dynamic zones with dnssec-policy could not be thawed because KASP
zones were considered always dynamic. But a dynamic KASP zone should
also check whether updates are disabled.
2021-03-17 08:24:15 +01:00
Matthijs Mekking
0eb0dabdcc Merge branch '2561-dnssec-guide-signing-type' into 'main'
Fix typo in DNSSEC Guide

Closes #2561

See merge request isc-projects/bind9!4791
2021-03-16 13:37:32 +00:00
Matthijs Mekking
d45af8877a Fix typo in DNSSEC Guide
The "dnssec-policy" example should say "keys" instead of "key".
2021-03-16 13:37:16 +00:00
Artem Boldariev
50eaa0f38f Merge branch '2514-tls-cert-chain' into 'main'
Load full certificate chain from a certificate chain file

Closes #2514

See merge request isc-projects/bind9!4792
2021-03-16 10:33:35 +00:00
Matthijs Mekking
c69fafdd65 Add change entry for [#2514] 2021-03-16 11:50:32 +02:00
Artem Boldariev
75363dcb7c Load full certificate chain from a certificate chain file
This commit fixes loading the certificate chain files so that the full
chain could be sent to the clients which require that for
verification. Before that fix only the top most certificate would be
loaded from the chain and sent to clients preventing some of them to
perform certificate validation (e.g. Windows 10 DoH client).
2021-03-16 11:49:04 +02:00
Matthijs Mekking
6dee5c1b28 Merge branch '2562-xot-crash' into 'main'
Fix a XoT crash

Closes #2562

See merge request isc-projects/bind9!4803
2021-03-16 09:42:18 +00:00
Matthijs Mekking
ee0835d977 Fix a XoT crash
The transport should also be detached when we skip a master, otherwise
named will crash when sending a SOA query to the next master over TLS,
because the transport must be NULL when we enter
'dns_view_gettransport'.
2021-03-16 10:11:12 +01:00
Mark Andrews
24c796942f Merge branch '2569-nsupdate-on-solaris-produces-different-failure-text-than-expected' into 'main'
Resolve "nsupdate on Solaris produces different failure text than expected"

Closes #2569

See merge request isc-projects/bind9!4804
2021-03-16 00:11:02 +00:00
Mark Andrews
25d1276170 Ignore the actual error code returned by getaddrinfo
when testing if interactive mode continues or not on
invalid hostname.  We only need to detect that getaddrinfo
failed and that we continued or not.
2021-03-16 10:20:28 +11:00
Mark Andrews
a9339fe7fc Merge branch '2567-warning-array-subscript-is-of-type-char-on-netbsd-9' into 'main'
Resolve "warning: array subscript is of type 'char' on NetBSD 9"

Closes #2567

See merge request isc-projects/bind9!4794
2021-03-15 03:33:21 +00:00
Mark Andrews
d768336cc6 Add CHANGES for [GL #2567] 2021-03-15 14:18:46 +11:00
Mark Andrews
99bd0c346f cast (char) to (unsigned char) when calling is*() 2021-03-15 14:18:03 +11:00
Michal Nowak
e391209212 Merge branch '2565-servestale-fetchlimits-crash' into 'main'
Fix servestale fetchlimits crash

Closes #2565

See merge request isc-projects/bind9!4797
2021-03-11 12:14:47 +00:00
Matthijs Mekking
87591de6f7 Fix servestale fetchlimits crash
When we query the resolver for a domain name that is in the same zone
for which is already one or more fetches outstanding, we could
potentially hit the fetch limits. If so, recursion fails immediately
for the incoming query and if serve-stale is enabled, we may try to
return a stale answer.

If the resolver is also is authoritative for the parent zone (for
example the root zone), first a delegation is found, but we first
check the cache for a better response.

Nothing is found in the cache, so we try to recurse to find the
answer to the query.

Because of fetch-limits 'dns_resolver_createfetch()' returns an error,
which 'ns_query_recurse()' propagates to the caller,
'query_delegation_recurse()'.

Because serve-stale is enabled, 'query_usestale()' is called,
setting 'qctx->db' to the cache db, but leaving 'qctx->version'
untouched. Now 'query_lookup()' is called to search for stale data
in the cache database with a non-NULL 'qctx->version'
(which is set to a zone db version), and thus we hit an assertion
in rbtdb.

This crash was introduced in 'main' by commit
8bcd7fe69e.
2021-03-11 12:16:14 +01:00
Ondřej Surý
74a0294be0 Merge branch '2568-test_client-c-error-static-declaration-of-yield-follows-non-static-declaration-on-solaris' into 'main'
Resolve "test_client.c: error: static declaration of 'yield' follows non-static declaration on Solaris"

Closes #2568

See merge request isc-projects/bind9!4795
2021-03-11 06:09:49 +00:00
Mark Andrews
af0ee2c718 Rename 'yield' to 'waitforsignal' due to namespace clash 2021-03-11 11:34:15 +11:00
Michał Kępień
77ac8db0c6 Merge branch '2556-fix-documentation-for-the-max-ixfr-ratio-option' into 'main'
Fix documentation for the "max-ixfr-ratio" option

Closes #2556

See merge request isc-projects/bind9!4787
2021-03-08 11:28:37 +00:00
Michał Kępień
3878cf4ac5 Fix documentation for the "max-ixfr-ratio" option
Commit 9fb6d11abb (which converted BIND 9
documentation from DocBook to Sphinx) inadvertently removed a paragraph
from the description of the "max-ixfr-ratio" option.  Add the missing
paragraph back.
2021-03-08 12:27:39 +01:00
Ondřej Surý
8bd1da8e4e Merge branch 'ondrej/disable-github-pr-fix' into 'main'
Fix syntax error in GitHub Actions lockdown.yml file

See merge request isc-projects/bind9!4789
2021-03-08 11:25:15 +00:00
Ondřej Surý
c4a4ee2db9 Fix syntax error in GitHub Actions lockdown.yml file 2021-03-08 12:24:17 +01:00
Ondřej Surý
494057b8f4 Merge branch 'ondrej/disable-github-pr' into 'main'
Add GitHub Action that immediately closes issue / PRs

See merge request isc-projects/bind9!4788
2021-03-08 11:13:24 +00:00
Ondřej Surý
2463f62c93 Add GitHub Action that immediately closes issue / PRs
Unfortunately, it's not possible to disable Pull Requests on the
mirrored repository on the GitHub, so this commit adds external action
that closes any new open Issue or Pull Requests instead letting them rot
unnoticed.
2021-03-08 12:09:14 +01:00
Ondřej Surý
42e8db9e74 Merge branch '2555-workaround-truncated-64-bit-enum-in-journal-on-windows' into 'main'
Resolve "journal test fails on Windows"

Closes #2555

See merge request isc-projects/bind9!4784
2021-03-08 08:42:14 +00:00
Evan Hunt
990dd9dbff fix automatic journal upgrade on windows
- use a value less than 2^32 for DNS_ZONEFLG_FIXJOURNAL; a larger value
  could cause problems in some build environments. the zone flag
  DNS_ZONEFLG_DIFFONRELOAD, which was no longer in use, has now been
  deleted and its value reused for _FIXJOURNAL.
2021-03-08 08:51:34 +01:00
Evan Hunt
46c11726d4 add start and end serial numbers to 'named-printjournal -x'
add the starting and ending serial number from the journal
header to the output of dns_journal_print().
2021-03-08 08:51:34 +01:00
Mark Andrews
bc714bc5c5 Merge branch '2559-cid-329159-logically-dead-code-in-lib-dns-journal-c' into 'main'
Resolve "CID 329159: Logically dead code in lib/dns/journal.c"

Closes #2559

See merge request isc-projects/bind9!4780
2021-03-08 05:25:17 +00:00
Mark Andrews
848e336db4 Silence CID 329159: Logically dead code in lib/dns/journal.c
*** CID 329159:    (DEADCODE)
    /lib/dns/journal.c: 1719 in dns_journal_print()
    1713     		}
    1714     		CHECK(dns_difftuple_create(
    1715     			diff.mctx, n_soa == 1 ? DNS_DIFFOP_DEL : DNS_DIFFOP_ADD,
    1716     			name, ttl, rdata, &tuple));
    1717     		dns_diff_append(&diff, &tuple);
    1718
    >>>     CID 329159:    (DEADCODE)
    >>>     Execution cannot reach the expression "printxhdr" inside this statement: "if (++n_put != 0U || printx...".
    1719     		if (++n_put != 0 || printxhdr) {
    1720     			result = dns_diff_print(&diff, file);
    1721     			dns_diff_clear(&diff);
    1722     			n_put = 0;
    1723     			if (result != ISC_R_SUCCESS) {
    1724     				break;
    /lib/dns/journal.c: 1734 in dns_journal_print()
    1728     	if (result == ISC_R_NOMORE) {
    1729     		result = ISC_R_SUCCESS;
    1730     	}
    1731     	CHECK(result);
    1732
    1733     	if (!printxhdr && n_put != 0) {
    >>>     CID 329159:    (DEADCODE)
    >>>     Execution cannot reach this statement: "result = dns_diff_print(&di...".
    1734     		result = dns_diff_print(&diff, file);
    1735     		dns_diff_clear(&diff);
    1736     	}
    1737     	goto cleanup;
    1738
    1739     failure:
2021-03-08 05:06:29 +00:00
Mark Andrews
279c8a837b Merge branch '2560-cid-329157-dereference-before-null-check-in-lib-dns-journal-c' into 'main'
Resolve "CID 329157: Dereference before null check in lib/dns/journal.c"

Closes #2560

See merge request isc-projects/bind9!4779
2021-03-08 05:06:06 +00:00
Mark Andrews
4054405909 Silence CID 329157: Dereference before null check in lib/dns/journal.c
*** CID 329157:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/journal.c: 754 in journal_open()
    748     			    j->header.index_size * sizeof(journal_rawpos_t));
    749     	}
    750     	if (j->index != NULL) {
    751     		isc_mem_put(j->mctx, j->index,
    752     			    j->header.index_size * sizeof(journal_pos_t));
    753     	}
       CID 329157:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "j->filename" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    754     	if (j->filename != NULL) {
    755     		isc_mem_free(j->mctx, j->filename);
    756     	}
    757     	if (j->fp != NULL) {
    758     		(void)isc_stdio_close(j->fp);
    759     	}
2021-03-08 05:05:28 +00:00
Mark Andrews
27117f7b46 Merge branch 'marka-add-journal-to-conf-sh-common' into 'main'
Add journal to conf.sh.common

See merge request isc-projects/bind9!4781
2021-03-08 01:12:54 +00:00
Mark Andrews
926b9056b7 add journal to conf.sh.common 2021-03-08 11:36:00 +11:00
Artem Boldariev
d6f33fcd6c Merge branch '1641-doh-dig' into 'main'
Resolve "RFC8484, DoH support in DIG (and any other relevant utilities)"

Closes #2464 and #1641

See merge request isc-projects/bind9!4672
2021-03-05 16:46:02 +00:00
Evan Hunt
f3b13c6027 CHANGES, release notes 2021-03-05 18:09:42 +02:00
Evan Hunt
dbffb212ce add basic DoH system tests
- rename dot to doth, as it now covers both dot and doh.
- merge xot into doth as it's closely related.
- added long-lived key and cert files (expiring 2121).
- add tests with https-get, https-post, http-plain, alternate
  endpoints, and both static and ephemeral TLS configuration.
- incidentally fixed a memory leak in dig that occurred if +https
  was specified more than once.
2021-03-05 18:09:42 +02:00
Artem Boldariev
7a59fb8207 Disable Nagle's algorithm for HTTP/2 connections
It is advisable to disable Nagle's algorithm for HTTP/2 connections
because multiple HTTP/2 streams could be multiplexed over one
transport connection. Thus, delays when delivering small packets could
bring down performance for the whole session. HTTP/2 is meant to be
used this way.
2021-03-05 18:09:42 +02:00
Artem Boldariev
66d20cf28b Fix deadlock in isc_nm_tlsconnect()
when called from within the context of a network thread,
isc_nm_tlsconnect() hangs. it is waiting for the socket's
result code to be updated, but that update is supposed to happen
asynchronously in the network thread, and if we're already blocking
in the network thread, it can never occur.

we can kluge around this by setting the socket result code
early; this works for most clients (including "dig"), but it causes
inconsistent behaviors that manifest as test failures in the DoH unit
test.

so we kluged around it even more by setting the socket result code
early *only when running in the network thread*. we need a better
solution for this problem, but this will do for now.
2021-03-05 18:09:22 +02:00
Artem Boldariev
ca9a15e3bc DoH: call send callbacks after data was actually sent 2021-03-05 13:29:32 +02:00
Artem Boldariev
71668437d4 Put sane limitations in place to handle bad requests gracefully
This commit makes the server-side code polite.

It fixes the error handling code on the server side and fixes
returning error code in responses (there was a nasty bug which could
potentially crash the server).

Also, in this commit we limit max size POST request data to 96K, max
processed data size in headers to 128K (should be enough to handle any
GET requests).

If these limits are surpassed, server will terminate the request with
RST_STREAM without responding with error code. Otherwise it politely
responds with error code.

This commit also limits number of concurrent HTTP/2 streams per
transport connection on server to 100 (as nghttp2 advises by default).

Ideally, these parameters should be configurable both globally and per
every HTTP endpoint description in the configuration file, but for now
putting sane limits should be enough.
2021-03-05 13:29:32 +02:00
Evan Hunt
88752b1121 refactor outgoing HTTP connection support
- style, cleanup, and removal of unnecessary code.
- combined isc_nm_http_add_endpoint() and isc_nm_http_add_doh_endpoint()
  into one function, renamed isc_http_endpoint().
- moved isc_nm_http_connect_send_request() into doh_test.c as a helper
  function; remove it from the public API.
- renamed isc_http2 and isc_nm_http2 types and functions to just isc_http
  and isc_nm_http, for consistency with other existing names.
- shortened a number of long names.
- the caller is now responsible for determining the peer address.
  in isc_nm_httpconnect(); this eliminates the need to parse the URI
  and the dependency on an external resolver.
- the caller is also now responsible for creating the SSL client context,
  for consistency with isc_nm_tlsdnsconnect().
- added setter functions for HTTP/2 ALPN. instead of setting up ALPN in
  isc_tlsctx_createclient(), we now have a function
  isc_tlsctx_enable_http2client_alpn() that can be run from
  isc_nm_httpconnect().
- refactored isc_nm_httprequest() into separate read and send functions.
  isc_nm_send() or isc_nm_read() is called on an http socket, it will
  be stored until a corresponding isc_nm_read() or _send() arrives; when
  we have both halves of the pair the HTTP request will be initiated.
- isc_nm_httprequest() is renamed isc__nm_http_request() for use as an
  internal helper function by the DoH unit test. (eventually doh_test
  should be rewritten to use read and send, and this function should
  be removed.)
- added implementations of isc__nm_tls_settimeout() and
  isc__nm_http_settimeout().
- increased NGHTTP2 header block length for client connections to 128K.
- use isc_mem_t for internal memory allocations inside nghttp2, to
  help track memory leaks.
- send "Cache-Control" header in requests and responses. (note:
  currently we try to bypass HTTP caching proxies, but ideally we should
  interact with them: https://tools.ietf.org/html/rfc8484#section-5.1)
2021-03-05 13:29:26 +02:00
Ondřej Surý
9c8b7a5c45 add preliminary DoH client support to dig
add options "+https", "+https-get" and "+http-plain" to
allow dig to connect over HTTP/2 channels.
2021-03-05 13:28:17 +02:00
Ondřej Surý
13d23b0c8e Merge branch '1529-add-threadsanitizer-core-dumping-flags-when-we-are-threadsanitizer-clean' into 'main'
Resolve "Add ThreadSanitizer core dumping flags when we are ThreadSanitizer-clean"

Closes #1529

See merge request isc-projects/bind9!4774
2021-03-04 15:25:00 +00:00
Ondřej Surý
4072cc2b93 Disable allow_failure for ThreadSanitizer jobs
Since the main branch is now TSAN-clean, it's a good opportunity to
enable hard failures for the TSAN system test jobs.
2021-03-04 15:32:55 +01:00
Michal Nowak
a730bc47f5 Add ThreadSanitizer core dumping flags
This should let us have core dumps from crashed system test when
ThreadSanitizer is enabled.
2021-03-04 15:32:50 +01:00
Ondřej Surý
80f01cbf42 Merge branch '2455-tcpdns_test-c-runtime-error-load-of-misaligned-address-for-type-uint64_t' into 'main'
Assigning uint64_t from buffer might be misaligned in netmgr tests

Closes #2455

See merge request isc-projects/bind9!4769
2021-03-04 14:28:11 +00:00
Ondřej Surý
a55bdb28f9 Assigning uint64_t from buffer might be misaligned in netmgr tests
Resolve possible 8-byte unaligned access when assigning the magic
value from the received buffer.
2021-03-04 15:02:24 +01:00
Ondřej Surý
cb9df06f7d Merge branch '2533-mdig-move-cleanup' into 'main'
Move cleanup of queries to later in the shutdown sequence

Closes #2533

See merge request isc-projects/bind9!4768
2021-03-04 14:01:15 +00:00
Mark Andrews
4015af02d8 Move cleanup of queries to later in the shutdown sequence
to avoid TSAN report

    WARNING: ThreadSanitizer: data race
      Write of size 8 at 0x000000000001 by main thread:
        #0 free <null>
        #1 default_memfree lib/isc/mem.c:440
        #2 mem_put lib/isc/mem.c:363
        #3 isc__mem_free lib/isc/mem.c:1012
        #4 main bin/tools/mdig.c:2231

      Previous read of size 1 at 0x000000000005 by thread T1:
        #0 dns_name_fromtext lib/dns/name.c:1121
        #1 sendquery bin/tools/mdig.c:596
        #2 sendqueries bin/tools/mdig.c:779
        #3 dispatch lib/isc/task.c:1153
        #4 run lib/isc/task.c:1345
        #5 isc__trampoline_run lib/isc/trampoline.c:184
        #6 <null> <null>

      Thread T1 (running) created by main thread at:
        #0 pthread_create <null>
        #1 isc_thread_create pthreads/thread.c:79
        #2 isc_taskmgr_create lib/isc/task.c:1435
        #3 main bin/tools/mdig.c:2148

    SUMMARY: ThreadSanitizer: data race in __interceptor_free
2021-03-04 13:21:56 +01:00
Michal Nowak
1f8463a6e9 Merge branch '2357-add-CHANGES-entry' into 'main'
Add CHANGES entry for GL #2357

Closes #2357

See merge request isc-projects/bind9!4770
2021-03-04 11:45:06 +00:00
Michal Nowak
d98f72de25 Add CHANGES entry for GL #2357 2021-03-04 12:26:58 +01:00
Ondřej Surý
b532eb3029 Merge branch '2552-comparison-between-signed-and-unsigned-on-arm7' into 'main'
Fix comparison between signed and unsigned integer expressions

Closes #2552

See merge request isc-projects/bind9!4766
2021-03-04 10:24:00 +00:00
Ondřej Surý
d3bb3ae64f Fix comparison between signed and unsigned integer expressions
Simple typecast to size_t should be enough to silence the warning on
ARMv7, even though the code is in fact correct, because the readlen is
checked for being < 0 in the block before the warning.
2021-03-04 11:21:43 +01:00
Ondřej Surý
2c9c16e334 Merge branch '2551-char-is-unsigned-on-arm64' into 'main'
Use int type to store result from isc_commandline_parse()

Closes #2551

See merge request isc-projects/bind9!4765
2021-03-04 10:20:18 +00:00
Ondřej Surý
8153729d3a Use int type to store result from isc_commandline_parse()
The C standard actually doesn't define char as signed or unsigned, and
it could be either according to underlying architecture.  It turns out
that while it's usually signed type, it isn't on arm64 where it's
unsigned.

isc_commandline_parse() return int, just use that instead of the char.
2021-03-04 10:43:00 +01:00
Mark Andrews
fc57dd4c41 Merge branch '2298-multiple-definition-of-librpz_dnsrpzd_path' into 'main'
Resolve "multiple definition of `librpz_dnsrpzd_path'"

Closes #2298

See merge request isc-projects/bind9!4703
2021-03-04 08:22:16 +00:00
Mark Andrews
e12cf5eb57 Add CHANGES for [GL #2298] 2021-03-04 19:21:44 +11:00
Mark Andrews
8f016dd57a Fixed librpz_dnsrpzd_path being a duplicate symbol
librpz_dnsrpzd_path should have been declared extern in dns/librpz.h
2021-03-04 19:20:59 +11:00
Evan Hunt
add81d6480 Merge branch '2505-journal-compatibility' into 'main'
allow dns_journal_rollforward() to read old journal files

Closes #2505

See merge request isc-projects/bind9!4720
2021-03-04 03:18:42 +00:00
Evan Hunt
82b82bb821 CHANGES, release note 2021-03-03 17:54:47 -08:00
Evan Hunt
a0aefa1de6 create 'journal' system test
tests that version 1 journal files containing version 1 transaction
headers are rolled forward correctly on server startup, then updated
into version 2 journals. also checks journal file consistency and
'max-journal-size' behavior.
2021-03-03 17:54:47 -08:00
Evan Hunt
a4972324a6 print journal index data and test for consistency
'named-journalprint -x' now prints the journal's index table and
the offset of each transaction in the journal, so that index consistency
can be confirmed.
2021-03-03 17:54:47 -08:00
Mark Andrews
fb2d0e2897 extend named-journalprint to be able to force the journal version
named-journalprint can now upgrade or downgrade a journal file
in place; the '-u' option upgrades and the '-d' option downgrades.
2021-03-03 17:54:47 -08:00
Evan Hunt
ee19966326 allow dns_journal_rollforward() to read old journal files
when the 'max-ixfr-ratio' option was added, journal transaction
headers were revised to include a count of RR's in each transaction.
this made it impossible to read old journal files after an upgrade.

this branch restores the ability to read version 1 transaction
headers. when rolling forward, printing journal contents, if
the wrong transaction header format is found, we can switch.

when dns_journal_rollforward() detects a version 1 transaction
header, it returns DNS_R_RECOVERABLE.  this triggers zone_postload()
to force a rewrite of the journal file in the new format, and
also to schedule a dump of the zone database with minimal delay.
journal repair is done by dns_journal_compact(), which rewrites
the entire journal, ignoring 'max-journal-size'. journal size is
corrected later.

newly created journal files now have "BIND LOG V9.2" in their headers
instead of "BIND LOG V9". files with the new version string cannot be
read using the old transaction header format. note that this means
newly created journal files will be rejected by older versions of named.

named-journalprint now takes a "-x" option, causing it to print
transaction header information before each delta, including its
format version.
2021-03-03 17:54:47 -08:00
Ondřej Surý
695caaf8d6 Merge branch 'ondrej/call-isc__initialize-shutdown-from-DllMain' into 'main'
Call isc__initialize()/isc__shutdown() from win32 DllMain

See merge request isc-projects/bind9!4759
2021-03-02 07:48:19 +00:00
Ondřej Surý
a50f5d0cf5 Call isc__initialize()/isc__shutdown() from win32 DllMain
Call the libisc isc__initialize() constructor and isc__shutdown()
destructor from DllMain instead of having duplicate code between
those and DllMain() code.
2021-03-01 14:24:57 +01:00
Evan Hunt
8795b12c49 Merge branch 'ondrej/improve-mempool-AddressSanitizer-integration' into 'main'
Improve allocation-deallocation tracking with AddressSanitizer

See merge request isc-projects/bind9!4748
2021-02-26 18:26:28 +00:00
Ondřej Surý
888bdfc1ff Add mempool get/put tracking with AddressSanitizer
When AddressSanitizer is in use, disable the internal mempool
implementation and redirect the isc_mempool_get to isc_mem_get
(and similarly for isc_mempool_put).  This is the method recommended
by the AddressSanitizer authors for tracking allocations and
deallocations instead of custom poison/unpoison code (see
https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning).
2021-02-26 10:05:42 -08:00
Ondřej Surý
aa8f730a22 Merge branch '2396-add-thread-trampoline-for-thread-accounting' into 'main'
Resolve "BIND 9.16 unit tests failing reliably on x86_64 NUMA machines"

Closes #2396

See merge request isc-projects/bind9!4687
2021-02-26 12:44:15 +00:00
4095 changed files with 106399 additions and 148452 deletions

View File

@@ -16,10 +16,6 @@
(concat directory-of-current-dir-locals-file "./"))
;; libisc
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isc/unix/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isc/pthreads/include"))
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/isc/include"))
(expand-file-name
@@ -77,6 +73,9 @@
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/rndc/include"))
(expand-file-name "/usr/include/libxml2")
(expand-file-name "/usr/include/json-c")
(expand-file-name "/usr/local/opt/openssl@1.1/include")
(expand-file-name "/usr/local/opt/libxml2/include/libxml2")
(expand-file-name "/usr/local/opt/json-c/include/json-c/")
@@ -107,8 +106,9 @@
"--enable=all"
"--suppress=missingIncludeSystem"
"--suppress=nullPointerRedundantCheck"
(concat "--suppressions-list=" (expand-file-name
(concat directory-of-current-dir-locals-file "util/suppressions.txt")))
"--suppress=preprocessorErrorDirective"
"--suppress=unknownMacro"
"--suppress=unmatchedSuppression"
(concat "-include=" (expand-file-name
(concat directory-of-current-dir-locals-file "config.h")))
)

15
.github/workflows/lockdown.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: 'Lock down mirror repository'
on:
issues:
types: opened
pull_request:
types: opened
jobs:
lockdown:
runs-on: ubuntu-latest
steps:
- uses: dessant/repo-lockdown@v2
with:
github-token: ${{ github.token }}

2
.gitignore vendored
View File

@@ -62,8 +62,6 @@ timestamp
/compile_commands.json
# Gets generated by Build Ear (bear)
/compile_commands.commands.json
/cppcheck_html/
/cppcheck.results
/tsan
/util/check-make-install
/INSTALL

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,7 @@ email to [security-officer@isc.org](security-officer@isc.org).
- [ ] Determine CVSS score
- [ ] Determine the range of BIND versions affected (including the Subscription Edition)
- [ ] Determine whether workarounds for the problem exists
- [ ] Create a draft of the security advisory and put the information above in there
- [ ] Prepare a detailed description of the problem which should include the following by default:
- instructions for reproducing the problem (a system test is good enough)
- explanation of code flow which triggers the problem (a system test is *not* good enough)
@@ -30,3 +31,7 @@ email to [security-officer@isc.org](security-officer@isc.org).
- [ ] Create/update the private issue containing links to fixes & reproducers for all CVEs fixed in a given release cycle
- [ ] Reserve a block of `CHANGES` placeholders once the complete set of vulnerabilities fixed in a given release cycle is determined
- [ ] Ensure the merge requests containing CVE fixes are merged into `security-*` branches in CVE identifier order
### Post-disclosure actions
- [ ] Merge a regression test reproducing the bug into all affected (and still maintained) BIND branches

View File

@@ -36,26 +36,26 @@
- [ ] ***(QA)*** Check whether all issues assigned to the release milestone are resolved[^1].
- [ ] ***(QA)*** Ensure that there are no outstanding merge requests in the private repository[^1] (Subscription Edition only).
- [ ] ***(QA)*** Ensure all merge requests marked for backporting have been indeed backported.
- [ ] ***(QA)*** Update GitLab settings for all maintained branches to disallow merging to them.
- [ ] ***(QA)*** Announce (on Mattermost) that the code freeze is in effect.
### Before the Tagging Deadline
- [ ] ***(QA)*** Look for outstanding documentation issues (e.g. `CHANGES` mistakes) and address them if any are found.
- [ ] ***(QA)*** Ensure release notes are correct, ask Support and Marketing to check them as well.
- [ ] ***(QA)*** Update API files for libraries with new version information.
- [ ] ***(QA)*** Change software version and library versions in `configure.ac` (new major release only).
- [ ] ***(QA)*** Rebuild `configure` using Autoconf on `docs.isc.org`.
- [ ] ***(QA)*** Update `CHANGES`.
- [ ] ***(QA)*** Update `CHANGES.SE` (Subscription Edition only).
- [ ] ***(QA)*** Update `README.md`.
- [ ] ***(QA)*** Update `version`.
- [ ] ***(QA)*** Build documentation on `docs.isc.org`.
- [ ] ***(QA)*** Check that the formatting is correct for text, PDF, and HTML versions of release notes.
- [ ] ***(QA)*** Check that the formatting of the generated man pages is correct.
- [ ] ***(QA)*** Add a release marker to `CHANGES`.
- [ ] ***(QA)*** Add a release marker to `CHANGES.SE` (Subscription Edition only).
- [ ] ***(QA)*** Update BIND 9 version in `configure.ac` (9.18+) or `version` (9.16).
- [ ] ***(QA)*** Rebuild `configure` using Autoconf on `docs.isc.org` (9.16).
- [ ] ***(QA)*** Tag the releases in the private repository (`git tag -s -m "BIND 9.x.y" v9_x_y`).
### Before the ASN Deadline (for ASN Releases) or the Public Release Date (for Regular Releases)
- [ ] ***(QA)*** Check that the formatting is correct for HTML and PDF versions of release notes.
- [ ] ***(QA)*** Check that the formatting of the generated man pages is correct.
- [ ] ***(QA)*** Verify GitLab CI results for the tags created and prepare a QA report for the releases to be published.
- [ ] ***(QA)*** Update GitLab settings for all maintained branches to allow merging to them again.
- [ ] ***(QA)*** Prepare and merge MRs resetting the release notes and updating the version string for each maintained branch.
- [ ] ***(QA)*** Announce (on Mattermost) that the code freeze is over.
- [ ] ***(QA)*** Request signatures for the tarballs, providing their location and checksums.
- [ ] ***(Signers)*** Validate tarball checksums, sign tarballs, and upload signatures.
- [ ] ***(QA)*** Verify tarball signatures and check tarball checksums again.
@@ -71,21 +71,22 @@
- [ ] ***(Support)*** Publish links to downloads on ISC website.
- [ ] ***(Support)*** Write release email to *bind-announce*.
- [ ] ***(Support)*** Write email to *bind-users* (if a major release).
- [ ] ***(Support)*** Send eligible customers updated links to the Subscription Edition.
- [ ] ***(Support)*** Send eligible customers updated links to the Subscription Edition (update the -S edition delivery tickets, even if those links were provided earlier via an ASN ticket).
- [ ] ***(Support)*** Update tickets in case of waiting support customers.
- [ ] ***(QA)*** Build and test any outstanding private packages.
- [ ] ***(QA)*** Build public packages (`*.deb`, RPMs).
- [ ] ***(QA)*** Build public RPMs.
- [ ] ***(SwEng)*** Build Debian/Ubuntu packages.
- [ ] ***(SwEng)*** Update Docker images.
- [ ] ***(QA)*** Inform Marketing of the release.
- [ ] ***(QA)*** Update the internal [BIND release dates wiki page](https://wiki.isc.org/bin/view/Main/BindReleaseDates) when public announcement has been made.
- [ ] ***(Marketing)*** Post short note to Twitter.
- [ ] ***(Marketing)*** Update [Wikipedia entry for BIND](https://en.wikipedia.org/wiki/BIND).
- [ ] ***(Marketing)*** Write blog article (if a major release).
- [ ] ***(QA)*** Ensure all new tags are annotated and signed.
- [ ] ***(QA)*** Push tags for the published releases to the public repository.
- [ ] ***(QA)*** Merge the automatically prepared `prep 9.x.y` commit which updates `version` and documentation on the release branch into the relevant maintenance branch (`v9_x`).
- [ ] ***(QA)*** For each maintained branch, update the `BIND_BASELINE_VERSION` variable for the `abi-check` job in `.gitlab-ci.yml` to the latest published BIND version tag for a given branch.
- [ ] ***(QA)*** Prepare empty release notes for the next set of releases.
- [ ] ***(QA)*** Sanitize all confidential issues assigned to the release milestone and make them public.
- [ ] ***(QA)*** Merge published release tags (non-linearly) back into the their relevant development/maintenance branches.
- [ ] ***(QA)*** Sanitize confidential issues which are assigned to the current release milestone and do not describe a security vulnerability, then make them public.
- [ ] ***(QA)*** Sanitize confidential issues which are assigned to older release milestones and describe security vulnerabilities, then make them public if appropriate[^2].
- [ ] ***(QA)*** Update QA tools used in GitLab CI (e.g. Flake8, PyLint) by modifying the relevant `Dockerfile`.
[^1]: If not, use the time remaining until the tagging deadline to ensure all outstanding issues are either resolved or moved to a different milestone.
[^2]: As a rule of thumb, security vulnerabilities which have reproducers merged to the public repository are considered okay for full disclosure.

View File

@@ -13,6 +13,7 @@ extraction:
- "libidn2-dev"
- "libmaxminddb-dev"
- "libuv1-dev"
- "libnghttp2-dev"
configure:
command:
- "autoreconf -fi"

View File

@@ -1,7 +1,9 @@
[MASTER]
disable=
C0103, # invalid-name
C0114, # missing-module-docstring
C0115, # missing-class-docstring
C0116, # missing-function-docstring
C0209, # consider-using-f-string
C0415, # import-outside-toplevel
R0801, # duplicate-code
C0103, # invalid-name

184
.reuse/dep5 Normal file
View File

@@ -0,0 +1,184 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: BIND 9
Upstream-Contact: Internet Systems Consortium, Inc. ("ISC") <info@isc.org>
Source: https://gitlab.isc.org/isc-projects/bind9/
#
# Build system, data files from tests, and misc cruft
#
Files: **/*.after*
**/*.bad
**/*.batch
**/*.before*
**/*.ccache
**/*.good
**/*.key
**/*.pem
**/*.private
**/*.raw
**/*.saved
**/*.zonelist
**/*dig.out*
**/Makefile
**/Makefile.*
**/testdata/*
.github/*
.gitlab/*
AUTHORS
CHANGES
COPYRIGHT
Makefile
Makefile.*
bin/tests/system/checkzone/zones/bad-caa-rr.db
bin/tests/system/checkzone/zones/bad1.db
bin/tests/system/checkzone/zones/crashzone.db
bin/tests/system/dnstap/large-answer.fstrm
bin/tests/system/doth/CA/CA.cfg
bin/tests/system/doth/CA/README
bin/tests/system/doth/CA/index.txt
bin/tests/system/doth/CA/index.txt.attr
bin/tests/system/doth/CA/serial
bin/tests/system/notify/ns4/named.port.in
bin/tests/system/formerr/nametoolong
bin/tests/system/formerr/noquestions
bin/tests/system/formerr/twoquestions
bin/tests/system/journal/ns1/managed-keys.bind.in
bin/tests/system/journal/ns1/managed-keys.bind.jnl.in
bin/tests/system/journal/ns2/managed-keys.bind.in
bin/tests/system/journal/ns2/managed-keys.bind.jnl.in
bin/tests/system/keepalive/expected
bin/tests/system/legacy/ns6/edns512.db.signed
bin/tests/system/legacy/ns7/edns512-notcp.db.signed
bin/tests/system/nsupdate/commandlist
bin/tests/system/nsupdate/verylarge.in
bin/tests/system/org.isc.bind.system.plist
bin/tests/system/pipelined/input
bin/tests/system/pipelined/inputb
bin/tests/system/pipelined/ref
bin/tests/system/pipelined/refb
bin/tests/system/rsabigexponent/ns2/dsset-example.in
bin/tests/system/run.gdb
bin/tests/system/runtime/ctrl-chars
bin/tests/system/runtime/long-cmd-line
bin/tests/system/statschannel/traffic.expect.1
bin/tests/system/statschannel/traffic.expect.2
bin/tests/system/statschannel/traffic.expect.4
bin/tests/system/statschannel/traffic.expect.5
bin/tests/system/statschannel/traffic.expect.6
bin/tests/system/tcp/1996-alloc_dnsbuf-crash-test.pkt
bin/tests/system/tsig/badlocation
bin/tests/system/tsig/badtime
bin/tests/system/unknown/large.out
bin/tests/system/xfer/ans5/badkeydata
bin/tests/system/xfer/ans5/badmessageid
bin/tests/system/xfer/ans5/goodaxfr
bin/tests/system/xfer/ans5/partial
bin/tests/system/xfer/ans5/soamismatch
bin/tests/system/xfer/ans5/unknownkey
bin/tests/system/xfer/ans5/unsigned
bin/tests/system/xfer/ans5/wrongkey
bin/tests/system/xfer/ans5/wrongname
bin/tests/system/xfer/knowngood.mapped
cocci/*.cocci
cocci/*.disabled
cocci/*.spatch
doc/arm/isc-logo.pdf
doc/arm/requirements.txt
doc/man/*.1in
doc/man/*.5in
doc/man/*.8in
fuzz/*.in/*
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: MPL-2.0
#
# DNSSEC Guide images
#
Files: doc/dnssec-guide/img/*.png
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: MPL-2.0
#
# Libtool Files
#
Files: m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/ltversion.m4
m4/lt~obsolete.m4
Copyright: Free Software Foundation, Inc.
License:
This file is free software; the Free Software Foundation gives unlimited
permission to copy and/or distribute it, with or without modifications, as long
as this notice is preserved.
#
# DLZ Modules
#
Files: contrib/dlz/modules/*/testing/*
Copyright: Internet Systems Consortium, Inc. ("ISC")
Stichting NLnet, Netherlands
License: ISC and MPL-2.0
#
# Stuff that's basically uncopyrightable (configuration, generated files),
# use CC0-1.0 for clarity that we don't care
#
Files: **/.clang-format
**/.clang-format.headers
**/.dir-locals.el
**/.gitattributes
**/.gitignore
**/named*.args
**/named.dropedns
**/named.ednsformerr
**/named.ednsnotimp
**/named.ednsrefused
**/named.maxudp1460
**/named.maxudp512
**/named.noaa
**/named.noedns
**/named.nosoa
**/named.notcp
**/startme
.clang-format
.clang-format.headers
.dir-locals.el
.gitattributes
.gitignore
.gitlab-ci.yml
.lgtm.yml
.pylintrc
.uncrustify.cfg
doc/misc/*.zoneopt
doc/misc/options
doc/misc/options.active
tsan-suppressions.txt
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: CC0-1.0
#
# geoip2 test files (mmdb is generated from json)
#
Files: bin/tests/system/geoip2/data/*.json
bin/tests/system/geoip2/data/*.mmdb
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: CC0-1.0
#
# files that may be left over from other branches.
#
# in a newly cloned branch or after running "git clean", these
# files don't exist, but they can be left lying around after
# checking out an older branch. we explicitly ignore them so they
# won't clutter up the output when running "reuse lint" by hand
# in a working source tree.
#
Files: **/platform.h
bin/python/*
bin/tests/optional/*
make/*
unit/unittest.sh
Copyright: Internet Systems Consortium, Inc. ("ISC")
License: CC0-1.0

View File

@@ -0,0 +1,16 @@
{% for copyright_line in copyright_lines %}
{{ copyright_line }}
{% endfor %}
{% for expression in spdx_expressions %}
SPDX-License-Identifier: {{ expression }}
{% endfor %}
{% if "MPL-2.0" in spdx_expressions %}
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
{% endif %}

1381
CHANGES

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,16 @@
<!--
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
SPDX-License-Identifier: MPL-2.0
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
-->
# BIND 9 Code of Conduct
Like the technical community as a whole, the BIND 9 team and community is made

View File

@@ -1,12 +1,14 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
SPDX-License-Identifier: MPL-2.0
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
-->
## BIND 9 Source Access and Contributor Guidelines
*May 28, 2020*

View File

@@ -1,4 +1,4 @@
Copyright (C) 1996-2021 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 1996-2022 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@@ -1,632 +0,0 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
### Functional enhancements from prior major releases of BIND 9
#### BIND 9.16
BIND 9.16 (a stable branch based on the 9.15 development branch)
includes a number of changes from BIND 9.14 and earlier releases.
New features include:
* New `dnssec-policy` statement to configure a key and signing policy
for zones, enabling automatic key regeneration and rollover.
* New network manager based on `libuv`.
* Added support for the new GeoIP2 geolocation API, `libmaxminddb`.
* Improved DNSSEC trust anchor configuration using the `trust-anchors`
statement, permitting configuration of trust anchors in DS as well as
DNSKEY format.
* YAML output for `dig`, `mdig`, and `delv`.
#### BIND 9.14
BIND 9.14 (a stable branch based on the 9.13 development branch)
includes a number of changes from BIND 9.12 and earlier releases.
New features include:
* A new "plugin" mechanism has been added to allow query functionality
to be extended using dynamically loadable libraries. The "filter-aaaa"
feature has been removed from named and is now implemented as a plugin.
* Socket and task code has been refactored to improve performance.
* QNAME minimization, as described in RFC 7816, is now supported.
* "Root key sentinel" support, enabling validating resolvers to indicate
via a special query which trust anchors are configured for the root zone.
* Secondary zones can now be configured as "mirror" zones; their contents
are transferred in as with traditional slave zones, but are subject to
DNSSEC validation and are not treated as authoritative data when
answering. This makes it easier to configure a local copy of the root
zone as described in RFC 7706.
* The "validate-except" option allows configuration of domains below which
DNSSEC validation should not be performed.
* The default value of "dnssec-validation" is now "auto".
* IDNA2008 is now supported when linking with `libidn2`.
* "named -V" now outputs the default paths for files used by named
and other tools.
In addition, workarounds that were formerly in place to enable resolution
of domains whose authoritative servers did not respond to EDNS queries
have been removed. See [https://dnsflagday.net](https://dnsflagday.net)
for more details.
Cryptographic support has been modernized. BIND now uses the
best available pseudo-random number generator for the platform on which
it's built. Very old versions of OpenSSL are no longer supported.
Cryptography is now mandatory: building BIND without DNSSEC is no
longer supported.
Special code to support certain legacy operating systems has also
been removed; see the file [PLATFORMS.md](PLATFORMS.md) for details
of supported platforms. In addition to OpenSSL, BIND now requires
support for IPv6, threads, and standard atomic operations provided
by the C compiler.
#### BIND 9.12
BIND 9.12 includes a number of changes from BIND 9.11 and earlier releases.
New features include:
* `named` and related libraries have been substantially refactored for
improved query performance -- particularly on delegation heavy zones --
and for improved readability, maintainability, and testability.
* Code implementing the name server query processing logic has been moved
into a new `libns` library, for easier testing and use in tools other
than `named`.
* Cached, validated NSEC and other records can now be used to synthesize
NXDOMAIN responses.
* The DNS Response Policy Service API (DNSRPS) is now supported.
* Setting `'max-journal-size default'` now limits the size of journal files
to twice the size of the zone.
* `dnstap-read -x` prints a hex dump of the wire format of each logged
DNS message.
* `dnstap` output files can now be configured to roll automatically when
reaching a given size.
* Log file timestamps can now also be formatted in ISO 8601 (local) or ISO
8601 (UTC) formats.
* Logging channels and `dnstap` output files can now be configured to use a
timestamp as the suffix when rolling to a new file.
* `'named-checkconf -l'` lists zones found in `named.conf`.
* Added support for the EDNS Padding and Keepalive options.
* 'new-zones-directory' option sets the location where the configuration
data for zones added by rndc addzone is stored.
* The default key algorithm in `rndc-confgen` is now hmac-sha256.
* `filter-aaaa-on-v4` and `filter-aaaa-on-v6` options are now available
by default without a configure option.
* The obsolete `isc-hmac-fixup` command has been removed.
#### BIND 9.11
BIND 9.11.0 includes a number of changes from BIND 9.10 and earlier
releases. New features include:
- Added support for Catalog Zones, a new method for provisioning servers: a
list of zones to be served is stored in a DNS zone, along with their
configuration parameters. Changes to the catalog zone are propagated to
slaves via normal AXFR/IXFR, whereupon the zones that are listed in it
are automatically added, deleted or reconfigured.
- Added support for "dnstap", a fast and flexible method of capturing and
logging DNS traffic.
- Added support for "dyndb", a new API for loading zone data from an
external database, developed by Red Hat for the FreeIPA project.
- "fetchlimit" quotas are now compiled in by default. These are for the
use of recursive resolvers that are are under high query load for domains
whose authoritative servers are nonresponsive or are experiencing a
denial of service attack:
- "fetches-per-server" limits the number of simultaneous queries that
can be sent to any single authoritative server. The configured value
is a starting point; it is automatically adjusted downward if the
server is partially or completely non-responsive. The algorithm used
to adjust the quota can be configured via the "fetch-quota-params"
option.
- "fetches-per-zone" limits the number of simultaneous queries that can
be sent for names within a single domain. (Note: Unlike
"fetches-per-server", this value is not self-tuning.)
- New stats counters have been added to count queries spilled due to
these quotas.
- Added a new "dnssec-keymgr" key mainenance utility, which can generate or
update keys as needed to ensure that a zone's keys match a defined DNSSEC
policy.
- The experimental "SIT" feature in BIND 9.10 has been renamed "COOKIE" and
is no longer optional. EDNS COOKIE is a mechanism enabling clients to
detect off-path spoofed responses, and servers to detect spoofed-source
queries. Clients that identify themselves using COOKIE options are not
subject to response rate limiting (RRL) and can receive larger UDP
responses.
- SERVFAIL responses can now be cached for a limited time (defaulting to 1
second, with an upper limit of 30). This can reduce the frequency of
retries when a query is persistently failing.
- Added an "nsip-wait-recurse" switch to RPZ. This causes NSIP rules to be
skipped if a name server IP address isn't in the cache yet; the address
will be looked up and the rule will be applied on future queries.
- Added a Python RNDC module. This allows multiple commands to sent over a
persistent RNDC channel, which saves time.
- The "controls" block in named.conf can now grant read-only "rndc" access
to specified clients or keys. Read-only clients could, for example, check
"rndc status" but could not reconfigure or shut down the server.
- "rndc" commands can now return arbitrarily large amounts of text to the
caller.
- The zone serial number of a dynamically updatable zone can now be set via
"rndc signing -serial <number> <zonename>". This allows inline-signing
zones to be set to a specific serial number.
- The new "rndc nta" command can be used to set a Negative Trust Anchor
(NTA), disabling DNSSEC validation for a specific domain; this can be
used when responses from a domain are known to be failing validation due
to administrative error rather than because of a spoofing attack.
Negative trust anchors are strictly temporary; by default they expire
after one hour, but can be configured to last up to one week.
- "rndc delzone" can now be used on zones that were not originally created
by "rndc addzone".
- "rndc modzone" reconfigures a single zone, without requiring the entire
server to be reconfigured.
- "rndc showzone" displays the current configuration of a zone.
- "rndc managed-keys" can be used to check the status of RFC 5011 managed
trust anchors, or to force trust anchors to be refreshed.
- "max-cache-size" can now be set to a percentage of available memory. The
default is 90%.
- Update forwarding performance has been improved by allowing a single TCP
connection to be shared by multiple updates.
- The EDNS Client Subnet (ECS) option is now supported for authoritative
servers; if a query contains an ECS option then ACLs containing "geoip"
or "ecs" elements can match against the the address encoded in the
option. This can be used to select a view for a query, so that different
answers can be provided depending on the client network.
- The EDNS EXPIRE option has been implemented on the client side, allowing
a slave server to set the expiration timer correctly when transferring
zone data from another slave server.
- The key generation and manipulation tools (dnssec-keygen, dnssec-settime,
dnssec-importkey, dnssec-keyfromlabel) now take "-Psync" and "-Dsync"
options to set the publication and deletion times of CDS and CDNSKEY
parent-synchronization records. Both named and dnssec-signzone can now
publish and remove these records at the scheduled times.
- A new "minimal-any" option reduces the size of UDP responses for query
type ANY by returning a single arbitrarily selected RRset instead of all
RRsets.
- A new "masterfile-style" zone option controls the formatting of text zone
files: When set to "full", a zone file is dumped in
single-line-per-record format.
- "serial-update-method" can now be set to "date". On update, the serial
number will be set to the current date in YYYYMMDDNN format.
- "dnssec-signzone -N date" sets the serial number to YYYYMMDDNN.
- "named -L <filename>" causes named to send log messages to the specified
file by default instead of to the system log.
- "dig +ttlunits" prints TTL values with time-unit suffixes: w, d, h, m, s
for weeks, days, hours, minutes, and seconds.
- "dig +unknownformat" prints dig output in RFC 3597 "unknown record"
presentation format.
- "dig +ednsopt" allows dig to set arbitrary EDNS options on requests.
- "dig +ednsflags" allows dig to set yet-to-be-defined EDNS flags on
requests.
- "mdig" is an alternate version of dig which sends multiple pipelined TCP
queries to a server. Instead of waiting for a response after sending a
query, it sends all queries immediately and displays responses in the
order received.
- "serial-query-rate" no longer controls NOTIFY messages. These are
separately controlled by "notify-rate" and "startup-notify-rate".
- "nsupdate" now performs "check-names" processing by default on records to
be added. This can be disabled with "check-names no".
- The statistics channel now supports DEFLATE compression, reducing the
size of the data sent over the network when querying statistics.
- New counters have been added to the statistics channel to track the sizes
of incoming queries and outgoing responses in histogram buckets, as
specified in RSSAC002.
- A new NXDOMAIN redirect method (option "nxdomain-redirect") has been
added, allowing redirection to a specified DNS namespace instead of a
single redirect zone.
- When starting up, named now ensures that no other named process is
already running.
- Files created by named to store information, including "mkeys" and "nzf"
files, are now named after their corresponding views unless the view name
contains characters incompatible with use as a filename. Old style
filenames (based on the hash of the view name) will still work.
#### BIND 9.10.0
BIND 9.10.0 includes a number of changes from BIND 9.9 and earlier
releases. New features include:
- DNS Response-rate limiting (DNS RRL), which blunts the
impact of reflection and amplification attacks, is always
compiled in and no longer requires a compile-time option
to enable it.
- An experimental "Source Identity Token" (SIT) EDNS option
is now available. Similar to DNS Cookies as invented by
Donald Eastlake 3rd, these are designed to enable clients
to detect off-path spoofed responses, and to enable servers
to detect spoofed-source queries. Servers can be configured
to send smaller responses to clients that have not identified
themselves using a SIT option, reducing the effectiveness of
amplification attacks. RRL processing has also been updated;
clients proven to be legitimate via SIT are not subject to
rate limiting. Use "configure --enable-sit" to enable this
feature in BIND.
- A new zone file format, "map", stores zone data in a
format that can be mapped directly into memory, allowing
significantly faster zone loading.
- "delv" (domain entity lookup and validation) is a new tool
with dig-like semantics for looking up DNS data and performing
internal DNSSEC validation. This allows easy validation in
environments where the resolver may not be trustworthy, and
assists with troubleshooting of DNSSEC problems. (NOTE:
In previous development releases of BIND 9.10, this utility
was called "delve". The spelling has been changed to avoid
confusion with the "delve" utility included with the Xapian
search engine.)
- Improved EDNS(0) processing for better resolver performance
and reliability over slow or lossy connections.
- A new "configure --with-tuning=large" option tunes certain
compiled-in constants and default settings to values better
suited to large servers with abundant memory. This can
improve performance on such servers, but will consume more
memory and may degrade performance on smaller systems.
- Substantial improvement in response-policy zone (RPZ)
performance. Up to 32 response-policy zones can be
configured with minimal performance loss.
- To improve recursive resolver performance, cache records
which are still being requested by clients can now be
automatically refreshed from the authoritative server
before they expire, reducing or eliminating the time
window in which no answer is available in the cache.
- New "rpz-client-ip" triggers and drop policies allowing
response policies based on the IP address of the client.
- ACLs can now be specified based on geographic location
using the MaxMind GeoIP databases. Use "configure
--with-geoip" to enable.
- Zone data can now be shared between views, allowing
multiple views to serve the same zones authoritatively
without storing multiple copies in memory.
- New XML schema (version 3) for the statistics channel
includes many new statistics and uses a flattened XML tree
for faster parsing. The older schema is now deprecated.
- A new stylesheet, based on the Google Charts API, displays
XML statistics in charts and graphs on javascript-enabled
browsers.
- The statistics channel can now provide data in JSON
format as well as XML.
- New stats counters track TCP and UDP queries received
per zone, and EDNS options received in total.
- The internal and export versions of the BIND libraries
(libisc, libdns, etc) have been unified so that external
library clients can use the same libraries as BIND itself.
- A new compile-time option, "configure --enable-native-pkcs11",
allows BIND 9 cryptography functions to use the PKCS#11 API
natively, so that BIND can drive a cryptographic hardware
service module (HSM) directly instead of using a modified
OpenSSL as an intermediary. (Note: This feature requires an
HSM to have a full implementation of the PKCS#11 API; many
current HSMs only have partial implementations. The new
"pkcs11-tokens" command can be used to check API completeness.
Native PKCS#11 is known to work with the Thales nShield HSM
and with SoftHSM version 2 from the Open DNSSEC project.)
- The new "max-zone-ttl" option enforces maximum TTLs for
zones. This can simplify the process of rolling DNSSEC keys
by guaranteeing that cached signatures will have expired
within the specified amount of time.
- "dig +subnet" sends an EDNS CLIENT-SUBNET option when
querying.
- "dig +expire" sends an EDNS EXPIRE option when querying.
When this option is sent with an SOA query to a server
that supports it, it will report the expiry time of
a slave zone.
- New "dnssec-coverage" tool to check DNSSEC key coverage
for a zone and report if a lapse in signing coverage has
been inadvertently scheduled.
- Signing algorithm flexibility and other improvements
for the "rndc" control channel.
- "named-checkzone" and "named-compilezone" can now read
journal files, allowing them to process dynamic zones.
- Multiple DLZ databases can now be configured. Individual
zones can be configured to be served from a specific DLZ
database. DLZ databases now serve zones of type "master"
and "redirect".
- "rndc zonestatus" reports information about a specified zone.
- "named" now listens on IPv6 as well as IPv4 interfaces
by default.
- "named" now preserves the capitalization of names
when responding to queries: for instance, a query for
"example.com" may be answered with "example.COM" if the
name was configured that way in the zone file. Some
clients have a bug causing them to depend on the older
behavior, in which the case of the answer always matched
the case of the query, rather than the case of the name
configured in the DNS. Such clients can now be specified
in the new "no-case-compress" ACL; this will restore the
older behavior of "named" for those clients only.
- new "dnssec-importkey" command allows the use of offline
DNSSEC keys with automatic DNSKEY management.
- New "named-rrchecker" tool to verify the syntactic
correctness of individual resource records.
- When re-signing a zone, the new "dnssec-signzone -Q" option
drops signatures from keys that are still published but are
no longer active.
- "named-checkconf -px" will print the contents of configuration
files with the shared secrets obscured, making it easier to
share configuration (e.g. when submitting a bug report)
without revealing private information.
- "rndc scan" causes named to re-scan network interfaces for
changes in local addresses.
- On operating systems with support for routing sockets,
network interfaces are re-scanned automatically whenever
they change.
- "tsig-keygen" is now available as an alternate command
name to use for "ddns-confgen".
#### BIND 9.9.0
BIND 9.9.0 includes a number of changes from BIND 9.8 and earlier
releases. New features include:
- Inline signing, allowing automatic DNSSEC signing of
master zones without modification of the zonefile, or
"bump in the wire" signing in slaves.
- NXDOMAIN redirection.
- New 'rndc flushtree' command clears all data under a given
name from the DNS cache.
- New 'rndc sync' command dumps pending changes in a dynamic
zone to disk without a freeze/thaw cycle.
- New 'rndc signing' command displays or clears signing status
records in 'auto-dnssec' zones.
- NSEC3 parameters for 'auto-dnssec' zones can now be set prior
to signing, eliminating the need to initially sign with NSEC.
- Startup time improvements on large authoritative servers.
- Slave zones are now saved in raw format by default.
- Several improvements to response policy zones (RPZ).
- Improved hardware scalability by using multiple threads
to listen for queries and using finer-grained client locking
- The 'also-notify' option now takes the same syntax as
'masters', so it can used named masterlists and TSIG keys.
- 'dnssec-signzone -D' writes an output file containing only DNSSEC
data, which can be included by the primary zone file.
- 'dnssec-signzone -R' forces removal of signatures that are
not expired but were created by a key which no longer exists.
- 'dnssec-signzone -X' allows a separate expiration date to
be specified for DNSKEY signatures from other signatures.
- New '-L' option to dnssec-keygen, dnssec-settime, and
dnssec-keyfromlabel sets the default TTL for the key.
- dnssec-dsfromkey now supports reading from standard input,
to make it easier to convert DNSKEY to DS.
- RFC 1918 reverse zones have been added to the empty-zones
table per RFC 6303.
- Dynamic updates can now optionally set the zone's SOA serial
number to the current UNIX time.
- DLZ modules can now retrieve the source IP address of
the querying client.
- 'request-ixfr' option can now be set at the per-zone level.
- 'dig +rrcomments' turns on comments about DNSKEY records,
indicating their key ID, algorithm and function
- Simplified nsupdate syntax and added readline support
#### BIND 9.8.0
BIND 9.8.0 includes a number of changes from BIND 9.7 and earlier
releases. New features include:
- Built-in trust anchor for the root zone, which can be
switched on via "dnssec-validation auto;"
- Support for DNS64.
- Support for response policy zones (RPZ).
- Support for writable DLZ zones.
- Improved ease of configuration of GSS/TSIG for
interoperability with Active Directory
- Support for GOST signing algorithm for DNSSEC.
- Removed RTT Banding from server selection algorithm.
- New "static-stub" zone type.
- Allow configuration of resolver timeouts via
"resolver-query-timeout" option.
- The DLZ "dlopen" driver is now built by default.
- Added a new include file with function typedefs
for the DLZ "dlopen" driver.
- Made "--with-gssapi" default.
- More verbose error reporting from DLZ LDAP.
#### BIND 9.7.0
BIND 9.7.0 includes a number of changes from BIND 9.6 and earlier
releases. Most are intended to simplify DNSSEC configuration.
New features include:
- Fully automatic signing of zones by "named".
- Simplified configuration of DNSSEC Lookaside Validation (DLV).
- Simplified configuration of Dynamic DNS, using the "ddns-confgen"
command line tool or the "local" update-policy option. (As a side
effect, this also makes it easier to configure automatic zone
re-signing.)
- New named option "attach-cache" that allows multiple views to
share a single cache.
- DNS rebinding attack prevention.
- New default values for dnssec-keygen parameters.
- Support for RFC 5011 automated trust anchor maintenance
- Smart signing: simplified tools for zone signing and key
maintenance.
- The "statistics-channels" option is now available on Windows.
- A new DNSSEC-aware libdns API for use by non-BIND9 applications
- On some platforms, named and other binaries can now print out
a stack backtrace on assertion failure, to aid in debugging.
- A "tools only" installation mode on Windows, which only installs
dig, host, nslookup and nsupdate.
- Improved PKCS#11 support, including Keyper support and explicit
OpenSSL engine selection.
#### BIND 9.6.0
- Full NSEC3 support
- Automatic zone re-signing
- New update-policy methods tcp-self and 6to4-self
- The BIND 8 resolver library, libbind, has been removed from the BIND 9
distribution and is now available as a separate download.
- Change the default pid file location from /var/run to
/var/run/{named,lwresd} for improved chroot/setuid support.
#### BIND 9.5.0
- GSS-TSIG support (RFC 3645).
- DHCID support.
- Experimental http server and statistics support for named via xml.
- More detailed statistics counters including those supported in BIND 8.
- Faster ACL processing.
- Use Doxygen to generate internal documentation.
- Efficient LRU cache-cleaning mechanism.
- NSID support.
BIND 9.4.0
- Implemented "additional section caching (or acache)", an internal cache
framework for additional section content to improve response performance.
Several configuration options were provided to control the behavior.
- New notify type 'master-only'. Enable notify for master zones only.
- Accept 'notify-source' style syntax for query-source.
- rndc now allows addresses to be set in the server clauses.
- New option "allow-query-cache". This lets "allow-query" be used to
specify the default zone access level rather than having to have every
zone override the global value. "allow-query-cache" can be set at both
the options and view levels. If "allow-query-cache" is not set then
"allow-recursion" is used if set, otherwise "allow-query" is used if set
unless "recursion no;" is set in which case "none;" is used, otherwise
the default (localhost; localnets;) is used.
- rndc: the source address can now be specified.
- ixfr-from-differences now takes master and slave in addition to yes and
no at the options and view levels.
- Allow the journal's name to be changed via named.conf.
- 'rndc notify zone [class [view]]' resend the NOTIFY messages for the
specified zone.
- 'dig +trace' now randomly selects the next servers to try. Report if
there is a bad delegation.
- Improve check-names error messages.
- Make public the function to read a key file, dst_key_read_public().
- dig now returns the byte count for axfr/ixfr.
- allow-update is now settable at the options / view level.
- named-checkconf now checks the logging configuration.
- host now can turn on memory debugging flags with '-m'.
- Don't send notify messages to self.
- Perform sanity checks on NS records which refer to 'in zone' names.
- New zone option "notify-delay". Specify a minimum delay between sets of
NOTIFY messages.
- Extend adjusting TTL warning messages.
- Named and named-checkzone can now both check for non-terminal wildcard
records.
- "rndc freeze/thaw" now freezes/thaws all zones.
- named-checkconf now check acls to verify that they only refer to existing
acls.
- The server syntax has been extended to support a range of servers.
- Report differences between hints and real NS rrset and associated address
records.
- Preserve the case of domain names in rdata during zone transfers.
- Restructured the data locking framework using architecture dependent
atomic operations (when available), improving response performance on
multi-processor machines significantly. x86, x86_64, alpha, powerpc, and
mips are currently supported.
- UNIX domain controls are now supported.
- Add support for additional zone file formats for improving loading
performance. The masterfile-format option in named.conf can be used to
specify a non-default format. A separate command named-compilezone was
provided to generate zone files in the new format. Additionally, the -I
and -O options for dnssec-signzone specify the input and output formats.
- dnssec-signzone can now randomize signature end times (dnssec-signzone -j
jitter).
- Add support for CH A record.
- Add additional zone data constancy checks. named-checkzone has extended
checking of NS, MX and SRV record and the hosts they reference. named
has extended post zone load checks. New zone options: check-mx and
integrity-check.
- edns-udp-size can now be overridden on a per server basis.
- dig can now specify the EDNS version when making a query.
- Added framework for handling multiple EDNS versions.
- Additional memory debugging support to track size and mctx arguments.
- Detect duplicates of UDP queries we are recursing on and drop them. New
stats category "duplicates".
- "USE INTERNAL MALLOC" is now runtime selectable.
- The lame cache is now done on a <qname,qclass,qtype> basis as some
servers only appear to be lame for certain query types.
- Limit the number of recursive clients that can be waiting for a single
query (<qname,qtype,qclass>) to resolve. New options clients-per-query
and max-clients-per-query.
- dig: report the number of extra bytes still left in the packet after
processing all the records.
- Support for IPSECKEY rdata type.
- Raise the UDP receive buffer size to 32k if it is less than 32k.
- x86 and x86_64 now have separate atomic locking implementations.
- named-checkconf now validates update-policy entries.
- Attempt to make the amount of work performed in a iteration self tuning.
The covers nodes clean from the cache per iteration, nodes written to
disk when rewriting a master file and nodes destroyed per iteration when
destroying a zone or a cache.
- ISC string copy API.
- Automatic empty zone creation for D.F.IP6.ARPA and friends. Note: RFC
1918 zones are not yet covered by this but are likely to be in a future
release.
- New options: empty-server, empty-contact, empty-zones-enable and
disable-empty-zone.
- dig now has a '-q queryname' and '+showsearch' options.
- host/nslookup now continue (default)/fail on SERVFAIL.
- dig now warns if 'RA' is not set in the answer when 'RD' was set in the
query. host/nslookup skip servers that fail to set 'RA' when 'RD' is set
unless a server is explicitly set.
- Integrate contributed DLZ code into named.
- Integrate contributed IDN code from JPNIC.
- libbind: corresponds to that from BIND 8.4.7.
#### BIND 9.3.0
- DNSSEC is now DS based (RFC 3658).
- DNSSEC lookaside validation.
- check-names is now implemented.
- rrset-order is more complete.
- IPv4/IPv6 transition support, dual-stack-servers.
- IXFR deltas can now be generated when loading master files,
ixfr-from-differences.
- It is now possible to specify the size of a journal, max-journal-size.
- It is now possible to define a named set of master servers to be used in
masters clause, masters.
- The advertised EDNS UDP size can now be set, edns-udp-size.
- allow-v6-synthesis has been obsoleted.
- Zones containing MD and MF will now be rejected.
- dig, nslookup name. now report "Not Implemented" as NOTIMP rather than
NOTIMPL. This will have impact on scripts that are looking for NOTIMPL.
- libbind: corresponds to that from BIND 8.4.5.
#### BIND 9.2.0
- The size of the cache can now be limited using the "max-cache-size"
option.
- The server can now automatically convert RFC1886-style recursive lookup
requests into RFC2874-style lookups, when enabled using the new option
"allow-v6-synthesis". This allows stub resolvers that support AAAA
records but not A6 record chains or binary labels to perform lookups in
domains that make use of these IPv6 DNS features.
- Performance has been improved.
- The man pages now use the more portable "man" macros rather than the
"mandoc" macros, and are installed by "make install".
- The named.conf parser has been completely rewritten. It now supports
"include" directives in more places such as inside "view" statements, and
it no longer has any reserved words.
- The "rndc status" command is now implemented.
- rndc can now be configured automatically.
- A BIND 8 compatible stub resolver library is now included in lib/bind.
- OpenSSL has been removed from the distribution. This means that to use
DNSSEC, OpenSSL must be installed and the --with-openssl option must be
supplied to configure. This does not apply to the use of TSIG, which
does not require OpenSSL.
- The source distribution now builds on Windows. See
win32utils/readme1.txt and win32utils/win32-build.txt for details.
- This distribution also includes a new lightweight stub resolver library
and associated resolver daemon that fully support forward and reverse
lookups of both IPv4 and IPv6 addresses. This library is considered
experimental and is not a complete replacement for the BIND 8 resolver
library. Applications that use the BIND 8 `res_*` functions to perform
DNS lookups or dynamic updates still need to be linked against the BIND 8
libraries. For DNS lookups, they can also use the new "getrrsetbyname()"
API.
- BIND 9.2 is capable of acting as an authoritative server for DNSSEC
secured zones. This functionality is believed to be stable and complete
except for lacking support for verifications involving wildcard records
in secure zones.
- When acting as a caching server, BIND 9.2 can be configured to perform
DNSSEC secure resolution on behalf of its clients. This part of the
DNSSEC implementation is still considered experimental. For detailed
information about the state of the DNSSEC implementation, see the file
doc/misc/dnssec.

View File

@@ -346,7 +346,7 @@ Exhibit A - Source Code Form License Notice
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
https://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular file,
then You may include the notice in a location (such as a LICENSE file in a

73
LICENSES/Apache-2.0.txt Normal file
View File

@@ -0,0 +1,73 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,26 @@
AUTOCONF CONFIGURE SCRIPT EXCEPTION
Version 3.0, 18 August 2009
Copyright © 2009 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
This Exception is an additional permission under section 7 of the GNU General Public License, version 3 ("GPLv3"). It applies to a given file that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception.
The purpose of this Exception is to allow distribution of Autoconf's typical output under terms of the recipient's choice (including proprietary).
0. Definitions.
"Covered Code" is the source or object code of a version of Autoconf that is a covered work under this License.
"Normally Copied Code" for a version of Autoconf means all parts of its Covered Code which that version can copy from its code (i.e., not from its input file) into its minimally verbose, non-debugging and non-tracing output.
"Ineligible Code" is Covered Code that is not Normally Copied Code.
1. Grant of Additional Permission.
You have permission to propagate output of Autoconf, even if such propagation would otherwise violate the terms of GPLv3. However, if by modifying Autoconf you cause any Ineligible Code of the version you received to become Normally Copied Code of your modified version, then you void this Exception for the resulting covered work. If you convey that resulting covered work, you must remove this Exception in accordance with the second paragraph of Section 7 of GPLv3.
2. No Weakening of Autoconf Copyleft.
The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of Autoconf.

View File

@@ -0,0 +1,9 @@
Copyright (c) <year> <owner> All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

11
LICENSES/BSD-3-Clause.txt Normal file
View File

@@ -0,0 +1,11 @@
Copyright (c) <year> <owner>. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

121
LICENSES/CC0-1.0.txt Normal file
View File

@@ -0,0 +1,121 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.

1
LICENSES/FSFAP.txt Normal file
View File

@@ -0,0 +1 @@
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

View File

@@ -0,0 +1,117 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice

View File

@@ -0,0 +1,232 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.

8
LICENSES/ISC.txt Normal file
View File

@@ -0,0 +1,8 @@
ISC License:
Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
Copyright (c) 1995-2003 by Internet Software Consortium
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@@ -0,0 +1,15 @@
---- LLVM Exceptions to the Apache 2.0 License ----
As an exception, if, as a result of your compiling your source code, portions
of this Software are embedded into an Object form of such source code, you
may redistribute such embedded portions in such Object form without complying
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
In addition, if you combine or link compiled forms of this Software with
software that is licensed under the GPLv2 ("Combined Software") and if a
court of competent jurisdiction determines that the patent provision (Section
3), the indemnity provision (Section 9) or other Section of the License
conflicts with the conditions of the GPLv2, you may retroactively and
prospectively choose to deem waived or otherwise exclude such Section(s) of
the License, but only in their entirety and only with respect to the Combined
Software.

View File

@@ -0,0 +1 @@
As a special exception to the GNU General Public License, if you distribute this file as part of a program that contains a configuration script generated by Autoconf, you may include it under the same distribution terms that you use for the rest of that program.

9
LICENSES/MIT.txt Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

144
LICENSES/MPL-2.0.txt Normal file
View File

@@ -0,0 +1,144 @@
Mozilla Public License Version 2.0
1. Definitions
1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.
1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution" means Covered Software of a particular Contributor.
1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.
1.5. "Incompatible With Secondary Licenses" means
(a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.
1.6. "Executable Form" means any form of the work other than Source Code Form.
1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.
1.8. "License" means this document.
1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.
1.10. "Modifications" means any of the following:
(a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
(b) any new file in Source Code Form that contains any Covered Software.
1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.
1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.
1.13. "Source Code Form" means the form of the work preferred for making modifications.
1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
2. License Grants and Conditions
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
(a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:
(a) for any code that a Contributor has removed from Covered Software; or
(b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or
(c) under Patent Claims infringed by Covered Software in the absence of its Contributions.
This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1.
3. Responsibilities
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s).
3.4. Notices
You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.
4. Inability to Comply Due to Statute or Regulation
If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
5. Termination
5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.
6. Disclaimer of Warranty
Covered Software is provided under this License on an "as is" basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.
7. Limitation of Liability
Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
8. Litigation
Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims.
9. Miscellaneous
This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.
10. Versions of the License
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, you can obtain one at https://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.

View File

@@ -9,26 +9,48 @@ AM_V_SPHINX_0 = @echo " SPHINX $@";
SPHINXBUILDDIR = $(builddir)/_build
LF = \n
RNDC_CONF = .. |rndc_conf| replace:: ``$(sysconfdir)/rndc.conf``
RNDC_KEY = .. |rndc_key| replace:: ``$(sysconfdir)/rndc.key``
NAMED_CONF = .. |named_conf| replace:: ``$(sysconfdir)/named.conf``
BIND_KEYS = .. |bind_keys| replace:: ``$(sysconfdir)/bind.keys``
NAMED_PID = .. |named_pid| replace:: ``$(runstatedir)/named.pid``
SESSION_KEY = .. |session_key| replace:: ``$(runstatedir)/session.key``
export RST_EPILOG = $(RNDC_CONF)$(LF)$(RNDC_KEY)$(LF)$(NAMED_CONF)$(LF)$(BIND_KEYS)$(LF)$(NAMED_PID)$(LF)$(SESSION_KEY)
common_SPHINXOPTS = \
-W \
-c $(srcdir) \
-a \
$(SPHINX_V)
ALLSPHINXOPTS = \
$(common_SPHINXOPTS) \
-D version="$(PACKAGE_VERSION)" \
-D today="$(RELEASE_DATE)" \
-D release="$(PACKAGE_VERSION)" \
$(SPHINXOPTS) \
# The "today" variable set below is not directly used in the ARM, but its value
# is implicitly inserted on the title page of the PDF file produced by Sphinx.
ALLSPHINXOPTS = \
$(common_SPHINXOPTS) \
-D today="$(RELEASE_DATE)" \
-D rst_epilog="$$(printf "$${RST_EPILOG}")" \
$(SPHINXOPTS) \
$(srcdir)
man_SPHINXOPTS = \
$(common_SPHINXOPTS) \
-D version="@""PACKAGE_VERSION@"\
-D today="@""RELEASE_DATE@" \
-D release="@""PACKAGE_VERSION@"\
$(SPHINXOPTS) \
_ = @
man_RNDC_CONF = .. |rndc_conf| replace:: ``$(_)sysconfdir$(_)/rndc.conf``
man_RNDC_KEY = .. |rndc_key| replace:: ``$(_)sysconfdir$(_)/rndc.key``
man_NAMED_CONF = .. |named_conf| replace:: ``$(_)sysconfdir$(_)/named.conf``
man_BIND_KEYS = .. |bind_keys| replace:: ``$(_)sysconfdir$(_)/bind.keys``
man_NAMED_PID = .. |named_pid| replace:: ``$(_)runstatedir$(_)/named.pid``
man_SESSION_KEY = .. |session_key| replace:: ``$(_)runstatedir$(_)/session.key``
export man_RST_EPILOG = $(man_RNDC_CONF)$(LF)$(man_RNDC_KEY)$(LF)$(man_NAMED_CONF)$(LF)$(man_BIND_KEYS)$(LF)$(man_NAMED_PID)$(LF)$(man_SESSION_KEY)
man_SPHINXOPTS = \
$(common_SPHINXOPTS) \
-D version="@""PACKAGE_VERSION@" \
-D today="@""RELEASE_DATE@" \
-D release="@""PACKAGE_VERSION@" \
-D rst_epilog="$$(printf "$${man_RST_EPILOG}")" \
$(SPHINXOPTS) \
$(srcdir)
AM_V_SED = $(AM_V_SED_@AM_V@)

View File

@@ -1,11 +1,20 @@
# Hey Emacs, this is -*- makefile-automake -*- file!
# vim: filetype=automake
unit-local: check
TESTS = $(check_PROGRAMS)
LOG_COMPILER = $(builddir)/../../unit-test-driver.sh
AM_CFLAGS += \
$(TEST_CFLAGS)
AM_CPPFLAGS += \
$(CMOCKA_CFLAGS) \
-DNAMED_PLUGINDIR=\"$(libdir)/named\" \
-DNAMED_PLUGINDIR=\"$(pkglibdir)\" \
-DSKIPPED_TEST_EXIT_CODE=77 \
-DTESTS_DIR=\"$(abs_srcdir)\"
LDADD = \
LDADD += \
$(CMOCKA_LIBS)

View File

@@ -11,7 +11,9 @@ AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-I$(srcdir)/include
AM_LDFLAGS =
AM_LDFLAGS = \
$(STD_LDFLAGS)
LDADD =
if HOST_MACOS
AM_LDFLAGS += \
@@ -20,8 +22,6 @@ endif HOST_MACOS
LIBISC_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/isc/unix/include \
-I$(top_srcdir)/lib/isc/pthreads/include \
-I$(top_srcdir)/lib/isc/include \
-I$(top_builddir)/lib/isc/include

View File

@@ -1,12 +1,14 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
SPDX-License-Identifier: MPL-2.0
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
-->
Setting the `CPPFLAGS` environment variable before running `configure`
can be used to enable certain compile-time options that are not

View File

@@ -1,105 +0,0 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
## Supported platforms
In general, this version of BIND will build and run on any POSIX-compliant
system with a C11-compliant C compiler, BSD-style sockets with RFC-compliant
IPv6 support, POSIX-compliant threads, the `libuv` asynchronous I/O library,
the OpenSSL cryptography library, and the `nghttp2` HTTP/2 library.
The following C11 features are used in BIND 9:
* Atomic operations support from the compiler is needed, either in the form of
builtin operations, C11 atomics, or the `Interlocked` family of functions on
Windows.
* Thread Local Storage support from the compiler is needed, either in the form
of C11 `_Thread_local`/`thread_local`, the `__thread` GCC extension, or
the `__declspec(thread)` MSVC extension on Windows.
BIND 9.17 requires a fairly recent version of `libuv` (at least 1.x). For
some of the older systems listed below, you will have to install an updated
`libuv` package from sources such as EPEL, PPA, or other native sources for
updated packages. The other option is to build and install `libuv` from
source.
Certain optional BIND features have additional library dependencies.
These include `libxml2` and `libjson-c` for statistics, `libmaxminddb` for
geolocation, `libfstrm` and `libprotobuf-c` for DNSTAP, and `libidn2` for
internationalized domain name conversion.
ISC regularly tests BIND on many operating systems and architectures, but
lacks the resources to test all of them. Consequently, ISC is only able to
offer support on a "best effort" basis for some.
### Regularly tested platforms
As of Nov 2020, BIND 9.17 is fully supported and regularly tested on the
following systems:
* Debian 9, 10
* Ubuntu LTS 16.04, 20.04
* Fedora 33
* Red Hat Enterprise Linux / CentOS 7, 8
* FreeBSD 11.4, 12.2
* OpenBSD 6.8
* Alpine Linux 3.13
The amd64, i386, armhf and arm64 CPU architectures are all fully supported.
### Best effort
The following are platforms on which BIND is known to build and run.
ISC makes every effort to fix bugs on these platforms, but may be unable to
do so quickly due to lack of hardware, less familiarity on the part of
engineering staff, and other constraints. With the exception of Windows
Server 2016, none of these are tested regularly by ISC.
* Windows Server 2012 R2, 2016 / x64
* Windows 10 / x64
* macOS 10.12+
* Solaris 11
* NetBSD
* Other Linux distributions still supported by their vendors, such as:
* Ubuntu 19.04+
* Gentoo
* Arch Linux
* OpenWRT/LEDE 17.01+
* Other CPU architectures (mips, mipsel, sparc, ...)
### Community maintained
These systems may not all have the required dependencies for building BIND
easily available, although it will be possible in many cases to compile
those directly from source. The community and interested parties may wish
to help with maintenance, and we welcome patch contributions, although we
cannot guarantee that we will accept them. All contributions will be
assessed against the risk of adverse effect on officially supported
platforms.
* Platforms past or close to their respective EOL dates, such as:
* Ubuntu 14.04, 18.10
* CentOS 6
* Debian Jessie
* FreeBSD 10.x
## Unsupported platforms
These are platforms on which BIND 9.17 is known *not* to build or run:
* Platforms without at least OpenSSL 1.0.2
* Windows 10 / x86
* Windows Server 2012 and older
* Solaris 10 and older
* Platforms that don't support IPv6 Advanced Socket API (RFC 3542)
* Platforms that don't support atomic operations (via compiler or library)
* Linux without NPTL (Native POSIX Thread Library)
* Platforms on which `libuv` cannot be compiled

170
README.md
View File

@@ -1,12 +1,14 @@
<!--
- Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
SPDX-License-Identifier: MPL-2.0
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
-->
# BIND 9
@@ -16,9 +18,6 @@
1. [Reporting bugs and getting help](#help)
1. [Contributing to BIND](#contrib)
1. [Building BIND](#build)
1. [macOS](#macos)
1. [Dependencies](#dependencies)
1. [Compile-time options](#opts)
1. [Automated testing](#testing)
1. [Documentation](#doc)
1. [Change log](#changes)
@@ -49,9 +48,6 @@ Internet infrastructure, developed BIND 9 and is responsible for its
ongoing maintenance and improvement. BIND is open source software
licensed under the terms of the Mozilla Public License, version 2.0.
For a summary of features introduced in past major releases of BIND,
see the file [HISTORY](HISTORY.md).
For a detailed list of changes made throughout the history of BIND 9, see
the file [CHANGES](CHANGES). See [below](#changes) for details on the
CHANGES file format.
@@ -59,7 +55,9 @@ CHANGES file format.
For up-to-date versions and release notes, see
[https://www.isc.org/download/](https://www.isc.org/download/).
For information about supported platforms, see [PLATFORMS](PLATFORMS.md).
For information about supported platforms, see the
["Supported Platforms"](doc/arm/platforms.rst) section in the BIND 9
Administrator Reference Manual.
### <a name="help"/> Reporting bugs and getting help
@@ -126,145 +124,9 @@ including your patch as an attachment, preferably generated by
### <a name="build"/> Building BIND 9
At a minimum, BIND requires a Unix or Linux system with an ANSI C compiler,
basic POSIX support, and a 64-bit integer type. BIND also requires the
`libuv` asynchronous I/O library, the `nghttp2` HTTP/2 library, and a
cryptography provider library such as OpenSSL or a hardware service
module supporting PKCS#11. On Linux, BIND requires the `libcap` library
to set process privileges, though this requirement can be overridden by
disabling capability support at compile time. See [Compile-time
options](#opts) below for details on other libraries that may be
required to support optional features.
Successful builds have been observed on many versions of Linux and
Unix, including RHEL/CentOS, Fedora, Debian, Ubuntu, SLES, openSUSE,
Slackware, Alpine, FreeBSD, NetBSD, OpenBSD, macOS, Solaris,
OpenIndiana, OmniOS CE, HP-UX, and OpenWRT.
BIND 9 is also available for Windows Server 2012 R2 and higher. See
`win32utils/build.txt` for details on building for Windows
systems.
To build on a Unix or Linux system, use:
$ autoreconf -fi (if you are building in the git repository)
$ ./configure
$ make
If you're using Emacs, you might find `make tags` helpful.
Several environment variables, which can be set before running `configure`,
affect compilation. Significant ones are:
|Variable|Description |
|--------------------|-----------------------------------------------|
|`CC`|The C compiler to use. `configure` tries to figure out the right one for supported systems.|
|`CFLAGS`|C compiler flags. Defaults to include -g and/or -O2 as supported by the compiler. Please include '-g' if you need to set `CFLAGS`. |
|`LDFLAGS`|Linker flags. Defaults to empty string.|
Additional environment variables affecting the build are listed at the
end of the `configure` help text, which can be obtained by running the
command:
$ ./configure --help
#### <a name="macos"> macOS
Building on macOS assumes that the "Command Tools for Xcode" are installed.
These can be downloaded from
[https://developer.apple.com/download/more/](https://developer.apple.com/download/more/)
or, if you have Xcode already installed, you can run `xcode-select --install`.
(Note that an Apple ID may be required to access the download page.)
#### <a name="dependencies"> Dependencies
To build BIND you need to have the following packages installed:
libuv
pkg-config / pkgconfig / pkgconf
To build BIND from the git repository, you need the following tools
installed:
autoconf (includes autoreconf)
automake
libtool
#### <a name="opts"/> Compile-time options
To see a full list of configuration options, run `configure --help`.
For the server to support DNSSEC, you need to build it with crypto support.
To use OpenSSL, you should have OpenSSL 1.0.2e or newer installed. If the
OpenSSL library is installed in a nonstandard location, specify the prefix
using `--with-openssl=<PREFIX>` on the configure command line. To use a
PKCS#11 hardware service module for cryptographic operations, specify the
path to the PKCS#11 provider library using `--with-pkcs11=<PREFIX>`, and
configure BIND with `--enable-native-pkcs11`.
To support the HTTP statistics channel, the server must be linked with at
least one of the following libraries: `libxml2`
[http://xmlsoft.org](http://xmlsoft.org) or `json-c`
[https://github.com/json-c/json-c](https://github.com/json-c/json-c).
If these are installed at a nonstandard location, then:
* for `libxml2`, specify the prefix using `--with-libxml2=/prefix`.
* for `json-c`, adjust `PKG_CONFIG_PATH`.
To support compression on the HTTP statistics channel, the server must be
linked against `libzlib`. If this is installed in a nonstandard location,
specify the prefix using `--with-zlib=/prefix`.
To support storing configuration data for runtime-added zones in an LMDB
database, the server must be linked with `liblmdb`. If this is installed in a
nonstandard location, specify the prefix using `with-lmdb=/prefix`.
To support MaxMind GeoIP2 location-based ACLs, the server must be linked
with `libmaxminddb`. This is turned on by default if the library is
found; if the library is installed in a nonstandard location,
specify the prefix using `--with-maxminddb=/prefix`. GeoIP2 support
can be switched off with `--disable-geoip`.
For DNSTAP packet logging, you must have installed `libfstrm`
[https://github.com/farsightsec/fstrm](https://github.com/farsightsec/fstrm)
and `libprotobuf-c`
[https://developers.google.com/protocol-buffers](https://developers.google.com/protocol-buffers),
and BIND must be configured with `--enable-dnstap`.
Certain compiled-in constants and default settings can be decreased to
values better suited to small machines, e.g. OpenWRT boxes, by specifying
`--with-tuning=small` on the `configure` command line. This decreases
memory usage by using smaller structures, but degrades performance.
On Linux, process capabilities are managed in user space using
the `libcap` library, which can be installed on most Linux systems via
the `libcap-dev` or `libcap-devel` package. Process capability support can
also be disabled by configuring with `--disable-linux-caps`.
On some platforms it is necessary to explicitly request large file support
to handle files bigger than 2GB. This can be done by using
`--enable-largefile` on the `configure` command line.
Support for the "fixed" rrset-order option can be enabled or disabled by
specifying `--enable-fixed-rrset` or `--disable-fixed-rrset` on the
configure command line. By default, fixed rrset-order is disabled to
reduce memory footprint.
The `--enable-querytrace` option causes `named` to log every step of
processing every query. The `--enable-singletrace` option turns on the
same verbose tracing, but allows an individual query to be separately
traced by setting its query ID to 0. These options should only be enabled
when debugging, because they have a significant negative impact on query
performance.
`make install` installs `named` and the various BIND 9 libraries. By
default, installation is into /usr/local, but this can be changed with the
`--prefix` option when running `configure`.
You may specify the option `--sysconfdir` to set the directory where
configuration files like `named.conf` go by default, and `--localstatedir`
to set the default parent directory of `run/named.pid`. `--sysconfdir`
defaults to `$prefix/etc` and `--localstatedir` defaults to `$prefix/var`.
For information about building BIND 9, see the
["Building BIND 9"](doc/arm/build.rst) section in the BIND 9
Administrator Reference Manual.
### <a name="testing"/> Automated testing

View File

@@ -1,5 +1 @@
SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen tests plugins
if HAVE_PKCS11
SUBDIRS += pkcs11
endif

View File

@@ -7,7 +7,7 @@ AM_CPPFLAGS += \
$(LIBISCCFG_CFLAGS) \
$(LIBBIND9_CFLAGS)
AM_CPPFLAGS += \
AM_CPPFLAGS += \
-DNAMED_CONFFILE=\"${sysconfdir}/named.conf\"
noinst_LTLIBRARIES = libcheck-tool.la
@@ -16,7 +16,7 @@ libcheck_tool_la_SOURCES = \
check-tool.h \
check-tool.c
LDADD = \
LDADD += \
libcheck-tool.la \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS) \

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -15,10 +17,6 @@
#include <stdbool.h>
#include <stdio.h>
#ifdef _WIN32
#include <Winsock2.h>
#endif /* ifdef _WIN32 */
#include <isc/buffer.h>
#include <isc/log.h>
#include <isc/mem.h>
@@ -26,6 +24,7 @@
#include <isc/netdb.h>
#include <isc/print.h>
#include <isc/region.h>
#include <isc/result.h>
#include <isc/stdio.h>
#include <isc/string.h>
#include <isc/symtab.h>
@@ -42,7 +41,6 @@
#include <dns/rdataset.h>
#include <dns/rdatasetiter.h>
#include <dns/rdatatype.h>
#include <dns/result.h>
#include <dns/types.h>
#include <dns/zone.h>
@@ -575,96 +573,6 @@ setup_logging(isc_mem_t *mctx, FILE *errout, isc_log_t **logp) {
return (ISC_R_SUCCESS);
}
/*% scan the zone for oversize TTLs */
static isc_result_t
check_ttls(dns_zone_t *zone, dns_ttl_t maxttl) {
isc_result_t result;
dns_db_t *db = NULL;
dns_dbversion_t *version = NULL;
dns_dbnode_t *node = NULL;
dns_dbiterator_t *dbiter = NULL;
dns_rdatasetiter_t *rdsiter = NULL;
dns_rdataset_t rdataset;
dns_fixedname_t fname;
dns_name_t *name;
name = dns_fixedname_initname(&fname);
dns_rdataset_init(&rdataset);
CHECK(dns_zone_getdb(zone, &db));
INSIST(db != NULL);
CHECK(dns_db_newversion(db, &version));
CHECK(dns_db_createiterator(db, 0, &dbiter));
for (result = dns_dbiterator_first(dbiter); result == ISC_R_SUCCESS;
result = dns_dbiterator_next(dbiter))
{
result = dns_dbiterator_current(dbiter, &node, name);
if (result == DNS_R_NEWORIGIN) {
result = ISC_R_SUCCESS;
}
CHECK(result);
CHECK(dns_db_allrdatasets(db, node, version, 0, &rdsiter));
for (result = dns_rdatasetiter_first(rdsiter);
result == ISC_R_SUCCESS;
result = dns_rdatasetiter_next(rdsiter))
{
dns_rdatasetiter_current(rdsiter, &rdataset);
if (rdataset.ttl > maxttl) {
char nbuf[DNS_NAME_FORMATSIZE];
char tbuf[255];
isc_buffer_t b;
isc_region_t r;
dns_name_format(name, nbuf, sizeof(nbuf));
isc_buffer_init(&b, tbuf, sizeof(tbuf) - 1);
CHECK(dns_rdatatype_totext(rdataset.type, &b));
isc_buffer_usedregion(&b, &r);
r.base[r.length] = 0;
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/%s TTL %d exceeds "
"maximum TTL %d",
nbuf, tbuf, rdataset.ttl, maxttl);
dns_rdataset_disassociate(&rdataset);
CHECK(ISC_R_RANGE);
}
dns_rdataset_disassociate(&rdataset);
}
if (result == ISC_R_NOMORE) {
result = ISC_R_SUCCESS;
}
CHECK(result);
dns_rdatasetiter_destroy(&rdsiter);
dns_db_detachnode(db, &node);
}
if (result == ISC_R_NOMORE) {
result = ISC_R_SUCCESS;
}
cleanup:
if (node != NULL) {
dns_db_detachnode(db, &node);
}
if (rdsiter != NULL) {
dns_rdatasetiter_destroy(&rdsiter);
}
if (dbiter != NULL) {
dns_dbiterator_destroy(&dbiter);
}
if (version != NULL) {
dns_db_closeversion(db, &version, false);
}
if (db != NULL) {
dns_db_detach(&db);
}
return (result);
}
/*% load the zone */
isc_result_t
load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
@@ -685,9 +593,9 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
zonename, filename, classname);
}
CHECK(dns_zone_create(&zone, mctx));
CHECK(dns_zone_create(&zone, mctx, 0));
dns_zone_settype(zone, dns_zone_master);
dns_zone_settype(zone, dns_zone_primary);
isc_buffer_constinit(&buffer, zonename, strlen(zonename));
isc_buffer_add(&buffer, strlen(zonename));
@@ -728,14 +636,6 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
CHECK(dns_zone_load(zone, false));
/*
* When loading map files we can't catch oversize TTLs during
* load, so we check for them here.
*/
if (fileformat == dns_masterformat_map && maxttl != 0) {
CHECK(check_ttls(zone, maxttl));
}
if (zonep != NULL) {
*zonep = zone;
zone = NULL;
@@ -788,25 +688,3 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
return (result);
}
#ifdef _WIN32
void
InitSockets(void) {
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD(2, 0);
err = WSAStartup(wVersionRequested, &wsaData);
if (err != 0) {
fprintf(stderr, "WSAStartup() failed: %d\n", err);
exit(1);
}
}
void
DestroySockets(void) {
WSACleanup();
}
#endif /* ifdef _WIN32 */

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -9,8 +11,7 @@
* information regarding copyright ownership.
*/
#ifndef CHECK_TOOL_H
#define CHECK_TOOL_H
#pragma once
/*! \file */
@@ -40,13 +41,6 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
dns_masterformat_t fileformat, const dns_master_style_t *style,
const uint32_t rawversion);
#ifdef _WIN32
void
InitSockets(void);
void
DestroySockets(void);
#endif /* ifdef _WIN32 */
extern int debug;
extern const char *journal;
extern bool nomerge;
@@ -56,5 +50,3 @@ extern bool dochecksrv;
extern dns_zoneopt_t zone_options;
ISC_LANG_ENDDECLS
#endif /* ifndef CHECK_TOOL_H */

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -32,7 +34,6 @@
#include <dns/log.h>
#include <dns/name.h>
#include <dns/rdataclass.h>
#include <dns/result.h>
#include <dns/rootns.h>
#include <dns/zone.h>
@@ -57,7 +58,7 @@ isc_log_t *logc = NULL;
} while (0)
/*% usage */
ISC_NORETURN static void
noreturn static void
usage(void);
static void
@@ -245,9 +246,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
* Skip checks when using an alternate data source.
*/
cfg_map_get(zoptions, "database", &dbobj);
if (dbobj != NULL && strcmp("rbt", cfg_obj_asstring(dbobj)) != 0 &&
strcmp("rbt64", cfg_obj_asstring(dbobj)) != 0)
{
if (dbobj != NULL && strcmp("rbt", cfg_obj_asstring(dbobj)) != 0) {
return (ISC_R_SUCCESS);
}
@@ -276,7 +275,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
}
/*
* Is the redirect zone configured as a slave?
* Is the redirect zone configured as a secondary?
*/
if (strcasecmp(cfg_obj_asstring(typeobj), "redirect") == 0) {
cfg_map_get(zoptions, "primaries", &primariesobj);
@@ -305,8 +304,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
zone_options &= ~DNS_ZONEOPT_CHECKDUPRR;
zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL;
} else {
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKDUPRR;
@@ -325,8 +323,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
zone_options &= ~DNS_ZONEOPT_CHECKMX;
zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL;
} else {
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKMX;
@@ -356,8 +353,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
zone_options |= DNS_ZONEOPT_WARNMXCNAME;
zone_options |= DNS_ZONEOPT_IGNOREMXCNAME;
} else {
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_WARNMXCNAME;
@@ -376,8 +372,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
zone_options |= DNS_ZONEOPT_IGNORESRVCNAME;
} else {
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
@@ -400,8 +395,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKSPF;
} else {
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKSPF;
@@ -419,8 +413,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
zone_options &= ~DNS_ZONEOPT_CHECKNAMES;
zone_options &= ~DNS_ZONEOPT_CHECKNAMESFAIL;
} else {
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKNAMES;
@@ -435,11 +428,8 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
masterformat = dns_masterformat_text;
} else if (strcasecmp(masterformatstr, "raw") == 0) {
masterformat = dns_masterformat_raw;
} else if (strcasecmp(masterformatstr, "map") == 0) {
masterformat = dns_masterformat_map;
} else {
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
}
@@ -453,7 +443,7 @@ configure_zone(const char *vclass, const char *view, const cfg_obj_t *zconfig,
NULL);
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "%s/%s/%s: %s\n", view, zname, zclass,
dns_result_totext(result));
isc_result_totext(result));
}
return (result);
}
@@ -611,12 +601,6 @@ main(int argc, char **argv) {
{
isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
}
if (strcasecmp(isc_commandline_argument, "size") == 0) {
isc_mem_debugging |= ISC_MEM_DEBUGSIZE;
}
if (strcasecmp(isc_commandline_argument, "mctx") == 0) {
isc_mem_debugging |= ISC_MEM_DEBUGCTX;
}
break;
default:
break;
@@ -684,7 +668,7 @@ main(int argc, char **argv) {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
/* FALLTHROUGH */
FALLTHROUGH;
case 'h':
usage();
@@ -714,14 +698,8 @@ main(int argc, char **argv) {
conffile = NAMED_CONFFILE;
}
#ifdef _WIN32
InitSockets();
#endif /* ifdef _WIN32 */
RUNTIME_CHECK(setup_logging(mctx, stdout, &logc) == ISC_R_SUCCESS);
dns_result_register();
RUNTIME_CHECK(cfg_parser_create(mctx, logc, &parser) == ISC_R_SUCCESS);
if (nodeprecate) {
@@ -758,9 +736,5 @@ main(int argc, char **argv) {
isc_mem_destroy(&mctx);
#ifdef _WIN32
DestroySockets();
#endif /* ifdef _WIN32 */
return (exit_status);
}

View File

@@ -1,26 +1,18 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
.. iscman:: named-checkconf
.. program:: named-checkconf
.. _man_named-checkconf:
named-checkconf - named configuration file syntax checking tool
@@ -34,72 +26,83 @@ Synopsis
Description
~~~~~~~~~~~
``named-checkconf`` checks the syntax, but not the semantics, of a
``named`` configuration file. The file, along with all files included by it, is parsed and checked for syntax
:program:`named-checkconf` checks the syntax, but not the semantics, of a
:iscman:`named` configuration file. The file, along with all files included by it, is parsed and checked for syntax
errors. If no file is specified,
``/etc/named.conf`` is read by default.
|named_conf| is read by default.
Note: files that ``named`` reads in separate parser contexts, such as
Note: files that :iscman:`named` reads in separate parser contexts, such as
``rndc.key`` and ``bind.keys``, are not automatically read by
``named-checkconf``. Configuration errors in these files may cause
``named`` to fail to run, even if ``named-checkconf`` was successful.
However, ``named-checkconf`` can be run on these files explicitly.
:program:`named-checkconf`. Configuration errors in these files may cause
:iscman:`named` to fail to run, even if :program:`named-checkconf` was successful.
However, :program:`named-checkconf` can be run on these files explicitly.
Options
~~~~~~~
``-h``
.. option:: -h
This option prints the usage summary and exits.
``-j``
When loading a zonefile, this option instructs ``named`` to read the journal if it exists.
.. option:: -j
When loading a zonefile, this option instructs :iscman:`named` to read the journal if it exists.
.. option:: -l
``-l``
This option lists all the configured zones. Each line of output contains the zone
name, class (e.g. IN), view, and type (e.g. primary or secondary).
``-c``
.. option:: -c
This option specifies that only the "core" configuration should be checked. This suppresses the loading of
plugin modules, and causes all parameters to ``plugin`` statements to
be ignored.
``-i``
.. option:: -i
This option ignores warnings on deprecated options.
``-p``
This option prints out the ``named.conf`` and included files in canonical form if
no errors were detected. See also the ``-x`` option.
.. option:: -p
``-t directory``
This option instructs ``named`` to chroot to ``directory``, so that ``include`` directives in the
This option prints out the :iscman:`named.conf` and included files in canonical form if
no errors were detected. See also the :option:`-x` option.
.. option:: -t directory
This option instructs :iscman:`named` to chroot to ``directory``, so that ``include`` directives in the
configuration file are processed as if run by a similarly chrooted
``named``.
:iscman:`named`.
``-v``
This option prints the version of the ``named-checkconf`` program and exits.
.. option:: -v
This option prints the version of the :program:`named-checkconf` program and exits.
.. option:: -x
``-x``
When printing the configuration files in canonical form, this option obscures
shared secrets by replacing them with strings of question marks
(``?``). This allows the contents of ``named.conf`` and related files
(``?``). This allows the contents of :iscman:`named.conf` and related files
to be shared - for example, when submitting bug reports -
without compromising private data. This option cannot be used without
``-p``.
:option:`-p`.
``-z``
This option performs a test load of all zones of type ``primary`` found in ``named.conf``.
.. option:: -z
This option performs a test load of all zones of type ``primary`` found in :iscman:`named.conf`.
.. option:: filename
``filename``
This indicates the name of the configuration file to be checked. If not specified,
it defaults to ``/etc/named.conf``.
it defaults to |named_conf|.
Return Values
~~~~~~~~~~~~~
``named-checkconf`` returns an exit status of 1 if errors were detected
:program:`named-checkconf` returns an exit status of 1 if errors were detected
and 0 otherwise.
See Also
~~~~~~~~
:manpage:`named(8)`, :manpage:`named-checkzone(8)`, BIND 9 Administrator Reference Manual.
:iscman:`named(8) <named>`, :iscman:`named-checkzone(8) <named-checkzone>`, BIND 9 Administrator Reference Manual.

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -24,7 +26,7 @@
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/socket.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/timer.h>
@@ -38,7 +40,6 @@
#include <dns/name.h>
#include <dns/rdataclass.h>
#include <dns/rdataset.h>
#include <dns/result.h>
#include <dns/types.h>
#include <dns/zone.h>
@@ -47,7 +48,7 @@
static int quiet = 0;
static isc_mem_t *mctx = NULL;
dns_zone_t *zone = NULL;
dns_zonetype_t zonetype = dns_zone_master;
dns_zonetype_t zonetype = dns_zone_primary;
static int dumpzone = 0;
static const char *output_filename;
static const char *prog_name = NULL;
@@ -59,12 +60,12 @@ static enum { progmode_check, progmode_compile } progmode;
if (result != ISC_R_SUCCESS) { \
if (!quiet) \
fprintf(stderr, "%s() returned %s\n", \
function, dns_result_totext(result)); \
function, isc_result_totext(result)); \
return (result); \
} \
} while (0)
ISC_NORETURN static void
noreturn static void
usage(void);
static void
@@ -146,8 +147,7 @@ main(int argc, char **argv) {
} else if (PROGCMP("named-compilezone")) {
progmode = progmode_compile;
} else {
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
/* Compilation specific defaults */
@@ -425,7 +425,7 @@ main(int argc, char **argv) {
fprintf(stderr, "%s: invalid argument -%c\n",
prog_name, isc_commandline_option);
}
/* FALLTHROUGH */
FALLTHROUGH;
case 'h':
usage();
@@ -454,8 +454,6 @@ main(int argc, char **argv) {
inputformat = dns_masterformat_raw;
fprintf(stderr, "WARNING: input format raw, version "
"ignored\n");
} else if (strcasecmp(inputformatstr, "map") == 0) {
inputformat = dns_masterformat_map;
} else {
fprintf(stderr, "unknown file format: %s\n",
inputformatstr);
@@ -478,8 +476,6 @@ main(int argc, char **argv) {
fprintf(stderr, "unknown raw format version\n");
exit(1);
}
} else if (strcasecmp(outputformatstr, "map") == 0) {
outputformat = dns_masterformat_map;
} else {
fprintf(stderr, "unknown file format: %s\n",
outputformatstr);
@@ -519,18 +515,12 @@ main(int argc, char **argv) {
usage();
}
#ifdef _WIN32
InitSockets();
#endif /* ifdef _WIN32 */
isc_mem_create(&mctx);
if (!quiet) {
RUNTIME_CHECK(setup_logging(mctx, errout, &lctx) ==
ISC_R_SUCCESS);
}
dns_result_register();
origin = argv[isc_commandline_index++];
if (isc_commandline_index == argc) {
@@ -572,9 +562,6 @@ main(int argc, char **argv) {
isc_log_destroy(&lctx);
}
isc_mem_destroy(&mctx);
#ifdef _WIN32
DestroySockets();
#endif /* ifdef _WIN32 */
return ((result == ISC_R_SUCCESS) ? 0 : 1);
}

View File

@@ -1,82 +1,75 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
.. BEWARE: Do not forget to edit also named-compilezone.rst!
.. iscman:: named-checkzone
.. program:: named-checkzone
.. _man_named-checkzone:
named-checkzone, named-compilezone - zone file validity checking or converting tool
-----------------------------------------------------------------------------------
named-checkzone - zone file validation tool
-------------------------------------------
Synopsis
~~~~~~~~
:program:`named-checkzone` [**-d**] [**-h**] [**-j**] [**-q**] [**-v**] [**-c** class] [**-f** format] [**-F** format] [**-J** filename] [**-i** mode] [**-k** mode] [**-m** mode] [**-M** mode] [**-n** mode] [**-l** ttl] [**-L** serial] [**-o** filename] [**-r** mode] [**-s** style] [**-S** mode] [**-t** directory] [**-T** mode] [**-w** directory] [**-D**] [**-W** mode] {zonename} {filename}
:program:`named-compilezone` [**-d**] [**-j**] [**-q**] [**-v**] [**-c** class] [**-C** mode] [**-f** format] [**-F** format] [**-J** filename] [**-i** mode] [**-k** mode] [**-m** mode] [**-n** mode] [**-l** ttl] [**-L** serial] [**-r** mode] [**-s** style] [**-t** directory] [**-T** mode] [**-w** directory] [**-D**] [**-W** mode] {**-o** filename} {zonename} {filename}
Description
~~~~~~~~~~~
``named-checkzone`` checks the syntax and integrity of a zone file. It
performs the same checks as ``named`` does when loading a zone. This
makes ``named-checkzone`` useful for checking zone files before
:program:`named-checkzone` checks the syntax and integrity of a zone file. It
performs the same checks as :iscman:`named` does when loading a zone. This
makes :program:`named-checkzone` useful for checking zone files before
configuring them into a name server.
``named-compilezone`` is similar to ``named-checkzone``, but it always
dumps the zone contents to a specified file in a specified format.
It also applies stricter check levels by default, since the
dump output is used as an actual zone file loaded by ``named``.
When manually specified otherwise, the check levels must at least be as
strict as those specified in the ``named`` configuration file.
Options
~~~~~~~
``-d``
.. option:: -d
This option enables debugging.
``-h``
.. option:: -h
This option prints the usage summary and exits.
``-q``
.. option:: -q
This option sets quiet mode, which only sets an exit code to indicate
successful or failed completion.
``-v``
This option prints the version of the ``named-checkzone`` program and exits.
.. option:: -v
``-j``
When loading a zone file, this option tells ``named`` to read the journal if it exists. The journal
This option prints the version of the :program:`named-checkzone` program and exits.
.. option:: -j
When loading a zone file, this option tells :iscman:`named` to read the journal if it exists. The journal
file name is assumed to be the zone file name with the
string ``.jnl`` appended.
``-J filename``
When loading the zone file, this option tells ``named`` to read the journal from the given file, if
it exists. This implies ``-j``.
.. option:: -J filename
When loading the zone file, this option tells :iscman:`named` to read the journal from the given file, if
it exists. This implies :option:`-j`.
.. option:: -c class
``-c class``
This option specifies the class of the zone. If not specified, ``IN`` is assumed.
``-i mode``
.. option:: -i mode
This option performs post-load zone integrity checks. Possible modes are
``full`` (the default), ``full-sibling``, ``local``,
``local-sibling``, and ``none``.
@@ -102,114 +95,128 @@ Options
Mode ``none`` disables the checks.
``-f format``
This option specifies the format of the zone file. Possible formats are ``text``
(the default), ``raw``, and ``map``.
.. option:: -f format
This option specifies the format of the zone file. Possible formats are
``text`` (the default), and ``raw``.
.. option:: -F format
``-F format``
This option specifies the format of the output file specified. For
``named-checkzone``, this does not have any effect unless it dumps
:program:`named-checkzone`, this does not have any effect unless it dumps
the zone contents.
Possible formats are ``text`` (the default), which is the standard
textual representation of the zone, and ``map``, ``raw``, and
``raw=N``, which store the zone in a binary format for rapid
loading by ``named``. ``raw=N`` specifies the format version of the
raw zone file: if ``N`` is 0, the raw file can be read by any version of
``named``; if N is 1, the file can only be read by release 9.9.0 or
higher. The default is 1.
textual representation of the zone, and ``raw`` and ``raw=N``, which
store the zone in a binary format for rapid loading by :iscman:`named`.
``raw=N`` specifies the format version of the raw zone file: if ``N`` is
0, the raw file can be read by any version of :iscman:`named`; if N is 1, the
file can only be read by release 9.9.0 or higher. The default is 1.
.. option:: -k mode
``-k mode``
This option performs ``check-names`` checks with the specified failure mode.
Possible modes are ``fail`` (the default for ``named-compilezone``),
``warn`` (the default for ``named-checkzone``), and ``ignore``.
Possible modes are ``fail``, ``warn`` (the default), and ``ignore``.
.. option:: -l ttl
``-l ttl``
This option sets a maximum permissible TTL for the input file. Any record with a
TTL higher than this value causes the zone to be rejected. This
is similar to using the ``max-zone-ttl`` option in ``named.conf``.
is similar to using the ``max-zone-ttl`` option in :iscman:`named.conf`.
``-L serial``
When compiling a zone to ``raw`` or ``map`` format, this option sets the "source
.. option:: -L serial
When compiling a zone to ``raw`` format, this option sets the "source
serial" value in the header to the specified serial number. This is
expected to be used primarily for testing purposes.
``-m mode``
.. option:: -m mode
This option specifies whether MX records should be checked to see if they are
addresses. Possible modes are ``fail``, ``warn`` (the default), and
``ignore``.
``-M mode``
.. option:: -M mode
This option checks whether a MX record refers to a CNAME. Possible modes are
``fail``, ``warn`` (the default), and ``ignore``.
``-n mode``
.. option:: -n mode
This option specifies whether NS records should be checked to see if they are
addresses. Possible modes are ``fail`` (the default for
``named-compilezone``), ``warn`` (the default for ``named-checkzone``),
and ``ignore``.
addresses. Possible modes are ``fail``, ``warn`` (the default), and ``ignore``.
.. option:: -o filename
``-o filename``
This option writes the zone output to ``filename``. If ``filename`` is ``-``, then
the zone output is written to standard output. This is mandatory for ``named-compilezone``.
the zone output is written to standard output.
.. option:: -r mode
``-r mode``
This option checks for records that are treated as different by DNSSEC but are
semantically equal in plain DNS. Possible modes are ``fail``,
``warn`` (the default), and ``ignore``.
``-s style``
.. option:: -s style
This option specifies the style of the dumped zone file. Possible styles are
``full`` (the default) and ``relative``. The ``full`` format is most
suitable for processing automatically by a separate script.
The relative format is more human-readable and is thus
suitable for editing by hand. For ``named-checkzone``, this does not
have any effect unless it dumps the zone contents. It also does not
have any meaning if the output format is not text.
suitable for editing by hand. This does not have any effect unless it dumps
the zone contents. It also does not have any meaning if the output format
is not text.
.. option:: -S mode
``-S mode``
This option checks whether an SRV record refers to a CNAME. Possible modes are
``fail``, ``warn`` (the default), and ``ignore``.
``-t directory``
This option tells ``named`` to chroot to ``directory``, so that ``include`` directives in the
configuration file are processed as if run by a similarly chrooted
``named``.
.. option:: -t directory
This option tells :iscman:`named` to chroot to ``directory``, so that ``include`` directives in the
configuration file are processed as if run by a similarly chrooted
:iscman:`named`.
.. option:: -T mode
``-T mode``
This option checks whether Sender Policy Framework (SPF) records exist and issues a
warning if an SPF-formatted TXT record is not also present. Possible
modes are ``warn`` (the default) and ``ignore``.
``-w directory``
This option instructs ``named`` to chdir to ``directory``, so that relative filenames in master file
.. option:: -w directory
This option instructs :iscman:`named` to chdir to ``directory``, so that relative filenames in master file
``$INCLUDE`` directives work. This is similar to the directory clause in
``named.conf``.
:iscman:`named.conf`.
``-D``
This option dumps the zone file in canonical format. This is always enabled for
``named-compilezone``.
.. option:: -D
This option dumps the zone file in canonical format.
.. option:: -W mode
``-W mode``
This option specifies whether to check for non-terminal wildcards. Non-terminal
wildcards are almost always the result of a failure to understand the
wildcard matching algorithm (:rfc:`1034`). Possible modes are ``warn``
wildcard matching algorithm (:rfc:`4592`). Possible modes are ``warn``
(the default) and ``ignore``.
``zonename``
.. option:: zonename
This indicates the domain name of the zone being checked.
``filename``
.. option:: filename
This is the name of the zone file.
Return Values
~~~~~~~~~~~~~
``named-checkzone`` returns an exit status of 1 if errors were detected
:program:`named-checkzone` returns an exit status of 1 if errors were detected
and 0 otherwise.
See Also
~~~~~~~~
:manpage:`named(8)`, :manpage:`named-checkconf(8)`, :rfc:`1035`, BIND 9 Administrator Reference
:iscman:`named(8) <named>`, :iscman:`named-checkconf(8) <named-checkconf>`, :iscman:`named-compilezone(8) <named-compilezone>`, :rfc:`1035`, BIND 9 Administrator Reference
Manual.

View File

@@ -0,0 +1,224 @@
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
.. BEWARE: Do not forget to edit also named-checkzone.rst!
.. iscman:: named-compilezone
.. program:: named-compilezone
.. _man_named-compilezone:
named-compilezone - zone file converting tool
---------------------------------------------
Synopsis
~~~~~~~~
:program:`named-compilezone` [**-d**] [**-h**] [**-j**] [**-q**] [**-v**] [**-c** class] [**-f** format] [**-F** format] [**-J** filename] [**-i** mode] [**-k** mode] [**-m** mode] [**-M** mode] [**-n** mode] [**-l** ttl] [**-L** serial] [**-r** mode] [**-s** style] [**-S** mode] [**-t** directory] [**-T** mode] [**-w** directory] [**-D**] [**-W** mode] {**-o** filename} {zonename} {filename}
Description
~~~~~~~~~~~
:program:`named-compilezone` checks the syntax and integrity of a zone file,
and dumps the zone contents to a specified file in a specified format.
It applies strict check levels by default, since the
dump output is used as an actual zone file loaded by :iscman:`named`.
When manually specified otherwise, the check levels must at least be as
strict as those specified in the :iscman:`named` configuration file.
Options
~~~~~~~
.. option:: -d
This option enables debugging.
.. option:: -h
This option prints the usage summary and exits.
.. option:: -q
This option sets quiet mode, which only sets an exit code to indicate
successful or failed completion.
.. option:: -v
This option prints the version of the :iscman:`named-checkzone` program and exits.
.. option:: -j
When loading a zone file, this option tells :iscman:`named` to read the journal if it exists. The journal
file name is assumed to be the zone file name with the
string ``.jnl`` appended.
.. option:: -J filename
When loading the zone file, this option tells :iscman:`named` to read the journal from the given file, if
it exists. This implies :option:`-j`.
.. option:: -c class
This option specifies the class of the zone. If not specified, ``IN`` is assumed.
.. option:: -i mode
This option performs post-load zone integrity checks. Possible modes are
``full`` (the default), ``full-sibling``, ``local``,
``local-sibling``, and ``none``.
Mode ``full`` checks that MX records refer to A or AAAA records
(both in-zone and out-of-zone hostnames). Mode ``local`` only
checks MX records which refer to in-zone hostnames.
Mode ``full`` checks that SRV records refer to A or AAAA records
(both in-zone and out-of-zone hostnames). Mode ``local`` only
checks SRV records which refer to in-zone hostnames.
Mode ``full`` checks that delegation NS records refer to A or AAAA
records (both in-zone and out-of-zone hostnames). It also checks that
glue address records in the zone match those advertised by the child.
Mode ``local`` only checks NS records which refer to in-zone
hostnames or verifies that some required glue exists, i.e., when the
name server is in a child zone.
Modes ``full-sibling`` and ``local-sibling`` disable sibling glue
checks, but are otherwise the same as ``full`` and ``local``,
respectively.
Mode ``none`` disables the checks.
.. option:: -f format
This option specifies the format of the zone file. Possible formats are
``text`` (the default), and ``raw``.
.. option:: -F format
This option specifies the format of the output file specified. For
:iscman:`named-checkzone`, this does not have any effect unless it dumps
the zone contents.
Possible formats are ``text`` (the default), which is the standard
textual representation of the zone, and ``raw`` and ``raw=N``, which
store the zone in a binary format for rapid loading by :iscman:`named`.
``raw=N`` specifies the format version of the raw zone file: if ``N`` is
0, the raw file can be read by any version of :iscman:`named`; if N is 1, the
file can only be read by release 9.9.0 or higher. The default is 1.
.. option:: -k mode
This option performs ``check-names`` checks with the specified failure mode.
Possible modes are ``fail`` (the default), ``warn``, and ``ignore``.
.. option:: -l ttl
This option sets a maximum permissible TTL for the input file. Any record with a
TTL higher than this value causes the zone to be rejected. This
is similar to using the ``max-zone-ttl`` option in :iscman:`named.conf`.
.. option:: -L serial
When compiling a zone to ``raw`` format, this option sets the "source
serial" value in the header to the specified serial number. This is
expected to be used primarily for testing purposes.
.. option:: -m mode
This option specifies whether MX records should be checked to see if they are
addresses. Possible modes are ``fail``, ``warn`` (the default), and
``ignore``.
.. option:: -M mode
This option checks whether a MX record refers to a CNAME. Possible modes are
``fail``, ``warn`` (the default), and ``ignore``.
.. option:: -n mode
This option specifies whether NS records should be checked to see if they are
addresses. Possible modes are ``fail`` (the default), ``warn``, and
``ignore``.
.. option:: -o filename
This option writes the zone output to ``filename``. If ``filename`` is ``-``, then
the zone output is written to standard output. This is mandatory for :program:`named-compilezone`.
.. option:: -r mode
This option checks for records that are treated as different by DNSSEC but are
semantically equal in plain DNS. Possible modes are ``fail``,
``warn`` (the default), and ``ignore``.
.. option:: -s style
This option specifies the style of the dumped zone file. Possible styles are
``full`` (the default) and ``relative``. The ``full`` format is most
suitable for processing automatically by a separate script.
The relative format is more human-readable and is thus
suitable for editing by hand.
.. option:: -S mode
This option checks whether an SRV record refers to a CNAME. Possible modes are
``fail``, ``warn`` (the default), and ``ignore``.
.. option:: -t directory
This option tells :iscman:`named` to chroot to ``directory``, so that ``include`` directives in the
configuration file are processed as if run by a similarly chrooted
:iscman:`named`.
.. option:: -T mode
This option checks whether Sender Policy Framework (SPF) records exist and issues a
warning if an SPF-formatted TXT record is not also present. Possible
modes are ``warn`` (the default) and ``ignore``.
.. option:: -w directory
This option instructs :iscman:`named` to chdir to ``directory``, so that relative filenames in master file
``$INCLUDE`` directives work. This is similar to the directory clause in
:iscman:`named.conf`.
.. option:: -D
This option dumps the zone file in canonical format. This is always enabled for
:program:`named-compilezone`.
.. option:: -W mode
This option specifies whether to check for non-terminal wildcards. Non-terminal
wildcards are almost always the result of a failure to understand the
wildcard matching algorithm (:rfc:`4592`). Possible modes are ``warn``
(the default) and ``ignore``.
.. option:: zonename
This indicates the domain name of the zone being checked.
.. option:: filename
This is the name of the zone file.
Return Values
~~~~~~~~~~~~~
:program:`named-compilezone` returns an exit status of 1 if errors were detected
and 0 otherwise.
See Also
~~~~~~~~
:iscman:`named(8) <named>`, :iscman:`named-checkconf(8) <named-checkconf>`, :iscman:`named-checkzone(8) <named-checkzone>`, `:rfc:`1035`,
BIND 9 Administrator Reference Manual.

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkconf.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,144 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{03A96113-CB14-43AA-AEB2-48950E3915C5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>checkconf</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;..\..\..\lib\isccfg\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkconf.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\ns\win32\libns.vcxproj">
<Project>{82ACD33C-E75F-45B8-BB6D-42643A10D7EE}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\bind9\win32\libbind9.vcxproj">
<Project>{E741C10B-B075-4206-9596-46765B665E03}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\check\win32\checktool.vcxproj">
<Project>{2C1F7096-C5B5-48D4-846F-A7ACA454335D}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\check-tool.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,124 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\check-tool.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2C1F7096-C5B5-48D4-846F-A7ACA454335D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>checktool</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<OutDir>.\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<OutDir>.\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\ns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Lib>
<OutputFile>.\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\ns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Lib>
<OutputFile>.\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\ns\win32\libns.vcxproj">
<Project>{82ACD33C-E75F-45B8-BB6D-42643A10D7EE}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkzone.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,152 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{66028555-7DD5-4016-B601-9EF9A1EE8BFA}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>checkzone</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>named-$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y named-checkzone.exe named-compilezone.exe
copy /Y named-checkzone.ilk named-compilezone.ilk
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y named-checkzone.exe named-compilezone.exe
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\check-tool.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\named-checkzone.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\ns\win32\libns.vcxproj">
<Project>{82ACD33C-E75F-45B8-BB6D-42643A10D7EE}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\check\win32\checktool.vcxproj">
<Project>{2C1F7096-C5B5-48D4-846F-A7ACA454335D}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -5,7 +5,7 @@ AM_CPPFLAGS += \
$(LIBDNS_CFLAGS) \
-DRNDC_KEYFILE=\"${sysconfdir}/rndc.key\"
LDADD = \
LDADD += \
libconfgen.la \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS)
@@ -14,11 +14,11 @@ noinst_LTLIBRARIES = libconfgen.la
libconfgen_la_SOURCES = \
include/confgen/os.h \
keygen.h \
keygen.c \
util.h \
keygen.h \
os.c \
util.c \
unix/os.c
util.h
sbin_PROGRAMS = tsig-keygen rndc-confgen

View File

@@ -0,0 +1,96 @@
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
.. BEWARE: Do not forget to edit also tsig-keygen.rst!
.. iscman:: ddns-confgen
.. program:: ddns-confgen
.. _man_ddns-confgen:
ddns-confgen - TSIG key generation tool
---------------------------------------
Synopsis
~~~~~~~~
:program:`ddns-confgen` [**-a** algorithm] [**-h**] [**-k** keyname] [**-q**] [**-s** name] [**-z** zone]
Description
~~~~~~~~~~~
:program:`ddns-confgen` is an utility that generates keys for use in TSIG signing.
The resulting keys can be used, for example, to secure dynamic DNS updates
to a zone, or for the :iscman:`rndc` command channel.
The key name can specified using :option:`-k` parameter and defaults to ``ddns-key``.
The generated key is accompanied by configuration text and instructions that
can be used with :iscman:`nsupdate` and :iscman:`named` when setting up dynamic DNS,
including an example ``update-policy`` statement.
(This usage is similar to the :iscman:`rndc-confgen` command for setting up
command-channel security.)
Note that :iscman:`named` itself can configure a local DDNS key for use with
:option:`nsupdate -l`; it does this when a zone is configured with
``update-policy local;``. :program:`ddns-confgen` is only needed when a more
elaborate configuration is required: for instance, if :iscman:`nsupdate` is to
be used from a remote system.
Options
~~~~~~~
.. option:: -a algorithm
This option specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384,
and hmac-sha512. The default is hmac-sha256. Options are
case-insensitive, and the "hmac-" prefix may be omitted.
.. option:: -h
This option prints a short summary of options and arguments.
.. option:: -k keyname
This option specifies the key name of the DDNS authentication key. The
default is ``ddns-key`` when neither the :option:`-s` nor :option:`-z` option is
specified; otherwise, the default is ``ddns-key`` as a separate label
followed by the argument of the option, e.g., ``ddns-key.example.com.``
The key name must have the format of a valid domain name, consisting of
letters, digits, hyphens, and periods.
.. option:: -q
This option enables quiet mode, which prints only the key, with no
explanatory text or usage examples. This is essentially identical to
:iscman:`tsig-keygen`.
.. option:: -s name
This option generates a configuration example to allow dynamic updates
of a single hostname. The example :iscman:`named.conf` text shows how to set
an update policy for the specified name using the "name" nametype. The
default key name is ``ddns-key.name``. Note that the "self" nametype
cannot be used, since the name to be updated may differ from the key
name. This option cannot be used with the :option:`-z` option.
.. option:: -z zone
This option generates a configuration example to allow
dynamic updates of a zone. The example :iscman:`named.conf` text shows how
to set an update policy for the specified zone using the "zonesub"
nametype, allowing updates to all subdomain names within that zone.
This option cannot be used with the :option:`-s` option.
See Also
~~~~~~~~
:iscman:`nsupdate(1) <nsupdate>`, :iscman:`named.conf(5) <named.conf>`, :iscman:`named(8) <named>`, BIND 9 Administrator Reference Manual.

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -11,8 +13,7 @@
/*! \file */
#ifndef RNDC_OS_H
#define RNDC_OS_H 1
#pragma once
#include <stdio.h>
@@ -30,5 +31,3 @@ set_user(FILE *fd, const char *user);
*/
ISC_LANG_ENDDECLS
#endif /* ifndef RNDC_OS_H */

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -23,8 +25,6 @@
#include <isc/result.h>
#include <isc/string.h>
#include <pk11/site.h>
#include <dns/keyvalues.h>
#include <dns/name.h>

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -9,8 +11,7 @@
* information regarding copyright ownership.
*/
#ifndef RNDC_KEYGEN_H
#define RNDC_KEYGEN_H 1
#pragma once
/*! \file */
@@ -38,5 +39,3 @@ int
alg_bits(dns_secalg_t alg);
ISC_LANG_ENDDECLS
#endif /* RNDC_KEYGEN_H */

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -38,8 +40,6 @@
#include <isc/time.h>
#include <isc/util.h>
#include <pk11/site.h>
#include <dns/keyvalues.h>
#include <dns/name.h>
@@ -61,7 +61,7 @@ bool verbose = false;
const char *keyfile, *keydef;
ISC_NORETURN static void
noreturn static void
usage(int status);
static void

View File

@@ -1,26 +1,18 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
.. iscman:: rndc-confgen
.. program:: rndc-confgen
.. _man_rndc-confgen:
rndc-confgen - rndc key generation tool
@@ -34,86 +26,96 @@ Synopsis
Description
~~~~~~~~~~~
``rndc-confgen`` generates configuration files for ``rndc``. It can be
used as a convenient alternative to writing the ``rndc.conf`` file and
the corresponding ``controls`` and ``key`` statements in ``named.conf``
by hand. Alternatively, it can be run with the ``-a`` option to set up a
``rndc.key`` file and avoid the need for a ``rndc.conf`` file and a
:program:`rndc-confgen` generates configuration files for :iscman:`rndc`. It can be
used as a convenient alternative to writing the :iscman:`rndc.conf` file and
the corresponding ``controls`` and ``key`` statements in :iscman:`named.conf`
by hand. Alternatively, it can be run with the :option:`-a` option to set up a
``rndc.key`` file and avoid the need for a :iscman:`rndc.conf` file and a
``controls`` statement altogether.
Options
~~~~~~~
``-a``
This option sets automatic ``rndc`` configuration, which creates a file ``rndc.key``
in ``/etc`` (or a different ``sysconfdir`` specified when BIND
was built) that is read by both ``rndc`` and ``named`` on startup.
.. option:: -a
This option sets automatic :iscman:`rndc` configuration, which creates a file
|rndc_key| that is read by both :iscman:`rndc` and :iscman:`named` on startup.
The ``rndc.key`` file defines a default command channel and
authentication key allowing ``rndc`` to communicate with ``named`` on
authentication key allowing :iscman:`rndc` to communicate with :iscman:`named` on
the local host with no further configuration.
If a more elaborate configuration than that generated by
``rndc-confgen -a`` is required, for example if rndc is to be used
remotely, run ``rndc-confgen`` without the ``-a`` option
and set up ``rndc.conf`` and ``named.conf`` as directed.
:option:`rndc-confgen -a` is required, for example if rndc is to be used
remotely, run :program:`rndc-confgen` without the :option:`-a` option
and set up :iscman:`rndc.conf` and :iscman:`named.conf` as directed.
.. option:: -A algorithm
``-A algorithm``
This option specifies the algorithm to use for the TSIG key. Available choices
are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384, and
hmac-sha512. The default is hmac-sha256.
``-b keysize``
.. option:: -b keysize
This option specifies the size of the authentication key in bits. The size must be between
1 and 512 bits; the default is the hash size.
``-c keyfile``
This option is used with the ``-a`` option to specify an alternate location for
.. option:: -c keyfile
This option is used with the :option:`-a` option to specify an alternate location for
``rndc.key``.
``-h``
This option prints a short summary of the options and arguments to
``rndc-confgen``.
.. option:: -h
``-k keyname``
This option specifies the key name of the ``rndc`` authentication key. This must be a
This option prints a short summary of the options and arguments to
:program:`rndc-confgen`.
.. option:: -k keyname
This option specifies the key name of the :iscman:`rndc` authentication key. This must be a
valid domain name. The default is ``rndc-key``.
``-p port``
This option specifies the command channel port where ``named`` listens for
connections from ``rndc``. The default is 953.
.. option:: -p port
This option specifies the command channel port where :iscman:`named` listens for
connections from :iscman:`rndc`. The default is 953.
.. option:: -q
``-q``
This option prevets printing the written path in automatic configuration mode.
``-s address``
This option specifies the IP address where ``named`` listens for command-channel
connections from ``rndc``. The default is the loopback address
.. option:: -s address
This option specifies the IP address where :iscman:`named` listens for command-channel
connections from :iscman:`rndc`. The default is the loopback address
127.0.0.1.
``-t chrootdir``
This option is used with the ``-a`` option to specify a directory where ``named``
.. option:: -t chrootdir
This option is used with the :option:`-a` option to specify a directory where :iscman:`named`
runs chrooted. An additional copy of the ``rndc.key`` is
written relative to this directory, so that it is found by the
chrooted ``named``.
chrooted :iscman:`named`.
``-u user``
This option is used with the ``-a`` option to set the owner of the generated ``rndc.key`` file.
If ``-t`` is also specified, only the file in the chroot
.. option:: -u user
This option is used with the :option:`-a` option to set the owner of the generated ``rndc.key`` file.
If :option:`-t` is also specified, only the file in the chroot
area has its owner changed.
Examples
~~~~~~~~
To allow ``rndc`` to be used with no manual configuration, run:
To allow :iscman:`rndc` to be used with no manual configuration, run:
``rndc-confgen -a``
To print a sample ``rndc.conf`` file and the corresponding ``controls`` and
``key`` statements to be manually inserted into ``named.conf``, run:
To print a sample :iscman:`rndc.conf` file and the corresponding ``controls`` and
``key`` statements to be manually inserted into :iscman:`named.conf`, run:
``rndc-confgen``
:program:`rndc-confgen`
See Also
~~~~~~~~
:manpage:`rndc(8)`, :manpage:`rndc.conf(5)`, :manpage:`named(8)`, BIND 9 Administrator Reference Manual.
:iscman:`rndc(8) <rndc>`, :iscman:`rndc.conf(5) <rndc.conf>`, :iscman:`named(8) <named>`, BIND 9 Administrator Reference Manual.

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -34,13 +36,8 @@
#include <isc/time.h>
#include <isc/util.h>
#if USE_PKCS11
#include <pk11/result.h>
#endif /* if USE_PKCS11 */
#include <dns/keyvalues.h>
#include <dns/name.h>
#include <dns/result.h>
#include <dst/dst.h>
@@ -57,7 +54,7 @@ const char *progname;
static enum { progmode_keygen, progmode_confgen } progmode;
bool verbose = false; /* needed by util.c but not used here */
ISC_NORETURN static void
noreturn static void
usage(int status);
static void
@@ -101,11 +98,6 @@ main(int argc, char **argv) {
int len = 0;
int ch;
#if USE_PKCS11
pk11_result_register();
#endif /* if USE_PKCS11 */
dns_result_register();
result = isc_file_progname(*argv, program, sizeof(program));
if (result != ISC_R_SUCCESS) {
memmove(program, "tsig-keygen", 11);
@@ -129,8 +121,7 @@ main(int argc, char **argv) {
} else if (PROGCMP("ddns-confgen")) {
progmode = progmode_confgen;
} else {
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
isc_commandline_errprint = false;

View File

@@ -1,101 +1,54 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
tsig-keygen, ddns-confgen - TSIG key generation tool
----------------------------------------------------
.. BEWARE: Do not forget to edit also ddns-confgen.rst!
.. iscman:: tsig-keygen
.. program:: tsig-keygen
.. _man_tsig-keygen:
tsig-keygen - TSIG key generation tool
--------------------------------------
Synopsis
~~~~~~~~
:program:`tsig-keygen` [**-a** algorithm] [**-h**] [**-r** randomfile] [name]
:program:`ddns-confgen` [**-a** algorithm] [**-h**] [**-k** keyname] [**-q**] [**-r** randomfile] [**-s** name] [**-z** zone]
:program:`tsig-keygen` [**-a** algorithm] [**-h**] [name]
Description
~~~~~~~~~~~
``tsig-keygen`` and ``ddns-confgen`` are invocation methods for a
utility that generates keys for use in TSIG signing. The resulting keys
can be used, for example, to secure dynamic DNS updates to a zone, or for
the ``rndc`` command channel.
:program:`tsig-keygen` is an utility that generates keys for use in TSIG signing.
The resulting keys can be used, for example, to secure dynamic DNS updates
to a zone, or for the :iscman:`rndc` command channel.
When run as ``tsig-keygen``, a domain name can be specified on the
command line to be used as the name of the generated key. If no
name is specified, the default is ``tsig-key``.
When run as ``ddns-confgen``, the key name can specified using ``-k``
parameter and defaults to ``ddns-key``. The generated key is accompanied
by configuration text and instructions that can be used with ``nsupdate``
and ``named`` when setting up dynamic DNS, including an example
``update-policy`` statement. (This usage is similar to the ``rndc-confgen``
command for setting up command-channel security.)
Note that ``named`` itself can configure a local DDNS key for use with
``nsupdate -l``; it does this when a zone is configured with
``update-policy local;``. ``ddns-confgen`` is only needed when a more
elaborate configuration is required: for instance, if ``nsupdate`` is to
be used from a remote system.
A domain name can be specified on the command line to be used as the name
of the generated key. If no name is specified, the default is ``tsig-key``.
Options
~~~~~~~
``-a algorithm``
.. option:: -a algorithm
This option specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384,
and hmac-sha512. The default is hmac-sha256. Options are
case-insensitive, and the "hmac-" prefix may be omitted.
``-h``
.. option:: -h
This option prints a short summary of options and arguments.
``-k keyname``
This option specifies the key name of the DDNS authentication key. The
default is ``ddns-key`` when neither the ``-s`` nor ``-z`` option is
specified; otherwise, the default is ``ddns-key`` as a separate label
followed by the argument of the option, e.g., ``ddns-key.example.com.``
The key name must have the format of a valid domain name, consisting of
letters, digits, hyphens, and periods.
``-q`` (``ddns-confgen`` only)
This option enables quiet mode, which prints only the key, with no
explanatory text or usage examples. This is essentially identical to
``tsig-keygen``.
``-s name`` (``ddns-confgen`` only)
This option generates a configuration example to allow dynamic updates
of a single hostname. The example ``named.conf`` text shows how to set
an update policy for the specified name using the "name" nametype. The
default key name is ``ddns-key.name``. Note that the "self" nametype
cannot be used, since the name to be updated may differ from the key
name. This option cannot be used with the ``-z`` option.
``-z zone`` (``ddns-confgen`` only)
This option generates a configuration example to allow
dynamic updates of a zone. The example ``named.conf`` text shows how
to set an update policy for the specified zone using the "zonesub"
nametype, allowing updates to all subdomain names within that zone.
This option cannot be used with the ``-s`` option.
See Also
~~~~~~~~
:manpage:`nsupdate(1)`, :manpage:`named.conf(5)`, :manpage:`named(8)`, BIND 9 Administrator Reference Manual.
:iscman:`nsupdate(1) <nsupdate>`, :iscman:`named.conf(5) <named.conf>`, :iscman:`named(8) <named>`, BIND 9 Administrator Reference Manual.

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -9,15 +11,13 @@
* information regarding copyright ownership.
*/
#ifndef RNDC_UTIL_H
#define RNDC_UTIL_H 1
#pragma once
/*! \file */
#include <isc/attributes.h>
#include <isc/formatcheck.h>
#include <isc/lang.h>
#include <isc/platform.h>
#define NS_CONTROL_PORT 953
@@ -36,9 +36,7 @@ ISC_LANG_BEGINDECLS
void
notify(const char *fmt, ...) ISC_FORMAT_PRINTF(1, 2);
ISC_NORETURN void
noreturn void
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
ISC_LANG_ENDDECLS
#endif /* RNDC_UTIL_H */

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\keygen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\confgen\os.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\keygen.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\util.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="os.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,128 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{64964B03-4815-41F0-9057-E766A94AF197}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>confgentool</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\include\confgen\os.h" />
<ClInclude Include="..\keygen.h" />
<ClInclude Include="..\util.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\keygen.c" />
<ClCompile Include="..\util.c" />
<ClCompile Include="os.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\rndc-confgen.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,132 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1E2C1635-3093-4D59-80E7-4743AC10F22F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>rndcconfgen</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>rndc-confgen</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>rndc-confgen</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@confgentool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@confgentool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\rndc-confgen.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\confgen\win32\confgentool.vcxproj">
<Project>{64964B03-4815-41F0-9057-E766A94AF197}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\tsig-keygen.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,143 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1EA4FC64-F33B-4A50-970A-EA052BBE9CF1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>tsigkeygen</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>tsig-keygen</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
<TargetName>tsig-keygen</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@confgentool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y tsig-keygen.exe ddns-confgen.exe
copy /Y tsig-keygen.ilk ddns-confgen.ilk
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@confgentool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>cd ..\..\..\Build\$(Configuration)
copy /Y tsig-keygen.exe ddns-confgen.exe
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\tsig-keygen.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\confgen\win32\confgentool.vcxproj">
<Project>{64964B03-4815-41F0-9057-E766A94AF197}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -9,22 +11,18 @@
* information regarding copyright ownership.
*/
#include <bind.keys.h>
#ifndef WIN32
#include <arpa/inet.h>
#include <bind.keys.h>
#include <inttypes.h>
#include <netdb.h>
#include <netinet/in.h>
#include <signal.h>
#include <sys/socket.h>
#include <sys/types.h>
#endif /* ifndef WIN32 */
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <isc/app.h>
@@ -32,17 +30,15 @@
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/hex.h>
#include <isc/lib.h>
#include <isc/log.h>
#include <isc/managers.h>
#include <isc/md.h>
#include <isc/mem.h>
#ifdef WIN32
#include <isc/ntpaths.h>
#endif /* ifdef WIN32 */
#include <isc/netmgr.h>
#include <isc/parseint.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/sockaddr.h>
#include <isc/socket.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/timer.h>
@@ -53,7 +49,6 @@
#include <dns/fixedname.h>
#include <dns/keytable.h>
#include <dns/keyvalues.h>
#include <dns/lib.h>
#include <dns/log.h>
#include <dns/masterdump.h>
#include <dns/name.h>
@@ -62,12 +57,10 @@
#include <dns/rdataset.h>
#include <dns/rdatastruct.h>
#include <dns/rdatatype.h>
#include <dns/result.h>
#include <dns/secalg.h>
#include <dns/view.h>
#include <dst/dst.h>
#include <dst/result.h>
#include <isccfg/log.h>
#include <isccfg/namedconf.h>
@@ -215,7 +208,7 @@ usage(void) {
exit(1);
}
ISC_NORETURN static void
noreturn static void
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
static void
@@ -819,14 +812,7 @@ setup_dnsseckeys(dns_client_t *client) {
}
if (filename == NULL) {
#ifndef WIN32
filename = SYSCONFDIR "/bind.keys";
#else /* ifndef WIN32 */
static char buf[MAX_PATH];
strlcpy(buf, isc_ntpaths_get(SYS_CONF_DIR), sizeof(buf));
strlcat(buf, "\\bind.keys", sizeof(buf));
filename = buf;
#endif /* ifndef WIN32 */
}
if (trust_anchor == NULL) {
@@ -1339,7 +1325,6 @@ dash_option(char *option, char *next, bool *open_type_class) {
case 'h':
usage();
exit(0);
/* NOTREACHED */
case 'i':
no_sigs = true;
root_validation = false;
@@ -1348,12 +1333,10 @@ dash_option(char *option, char *next, bool *open_type_class) {
/* handled in preparse_args() */
break;
case 'v':
fprintf(stderr, "delv %s\n", PACKAGE_VERSION);
printf("delv %s\n", PACKAGE_VERSION);
exit(0);
/* NOTREACHED */
default:
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
if (strlen(option) > 1U) {
option = &option[1];
@@ -1491,7 +1474,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
fprintf(stderr, "Invalid option: -%s\n", option);
usage();
}
/* NOTREACHED */
UNREACHABLE();
return (false);
}
@@ -1735,14 +1718,10 @@ main(int argc, char *argv[]) {
dns_rdataset_t *rdataset;
dns_namelist_t namelist;
unsigned int resopt;
isc_appctx_t *actx = NULL;
isc_nm_t *netmgr = NULL;
isc_taskmgr_t *taskmgr = NULL;
isc_socketmgr_t *socketmgr = NULL;
isc_timermgr_t *timermgr = NULL;
dns_master_style_t *style = NULL;
#ifndef WIN32
struct sigaction sa;
#endif /* ifndef WIN32 */
progname = argv[0];
preparse_args(argc, argv);
@@ -1750,18 +1729,14 @@ main(int argc, char *argv[]) {
argc--;
argv++;
isc_lib_register();
result = dns_lib_init();
if (result != ISC_R_SUCCESS) {
fatal("dns_lib_init failed: %d", result);
}
isc_mem_create(&mctx);
CHECK(isc_appctx_create(mctx, &actx));
CHECK(isc_taskmgr_createinctx(mctx, 1, 0, &taskmgr));
CHECK(isc_socketmgr_createinctx(mctx, &socketmgr));
CHECK(isc_timermgr_createinctx(mctx, &timermgr));
result = dst_lib_init(mctx, NULL);
if (result != ISC_R_SUCCESS) {
fatal("dst_lib_init failed: %d", result);
}
isc_managers_create(mctx, 1, 0, &netmgr, &taskmgr, &timermgr);
parse_args(argc, argv);
@@ -1769,20 +1744,9 @@ main(int argc, char *argv[]) {
setup_logging(stderr);
CHECK(isc_app_ctxstart(actx));
#ifndef WIN32
/* Unblock SIGINT if it's been blocked by isc_app_ctxstart() */
memset(&sa, 0, sizeof(sa));
sa.sa_handler = SIG_DFL;
if (sigfillset(&sa.sa_mask) != 0 || sigaction(SIGINT, &sa, NULL) < 0) {
fatal("Couldn't set up signal handler");
}
#endif /* ifndef WIN32 */
/* Create client */
result = dns_client_createx(mctx, actx, taskmgr, socketmgr, timermgr, 0,
&client, srcaddr4, srcaddr6);
result = dns_client_create(mctx, taskmgr, netmgr, timermgr, 0, &client,
srcaddr4, srcaddr6);
if (result != ISC_R_SUCCESS) {
delv_log(ISC_LOG_ERROR, "dns_client_create: %s",
isc_result_totext(result));
@@ -1802,7 +1766,7 @@ main(int argc, char *argv[]) {
CHECK(convert_name(&qfn, &query_name, qname));
/* Set up resolution options */
resopt = DNS_CLIENTRESOPT_ALLOWRUN | DNS_CLIENTRESOPT_NOCDFLAG;
resopt = DNS_CLIENTRESOPT_NOCDFLAG;
if (no_sigs) {
resopt |= DNS_CLIENTRESOPT_NODNSSEC;
}
@@ -1862,26 +1826,17 @@ cleanup:
dns_master_styledestroy(&style, mctx);
}
if (client != NULL) {
dns_client_destroy(&client);
}
if (taskmgr != NULL) {
isc_taskmgr_destroy(&taskmgr);
}
if (timermgr != NULL) {
isc_timermgr_destroy(&timermgr);
}
if (socketmgr != NULL) {
isc_socketmgr_destroy(&socketmgr);
}
if (actx != NULL) {
isc_appctx_destroy(&actx);
dns_client_detach(&client);
}
isc_managers_destroy(&netmgr, &taskmgr, &timermgr);
if (lctx != NULL) {
isc_log_destroy(&lctx);
}
isc_mem_detach(&mctx);
dns_lib_shutdown();
dst_lib_destroy();
return (0);
}

View File

@@ -1,26 +1,18 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
.. iscman:: delv
.. program:: delv
.. _man_delv:
delv - DNS lookup and validation utility
@@ -40,10 +32,10 @@ Synopsis
Description
~~~~~~~~~~~
``delv`` is a tool for sending DNS queries and validating the results,
using the same internal resolver and validator logic as ``named``.
:program:`delv` is a tool for sending DNS queries and validating the results,
using the same internal resolver and validator logic as :iscman:`named`.
``delv`` sends to a specified name server all queries needed to
:program:`delv` sends to a specified name server all queries needed to
fetch and validate the requested data; this includes the original
requested query, subsequent queries to follow CNAME or DNAME chains,
queries for DNSKEY, and DS records to establish a chain of trust for
@@ -52,25 +44,25 @@ simulates the behavior of a name server configured for DNSSEC validating
and forwarding.
By default, responses are validated using the built-in DNSSEC trust anchor
for the root zone ("."). Records returned by ``delv`` are either fully
for the root zone ("."). Records returned by :program:`delv` are either fully
validated or were not signed. If validation fails, an explanation of the
failure is included in the output; the validation process can be traced
in detail. Because ``delv`` does not rely on an external server to carry
in detail. Because :program:`delv` does not rely on an external server to carry
out validation, it can be used to check the validity of DNS responses in
environments where local name servers may not be trustworthy.
Unless it is told to query a specific name server, ``delv`` tries
Unless it is told to query a specific name server, :program:`delv` tries
each of the servers listed in ``/etc/resolv.conf``. If no usable server
addresses are found, ``delv`` sends queries to the localhost
addresses are found, :program:`delv` sends queries to the localhost
addresses (127.0.0.1 for IPv4, ::1 for IPv6).
When no command-line arguments or options are given, ``delv``
When no command-line arguments or options are given, :program:`delv`
performs an NS query for "." (the root zone).
Simple Usage
~~~~~~~~~~~~
A typical invocation of ``delv`` looks like:
A typical invocation of :program:`delv` looks like:
::
@@ -78,125 +70,142 @@ A typical invocation of ``delv`` looks like:
where:
``server``
.. option:: server
is the name or IP address of the name server to query. This can be an
IPv4 address in dotted-decimal notation or an IPv6 address in
colon-delimited notation. When the supplied ``server`` argument is a
hostname, ``delv`` resolves that name before querying that name
hostname, :program:`delv` resolves that name before querying that name
server (note, however, that this initial lookup is *not* validated by
DNSSEC).
If no ``server`` argument is provided, ``delv`` consults
If no ``server`` argument is provided, :program:`delv` consults
``/etc/resolv.conf``; if an address is found there, it queries the
name server at that address. If either of the ``-4`` or ``-6``
name server at that address. If either of the :option:`-4` or :option:`-6`
options is in use, then only addresses for the corresponding
transport are tried. If no usable addresses are found, ``delv``
transport are tried. If no usable addresses are found, :program:`delv`
sends queries to the localhost addresses (127.0.0.1 for IPv4, ::1
for IPv6).
``name``
.. option:: name
is the domain name to be looked up.
``type``
.. option:: type
indicates what type of query is required - ANY, A, MX, etc.
``type`` can be any valid query type. If no ``type`` argument is
supplied, ``delv`` performs a lookup for an A record.
supplied, :program:`delv` performs a lookup for an A record.
Options
~~~~~~~
``-a anchor-file``
.. option:: -a anchor-file
This option specifies a file from which to read DNSSEC trust anchors. The default
is ``/etc/bind.keys``, which is included with BIND 9 and contains one
is |bind_keys|, which is included with BIND 9 and contains one
or more trust anchors for the root zone (".").
Keys that do not match the root zone name are ignored. An alternate
key name can be specified using the ``+root=NAME`` options.
key name can be specified using the :option:`+root` option.
Note: When reading the trust anchor file, ``delv`` treats ``trust-anchors``,
Note: When reading the trust anchor file, :program:`delv` treats ``trust-anchors``,
``initial-key``, and ``static-key`` identically. That is, for a managed key,
it is the *initial* key that is trusted; :rfc:`5011` key management is not
supported. ``delv`` does not consult the managed-keys database maintained by
``named``, which means that if either of the keys in ``/etc/bind.keys`` is
revoked and rolled over, ``/etc/bind.keys`` must be updated to
use DNSSEC validation in ``delv``.
supported. :program:`delv` does not consult the managed-keys database maintained by
:iscman:`named`, which means that if either of the keys in |bind_keys| is
revoked and rolled over, |bind_keys| must be updated to
use DNSSEC validation in :program:`delv`.
.. option:: -b address
``-b address``
This option sets the source IP address of the query to ``address``. This must be
a valid address on one of the host's network interfaces, or ``0.0.0.0``,
or ``::``. An optional source port may be specified by appending
``#<port>``
``-c class``
This option sets the query class for the requested data. Currently, only class
"IN" is supported in ``delv`` and any other value is ignored.
.. option:: -c class
This option sets the query class for the requested data. Currently, only class
"IN" is supported in :program:`delv` and any other value is ignored.
.. option:: -d level
``-d level``
This option sets the systemwide debug level to ``level``. The allowed range is
from 0 to 99. The default is 0 (no debugging). Debugging traces from
``delv`` become more verbose as the debug level increases. See the
``+mtrace``, ``+rtrace``, and ``+vtrace`` options below for
:program:`delv` become more verbose as the debug level increases. See the
:option:`+mtrace`, :option:`+rtrace`, and :option:`+vtrace` options below for
additional debugging details.
``-h``
This option displays the ``delv`` help usage output and exits.
.. option:: -h
This option displays the :program:`delv` help usage output and exits.
.. option:: -i
``-i``
This option sets insecure mode, which disables internal DNSSEC validation. (Note,
however, that this does not set the CD bit on upstream queries. If the
server being queried is performing DNSSEC validation, then it does
not return invalid data; this can cause ``delv`` to time out. When it
not return invalid data; this can cause :program:`delv` to time out. When it
is necessary to examine invalid data to debug a DNSSEC problem, use
``dig +cd``.)
:option:`dig +cd`.)
.. option:: -m
``-m``
This option enables memory usage debugging.
``-p port#``
.. option:: -p port#
This option specifies a destination port to use for queries, instead of the
standard DNS port number 53. This option is used with a name
server that has been configured to listen for queries on a
non-standard port number.
``-q name``
.. option:: -q name
This option sets the query name to ``name``. While the query name can be
specified without using the ``-q`` option, it is sometimes necessary to
specified without using the :option:`-q` option, it is sometimes necessary to
disambiguate names from types or classes (for example, when looking
up the name "ns", which could be misinterpreted as the type NS, or
"ch", which could be misinterpreted as class CH).
``-t type``
.. option:: -t type
This option sets the query type to ``type``, which can be any valid query type
supported in BIND 9 except for zone transfer types AXFR and IXFR. As
with ``-q``, this is useful to distinguish query-name types or classes
with :option:`-q`, this is useful to distinguish query-name types or classes
when they are ambiguous. It is sometimes necessary to disambiguate
names from types.
The default query type is "A", unless the ``-x`` option is supplied
The default query type is "A", unless the :option:`-x` option is supplied
to indicate a reverse lookup, in which case it is "PTR".
``-v``
This option prints the ``delv`` version and exits.
.. option:: -v
This option prints the :program:`delv` version and exits.
.. option:: -x addr
``-x addr``
This option performs a reverse lookup, mapping an address to a name. ``addr``
is an IPv4 address in dotted-decimal notation, or a colon-delimited
IPv6 address. When ``-x`` is used, there is no need to provide the
``name`` or ``type`` arguments; ``delv`` automatically performs a
IPv6 address. When :option:`-x` is used, there is no need to provide the
``name`` or ``type`` arguments; :program:`delv` automatically performs a
lookup for a name like ``11.12.13.10.in-addr.arpa`` and sets the
query type to PTR. IPv6 addresses are looked up using nibble format
under the IP6.ARPA domain.
``-4``
This option forces ``delv`` to only use IPv4.
.. option:: -4
``-6``
This option forces ``delv`` to only use IPv6.
This option forces :program:`delv` to only use IPv4.
.. option:: -6
This option forces :program:`delv` to only use IPv6.
Query Options
~~~~~~~~~~~~~
``delv`` provides a number of query options which affect the way results
:program:`delv` provides a number of query options which affect the way results
are displayed, and in some cases the way lookups are performed.
Each query option is identified by a keyword preceded by a plus sign
@@ -205,69 +214,79 @@ the string ``no`` to negate the meaning of that keyword. Other keywords
assign values to options like the timeout interval. They have the form
``+keyword=value``. The query options are:
``+[no]cdflag``
.. option:: +cdflag, +nocdflag
This option controls whether to set the CD (checking disabled) bit in queries
sent by ``delv``. This may be useful when troubleshooting DNSSEC
sent by :program:`delv`. This may be useful when troubleshooting DNSSEC
problems from behind a validating resolver. A validating resolver
blocks invalid responses, making it difficult to retrieve them
for analysis. Setting the CD flag on queries causes the resolver
to return invalid responses, which ``delv`` can then validate
to return invalid responses, which :program:`delv` can then validate
internally and report the errors in detail.
``+[no]class``
.. option:: +class, +noclass
This option controls whether to display the CLASS when printing a record. The
default is to display the CLASS.
``+[no]ttl``
.. option:: +ttl, +nottl
This option controls whether to display the TTL when printing a record. The
default is to display the TTL.
``+[no]rtrace``
.. option:: +rtrace, +nortrace
This option toggles resolver fetch logging. This reports the name and type of each
query sent by ``delv`` in the process of carrying out the resolution
query sent by :program:`delv` in the process of carrying out the resolution
and validation process, including the original query
and all subsequent queries to follow CNAMEs and to establish a chain
of trust for DNSSEC validation.
This is equivalent to setting the debug level to 1 in the "resolver"
logging category. Setting the systemwide debug level to 1 using the
``-d`` option produces the same output, but affects other
:option:`-d` option produces the same output, but affects other
logging categories as well.
``+[no]mtrace``
.. option:: +mtrace, +nomtrace
This option toggles message logging. This produces a detailed dump of the
responses received by ``delv`` in the process of carrying out the
responses received by :program:`delv` in the process of carrying out the
resolution and validation process.
This is equivalent to setting the debug level to 10 for the "packets"
module of the "resolver" logging category. Setting the systemwide
debug level to 10 using the ``-d`` option produces the same
debug level to 10 using the :option:`-d` option produces the same
output, but affects other logging categories as well.
``+[no]vtrace``
.. option:: +vtrace, +novtrace
This option toggles validation logging. This shows the internal process of the
validator as it determines whether an answer is validly signed,
unsigned, or invalid.
This is equivalent to setting the debug level to 3 for the
"validator" module of the "dnssec" logging category. Setting the
systemwide debug level to 3 using the ``-d`` option produces the
systemwide debug level to 3 using the :option:`-d` option produces the
same output, but affects other logging categories as well.
``+[no]short``
.. option:: +short, +noshort
This option toggles between verbose and terse answers. The default is to print the answer in a
verbose form.
``+[no]comments``
.. option:: +comments, +nocomments
This option toggles the display of comment lines in the output. The default is to
print comments.
``+[no]rrcomments``
.. option:: +rrcomments, +norrcomments
This option toggles the display of per-record comments in the output (for example,
human-readable key information about DNSKEY records). The default is
to print per-record comments.
``+[no]crypto``
.. option:: +crypto, +nocrypto
This option toggles the display of cryptographic fields in DNSSEC records. The
contents of these fields are unnecessary to debug most DNSSEC
validation failures and removing them makes it easier to see the
@@ -275,62 +294,71 @@ assign values to options like the timeout interval. They have the form
they are replaced by the string ``[omitted]`` or, in the DNSKEY case, the
key ID is displayed as the replacement, e.g. ``[ key id = value ]``.
``+[no]trust``
.. option:: +trust, +notrust
This option controls whether to display the trust level when printing a record.
The default is to display the trust level.
``+[no]split[=W]``
.. option:: +split[=W], +nosplit
This option splits long hex- or base64-formatted fields in resource records into
chunks of ``W`` characters (where ``W`` is rounded up to the nearest
multiple of 4). ``+nosplit`` or ``+split=0`` causes fields not to be
split at all. The default is 56 characters, or 44 characters when
multiline mode is active.
``+[no]all``
This option sets or clears the display options ``+[no]comments``,
``+[no]rrcomments``, and ``+[no]trust`` as a group.
.. option:: +all, +noall
This option sets or clears the display options :option:`+comments`,
:option:`+rrcomments`, and :option:`+trust` as a group.
.. option:: +multiline, +nomultiline
``+[no]multiline``
This option prints long records (such as RRSIG, DNSKEY, and SOA records) in a
verbose multi-line format with human-readable comments. The default
is to print each record on a single line, to facilitate machine
parsing of the ``delv`` output.
parsing of the :program:`delv` output.
``+[no]dnssec``
This option indicates whether to display RRSIG records in the ``delv`` output.
The default is to do so. Note that (unlike in ``dig``) this does
.. option:: +dnssec, +nodnssec
This option indicates whether to display RRSIG records in the :program:`delv` output.
The default is to do so. Note that (unlike in :iscman:`dig`) this does
*not* control whether to request DNSSEC records or to
validate them. DNSSEC records are always requested, and validation
always occurs unless suppressed by the use of ``-i`` or
``+noroot``.
always occurs unless suppressed by the use of :option:`-i` or
:option:`+noroot`.
.. option:: +root[=ROOT], +noroot
``+[no]root[=ROOT]``
This option indicates whether to perform conventional DNSSEC validation, and if so,
specifies the name of a trust anchor. The default is to validate using a
trust anchor of "." (the root zone), for which there is a built-in key. If
specifying a different trust anchor, then ``-a`` must be used to specify a
specifying a different trust anchor, then :option:`-a` must be used to specify a
file containing the key.
``+[no]tcp``
.. option:: +tcp, +notcp
This option controls whether to use TCP when sending queries. The default is to
use UDP unless a truncated response has been received.
``+[no]unknownformat``
.. option:: +unknownformat, +nounknownformat
This option prints all RDATA in unknown RR-type presentation format (:rfc:`3597`).
The default is to print RDATA for known types in the type's
presentation format.
``+[no]yaml``
.. option:: +yaml, +noyaml
This option prints response data in YAML format.
Files
~~~~~
``/etc/bind.keys``
|bind_keys|
``/etc/resolv.conf``
See Also
~~~~~~~~
:manpage:`dig(1)`, :manpage:`named(8)`, :rfc:`4034`, :rfc:`4035`, :rfc:`4431`, :rfc:`5074`, :rfc:`5155`.
:iscman:`dig(1) <dig>`, :iscman:`named(8) <named>`, :rfc:`4034`, :rfc:`4035`, :rfc:`4431`, :rfc:`5074`, :rfc:`5155`.

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\delv.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,133 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BE172EFE-C1DC-4812-BFB9-8C5F8ADB7E9F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>delv</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@GEOIP_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\win32\include;..\..\..\lib\dns\include;..\..\..\lib\irs\win32\include;..\..\..\lib\irs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@GEOIP_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\win32\include;..\..\..\lib\dns\include;..\..\..\lib\irs\win32\include;..\..\..\lib\irs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@libisc.lib;libdns.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\delv.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\irs\win32\libirs.vcxproj">
<Project>{A4F29CEB-7644-4A7F-BE9E-02B6A90E4919}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -8,7 +8,7 @@ AM_CPPFLAGS += \
$(LIBBIND9_CFLAGS) \
$(LIBIDN2_CFLAGS)
LDADD = \
LDADD += \
libdighost.la \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS) \
@@ -19,8 +19,8 @@ LDADD = \
noinst_LTLIBRARIES = libdighost.la
libdighost_la_SOURCES = \
dighost.h \
libdighost_la_SOURCES = \
dighost.h \
dighost.c
bin_PROGRAMS = dig host nslookup

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -19,16 +21,16 @@
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/dir.h>
#include <isc/netaddr.h>
#include <isc/parseint.h>
#include <isc/platform.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/time.h>
#include <isc/util.h>
#include <pk11/site.h>
#include <dns/byaddr.h>
#include <dns/dns64.h>
#include <dns/fixedname.h>
@@ -40,7 +42,6 @@
#include <dns/rdataclass.h>
#include <dns/rdataset.h>
#include <dns/rdatatype.h>
#include <dns/result.h>
#include <dns/tsig.h>
#include "dighost.h"
@@ -58,7 +59,7 @@
dig_lookup_t *default_lookup = NULL;
static atomic_uintptr_t batchname = ATOMIC_VAR_INIT(0);
static atomic_uintptr_t batchname = 0;
static FILE *batchfp = NULL;
static char *argv0;
static int addresscount = 0;
@@ -112,7 +113,7 @@ usage(void) {
fprintf(stderr, "Press <Help> for complete list of options\n");
}
#else /* if TARGET_OS_IPHONE */
ISC_NORETURN static void
noreturn static void
usage(void);
static void
@@ -124,12 +125,6 @@ usage(void) {
}
#endif /* if TARGET_OS_IPHONE */
/*% version */
static void
version(void) {
fprintf(stderr, "DiG %s\n", PACKAGE_VERSION);
}
/*% help */
static void
help(void) {
@@ -228,6 +223,15 @@ help(void) {
"SERVFAIL)\n"
" +[no]header-only (Send query without a "
"question section)\n"
" +[no]https[=###] (DNS-over-HTTPS mode) "
"[/]\n"
" +[no]https-get (Use GET instead of "
"default POST method while using HTTPS)\n"
" +[no]http-plain[=###] (DNS over plain HTTP "
"mode) "
"[/]\n"
" +[no]https-plain-get (Use GET instead of "
"default POST method while using plain HTTP)\n"
" +[no]identify (ID responders in short "
"answers)\n"
#ifdef HAVE_LIBIDN2
@@ -243,8 +247,6 @@ help(void) {
" +[no]keepopen (Keep the TCP socket open "
"between "
"queries)\n"
" +[no]mapped (Allow mapped IPv4 over "
"IPv6)\n"
" +[no]multiline (Print records in an "
"expanded format)\n"
" +ndots=### (Set search NDOTS value)\n"
@@ -278,6 +280,7 @@ help(void) {
"short\n"
" form of answers - global "
"option)\n"
" +[no]showbadcookie (Show BADCOOKIE message)\n"
" +[no]showsearch (Search with intermediate "
"results)\n"
" +[no]split=## (Split hex/base64 fields "
@@ -290,7 +293,15 @@ help(void) {
"(+[no]tcflag))\n"
" +[no]tcp (TCP mode (+[no]vc))\n"
" +timeout=### (Set query timeout) [5]\n"
" +[no]tls (DNS over TLS mode)\n"
" +[no]tls (DNS-over-TLS mode)\n"
" +[no]tls-ca[=file] (Enable remote server's "
"TLS certificate validation)\n"
" +[no]tls-hostname=hostname (Explicitly set "
"the expected TLS hostname)\n"
" +[no]tls-certfile=file (Load client TLS "
"certificate chain from file)\n"
" +[no]tls-keyfile=file (Load client TLS "
"private key from file)\n"
" +[no]trace (Trace delegation down "
"from root "
"[+dnssec])\n"
@@ -325,11 +336,7 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
uint64_t diff;
time_t tnow;
struct tm tmnow;
#ifdef WIN32
wchar_t time_str[100];
#else /* ifdef WIN32 */
char time_str[100];
#endif /* ifdef WIN32 */
char fromtext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(from, fromtext, sizeof(fromtext));
@@ -346,35 +353,29 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
} else {
printf(";; Query time: %ld msec\n", (long)diff / 1000);
}
if (query->lookup->tls_mode) {
if (dig_lookup_is_tls(query->lookup)) {
proto = "TLS";
} else if (query->lookup->https_mode) {
if (query->lookup->http_plain) {
proto = "HTTP";
} else {
proto = "HTTPS";
}
} else if (query->lookup->tcp_mode) {
proto = "TCP";
} else {
proto = "UDP";
}
printf(";; SERVER: %s(%s) (%s)\n", fromtext, query->servname,
printf(";; SERVER: %s(%s) (%s)\n", fromtext, query->userarg,
proto);
time(&tnow);
(void)localtime_r(&tnow, &tmnow);
#ifdef WIN32
/*
* On Windows, time zone name ("%Z") may be a localized
* wide-character string, which strftime() handles incorrectly.
*/
if (wcsftime(time_str, sizeof(time_str) / sizeof(time_str[0]),
L"%a %b %d %H:%M:%S %Z %Y", &tmnow) > 0U)
{
printf(";; WHEN: %ls\n", time_str);
}
#else /* ifdef WIN32 */
if (strftime(time_str, sizeof(time_str),
"%a %b %d %H:%M:%S %Z %Y", &tmnow) > 0U)
{
printf(";; WHEN: %s\n", time_str);
}
#endif /* ifdef WIN32 */
if (query->lookup->doing_xfr) {
printf(";; XFR size: %u records (messages %u, "
"bytes %" PRIu64 ")\n",
@@ -502,10 +503,12 @@ dns64prefix_answer(dns_message_t *msg, isc_buffer_t *buf) {
}
result = dns_dns64_findprefix(rdataset, prefix, &count);
if (result == ISC_R_NOTFOUND)
if (result == ISC_R_NOTFOUND) {
return (ISC_R_SUCCESS);
if (count > 10)
}
if (count > 10) {
count = 10;
}
for (i = 0; i < count; i++) {
result = isc_netaddr_totext(&prefix[i].addr, buf);
if (result != ISC_R_SUCCESS) {
@@ -915,8 +918,9 @@ repopulate_buffer:
check_result(result, "dns_message_sectiontotext");
} else if (dns64prefix) {
result = dns64prefix_answer(msg, buf);
if (result == ISC_R_NOSPACE)
if (result == ISC_R_NOSPACE) {
goto buftoosmall;
}
check_result(result, "dns64prefix_answer");
} else {
result = short_answer(msg, flags, buf, query);
@@ -1024,6 +1028,128 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
}
}
#define FULLCHECK(A) \
do { \
size_t _l = strlen(cmd); \
if (_l >= sizeof(A) || strncasecmp(cmd, A, _l) != 0) \
goto invalid_option; \
} while (0)
#define FULLCHECK2(A, B) \
do { \
size_t _l = strlen(cmd); \
if ((_l >= sizeof(A) || strncasecmp(cmd, A, _l) != 0) && \
(_l >= sizeof(B) || strncasecmp(cmd, B, _l) != 0)) \
goto invalid_option; \
} while (0)
#define FULLCHECK6(A, B, C, D, E, F) \
do { \
size_t _l = strlen(cmd); \
if ((_l >= sizeof(A) || strncasecmp(cmd, A, _l) != 0) && \
(_l >= sizeof(B) || strncasecmp(cmd, B, _l) != 0) && \
(_l >= sizeof(C) || strncasecmp(cmd, C, _l) != 0) && \
(_l >= sizeof(D) || strncasecmp(cmd, D, _l) != 0) && \
(_l >= sizeof(E) || strncasecmp(cmd, E, _l) != 0) && \
(_l >= sizeof(F) || strncasecmp(cmd, F, _l) != 0)) \
goto invalid_option; \
} while (0)
static bool
plus_tls_options(const char *cmd, const char *value, const bool state,
dig_lookup_t *lookup) {
/*
* Using TLS implies "TCP-like" mode.
*/
if (!lookup->tcp_mode_set) {
lookup->tcp_mode = state;
}
switch (cmd[3]) {
case '-':
/*
* Assume that if any of the +tls-* options are set, then we
* need to verify the remote certificate (compatibility with
* kdig).
*/
if (state) {
lookup->tls_ca_set = state;
}
switch (cmd[4]) {
case 'c':
switch (cmd[5]) {
case 'a':
FULLCHECK("tls-ca");
lookup->tls_ca_set = state;
if (state && value != NULL) {
lookup->tls_ca_file =
isc_mem_strdup(mctx, value);
}
break;
case 'e':
FULLCHECK("tls-certfile");
lookup->tls_cert_file_set = state;
if (state) {
if (value != NULL && *value != '\0') {
lookup->tls_cert_file =
isc_mem_strdup(mctx,
value);
} else {
fprintf(stderr,
";; TLS certificate "
"file is "
"not specified\n");
goto invalid_option;
}
}
break;
default:
goto invalid_option;
}
break;
case 'h':
FULLCHECK("tls-hostname");
lookup->tls_hostname_set = state;
if (state) {
if (value != NULL && *value != '\0') {
lookup->tls_hostname =
isc_mem_strdup(mctx, value);
} else {
fprintf(stderr, ";; TLS hostname is "
"not specified\n");
goto invalid_option;
}
}
break;
case 'k':
FULLCHECK("tls-keyfile");
lookup->tls_key_file_set = state;
if (state) {
if (value != NULL && *value != '\0') {
lookup->tls_key_file =
isc_mem_strdup(mctx, value);
} else {
fprintf(stderr,
";; TLS private key file is "
"not specified\n");
goto invalid_option;
}
}
break;
default:
goto invalid_option;
}
break;
case '\0':
FULLCHECK("tls");
lookup->tls_mode = state;
break;
default:
goto invalid_option;
}
return true;
invalid_option:
return false;
}
/*%
* We're not using isc_commandline_parse() here since the command line
* syntax of dig is quite a bit different from that which can be described
@@ -1053,20 +1179,6 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
/* parse the rest of the string */
value = strtok_r(NULL, "", &last);
#define FULLCHECK(A) \
do { \
size_t _l = strlen(cmd); \
if (_l >= sizeof(A) || strncasecmp(cmd, A, _l) != 0) \
goto invalid_option; \
} while (0)
#define FULLCHECK2(A, B) \
do { \
size_t _l = strlen(cmd); \
if ((_l >= sizeof(A) || strncasecmp(cmd, A, _l) != 0) && \
(_l >= sizeof(B) || strncasecmp(cmd, B, _l) != 0)) \
goto invalid_option; \
} while (0)
switch (cmd[0]) {
case 'a':
switch (cmd[1]) {
@@ -1412,8 +1524,90 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
lookup->servfail_stops = state;
break;
case 'h':
FULLCHECK("header-only");
lookup->header_only = state;
switch (cmd[1]) {
case 'e': /* header-only */
FULLCHECK("header-only");
lookup->header_only = state;
break;
case 't':
FULLCHECK6("https", "https-get", "https-post",
"http-plain", "http-plain-get",
"http-plain-post");
#if HAVE_LIBNGHTTP2
if (lookup->https_path != NULL) {
isc_mem_free(mctx, lookup->https_path);
lookup->https_path = NULL;
}
if (!state) {
lookup->https_mode = false;
break;
}
lookup->https_mode = true;
if (cmd[4] == '-') {
lookup->http_plain = true;
switch (cmd[10]) {
case '\0':
FULLCHECK("http-plain");
break;
case '-':
switch (cmd[6]) {
case 'p':
FULLCHECK("https-plain-post");
break;
case 'g':
FULLCHECK("https-plain-get");
lookup->https_get = true;
break;
}
break;
default:
goto invalid_option;
}
} else {
switch (cmd[5]) {
case '\0':
FULLCHECK("https");
break;
case '-':
switch (cmd[6]) {
case 'p':
FULLCHECK("https-post");
break;
case 'g':
FULLCHECK("https-get");
lookup->https_get = true;
break;
}
break;
default:
goto invalid_option;
}
}
if (!lookup->tcp_mode_set) {
lookup->tcp_mode = state;
}
if (value == NULL) {
lookup->https_path = isc_mem_strdup(
mctx, ISC_NM_HTTP_DEFAULT_PATH);
} else {
if (!isc_nm_http_path_isvalid(value)) {
fprintf(stderr,
";; The given HTTP path \"%s\" "
"is not "
"a valid absolute path\n",
value);
goto invalid_option;
}
lookup->https_path = isc_mem_strdup(mctx,
value);
}
#else
fprintf(stderr, ";; DoH support not enabled\n");
#endif
break;
default:
goto invalid_option;
}
break;
case 'i':
switch (cmd[1]) {
@@ -1428,8 +1622,11 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
case 'i':
FULLCHECK("idnin");
#ifndef HAVE_LIBIDN2
fprintf(stderr, ";; IDN input support"
if (state) {
fprintf(stderr,
";; IDN input support"
" not enabled\n");
}
#else /* ifndef HAVE_LIBIDN2 */
lookup->idnin = state;
#endif /* ifndef HAVE_LIBIDN2 */
@@ -1437,8 +1634,11 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
case 'o':
FULLCHECK("idnout");
#ifndef HAVE_LIBIDN2
fprintf(stderr, ";; IDN output support"
if (state) {
fprintf(stderr,
";; IDN output support"
" not enabled\n");
}
#else /* ifndef HAVE_LIBIDN2 */
lookup->idnout = state;
#endif /* ifndef HAVE_LIBIDN2 */
@@ -1495,7 +1695,7 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
switch (cmd[1]) {
case 'a':
FULLCHECK("mapped");
lookup->mapped = state;
fprintf(stderr, ";; +mapped option is deprecated");
break;
case 'u':
FULLCHECK("multiline");
@@ -1716,10 +1916,20 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
}
break;
case 'w': /* showsearch */
FULLCHECK("showsearch");
if (!lookup->trace) {
showsearch = state;
usesearch = state;
switch (cmd[4]) {
case 'b':
FULLCHECK("showbadcookie");
lookup->showbadcookie = state;
break;
case 's':
FULLCHECK("showsearch");
if (!lookup->trace) {
showsearch = state;
usesearch = state;
}
break;
default:
goto invalid_option;
}
break;
default:
@@ -1837,10 +2047,15 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
}
break;
case 'l':
FULLCHECK("tls");
lookup->tls_mode = state;
if (!lookup->tcp_mode_set) {
lookup->tcp_mode = state;
switch (cmd[2]) {
case 's':
if (!plus_tls_options(cmd, value, state,
lookup)) {
goto invalid_option;
}
break;
default:
goto invalid_option;
}
break;
case 'o':
@@ -2015,7 +2230,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
have_ipv6 = false;
} else {
fatal("can't find IPv4 networking");
/* NOTREACHED */
UNREACHABLE();
return (false);
}
break;
@@ -2025,7 +2240,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
have_ipv4 = false;
} else {
fatal("can't find IPv6 networking");
/* NOTREACHED */
UNREACHABLE();
return (false);
}
break;
@@ -2061,7 +2276,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
(*lookup)->use_usec = true;
break;
case 'v':
version();
printf("DiG %s\n", PACKAGE_VERSION);
exit(0);
break;
}
@@ -2277,7 +2492,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
fprintf(stderr, "Invalid option: -%s\n", option);
usage();
}
/* NOTREACHED */
UNREACHABLE();
return (false);
}

View File

@@ -1,26 +1,18 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
.. iscman:: dig
.. program:: dig
.. _man_dig:
dig - DNS lookup utility
@@ -37,41 +29,41 @@ Synopsis
Description
~~~~~~~~~~~
``dig`` is a flexible tool for interrogating DNS name servers. It
:program:`dig` is a flexible tool for interrogating DNS name servers. It
performs DNS lookups and displays the answers that are returned from the
name server(s) that were queried. Most DNS administrators use ``dig`` to
name server(s) that were queried. Most DNS administrators use :program:`dig` to
troubleshoot DNS problems because of its flexibility, ease of use, and
clarity of output. Other lookup tools tend to have less functionality
than ``dig``.
than :program:`dig`.
Although ``dig`` is normally used with command-line arguments, it also
Although :program:`dig` is normally used with command-line arguments, it also
has a batch mode of operation for reading lookup requests from a file. A
brief summary of its command-line arguments and options is printed when
the ``-h`` option is given. The BIND 9
implementation of ``dig`` allows multiple lookups to be issued from the
the :option:`-h` option is given. The BIND 9
implementation of :program:`dig` allows multiple lookups to be issued from the
command line.
Unless it is told to query a specific name server, ``dig`` tries each
Unless it is told to query a specific name server, :program:`dig` tries each
of the servers listed in ``/etc/resolv.conf``. If no usable server
addresses are found, ``dig`` sends the query to the local host.
addresses are found, :program:`dig` sends the query to the local host.
When no command-line arguments or options are given, ``dig``
When no command-line arguments or options are given, :program:`dig`
performs an NS query for "." (the root).
It is possible to set per-user defaults for ``dig`` via
It is possible to set per-user defaults for :program:`dig` via
``${HOME}/.digrc``. This file is read and any options in it are applied
before the command-line arguments. The ``-r`` option disables this
before the command-line arguments. The :option:`-r` option disables this
feature, for scripts that need predictable behavior.
The IN and CH class names overlap with the IN and CH top-level domain
names. Either use the ``-t`` and ``-c`` options to specify the type and
class, use the ``-q`` to specify the domain name, or use "IN." and
names. Either use the :option:`-t` and :option:`-c` options to specify the type and
class, use the :option:`-q` to specify the domain name, or use "IN." and
"CH." when looking up these top-level domains.
Simple Usage
~~~~~~~~~~~~
A typical invocation of ``dig`` looks like:
A typical invocation of :program:`dig` looks like:
::
@@ -79,83 +71,101 @@ A typical invocation of ``dig`` looks like:
where:
``server``
.. option:: server
is the name or IP address of the name server to query. This can be an
IPv4 address in dotted-decimal notation or an IPv6 address in
colon-delimited notation. When the supplied ``server`` argument is a
hostname, ``dig`` resolves that name before querying that name
hostname, :program:`dig` resolves that name before querying that name
server.
If no ``server`` argument is provided, ``dig`` consults
If no ``server`` argument is provided, :program:`dig` consults
``/etc/resolv.conf``; if an address is found there, it queries the
name server at that address. If either of the ``-4`` or ``-6``
name server at that address. If either of the :option:`-4` or :option:`-6`
options are in use, then only addresses for the corresponding
transport are tried. If no usable addresses are found, ``dig``
transport are tried. If no usable addresses are found, :program:`dig`
sends the query to the local host. The reply from the name server
that responds is displayed.
``name``
.. option:: name
is the name of the resource record that is to be looked up.
``type``
.. option:: type
indicates what type of query is required - ANY, A, MX, SIG, etc.
``type`` can be any valid query type. If no ``type`` argument is
supplied, ``dig`` performs a lookup for an A record.
supplied, :program:`dig` performs a lookup for an A record.
Options
~~~~~~~
``-4``
.. option:: -4
This option indicates that only IPv4 should be used.
``-6``
.. option:: -6
This option indicates that only IPv6 should be used.
``-b address[#port]``
.. option:: -b address[#port]
This option sets the source IP address of the query. The ``address`` must be a
valid address on one of the host's network interfaces, or "0.0.0.0"
or "::". An optional port may be specified by appending ``#port``.
``-c class``
.. option:: -c class
This option sets the query class. The default ``class`` is IN; other classes are
HS for Hesiod records or CH for Chaosnet records.
``-f file``
This option sets batch mode, in which ``dig`` reads a list of lookup requests to process from
.. option:: -f file
This option sets batch mode, in which :program:`dig` reads a list of lookup requests to process from
the given ``file``. Each line in the file should be organized in the
same way it would be presented as a query to ``dig`` using the
same way it would be presented as a query to :program:`dig` using the
command-line interface.
``-k keyfile``
This option tells ``named`` to sign queries using TSIG using a key read from the given file. Key
files can be generated using ``tsig-keygen``. When using TSIG
authentication with ``dig``, the name server that is queried needs to
.. option:: -h
Print a usage summary.
.. option:: -k keyfile
This option tells :iscman:`named` to sign queries using TSIG using a key read from the given file. Key
files can be generated using :iscman:`tsig-keygen`. When using TSIG
authentication with :program:`dig`, the name server that is queried needs to
know the key and algorithm that is being used. In BIND, this is done
by providing appropriate ``key`` and ``server`` statements in
``named.conf``.
:iscman:`named.conf`.
.. option:: -m
``-m``
This option enables memory usage debugging.
``-p port``
.. option:: -p port
This option sends the query to a non-standard port on the server, instead of the
default port 53. This option is used to test a name server that
has been configured to listen for queries on a non-standard port
number.
``-q name``
.. option:: -q name
This option specifies the domain name to query. This is useful to distinguish the ``name``
from other arguments.
``-r``
.. option:: -r
This option indicates that options from ``${HOME}/.digrc`` should not be read. This is useful for
scripts that need predictable behavior.
``-t type``
.. option:: -t type
This option indicates the resource record type to query, which can be any valid query type. If
it is a resource record type supported in BIND 9, it can be given by
the type mnemonic (such as ``NS`` or ``AAAA``). The default query type is
``A``, unless the ``-x`` option is supplied to indicate a reverse
``A``, unless the :option:`-x` option is supplied to indicate a reverse
lookup. A zone transfer can be requested by specifying a type of
AXFR. When an incremental zone transfer (IXFR) is required, set the
``type`` to ``ixfr=N``. The incremental zone transfer contains
@@ -166,23 +176,27 @@ Options
the number of the type. If the resource record type is not supported
in BIND 9, the result is displayed as described in :rfc:`3597`.
``-u``
.. option:: -u
This option indicates that print query times should be provided in microseconds instead of milliseconds.
``-v``
.. option:: -v
This option prints the version number and exits.
``-x addr``
.. option:: -x addr
This option sets simplified reverse lookups, for mapping addresses to names. The
``addr`` is an IPv4 address in dotted-decimal notation, or a
colon-delimited IPv6 address. When the ``-x`` option is used, there is no
colon-delimited IPv6 address. When the :option:`-x` option is used, there is no
need to provide the ``name``, ``class``, and ``type`` arguments.
``dig`` automatically performs a lookup for a name like
:program:`dig` automatically performs a lookup for a name like
``94.2.0.192.in-addr.arpa`` and sets the query type and class to PTR
and IN respectively. IPv6 addresses are looked up using nibble format
under the IP6.ARPA domain.
``-y [hmac:]keyname:secret``
.. option:: -y [hmac:]keyname:secret
This option signs queries using TSIG with the given authentication key.
``keyname`` is the name of the key, and ``secret`` is the
base64-encoded shared secret. ``hmac`` is the name of the key algorithm;
@@ -191,15 +205,15 @@ Options
not specified, the default is ``hmac-md5``; if MD5 was disabled, the default is
``hmac-sha256``.
.. note:: Only the ``-k`` option should be used, rather than the ``-y`` option,
because with ``-y`` the shared secret is supplied as a command-line
.. note:: Only the :option:`-k` option should be used, rather than the :option:`-y` option,
because with :option:`-y` the shared secret is supplied as a command-line
argument in clear text. This may be visible in the output from ``ps1`` or
in a history file maintained by the user's shell.
Query Options
~~~~~~~~~~~~~
``dig`` provides a number of query options which affect the way in which
:program:`dig` provides a number of query options which affect the way in which
lookups are made and the results displayed. Some of these set or reset
flag bits in the query header, some determine which sections of the
answer get printed, and others determine the timeout and retry
@@ -210,20 +224,24 @@ Each query option is identified by a keyword preceded by a plus sign
the string ``no`` to negate the meaning of that keyword. Other keywords
assign values to options, like the timeout interval. They have the form
``+keyword=value``. Keywords may be abbreviated, provided the
abbreviation is unambiguous; for example, ``+cd`` is equivalent to
``+cdflag``. The query options are:
abbreviation is unambiguous; for example, :option:`+cd` is equivalent to
:option:`+cdflag`. The query options are:
``+[no]aaflag``
This option is a synonym for ``+[no]aaonly``.
.. option:: +aaflag, +noaaflag
This option is a synonym for :option:`+aaonly`, :option:`+noaaonly`.
.. option:: +aaonly, +noaaonly
``+[no]aaonly``
This option sets the ``aa`` flag in the query.
``+[no]additional``
.. option:: +additional, +noadditional
This option displays [or does not display] the additional section of a reply. The
default is to display it.
``+[no]adflag``
.. option:: +adflag, +noadflag
This option sets [or does not set] the AD (authentic data) bit in the query. This
requests the server to return whether all of the answer and authority
sections have been validated as secure, according to the security
@@ -232,61 +250,73 @@ abbreviation is unambiguous; for example, ``+cd`` is equivalent to
indicates that some part of the answer was insecure or not validated.
This bit is set by default.
``+[no]all``
.. option:: +all, +noall
This option sets or clears all display flags.
``+[no]answer``
.. option:: +answer, +noanswer
This option displays [or does not display] the answer section of a reply. The default
is to display it.
``+[no]authority``
.. option:: +authority, +noauthority
This option displays [or does not display] the authority section of a reply. The
default is to display it.
``+[no]badcookie``
.. option:: +badcookie, +nobadcookie
This option retries the lookup with a new server cookie if a BADCOOKIE response is
received.
``+[no]besteffort``
.. option:: +besteffort, +nobesteffort
This option attempts to display the contents of messages which are malformed. The
default is to not display malformed answers.
``+bufsize[=B]``
.. option:: +bufsize[=B]
This option sets the UDP message buffer size advertised using EDNS0 to
``B`` bytes. The maximum and minimum sizes of this buffer are 65535 and
0, respectively. ``+bufsize`` restores the default buffer size.
``+[no]cdflag``
.. option:: +cd, +cdflag, +nocdflag
This option sets [or does not set] the CD (checking disabled) bit in the query. This
requests the server to not perform DNSSEC validation of responses.
``+[no]class``
.. option:: +class, +noclass
This option displays [or does not display] the CLASS when printing the record.
``+[no]cmd``
.. option:: +cmd, +nocmd
This option toggles the printing of the initial comment in the output, identifying the
version of ``dig`` and the query options that have been applied. This option
version of :program:`dig` and the query options that have been applied. This option
always has a global effect; it cannot be set globally and then overridden on a
per-lookup basis. The default is to print this comment.
``+[no]comments``
.. option:: +comments, +nocomments
This option toggles the display of some comment lines in the output, with
information about the packet header and OPT pseudosection, and the names of
the response section. The default is to print these comments.
Other types of comments in the output are not affected by this option, but
can be controlled using other command-line switches. These include
``+[no]cmd``, ``+[no]question``, ``+[no]stats``, and ``+[no]rrcomments``.
:option:`+cmd`, :option:`+question`, :option:`+stats`, and :option:`+rrcomments`.
.. option:: +cookie=####, +nocookie
``+[no]cookie=####``
This option sends [or does not send] a COOKIE EDNS option, with an optional value. Replaying a COOKIE
from a previous response allows the server to identify a previous
client. The default is ``+cookie``.
``+cookie`` is also set when ``+trace`` is set to better emulate the
``+cookie`` is also set when :option:`+trace` is set to better emulate the
default queries from a nameserver.
``+[no]crypto``
.. option:: +crypto, +nocrypto
This option toggles the display of cryptographic fields in DNSSEC records. The
contents of these fields are unnecessary for debugging most DNSSEC
validation failures and removing them makes it easier to see the
@@ -294,131 +324,186 @@ abbreviation is unambiguous; for example, ``+cd`` is equivalent to
they are replaced by the string ``[omitted]`` or, in the DNSKEY case, the
key ID is displayed as the replacement, e.g. ``[ key id = value ]``.
``+[no]defname``
This option, which is deprecated, is treated as a synonym for ``+[no]search``.
.. option:: +defname, +nodefname
This option, which is deprecated, is treated as a synonym for
:option:`+search`, :option:`+nosearch`.
.. option:: +dns64prefix, +nodns64prefix
``+[no]dns64prefix``
Lookup IPV4ONLY.ARPA AAAA and print any DNS64 prefixes found.
``+[no]dnssec``
.. option:: +dnssec, +do, +nodnssec, +nodo
This option requests that DNSSEC records be sent by setting the DNSSEC OK (DO) bit in
the OPT record in the additional section of the query.
``+domain=somename``
.. option:: +domain=somename
This option sets the search list to contain the single domain ``somename``, as if
specified in a ``domain`` directive in ``/etc/resolv.conf``, and
enables search list processing as if the ``+search`` option were
enables search list processing as if the :option:`+search` option were
given.
``+dscp=value``
.. option:: +dscp=value
This option sets the DSCP code point to be used when sending the query. Valid DSCP
code points are in the range [0...63]. By default no code point is
explicitly set.
``+[no]edns[=#]``
.. option:: +edns[=#], +noedns
This option specifies the EDNS version to query with. Valid values are 0 to 255.
Setting the EDNS version causes an EDNS query to be sent.
``+noedns`` clears the remembered EDNS version. EDNS is set to 0 by
default.
``+[no]ednsflags[=#]``
.. option:: +ednsflags[=#], +noednsflags
This option sets the must-be-zero EDNS flags bits (Z bits) to the specified value.
Decimal, hex, and octal encodings are accepted. Setting a named flag
(e.g., DO) is silently ignored. By default, no Z bits are set.
``+[no]ednsnegotiation``
.. option:: +ednsnegotiation, +noednsnegotiation
This option enables/disables EDNS version negotiation. By default, EDNS version
negotiation is enabled.
``+[no]ednsopt[=code[:value]]``
.. option:: +ednsopt[=code[:value]], +noednsopt
This option specifies the EDNS option with code point ``code`` and an optional payload
of ``value`` as a hexadecimal string. ``code`` can be either an EDNS
option name (for example, ``NSID`` or ``ECS``) or an arbitrary
numeric value. ``+noednsopt`` clears the EDNS options to be sent.
``+[no]expire``
.. option:: +expire, +noexpire
This option sends an EDNS Expire option.
``+[no]fail``
This option indicates that ``named`` should try [or not try] the next server if a SERVFAIL is received. The default is
.. option:: +fail, +nofail
This option indicates that :iscman:`named` should try [or not try] the next server if a SERVFAIL is received. The default is
to not try the next server, which is the reverse of normal stub
resolver behavior.
``+[no]header-only``
.. option:: +header-only, +noheader-only
This option sends a query with a DNS header without a question section. The
default is to add a question section. The query type and query name
are ignored when this is set.
``+[no]identify``
This option shows [or does not show] the IP address and port number that supplied
the answer, when the ``+short`` option is enabled. If short form
answers are requested, the default is not to show the source address
and port number of the server that provided the answer.
.. option:: +https[=value], +nohttps
This option indicates whether to use DNS over HTTPS (DoH) when querying
name servers. When this option is in use, the port number defaults to 443.
The HTTP POST request mode is used when sending the query.
If ``value`` is specified, it will be used as the HTTP endpoint in the
query URI; the default is ``/dns-query``. So, for example, ``dig
@example.com +https`` will use the URI ``https://example.com/dns-query``.
.. option:: +https-get[=value], +nohttps-get
Similar to :option:`+https`, except that the HTTP GET request mode is used
when sending the query.
.. option:: +https-post[=value], +nohttps-post
Same as :option:`+https`.
.. option:: +http-plain[=value], +nohttp-plain
Similar to :option:`+https`, except that HTTP queries will be sent over a
non-encrypted channel. When this option is in use, the port number
defaults to 80 and the HTTP request mode is POST.
.. option:: +http-plain-get[=value], +nohttp-plain-get
Similar to :option:`+http-plain`, except that the HTTP request mode is GET.
.. option:: +http-plain-post[=value], +nohttp-plain-post
Same as :option:`+http-plain`.
.. option:: +identify, +noidentify
This option shows [or does not show] the IP address and port number that
supplied the answer, when the :option:`+short` option is enabled. If short
form answers are requested, the default is not to show the source
address and port number of the server that provided the answer.
.. option:: +idnin, +noidnin
``+[no]idnin``
This option processes [or does not process] IDN domain names on input. This requires
``IDN SUPPORT`` to have been enabled at compile time.
The default is to process IDN input when standard output is a tty.
The IDN processing on input is disabled when ``dig`` output is redirected
The IDN processing on input is disabled when :program:`dig` output is redirected
to files, pipes, and other non-tty file descriptors.
``+[no]idnout``
.. option:: +idnout, +noidnout
This option converts [or does not convert] puny code on output. This requires
``IDN SUPPORT`` to have been enabled at compile time.
The default is to process puny code on output when standard output is
a tty. The puny code processing on output is disabled when ``dig`` output
a tty. The puny code processing on output is disabled when :program:`dig` output
is redirected to files, pipes, and other non-tty file descriptors.
``+[no]ignore``
.. option:: +ignore, +noignore
This option ignores [or does not ignore] truncation in UDP responses instead of retrying with TCP. By
default, TCP retries are performed.
``+[no]keepalive``
.. option:: +keepalive, +nokeepalive
This option sends [or does not send] an EDNS Keepalive option.
``+[no]keepopen``
.. option:: +keepopen, +nokeepopen
This option keeps [or does not keep] the TCP socket open between queries, and reuses it rather than
creating a new TCP socket for each lookup. The default is
``+nokeepopen``.
``+[no]mapped``
This option allows [or does not allow] mapped IPv4-over-IPv6 addresses to be used. The default is
``+mapped``.
.. option:: +multiline, +nomultiline
``+[no]multiline``
This option prints [or does not print] records, like the SOA records, in a verbose multi-line format
with human-readable comments. The default is to print each record on
a single line to facilitate machine parsing of the ``dig`` output.
a single line to facilitate machine parsing of the :program:`dig` output.
.. option:: +ndots=D
``+ndots=D``
This option sets the number of dots (``D``) that must appear in ``name`` for
it to be considered absolute. The default value is that defined using
the ``ndots`` statement in ``/etc/resolv.conf``, or 1 if no ``ndots``
statement is present. Names with fewer dots are interpreted as
relative names, and are searched for in the domains listed in the
``search`` or ``domain`` directive in ``/etc/resolv.conf`` if
``+search`` is set.
:option:`+search` is set.
.. option:: +nsid, +nonsid
``+[no]nsid``
When enabled, this option includes an EDNS name server ID request when sending a query.
``+[no]nssearch``
When this option is set, ``dig`` attempts to find the authoritative
.. option:: +nssearch, +nonssearch
When this option is set, :program:`dig` attempts to find the authoritative
name servers for the zone containing the name being looked up, and
display the SOA record that each name server has for the zone.
Addresses of servers that did not respond are also printed.
``+[no]onesoa``
.. option:: +onesoa, +noonesoa
When enabled, this option prints only one (starting) SOA record when performing an AXFR. The
default is to print both the starting and ending SOA records.
``+[no]opcode=value``
.. option:: +opcode=value, +noopcode
When enabled, this option sets (restores) the DNS message opcode to the specified value. The
default value is QUERY (0).
``+padding=value``
.. option:: +padding=value
This option pads the size of the query packet using the EDNS Padding option to
blocks of ``value`` bytes. For example, ``+padding=32`` causes a
48-byte query to be padded to 64 bytes. The default block size is 0,
@@ -427,75 +512,96 @@ abbreviation is unambiguous; for example, ``+cd`` is equivalent to
mandatory. Responses to padded queries may also be padded, but only
if the query uses TCP or DNS COOKIE.
``+qid=value``
.. option:: +qid=value
This option specifies the query ID to use when sending queries.
``+[no]qr``
.. option:: +qr, +noqr
This option toggles the display of the query message as it is sent. By default, the query
is not printed.
``+[no]question``
.. option:: +question, +noquestion
This option toggles the display of the question section of a query when an answer is
returned. The default is to print the question section as a comment.
``+[no]raflag``
.. option:: +raflag, +noraflag
This option sets [or does not set] the RA (Recursion Available) bit in the query. The
default is ``+noraflag``. This bit is ignored by the server for
QUERY.
``+[no]rdflag``
This option is a synonym for ``+[no]recurse``.
.. option:: +rdflag, +nordflag
This option is a synonym for :option:`+recurse`, :option:`+norecurse`.
.. option:: +recurse, +norecurse
``+[no]recurse``
This option toggles the setting of the RD (recursion desired) bit in the query.
This bit is set by default, which means ``dig`` normally sends
This bit is set by default, which means :program:`dig` normally sends
recursive queries. Recursion is automatically disabled when the
``+nssearch`` or ``+trace`` query option is used.
:option:`+nssearch` or :option:`+trace` query option is used.
``+retry=T``
This option sets the number of times to retry UDP queries to server to ``T``
instead of the default, 2. Unlike ``+tries``, this does not include
.. option:: +retry=T
This option sets the number of times to retry UDP and TCP queries to server to ``T``
instead of the default, 2. Unlike :option:`+tries`, this does not include
the initial query.
``+[no]rrcomments``
.. option:: +rrcomments, +norrcomments
This option toggles the display of per-record comments in the output (for example,
human-readable key information about DNSKEY records). The default is
not to print record comments unless multiline mode is active.
``+[no]search``
.. option:: +search, +nosearch
This option uses [or does not use] the search list defined by the searchlist or domain
directive in ``resolv.conf``, if any. The search list is not used by
default.
``ndots`` from ``resolv.conf`` (default 1), which may be overridden by
``+ndots``, determines whether the name is treated as relative
:option:`+ndots`, determines whether the name is treated as relative
and hence whether a search is eventually performed.
``+[no]short``
.. option:: +short, +noshort
This option toggles whether a terse answer is provided. The default is to print the answer in a verbose
form. This option always has a global effect; it cannot be set globally and
then overridden on a per-lookup basis.
``+[no]showsearch``
.. option:: +showbadcookie, +noshowbadcookie
This option toggles whether to show the message containing the
BADCOOKIE rcode before retrying the request or not. The default
is to not show the messages.
.. option:: +showsearch, +noshowsearch
This option performs [or does not perform] a search showing intermediate results.
``+[no]sigchase``
This feature is now obsolete and has been removed; use ``delv``
.. option:: +sigchase, +nosigchase
This feature is now obsolete and has been removed; use :iscman:`delv`
instead.
``+split=W``
.. option:: +split=W
This option splits long hex- or base64-formatted fields in resource records into
chunks of ``W`` characters (where ``W`` is rounded up to the nearest
multiple of 4). ``+nosplit`` or ``+split=0`` causes fields not to be
split at all. The default is 56 characters, or 44 characters when
multiline mode is active.
``+[no]stats``
.. option:: +stats, +nostats
This option toggles the printing of statistics: when the query was made, the size of the
reply, etc. The default behavior is to print the query statistics as a
comment after each lookup.
``+[no]subnet=addr[/prefix-length]``
.. option:: +subnet=addr[/prefix-length], +nosubnet
This option sends [or does not send] an EDNS CLIENT-SUBNET option with the specified IP
address or network prefix.
@@ -504,32 +610,60 @@ abbreviation is unambiguous; for example, ``+cd`` is equivalent to
prefix-length of zero, which signals a resolver that the client's
address information must *not* be used when resolving this query.
``+[no]tcflag``
.. option:: +tcflag, +notcflag
This option sets [or does not set] the TC (TrunCation) bit in the query. The default is
``+notcflag``. This bit is ignored by the server for QUERY.
``+[no]tcp``
.. option:: +tcp, +notcp
This option indicates whether to use TCP when querying name servers.
The default behavior is to use UDP unless a type ``any`` or ``ixfr=N``
query is requested, in which case the default is TCP. AXFR queries
always use TCP.
``+timeout=T``
.. option:: +timeout=T
This option sets the timeout for a query to ``T`` seconds. The default timeout is
5 seconds. An attempt to set ``T`` to less than 1 is silently set to 1.
``+[no]tls``
.. option:: +tls, +notls
This option indicates whether to use DNS over TLS (DoT) when querying
name servers.
name servers. When this option is in use, the port number defaults
to 853.
``+[no]topdown``
This feature is related to ``dig +sigchase``, which is obsolete and
has been removed. Use ``delv`` instead.
.. option:: +tls-ca[=file-name], +notls-ca
This option enables remote server TLS certificate validation for
DNS transports, relying on TLS. Certificate authorities
certificates are loaded from the specified PEM file
(``file-name``). If the file is not specified, the default
certificates from the global certificates store are used.
.. option:: +tls-certfile=file-name, +tls-keyfile=file-name, +notls-certfile, +notls-keyfile
These options set the state of certificate-based client
authentication for DNS transports, relying on TLS. Both certificate
chain file and private key file are expected to be in PEM format.
Both options must be specified at the same time.
.. option:: +tls-hostname=hostname, +notls-hostname
This option makes :program:`dig` use the provided hostname during remote
server TLS certificate verification. Otherwise, the DNS server name
is used. This option has no effect if :option:`+tls-ca` is not specified.
.. option:: +topdown, +notopdown
This feature is related to :option:`dig +sigchase`, which is obsolete and
has been removed. Use :iscman:`delv` instead.
.. option:: +trace, +notrace
``+[no]trace``
This option toggles tracing of the delegation path from the root name servers for
the name being looked up. Tracing is disabled by default. When
tracing is enabled, ``dig`` makes iterative queries to resolve the
tracing is enabled, :program:`dig` makes iterative queries to resolve the
name being looked up. It follows referrals from the root servers,
showing the answer from each server that was used to resolve the
lookup.
@@ -537,49 +671,57 @@ abbreviation is unambiguous; for example, ``+cd`` is equivalent to
If ``@server`` is also specified, it affects only the initial query for
the root zone name servers.
``+dnssec`` is also set when ``+trace`` is set, to better emulate the
:option:`+dnssec` is also set when :option:`+trace` is set, to better emulate the
default queries from a name server.
``+tries=T``
This option sets the number of times to try UDP queries to server to ``T``
.. option:: +tries=T
This option sets the number of times to try UDP and TCP queries to server to ``T``
instead of the default, 3. If ``T`` is less than or equal to zero,
the number of tries is silently rounded up to 1.
``+trusted-key=####``
This option formerly specified trusted keys for use with ``dig +sigchase``. This
feature is now obsolete and has been removed; use ``delv`` instead.
.. option:: +trusted-key=####
This option formerly specified trusted keys for use with :option:`dig +sigchase`. This
feature is now obsolete and has been removed; use :iscman:`delv` instead.
.. option:: +ttlid, +nottlid
``+[no]ttlid``
This option displays [or does not display] the TTL when printing the record.
``+[no]ttlunits``
.. option:: +ttlunits, +nottlunits
This option displays [or does not display] the TTL in friendly human-readable time
units of ``s``, ``m``, ``h``, ``d``, and ``w``, representing seconds, minutes,
hours, days, and weeks. This implies ``+ttlid``.
hours, days, and weeks. This implies :option:`+ttlid`.
.. option:: +unknownformat, +nounknownformat
``+[no]unknownformat``
This option prints all RDATA in unknown RR type presentation format (:rfc:`3597`).
The default is to print RDATA for known types in the type's
presentation format.
``+[no]vc``
.. option:: +vc, +novc
This option uses [or does not use] TCP when querying name servers. This alternate
syntax to ``+[no]tcp`` is provided for backwards compatibility. The
syntax to :option:`+tcp` is provided for backwards compatibility. The
``vc`` stands for "virtual circuit."
``+[no]yaml``
When enabled, this option prints the responses (and, if ``+qr`` is in use, also the
.. option:: +yaml, +noyaml
When enabled, this option prints the responses (and, if :option:`+qr` is in use, also the
outgoing queries) in a detailed YAML format.
``+[no]zflag``
.. option:: +zflag, +nozflag
This option sets [or does not set] the last unassigned DNS header flag in a DNS query.
This flag is off by default.
Multiple Queries
~~~~~~~~~~~~~~~~
The BIND 9 implementation of ``dig`` supports specifying multiple
queries on the command line (in addition to supporting the ``-f`` batch
The BIND 9 implementation of :program:`dig` supports specifying multiple
queries on the command line (in addition to supporting the :option:`-f` batch
file option). Each of those queries can be supplied with its own set of
flags, options, and query options.
@@ -592,33 +734,53 @@ query.
A global set of query options, which should be applied to all queries,
can also be supplied. These global query options must precede the first
tuple of name, class, type, options, flags, and query options supplied
on the command line. Any global query options (except ``+[no]cmd`` and
``+[no]short`` options) can be overridden by a query-specific set of
on the command line. Any global query options (except :option:`+cmd` and
:option:`+short` options) can be overridden by a query-specific set of
query options. For example:
::
dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
shows how ``dig`` can be used from the command line to make three
shows how :program:`dig` can be used from the command line to make three
lookups: an ANY query for ``www.isc.org``, a reverse lookup of 127.0.0.1,
and a query for the NS records of ``isc.org``. A global query option of
``+qr`` is applied, so that ``dig`` shows the initial query it made for
each lookup. The final query has a local query option of ``+noqr`` which
means that ``dig`` does not print the initial query when it looks up the
:option:`+qr` is applied, so that :program:`dig` shows the initial query it made for
each lookup. The final query has a local query option of :option:`+qr` which
means that :program:`dig` does not print the initial query when it looks up the
NS records for ``isc.org``.
IDN Support
~~~~~~~~~~~
If ``dig`` has been built with IDN (internationalized domain name)
support, it can accept and display non-ASCII domain names. ``dig``
If :program:`dig` has been built with IDN (internationalized domain name)
support, it can accept and display non-ASCII domain names. :program:`dig`
appropriately converts character encoding of a domain name before sending
a request to a DNS server or displaying a reply from the server.
To turn off IDN support, use the parameters
``+noidnin`` and ``+noidnout``, or define the ``IDN_DISABLE`` environment
:option:`+idnin` and :option:`+idnout`, or define the ``IDN_DISABLE`` environment
variable.
Return Codes
~~~~~~~~~~~~
:program:`dig` return codes are:
``0``
DNS response received, including NXDOMAIN status
``1``
Usage error
``8``
Couldn't open batch file
``9``
No reply from server
``10``
Internal error
Files
~~~~~
@@ -629,7 +791,7 @@ Files
See Also
~~~~~~~~
:manpage:`delv(1)`, :manpage:`host(1)`, :manpage:`named(8)`, :manpage:`dnssec-keygen(8)`, :rfc:`1035`.
:iscman:`delv(1) <delv>`, :iscman:`host(1) <host>`, :iscman:`named(8) <named>`, :iscman:`dnssec-keygen(8) <dnssec-keygen>`, :rfc:`1035`.
Bugs
~~~~

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -9,8 +11,7 @@
* information regarding copyright ownership.
*/
#ifndef DIG_H
#define DIG_H
#pragma once
/*! \file */
@@ -28,7 +29,7 @@
#include <isc/print.h>
#include <isc/refcount.h>
#include <isc/sockaddr.h>
#include <isc/socket.h>
#include <isc/time.h>
#include <dns/rdatalist.h>
@@ -76,6 +77,8 @@
#define DEFAULT_EDNS_VERSION 0
#define DEFAULT_EDNS_BUFSIZE 1232
#define DEFAULT_HTTPS_QUERY "?dns="
/*%
* Lookup_limit is just a limiter, keeping too many lookups from being
* created. It's job is mainly to prevent the program from running away
@@ -108,18 +111,18 @@ struct dig_lookup {
message */
identify_previous_line, /*% Prepend a "Nameserver <foo>:"
message, with newline and tab */
idnin, idnout, ignore, mapped, multiline, need_search,
new_search, noclass, nocrypto, nottl,
ns_search_only, /*%< dig +nssearch, host -C */
idnin, idnout, ignore, multiline, need_search, new_search,
noclass, nocrypto, nottl, ns_search_only, /*%< dig +nssearch,
host -C */
nsid, /*% Name Server ID (RFC 5001) */
onesoa, pending, /*%< Pending a successful answer */
print_unknown_format, qr, raflag, recurse, section_additional,
section_answer, section_authority, section_question,
seenbadcookie, sendcookie, servfail_stops,
setqid, /*% use a speciied query ID */
stats, tcflag, tcp_keepalive, tcp_mode, tcp_mode_set,
tls_mode, /*% connect using TLS */
trace, /*% dig +trace */
showbadcookie, stats, tcflag, tcp_keepalive, tcp_mode,
tcp_mode_set, tls_mode, /*% connect using TLS */
trace, /*% dig +trace */
trace_root, /*% initial query for either +trace or +nssearch */
ttlunits, use_usec, waiting_connect, zflag;
char textname[MXNAME]; /*% Name we're going to be looking up */
@@ -168,17 +171,35 @@ struct dig_lookup {
int rrcomments;
unsigned int eoferr;
uint16_t qid;
struct {
bool http_plain;
bool https_mode;
bool https_get;
char *https_path;
};
struct {
bool tls_ca_set;
char *tls_ca_file;
bool tls_hostname_set;
char *tls_hostname;
bool tls_cert_file_set;
char *tls_cert_file;
bool tls_key_file_set;
char *tls_key_file;
isc_tlsctx_cache_t *tls_ctx_cache;
};
};
/*% The dig_query structure */
struct dig_query {
unsigned int magic;
dig_lookup_t *lookup;
bool first_pass;
bool started;
bool first_soa_rcvd;
bool second_rr_rcvd;
bool first_repeat_rcvd;
bool warn_id;
bool canceled;
uint32_t first_rr_serial;
uint32_t second_rr_serial;
uint32_t msg_count;
@@ -199,8 +220,6 @@ struct dig_query {
isc_time_t time_recv;
uint64_t byte_count;
isc_timer_t *timer;
uint8_t tries;
isc_tlsctx_t *tlsctx;
};
struct dig_server {
@@ -267,13 +286,13 @@ getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp);
isc_result_t
get_reverse(char *reverse, size_t len, char *value, bool strict);
ISC_NORETURN void
noreturn void
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
void
warn(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
ISC_NORETURN void
noreturn void
digexit(void);
void
@@ -438,6 +457,7 @@ dig_idnsetup(dig_lookup_t *lookup, bool active);
void
dig_shutdown(void);
ISC_LANG_ENDDECLS
bool
dig_lookup_is_tls(const dig_lookup_t *lookup);
#endif /* ifndef DIG_H */
ISC_LANG_ENDDECLS

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -13,13 +15,10 @@
#include <inttypes.h>
#include <limits.h>
#include <locale.h>
#include <stdbool.h>
#include <stdlib.h>
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif /* ifdef HAVE_LOCALE_H */
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/commandline.h>
@@ -102,7 +101,7 @@ rcode_totext(dns_rcode_t rcode) {
return (totext.deconsttext);
}
ISC_NORETURN static void
noreturn static void
show_usage(void);
static void
@@ -151,7 +150,11 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
if (!short_form) {
char fromtext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(from, fromtext, sizeof(fromtext));
TIME_NOW(&now);
if (query->lookup->use_usec) {
TIME_NOW_HIRES(&now);
} else {
TIME_NOW(&now);
}
diff = (int)isc_time_microdiff(&now, &query->time_sent);
printf("Received %u bytes from %s in %d ms\n", bytes, fromtext,
diff / 1000);
@@ -208,15 +211,9 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
isc_result_t result, loopresult;
isc_region_t r;
dns_name_t empty_name;
char tbuf[4096];
char tbuf[4096] = { 0 };
bool first;
bool no_rdata;
if (sectionid == DNS_SECTION_QUESTION) {
no_rdata = true;
} else {
no_rdata = false;
}
bool no_rdata = (sectionid == DNS_SECTION_QUESTION);
if (headers) {
printf(";; %s SECTION:\n", section_name);
@@ -375,7 +372,7 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
dns_rdataset_current(rdataset, &rdata);
result = dns_rdata_tostruct(&rdata, &cname, NULL);
check_result(result, "dns_rdata_tostruct");
dns_name_copynf(&cname.cname, qname);
dns_name_copy(&cname.cname, qname);
dns_rdata_freestruct(&cname);
}
}
@@ -438,7 +435,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
/* Add AAAA and MX lookups. */
name = dns_fixedname_initname(&fixed);
dns_name_copynf(query->lookup->name, name);
dns_name_copy(query->lookup->name, name);
chase_cnamechain(msg, name);
dns_name_format(name, namestr, sizeof(namestr));
lookup = clone_lookup(query->lookup, false);
@@ -581,12 +578,6 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
static const char *optstring = "46aAc:dilnm:p:rst:vVwCDN:R:TUW:";
/*% version */
static void
version(void) {
fprintf(stderr, "host %s\n", PACKAGE_VERSION);
}
static void
pre_parse_args(int argc, char **argv) {
int c;
@@ -660,7 +651,7 @@ pre_parse_args(int argc, char **argv) {
case 'v':
break;
case 'V':
version();
printf("host %s\n", PACKAGE_VERSION);
exit(0);
break;
case 'w':
@@ -773,7 +764,7 @@ parse_args(bool is_batchfile, int argc, char **argv) {
break;
case 'A':
list_almost_all = true;
/* FALL THROUGH */
FALLTHROUGH;
case 'a':
if (!lookup->rdtypeset ||
lookup->rdtype != dns_rdatatype_axfr) {

View File

@@ -1,26 +1,18 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
.. iscman:: host
.. program:: host
.. _man_host:
host - DNS lookup utility
@@ -34,55 +26,64 @@ Synopsis
Description
~~~~~~~~~~~
``host`` is a simple utility for performing DNS lookups. It is normally
:program:`host` is a simple utility for performing DNS lookups. It is normally
used to convert names to IP addresses and vice versa. When no arguments
or options are given, ``host`` prints a short summary of its
or options are given, :program:`host` prints a short summary of its
command-line arguments and options.
``name`` is the domain name that is to be looked up. It can also be a
dotted-decimal IPv4 address or a colon-delimited IPv6 address, in which
case ``host`` by default performs a reverse lookup for that address.
case :program:`host` by default performs a reverse lookup for that address.
``server`` is an optional argument which is either the name or IP
address of the name server that ``host`` should query instead of the
address of the name server that :program:`host` should query instead of the
server or servers listed in ``/etc/resolv.conf``.
Options
~~~~~~~
``-4``
This option specifies that only IPv4 should be used for query transport. See also the ``-6`` option.
.. option:: -4
``-6``
This option specifies that only IPv6 should be used for query transport. See also the ``-4`` option.
This option specifies that only IPv4 should be used for query transport. See also the :option:`-6` option.
``-a``
The ``-a`` ("all") option is normally equivalent to ``-v -t ANY``. It
also affects the behavior of the ``-l`` list zone option.
.. option:: -6
``-A``
The ``-A`` ("almost all") option is equivalent to ``-a``, except that RRSIG,
This option specifies that only IPv6 should be used for query transport. See also the :option:`-4` option.
.. option:: -a
The :option:`-a` ("all") option is normally equivalent to :option:`-v` :option:`-t ANY <-t>`. It
also affects the behavior of the :option:`-l` list zone option.
.. option:: -A
The :option:`-A` ("almost all") option is equivalent to :option:`-a`, except that RRSIG,
NSEC, and NSEC3 records are omitted from the output.
``-c class``
.. option:: -c class
This option specifies the query class, which can be used to lookup HS (Hesiod) or CH (Chaosnet)
class resource records. The default class is IN (Internet).
``-C``
This option indicates that ``named`` should check consistency, meaning that ``host`` queries the SOA records for zone
.. option:: -C
This option indicates that :iscman:`named` should check consistency, meaning that :program:`host` queries the SOA records for zone
``name`` from all the listed authoritative name servers for that
zone. The list of name servers is defined by the NS records that are
found for the zone.
``-d``
This option prints debugging traces, and is equivalent to the ``-v`` verbose option.
.. option:: -d
``-l``
This option tells ``named` to list the zone, meaning the ``host`` command performs a zone transfer of zone
This option prints debugging traces, and is equivalent to the :option:`-v` verbose option.
.. option:: -l
This option tells :iscman:`named` to list the zone, meaning the :program:`host` command performs a zone transfer of zone
``name`` and prints out the NS, PTR, and address records (A/AAAA).
Together, the ``-l -a`` options print all records in the zone.
Together, the :option:`-l` :option:`-a` options print all records in the zone.
.. option:: -N ndots
``-N ndots``
This option specifies the number of dots (``ndots``) that have to be in ``name`` for it to be
considered absolute. The default value is that defined using the
``ndots`` statement in ``/etc/resolv.conf``, or 1 if no ``ndots`` statement
@@ -90,85 +91,96 @@ Options
and are searched for in the domains listed in the ``search`` or
``domain`` directive in ``/etc/resolv.conf``.
``-p port``
.. option:: -p port
This option specifies the port to query on the server. The default is 53.
``-r``
.. option:: -r
This option specifies a non-recursive query; setting this option clears the RD (recursion
desired) bit in the query. This means that the name server
receiving the query does not attempt to resolve ``name``. The ``-r``
option enables ``host`` to mimic the behavior of a name server by
receiving the query does not attempt to resolve ``name``. The :option:`-r`
option enables :program:`host` to mimic the behavior of a name server by
making non-recursive queries, and expecting to receive answers to
those queries that can be referrals to other name servers.
``-R number``
.. option:: -R number
This option specifies the number of retries for UDP queries. If ``number`` is negative or zero,
the number of retries is silently set to 1. The default value is 1, or
the value of the ``attempts`` option in ``/etc/resolv.conf``, if set.
``-s``
This option tells ``named`` *not* to send the query to the next nameserver if any server responds
.. option:: -s
This option tells :iscman:`named` *not* to send the query to the next nameserver if any server responds
with a SERVFAIL response, which is the reverse of normal stub
resolver behavior.
``-t type``
.. option:: -t type
This option specifies the query type. The ``type`` argument can be any recognized query type:
CNAME, NS, SOA, TXT, DNSKEY, AXFR, etc.
When no query type is specified, ``host`` automatically selects an
When no query type is specified, :program:`host` automatically selects an
appropriate query type. By default, it looks for A, AAAA, and MX
records. If the ``-C`` option is given, queries are made for SOA
records. If the :option:`-C` option is given, queries are made for SOA
records. If ``name`` is a dotted-decimal IPv4 address or
colon-delimited IPv6 address, ``host`` queries for PTR records.
colon-delimited IPv6 address, :program:`host` queries for PTR records.
If a query type of IXFR is chosen, the starting serial number can be
specified by appending an equals sign (=), followed by the starting serial
number, e.g., ``-t IXFR=12345678``.
number, e.g., :option:`-t IXFR=12345678 <-t>`.
``-T``; ``-U``
This option specifies TCP or UDP. By default, ``host`` uses UDP when making queries; the
``-T`` option makes it use a TCP connection when querying the name
.. option:: -T, -U
This option specifies TCP or UDP. By default, :program:`host` uses UDP when making queries; the
:option:`-T` option makes it use a TCP connection when querying the name
server. TCP is automatically selected for queries that require
it, such as zone transfer (AXFR) requests. Type ``ANY`` queries default
to TCP, but can be forced to use UDP initially via ``-U``.
to TCP, but can be forced to use UDP initially via :option:`-U`.
.. option:: -m flag
``-m flag``
This option sets memory usage debugging: the flag can be ``record``, ``usage``, or
``trace``. The ``-m`` option can be specified more than once to set
``trace``. The :option:`-m` option can be specified more than once to set
multiple flags.
``-v``
This option sets verbose output, and is equivalent to the ``-d`` debug option. Verbose output
.. option:: -v
This option sets verbose output, and is equivalent to the :option:`-d` debug option. Verbose output
can also be enabled by setting the ``debug`` option in
``/etc/resolv.conf``.
``-V``
.. option:: -V
This option prints the version number and exits.
``-w``
This option sets "wait forever": the query timeout is set to the maximum possible. See
also the ``-W`` option.
.. option:: -w
``-W wait``
This options sets the length of the wait timeout, indicating that ``named`` should wait for up to ``wait`` seconds for a reply. If ``wait`` is
This option sets "wait forever": the query timeout is set to the maximum possible. See
also the :option:`-W` option.
.. option:: -W wait
This options sets the length of the wait timeout, indicating that :iscman:`named` should wait for up to ``wait`` seconds for a reply. If ``wait`` is
less than 1, the wait interval is set to 1 second.
By default, ``host`` waits for 5 seconds for UDP responses and 10
By default, :program:`host` waits for 5 seconds for UDP responses and 10
seconds for TCP connections. These defaults can be overridden by the
``timeout`` option in ``/etc/resolv.conf``.
See also the ``-w`` option.
See also the :option:`-w` option.
IDN Support
~~~~~~~~~~~
If ``host`` has been built with IDN (internationalized domain name)
support, it can accept and display non-ASCII domain names. ``host``
If :program:`host` has been built with IDN (internationalized domain name)
support, it can accept and display non-ASCII domain names. :program:`host`
appropriately converts character encoding of a domain name before sending
a request to a DNS server or displaying a reply from the server.
To turn off IDN support, define the ``IDN_DISABLE``
environment variable. IDN support is disabled if the variable is set
when ``host`` runs.
when :program:`host` runs.
Files
~~~~~
@@ -178,4 +190,4 @@ Files
See Also
~~~~~~~~
:manpage:`dig(1)`, :manpage:`named(8)`.
:iscman:`dig(1) <dig>`, :iscman:`named(8) <named>`.

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
@@ -391,7 +393,7 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
dns_rdataset_current(rdataset, &rdata);
result = dns_rdata_tostruct(&rdata, &cname, NULL);
check_result(result, "dns_rdata_tostruct");
dns_name_copynf(&cname.cname, qname);
dns_name_copy(&cname.cname, qname);
dns_rdata_freestruct(&cname);
}
}
@@ -448,7 +450,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
/* Add AAAA lookup. */
name = dns_fixedname_initname(&fixed);
dns_name_copynf(query->lookup->name, name);
dns_name_copy(query->lookup->name, name);
chase_cnamechain(msg, name);
dns_name_format(name, namestr, sizeof(namestr));
lookup = clone_lookup(query->lookup, false);
@@ -610,17 +612,10 @@ set_ndots(const char *value) {
}
}
static void
version(void) {
fprintf(stderr, "nslookup %s\n", PACKAGE_VERSION);
}
static void
setoption(char *opt) {
size_t l = strlen(opt);
debugging = true;
#define CHECKOPT(A, N) \
((l >= N) && (l < sizeof(A)) && (strncasecmp(opt, A, l) == 0))
@@ -854,7 +849,7 @@ get_next_command(void) {
}
}
ISC_NORETURN static void
noreturn static void
usage(void);
static void
@@ -880,7 +875,7 @@ parse_args(int argc, char **argv) {
debug("main parsing %s", argv[0]);
if (argv[0][0] == '-') {
if (strncasecmp(argv[0], "-ver", 4) == 0) {
version();
printf("nslookup %s\n", PACKAGE_VERSION);
exit(0);
} else if (argv[0][1] != 0) {
setoption(&argv[0][1]);

View File

@@ -1,26 +1,18 @@
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
..
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
.. SPDX-License-Identifier: MPL-2.0
..
.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, you can obtain one at https://mozilla.org/MPL/2.0/.
..
.. See the COPYRIGHT file distributed with this work for additional
.. information regarding copyright ownership.
.. highlight: console
.. iscman:: nslookup
.. program:: nslookup
.. _man_nslookup:
nslookup - query Internet name servers interactively
@@ -34,8 +26,8 @@ Synopsis
Description
~~~~~~~~~~~
``nslookup`` is a program to query Internet domain name servers.
``nslookup`` has two modes: interactive and non-interactive. Interactive
:program:`nslookup` is a program to query Internet domain name servers.
:program:`nslookup` has two modes: interactive and non-interactive. Interactive
mode allows the user to query name servers for information about various
hosts and domains or to print a list of hosts in a domain.
Non-interactive mode prints just the name and requested
@@ -64,16 +56,16 @@ seconds, type:
nslookup -query=hinfo -timeout=10
The ``-version`` option causes ``nslookup`` to print the version number
The ``-version`` option causes :program:`nslookup` to print the version number
and immediately exit.
Interactive Commands
~~~~~~~~~~~~~~~~~~~~
``host [server]``
This command looks up information for ``host`` using the current default server or
using ``server``, if specified. If ``host`` is an Internet address and the
query type is A or PTR, the name of the host is returned. If ``host`` is
This command looks up information for :iscman:`host` using the current default server or
using ``server``, if specified. If :iscman:`host` is an Internet address and the
query type is A or PTR, the name of the host is returned. If :iscman:`host` is
a name and does not have a trailing period (``.``), the search list is used
to qualify the name.
@@ -191,19 +183,19 @@ Interactive Commands
Return Values
~~~~~~~~~~~~~
``nslookup`` returns with an exit status of 1 if any query failed, and 0
:program:`nslookup` returns with an exit status of 1 if any query failed, and 0
otherwise.
IDN Support
~~~~~~~~~~~
If ``nslookup`` has been built with IDN (internationalized domain name)
support, it can accept and display non-ASCII domain names. ``nslookup``
If :program:`nslookup` has been built with IDN (internationalized domain name)
support, it can accept and display non-ASCII domain names. :program:`nslookup`
appropriately converts character encoding of a domain name before sending
a request to a DNS server or displaying a reply from the server.
To turn off IDN support, define the ``IDN_DISABLE``
environment variable. IDN support is disabled if the variable is set
when ``nslookup`` runs, or when the standard output is not a tty.
when :program:`nslookup` runs, or when the standard output is not a tty.
Files
~~~~~
@@ -213,4 +205,4 @@ Files
See Also
~~~~~~~~
:manpage:`dig(1)`, :manpage:`host(1)`, :manpage:`named(8)`.
:iscman:`dig(1) <dig>`, :iscman:`host(1) <host>`, :iscman:`named(8) <named>`.

View File

@@ -1,6 +1,8 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\dig\dig.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\dig.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,142 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F938F9B8-D395-4A40-BEC7-0122D289C692}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>dig</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\include;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@IDN_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@dighost.lib;libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;@IDN_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\include;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@IDN_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@dighost.lib;libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;@IDN_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\include\dig\dig.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\dig.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\irs\win32\libirs.vcxproj">
<Project>{A4F29CEB-7644-4A7F-BE9E-02B6A90E4919}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\bind9\win32\libbind9.vcxproj">
<Project>{E741C10B-B075-4206-9596-46765B665E03}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\dig\win32\dighost.vcxproj">
<Project>{140DE800-E552-43CC-B0C7-A33A92E368CA}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\dighost.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,132 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{140DE800-E552-43CC-B0C7-A33A92E368CA}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>dighost</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>.\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@IDN_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\irs\include;..\..\..\lib\irs\win32\include;..\..\..\lib\bind9\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@IDN_INC@..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\irs\include;..\..\..\lib\irs\win32\include;..\..\..\lib\bind9\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\dighost.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\irs\win32\libirs.vcxproj">
<Project>{A4F29CEB-7644-4A7F-BE9E-02B6A90E4919}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\bind9\win32\libbind9.vcxproj">
<Project>{E741C10B-B075-4206-9596-46765B665E03}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\host.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,139 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BA1048A8-6961-4A20-BE12-08BE20611C9D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>host</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\include;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@IDN_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@dighost.lib;@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\include;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@IDN_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@dighost.lib;@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\host.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\irs\win32\libirs.vcxproj">
<Project>{A4F29CEB-7644-4A7F-BE9E-02B6A90E4919}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\bind9\win32\libbind9.vcxproj">
<Project>{E741C10B-B075-4206-9596-46765B665E03}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\dig\win32\dighost.vcxproj">
<Project>{140DE800-E552-43CC-B0C7-A33A92E368CA}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\dighost.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\nslookup.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -1,140 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="@TOOLS_VERSION@" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C15A6E1A-94CE-4686-99F9-6BC5FD623EB5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>nslookup</RootNamespace>
@WINDOWS_TARGET_PLATFORM_VERSION@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@PLATFORM_TOOLSET@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<IntDirSharingDetected>None</IntDirSharingDetected>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;USE_READLINE_STATIC;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\include;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@READLINE_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\irs\include;..\..\..\lib\irs\win32\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@@READLINE_LIBD@@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level1</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;USE_READLINE_STATIC;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>.\;..\include;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@@READLINE_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\isccfg\include;..\..\..\lib\irs\include;..\..\..\lib\irs\win32\include;..\..\..\lib\dns\include;..\..\..\lib\bind9\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIBCRYPTO@@OPENSSL_LIBSSL@@READLINE_LIB@@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\dighost.c" />
<ClCompile Include="..\nslookup.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\lib\isc\win32\libisc.vcxproj">
<Project>{3840E563-D180-4761-AA9C-E6155F02EAFF}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\dns\win32\libdns.vcxproj">
<Project>{5FEBFD4E-CCB0-48B9-B733-E15EEB85C16A}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\isccfg\win32\libisccfg.vcxproj">
<Project>{B2DFA58C-6347-478E-81E8-01E06999D4F1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\irs\win32\libirs.vcxproj">
<Project>{A4F29CEB-7644-4A7F-BE9E-02B6A90E4919}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\lib\bind9\win32\libbind9.vcxproj">
<Project>{E741C10B-B075-4206-9596-46765B665E03}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\bin\dig\win32\dighost.vcxproj">
<Project>{140DE800-E552-43CC-B0C7-A33A92E368CA}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

Some files were not shown because too many files have changed in this diff Show More