Compare commits

..
Author SHA1 Message Date
Michal Nowak 99783f9a5e Update BIND version for release 2023-02-03 12:19:48 +01:00
Michal Nowak 5274f62e2a Add a CHANGES marker 2023-02-03 12:19:22 +01:00
Michal Nowak ad861b90ee Merge branch 'michal/prepare-documentation-for-bind-9.18.12' into 'v9_18_12-release'
Prepare documentation for BIND 9.18.12

See merge request isc-private/bind9!496
2023-02-03 11:17:14 +00:00
Michał Kępień 6b77e577d4 Add release note for GL #3827 2023-02-03 10:00:20 +01:00
Michał Kępień 2e1fcbd1b9 Tweak and reword release notes 2023-02-03 10:00:20 +01:00
Michał Kępień 2b9fbddf91 Prepare release notes for BIND 9.18.12 2023-02-03 10:00:20 +01:00
Tom KrizekandMichał Kępień c8b4ca8e3a Update docs to reflect 9.18 has become ESV 2023-02-03 10:00:20 +01:00
Michał Kępień 60124f85bd Merge branch '3781-deprecate-source-port-v9_18' into 'v9_18'
[9.18] mark "port" as deprecated for source address options

See merge request isc-projects/bind9!7478
2023-02-02 11:58:57 +00:00
Evan HuntandMichał Kępień 4cb762a10d CHANGES and release note for [GL #3781]
(cherry picked from commit 22d1951aa6)
2023-02-02 12:21:08 +01:00
Matthijs MekkingandMichał Kępień 64f5e83ef4 Test deprecate source port configuration
Add 'port' token to deprecated.conf. Also add options
'use-v4-udp-ports', 'use-v6-udp-ports', 'avoid-v4-udp-ports',
and 'avoid-v6-udp-ports'.

All of these should trigger warnings (except when deprecation warnings
are being ignored).

(cherry picked from commit 531914e660)
2023-02-02 12:21:08 +01:00
Evan HuntandMichał Kępień 5fa4aa2fec mark "port" as deprecated for source address options
Deprecate the use of "port" when configuring query-source(-v6),
transfer-source(-v6), notify-source(-v6), parental-source(-v6),
etc. Also deprecate use-{v4,v6}-udp-ports and avoid-{v4,v6}udp-ports.

(cherry picked from commit 470ccbc8ed)
2023-02-02 12:21:08 +01:00
Michał Kępień 5a14d4b015 Merge branch '3827-fix-dnsrps-builds-v9_18' into 'v9_18'
[9.18] Fix DNSRPS builds

See merge request isc-projects/bind9!7474
2023-02-01 10:54:46 +00:00
Michał Kępień 19bac062ad Add CHANGES entry for GL #3827
(cherry picked from commit 493eadd1ae)
2023-02-01 11:26:31 +01:00
Michał Kępień 41743a3061 Handle iterator options in rpsdb_allrdatasets()
Commit 6f998bbe51 added a new parameter,
'options', to the prototype of the 'allrdatasets' function pointer in
struct dns_dbmethods.  Handle this new parameter accordingly in
rpsdb_allrdatasets().

(cherry picked from commit f3def4e4ed)
2023-02-01 11:26:31 +01:00
Michał Kępień ef97bf534d Add DNSRPS builds to pairwise testing
The --enable-dnsrps-dl switch for ./configure enables preparing a
DNSRPS-enabled build of BIND 9 that is not directly linked against a
DNSRPS provider library (dlopen() at runtime is used instead).  Employ
this switch to test DNSRPS-enabled builds in the pairwise testing job in
GitLab CI.

(cherry picked from commit e688ca5316)
2023-02-01 11:26:31 +01:00
Mark Andrews feb6f768de Merge branch '3828-fuzz-dns_message_checksig-c-fails-to-call-dst_lib_destroy-v9_18' into 'v9_18'
[9.18] Call dst_lib_destroy if we have called dst_lib_init

See merge request isc-projects/bind9!7460
2023-01-31 22:15:26 +00:00
Mark Andrews 4666c2b0b2 Add CHANGES for [GL #3828]
(cherry picked from commit 13e0dfbae2)
2023-02-01 01:37:04 +11:00
Mark Andrews 0e89e18c4f Call dst_lib_destroy if we have called dst_lib_init
This returns BIGNUMs to OpenSSL allowing libcrypto to fully clean up.

(cherry picked from commit 897e0cd6f4)
2023-02-01 01:37:04 +11:00
Mark Andrews f56de96934 Merge branch '3830-nsupdate-failed-to-handle-primary-server-address-lookup-gracefully-v9_18' into 'v9_18'
[9.18] Handle address lookup failure more gracefully

See merge request isc-projects/bind9!7458
2023-01-31 14:34:26 +00:00
Mark Andrews 819ee39129 Add CHANGES for [GL #3830]
(cherry picked from commit fda7858e74)
2023-02-01 00:36:42 +11:00
Mark Andrews e0090d4639 Handle address lookup failure more gracefully
If the address lookup of the primary server fails just abort
the current update request rather than calling exit.  This allows
nsupdate to cleanup gracefully.

(cherry picked from commit f1387514c6)
2023-02-01 00:36:42 +11:00
Mark Andrews 5e6093210a Merge branch '3829-named-v-leaks-memory-when-shutting-down-v9_18' into 'v9_18'
[9.18] Call dns_lib_destroy in bin/named/main.c:printversion

See merge request isc-projects/bind9!7454
2023-01-30 23:32:47 +00:00
Mark Andrews caaf6a7594 Add CHANGES for [GL #3829]
(cherry picked from commit 1d258e2fb8)
2023-01-31 10:06:02 +11:00
Mark Andrews 4263afa31d Call dns_lib_destroy in bin/named/main.c:printversion
There were unbalanced calls to dns_lib_init and dns_lib_destroy
leading to an OpenSSL memory leak.

(cherry picked from commit 8b3c018f54)
2023-01-31 10:06:02 +11:00
Ondřej Surý 198615faad Merge branch '3806-give-ADB-heap-memory-context-a-name-v9_18' into 'v9_18'
[9.18] Properly name ADB hashmap memory context

See merge request isc-projects/bind9!7448
2023-01-30 11:57:38 +00:00
Ondřej Surý a25e41da02 Properly name ADB hashmap and named log memory contexts
The ADB hashmaps are stored in extra memory contexts, so the hash
tables are excluded from the overmem accounting.  The new memory
context was unnamed, give it a proper name.

Same thing has happened with extra memory context used for named
global log context - give the extra memory context a proper name.

(cherry picked from commit 3cda9f9f14)
2023-01-30 12:38:13 +01:00
Matthijs Mekking dcaf8d99c3 Merge branch '3822-rndc-dnssec-checkds-force-ds-state-v9_18' into 'v9_18'
[9.18] Force set DS state after 'rndc dnssec -checkds'

See merge request isc-projects/bind9!7437
2023-01-30 10:48:21 +00:00
Matthijs Mekking 7b69792cf7 Add CHANGES for #3822
(cherry picked from commit 38ffe5acf3)
2023-01-30 09:27:38 +01:00
Matthijs Mekking 68f0fc6309 Force set DS state after 'rndc dnssec -checkds'
Set the DS state after issuing 'rndc dnssec -checkds'. If the DS
was published, it should go in RUMOURED state, regardless whether it
is already safe to do so according to the state machine.

Leaving it in HIDDEN (or if it was magically already in OMNIPRESENT or
UNRETENTIVE) would allow for easy shoot in the foot situations.

Similar, if the DS was withdrawn, the state should be set to
UNRETENTIVE. Leaving it in OMNIPRESENT (or RUMOURED/HIDDEN)
would also allow for easy shoot in the foot situations.

(cherry picked from commit ee42f66fbe)
2023-01-30 09:27:38 +01:00
Mark Andrews 699d185176 Merge branch '3824-teach-danger-about-amend-v9_18' into 'v9_18'
[9.18] Teach danger about amend

See merge request isc-projects/bind9!7439
2023-01-27 22:58:03 +00:00
Mark Andrews 8a6b78f810 Teach danger about amend
commit --fixup=amend:<hash> produces a subject starting with amend!
by default.  Have danger look for this to ensure that it is squashed
before merging.

(cherry picked from commit 9b12473292)
2023-01-28 09:18:20 +11:00
Tom Krizek c8232051a6 Merge branch 'tkrizek/danger-improvements-v9_18' into 'v9_18'
[9.18] danger: refine existing rules

See merge request isc-projects/bind9!7435
2023-01-27 13:51:23 +00:00
Tom Krizek 11f07ca582 danger: relax rules for single-line commits
The following are not also accepted as single-line commits without
generating warnings:
- CHANGES/release note may appear in the beginning of the commit message
- Release note may be capitalized
- Allow commits with "GL #" (e.g. Update documentation for [GL #XXXX])

(cherry picked from commit 79ae467973)
2023-01-27 14:49:29 +01:00
Tom Krizek bc1bc38731 danger: update CHANGES rule to work with -S edition
When updating the -S edition, the CHANGES.SE file is modified. Make sure
danger accepts that.

(cherry picked from commit 1939e585c0)
2023-01-27 14:49:25 +01:00
Michał Kępień e819d4f966 Merge branch 'michal/extend-artifact-lifetime-for-release-related-jobs-v9_18' into 'v9_18'
[9.18] Extend artifact lifetime for release-related jobs

See merge request isc-projects/bind9!7433
2023-01-27 12:31:33 +00:00
Michał Kępień f99dd245fa Extend artifact lifetime for release-related jobs
Artifacts of the "stress" jobs in GitLab CI are used for generating the
QA summary for a given set of releases.  It happened in the past that
these artifacts were purged before the QA summary was prepared,
unnecessarily prolonging the release process.  A complete set of
artifacts from all such jobs for a single pipeline should be less than 1
GB in size, so extend their lifetime from one day to one week as a more
reasonable compromise between availability and disk space usage.  (Note:
these jobs are also run in scheduled pipelines, but that is expected to
be acceptable in the context of artifact lifetime.)

Artifacts of the "release" jobs in GitLab CI are what we eventually
publish on the FTP server.  It happened in the past that these artifacts
were purged before we copied them to their destination, unnecessarily
prolonging the release process, even though we usually press the "Keep"
button for the "release" jobs manually to keep them around indefinitely
(as they are the source of what we publish in other places).  Since
there is only one "release" job per tag pipeline and its artifacts only
take up tens of megabytes of space, keep the artifacts of the "release"
jobs around indefinitely by default.

(cherry picked from commit 71c9d69145)
2023-01-27 13:29:18 +01:00
Michał Kępień 8b4dcc27ef Merge tag 'v9_18_11' into v9_18
BIND 9.18.11
2023-01-25 21:26:22 +01:00
Artem Boldariev 245e4fd441 Merge branch 'artem-cookie-use-reuseport-socket-option-in-python-mock-server-v9-18' into 'v9_18'
[9.18] Use SO_REUSEADDR for "ans9" mock server in "cookie" system test

See merge request isc-projects/bind9!7421
2023-01-24 17:55:02 +00:00
Artem Boldariev f408cacd86 Use SO_REUSEADDR for "ans9" mock server in "cookie" system test
This commit ensures that it is possible to run the 'cookie' test
multiple times in a row.

(cherry picked from commit 8fdf7bad76)
2023-01-24 16:05:46 +02:00
Artem Boldariev b8c0b64995 Merge branch 'artem-fix-building-on-dragonflybsd-v9-18' into 'v9_18'
[9.18]Fix building BIND on DragonFly BSD

See merge request isc-projects/bind9!7416
2023-01-19 23:43:36 +00:00
Artem Boldariev cb9f8c08d5 Fix building BIND on DragonFly BSD (on both older an newer versions)
This commit ensures that BIND and supplementary tools still can be
built on newer versions of DragonFly BSD. It used to be the case, but
somewhere between versions 6.2 and 6.4 the OS developers rearranged
headers and moved some function definitions around.

Before that the fact that it worked was more like a coincidence, this
time we, at least, looked at the related man pages included with the
OS.

No in depth testing has been done on this OS as we do not really
support this platform - so it is more like a goodwill act. We can,
however, use this platform for testing purposes, too. Also, we know
that the OS users do use BIND, as it is included in its ports
directory.

Building with './configure' and './configure --without-jemalloc' have
been fixed and are known to work at the time the commit is made.

(cherry picked from commit 942569a1bb)
2023-01-20 00:56:16 +02:00
Matthijs Mekking d47890f3c8 Merge branch '3783-parental-ds-requests-need-rd-bit-set-v9_18' into 'v9_18'
[9.18] Set RD=1 on DS requests to parental-agents

See merge request isc-projects/bind9!7411
2023-01-19 15:57:35 +00:00
Matthijs Mekking 8ab8918c64 Add CHANGES and release note for GL #3783
News worthy.

(cherry picked from commit dbbacd910f)
2023-01-19 16:56:39 +01:00
Matthijs Mekking 89089817d3 Set RD bit on checkds requests
It is allowed to point parental-agents to a resolver. Therefore, the
RD bit should be set on requests.

Upon receiving a DS response, ensure that the message has either the
AA or the RA bit set.

(cherry picked from commit e34722ed43)
2023-01-19 16:56:22 +01:00
Matthijs Mekking 7ce0f7fb9e Add checkds test case with resolver parental-agent
Add a test case for a server that uses a resolver as an parental-agent.

We need two root servers, ns1 and ns10, one that delegates to the
'checkds' tld with the DS published (ns2), and one that delegates to
the 'checkds' tld with the DS removed (ns5). Both root zones are
being setup in the 'ns1/setup.sh' script.

We also need two resolvers, ns3 and ns8, that use different root hints
(one uses ns1 address as a hint, the other uses ns10).

Then add the checks to test_checkds.py is similar to the existing tests.

Update 'types' because for zones that have the DS withdrawn (or to be
withdrawn), the CDS and CDNSKEY records should not be published and
thus should not be in the NSEC bitmap.

(cherry picked from commit 0b9a9f9955)
2023-01-19 16:56:22 +01:00
Mark Andrews 5e8be202e9 Merge branch '3799-tsan-race-between-dns_rbtnode_t-bitfields-v9_18' into 'v9_18'
[9.18] Add missing node lock when setting node->wild in rbtdb.c

See merge request isc-projects/bind9!7414
2023-01-19 14:24:37 +00:00
Mark Andrews ee5da17e13 Add CHANGES for [GL #3799]
(cherry picked from commit 5c471c5d2c)
2023-01-20 00:47:51 +11:00
Mark Andrews 4508b0a1e2 Add missing node lock when setting node->wild in rbtdb.c
The write node lock needs to be held when setting node->wild in
add_wildcard_magic except when being called from loading_addrdataset
which is used to load the zone without locking during its initial
load.

(cherry picked from commit 81c24b8da2)
2023-01-20 00:46:24 +11:00
Arаm Sаrgsyаn feed44fd51 Merge branch '3808-refactor-isc_nm_xfr_allowed-v9_18' into 'v9_18'
[9.18] Refactor isc_nm_xfr_allowed()

See merge request isc-projects/bind9!7413
2023-01-19 13:37:24 +00:00
Aram Sargsyan 969811fc77 Add a CHANGES note for [GL #3808]
(cherry picked from commit 5a1707aa8d)
2023-01-19 12:20:10 +00:00
Aram Sargsyan 8f209c7dcf Refactor isc_nm_xfr_allowed()
Return 'isc_result_t' type value instead of 'bool' to indicate
the actual failure. Rename the function to something not suggesting
a boolean type result. Make changes in the places where the API
function is being used to check for the result code instead of
a boolean value.

(cherry picked from commit 41dc48bfd7)
2023-01-19 12:20:10 +00:00
Ondřej Surý 1f6d54d1fb Merge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach-lock-order-inversion-v9_18' into 'v9_18'
[9.18] Detach the zone views outside of the zone lock

See merge request isc-projects/bind9!7408
2023-01-19 10:00:49 +00:00
Ondřej Surý 3d3c8a935a Detach the zone views outside of the zone lock
Detaching the views in the zone_shutdown() could lead to
lock-order-inversion between adb->namelocks[bucket], adb->lock,
view->lock and zone->lock.  Detach the views outside of the section that
zone-locked.

(cherry picked from commit 978a0ef84c)
2023-01-19 10:21:19 +01:00
Ondřej Surý 579f3b66f1 Merge branch 'ondrej/replace-lgtm-with-codeql-add-python-ply-v9_18' into 'v9_18'
[9.18] Add python3-ply for ./configure to succeed on BIND 9.16 branch

See merge request isc-projects/bind9!7406
2023-01-19 09:16:37 +00:00
Ondřej Surý a393573300 Add python3-ply to GitHub CodeQL configuration
BIND 9.16 needs Python and PLY packages for configure to succeed.
Unless we want to tweak the build script to exclude python, we need to
add python3-ply package to the CodeQL configuration.

(cherry picked from commit 0622d11366)
2023-01-19 10:12:04 +01:00
Ondřej Surý ba1460407d Merge branch 'ondrej/replace-lgtm-with-codeql-v9_18' into 'v9_18'
[9.18] Add CodeQL GitHub Action

See merge request isc-projects/bind9!7403
2023-01-19 08:46:43 +00:00
Ondřej Surý fd8fe4ba4e Add CodeQL GitHub Action
Replace the decommissioned LGTM service with CodeQL GitHub action.

(cherry picked from commit 77abe612a1)
2023-01-19 08:46:36 +00:00
Ondřej Surý adfa48ed39 Merge branch '3795-speed-up-EVP_DigestInit_ex-v9_18' into 'v9_18'
[9.18] Avoid implicit algorithm fetch for OpenSSL EVP_MD family

See merge request isc-projects/bind9!7398
2023-01-18 23:33:53 +00:00
Ondřej Surý 9679417cfa Add CHANGES and release note for [GL #3795]
(cherry picked from commit 401294cf60)
2023-01-19 00:33:37 +01:00
Ondřej Surý bf1a29e9e1 Use OpenSSL 1.x SHA_CTX API in isc_iterated_hash()
If the OpenSSL SHA1_{Init,Update,Final} API is still available, use it.
The API has been deprecated in OpenSSL 3.0, but it is significantly
faster than EVP_MD API, so make an exception here and keep using it
until we can't.

(cherry picked from commit 25db8d0103)
2023-01-19 00:33:37 +01:00
Ondřej Surý a1dcbcab8d Use OpenSSL EVP_MD API directly in isc_iterated_hash()
Instead of going through another layer, use OpenSSL EVP_MD API directly
in the isc_iterated_hash() implementation.  This shaves off couple of
microseconds in the microbenchmark.

(cherry picked from commit 36654df732)
2023-01-19 00:32:51 +01:00
Ondřej Surý cb4453faef Merge branch '3252-repair-isc_task_purgeevent-v9_18' into 'v9_18'
[9.18] Keep the list of scheduled events on the timer

See merge request isc-projects/bind9!7396
2023-01-18 23:32:35 +00:00
Ondřej Surý a7e8e43829 Add CHANGES note for [GL #3252]
(cherry picked from commit a7cd0868a2)
2023-01-18 22:39:26 +01:00
Mark AndrewsandOndřej Surý 80a052aaf6 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

(cherry picked from commit 98718b3b4b)
2023-01-18 22:39:26 +01:00
Ondřej Surý e26aa4cbb1 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.

(cherry picked from commit ae01ec2823)
2023-01-18 22:39:26 +01:00
Ondřej Surý 7197cf2b7e 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.

(cherry picked from commit c17eee034b)
2023-01-18 22:06:24 +01:00
Ondřej Surý a7055b01af 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.

(cherry picked from commit 87c4c24cde)
2023-01-18 18:04:41 +01:00
Ondřej Surý 68abe3fa06 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.

(cherry picked from commit 15ea6f002f)
2023-01-18 18:04:41 +01:00
Ondřej Surý 5f141e2c7f 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.

(cherry picked from commit 3f8024b4a2f12fcd28a9dd813b6f1f3f11d506f2)
2023-01-18 18:04:41 +01:00
Ondřej Surý be99507488 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.

(cherry picked from commit 17aed2f895)
2023-01-18 18:04:41 +01:00
Ondřej Surý 29bc0daed1 Merge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach-v9_18' into 'v9_18'
[9.18] Detach the views in zone_shutdown(), not in zone_free()

See merge request isc-projects/bind9!7388
2023-01-17 22:17:29 +00:00
Ondřej Surý b4357fab6f Add CHANGES and release note for [GL #3801]
(cherry picked from commit b049e329ef)
2023-01-17 22:47:44 +01:00
Ondřej Surý fe0e9cf301 Commit the change of view for view->managed_keys
When we change the view in the view->managed_keys, we never commit the
change, keeping the previous view possibly attached forever.

Call the dns_zone_setviewcommit() immediately after changing the view as
we are detaching the previous view anyway and there's no way to recover
from that.

(cherry picked from commit 7e8b53720d)
2023-01-17 22:47:44 +01:00
Ondřej Surý f8b7188a42 Detach the views in zone_shutdown(), not in zone_free()
The .view (and possibly .prev_view) would be kept attached to the
removed zone until the zone is fully removed from the memory in
zone_free().  If this process is delayed because server is busy
something else like doing constant `rndc reconfig`, it could take
seconds to detach the view, possibly keeping multiple dead views in the
memory.  This could quickly lead to a massive memory bloat.

Release the views early in the zone_shutdown() call, and don't wait
until the zone is freed.

(cherry picked from commit 13bb821280)
2023-01-17 22:47:43 +01:00
Artem Boldariev 5d41338e9c Merge branch '3767-dot-no-alpn-transfer-shutdown-crash-v9-18' into 'v9_18'
[9.18](backport )XoT: properly handle the case when checking for ALPN failed

See merge request isc-projects/bind9!7387
2023-01-17 19:53:54 +00:00
Artem Boldariev 26c0dd96eb Modify CHANGES [GL #3767]
Mention that downloading a zone via TLS- from a server which does not
negotiate "dot" ALPN tag could have crashed BIND on shutdown.

(cherry picked from commit 16fa692b56)
2023-01-17 21:29:38 +02:00
Artem Boldariev dbd15f962e XoT: properly handle the case when checking for ALPN failed
During XoT it is important to check for "dot" ALPN tag to be
negotiated (according to the RFC 9103). We were doing that, however, the
situation was not handled properly, leading to non-cancelled zone
transfers that would crash (abort()) BIND on shutdown.

In this particular case 'result' might equal 'ISC_R_SUCCESS'. When
this is the case, the part of the code supposed to handle failures
will not cancel the zone transfer.

This situation cannot happen when BIND is a secondary of other BIND
instance. Only primaries following the RFC not closely enough could
trigger such a behaviour.

(cherry picked from commit 34a1aab1cb)
2023-01-17 21:27:44 +02:00
Tom Krizek ed23fd4b1f Merge branch '3804-fix-feature-detection-in-pytests-v9_18' into 'v9_18'
[9.18] Fix feature detection for pytest markers in tests

See merge request isc-projects/bind9!7385
2023-01-17 14:29:50 +00:00
Tom Krizek 58ff3b4fc0 Fix feature detection for pytest markers in tests
The condition was accidentally reversed during refactoring in
9730ac4c56 . It would result in skipped
tests on builds with proper support and false negatives on builds
without proper feature support.

Credit for reporting the issue and the fix goes to Stanislav Levin.

(cherry picked from commit 473cb530f4)
2023-01-17 14:50:23 +01:00
Ondřej Surý aee89c3454 Merge branch 'cherry-pick-d7bcdf8b' into 'v9_18'
[9.18] Merge branch 'feature/main/zt-rwlock.h' into 'main'

See merge request isc-projects/bind9!7377
2023-01-16 11:09:55 +00:00
Ondřej Surý c5c432a36a Merge branch 'feature/main/zt-rwlock.h' into 'main'
Include isc_rwlocktype_t type definition in zt.h

See merge request isc-projects/bind9!7376

(cherry picked from commit d7bcdf8bd6)

395d6fca Include isc_rwlocktype_t type definition in zt.h
2023-01-16 11:07:19 +00:00
Tom Krizek 0d0c2e466b Merge branch 'tkrizek/system-tests-pytest-prep-v9_18' into 'v9_18'
[9.18] Various tweaks of system test framework

See merge request isc-projects/bind9!7374
2023-01-16 09:42:30 +00:00
Tom Krizek f3c6217046 Update the TEST_PARALLEL_JOBS value in CI
The authoritative source for this value is in the project's CI/CD
Variables Setting. The reason to keep it in .gitlab-ci.yaml as well is
to have functional testing in forks without the need to manually specify
this variable in Settings.

The tests have been executed with 4 jobs for some time now. This
"change" only brings .gitlab-ci.yaml file up to date, it doesn't
actually change the number of jobs we currently use to test.

(cherry picked from commit 03d7b45d81)
2023-01-16 10:13:53 +01:00
Tom Krizek dd5f0d2c4c Tweak dupsigs test output
Use a different visual separator, since "====", "----" and "____" is
used by pytest to separate the log output.

(cherry picked from commit 9593ff9347)
2023-01-16 10:13:53 +01:00
Tom Krizek 8033857295 Look for ifconfig.sh.in in testsock.pl parent dir
Instead of using the current working directory to find the ifconfig.sh
script, look for the ifconfig.sh.in template in the directory where the
testsock.pl script is located. This enables the testsock.pl script to be
called from any working directory.

Using the ifconfig.sh.in template is sufficient, since it contains
the necessary information to be extracted: the max= value (which is
hard-coded in the template).

(cherry picked from commit e24d3b21d0)
2023-01-16 10:13:53 +01:00
Tom Krizek bcf1f5c808 Factor out script to handle system test core dumps
Move the core dump detection functionality for system test runs into a
separate script. This enables reuse by the pytest runner. The
functionality remains the same.

(cherry picked from commit d9a97200d5)
2023-01-16 10:13:53 +01:00
Tom Krizek db03296683 testcrypto.sh: run in TMPDIR if possible
Avoid creating any temporary files in the current workdir.

Additional/changing files in the bin/tests/system directory are
problematic for pytest/xdist collection phase, which assumes the list of
files doesn't change between the collection phase of the main pytest
thread and the subsequent collection phase of the xdist worker threads.

Since the testcrypto.sh is also called during pytest initialization
through conf.sh.common (to detect feature support), this could
occasionally cause a race condition when the list of files would be
different for the main pytest thread and the xdist worker.

(cherry picked from commit 61330a7863)
2023-01-16 10:13:51 +01:00
Michał Kępień 8b06de031e Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.18.12' into 'v9_18'
Set up version and release notes for BIND 9.18.12

See merge request isc-projects/bind9!7363
2023-01-13 14:47:07 +00:00
Michał Kępień b6d271a1af Set up release notes for BIND 9.18.12 2023-01-13 15:40:27 +01:00
Michał Kępień 6d89ad302b Update BIND version to 9.18.12-dev 2023-01-13 15:40:27 +01:00
Michał Kępień 1f554acee8 Update BIND version for release 2023-01-12 23:20:04 +01:00
Michał Kępień 703fefc88c Add a CHANGES marker 2023-01-12 23:20:04 +01:00
Michał Kępień 6515e69b9b Merge branch 'michal/prepare-documentation-for-bind-9.18.11' into 'security-v9_18'
Prepare documentation for BIND 9.18.11

See merge request isc-private/bind9!493
2023-01-12 22:18:44 +00:00
Michał Kępień 3b4a34ccb9 Remove reused CHANGES entry
Changes entry 6063 was added to the v9_18 branch (by commit
cb3990001f) without an associated
placeholder in the main branch.  The same entry number was subsequently
reused for a different change in the main branch (by commit
41870dccba).  To prevent confusion, remove
the entry from the v9_18 branch as the original code change whose
reversal is mentioned in entry 6063 was not accompanied by its own
CHANGES entry.
2023-01-12 22:11:14 +01:00
Michał Kępień c901270670 Add release note for GL #3678 2023-01-12 22:11:14 +01:00
Michał Kępień 3fcc021294 Reorder release notes 2023-01-12 22:11:14 +01:00
Michał Kępień 828d5d51d0 Tweak and reword release notes 2023-01-12 22:11:14 +01:00
Michał Kępień 166523fd61 Prepare release notes for BIND 9.18.11 2023-01-12 22:11:14 +01:00
Michał Kępień 1bec7e09a3 Update documentation for GL #3212 2023-01-12 22:11:14 +01:00
Michał Kępień 04b41cd54e Fix a typo in the DNSSEC Guide 2023-01-12 22:11:14 +01:00
Michał Kępień b04ab0648a Merge branch '3619-security-serve-stale-client-timeout-crash-v9_18' into 'security-v9_18'
[9.18] [CVE-2022-3924] Fix the serve-stale crash when recursive clients soft quota is reached

See merge request isc-private/bind9!478
2023-01-12 11:56:39 +00:00
Aram SargsyanandMichał Kępień 601066e854 Add CHANGES and release notes for [GL #3619]
(cherry picked from commit d08a478b42)
2023-01-12 12:54:02 +01:00
Aram SargsyanandMichał Kępień a4fc5e5158 Cancel all fetch events in dns_resolver_cancelfetch()
Although 'dns_fetch_t' fetch can have two associated events, one for
each of 'DNS_EVENT_FETCHDONE' and 'DNS_EVENT_TRYSTALE' types, the
dns_resolver_cancelfetch() function is designed in a way that it
expects only one existing event, which it must cancel, and when it
happens so that 'stale-answer-client-timeout' is enabled and there
are two events, only one of them is canceled, and it results in an
assertion in dns_resolver_destroyfetch(), when it finds a dangling
event.

Change the logic of dns_resolver_cancelfetch() function so that it
cancels both the events (if they exist), and in the right order.

(cherry picked from commit ec2098ca35)
2023-01-12 12:54:02 +01:00
Michał Kępień 72db6402f3 Merge branch '3622-serve-stale-rrsig-fix-security-v9_18' into 'security-v9_18'
[9.18] [CVE-2022-3736] Properly handle stale RRSIG lookups

See merge request isc-private/bind9!485
2023-01-12 11:31:41 +00:00
Mark AndrewsandMichał Kępień 645dd3fdf1 Add release note for [GL #3622]
(cherry picked from commit 42c42be9a9)
2023-01-12 12:27:28 +01:00
Mark AndrewsandMichał Kępień a4b760d8f6 Add CHANGES note for [GL #3622]
(cherry picked from commit 8ca018b5ec)
2023-01-12 12:27:28 +01:00
Mark AndrewsandMichał Kępień 38323f3b9f Move the mapping of SIG and RRSIG to ANY
dns_db_findext() asserts if RRSIG is passed to it and
query_lookup_stale() failed to map RRSIG to ANY to prevent this.  To
avoid cases like this in the future, move the mapping of SIG and RRSIG
to ANY for qctx->type to qctx_init().

(cherry picked from commit 56eae06418)
2023-01-12 12:27:28 +01:00
Michał Kępień 35c40a8053 Merge branch '3523-confidential-update-quota-v9_18' into 'security-v9_18'
[9.18] [CVE-2022-3094] apply quotas to updates

See merge request isc-private/bind9!490
2023-01-12 11:08:07 +00:00
Evan HuntandMichał Kępień 5a7d1d2d0c CHANGES and release notes for [GL #3523]
(cherry picked from commit 991de0aa76)
2023-01-12 12:02:35 +01:00
Evan HuntandMichał Kępień 24a684db94 test failure conditions
verify that updates are refused when the client is disallowed by
allow-query, and update forwarding is refused when the client is
is disallowed by update-forwarding.

verify that "too many DNS UPDATEs" appears in the log file when too
many simultaneous updates are processing.

(cherry picked from commit b91339b80e)
2023-01-12 12:02:35 +01:00
Evan HuntandMichał Kępień 65d70ebd20 move update ACL and update-policy checks before quota
check allow-update, update-policy, and allow-update-forwarding before
consuming quota slots, so that unauthorized clients can't fill the
quota.

(this moves the access check before the prerequisite check, which
violates the precise wording of RFC 2136. however, RFC co-author Paul
Vixie has stated that the RFC is mistaken on this point; it should have
said that access checking must happen *no later than* the completion of
prerequisite checks, not that it must happen exactly then.)

(cherry picked from commit 964f559edb)
2023-01-12 12:02:35 +01:00
Evan HuntandMichał Kępień 3d2033bb89 add a configuration option for the update quota
add an "update-quota" option to configure the update quota.

(cherry picked from commit f57758a730)
2023-01-12 12:02:35 +01:00
Evan HuntandMichał Kępień 9f1ebd25f6 add an update quota
limit the number of simultaneous DNS UPDATE events that can be
processed by adding a quota for update and update forwarding.
this quota currently, arbitrarily, defaults to 100.

also add a statistics counter to record when the update quota
has been exceeded.

(cherry picked from commit 7c47254a14)
2023-01-12 12:02:35 +01:00
Ondřej Surý dec1bf29fd Merge branch '3212-implement-incremental-rehashing-for-isc_ht-hashtables-v9_18' into 'v9_18'
[9.18] Implement incremental hash table resizing in isc_ht

See merge request isc-projects/bind9!7355
2023-01-11 17:01:00 +00:00
Ondřej Surý 68c094c59a Add CHANGES note for [GL #3212]
(cherry picked from commit 5ccb28d6d8)
2023-01-11 17:16:35 +01:00
Ondřej Surý 8c31a939c9 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.

(cherry picked from commit e42cb1f198)
2023-01-11 17:15:33 +01:00
Arаm Sаrgsyаn c120cc40f5 Merge branch 'aram/dns_fwdtable_addfwd-cleanup-bugfix-v9_18' into 'v9_18'
[9.18] Fix dns_fwdtable_addfwd() error path cleanup bug

See merge request isc-projects/bind9!7354
2023-01-11 14:25:44 +00:00
Aram Sargsyan 39cc597022 Use sizeof(*ptr) for allocating/freeing memory in forward.c
As shown in the previous commit, using sizeof(type_t) is a little
bit more error-prone when copy-pasting code, so extracting the
size information from the pointer which is being dealt with seems
like a better alternative.

(cherry picked from commit cf4003fa58)
2023-01-11 13:42:09 +00:00
Aram Sargsyan 64c8e63942 Fix dns_fwdtable_addfwd() error path cleanup bug
Free 'sizeof(dns_forwarder_t)' bytes of memory instead of
'sizeof(dns_sockaddr_t)' bytes, because `fwd` is a pointer
to a 'dns_forwarder_t' type structure.

(cherry picked from commit 0cc1b06d98)
2023-01-11 13:42:09 +00:00
Arаm Sаrgsyаn 6d3c38e381 Merge branch '3768-dns_zonemgr-use-after-free-v9_18' into 'v9_18'
[9.18] Fix a use-after-free bug in dns_zonemgr_releasezone()

See merge request isc-projects/bind9!7351
2023-01-11 12:53:01 +00:00
Aram Sargsyan 7643e0b60a Add a CHANGES note for [GL #3768]
(cherry picked from commit d50cb1d45d)
2023-01-11 12:16:40 +00:00
Aram Sargsyan 4121af8f7e Fix a use-after-free bug in dns_zonemgr_releasezone()
The dns_zonemgr_releasezone() function makes a decision to destroy
'zmgr' (based on its references count, after decreasing it) inside
a lock, and then destroys the object outside of the lock.

This causes a race with dns_zonemgr_detach(), which could destroy
the object in the meantime.

Change dns_zonemgr_releasezone() to detach from 'zmgr' and destroy
the object (if needed) using dns_zonemgr_detach(), outside of the
lock.

(cherry picked from commit c1fc212253)
2023-01-11 12:16:23 +00:00
Ondřej Surý 4ad0cc8118 Merge branch 'ondrej/use-pthread_barrier-if-available-v9_18' into 'v9_18'
[9.18] Prefer the pthread_barrier implementation over uv_barrier

See merge request isc-projects/bind9!7350
2023-01-11 10:21:46 +00:00
Ondřej Surý 6906b42cdd Prefer the pthread_barrier implementation over uv_barrier
Prefer the pthread_barrier implementation on platforms where it is
available over uv_barrier implementation.  This also solves the problem
with thread sanitizer builds on macOS that doesn't have pthread barrier.

(cherry picked from commit d07c4a98da)
2023-01-11 10:21:39 +00:00
Ondřej Surý fa53e4f87c Merge branch '3772-revert-fix-single-read-tlsdns-client-v9_18' into 'v9_18'
Don't honour single read per client isc_nm_read() call in the TLSDNS

See merge request isc-projects/bind9!7349
2023-01-11 10:20:49 +00:00
Ondřej Surý cb3990001f Add CHANGES and release note for [GL #3772] 2023-01-11 10:42:03 +01:00
Ondřej Surý d0d9e7dfb2 Don't honour single read per client isc_nm_read() call in the TLSDNS
This reverts commit f17f5e831b that made
following change:

> The TLSDNS transport was not honouring the single read callback for
> TLSDNS client.  It would call the read callbacks repeatedly in case the
> single TLS read would result in multiple DNS messages in the decoded
> buffer.

Turns out that this change broke XoT, so we are reverting the change
until we figure out a proper fix that will keep the design promise and
not break XoT at the same time.
2023-01-11 10:17:55 +01:00
Matthijs Mekking 614d5c3334 Merge branch '3743-unexpected-prohibited-ede-v9_18' into 'v9_18'
[9.18] Fix unexpected "Prohibited" extended DNS error on allow-recursion mismatch

See merge request isc-projects/bind9!7324
2023-01-10 10:02:22 +00:00
Matthijs Mekking 29963f4c0e Add system test for #3743
(cherry picked from commit 8db8ec1f6e)
2023-01-10 10:02:14 +00:00
Matthijs Mekking f8b7bb7c9f Add release note and CHANGES for #3743
(cherry picked from commit e43a26fd1e)
2023-01-10 10:02:14 +00:00
Matthijs Mekking f481073110 Don't set EDE in ns_client_aclchecksilent
The ns_client_aclchecksilent is used to check multiple ACLs before
the decision is made that a query is denied. It is also used to
determine if recursion is available. In those cases we should not
set the extended DNS error "Prohibited".

(cherry picked from commit 798c8f57d4)
2023-01-10 10:02:14 +00:00
Mark Andrews 81f8b8fc14 Merge branch '3787-siphash-c-105-26-runtime-error-applying-zero-offset-to-null-pointer-v9_18' into 'v9_18'
[9.18] Accept 'in=NULL' with 'inlen=0' in isc_{half}siphash24

See merge request isc-projects/bind9!7341

Backport of MR !7339
2023-01-10 08:28:15 +00:00
Mark Andrews f99593a9ca Accept 'in=NULL' with 'inlen=0' in isc_{half}siphash24
Arthimetic on NULL pointers is undefined.  Avoid arithmetic operations
when 'in' is NULL and require 'in' to be non-NULL if 'inlen' is not zero.

(cherry picked from commit 349c23dbb7)
2023-01-10 18:36:08 +11:00
Evan Hunt 12de356ed6 Merge branch '3773-remove-dscp-v9_18' into 'v9_18'
[9.18] Merge branch '3773-remove-dscp' into 'main'

See merge request isc-projects/bind9!7336
2023-01-10 00:20:14 +00:00
Evan Hunt 55d728a678 CHANGES and release note for [GL #3773]
(cherry picked from commit 34a7166029)
2023-01-09 14:24:23 -08:00
Evan Hunt 5fd93c66aa remove nonfunctional DSCP implementation
DSCP has not been fully working since the network manager was
introduced in 9.16, and has been completely broken since 9.18.
This seems to have caused very few difficulties for anyone,
so we have now marked it as obsolete and removed the
implementation.

To ensure that old config files don't fail, the code to parse
dscp key-value pairs is still present, but a warning is logged
that the feature is obsolete and should not be used. Nothing is
done with configured values, and there is no longer any
range checking.

(cherry picked from commit 916ea26ead)
2023-01-09 14:23:26 -08:00
Michal Nowak 703c799376 Merge branch 'mnowak/abort-on-ubsan-errors-v9_18' into 'v9_18'
[9.18] Abort on UBSAN errors

See merge request isc-projects/bind9!7327
2023-01-09 17:07:44 +00:00
Michal Nowak addd4141a7 Abort on UBSAN errors
Previously, UBSAN errors might slip undetected.

(cherry picked from commit 1451bb7390)
2023-01-09 17:40:32 +01:00
Matthijs Mekking 815ac08a26 Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_18' into 'v9_18'
[9.18] Resolve "stale-serve and RPZ put in SERVFAIL cache unexpected record"

See merge request isc-projects/bind9!7310
2023-01-09 15:01:49 +00:00
Michał KępieńandMatthijs Mekking 90408617d7 Check for NULL before dereferencing qctx->rpz_st
Commit 9ffb4a7ba1 causes Clang Static
Analyzer to flag a potential NULL dereference in query_nxdomain():

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

The warning above is for qctx->rpz_st potentially being a NULL pointer
when query_nxdomain() is called from query_resume().  This is a false
positive because none of the database lookup result codes currently
causing query_nxdomain() to be called (DNS_R_EMPTYWILD, DNS_R_NXDOMAIN)
can be returned by a database lookup following a recursive resolution
attempt.  Add a NULL check nevertheless in order to future-proof the
code and silence Clang Static Analyzer.

(cherry picked from commit 07592d1315)
(cherry picked from commit a4547a1093)
2023-01-09 14:26:02 +01:00
Aram SargsyanandMatthijs Mekking 096d980a87 Add a CHANGES note for [GL #3678]
(cherry picked from commit 40dee61a1e)
2023-01-09 14:26:02 +01:00
Matthijs Mekking 271bc20b1c Consider non-stale data when in serve-stale mode
With 'stale-answer-enable yes;' and 'stale-answer-client-timeout off;',
consider the following situation:

A CNAME record and its target record are in the cache, then the CNAME
record expires, but the target record is still valid.

When a new query for the CNAME record arrives, and the query fails,
the stale record is used, and then the query "restarts" to follow
the CNAME target. The problem is that the query's multiple stale
options (like DNS_DBFIND_STALEOK) are not reset, so 'query_lookup()'
treats the restarted query as a lookup following a failed lookup,
and returns a SERVFAIL answer when there is no stale data found in the
cache, even if there is valid non-stale data there available.

With this change, query_lookup() now considers non-stale data in the
cache in the first place, and returns it if it is available.

(cherry picked from commit 91a1a8efc5)
2023-01-09 14:26:02 +01:00
Aram SargsyanandMatthijs Mekking d54e7052ab Add serve-stale CNAME check with stale-answer-client-timeout off
Prime the cache with the following records:

    shortttl.cname.example.	1	IN	CNAME	longttl.target.example.
    longttl.target.example.	600	IN	A	10.53.0.2

Wait for the CNAME record to expire, disable the authoritative server,
and query 'shortttl.cname.example' again, expecting a stale answer.

(cherry picked from commit 537187bf2f)
2023-01-09 14:26:02 +01:00
Ondřej Surý bea3d7994a Merge branch '3766-pin-TCP-dispatch-to-threads-v9_18' into 'v9_18'
[9.18] Pin the dns_dispatch to threads when reusing

See merge request isc-projects/bind9!7302
2023-01-05 10:25:32 +00:00
Ondřej Surý 0e263b34c6 Pin the dns_dispatch to threads when reusing
Previously, dns_dispatch_gettcp() could pick a TCP connection created by
different thread - this breaks our contractual promise to DNS dispatch
by using the TCP connection on a different thread than it was created.
Add .tid member to the dns_dispatch_t struct and skip the dispatches
from other threads when looking up a TCP dispatch that we can reuse in
dns_request.

NOTE: This is going to be properly refactored, but this change could be
also backported to 9.18 for better stability and thread-affinity.

(cherry picked from commit 1a999353cd)
2023-01-05 10:20:47 +01:00
Tony Finch 3c411ad294 Merge branch '3745-delzone-catz-v9_18' into 'v9_18'
[9.18] Don't crash when rndc delzone encounters a catz member

See merge request isc-projects/bind9!7297
2023-01-04 18:56:07 +00:00
Tony FinchandTony Finch 03beb6e355 Don't crash when rndc delzone encounters a catz member
This bug was masked in the tests because the `catz` test script did an
`rndc addzone` before an `rndc delzone`. The `addzone` autovivified
the NZF config, so `delzone` worked OK.

This commit swaps the order of two sections of the `catz` test script
so that it uses `delzone` before `addzone`, which provokes a crash
when `delzone` requires a non-NULL NZF config.

To fix the crash, we now try to remove the zone from the NZF config
only if it was dynamically added but not by a catalog zone.

(cherry picked from commit 9fa20d6f6c)
2023-01-04 17:50:44 +00:00
Ondřej Surý f5e7192691 Merge branch '3723-dont-shutdown-invalid-tasks-v9_18' into 'v9_18'
[v9.18] Don't cleanup uninitialized dns_resolver buckets

See merge request isc-projects/bind9!7286
2023-01-03 11:54:21 +00:00
Ondřej Surý d48f5e253f Don't cleanup uninitialized dns_resolver buckets
If the isc_task_create_bound() fails in the middle of buckets
initialization - the most common case would be shutdown initialized
during reload, not all tasks would be initialized, but the cleanup
code would try to cleanup all buckets.

Make sure that we cleanup only the initialized buckets by setting
ntasks to the number of already initialized tasks on the error path.
2023-01-03 10:33:23 +01:00
Michał Kępień 04d4a608b8 Merge branch 'michal/update-copyright-year-to-2023-v9_18' into 'v9_18'
[9.18] Update copyright year to 2023

See merge request isc-projects/bind9!7283
2023-01-02 13:16:50 +00:00
Michał Kępień d72070f30e Update copyright year to 2023
(cherry picked from commit 1a5d707f52)
2023-01-02 14:12:23 +01:00
Arаm Sаrgsyаn a21562c6cf Merge branch 'aram/dns_dispatch_createtcp-bugfix-v9_18' into 'v9_18'
[9.18] Don't pass a NULL pointer to isc_sockaddr_format()

See merge request isc-projects/bind9!7278
2022-12-28 14:54:16 +00:00
Aram Sargsyan 35b5ba2ff4 Don't pass a NULL pointer to isc_sockaddr_format()
The 'localaddr' pointer can be NULL, which causes an assertion failure.

Use '&disp->local' instead when printing a debug log message.

(cherry picked from commit 41ca9d419e)
2022-12-28 14:19:37 +00:00
Tom Krizek 5102e676e7 Merge branch 'tkrizek/gitignore-fixes-v9_18' into 'v9_18'
[9.18] Don't track gitignored files in the repo

See merge request isc-projects/bind9!7274
2022-12-23 14:14:28 +00:00
Michał KępieńandTom Krizek df5c90843b Detect "ignored yet tracked" files in GitLab CI
Ensure that no .gitignore file in the tree contains patterns matching
files tracked by Git by adding a simple script that detects such
situations and running that script as part of the "misc" job in the
"precheck" stage of every GitLab CI pipeline.

(cherry picked from commit 5b28da7ea0)
2022-12-23 14:29:48 +01:00
Tom Krizek ee4a18ee23 Remove obsolete gitignore file in mysqldyn
The Makefile used to be autogenerated prior to
67f76b1269 which is the reason why the
.gitignore existed in the first place. Since then, a static Makefile is
used and is supposed to be tracked in the git repo.

(cherry picked from commit a02da6cf21)
2022-12-23 14:29:47 +01:00
Tom Krizek 6b56dad1cd Make gitignore matching in rpzrecurse more precise
The pre-defined test cases use named.$TESTCASE.conf naming convention,
where TESTCASE is a human readable name contaning actual word(s). The
autogenerated test cases' names always start with a number from 1 to 6.

(cherry picked from commit e03daf22ec)
2022-12-23 14:29:47 +01:00
Tom Krizek b9065fb187 Remove ans.pl system test files from gitignore
The ans*.pl scripts are part of system tests and should be part of the
repository. The gitignore entires for these files have been removed.

(cherry picked from commit b8616e457f)
2022-12-23 14:29:47 +01:00
Tom Krizek bff1f5af2b Rename dig reference files in the rrsetorder test
bin/tests/system/rrsetorder/dig.out* files match a gitignore expression
present in bin/tests/system/.gitignore.  Since these are meant to be
reference files that are compared to the files generated when the
"rrsetorder" system test is run, rename them to avoid listing tracked
files in .gitignore files.

(cherry picked from commit c5708044e7)
2022-12-23 14:29:44 +01:00
Artem Boldariev 5a4b3491f9 Merge branch '3748-rename-tls-caches-creation-functions-v9-18' into 'v9_18'
[9.18] Rename isc_tlsctx_cache_new() to isc_tlsctx_cache_create(), tlsctx_client_session_cache_new() to tlsctx_client_session_create()

See merge request isc-projects/bind9!7272
2022-12-23 12:43:55 +00:00
Artem Boldariev bccbf28249 tlsctx_client_session_cache_new() -> tlsctx_client_session_create()
Additionally to renaming, it changes the function definition so that
it accepts a pointer to pointer instead of returning a pointer to the
new object.

It is mostly done to make it in line with other functions in the
module.

(cherry picked from commit 7962e7f575)
2022-12-23 13:58:14 +02:00
Artem Boldariev b05b05cb48 Rename isc_tlsctx_cache_new() -> isc_tlsctx_cache_create()
Additionally to renaming, it changes the function definition so that
it accepts a pointer to pointer instead of returning a pointer to the
new object.

It is mostly done to make it in line with other functions in the
module.

(cherry picked from commit f102df96b8)
2022-12-23 13:58:14 +02:00
Arаm Sаrgsyаn 3922728175 Merge branch '3752-resolver-adb-quota-bug-v9_18' into 'v9_18'
[9.18] Fix an ADB quota management bug in the resolver

See merge request isc-projects/bind9!7273
2022-12-23 10:44:19 +00:00
Aram Sargsyan 0e849a99cf Add CHANGES and release notes for [GL #3752]
(cherry picked from commit a4def095f3)
2022-12-23 10:08:00 +00:00
Aram Sargsyan 926f0323b6 Fix an ADB quota management error in the resolver
Normally, when a 'resquery_t' object is created in fctx_query(),
we call dns_adb_beginudpfetch() (which increases the ADB quota)
only if it's a UDP query. Then, in fctx_cancelquery(), we call
dns_adb_endudpfetch() to decreases back the ADB quota, again only
if it's a UDP query.

The problem is that a UDP query can become a TCP query, preventing
the quota from adjusting back in fctx_cancelquery() later.

Call dns_adb_beginudpfetch() also when switching the query type
from UDP to TCP.

(cherry picked from commit 53afe1f978)
2022-12-23 10:08:00 +00:00
Aram Sargsyan 650f3098e1 INSIST that active quota is 0 in destroy_adbentry()
This should catch ADB quota management errors in the resolver.

(cherry picked from commit c7ba26c3d6)
2022-12-23 10:08:00 +00:00
Tom Krizek 02f775a447 Merge branch 'tkrizek/dangerfile-backport-tweaks-v9_18' into 'v9_18'
[9.18] danger CI: tweak backport check and add Affects label check

See merge request isc-projects/bind9!7270
2022-12-23 08:57:53 +00:00
Tom Krizek 893d6dc98f danger: check the Affects labels are set
Unless the MR is a backport, the Affects labels should be used to
indicate which versions are affected by the issue that prompted the MR.

(cherry picked from commit 64d71a1f5f)
2022-12-23 09:52:40 +01:00
Tom Krizek 8bc806a9f2 danger: check version in MR title
Enforce the version indicator to be at the start of the MR title.

(cherry picked from commit d1172e011c)
2022-12-23 09:52:32 +01:00
Tom Krizek 2c2148fb23 Merge tag 'v9_18_10' into v9_18
BIND 9.18.10
2022-12-22 10:06:46 +01:00
Arаm Sаrgsyаn fc122887f8 Merge branch '3750-legacy-system-test-dig-timed-out-fix-v9_18' into 'v9_18'
[9.18] Fix DiG "timed out" message check in "legacy" system test

See merge request isc-projects/bind9!7260
2022-12-21 15:09:50 +00:00
Aram Sargsyan 5e57ffbd51 Fix DiG "timed out" message check in "legacy" system test
The test expects a "connection timed out" message from DiG when it
experiences a timeout, while the current version of DiG prints just
a "timed out" message, like below:

    ;; communications error to 10.53.0.1#11314: timed out
    ;; communications error to 10.53.0.1#11314: timed out
    ;; communications error to 10.53.0.1#11314: timed out

    ; <<>> DiG 9.19.9-dev <<>> -p 11314 +tries +time +tcp +tries +time @10.53.0.1 dropedns. TXT
    ; (1 server found)
    ;; global options: +cmd
    ;; no servers could be reached

Change the expected string to match the current DiG output.

Use the '-F' switch for "grep" for matching a fixed string.

(cherry picked from commit 35988748f3)
2022-12-21 14:32:18 +00:00
Tom Krizek e64dbb578b Merge branch 'tkrizek/system-tests-conventions-v9_18' into 'v9_18'
[9.18] Unify system tests naming conventions

See merge request isc-projects/bind9!7257
2022-12-21 13:44:34 +00:00
Tom Krizek 3c29317ad3 Update tests gitignore file
The .mypy_cache was added to the system test dir gitignore, since it
should be ignored.

(cherry picked from commit 4145068bfa)
2022-12-21 14:02:47 +01:00
Tom Krizek 873feb0c53 Rename engine_pkcs11 system test
In order to have a common naming convention for system tests, rename the
only outlier "engine_pkcs11" to "enginepkcs11", which was the only
system test using an underscore in its name.

The only allowed word separators for system test names are either dash
or no separator.

(cherry picked from commit 62eea511db)
2022-12-21 14:02:47 +01:00
Tom Krizek 4652da6caf Use common name convention for pytest files
It is better to use consistent file names to avoid issue with sorting
etc.

Using underscore in filenames as opposed to dash was chosen because it
seems more common in pytest/python to use underscore for filenames.

Also rename the bin/tests/system/timeouts/tests-tcp.py file to
bin/tests/system/timeouts/tests_tcp_timeouts.py to avoid pytest name
collision (there can't be two files named tests_tcp.py).

(cherry picked from commit f6409ee6ac)
2022-12-21 14:02:45 +01:00
Ondřej Surý 6fd6686865 Merge branch '3178-dispatch-race-v9_18' into 'v9_18'
[9.18] Fix the thread safety in the dns_dispatch unit

See merge request isc-projects/bind9!7251
2022-12-21 12:41:22 +00:00
Ondřej Surý 3492dc2f0e Add CHANGES and release note for [GL #3178] and [GL #3636]
(cherry picked from commit 2df311eb21)
2022-12-21 12:41:15 +00:00
Ondřej Surý be3cf85cfe Call the connected dns_dispatch callback asynchronously
The dns_request code is very sensitive about calling the connected and
deadlocks when the timing is "right" in several places.  Move the call
to the connected callback to the (udp|tcp)_connected() functions, so
they are called asynchronously instead of directly from
the (udp|tcp)_dispentry_cancel() functions.

(cherry picked from commit 9dd8deaf01)
2022-12-21 12:41:15 +00:00
Ondřej Surý 87ad3ecaf0 Ignore TCP dispatches that have zero references
The TCP dispatches are removed from the dispatchmgr->list in the
dispatch_destroy() and there's a brief period of time where
dns_dispatch_gettcp() can find a dispatch in connected state that's
being destroyed.

Set the dispatch state to DNS_DISPATCHSTATE_NONE in the TCP connection
callback if there are no responses waiting, and ignore TCP dispatches
with zero references in dns_dispatch_gettcp().

(cherry picked from commit 3fac4ca57e)
2022-12-21 12:41:15 +00:00
Ondřej Surý 3f4970da1a Fix assignment vs comparison typo in tcp_connected()
In tcp_connected() a typo has turned a DbC check into an assignment
breaking the state machine and making the dns_dispatch_gettcp() try to
attach to dispatch in process of destruction.
2022-12-21 12:41:15 +00:00
Ondřej Surý b714033731 Don't remove dispatches in CANCELED state from the list
In dns_dispatch_gettcp(), we can't remove canceled dispatches from the
mgr->list because ISC_LIST_NEXT() would fail in the next iteration.
2022-12-21 12:41:15 +00:00
Ondřej Surý 3edccaf0c7 Ignore TCP dispatches in DNS_DISPATCHSTATE_NONE state
The TCP dispatches in DNS_DISPATCHSTATE_NONE could be either very
fresh or those could be dispatches that failed connecting to the
destination.  Ignore them when trying to connect to an existing
TCP dispatch via dns_dispatch_gettcp().
2022-12-21 12:41:15 +00:00
Ondřej Surý 5cc12ab92c Fix the thread safety in the dns_dispatch unit
The dispatches are not thread-bound, and used freely between various
threads (see the dns_resolver and dns_request units for details).

This refactoring make sure that all non-const dns_dispatch_t and
dns_dispentry_t members are accessed under a lock, and both object now
track their internal state (NONE, CONNECTING, CONNECTED, CANCELED)
instead of guessing the state from the state of various struct members.

During the refactoring, the artificial limit DNS_DISPATCH_SOCKSQUOTA on
UDP sockets per dispatch was removed as the limiting needs to happen and
happens on in dns_resolver and limiting the number of UDP sockets
artificially in dispatch could lead to unpredictable behaviour in case
one dispatch has the limit exhausted by others are idle.

The TCP artificial limit of DNS_DISPATCH_MAXREQUESTS makes even less
sense as the TCP connections are only reused in the dns_request API
that's not a heavy user of the outgoing connections.

As a side note, the fact that UDP and TCP dispatch pretends to be same
thing, but in fact the connected UDP is handled from dns_dispentry_t and
dns_dispatch_t acts as a broker, but connected TCP is handled from
dns_dispatch_t and dns_dispatchmgr_t acts as a broker doesn't really
help the clarity of this unit.

This refactoring kept to API almost same - only dns_dispatch_cancel()
and dns_dispatch_done() were merged into dns_dispatch_done() as we need
to cancel active netmgr handles in any case to not leave dangling
connections around.  The functions handling UDP and TCP have been mostly
split to their matching counterparts and the dns_dispatch_<function>
functions are now thing wrappers that call <udp|tcp>_dispatch_<function>
based on the socket type.

More debugging-level logging was added to the unit to accomodate for
this fact.

(cherry picked from commit 6f317f27ea)
2022-12-21 12:41:15 +00:00
Ondřej Surý 24847cfd3e Backport ISC_REFCOUNT{,_TRACE}_{DECL,IMPL} macros
Backport macros that can be used to implement generic attach, detach,
ref, and unref functions, so they don't have to be repeated over and
over in each unit that uses reference counting.
2022-12-21 12:41:15 +00:00
Tom Krizek 7009aa9044 Merge branch 'tkrizek/default-alg-fixups-v9_18' into 'v9_18'
[9.18] Fix minor issues with DEFAULT_ALGORITHM selection in system tests

See merge request isc-projects/bind9!7255
2022-12-21 11:43:02 +00:00
Tom Krizek 45b003316f Make Python interpreter required for system tests
This introduces a Python dependency for running system tests. It is
needed in order to:
  - write new test control scripts in Python
  - gradually rewrite old Perl scripts into Python if needed
  - eventually introduce pytest as the new test runner framework

This commit is not intended to be backported to 9.16.

(cherry picked from commit 56416ebd65)
2022-12-21 10:49:33 +01:00
Tom Krizek efa09a37f3 Make Perl interpreter required for system tests
This change has no practical impact, as Perl was already required for
all system tests, this check only makes it more explicit.

(cherry picked from commit 084d72d1d5)
2022-12-21 10:49:33 +01:00
Tom Krizek 0079745f97 Ensure test interpreters are defined before common config
Nothing from conf.sh.common is required to set these values. On the
contrary, a Python interpreter needs to be set in order to randomize the
algorithm set (which happens in conf.sh.common).

(cherry picked from commit 492992dca8)
2022-12-21 10:49:33 +01:00
Tom Krizek 54a877ef47 Force quiet mode when using testcrypto.sh directly
When testcrypto.sh is used as a standalone script, always use quiet mode
to avoid using undefined commands (such as echo_i) which require
inclusion of the entire conf.sh machinery.

(cherry picked from commit ba35a6df9c)
2022-12-21 10:42:10 +01:00
Ondřej Surý 3a78f58c55 Merge branch '3739-adb-cleans-overzealously-under-memory-pressure-v9_18' into 'v9_18'
Exclude the ADB hashmaps from ADB overmem accounting [v9.18]

See merge request isc-projects/bind9!7248
2022-12-19 08:58:27 +00:00
Ondřej Surý c3f1a0dfff Add CHANGES and release note for [GL #3739]
(cherry picked from commit 11df7f02fd)
2022-12-19 09:26:59 +01:00
Ondřej Surý 146f93ff46 Don't expire fresh ADB names and entries
The overmem cleaning in ADB could become overzealous and clean fresh ADB
names and entries.  Add a safety check to not clean any ADB names and
entries that are below ADB_CACHE_MINIMUM threshold.

(cherry picked from commit 0b661b6f95)
2022-12-19 09:26:58 +01:00
Ondřej Surý ecde82689e Exclude the ADB hashmaps from ADB overmem accounting
The ADB overmem accounting would include the memory used by hashtables
thus vastly reducing the space that can be used for ADB names and
entries when the hashtables would grow.  Create own memory context for
the ADB names and entries hash tables.

(cherry picked from commit 59dee0b078)
2022-12-16 19:22:43 +01:00
Ondřej Surý 25201365a6 Merge branch '3637-try-next-server-on-resolver-timeout-v9_18' into 'v9_18'
Try next server on resolver timeout [v9.18]

See merge request isc-projects/bind9!7249
2022-12-16 18:22:39 +00:00
Ondřej Surý 6ca03d1012 Add CHANGES and release notes for [GL #3637]
(cherry picked from commit d1f1db2f5a)
2022-12-16 18:38:02 +01:00
Ondřej Surý 2cb6001a2e Add comment why statistics/ns3 has misconfigure root.hints
To count pending queries in the statistics, we need the ns3 to be
misconfigured.  Document the fact in the statistics/ns3/root.hints.

(cherry picked from commit 32c2acf6fc)
2022-12-16 18:37:22 +01:00
Ondřej Surý 9e8c23be7e Revert the statistics system test change after we fixed the resolver
When the resolver was refactored, the statistics system test had to be
adjusted in c6b4d82557.  Unfortunately,
this change had to be done because of an error in the resolver
refactoring where timeout would not retry next server, but keep trying
the same server.  As we have now fixed this bug, revert the change to
the test back to the previous state.

(cherry picked from commit b679640950)
2022-12-16 18:37:22 +01:00
Ondřej Surý 095f634f48 Try next server on resolver timeout
Instead of resending to the same server on the (dispatch) timeout in the
resolver, try the next server.

(cherry picked from commit 5466a48fc9)
2022-12-16 18:37:22 +01:00
Tom Krizek 773517960f Merge branch 'tkrizek/danger-backports-v9_18' into 'v9_18'
Check backport workflow in danger CI [v9_18]

See merge request isc-projects/bind9!7245
2022-12-16 13:39:32 +00:00
Tom Krizek a11bcfa8ba danger: remove obsolete check for cherry pick msg
With proper backport commit detection, this check has been made
redundant.

(cherry picked from commit e8a5ebaee5)
2022-12-16 14:21:10 +01:00
Tom Krizek 90b4441e3e danger: check backport commits for original commit IDs
A full backport must have all the commit from the original MR and the
original commit IDs must be referenced in the backport commit messages.

If the criteria above is not met, the MR should be marked as a partial
backport. In that case, any discrepencies are only logged as informative
messages rather than failures.

(cherry picked from commit c617f97784)
2022-12-16 14:21:10 +01:00
Tom Krizek 8ebfcb6b5a danger: check that original MR has been merged
When checking a backport MR, ensure that the original MR has been merged
already. This is vital for followup checks that verify commit IDs from
original commits are present in backport commit messages.

(cherry picked from commit 89530f1a1c)
2022-12-16 14:21:10 +01:00
Tom Krizek eab1d81072 danger: check backport links to the original MR
When doing archeology, it is much easier to find stuff if it's properly
linked. This check ensures that backport MR are linked to their original
MR via a "Backport of !XXXX" message.

The regular expression is fairly broad and has been tested to accept the
following variants of the message:
Backport of MR !XXXX
Backport of: !XXXX
backport of mr !XXXX
Backport of   !XXXX
Backport of https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/XXXX

(cherry picked from commit 12e0b05738)
2022-12-16 14:21:10 +01:00
Tom Krizek cb6ba18aaa danger: ensure target branch is in the MR title
Having the MR title clearly marked in its title can be very useful when
looking through older issues/MRs.

This check also ensures that the version from the version label matches
the proper version branch (i.e. v9.16 must be marked with [v9_16]).

(cherry picked from commit 14b027cf83)
2022-12-16 14:21:09 +01:00
Tom Krizek 2b5b016f1e danger: support partial backport label
Treat the Backport::Partial label as a backport as well.

(cherry picked from commit 1c0c1ba8b9)
2022-12-16 14:21:07 +01:00
Tony Finch 4d8f551195 Merge branch '3740-rpz-reconfig-v9_18' into 'v9_18'
A couple of RPZ options were not reconfigured as expected

See merge request isc-projects/bind9!7238
2022-12-16 10:15:31 +00:00
Tony FinchandTony Finch 08d0d24d3b A couple of RPZ options were not reconfigured as expected
[bug]	Changes to the RPZ response-policy min-update-interval
	and add-soa options now take effect as expected when
	named is reconfigured. [GL #3740]

(cherry picked from commit d8a3d328db)
2022-12-16 09:53:01 +00:00
Arаm Sаrgsyаn 61c2337a1e Merge branch '3742-catz-update-log-incorrect-soa-serial-representation-v9_18' into 'v9_18'
[v9_18] Fix an incorrect SOA serial representation in catz

See merge request isc-projects/bind9!7236
2022-12-15 14:27:33 +00:00
Aram Sargsyan c833de15c0 Add a CHANGES note for [GL #3742]
(cherry picked from commit ac7149aa88)
2022-12-15 13:32:27 +00:00
Aram Sargsyan 19325a228c Fix logging a uint32_t SOA serial value in dns_catz_update_from_db()
The dns_catz_update_from_db() function prints serial number as a signed
number (with "%d" in the format string), but the `vers` variable's type
is 'uint32_t'. This breaks serials bigger than 2^31.

Use PRIu32 instead of "d" in the format string.

(cherry picked from commit 72b1760ea6)
2022-12-15 13:31:30 +00:00
Aram Sargsyan eae5c06e57 Add big SOA serial logging check into the catz system test
Check that the SOA serial numbers printed when updating a catalog zone
is represented correctly for numbers bigger than 2^31.

(cherry picked from commit de232ab446)
2022-12-15 13:31:04 +00:00
Artem Boldariev de9c75a532 Merge branch '3725-mutual-tls-session-resumption-fix-v9-18' into 'v9_18'
[Backport to 9.18] Fix TLS session resumption via IDs when Mutual TLS is used

See merge request isc-projects/bind9!7234
2022-12-14 17:45:52 +00:00
Artem Boldariev 055974a709 Update Release notes [GL #3725]
Mention that TLS session resumption for Mutual TLS has been fixed.

(cherry picked from commit 67d74e228f)
2022-12-14 18:32:32 +02:00
Artem Boldariev 3ce5d6c119 Update CHANGES [GL #3725]
Mention that TLS session resumption for Mutual TLS has been fixed.

(cherry picked from commit d8e04cdbc7)
2022-12-14 18:32:32 +02:00
Artem Boldariev e903ce1f3e Extend the 'doth' system test with a Mutual TLS resumption check
This commit adds a simple check to the 'doth' system test which
ensures that session resumption when Mutual TLS is used works as
expected.

(cherry picked from commit d5d31c6ba1)
2022-12-14 18:32:32 +02:00
Artem Boldariev 5de938c6cf Fix TLS session resumption via IDs when Mutual TLS is used
This commit fixes TLS session resumption via session IDs when
client certificates are used. To do so it makes sure that session ID
contexts are set within server TLS contexts. See OpenSSL documentation
for 'SSL_CTX_set_session_id_context()', the "Warnings" section.

(cherry picked from commit 837fef78b1)
2022-12-14 18:32:26 +02:00
Tony Finch 605e714438 Merge branch 'fanf-rsasha236-v9_18' into 'v9_18'
Fix a typo RSASHA236 -> RSASHA256

See merge request isc-projects/bind9!7224
2022-12-14 15:52:06 +00:00
Tony FinchandTony Finch d2fff95bc0 Fix a typo RSASHA236 -> RSASHA256
Use dns_secalg_format() to avoid error-prone repetition.

(cherry picked from commit c18a9a208d)
2022-12-14 15:51:33 +00:00
Tony Finch 1c68885cee Merge branch 'fanf-dnssec-algorithm-loglevel-v9_18' into 'v9_18'
List supported DNSSEC algorithms at log level NOTICE

See merge request isc-projects/bind9!7226
2022-12-14 12:30:14 +00:00
Tony FinchandTony Finch 24d02d0986 List supported DNSSEC algorithms at log level NOTICE
NOTICE matches the other startup messages. WARNING weirdly
suggests the list is a problem.

(cherry picked from commit 72f8d03cad)
2022-12-14 11:03:48 +00:00
Mark Andrews 18e407c712 Merge branch '3737-fix-initialisation-of-local-in-isdotlocal-in-dig-v9_18' into 'v9_18'
Resolve "fix initialisation of local. in isdotlocal in dig" [v9_18]

See merge request isc-projects/bind9!7221
2022-12-14 00:32:52 +00:00
Mark Andrews d2aa4ad87c Properly initialise local_ndata in isdotlocal in dig
Remove the trailing '\0' so that the length field of the dns_name_t
structure is correct.  The old data just happens to work with
dns_name_issubdomain but would fail with dns_name_equal.

(cherry picked from commit 8ce163bbc5)
2022-12-14 10:30:16 +11:00
Tom Krizek c5e392a226 Merge branch 'tkrizek/set-up-version-and-release-notes-for-bind-9.18.11' into 'v9_18'
Set up version and release notes for bind 9.18.11

See merge request isc-projects/bind9!7219
2022-12-13 16:18:12 +00:00
Tom Krizek 6b498a12cf Set up release notes for BIND 9.18.11 2022-12-13 17:02:14 +01:00
Tom Krizek 4d79f073b6 Update BIND version to 9.18.11-dev 2022-12-13 17:02:03 +01:00
Tom Krizek 7011eaf906 Update BIND version for release 2022-12-12 14:21:01 +01:00
Tom Krizek 08d554a913 Add a CHANGES marker 2022-12-12 14:04:01 +01:00
Tom Krizek eb67931800 Merge branch 'tkrizek/prepare-documentation-for-bind-9.18.10' into 'v9_18_10-release'
Prepare documentation for BIND 9.18.10

See merge request isc-private/bind9!488
2022-12-12 12:57:09 +00:00
Michał Kępień f799449fae Add release note for GL #3721 2022-12-12 12:53:31 +01:00
Michał Kępień d7585d507c Reorder release notes 2022-12-12 12:53:31 +01:00
Michał Kępień 91d0e488da Tweak and reword release notes 2022-12-12 12:53:31 +01:00
Michał Kępień b315fabdce Prepare release notes for BIND 9.18.10 2022-12-12 12:53:31 +01:00
Ondřej Surý e0bf7ed171 Merge branch '3731-attach-keyfileio-to-zone-v9_18' into 'v9_18'
Implement proper reference counting for dns_keyfileio_t

See merge request isc-projects/bind9!7210
2022-12-09 14:56:01 +00:00
Ondřej Surý 9ebd775e29 Implement proper reference counting for dns_keyfileio_t
Instead of relying on hash table search when using the keys, implement a
proper reference counting in dns_keyfileio_t objects, and attach/detach
the objects to the zone.

(cherry picked from commit 79115a0c3b)
2022-12-09 15:17:02 +01:00
Ondřej Surý 8b8c761a90 Merge branch 'pspacek/configure-doh-help-fix-v9_18' into 'v9_18'
Fix configure --disable-doh help text [v9_18]

See merge request isc-projects/bind9!7194
2022-12-08 10:17:41 +00:00
Petr ŠpačekandOndřej Surý 0d78be7057 Fix configure --disable-doh help text
This is technically fixup for 2bb454182b.

Related: !4926
(cherry picked from commit 5ec272007d)
2022-12-08 10:17:32 +00:00
Ondřej Surý c51cb3b390 Merge branch '3727-fix-off-by-one-reference-counting-in-zonemgr_keymgmt_delete-v9_18' into 'v9_18'
Release unused key file IO lock objects [v9.18]

See merge request isc-projects/bind9!7193
2022-12-08 10:17:15 +00:00
Ondřej Surý f79a9c856c Add CHANGES and release note for [GL #3727]
(cherry picked from commit 56a997b0b5)
2022-12-08 10:56:31 +01:00
Ondřej Surý 85f5071a6d Release unused key file IO lock objects
Due to off-by-one error in zonemgr_keymgmt_delete, unused key file IO
lock objects were never freed and they were kept until the server
shutdown.  Adjust the returned value by -1 to accomodate the fact that
the atomic_fetch_*() functions return the value before the operation and
not current value after the operation.

(cherry picked from commit fb1acd6736)
2022-12-08 10:56:31 +01:00
Tom Krizek b5d53e75b7 Merge branch 'tkrizek/revert-3678-serve-stale-servfail-v9_18' into 'v9_18'
Revert "Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_18' into 'v9_18'"

See merge request isc-projects/bind9!7184
2022-12-08 09:31:50 +00:00
Tom Krizek f4d0b2dca9 Revert "Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_18' into 'v9_18'"
This reverts commit 81b6f17e7c, reversing
changes made to ea47a9c100.

It also removes release note 6038, since the fix is reverted.
2022-12-08 10:22:33 +01:00
Mark Andrews aa7870cd2e Merge branch '3613-redo-dumping-expired-rdatasets-v9_18' into 'v9_18'
Resolve "TTL issue with resolver's cached and expired results for qtype ANY queries" [v9_18]

See merge request isc-projects/bind9!7188
2022-12-08 01:03:23 +00:00
Mark Andrews 2ddf710e40 Add CHANGES note for [GL #3613]
(cherry picked from commit 485e968087)
2022-12-07 23:59:36 +00:00
Mark Andrews d218c7f2f3 Remove different zero TTL handling for rdataset iterator
Zero TTL handling does not need to be different for 'rdatasetiter_first'
and 'rdatasetiter_next' and it interacts badly with 'bind_rdatadataset'
which makes different determinations.

(cherry picked from commit 1a39328feb)
2022-12-07 23:59:36 +00:00
Mark Andrews 47239b45e6 Add dns_db_allrdatasets options
'DNS_DB_STALEOK' returns stale rdatasets as well as current rdatasets.

'DNS_DB_EXPIREDOK' returns expired rdatasets as well as current
rdatasets. This option is currently only set when DNS_DB_STALEOK is
also set.

(cherry picked from commit 85048ddeee)
2022-12-07 23:59:36 +00:00
Mark Andrews 6f998bbe51 Extend dns_db_allrdatasets to control interation results
Add an options parameter to control what rdatasets are returned when
iteratating over the node.  Specific modes will be added later.

(cherry picked from commit 7695c36a5d)
2022-12-07 23:59:36 +00:00
Mark Andrews 434b53281b Properly select active rdatasets when iterating across node
Active rdatasets where not being properly selected in rdatasetiter_first
and rdatasetiter_next.

(cherry picked from commit 3bdab2d111)
2022-12-07 23:59:36 +00:00
Mark Andrews 52a9db2180 Check TTLs of mixed TTL ANY response with expired records
(cherry picked from commit e49f83499a)
2022-12-07 23:59:36 +00:00
Mark Andrews 50caecea06 Revert "Fix rndc dumpdb -expired for stuck cache contents"
This reverts commit f8d866c6ef.

(cherry picked from commit 90249e4aa5)
2022-12-07 23:59:36 +00:00
Mark Andrews 2cc91f65c4 Merge branch '3724-update-dig-tcp-documentation-v9_18' into 'v9_18'
Add reference to +tcp for +ignore [v9_18]

See merge request isc-projects/bind9!7186
2022-12-07 23:13:46 +00:00
Mark Andrews f8ce443684 Add reference to +tcp for +ignore
(cherry picked from commit b5951f0411)
2022-12-08 09:29:35 +11:00
Ondřej Surý 6c0577ad81 Merge branch 'ondrej-fix-missing-zone_check-in-checkds-system-test-v9_18' into 'v9_18'
Fix missing zone_check() call in checkds test [v9.18]

See merge request isc-projects/bind9!7182
2022-12-07 18:46:48 +00:00
Ondřej Surý 5164ba8d71 Fix missing zone_check() call in checkds test
The bad2-dswithdrawn.checkds tests were missing call to the
zone_checks() contributing to intermittent timing failures of the
checkds system test.

(cherry picked from commit 718831bfcc)
2022-12-07 19:34:42 +01:00
Ondřej Surý 31eed6a31f Merge branch '3183-send-shutdown-to-ns_client-on-shutdown-v9_18' into 'v9_18'
Propagate the shutdown event to the recursing ns_client(s) [v9.18]

See merge request isc-projects/bind9!7028
2022-12-07 18:33:27 +00:00
Ondřej Surý 2cb02a417a Add CHANGES and release notes for [GL #3183]
(cherry picked from commit d3f1639c16e7777a52d66c2dccd8b43a08a0750b)
2022-12-07 18:09:06 +01:00
Ondřej Surý 85e35d4c27 Propagate the shutdown event to the recursing ns_client(s)
Send the ns_query_cancel() on the recursing clients when we initiate the
named shutdown for faster shutdown.

When we are shutting down the resolver, we cancel all the outstanding
fetches, and the ISC_R_CANCEL events doesn't propagate to the ns_client
callback.

In the future, the better solution how to fix this would be to look at
the shutdown paths and let them all propagate from bottom (loopmgr) to
top (f.e. ns_client).

(cherry picked from commit d861d403bb9a7912e29a06aba6caf6d502839f1b)
2022-12-07 18:08:29 +01:00
Ondřej Surý d3ae26fa8e Merge branch '3386-nxdomain-serve-stale-v9_18' into 'v9_18'
don't keep stale NXDOMAIN cache entries [v9.18]

See merge request isc-projects/bind9!7180
2022-12-07 16:58:35 +00:00
Evan HuntandOndřej Surý 265d606fd3 CHANGES and release note for [GL #3386]
(cherry picked from commit 15f08ca961)
2022-12-07 17:46:53 +01:00
Evan HuntandOndřej Surý 2b78a2f9fa don't keep stale NXDOMAIN cache entries
when serve-stale is enabled, NXDOMAIN cache entries are no longer
preserved after the normal negative cache TTL, in order to reduce
unnecessary cache memory consumption.

(cherry picked from commit f1485ca145)
2022-12-07 17:21:00 +01:00
Matthijs Mekking b6df5bfe2b Merge branch 'matthijs-document-ns-minimal-responses-v9_18' into 'v9_18'
Document NS queries are excempt from minimal-responses

See merge request isc-projects/bind9!7176
2022-12-07 12:09:20 +00:00
Matthijs Mekking 7694e5019c Document NS queries are excempt from minimal-responses
Also document that DNSKEY, DS, CDNSKEY, and CDS never do additional
section processing.

(cherry picked from commit f7b477f6ea)
2022-12-07 12:06:43 +01:00
Michal Nowak f275e9896b Merge branch 'mnowak/asan-tsan-respdiff-jobs-v9_18' into 'v9_18'
[v9_18] Add ASAN- and TSAN-enabled respdiff jobs

See merge request isc-projects/bind9!7173
2022-12-07 09:40:47 +00:00
Michal Nowak af03ec8987 Add ASAN- and TSAN-enabled respdiff jobs
Neither of the new CI jobs can reliably pass at the moment; hence they
are defined with "allow_failure: true" until issues in the code base are
resolved.

(cherry picked from commit 4f23de554c)
2022-12-07 08:28:16 +01:00
Michal Nowak 865bc5c250 Extract TSAN parsing code
(cherry picked from commit 9856296666)
2022-12-07 08:27:56 +01:00
Mark Andrews 9dd77f770c Merge branch '3683-use-after-free-in-catalog-zone-processing-v9_18' into 'v9_18'
Resolve "use after free in catalog zone processing" [v9_18]

See merge request isc-projects/bind9!7170
2022-12-06 23:30:49 +00:00
Mark Andrews c8fa438768 Add release note for [GL #3683]
(cherry picked from commit 9843da3423)
2022-12-07 09:45:21 +11:00
Mark Andrews 569b7b20da Add CHANGES note for [GL #3683]
(cherry picked from commit 72402e1710)
2022-12-07 09:44:35 +11:00
Mark Andrews 814ae11d19 Check that restored catalog zone works
Using a restored catalog zone excercised a use-after-free bug.
The test checks that the use-after-free bug is gone and is just
a reasonable behaviour check in its own right.

(cherry picked from commit bca84c8601)
2022-12-07 09:44:35 +11:00
Mark Andrews 1e6a12091f Add missing DbC magic checks
Checking for value != NULL is not sufficient to detect use after
free errors.

(cherry picked from commit b1086a5561)
2022-12-07 09:44:35 +11:00
Mark Andrews 6e2a33dd4c Call dns_db_updatenotify_unregister earlier
dns_db_updatenotify_unregister needed to be called earlier to ensure
that listener->onupdate_arg always points to a valid object.  The
existing lazy cleanup in rbtdb_free did not ensure that.

(cherry picked from commit 35839e91d8)
2022-12-07 09:44:35 +11:00
Mark Andrews 90822519eb Suppress duplicate dns_db_updatenotify_register registrations
Duplicate dns_db_updatenotify_register registrations need to be
suppressed to ensure that dns_db_updatenotify_unregister is successful.

(cherry picked from commit f13e71e551)
2022-12-07 09:44:30 +11:00
Arаm Sаrgsyаn 81b6f17e7c Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_18' into 'v9_18'
[v9_18] Resolve "stale-serve and RPZ put in SERVFAIL cache unexpected record"

See merge request isc-projects/bind9!7166
2022-12-06 15:01:29 +00:00
Michał KępieńandAram Sargsyan a4547a1093 Check for NULL before dereferencing qctx->rpz_st
Commit 9ffb4a7ba1 causes Clang Static
Analyzer to flag a potential NULL dereference in query_nxdomain():

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

The warning above is for qctx->rpz_st potentially being a NULL pointer
when query_nxdomain() is called from query_resume().  This is a false
positive because none of the database lookup result codes currently
causing query_nxdomain() to be called (DNS_R_EMPTYWILD, DNS_R_NXDOMAIN)
can be returned by a database lookup following a recursive resolution
attempt.  Add a NULL check nevertheless in order to future-proof the
code and silence Clang Static Analyzer.

(cherry picked from commit 07592d1315)
2022-12-06 13:47:51 +00:00
Aram Sargsyan f92b3b496f Add a CHANGES note for [GL #3678]
(cherry picked from commit 5b5f3a0ea7)
2022-12-06 13:47:38 +00:00
Matthijs MekkingandAram Sargsyan 65443cb59f Consider non-stale data when in serve-stale mode
With 'stale-answer-enable yes;' and 'stale-answer-client-timeout off;',
consider the following situation:

A CNAME record and its target record are in the cache, then the CNAME
record expires, but the target record is still valid.

When a new query for the CNAME record arrives, and the query fails,
the stale record is used, and then the query "restarts" to follow
the CNAME target. The problem is that the query's multiple stale
options (like DNS_DBFIND_STALEOK) are not reset, so 'query_lookup()'
treats the restarted query as a lookup following a failed lookup,
and returns a SERVFAIL answer when there is no stale data found in the
cache, even if there is valid non-stale data there available.

With this change, query_lookup() now considers non-stale data in the
cache in the first place, and returns it if it is available.

(cherry picked from commit 86a80e723f)
2022-12-06 13:47:22 +00:00
Aram Sargsyan 4ae4f1fd48 Add serve-stale CNAME check with stale-answer-client-timeout off
Prime the cache with the following records:

    shortttl.cname.example.	1	IN	CNAME	longttl.target.example.
    longttl.target.example.	600	IN	A	10.53.0.2

Wait for the CNAME record to expire, disable the authoritative server,
and query 'shortttl.cname.example' again, expecting a stale answer.

(cherry picked from commit 21faf44ef7)
2022-12-06 13:46:55 +00:00
Mark Andrews ea47a9c100 Merge branch '3721-the-nslookup-command-does-not-obey-the-port-option-when-record-type-any-is-used-v9_18' into 'v9_18'
Resolve "The nslookup command does not obey the port option when record type ANY is used." [v9_18]

See merge request isc-projects/bind9!7164
2022-12-06 00:11:32 +00:00
Mark Andrews 0033c12002 Add CHANGES note for [GL #3721]
(cherry picked from commit 27168dbf43)
2022-12-06 09:22:39 +11:00
Mark Andrews 0569fa0d25 Remember that the port was set in host and nslookup
Set 'port_set = true;' so that the TCP/DOT/DOH code doesn't reset
the port when making connections.

(cherry picked from commit 8caa94bdf1)
2022-12-06 09:21:43 +11:00
Mark Andrews e1234f66c6 Add checks for 'host'
(cherry picked from commit e9c4192ee5)
2022-12-06 09:21:43 +11:00
Mark Andrews 375918493e Check ANY lookup using nslookup
(cherry picked from commit c367dd1b0b)
2022-12-06 09:21:43 +11:00
Artem Boldariev 825c40697e Merge branch 'artem-tls-tcp-compatibility-fixes-v9-18' into 'v9_18'
[Partial backport to 9.18] TLS Stream: TCP transport compatibility fixes

See merge request isc-projects/bind9!7160
2022-12-02 21:45:54 +00:00
Artem Boldariev f921cb4579 TLS: take 'sock->recv_read' flag into assumption
For compatibility with TCP this commit adds some trivial logic related
to 'sock->recv_read' flag processing.
2022-12-02 15:37:41 +02:00
Artem Boldariev c1c22ad69a TLS stream: always handle send callbacks asynchronously
This commit ensures that send callbacks are always called from within
the context of its worker thread even in the case of
shuttigdown/inactive socket, just like TCP transport does and with
which TLS attempts to be as compatible as possible.

(cherry picked from commit 2bfc079946)
2022-12-02 15:37:41 +02:00
Artem Boldariev 66bec1d886 TLS Stream: use ISC_R_CANCELLED error when shutting down
This commit changes ISC_R_NOTCONNECTED error code to ISC_R_CANCELLED
when attempting to start reading data on the shutting down socket in
order to make its behaviour compatible with that of TCP and not break
the common code in the unit tests.

(cherry picked from commit ef659365ce)
2022-12-02 15:37:41 +02:00
Artem Boldariev fbec0ece73 Merge branch 'artem-tls-check-for-recv_cb-v9-18' into 'v9_18'
TLS: check for sock->recv_cb when handling received data

See merge request isc-projects/bind9!7159
2022-12-02 13:31:42 +00:00
Artem Boldariev fc637fbdc3 TLS: check for sock->recv_cb when handling received data
This commit adds a check if 'sock->recv_cb' might have been nullified
during the call to 'sock->recv_cb'. That could happen, e.g. by an
indirect call to 'isc_nmhandle_close()' from within the callback when
wrapping up.

In this case, let's close the TLS connection.

(cherry picked from commit bed5e2bb08)
2022-12-02 14:29:36 +02:00
Tom Krizek 90b924be13 Merge branch 'tkrizek/system-tests-prereqs-v9_18' into 'v9_18'
Unify system test feature detection and add missing prerequisites [v9_18]

See merge request isc-projects/bind9!7156
2022-12-02 11:33:38 +00:00
Tom Krizek ca4ebedf02 Add dnstap prerequisite for dnstap system test
(cherry picked from commit 9846c920c3)
2022-12-02 10:45:21 +01:00
Tom Krizek 5a0d5c6e6f Add libnghttp2 prerequisite for doth system test
While some of these tests are for DoT which doesn't require nghttp2,
the server configs won't allow the server to start without nghttp2
support during compile time.

It might be possible to split these tests into DoT and DoH and only
require nghttp2 for DoH tests, but since almost all of our CI jobs are
compiled with nghttp2, we wouldn't gain a lot of coverage, so it's
probably not worth the effort.

(cherry picked from commit f514604613)
2022-12-02 10:45:21 +01:00
Tom Krizek 184f6d25e5 Add lmdb prerequisite for nzd2nzf system test
(cherry picked from commit b1e011e158)
2022-12-02 10:45:21 +01:00
Tom Krizek 8339c60346 Check for pkcs11-tool in keyfromlabel system test
pkcs11-tool which is typically part of the opensc package is required
for the keyfromlabel test.

(cherry picked from commit e9d9f11539)
2022-12-02 10:45:21 +01:00
Tom Krizek e8f1c7e1fb Use feature-test feature detection in pytests
Avoid using the environment variables for feature detection and use the
feature-test utility instead.

Remove the obsolete environment variables from conf.sh, since they're no
longer used anywhere.

(cherry picked from commit 9730ac4c56)
2022-12-02 10:45:21 +01:00
Tom Krizek a97a72fb8b Use feature-test to detect feature support in system tests
Previously, there were two different ways to detect feature support.
Either through an environment variable set by configure in conf.sh, or
using the feature-test utility.

It is more simple and consistent to have only one way of detecting the
feature support. Using the feature-test utility seems superior the the
environment variables set by configure.

(cherry picked from commit d24fb1122e)
2022-12-02 10:45:20 +01:00
Tom Krizek 418f7bb0ae Add missing options to feature-test utility
(cherry picked from commit e22d27da71)
2022-12-02 10:45:18 +01:00
Ondřej Surý 8b51844c2d Merge branch 'ondrej-fix-single-read-tlsdns-client-v9_18' into 'v9_18'
Honour single read per client isc_nm_read() call in the TLSDNS [v9.18]

See merge request isc-projects/bind9!7153
2022-12-01 18:33:06 +00:00
Ondřej Surý f17f5e831b Honour single read per client isc_nm_read() call in the TLSDNS
The TLSDNS transport was not honouring the single read callback for
TLSDNS client.  It would call the read callbacks repeatedly in case the
single TLS read would result in multiple DNS messages in the decoded
buffer.

(cherry picked from commit e3c628d562)
2022-12-01 19:07:22 +01:00
Matthijs Mekking 8b14eb577f Merge branch 'matthijs-deprecate-alt-transfer-source-v9_18' into 'v9_18'
[v9_18] Deprecate alt-transfer-source and companions

See merge request isc-projects/bind9!7149
2022-12-01 07:39:45 +00:00
Matthijs Mekking 9f73e2d6f8 Mention deprecation of alternate transfer source
In the CHANGES and release notes.

(cherry picked from commit 7920347077)
2022-12-01 08:15:45 +01:00
Matthijs Mekking 132387b658 Add missing deprecated tag to max-zone-ttl
This option was deprecated in commit 19352dd187 but at that time
we didn't mark it deprecated in the ARM reference.

(cherry picked from commit 13a16c1f4d)
2022-12-01 08:14:49 +01:00
Matthijs Mekking b4429660da Deprecate alt-transfer-source and companions
Deprecate the alternate transfer sources from BIND 8.

(cherry picked from commit 105465d316)
2022-12-01 08:14:42 +01:00
Michał Kępień 2b242cb9e3 Merge branch 'matthijs/update-serve-stale-test-messages-to-include-rrtype-v9_18' into 'v9_18'
[v9_18] Update serve-stale test messages to include RRtype

See merge request isc-projects/bind9!7146
2022-11-30 13:59:43 +00:00
Matthijs MekkingandMichał Kępień fe910b2cc0 Update serve-stale test messages to include RRtype
(cherry picked from commit 45f7a15785)
2022-11-30 14:29:30 +01:00
Michał Kępień cd195ba77e Merge branch '3707-dont-log-final-reference-detached-on-LOG_INFO-v9_18' into 'v9_18'
Don't log "final reference detached" on INFO level [v9.18]

See merge request isc-projects/bind9!7143
2022-11-30 13:27:42 +00:00
Ondřej Surý 8675a1ac53 Add CHANGES and release note for [GL #3707]
(cherry picked from commit 116d1b94a9)
2022-11-30 11:50:19 +01:00
Ondřej Surý 343e67ad39 Don't log "final reference detached" on INFO level
The "final reference detached" message was meant to be DEBUG(1), but was
instead kept at INFO level.  Move it to the DEBUG(1) logging level, so
it's not printed under normal operations.

(cherry picked from commit 1816244725)
2022-11-30 11:49:51 +01:00
Ondřej Surý 06216b0117 Merge branch '3693-crash-when-restarting-server-with-active-statschannel-connection-v9_18' into 'v9_18'
Be more resilient when destroying the httpd request [v9.18]

See merge request isc-projects/bind9!7112
2022-11-29 09:32:35 +00:00
Ondřej Surý 469579e71e Add CHANGES and release note for [GL #3693]
(cherry picked from commit 32e0df2a13)
2022-11-29 10:11:36 +01:00
Ondřej Surý 349b0f433b Be more resilient when destroying the httpd request
Handle the situation in the read and send callbacks when the
httpd->readhandle has been already detached; f.e. from the previous
iteration of the read callback.

Don't detach the httpd->readcallback from the isc_httpdmgr_shutdown()
and the send callback, but rather call isc_nm_cancelread() to shutdown
the http request from the read callback.
2022-11-29 10:11:28 +01:00
Michal Nowak bc8c055c6d Merge branch 'mnowak/llvm-15-v9_18' into 'v9_18'
[v9_18] Update clang to version 15

See merge request isc-projects/bind9!7133
2022-11-29 09:00:23 +00:00
Michal Nowak 1d7d504338 Update sources to Clang 15 formatting 2022-11-29 09:14:07 +01:00
Michal Nowak 6fac8ef4be Update clang to version 15
(cherry picked from commit 26a42ed1ac)
2022-11-29 09:05:16 +01:00
Mark Andrews 81e9636d6d Merge branch '3702-man-page-dig-1-typo-in-options-v9_18' into 'v9_18'
Fix typo in dig man page '+qr' should be '+noqr' [v9_18]

See merge request isc-projects/bind9!7132
2022-11-28 23:07:10 +00:00
Mark Andrews acdf043360 Fix typo in dig man page '+qr' should be '+noqr'
Reported by Fabian P. Schmidt

(cherry picked from commit 3769266318)
2022-11-29 09:45:36 +11:00
Michal Nowak 8abb2b780f Merge branch '3310-build-contrib-in-ci-v9_18' into 'v9_18'
[v9_18] Build contrib in CI & associated fixes

See merge request isc-projects/bind9!7113
2022-11-28 13:24:23 +00:00
Michal Nowak 65cc924042 Help gcovr find contrib files
(cherry picked from commit 445a90fb78)
2022-11-28 13:30:38 +01:00
Michal Nowak 56abbea62c Add install target for Perl DLZ module
Perl DLZ module Makefile lacked "install" target, add it as we want to
test DLZ module installation in the CI.

(cherry picked from commit 35e44978b5)
2022-11-28 13:30:38 +01:00
Michal Nowak 2d747f7312 Disable compound-token-split-by-macro warning with Clang
Perl DLZ module compilation with Clang produces the following warning:

    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:150:5: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
        ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                         ^~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/perl.h:666:29: note: expanded from macro 'STMT_START'
    #   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                                  ^
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:150:5: note: '{' token is here
        ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                    ^

(cherry picked from commit 69b7e4362d)
2022-11-28 13:30:37 +01:00
Michal Nowak c49b5d9d1d Build contrib dlz modules in the CI
(cherry picked from commit 4a4a91b012)
2022-11-28 13:30:37 +01:00
Michal Nowak d25dc23563 Leverage CFLAGS from environment in contrib Makefiles
(cherry picked from commit 4affc436d3)
2022-11-28 13:30:37 +01:00
Michal Nowak e23fb140fa Fix statement may fall through warnings in dlz_ldap_dynamic.c
dlz_ldap_dynamic.c: In function ‘dlz_create’:
    dlz_ldap_dynamic.c:971:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
      971 |                 if (result != ISC_R_SUCCESS) {
          |                    ^
    dlz_ldap_dynamic.c:974:9: note: here
      974 |         case 11:
          |         ^~~~
    dlz_ldap_dynamic.c:976:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
      976 |                 if (result != ISC_R_SUCCESS) {
          |                    ^
    dlz_ldap_dynamic.c:979:9: note: here
      979 |         case 10:
          |         ^~~~
    dlz_ldap_dynamic.c:980:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
      980 |                 if (strlen(argv[9]) > 0) {
          |                    ^
    dlz_ldap_dynamic.c:987:9: note: here
      987 |         case 9:
          |         ^~~~

(cherry picked from commit 99912ed2f7)
2022-11-28 13:30:37 +01:00
Michal Nowak f47990aa6e Fix compilation warnings in dlz_wildcard_dynamic.c
dlz_wildcard_dynamic.c: In function ‘dlz_lookup’:
    dlz_wildcard_dynamic.c:227:14: warning: variable ‘origin’ set but not used [-Wunused-but-set-variable]
      227 |         bool origin = true;
          |              ^~~~~~
    dlz_wildcard_dynamic.c: In function ‘dlz_lookup’:
    dlz_wildcard_dynamic.c:252:28: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
      252 |                 cd->record = "@";
          |                            ^
    dlz_wildcard_dynamic.c: In function ‘dlz_authority’:
    dlz_wildcard_dynamic.c:328:22: warning: unused variable ‘origin’ [-Wunused-variable]
      328 |                 bool origin;
          |                      ^~~~~~
    dlz_wildcard_dynamic.c:312:25: warning: unused variable ‘name’ [-Wunused-variable]
      312 |         const char *p, *name = "@";
          |                         ^~~~
    dlz_wildcard_dynamic.c: In function ‘dlz_create’:
    dlz_wildcard_dynamic.c:441:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
      441 |         for (i = 4; i < argc; i += 4) {
          |                       ^

(cherry picked from commit 76c8c58d54)
2022-11-28 13:30:37 +01:00
Michal Nowak 48c3891603 Fix compilation warnings in dlz_sqlite3_dynamic.c
dlz_sqlite3_dynamic.c: In function ‘dlz_sqlite3_fetch_row’:
    dlz_sqlite3_dynamic.c:447:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
      447 |                 if (rs->pnRow > 0U && rs->curRow < rs->pnRow) {
          |                               ^
    dlz_sqlite3_dynamic.c:447:50: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
      447 |                 if (rs->pnRow > 0U && rs->curRow < rs->pnRow) {
          |                                                  ^

(cherry picked from commit 60f68dc0d6)
2022-11-28 13:30:37 +01:00
Michal Nowak 2a52f343a3 Fix warnings in dlz_mysqldyn_mod.c
dlz_mysqldyn_mod.c: In function ‘dlz_findzonedb’:
    dlz_mysqldyn_mod.c:1079:73: warning: unused parameter ‘methods’ [-Wunused-parameter]
     1079 | dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
          |                                                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    dlz_mysqldyn_mod.c:1080:34: warning: unused parameter ‘clientinfo’ [-Wunused-parameter]
     1080 |                dns_clientinfo_t *clientinfo) {
          |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    dlz_mysqldyn_mod.c: In function ‘dlz_lookup’:
    dlz_mysqldyn_mod.c:1111:63: warning: unused parameter ‘methods’ [-Wunused-parameter]
     1111 |            dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods,
          |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    dlz_mysqldyn_mod.c: In function ‘build_query’:
    dlz_mysqldyn_mod.c:465:19: warning: pointer ‘item’ used after ‘free’ [-Wuse-after-free]
      465 |              item = DLZ_LIST_NEXT(item, link))
    dlz_mysqldyn_mod.c:470:17: note: call to ‘free’ here
      470 |                 free(item);
          |                 ^~~~~~~~~~

(cherry picked from commit 587ea10567)
2022-11-28 13:30:37 +01:00
Michal Nowak 0d8032842c Fix compilation warnings in dlz_perl_driver.c
dlz_perl_driver.c: In function ‘dlz_version’:
    dlz_perl_driver.c:116:27: warning: unused parameter ‘flags’ [-Wunused-parameter]
      116 | dlz_version(unsigned int *flags) {
          |             ~~~~~~~~~~~~~~^~~~~
    In file included from /usr/lib64/perl5/CORE/perl.h:5685,
                     from dlz_perl_driver.c:33:
    dlz_perl_driver.c: In function ‘dlz_allnodes’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:151:17: note: in expansion of macro ‘POPs’
      151 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c: In function ‘dlz_allowzonexfr’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:251:17: note: in expansion of macro ‘POPs’
      251 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c: In function ‘dlz_findzonedb’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:328:17: note: in expansion of macro ‘POPs’
      328 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c: In function ‘dlz_lookup’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:407:17: note: in expansion of macro ‘POPs’
      407 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c:472:1: error: no previous prototype for ‘missing_perl_method’ [-Werror=missing-prototypes]
      472 | missing_perl_method(const char *perl_class_name, PerlInterpreter *my_perl)
          | ^~~~~~~~~~~~~~~~~~~
    dlz_perl_driver.c: In function ‘missing_perl_method’:
    dlz_perl_driver.c:485:9: error: ISO C90 forbids array ‘full_name’ whose size cannot be evaluated [-Werror=vla]
      485 |         char full_name[BUF_LEN];
          |         ^~~~
    dlz_perl_driver.c: In function ‘dlz_create’:
    dlz_perl_driver.c:613:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
      613 |         if (missing_method_name = missing_perl_method(perl_class_name, my_perl))
          |             ^~~~~~~~~~~~~~~~~~~
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:657:17: note: in expansion of macro ‘POPs’
      657 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c:502:15: warning: unused variable ‘init_args’ [-Wunused-variable]
      502 |         char *init_args[] = { NULL, NULL };
          |               ^~~~~~~~~

(cherry picked from commit be928dbba2)
2022-11-28 13:30:36 +01:00
Tony Finch 204387be3c Merge branch 'fanf-deduplicate-time-units-v9_18' into 'v9_18'
Deduplicate time unit conversion factors [v9_18]

See merge request isc-projects/bind9!7126
2022-11-25 15:08:39 +00:00
Tony FinchandTony Finch 303cdf8e27 Deduplicate time unit conversion factors
The various factors like NS_PER_MS are now defined in a single place
and the names are no longer inconsistent. I chose the _PER_SEC names
rather than _PER_S because it is slightly more clear in isolation;
but the smaller units are always NS, US, and MS.

(cherry picked from commit 00307fe318)
2022-11-25 14:16:09 +00:00
Tom Krizek 2c03ac2f5f Merge branch 'tkrizek/system-tests-start-stop-helpers-v9_18' into 'v9_18'
Simplify start/stop helper func in system tests [v9_18]

See merge request isc-projects/bind9!7124
2022-11-25 13:25:48 +00:00
Tom Krizek 34eda91697 Simplify start/stop helper func in system tests
The system test should never attempt to start or stop any other server
than those that belong to that system test. Therefore, it is not
necessary to specify the system test name in function calls.

Additionally, this makes it possible to run the test inside a
differently named directory, as its name is automatically detected with
the $SYSTESTDIR variable. This enables running the system tests inside a
temporary directory.

Direct use of stop.pl was replaced with a more systematic approach to
use stop_servers helper function.

(cherry picked from commit c100308b7d)
2022-11-25 12:57:46 +01:00
Mark Andrews 2c4054a2f7 Merge branch '3638-tls-settings-for-primaries-not-saved-for-catalog-zone-entries-v9_18' into 'v9_18'
Resolve "TLS settings for primaries not saved for catalog zone entries." [v9_18]

See merge request isc-projects/bind9!7122
2022-11-25 00:04:40 +00:00
Mark Andrews f21c770733 Back port @DEFAULT_HMAC@ changes for tsig_key in catz 2022-11-25 10:42:53 +11:00
Mark Andrews 567fc35fba Add release note for [GL #3638]
(cherry picked from commit 7e223f5e55)
2022-11-25 09:57:30 +11:00
Mark Andrews f19e688b73 Add CHANGES note for [GL #3638]
(cherry picked from commit de3bd0d3d6)
2022-11-25 09:57:30 +11:00
Mark Andrews 55bcdcf943 Add catalog zone that requires TLS for all transfers
Both the catalog zone (catalog-tls.example) the zone managed using
the catalog zone (tls1.example) require TLS and a TSIG for zone
transfers.

(cherry picked from commit bb66ef2a47)
2022-11-25 09:57:30 +11:00
Mark Andrews 6b8abcae4a Fix log messages incorrectly logged at error
The log message "got TLS configuration for zone transfer" is not
an error, setting to info.

(cherry picked from commit b95d089751)
2022-11-25 09:57:30 +11:00
Mark Andrews 2fcd842a82 TLS setting of primaries with catalog zones where being ignored
Extract the tlss values if present from the ipkeylist entry and add
the resulting tls setting to the constructed configuration for the
primary.

When comparing catalog zone entries for reuse also check the
masters.tlss values for equality.

(cherry picked from commit 65f2512315)
2022-11-25 09:57:30 +11:00
Michal Nowak d8027595c5 Merge branch 'mnowak/gcovr-cleanup-v9_18' into 'v9_18'
[v9_18] Various gcovr clean-ups

See merge request isc-projects/bind9!7109
2022-11-23 15:46:36 +00:00
Michal Nowak b1b1e1b4f1 Restructure inline-function helpers for code coverage
(cherry picked from commit fdad6ff7c7)
2022-11-23 15:04:21 +01:00
Michal Nowak fa3f04a7ff Drop redundant code coverage helper
The "hash.h" file does not need to be copied to "lib/dns/" for the gcovr
tool to generate the code coverage report, as it has been copied
already.

(cherry picked from commit 6b1dd7d6b1)
2022-11-23 15:04:17 +01:00
Michal Nowak 71d1e19c3c Drop buffer.h helper for fuzz directory
The "fuzz" directory is no longer included in the code coverage report
and the associated buffer.h helper is no longer needed.

(cherry picked from commit 8b9c04342d)
2022-11-23 15:04:12 +01:00
Michal Nowak 9395362503 Exclude fuzz directory from code coverage report
gcovr fails to process fuzz/old.gcda and fuzz/old.gcno files after !7045
MR with:

    (WARNING) GCOV produced the following errors processing /builds/isc-projects/bind9/fuzz/old.gcda:
    	Cannot open source file ../../fuzz/old.c
    Cannot open source file ../../lib/dns/include/dns/compress.h
    Cannot open source file ../../lib/isc/include/isc/buffer.h
    ...
    (gcovr could not infer a working directory that resolved it.)

Given that code coverage inspection is meant only for BIND 9 code and
not its tests and auxiliary tools, the "fuzz" directory should be
excluded from being included in the code coverage report.

(cherry picked from commit 3b5e9666c6)
2022-11-23 15:04:07 +01:00
Matthijs Mekking 00e776dae4 Merge branch '3667-deprecate-auto-dnssec-v9_18' into 'v9_18'
[v9_18] Deprecate auto-dnssec

See merge request isc-projects/bind9!7106
2022-11-23 11:37:01 +00:00
Matthijs Mekking 2c4e680142 Add CHANGES and release note for GL #3667
Announce deprecation of 'auto-dnssec'.

(cherry picked from commit fde1d89d03)
2022-11-23 11:21:39 +01:00
Matthijs Mekking 556acc0b85 Deprecate auto-dnssec
Deprecate auto-dnssec, add specific log warning to migrate to
dnssec-policy.

(cherry picked from commit f9845dd128)
2022-11-23 11:19:40 +01:00
Ondřej Surý 93dfa63ac2 Merge branch '3676-deprecate-operating-system-resource-limits-v9_18' into 'v9_18'
Deprecate setting operating system limits from named.conf

See merge request isc-projects/bind9!7103
2022-11-21 17:36:50 +00:00
Ondřej Surý 8145183c73 Add CHANGES and release note [GL #3676]
(cherry picked from commit 65156afb8c)
2022-11-21 15:57:40 +01:00
Ondřej Surý 0d1c3ef7c2 Deprecate setting operating system limits from named.conf
It was possible to set operating system limits (RLIMIT_DATA,
RLIMIT_STACK, RLIMIT_CORE and RLIMIT_NOFILE) from named.conf.  It's
better to leave these untouched as setting these is responsibility of
the operating system and/or supervisor.

Deprecate the configuration options and remove them in future BIND 9
release.

(cherry picked from commit 379929e052)
2022-11-21 15:57:09 +01:00
Tony Finch a2f4f9bb92 Merge branch '3655-decompress-faster-v9_18' into 'v9_18'
Simplify and speed up DNS name decompression

See merge request isc-projects/bind9!7099
2022-11-21 13:43:41 +00:00
Tony Finch 4e14f91380 Simplify and speed up DNS name decompression
The aim is to do less work per byte:

  * Check the bounds for each label, instead of checking the
    bounds for each character.

  * Instead of copying one character at a time from the wire to
    the name, copy entire runs of sequential labels using memmove()
    to make the most of its fast loop.

  * To remember where the name ends, we only need to set the end
    marker when we see a compression pointer or when we reach the
    root label. There is no need to check if we jumped back and
    conditionally update the counter for every character.

  * To parse a compression pointer, we no longer take a diversion
    around the outer loop in between reading the upper byte of the
    pointer and the lower byte.

  * The parser state machine is now implicit in the instruction
    pointer, instead of being an explicit variable. Similarly,
    when we reach the root label we break directly out of the loop
    instead of setting a second state machine variable.

  * DNS_NAME_DOWNCASE is never used with dns_name_fromwire() so
    that option is no longer supported.

I have removed this comment which dated from January 1999 when
dns_name_fromwire() was first introduced:

   /*
    * Note:  The following code is not optimized for speed, but
    * rather for correctness.  Speed will be addressed in the future.
    */

No functional change, apart from removing support for the unused
DNS_NAME_DOWNCASE option. The new code is about 2x faster than the
old code: best case 11x faster, worst case 1.4x faster.
2022-11-21 13:43:01 +00:00
Michal Nowak c8958e369f Merge branch 'mnowak/fedora-37-v9_18' into 'v9_18'
[v9_18] Add Fedora 37

See merge request isc-projects/bind9!7101
2022-11-21 13:18:11 +00:00
Michal Nowak ecd9ed84ea Add Fedora 37
(cherry picked from commit b293b2c638)
2022-11-21 13:49:27 +01:00
Michał Kępień 52269888fa Merge branch 'matthijs-tweak-kasp-test-v9_18' into 'v9_18'
[v9_18] Tweak kasp system test script

See merge request isc-projects/bind9!7094
2022-11-17 12:28:06 +00:00
Matthijs Mekking ba2ef65483 Tweak kasp system test script
The retry 3 times when checking signatures did not make sense because
at this point the input file does not change.

Raise the number of retries when checking the apex DNSKEY response to
reduce the number of intermittent failures due to unexpected delays.

(cherry picked from commit 6ef0417274)
2022-11-17 12:31:48 +01:00
Mark Andrews e1b7db99e2 Merge branch '3607-apex-in-name_external-may-be-invalid-when-using-dual-stack-servers-v9_18' into 'v9_18'
Resolve "apex in name_external may be invalid when using dual stack servers" [v9_18]

See merge request isc-projects/bind9!7092
2022-11-17 02:37:47 +00:00
Mark Andrews 55d817b0b6 Add CHANGES note for [GL #3607]
(cherry picked from commit 8a2149f502)
2022-11-17 13:05:12 +11:00
Mark Andrews 726aa21913 Add system test for dual-stack-servers with possible DNAME response
Create a zone that triggers DNAME owner name checks in a zone that
is only reachable using a dual stack server.  The answer contains
a name that is higher in the tree than the query name.

e.g.
	foo.v4only.net.	CNAME	v4only.net.
	v4only.net.	A	10.0.0.1

ns4 is serving the test zone (ipv4-only)
ns6 is the root server for this test (dual stacked)
ns7 is acting as the dual stack server (dual stacked)
ns9 is the server under test (ipv6-only)

(cherry picked from commit f946133ec9)
2022-11-17 13:05:12 +11:00
Mark Andrews c77af4be6f Support starting and stopping IPv6 only servers
Look for $testdir/$server/named.ipv6-only and use
fd92:7065:b8e:ffff::$n instead of 10.53.0.$n to
communicate with the server.

(cherry picked from commit a35c34e10f)
2022-11-17 13:05:12 +11:00
Mark Andrews 43e714336a Select the appropriate namespace when using a dual stack server
When using dual-stack-servers the covering namespace to check whether
answers are in scope or not should be fctx->domain.  To do this we need
to be able to distingish forwarding due to forwarders clauses and
dual-stack-servers.  A new flag FCTX_ADDRINFO_DUALSTACK has been added
to signal this.

(cherry picked from commit dfbffd77f9)
2022-11-17 13:05:12 +11:00
Mark Andrews eaa97f48df Merge branch '1905-check-wildcard-in-checkconf-z-v9_18' into 'v9_18'
Fix 'named-checkconf -z' was ignoring check-wildcard settings in named.conf [v9_18]

See merge request isc-projects/bind9!7090
2022-11-17 00:53:46 +00:00
Mark Andrews 4906ae9fe0 Check 'named-checkconf -z' and check-wildcard
Add tests to check the behavior of 'named-checkconf -z' and
check-wildcard setting in named.conf.

(cherry picked from commit 708dadac59)
2022-11-17 10:58:54 +11:00
Mark Andrews 27250ec8d2 named-checkzone -z ignored the check-wildcard option
Lookup and set the wildcard option according to the configuration
settings.  The default is on as per bin/named/config.c.

(cherry picked from commit dfc5c1e018)
2022-11-17 10:54:36 +11:00
Michal Nowak f0fc13e408 Merge tag 'v9_18_9' into v9_18
BIND 9.18.9
2022-11-16 15:49:55 +01:00
Michal Nowak adc93de268 Merge branch 'mnowak/openbsd-7.2-v9_18' into 'v9_18'
[v9_18] Add OpenBSD 7.2

See merge request isc-projects/bind9!7082
2022-11-15 09:52:54 +00:00
Michal Nowak 4f180ee1f6 Add OpenBSD 7.2
(cherry picked from commit b239e6870d)
2022-11-15 08:32:29 +01:00
Michal Nowak 5ddc9bd59c Merge branch '2265-fix-and-check-bashisms-v9_18' into 'v9_18'
[v9_18] Fix and check bashisms in system test

See merge request isc-projects/bind9!7080
2022-11-14 20:34:42 +00:00
Michal Nowak ebdf9336e3 Add checkbashisms CI job
(cherry picked from commit 47a7c5123a)
2022-11-14 21:03:01 +01:00
Michal Nowak e30f71f6f1 Replace "sha1sum" with "openssl sha1 -r"
"sha1sum" is part of GNU Coreutils, neither BIND 9 dependency nor POSIX.
Replace it with "openssl sha1 -r" as OpenSSL is BIND 9 dependency.

(cherry picked from commit d34c7ae227)
2022-11-14 21:03:01 +01:00
Michal Nowak 18965b6ecd Rename $HOSTNAME to $HOST_NAME to silence checkbashisms
checkbashisms warns about possible reliance on HOSTNAME environmental
variable which Bash sets to the name of the current host, and some
commands may leverage it:

    possible bashism in builtin/tests.sh line 199 ($HOST(TYPE|NAME)):
    grep "^\"$HOSTNAME\"$" dig.out.ns1.$n > /dev/null || ret=1
    possible bashism in builtin/tests.sh line 221 ($HOST(TYPE|NAME)):
    grep "^\"$HOSTNAME\"$" dig.out.ns2.$n > /dev/null || ret=1
    possible bashism in builtin/tests.sh line 228 ($HOST(TYPE|NAME)):
    grep "^; NSID: .* (\"$HOSTNAME\")$" dig.out.ns2.$n > /dev/null || ret=1

We don't use the variable this way but rename it to HOST_NAME to silence
the tool.

(cherry picked from commit ae33a8ddea)
2022-11-14 21:03:01 +01:00
Michal Nowak c13bb5a7c1 Remove no-op assignment from kasp/tests.sh
"next_key_event_threshold" is assigned with
"next_key_event_threshold+i", but "i" is empty (never set, nor used
afterwards).

posh, the Policy-compliant Ordinary SHell, failed on this assignment
with:

    tests.sh:253: : unexpected `end of expression'

(cherry picked from commit 00c3b1e309)
2022-11-14 21:03:01 +01:00
Michal Nowak d247b6c09e Remove unused $@ array from cds/setup.sh
posh, the Policy-compliant Ordinary SHell, failed with:

    setup.sh:57: @: parameter not set

(cherry picked from commit 02a4a95395)
2022-11-14 21:03:01 +01:00
Michal Nowak a55099ba5b Drop interpolated string replacement
Interpolated string is Bashism:

    possible bashism in bin/tests/system/engine_pkcs11/setup.sh line 34 ($'...' should be "$(printf '...')"):
            pkcs11-tool --module $SOFTHSM2_MODULE --token-label "softhsm2-engine_pkcs11" -l -k --key-type $type:$bits --label "${label}" --id "${p11id//$'\n'/}" --pin $(cat $PWD/pin) > pkcs11-tool.out.$zone.$id 2> pkcs11-tool.err.$zone.$id || return 1
    possible bashism in bin/tests/system/engine_pkcs11/setup.sh line 34 (${parm/?/pat[/str]}):
            pkcs11-tool --module $SOFTHSM2_MODULE --token-label "softhsm2-engine_pkcs11" -l -k --key-type $type:$bits --label "${label}" --id "${p11id//$'\n'/}" --pin $(cat $PWD/pin) > pkcs11-tool.out.$zone.$id 2> pkcs11-tool.err.$zone.$id || return 1
    possible bashism in bin/tests/system/keyfromlabel/tests.sh line 27 ($'...' should be "$(printf '...')"):
            pkcs11-tool --module $SOFTHSM2_MODULE --token-label "softhsm2-keyfromlabel" -l -k --key-type $type:$bits --label "${label}" --id "${p11id//$'\n'/}" --pin $(cat $PWD/pin) > pkcs11-tool.out.$zone.$id || return 1
    possible bashism in bin/tests/system/keyfromlabel/tests.sh line 27 (${parm/?/pat[/str]}):
            pkcs11-tool --module $SOFTHSM2_MODULE --token-label "softhsm2-keyfromlabel" -l -k --key-type $type:$bits --label "${label}" --id "${p11id//$'\n'/}" --pin $(cat $PWD/pin) > pkcs11-tool.out.$zone.$id || return 1

The replacement is actually not needed as $p11id holds only one line.

Also see https://www.shellcheck.net/wiki/SC3003 and
https://www.shellcheck.net/wiki/SC3060.

(cherry picked from commit ac3fcb612d)
2022-11-14 21:03:01 +01:00
Michal Nowak 64311314dc Join two rndc lines not to confuse checkbashisms
checkbashisms gets confused by the rndc command being on two lines:

    possible bashism in bin/tests/system/nzd2nzf/tests.sh line 37 (type):
    rndccmd 10.53.0.1 addzone "added.example { type primary; file \"added.db\";

(cherry picked from commit 9eb2f6b0e8)
2022-11-14 21:03:00 +01:00
Michal Nowak e7e0d1dd0a Replace string comparisons with integer comparisons
checkbashisms reports Bash-style ("==") string comparisons inside test/[
command:

    possible bashism in bin/tests/system/checkconf/tests.sh line 105 (should be 'b = a'):
                    if [ $? == 0 ]; then echo_i "failed"; ret=1; fi
    possible bashism in bin/tests/system/keyfromlabel/tests.sh line 62 (should be 'b = a'):
                    test $ret == 0 || continue
    possible bashism in bin/tests/system/keyfromlabel/tests.sh line 79 (should be 'b = a'):
                    test $ret == 0 || continue

(cherry picked from commit 7640fc5b39)
2022-11-14 21:02:59 +01:00
Michal Nowak 5bab6f2104 Add shell interpreter line where missing
The checkbashisms script reports errors like this one:

    script util/check-line-length.sh does not appear to have a #! interpreter line;
    you may get strange results

(cherry picked from commit 9e68997cbb)
2022-11-14 21:02:15 +01:00
Mark Andrews d4b064bd65 Merge branch '3468-statistics-xml-rendering-does-not-seem-to-protect-against-concurrent-changes-v9_18' into 'v9_18'
Resolve "Statistics XML rendering does not seem to protect against concurrent changes" [v9_18]

See merge request isc-projects/bind9!7076
2022-11-11 19:08:16 +00:00
Mark Andrews 9e1f36165c Add CHANGES note for [GL #3468]
(cherry picked from commit a4383c906c)
2022-11-11 15:58:37 +00:00
Mark Andrews 1de9c05210 Have dns_zt_apply lock the zone table
There were a number of places where the zone table should have been
locked, but wasn't, when dns_zt_apply was called.

Added a isc_rwlocktype_t type parameter to dns_zt_apply and adjusted
all calls to using it.  Removed locks in callers.

(cherry picked from commit f053d5b414)
2022-11-11 15:57:52 +00:00
Petr Špaček 7835ccd048 Merge branch '3669-update-policy-external-synchronous-doc-v9_18' into 'v9_18'
Document that update-policy external is synchronous [v9_18]

See merge request isc-projects/bind9!7073
2022-11-11 10:15:23 +00:00
Petr Špaček fb6e5c2d28 Document that update-policy external is synchronous
(cherry picked from commit 7d352741a0)
2022-11-11 10:38:17 +01:00
Ondřej Surý 0e0a86d199 Merge branch '3670-bump-statschannel-headers-v9_18' into 'v9_18'
Bump the allowed HTTP headers in statschannel to 100 [v9.18]

See merge request isc-projects/bind9!7071
2022-11-11 09:00:57 +00:00
Ondřej Surý b1d21c0ece Add CHANGES and release note for [GL #3670]
(cherry picked from commit c65666dc97)
2022-11-11 09:25:00 +01:00
Ondřej Surý 9e5299db30 Update the HTTP headers test to check for 101 headers
When we bumped the number of allowed HTTP headers to 100, we forgot to
bump the number in the system test.  Bump the number in the system test
too.
2022-11-11 09:25:00 +01:00
Ondřej Surý 882adbdc20 Bump the allowed HTTP headers in statschannel to 100
Firefox 90+ apparently sends more than 10 headers, so we need to bump
the number to some higher number.  Bump it to 100 just to be on a save
side, this is for internal use only anyway.

(cherry picked from commit e4654d1a6a)
2022-11-11 09:23:47 +01:00
Mark Andrews 59cb6fa575 Merge branch '3630-nextpart-is-not-compatible-with-set-x-v9_18' into 'v9_18'
Resolve "'nextpart' is not compatible with 'set -x'" [v9_18]

See merge request isc-projects/bind9!7060
2022-11-08 17:15:33 +00:00
Mark Andrews bc26438979 Use file descriptor 3 to save file.prev
If 'set -x' is in effect file.prev gets populated with debugging output.
To prevent this open descriptor 3 and redirect stderr from the awk
command to descriptor 3. Debugging output will stay directed to stderr.

(cherry picked from commit 10f67938db)
2022-11-08 16:43:58 +00:00
Tom Krizek 2c66f16f06 Merge branch 'tkrizek/danger-approve-v9_18' into 'v9_18'
ci: add danger checks - approve workflow & wip commits [v9_18]

See merge request isc-projects/bind9!7057
2022-11-08 13:41:23 +00:00
Tom Krizek e15f4aefab Check for cherry pick message in backport commits in danger CI
Using the -x option for cherry pick makes it easy to link commits across
branches and it is recommended to use for all backport commits (with
exceptions -- thus a warning level rather than failure).

(cherry picked from commit 5ecb277090)
2022-11-08 14:38:34 +01:00
Tom Krizek 12e03cb48d Detect work-in-progress commits in danger CI
To avoid accidentally merging unfinished work, detect prohibited
keywords at the start of the subject line. If the first word is any of
the following, fail the check:
WIP, wip, DROP, drop, TODO, todo

The only slightly controversial is the lowercase "drop" which might have
a legitimate use - seems like four commits in the history used it as a
start of a sentence. However, since people commonly use "drop" to
indicate a commit should be dropped before merging, let's prohibit it as
well. In case of false-positive, "Drop" with a capitalized first letter
can always be used.

(cherry picked from commit 402b11431c)
2022-11-08 14:38:34 +01:00
Tom Krizek 9633be904c Use approve button workflow in danger CI
Since the LGTM label was deprecated in favor of using the Approve button
in gitlab, adjust the detection in danger bot.

Unfortunately, danger-python seems no longer maintained since 2020 and
MR approvals aren't available in its Python API (even though they're
supported in its Ruby/JS APIs). Going forward, let's use the more
comprehensive python-gitlab API.

It still makes sense to utilize the danger-python, since it handles the
integration with gitlab which doesn't need to be reimplemented as long
as it works - same with the other checks.

(cherry picked from commit e901342dd9)
2022-11-08 14:38:32 +01:00
Michał Kępień d4bfa75ee1 Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.18.10' into 'v9_18'
Set up version and release notes for BIND 9.18.10

See merge request isc-projects/bind9!7054
2022-11-08 12:30:12 +00:00
Michał Kępień 60c976267e Set up release notes for BIND 9.18.10 2022-11-08 13:23:20 +01:00
Michał Kępień 1f1c012a5f Update BIND version to 9.18.10-dev 2022-11-08 13:23:20 +01:00
Michał Kępień e83150781b Update BIND version for release 2022-11-07 23:16:44 +01:00
Michał Kępień 6b25fe9c13 Add a CHANGES marker 2022-11-07 23:16:44 +01:00
Michał Kępień 342045e9d8 Merge branch 'michal/prepare-documentation-for-bind-9.18.9' into 'v9_18_9-release'
Prepare documentation for BIND 9.18.9

See merge request isc-private/bind9!472
2022-11-07 21:41:36 +00:00
Michał Kępień 2a6be79edf Add release note for GL #3603 2022-11-07 22:33:46 +01:00
Michał Kępień 09d9b70b74 Add release note for GL #3247 2022-11-07 22:33:46 +01:00
Michał Kępień 8d752fbf6b Reorder release notes 2022-11-07 22:33:46 +01:00
Michał Kępień cb5b90c57e Tweak and reword release notes 2022-11-07 22:33:46 +01:00
Michał Kępień 82cbef953b Prepare release notes for BIND 9.18.9 2022-11-07 22:33:46 +01:00
Michał Kępień 3f04105401 Merge branch 'pspacek/doc-known-issues-reshuffle-v9_18' into 'v9_18'
[v9_18] Repeat Known Issues at the top of Release Notes page

See merge request isc-projects/bind9!7042
2022-11-07 13:49:10 +00:00
Petr ŠpačekandMichał Kępień 1275f47907 Repeat Known Issues at the top of Release Notes page
From now on all per-version notes link to the global list
of Known Issues. If there is a new note it should be listed twice:
In the per-version list, and in the global list.

(cherry picked from commit c58dd2790a)
2022-11-07 14:43:40 +01:00
Michał Kępień 641293eb45 Merge branch '3652-reference-manual-update-policies-unmatched-parenthesis-v9_18' into 'v9_18'
[v9_18] Add missing closing ')' to update-policy documentation

See merge request isc-projects/bind9!7038
2022-11-07 12:49:20 +00:00
Mark AndrewsandMichal Nowak 09dab3d924 Add missing closing ')' to update-policy documentation
The opening '(' before local was not being matched by a closing
')' after the closing '};'.

(cherry picked from commit 044c3b2bb8)
2022-11-07 12:23:17 +01:00
Ondřej Surý 4eadc05c67 Merge branch '3643-dont-use-dns_zone_attach-in-zone_refreshkeys-v9_18' into 'v9_18'
Don't use dns_zone_attach() in zone_refreshkeys() [v9.18]

See merge request isc-projects/bind9!7024
2022-11-03 15:14:58 +00:00
Ondřej Surý 21d8d5e07d Don't use dns_zone_attach() in zone_refreshkeys()
The zone_refreshkeys() could run before the zone_shutdown(), but after
the last .erefs has been "detached" causing assertion failure when doing
dns_zone_attach().  Remove the use of .erefs (dns_zone_attach/detach)
and replace it with using the .irefs and additional checks whether the
zone is exiting in the callbacks.

(cherry picked from commit 80e66fbd2d)
2022-11-03 15:22:50 +01:00
Matthijs Mekking 1a47343965 Merge branch '3591-nsec3-crash-dynamic-to-inline-signing-v9_18' into 'v9_18'
[v9_18] Fix crash where dnssec-policy zone with NSEC3 crashes when inline-signing is turned on

See merge request isc-projects/bind9!7020
2022-11-03 11:13:25 +00:00
Matthijs Mekking e4467aa841 Add release note and change for GL #3591
Breaking news.

(cherry picked from commit 1cf2f6fe68)
2022-11-03 11:51:22 +01:00
Matthijs Mekking b12572b4af If a zone is not reusable, trigger full sign
If after a reconfig a zone is not reusable because inline-signing
was turned on/off, trigger a full resign. This is necessary because
otherwise the zone maintenance may decide to only apply the changes
in the journal, leaving the zone in an inconsistent DNSSEC state.

(cherry picked from commit 4d143f2cc4)
2022-11-03 11:43:14 +01:00
Matthijs Mekking 3609dce81d Don't allow DNSSEC records in the raw zone
There was an exception for dnssec-policy that allowed DNSSEC in the
unsigned version of the zone. This however causes a crash if the
zone switches from dynamic to inline-signing in the case of NSEC3,
because we are now trying to add an NSEC3 record to a non-NSEC3 node.
This is because BIND expects none of the records in the unsigned
version of the zone to be NSEC3.

Remove the exception for dnssec-policy when copying non DNSSEC
records, but do allow for DNSKEY as this may be a published DNSKEY
from a different provider.

(cherry picked from commit 332b98ae49)
2022-11-03 11:43:08 +01:00
Matthijs Mekking bb1c40e0a3 Remove checks when going to dnssec-policy none
The changes in the code have the side effect that the CDNSKEY and CDS
records in the secure version of the zone are not reusable and thus
are thrashed from the zone. Remove the apex checks for this use case.
We only care about that the zone is not immediately goes bogus, but
a user really should use the built-in "insecure" policy when unsigning
a zone.

(cherry picked from commit bc703a12e7)
2022-11-03 11:43:02 +01:00
Matthijs Mekking 7a8eb8d035 Add nsec3 system test that transfers in NSEC3
Similar to an attempt to add NSEC through dynamic update, add a test
case that tries to add NSEC3 through zone transfer.

(cherry picked from commit ef1cb9935c)
2022-11-03 11:42:56 +01:00
Matthijs Mekking b9726ad03c Add two more nsec3 system tests
Add one more case that tests reconfiguring a zone to turn off
inline-signing. It should still be a valid DNSSEC zone and the NSEC3
parameters should not change.

Add another test to ensure that you cannot update the zone with a
NSEC3 record.

(cherry picked from commit 4cd8e8e9c3)
2022-11-03 11:42:49 +01:00
Matthijs Mekking 1815a9a4f4 Update kasp system test to work with .signed files
We no longer accept copying DNSSEC records from the raw zone to
the secure zone, so update the kasp system test that relies on this
accordingly.

Also add more debugging and store the dnssec-verify results in a file.

(cherry picked from commit 57ea9e08c6)
2022-11-03 11:42:44 +01:00
Matthijs Mekking 518218e053 Test changing from dynamic to inline-signing
Add a kasp system test that reconfigures a dnssec-policy zone from
maintaining DNSSEC records directly to the zone to using inline-signing.

Add a similar test case to the nsec3 system test, testing the same
thing but now with NSEC3 in use.

(cherry picked from commit 9018fbb205)
2022-11-03 11:42:38 +01:00
Arаm Sаrgsyаn fd77c37820 Merge branch '2895-named-can-create-unrecoverable-managed-keys-v9_18' into 'v9_18'
[v9_18] Don't trust a placeholder KEYDATA record

See merge request isc-projects/bind9!7008
2022-11-01 11:26:24 +00:00
Aram Sargsyan ac25292556 Add CHANGES and release notes for [GL #2895]
(cherry picked from commit 3bf4bc7336)
2022-11-01 10:49:58 +00:00
Aram Sargsyan 4b80324f51 Don't trust a placeholder KEYDATA record
When named starts it creates an empty KEYDATA record in the managed-keys
zone as a placeholder, then schedules a key refresh. If key refresh
fails for some reason (e.g. connectivity problems), named will load the
placeholder key into secroots as a trusted key during the next startup,
which will break the chain of trust, and named will never recover from
that state until managed-keys.bind and managed-keys.bind.jnl files are
manually deleted before (re)starting named again.

Before calling load_secroots(), check that we are not dealing with a
placeholder.

(cherry picked from commit 354ae2d7e3)
2022-11-01 10:49:51 +00:00
Aram Sargsyan 5e26074ce4 Test managed-keys placeholder
Add a dnssec test to make sure that named can correctly process a
managed-keys zone with a placeholder KEYDATA record.

(cherry picked from commit 8c48eabbc1)
2022-11-01 10:49:43 +00:00
Evan Hunt dfcbbdcb6f Merge branch '3617-keyfetch-race-v9_18' into 'v9_18'
Call dns_resolver_createfetch() asynchronously in zone_refreshkeys()

See merge request isc-projects/bind9!7006
2022-11-01 08:44:07 +00:00
Evan Hunt 67f60e5ae4 CHANGES for [GL #3617] 2022-11-01 00:23:05 -07:00
Evan Hunt 28d0c37ef0 Call dns_resolver_createfetch() asynchronously in zone_refreshkeys()
Because dns_resolver_createfetch() locks the view, it was necessary
to unlock the zone in zone_refreshkeys() before calling it in order
to maintain the lock order, and relock afterward. this permitted a race
with dns_zone_synckeyzone().

This commit moves the call to dns_resolver_createfetch() into a separate
function which is called asynchronously after the zone has been
unlocked.

The keyfetch object now attaches to the zone to ensure that
it won't be shut down before the asynchronous call completes.

This necessitated refactoring dns_zone_detach() so it always runs
unlocked. For managed zones it schedules zone_shutdown() to
run asynchronously; for unmanaged zones there is no task.
2022-11-01 00:23:05 -07:00
Ondřej Surý c8ff8108e7 Merge branch '3634-dont-enforce-jemalloc-on-NetBSD-v9_18' into 'v9_18'
Don't enforce jemalloc on NetBSD [v9.18]

See merge request isc-projects/bind9!7005
2022-10-31 15:24:25 +00:00
Ondřej Surý 0cc485faf1 Add CHANGES note for [GL #3634]
(cherry picked from commit fdf1e226fd)
2022-10-31 16:15:32 +01:00
Ondřej Surý a4341b4338 Don't enforce jemalloc on NetBSD
The NetBSD system allocator is in fact based on the jemalloc, but it
doesn't export the extended interface, so we can't use that.  Remove
the jemalloc enforcement for the NetBSD.

(cherry picked from commit feea72414b)
2022-10-31 16:15:11 +01:00
Evan Hunt 82df6b5a55 Merge branch 'each-dupsigs-test-v9_18' into 'v9_18'
make dupsigs test less timing-sensitive

See merge request isc-projects/bind9!7002
2022-10-31 11:27:06 +00:00
Evan Hunt ebacebec15 make dupsigs test less timing-sensitive
the dupsigs test is prone to failing on slow CI machines
because the first test can occur before the zone is fully
signed.

instead of just waiting ten seconds arbitrarily, we now
check every second, and allow up to 30 seconds before giving
up.

(cherry picked from commit d9b85cbaae)
2022-10-31 04:24:37 -07:00
Evan Hunt e65a34e504 Merge branch '3631-fix-zone-maintenance-race-v9_18' into 'v9_18'
fix a potential data race in zone_maintenance()

See merge request isc-projects/bind9!7001
2022-10-31 11:01:14 +00:00
Evan Hunt c7e2fae6de fix a potential data race in zone_maintenance()
zone_maintenance() accessed zone timer information without locking.

(cherry picked from commit f92b946df3)
2022-10-31 03:29:28 -07:00
Tom Krizek eae3d11cee Merge branch '3503-random-default-algorithm-in-tests-v9_18' into 'v9_18'
Random selection of DEFAULT_ALGORITHM in system tests at runtime [v9_18]

See merge request isc-projects/bind9!6992
2022-10-27 11:26:28 +00:00
Tom Krizek 05a1a0e7b5 Randomize algorithm selection for mkeys test
Use the ALGORITHM_SET option to use randomly selected default algorithm
in this test. Make sure the test works by using variables instead of
hard-coding values.

(cherry picked from commit f65f276f98)
2022-10-27 13:24:52 +02:00
Tom Krizek e3b5521845 Set algorithms for system tests at runtime
Use the get_algorithms.py script to detect supported algorithms and
select random algorithms to use for the tests.

Make sure to load common.conf.sh after KEYGEN env var is exported.

(cherry picked from commit 69b608ee9f)
2022-10-27 13:24:52 +02:00
Tom Krizek 550c0e8964 Script for random algorithm selection in system tests
Multiple algorithm sets can be defined in this script. These can be
selected via the ALGORITHM_SET environment variable. For compatibility
reasons, "stable" set contains the currently used algorithms, since our
system tests need some changes before being compatible with randomly
selected algorithms.

The script operation is similar to the get_ports.py - environment
variables are created and then printed out as `export NAME=VALUE`
commands, to be interpreted by shell. Once we support pytest runner for
system tests, this should be a fixture instead.

(cherry picked from commit 5f480c8485)
2022-10-27 13:24:52 +02:00
Tom Krizek 01b4a28d59 Export env variables in system tests
Certain variables have to be exported in order for the system tests to
work. It makes little sense to export the variables in one place/script
while they're defined in another place.

Since it makes no harm, export all the variables to make the behaviour
more predictable and consistent. Previously, some variables were
exported as environment variables, while others were just shell
variables which could be used once the configuration was sourced from
another script. However, they wouldn't be exposed to spawned processes.

For simplicity sake (and for the upcoming effort to run system tests
with pytest), export all variables that are used. TESTS, PARALLEL_UNIX
and SUBDIRS variables are automake-specific, aren't used anywhere else
and thus not exported.

(cherry picked from commit 37d14c69c0)
2022-10-27 13:24:52 +02:00
Tom Krizek 2843d32d00 Support testcrypto.sh usage without including conf.sh
The only variable really needed for the script to work is the path to
the $KEYGEN binary. Allow setting this via an environment variable to
avoid loading conf.sh (and causing a chicken-egg problem). Also make
testcrypto.sh executable to allow its use from conf.sh.

(cherry picked from commit bb1c6bbdc7)
2022-10-27 13:24:52 +02:00
Tom Krizek 798f969043 Unify indentation level in testcrypto.sh
(cherry picked from commit 01b293b055)
2022-10-27 13:24:50 +02:00
Matthijs Mekking e891053c31 Merge branch '3627-inheritance-bug-remote-server-port-v9_18' into 'v9_18'
[v9_18] Fix inheritance bug when setting port in remote server configuration

See merge request isc-projects/bind9!6993
2022-10-27 10:53:24 +00:00
Matthijs Mekking 2655ee4902 Add release note and change entry for [GL #3627]
(cherry picked from commit 5585256bf6)
2022-10-27 12:18:27 +02:00
Matthijs Mekking 9a05448f13 Fix config bug related to port setting
There are three levels there for the port value, with increasing
priority:

1. The default ports, defined by 'port' and 'tls-port' config options.
2. The primaries-level default port: primaries port <number>  { ... };
3. The primaries element-level port: primaries { <address> port
   <number>; ... };"

In 'named_config_getipandkeylist()', the 'def_port' and 'def_tlsport'
variables are extracted from level 1. The 'port' variable is extracted
from the level 2. Currently if that is unset, it defaults to the
default port ('def_port' or 'def_tlsport' depending on the transport
used), but overrides the level 2 port setting for the next primaries in
the list.

Update the code such that we inherit the port only if the level 3 port
is not set, and inherit from the default ports if the level 2 port is
also not set.

(cherry picked from commit 72d3bf8e4e)
2022-10-27 12:18:18 +02:00
Matthijs Mekking bf6961c551 Add xfer system test case
Add a test case that if the first primary fails, the fallback of a
second primary on plain DNS works. This is mainly to test that the port
configuration inheritance works correctly.

(cherry picked from commit 622a499027)
2022-10-27 12:18:12 +02:00
Tom Krizek 222a1fc4eb Merge branch '3517-serve-stale-cache-timeout-0-test-v9_18' into 'v9_18'
[v9_18] [CVE-2022-3080] Test serve stale cache with timeout 0 and CNAME

See merge request isc-projects/bind9!6976
2022-10-24 13:00:50 +00:00
Tom Krizek 9a159fc4c4 Remove misleading comment from serve-stale test
The stale-answer-client-timeout option is not set to 0 in the config
neither is it the default value. This was probably caused by a
copy-paste error.
2022-10-24 14:30:43 +02:00
Tom Krizek 3a9ae0249d Test serve stale cache with timeout 0 and CNAME
Add a couple of tests that verify the serve-stale behavior when
stale-answer-client-timeout is set to 0 and a (stale) CNAME record is
queried.

Related #3517
2022-10-24 14:30:41 +02:00
Michał Kępień b272185c38 Merge branch 'michal/bump-sphinx-version-to-5.3.0-v9_18' into 'v9_18'
[v9_18] Bump Sphinx version to 5.3.0

See merge request isc-projects/bind9!6973
2022-10-24 09:57:41 +00:00
Michał Kępień da0cd8c6db Bump Sphinx version to 5.3.0
Make the Sphinx version listed in doc/arm/requirements.txt match the
version currently used in GitLab CI, so that Read the Docs builds the
documentation using the same Python software versions as those used in
GitLab CI.

(cherry picked from commit a8f0ab7df6)
2022-10-24 11:45:11 +02:00
Arаm Sаrgsyаn 65467dfcff Merge branch '3603-resolver-prefetch-eligibility-edge-case-bug-v9_18' into 'v9_18'
[v9_18] Synchronize prefetch "trigger" and "eligibility" code and documentation

See merge request isc-projects/bind9!6969
2022-10-21 11:29:08 +00:00
Aram Sargsyan 840cad93c7 Getting the "prefetch" setting from the configuration cannot fail
The "prefetch" setting is in "defaultconf" so it cannot fail, use
INSIST to confirm that.

The 'trigger' and 'eligible' variables are now prefixed with
'prefetch_' and their declaration moved to an upper level, because
there is no more additional code block after this change.

(cherry picked from commit 0227565cf1)
2022-10-21 10:22:51 +00:00
Aram Sargsyan 6d64f9e4ec Fix prefetch "trigger" value's documentation in ARM
For the prefetch "trigger" parameter ARM states that when a cache
record with a lower TTL value is encountered during query processing,
it is refreshed. But in reality, the record is refreshed when the TTL
value is lower or equal to the configured "trigger" value.

Fix the documentation to make it match with with the code.

(cherry picked from commit ef344b1f52)
2022-10-21 10:22:44 +00:00
Aram Sargsyan b7149536ee Add a CHANGES note for [GL #3603]
(cherry picked from commit 041ffac0d7)
2022-10-21 10:22:37 +00:00
Aram Sargsyan bb9cc81dd4 Match prefetch eligibility behavior with ARM
ARM states that the "eligibility" TTL is the smallest original TTL
value that is accepted for a record to be eligible for prefetching,
but the code, which implements the condition doesn't behave in that
manner for the edge case when the TTL is equal to the configured
eligibility value.

Fix the code to check that the TTL is greater than, or equal to the
configured eligibility value, instead of just greater than it.

(cherry picked from commit 863f51466e)
2022-10-21 10:22:29 +00:00
Aram Sargsyan 9000b43d46 Add another prefetch check in the resolver system test
The test triggers a prefetch, but fails to check if it acutally
happened, which prevented it from catching a bug when the record's
TTL value matches the configured prefetch eligibility value.

Check that prefetch happened by comparing the TTL values.

(cherry picked from commit 89fa9a6592)
2022-10-21 10:22:23 +00:00
Arаm Sаrgsyаn ccbd389ed2 Merge branch '3598-adb-quota-might-not-be-decremented-v9_18' into 'v9_18'
[v9_18] Resolve "ADB quota might not be decremented"

See merge request isc-projects/bind9!6967
2022-10-21 10:09:09 +00:00
Aram Sargsyan 192373a26e Add CHANGES and release notes for [GL #3598]
(cherry picked from commit 6f50972e5f)
2022-10-21 09:04:51 +00:00
Aram Sargsyan 64feeba60f Call dns_adb_endudpfetch() on error path, if required
For UDP queries, after calling dns_adb_beginudpfetch() in fctx_query(),
make sure that dns_adb_endudpfetch() is also called on error path, in
order to adjust the quota back.

(cherry picked from commit 5da79e2be0)
2022-10-21 08:36:34 +00:00
Aram Sargsyan a83a58467d Always call dns_adb_endudpfetch() in fctx_cancelquery() for UDP queries
It is currently possible that dns_adb_endudpfetch() is not
called in fctx_cancelquery() for a UDP query, which results
in quotas not being adjusted back.

Always call dns_adb_endudpfetch() for UDP queries.

(cherry picked from commit e4569373ca)
2022-10-21 08:36:34 +00:00
Aram Sargsyan 4a311b9bb4 Unlink the query under cleanup_query
In the cleanup code of fctx_query() function there is a code path
where 'query' is linked to 'fctx' and it is being destroyed.

Make sure that 'query' is unlinked before destroying it.

(cherry picked from commit ac889684c7)
2022-10-21 08:36:34 +00:00
Ondřej Surý b55f4068ff Merge branch '3270-use-curl-in-statschannel-system-test-v9_18' into 'v9_18'
Replace some raw nc usage in statschannel system test with curl [v9.18]

See merge request isc-projects/bind9!6966
2022-10-20 16:28:29 +00:00
Ondřej Surý a06bd51bd7 Replace some raw nc usage in statschannel system test with curl
For tests where the TCP connection might get interrupted abruptly,
replace the nc with curl as the data sent from server to client might
get lost because of abrupt TCP connection.  This happens when the TCP
connection gets closed during sending the large request to the server.

As we already require curl for other system tests, replace the nc usage
in the statschannel test with curl that actually understands the
HTTP/1.1 protocol, so the same connection is reused for sending the
consequtive requests, but without client-side "pipelining".

For the record, the server doesn't support parallel processing of the
pipelined request, so it's a bit misnomer here, because what we are
actually testing is that we process all requests received in a single
TCP read callback.

(cherry picked from commit cd0e5c5784)
2022-10-20 18:06:48 +02:00
Ondřej Surý ce4528940b Merge branch '3270-serialize-statschannel-http-requests-v9_18' into 'v9_18'
Serialize the HTTP/1.1 statschannel requests [v9.18]

See merge request isc-projects/bind9!6965
2022-10-20 15:57:53 +00:00
Ondřej Surý 9274876dec Serialize the HTTP/1.1 statschannel requests
The statschannel truncated test still terminates abruptly sometimes and
it doesn't return the answer for the first query.  This might happen
when the second process_request() discovers there's not enough space
before the sending is complete and the connection is terminated before
the client gets the data.

Change the isc_http, so it pauses the reading when it receives the data
and resumes it only after the sending has completed or there's
incomplete request waiting for more data.

This makes the request processing slightly less efficient, but also less
taxing for the server, because previously all requests that has been
received via single TCP read would be processed in the loop and the
sends would be queued after the read callback has processed a full
buffer.

(cherry picked from commit 13959781cb)
2022-10-20 17:23:36 +02:00
Ondřej Surý f3847437b2 Merge branch 'ondrej-refactor-isc_httpd-v9_18' into 'v9_18'
Rewrite isc_httpd using picohttpparser and isc_url_parse [v9.18]

See merge request isc-projects/bind9!6964
2022-10-20 15:14:45 +00:00
Ondřej Surý da1e7a7ba2 Replace the statschannel truncated tests with two new tests
Now that the artificial limit on the recv buffer has been removed, the
current system test always fails because it tests if the truncation has
happened.

Add test that sending more than 10 headers makes the connection to
closed; and add test that sending huge HTTP request makes the connection
to be closed.

(cherry picked from commit cad2706cce)
2022-10-20 16:13:10 +02:00
Ondřej Surý 067502a16e Rewrite isc_httpd using picohttpparser and isc_url_parse
Rewrite the isc_httpd to be more robust.

1. Replace the hand-crafted HTTP request parser with picohttpparser for
   parsing the whole HTTP/1.0 and HTTP/1.1 requests.  Limit the number
   of allowed headers to 10 (arbitrary number).

2. Replace the hand-crafted URL parser with isc_url_parse for parsing
   the URL from the HTTP request.

3. Increase the receive buffer to match the isc_netmgr buffers, so we
   can at least receive two full isc_nm_read()s.  This makes the
   truncation processing much simpler.

4. Process the received buffer from single isc_nm_read() in a single
   loop and schedule the sends to be independent of each other.

The first two changes makes the code simpler and rely on already
existing libraries that we already had (isc_url based on nodejs) or are
used elsewhere (picohttpparser).

The second two changes remove the artificial "truncation" limit on
parsing multiple request.  Now only a request that has too many
headers (currently 10) or is too big (so, the receive buffer fills up
without reaching end of the request) will end the connection.

We can be benevolent here with the limites, because the statschannel
channel is by definition private and access must be allowed only to
administrators of the server.  There are no timers, no rate-limiting, no
upper limit on the number of requests that can be served, etc.

(cherry picked from commit beecde7120)
2022-10-20 16:10:21 +02:00
Ondřej Surý 944ddd0fb2 Add picohttpparser.{c.h} from https://github.com/h2o/picohttpparser
PicoHTTPParser is a tiny, primitive, fast HTTP request/response parser.

Unlike most parsers, it is stateless and does not allocate memory by
itself. All it does is accept pointer to buffer and the output
structure, and setups the pointers in the latter to point at the
necessary portions of the buffer.

(cherry picked from commit 3a8884f024)
2022-10-20 15:49:27 +02:00
Artem Boldariev 8e6721fe9e Merge branch '3563-fix-named-startup-on-manycore-solaris-systems-v9-18' into 'v9_18'
[Backport to v9.18] Fix named failing to start on Solaris systems with hundreds of CPUs

See merge request isc-projects/bind9!6962
2022-10-20 13:14:46 +00:00
Artem Boldariev c3ce67f994 Modify release notes [GL #3563]
Mention that a startup problem on manycore Solaris systems is fixed.

(cherry picked from commit 2c9400f116)
2022-10-20 15:15:52 +03:00
Artem Boldariev acb431b5c3 Modify CHANGES [GL #3563]
Mention that a startup problem on manycore Solaris systems is fixed.

(cherry picked from commit 03ee132e28)
2022-10-20 15:15:51 +03:00
Artem Boldariev 43c8e8b9d6 Fix named failing to start on Solaris systems with hundreds of CPUs
This commit fixes a startup issue on Solaris systems with
many (reportedly > 510) CPUs by bumping RLIMIT_NOFILE. This appears to
be a regression from 9.11.

(cherry picked from commit fff01fe7eb)
2022-10-20 15:15:10 +03:00
Michal Nowak d11843bdfc Merge tag 'v9_18_8' into v9_18
BIND 9.18.8
2022-10-20 11:47:43 +02:00
Matthijs Mekking be33035f26 Merge branch 'matthijs-fix-dnssec-signing-log-lovel-v9_18' into 'v9_18'
[v9_18] Change log level when doing rekey

See merge request isc-projects/bind9!6939
2022-10-20 08:20:49 +00:00
Matthijs Mekking 6af9d0088b Change log level when doing rekey
This log happens when BIND checks the parental-agents if the DS has
been published. But if you don't have parental-agents set up, the list
of keys to check will be empty and the result will be ISC_R_NOTFOUND.
This is not an error, so change the log level to debug in this case.

(cherry picked from commit a1d57fc8cb)
2022-10-20 10:20:14 +02:00
Evan Hunt 8138ab4611 Merge branch '3247-rpz-ip-cd-v9_18' into 'v9_18'
ensure RPZ lookups handle CD=1 correctly

See merge request isc-projects/bind9!6957
2022-10-19 20:38:34 +00:00
Evan Hunt 777aa045fc CHANGES for [GL #3247]
(cherry picked from commit 3676f6394b)
2022-10-19 13:12:52 -07:00
Evan Hunt 5c44d63979 add a test with CD=1 query for pending data
this is a regression test for [GL #3247].

(cherry picked from commit 575a924b1a)
2022-10-19 13:12:32 -07:00
Evan Hunt 2cc8874c90 ensure RPZ lookups handle CD=1 correctly
RPZ rewrites called dns_db_findext() without passing through the
client database options; as as result, if the client set CD=1,
DNS_DBFIND_PENDINGOK was not used as it should have been, and
cache lookups failed, resulting in failure of the rewrite.

(cherry picked from commit 305a50dbe1)
2022-10-19 13:12:31 -07:00
Tom Krizek ff5823fa12 Merge branch 'tkrizek/system-tests-fixes-v9_18' into 'v9_18'
Update various system tests and add them to default test suite [v9_18]

See merge request isc-projects/bind9!6949
2022-10-19 14:58:13 +00:00
Tom Krizek ba7ea2dfac Remove generated controls.conf file from system tests
The controls.conf file shouldn't be used directly without templating it
first. Remove this no longer used hard-coded file to avoid confusion.

(cherry picked from commit cbd0355328)
2022-10-19 15:32:46 +02:00
Tom Krizek 5db5f20985 Revive dupsigs system test
Correctly source conf.sh in dupsigs test scripts (fix issue introduced
by 093af1c00a).

Update dupsigs test for dnssec-dnskey-kskonly default. Since v9.17.20,
the dnssec-dnskey-kskonly is set to yes. Update the test to not expect
the additional RRSIG with ZSK for DNSKEY.

Speed up the test from 20 minutes to 2.5 minutes and make it part of the
default test suite executed in CI.
- decrease number of records to sign from 2000 to 500
- decrease the signing interval by a factor of 6
- shorten the final part of the test after last signing (since nothing
  new happens there)

Finally, clarify misleading comments about (in)sufficient time for zone
re-signing. The time used in the test is in fact sufficient for the
re-signing to happen. If it wasn't, the previous ZSK would end up being
deleted while its signatures would still be present, which is a
situation where duplicate signatures can still happen.

(cherry picked from commit cb0a2ae1dd)
2022-10-19 15:32:44 +02:00
Tom Krizek ef0eadf864 Revive the stress system test
Ensure the port numbers are dynamically filled in with copy_setports.

Clarify test fail condition.

Make the stress test part of the default test suite since it doesn't
seem to run too long or interfere with other tests any more (the
original note claiming so is more than 20 years old).

Related !6883

(cherry picked from commit 7495deea3e)
2022-10-19 15:32:44 +02:00
Tom Krizek bd8262dc35 Revive dialup system test
Properly template the port number in config files with copy_setports.

The test takes two minutes on my machine which doesn't seem like a
proper justification to exclude it from the test suite, especially
considering we run these tests in parallel nowadays. The resource usage
doesn't seems significantly increased so it shouldn't interfere with
other system tests.

There also exists a precedent for longer running system tests that are
already part of the default system test suite (e.g. serve-stale takes
almost three minutes on the same machine).

(cherry picked from commit 235ae5f344)
2022-10-19 15:32:44 +02:00
Tom Krizek 25d2d7e46e Make digdelv test work in different network envs
When a target server is unreachable, the varying network conditions may
cause different ICMP message (or no message). The host unreachable
message was discovered when attempting to run the test locally while
connected to a VPN network which handles all traffic.

Extend the dig output check with "host unreachable" message to avoid a
false negative test result in certain network environments.

(cherry picked from commit 1e7d832342)
2022-10-19 15:32:44 +02:00
Ondřej Surý 10a43eba02 Merge branch '3270-remove-time-requirement-for-statschannel-truncated-test-v9_18' into 'v9_18'
Remove the time requirement for the statschannel truncated test [v9.18]

See merge request isc-projects/bind9!6953
2022-10-19 13:31:23 +00:00
Ondřej Surý 6261ada8c2 Remove the time requirement for the statschannel truncated test
The 5 seconds requirement to finish the 'pipelined with truncated
stream' was causing spurious failures in the CI because the job runners
might be very busy and sending 128k of data might simply take some time.

Remove the time requirement altogether, there's actually no reason why
the test SHOULD or even MUST finish under 5 seconds.

(cherry picked from commit 0f56a53d66)
2022-10-19 15:30:44 +02:00
Michal Nowak 6a3d92a98c Merge branch '3394-cve-2022-2795-test-v9_18' into 'v9_18'
[v9_18] Add tests for CVE-2022-2795

See merge request isc-projects/bind9!6948
2022-10-19 13:05:22 +00:00
Michał KępieńandMichal Nowak 9c2714e27f Add tests for CVE-2022-2795
Add a test ensuring that the amount of work fctx_getaddresses() performs
for any encountered delegation is limited: delegate example.net to a set
of 1,000 name servers in the redirect.com zone, the names of which all
resolve to IP addresses that nothing listens on, and query for a name in
the example.net domain, checking the number of times the findname()
function gets executed in the process; fail if that count is excessively
large.

Since the size of the referral response sent by ans3 is about 20 kB, it
cannot be sent back over UDP (EMSGSIZE) on some operating systems in
their default configuration (e.g. FreeBSD - see the
net.inet.udp.maxdgram sysctl).  To enable reliable reproduction of
CVE-2022-2795 (retry patterns vary across BIND 9 versions) and avoid
false positives at the same time (thread scheduling - and therefore the
number of fetch context restarts - vary across operating systems and
across test runs), extend bin/tests/system/resolver/ans3/ans.pl so that
it also listens on TCP and make "ns1" in the "resolver" system test
always use TCP when communicating with "ans3".

Also add a test (foo.bar.sub.tld1/TXT) that ensures the new limitations
imposed on the resolution process by the mitigation for CVE-2022-2795 do
not prevent valid, glueless delegation chains from working properly.

(cherry picked from commit 604d8f0b96)
2022-10-19 12:36:20 +02:00
Michal Nowak 09ea1f9b3b Merge branch '3493-compression-buffer-reuse-test-v9_18' into 'v9_18'
[CVE-2022-2881] test for growth of compressed pipelined responses

See merge request isc-projects/bind9!6941
2022-10-19 08:19:06 +00:00
Evan HuntandMichal Nowak b42dfd01f1 test for growth of compressed pipelined responses
add a test to compare the Content-Length of successive compressed
messages on a single HTTP connection that should contain the same
data; fail if the size grows by more than 100 bytes from one query
to the next.

(cherry picked from commit 3c11fafadf)
2022-10-18 17:28:45 +02:00
Artem Boldariev 49c8d04c65 Merge branch 'artem-sync-multilayer-stoplistening-v9-18' into 'v9_18'
Backport to v9.18] Synchronise stop listening operation for multi-layer transports

See merge request isc-projects/bind9!6932
2022-10-18 14:24:24 +00:00
Artem Boldariev a6f14565b4 TLS Stream: handle successful TLS handshake after listener shutdown
It was possible that accept callback can be called after listener
shutdown. In such a case the callback pointer equals NULL, leading to
segmentation fault. This commit fixes that.
2022-10-18 16:40:08 +03:00
Artem Boldariev c62994e6a4 Synchronise stop listening operation for multi-layer transports
This commit introduces a primitive isc__nmsocket_stop() which performs
shutting down on a multilayered socket ensuring the proper order of
the operations.

The shared data within the socket object can be destroyed after the
call completed, as it is guaranteed to not be used from within the
context of other worker threads.

(cherry picked from commit 5ab2c0ebb3)
2022-10-18 16:40:08 +03:00
Petr Špaček 7a992cb948 Merge branch 'pspacek/ci-no-developer-mode-v9_18' into 'v9_18'
Add CI job with --disable-developer [v9_18]

See merge request isc-projects/bind9!6931
2022-10-18 13:15:49 +00:00
Petr Špaček 9a132f9e2b Allow system tests to run under root user when inside CI
https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
says variable CI_SERVER="yes" is available in all versions of Gitlab.

(cherry picked from commit ddf46056ca)
2022-10-18 15:14:54 +02:00
Petr Špaček 4f4556941c Build gcc:oraclelinux9:amd64 CI jobs with --disable-developer
Purpose of this is to guard against tests which rely on querytrace or
other optional features enabled by --enable-developer switch.

(cherry picked from commit d6db5c5335)
2022-10-18 15:14:54 +02:00
Ondřej Surý bc1acfdccb Merge branch 'ondrej-add-ISC_LIST,LINK_INITIALIZER-v9_18' into 'v9_18'
Add ISC_{LIST,LINK}_INITIALIZER for designated initializers [v9.18]

See merge request isc-projects/bind9!6934
2022-10-18 12:56:42 +00:00
Ondřej Surý 6525ebc777 Replace (void *)-1 with ISC_LINK_TOMBSTONE
Instead of having "arbitrary" (void *)-1 to define non-linked, add a
ISC_LINK_TOMBSTONE(type) macro that replaces the "magic" value with a
define.

(cherry picked from commit 5e20c2ccfb)
2022-10-18 14:30:43 +02:00
Ondřej Surý 8efe60d423 Add ISC_{LIST,LINK}_INITIALIZER for designated initializers
Since we are using designated initializers, we were missing initializers
for ISC_LIST and ISC_LINK, add them, so you can do

    *foo = (foo_t){ .list = ISC_LIST_INITIALIZER };

Instead of:

    *foo = (foo_t){ 0 };
    ISC_LIST_INIT(foo->list);

(cherry picked from commit cb3c36b8bf)
2022-10-18 14:30:43 +02:00
Arаm Sаrgsyаn c6270cefb2 Merge branch '3584-ns_statscounter_recursclients-bug-v9_18' into 'v9_18'
[v9_18] Fix ns_statscounter_recursclients counting bug

See merge request isc-projects/bind9!6876
2022-10-18 10:36:55 +00:00
Aram Sargsyan d83642b3ac Add a release note for [GL #3584] 2022-10-18 08:54:20 +00:00
Aram Sargsyan 5b1ef41897 Add a CHANGES note for [GL #3584] 2022-10-18 08:54:11 +00:00
Aram Sargsyan 82991451b4 Fix ns_statscounter_recursclients counting bug
The incrementing and decrementing of 'ns_statscounter_recursclients'
were not properly balanced: for example, it would be incremented for
a prefetch query but not decremented if the query failed.

This commit ensures that the recursion quota and the recursive clients
counter are always in sync with each other.
2022-10-18 08:54:04 +00:00
Petr Špaček 954ce9fcff Merge branch 'pspacek/doc-nsupdate-server-gsstsig-v9_18' into 'v9_18'
Document that nsupdate ignores server command in GSS-TSIG mode [v9_18]

See merge request isc-projects/bind9!6925
2022-10-18 08:17:15 +00:00
Petr Špaček dbb7856038 Document that nsupdate ignores server command in GSS-TSIG mode
This behavior is present since introduction of GSS-TSIG support,
commit 289ae548d5.

(cherry picked from commit c8a38d70f0)
2022-10-18 10:13:30 +02:00
Tony Finch 684b5e536d Merge branch 'fanf-deduplicate-file-line-v9_18' into 'v9_18'
De-duplicate __FILE__, __LINE__ plus some error reporting cleanup (backport to v9_18)

See merge request isc-projects/bind9!6922
2022-10-17 17:27:04 +00:00
Tony Finch 6adb0c32ea CHANGES for [GL !6914]
[cleanup]	Less ceremonial UNEXPECTED_ERROR() and FATAL_ERROR()
		reporting macros. [GL !6914]

(cherry picked from commit 2ffb582d2c)
2022-10-17 16:08:28 +01:00
Tony FinchandTony Finch b48c73d802 Remove redundant #include <isc/strerr.h>
Most uses are now internal to <isc/util.h>
2022-10-17 16:08:28 +01:00
Tony Finch 96b6bae5bc Include the function name when reporting unexpected errors
I.e. print the name of the function in BIND that called the system
function that returned an error. Since it was useful for pthreads
code, it seems worthwhile doing so everywhere.

(cherry picked from commit 26ed03a61e)
2022-10-17 16:00:27 +01:00
Tony Finch 8dfc078ea3 De-duplicate some calls to strerror_r()
Specifically, when reporting an unexpected or fatal error.

(cherry picked from commit a34a2784b1)
2022-10-17 16:00:27 +01:00
Tony Finch f273fdfc12 De-duplicate __FILE__, __LINE__
Mostly generated automatically with the following semantic patch,
except where coccinelle was confused by #ifdef in lib/isc/net.c

@@ expression list args; @@
- UNEXPECTED_ERROR(__FILE__, __LINE__, args)
+ UNEXPECTED_ERROR(args)
@@ expression list args; @@
- FATAL_ERROR(__FILE__, __LINE__, args)
+ FATAL_ERROR(args)

(cherry picked from commit ec50c58f52)
2022-10-17 16:00:26 +01:00
Arаm Sаrgsyаn 79a7fb6cb5 Merge branch 'aram/cfg_print_duration-uninitialized-length-v9_18' into 'v9_18'
[v9_18] Fix a logical bug in cfg_print_duration()

See merge request isc-projects/bind9!6920
2022-10-17 09:56:59 +00:00
Aram Sargsyan 24aa154b67 Handle large numbers when parsing/printing a duration
The isccfg_duration_fromtext() function is truncating large numbers
to 32 bits instead of capping or rejecting them, i.e. 64424509445,
which is 0xf00000005, gets parsed as 32-bit value 5 (0x00000005).

Fail parsing a duration if any of its components is bigger than
32 bits. Using those kind of big numbers has no practical use case
for a duration.

The isccfg_duration_toseconds() function can overflow the 32 bit
seconds variable when calculating the duration from its component
parts.

To avoid that, use 64-bit calculation and return UINT32_MAX if the
calculated value is bigger than UINT32_MAX. Again, a number this big
has no practical use case anyway.

The buffer for the generated duration string is limited to 64 bytes,
which, in theory, is smaller than the longest possible generated
duration string.

Use 80 bytes instead, calculated by the '7 x (10 + 1) + 3' formula,
where '7' is the count of the duration's parts (year, month, etc.), '10'
is their maximum length when printed as a decimal number, '1' is their
indicator character (Y, M, etc.), and 3 is two more indicators (P and T)
and the terminating NUL character.

(cherry picked from commit fddaebb285)
2022-10-17 08:54:10 +00:00
Aram Sargsyan 9a318fbc1e Add a CHANGES note for [GL !6880]
(cherry picked from commit 190aab84d7)
2022-10-17 08:53:49 +00:00
Aram Sargsyan e3fa77f577 Fix an off-by-one error in cfg_print_duration()
The cfg_print_duration() checks added previously in the 'duration_test'
unit test uncovered a bug in cfg_print_duration().

When calculating the current 'str' pointer of the generated text in the
buffer 'buf', it erroneously adds 1 byte to compensate for that part's
indicator character. For example, to add 12 minutes, it needs to add
2 + 1 = 3 characters, where 2 is the length of "12", and 1 is the length
of "M" (for minute). The mistake was that the length of the indicator
is already included in 'durationlen[i]', so there is no need to
calculate it again.

In the result of this mistake the current pointer can advance further
than needed and end up after the zero-byte instead of right on it, which
essentially cuts off any further generated text. For example, for a
5 minutes and 30 seconds duration, instead of having this:

    'P', 'T', '5', 'M', '3', '0', 'S', '\0'

The function generates this:

    'P', 'T', '5', 'M', '\0', '3', '0', 'S', '\0'

Fix the bug by adding to 'str' just 'durationlen[i]' instead of
'durationlen[i] + 1'.

(cherry picked from commit dc55f1ebb9)
2022-10-17 08:52:33 +00:00
Aram Sargsyan 98481e0a0a Test cfg_print_duration() in duration_test.c
Currently the 'duration_test' unit test checks only the
cfg_obj_asduration() function.

Extend the test so it checks also the reverse operation using the
cfg_print_duration() function, which is used in named-checkconf.

(cherry picked from commit 39290bb7cd)
2022-10-17 08:52:26 +00:00
Aram Sargsyan b6978ccbe3 Fix a logical bug in cfg_print_duration()
The cfg_print_duration() function prints a ISO 8601 duration value
converted from an array of integers, where the parts of the date and
time are stored.

durationlen[6], which holds the "seconds" part of the duration, has
a special case in cfg_print_duration() to ensure that when there are
no values in the duration, the result still can be printed as "PT0S",
instead of just "P", so it can be a valid ISO 8601 duration value.

There is a logical error in one of the two special case code paths,
when it checks that no value from the "date" part is defined, and no
"hour" or "minute" from the "time" part are defined.

Because of the error, durationlen[6] can be used uninitialized, in
which case the second parameter passed to snprintf() (which is the
maximum allowed length) can contain a garbage value.

This can not be exploited because the buffer is still big enough to
hold the maximum possible amount of characters generated by the "%u%c"
format string.

Fix the logical bug, and initialize the 'durationlen' array to zeros
to be a little safer from other similar errors.

(cherry picked from commit 9440910187)
2022-10-17 08:52:20 +00:00
Ondřej Surý e33fdd5c05 Merge branch 'mnowak/fix-grep-3.8-warnings-v9_18' into 'v9_18'
Fix GNU Grep 3.8 warnings [v9_18]

See merge request isc-projects/bind9!6918
2022-10-17 07:56:21 +00:00
Michal NowakandOndřej Surý 1751a9e191 Add CI check for Grep warnings
(cherry picked from commit 759e8a6671)
2022-10-17 09:10:29 +02:00
Michal NowakandOndřej Surý a7e2cc5dec Replace fgrep and egrep with grep -F/-E
GNU Grep 3.8 reports the following warnings:

    egrep: warning: egrep is obsolescent; using grep -E
    fgrep: warning: fgrep is obsolescent; using grep -F

(cherry picked from commit 212c4de043)
2022-10-17 09:10:29 +02:00
Michal NowakandOndřej Surý 55a866355b Remove stray backslashes
GNU Grep 3.8 reports several instances of stray backslashes in matching
patterns:

    grep: warning: stray \ before /
    grep: warning: stray \ before :

(cherry picked from commit 65e91ef5e6)
2022-10-17 09:10:29 +02:00
Tom Krizek da566ca54c Merge branch 'tkrizek/remove-system-test-delzone-v9_18' into 'v9_18'
Remove system test delzone [v9_18]

See merge request isc-projects/bind9!6911
2022-10-14 15:16:34 +00:00
Tom Krizek cfbd7431cd Remove system test delzone
There are multiple reasons to remove this test as obsolete:

- The test may not possibly work for over 2.5 years, since
  98b3b93791 removed the rndc.py python
  tool on which this test relies.
- It isn't part of the test suite either in CI or locally unless it is
  explicitly enabled. As a result, there are many issues which prevent
  the test from being executed caused by various refactoring efforts
  accumulated over time.
- Even if the test could be executed, it has no clear failure condition.
  If the python script(s) fail, the test still passes.

(cherry picked from commit 05180154d9)
2022-10-14 16:40:40 +02:00
Ondřej Surý 50ec8de8eb Merge branch 'artem-doth-reduce-listener-sockets-number-v9_18' into 'v9_18'
doth system test - decrease HTTP listener quota size

See merge request isc-projects/bind9!6900
2022-10-13 06:00:09 +00:00
Artem BoldarievandOndřej Surý 5656f681bd doth system test: increase transfers-in/out limits
Sometimes doth test could intermittently fail shortly after start due
to inability to complete a zone transfer in time. As it turned out, it
could happen due to transfers-in/out limits. Initially the defaults
were fine, but over time, especially when adding Strict/Mutual TLS, we
added more than 10 zones so it became possible to hit the limits.

This commit takes care of that by bumping the limits.

(cherry picked from commit 95a551de7b)
2022-10-13 07:39:07 +02:00
Artem BoldarievandOndřej Surý adcdbcd097 doth system test - decrease HTTP listener quota size
This commit reduces the size of HTTP listener quota from 300 (default)
to 100 so that it would make hitting any global limits in case of
running multiple tests in parallel in multiple containers unlikely.

This way the need in opening many file descriptors of different
kinds (e.g. client side connections and pipes) gets significantly
reduced while the required code paths are still verified.

(cherry picked from commit 354494cd10)
2022-10-13 07:39:07 +02:00
Artem Boldariev 064af66a0f Merge branch 'artem-clear-ssl-error-queue-for-dns-transports-v9-18' into 'v9_18'
[Backport to v9.18] TLS: clear error queue before doing IO or calling SSL_get_error()

See merge request isc-projects/bind9!6896
2022-10-12 14:53:22 +00:00
Artem Boldariev 15b7605e72 TLS DNS: fix certificate verification error message reporting
This commit fixes TLS DNS verification error message reporting which
we probably broke during one of the recent networking code
refactorings.

This prevent e.g. dig from producing useful error messages related to
TLS certificates verification.
2022-10-12 16:53:06 +03:00
Artem Boldariev e229af39e7 TLS: clear error queue before doing IO or calling SSL_get_error()
Ensure that TLS error is empty before calling SSL_get_error() or doing
SSL I/O so that the result will not get affected by prior error
statuses.

In particular, the improper error handling led to intermittent unit
test failure and, thus, could be responsible for some of the system
test failures and other intermittent TLS-related issues.

See here for more details:

https://www.openssl.org/docs/man3.0/man3/SSL_get_error.html

In particular, it mentions the following:

> The current thread's error queue must be empty before the TLS/SSL
> I/O operation is attempted, or SSL_get_error() will not work
> reliably.

As we use the result of SSL_get_error() to decide on I/O operations,
we need to ensure that it works reliably by cleaning the error queue.

TLS DNS: empty error queue before attempting I/O
2022-10-12 16:39:46 +03:00
Michał Kępień 3b9ec670f6 Merge branch '3592-fix-startup-detection-after-restart-in-start.pl-v9_18' into 'v9_18'
[v9_18] Fix startup detection after restart in start.pl

See merge request isc-projects/bind9!6890
2022-10-11 10:25:31 +00:00
Michał Kępień 9bfb9184f2 Fix startup detection after restart in start.pl
The bin/tests/system/start.pl script waits until a "running" message is
logged by a given name server instance before attempting to send a
version.bind/CH/TXT query to it.  The idea behind this was to make the
script wait until named loads all the zones it is configured to serve
before telling the system test framework that a given server is ready to
use; this prevents the need to add boilerplate code that waits for a
specific zone to be loaded to each test expecting that.

The problem is that when it looks for "running" messages, the
bin/tests/system/start.pl script assumes that the existence of any such
message in the named.run file indicates that a given named instance has
already finished loading all zones.  Meanwhile, some system tests
restart all the named instances they use throughout their lifetime (some
even do that a few times), for example to run Python-based tests.  The
bin/tests/system/start.pl script handles such a scenario incorrectly: as
soon as it finds any "running" message in the named.run file it inspects
and it gets a response to a version.bind/CH/TXT query, it tells the
system test framework that a given server is ready to use, which might
not be true - it is possible that only the "version.bind" zone is loaded
at that point and the "running" message found was logged by a
previously-shutdown named instance. This triggers intermittent failures
for Python-based tests.

Fix by improving the logic that the bin/tests/system/start.pl script
uses to detect server startup: check how many "running" lines are
present in a given named.run file before attempting to start a named
instance and only proceed with version.bind/CH/TXT queries when the
number of "running" lines found in that named.run file increases after
the server is started.

(cherry picked from commit 18e20f95f6)
2022-10-11 11:56:29 +02:00
Michał Kępień 2584413c90 Do not truncate ns2 logs in the "rrsetorder" test
In the "rrsetorder" system test, the ns2 named instance is restarted
without passing the --restart option to bin/tests/system/start.pl.  This
causes the log file for that named instance to be needlessly truncated.
Prevent this from happening by restarting the affected named instance
in the same way as all the other named instances used in system tests.

(cherry picked from commit 9146b956ae)
2022-10-11 11:56:29 +02:00
Michał Kępień bfe777613b Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.18.9' into 'v9_18'
Set up version and release notes for BIND 9.18.9

See merge request isc-projects/bind9!6885
2022-10-10 21:36:40 +00:00
Michał Kępień dd8872de8f Set up release notes for BIND 9.18.9 2022-10-10 23:18:40 +02:00
Michał Kępień fd028232f9 Update BIND version to 9.18.9-dev 2022-10-10 23:18:40 +02:00
Michał Kępień 35f5d35d41 Update BIND version for release 2022-10-10 09:43:12 +02:00
Michał Kępień 9419f00dc1 Add a CHANGES marker 2022-10-10 09:43:12 +02:00
Michał Kępień 499a321c7e Merge branch 'michal/prepare-documentation-for-bind-9.18.8' into 'v9_18_8-release'
Prepare documentation for BIND 9.18.8

See merge request isc-private/bind9!464
2022-10-07 11:28:52 +00:00
Michał Kępień a6ff5f9b49 Add release note for GL #3587 2022-10-07 13:22:06 +02:00
Michał Kępień d1b5ba07fd Reorder release notes 2022-10-07 13:22:06 +02:00
Michał Kępień de92c44be0 Tweak and reword release notes 2022-10-07 13:22:06 +02:00
Michał Kępień ec93236a5f Prepare release notes for BIND 9.18.8 2022-10-07 13:22:06 +02:00
Petr Špaček d2b428d8d2 Merge branch '3554-improve-dnssec-policy-inline-signing-err-msg-v9_18' into 'v9_18'
Clarify new configuration incompabitility: dnssec-policy vs. inline-signing [v9_18]

See merge request isc-projects/bind9!6871
2022-10-06 08:30:42 +00:00
Petr Špaček 49db39abfe Add Known Issue about config incompatibility
(cherry picked from commit 5589d0a49c)
2022-10-06 10:28:19 +02:00
Petr Špaček 6394f5c423 Clarify error message about missing inline-signing & dnssec-policy
(cherry picked from commit 058c1744ba)
2022-10-06 10:27:32 +02:00
Mark Andrews 7de12577ef Merge branch '3577-reloads-in-ixfr-system-test-happen-too-fast-v9_18' into 'v9_18'
Add sleeps to ixfr system test [v9_18]

See merge request isc-projects/bind9!6869
2022-10-05 22:28:16 +00:00
Mark Andrews 51bcf741fc Add sleeps to ixfr system test
ensure that at least a second has passed since a zone was last loaded
to prevent it accidentally being skipped as up to date.

(cherry picked from commit 491a8cfe96)
2022-10-06 08:36:25 +11:00
Michal Nowak 36f62900de Merge branch 'mnowak/drop-flake8-ignore-lists-v9_18' into 'v9_18'
[v9_18] Drop flake8 ignore lists

See merge request isc-projects/bind9!6867
2022-10-05 16:24:38 +00:00
Michal Nowak 8934362636 Drop flake8 ignore lists
flake8 is not used in BIND 9 CI and inline ignore lists are not needed
anymore.

(cherry picked from commit f5d9fa6ea4)
2022-10-05 18:06:38 +02:00
Petr Špaček aa8a0f761c Merge branch '3572-fix-duplicate-link-anchor-v9_18' into 'v9_18'
Deduplicate link anchors in the ARM [v9_18]

See merge request isc-projects/bind9!6861
2022-10-05 09:59:07 +00:00
Petr Špaček ce71fce811 Remove manually defined anchors pointing to statement definitions
This is hopefully end of duplication. This batch did not cause clashes
in Sphinx but it was pointless nonetheless as we have auto-generated
anchors for all statements.

(cherry picked from commit 137e0f4e0e)

Adapted for v9_18 branch by doing cleanup also in
notes/notes-9.18.0.rst.
2022-10-05 11:55:03 +02:00
Tom KrizekandPetr Špaček 6cd00258fa Remove trailing whitespaces
(cherry picked from commit ea2d213f34)
2022-10-05 11:44:33 +02:00
Petr Špaček bba3440638 Deduplicate link anchors in the ARM
Some statement names like "allow-query" had manually defined link anchor
_allow-query and also implicit anchor created by
.. namedconf:statement:: syntax. This causes warnings if a ambiguous
reference is made using :any:`allow-query` syntax.

Remove (hopefully all) manually defined anchors which pointed to
identical place as the implicit anchor. This allows :any: to work.

In rare cases where manual anchor points to descriptive text separated
from statement definition the reference was disamguated by replacing
:any:`notify` with :ref:`notify` (for manual anchor)
vs. :namedconf:ref:`notify` (for statement definition).

Please note that `options` statement is a trap: It is ambiguous even
without manual anchor because rndc.conf has its own `options`. Use
:namedconf:ref:`options` vs. :rndcconf:ref:`options` to select
appropriate target.

(cherry picked from commit 9a7c2b370e)
2022-10-05 11:44:33 +02:00
Mark Andrews cf9ef990d2 Merge branch '3338-zero-system-test-add-forensics-v9_18' into 'v9_18'
Add additional forensics to zero system test [v9_18]

See merge request isc-projects/bind9!6860
2022-10-05 08:52:08 +00:00
Mark Andrews 1d508b76cd Add additional forensics to zero system test
(cherry picked from commit 285351d4b2)
2022-10-05 19:30:38 +11:00
Mark Andrews 091be7c61d Merge branch '3569-dns-message-checksig-create-test-key-directory-v9_18' into 'v9_18'
Resolve "dns_message_checksig under oss_fuzz is not seeing the data files" [v9_18]

See merge request isc-projects/bind9!6858
2022-10-05 08:23:06 +00:00
Mark Andrews f7c2c07051 Add CHANGES note for [GL #3569]
(cherry picked from commit 1849a8a526)
2022-10-05 19:01:41 +11:00
Mark Andrews 280b863c97 Create a key directory in /tmp
Access to the source tree is not available with oss_fuzz.  Have
fuzz/dns_message_checksig build and populate a key directory for
the fuzzer to use.  This contains a key pair and a zone file which
has the public key from the key pair.  Clean it up on shutdown.

(cherry picked from commit 033057ba9d)
2022-10-05 19:01:41 +11:00
Petr Špaček 39827cfe3b Merge branch 'pspacek/tsan-ci-artifacts-fix-v9_18' into 'v9_18'
Fix TSAN artifact gathering in CI [v9_18]

See merge request isc-projects/bind9!6857
2022-10-05 07:45:12 +00:00
Petr Špaček a1d3fb98b7 Fix TSAN artifact gathering in CI
Fixup for 2c3b2dabe9.

We forgot to update TSAN paths when moving all the unit tests to
/tests/.  Let's remove paths from find to make it less dependent on
exact location, and store all untracked files as we do in the normal
unit test template.

Related: !6243
(cherry picked from commit 9559eb3b21)
2022-10-05 09:44:20 +02:00
Mark Andrews 087faf0747 Merge branch '3544-add-dohpath-parsing-to-svbc-v9_18' into 'v9_18'
Add support for 'dohpath' to SVCB (and HTTPS) [v9_18]

See merge request isc-projects/bind9!6849
2022-10-04 05:07:10 +00:00
Mark Andrews 886df1542e Use strnstr implementation from FreeBSD if not provided by OS
(cherry picked from commit 5f07fe8cbb)
2022-10-04 15:33:33 +11:00
Mark Andrews ec31057a0f Add release note for [GL #3544]
(cherry picked from commit 2f3441b40a)
2022-10-04 15:33:32 +11:00
Mark Andrews 9e8ebbbd23 Add CHANGES note for [GL #3544]
(cherry picked from commit 335b397e15)
2022-10-04 15:33:00 +11:00
Mark Andrews 10d9c040e7 Add support for 'dohpath' to SVCB (and HTTPS)
dohpath is specfied in draft-ietf-add-svcb-dns and has a value
of 7.  It must be a relative path (start with a /), be encoded
as UTF8 and contain the variable dns ({?dns}).

(cherry picked from commit 6d561d3886)
2022-10-04 15:32:22 +11:00
Matthijs Mekking c179933c09 Merge branch 'matthijs-dnssec-guide-dnssec-policy-requires-inline-signing-v9_18' into 'v9_18'
[v9_18] Add dnssec-policy inline-signing requirement to documentation

See merge request isc-projects/bind9!6832
2022-09-28 08:38:45 +00:00
Matthijs Mekking 2abb2b638a Add inline-signing to config examples
Add 'inline-signing yes;' to configuration examples to have working
copy paste configurations.

(cherry picked from commit 18d230a584)
2022-09-28 10:37:41 +02:00
Matthijs Mekking d1a01d88f9 Update inline-signing requirement to ARM
This change was made in !6403, but the appropriate documentation
changes were not applied to the ARM.

(cherry picked from commit 5d454a7158)
2022-09-28 10:37:41 +02:00
Matthijs Mekking 2305d8770b Add inline-signing requirement to DNSSEC Guide
This change was made in !6403, but the appropriate documentation
changes were not applied to the DNSSEC Guide.

(cherry picked from commit 09522c8d73)
2022-09-28 10:37:41 +02:00
Mark Andrews 79462fcb1d Merge branch '3562-assign-default-value-to-suffix-v9_18' into 'v9_18'
Suffix may be used before it is assigned a value [v9_18]

See merge request isc-projects/bind9!6836
2022-09-28 01:40:56 +00:00
Mark Andrews 750766a842 Suffix may be used before it is assigned a value
CID 350722 (#5 of 7): Bad use of null-like value (FORWARD_NULL)
        12. invalid_operation: Invalid operation on null-like value suffix.
    145        r.authority.append(
    146            dns.rrset.from_text(
    147                "icky.ptang.zoop.boing." + suffix,
    148                1,
    149                IN,
    150                NS,
    151                "a.bit.longer.ns.name." + suffix,
    152            )
    153        )

(cherry picked from commit 432064f63c)
2022-09-28 11:19:38 +10:00
Mark Andrews cff7e5acdd Merge branch '3551-missing-rsa_free-call-in-opensslrsa_verify2-v9_18' into 'v9_18'
Free 'rsa' if 'e' is NULL in opensslrsa_verify2 [v9_18]

See merge request isc-projects/bind9!6834
2022-09-28 01:06:10 +00:00
Mark Andrews 573eeea2ee Add CHANGES note for [GL #3551]
(cherry picked from commit 1e3680193a)
2022-09-28 09:49:27 +10:00
Mark Andrews 9f8eadd289 Check BN_dup results in rsa_check
(cherry picked from commit a47235f4f5)
2022-09-28 09:49:04 +10:00
Mark Andrews 6b37a69213 Free 'n' on error path in rsa_check
(cherry picked from commit 483c5a1978)
2022-09-28 09:49:04 +10:00
Mark Andrews 6c8fe060af Check that 'e' and 'n' are allocated in opensslrsa_fromdns
(cherry picked from commit db70c30213)
2022-09-28 09:49:04 +10:00
Mark Andrews 3fd8d439c6 Check that 'e' and 'n' are non-NULL in opensslrsa_todns
(cherry picked from commit 5603cd69d1)
2022-09-28 09:49:04 +10:00
Mark Andrews e9b880f648 Free 'rsa' if 'e' is NULL in opensslrsa_verify2
(cherry picked from commit a2b51ca6ac)
2022-09-28 09:49:04 +10:00
Mark Andrews ae44b22ca6 Merge branch '3541-have-named-v-report-supported-algorithms-v9_18' into 'v9_18'
Report supported crypto algorithms [v9_18]

See merge request isc-projects/bind9!6831
2022-09-27 23:27:48 +00:00
Petr ŠpačekandMark Andrews 81c8cc37aa Add release note for new crypto algorithm logging
(cherry picked from commit c138a8aa59)
2022-09-28 01:19:50 +10:00
Petr ŠpačekandMark Andrews af5f4bacf6 Document list of crypto algorithms in named -V output
(cherry picked from commit c648e280e4)
2022-09-28 01:19:50 +10:00
Mark Andrews 70606149c6 Deduplicate string formating
(cherry picked from commit d34ecdb366)
2022-09-28 01:19:50 +10:00
Mark Andrews 2f9a504998 Add CHANGES entry for [GL #3541]
(cherry picked from commit e876de442e)
2022-09-28 01:19:50 +10:00
Mark Andrews 09910d25a9 silence scan-build false positive
(cherry picked from commit 3156d36495)
2022-09-28 01:19:50 +10:00
Mark AndrewsandPetr Špaček 450a8ed5d5 Report algorithms supported by named at startup
(cherry picked from commit cb1515e71f)
2022-09-27 16:55:33 +02:00
Mark AndrewsandPetr Špaček c0e59be125 Have 'named -V' report supported algorithms
These cover DNSSEC, DS, HMAC and TKEY algorithms.

(cherry picked from commit b308f866c0)
2022-09-27 16:55:33 +02:00
Mark AndrewsandPetr Špaček 3d223e0338 Replace alg_totext with dst_hmac_algorithm_totext
The new library function will be reused by subsequent commits.

(cherry picked from commit 151cc2fff9)
2022-09-27 16:55:33 +02:00
Mark AndrewsandPetr Špaček 0bbc0c61e3 Convert DST_ALG defines to enum and group HMAC algorithms
The HMACs and GSSAPI are just using unallocated values.
Moving them around shouldn't cause issues.
Only the dnssec system test knew the internal number in use for hmacmd5.

(cherry picked from commit 09f7e0607a)
2022-09-27 16:55:33 +02:00
Tony Finch 57a773fa81 Merge branch '3548-without-system-jemalloc-v9_18' into 'v9_18'
A more helpful error when --without-jemalloc is impossible

See merge request isc-projects/bind9!6830
2022-09-27 14:17:36 +00:00
Tony Finch 9ec7f4399f A more helpful error when --without-jemalloc is impossible
When jemalloc is the system allocator (on FreeBSD and NetBSD), trying
to build --without-jemalloc caused an obscure compiler error. Instead,
complain at configure time that --without-jemalloc cannot work. (It
needs to remain an error because it is vexing when configure quietly
ignores an explicit direction.)

(cherry picked from commit f0e79458be)
2022-09-27 14:35:29 +01:00
Mark Andrews 6173e62147 Merge branch '3557-catalog-zone-check-key-names-v9_18' into 'v9_18'
Check that primary key names have not changed [v9_18]

See merge request isc-projects/bind9!6825
2022-09-27 12:42:23 +00:00
Mark Andrews 3fb4ced9aa Add release note for [GL #3557]
(cherry picked from commit eacf41a20a)
2022-09-27 22:20:21 +10:00
Mark Andrews 68336b367f Add CHANGES note for [GL #3557]
(cherry picked from commit 0774dacf2d)
2022-09-27 22:19:37 +10:00
Mark Andrews 66463ee48c Check that changing the TSIG key is successful
Switch the primary to require 'next_key' for zone transfers then
update the catalog zone to say to use 'next_key'.  Next update the
zones contents then check that those changes are seen on the
secondary.

(cherry picked from commit 176e172210)
2022-09-27 22:19:37 +10:00
Mark Andrews 83726e2fd3 Check that primary key names have not changed
When looking for changes in a catalog zone member zone we need to
also check if the TSIG key name associated with a primary server
has be added, removed or changed.

(cherry picked from commit 9172bd9b5a)
2022-09-27 22:19:37 +10:00
Petr Špaček 55726d616f Merge branch 'pspacek/fix-dns_message_checksig-out-of-tree-v9_18' into 'v9_18'
Fix dns_message_checksig fuzzer [v9_18]

See merge request isc-projects/bind9!6824
2022-09-27 11:37:01 +00:00
Ondřej SurýandPetr Špaček 6a349d5c29 Fix stack-use-after-scope in dns_message_checksig test
Previously stack with buffer for test dns message went out of scope
before the message was processed. For fuzz testing its better to avoid
allocation, so let's avoid allocations completely and use simplest
possible static buffer.

Fixes: #3565
(cherry picked from commit 16377100ae)
2022-09-27 13:23:25 +02:00
Petr Špaček a24ced44ab Fix dns_message_checksig in out-of-tree setup
Hardcoded path was missing FUZZDIR prefix.

Related: !5923
(cherry picked from commit 4108d79c9a)
2022-09-27 13:23:25 +02:00
Petr Špaček 35c5853f8a Detect errors in fuzzer initialization
Incomplete initialization typically causes mysterious failures later on,
so let's err out early.

(cherry picked from commit d102c59b96)
2022-09-27 13:23:16 +02:00
Evan Hunt a44ccdbabb Merge branch '3553-static-buffer-functions-v9_18' into 'v9_18'
change ISC__BUFFER macros to inline functions

See merge request isc-projects/bind9!6819
2022-09-27 07:46:00 +00:00
Evan Hunt 369858730a change ISC__BUFFER macros to inline functions
previously, when ISC_BUFFER_USEINLINE was defined, macros were
used to implement isc_buffer primitives (isc_buffer_init(),
isc_buffer_region(), etc). these macros were missing the DbC
assertions for those primitives, which made it possible for
coding errors to go undetected.

adding the assertions to the macros caused compiler warnings on
some platforms. therefore, this commit converts the ISC__BUFFER
macros to static inline functions instead, with assertions included,
and eliminates the non-inline implementation from buffer.c.

the --enable-buffer-useinline configure option has been removed.

(cherry picked from commit 1926ddc987)
2022-09-27 00:45:28 -07:00
Michał Kępień e442730104 Merge branch 'mnowak/add-fedora-36-v9_18' into 'v9_18'
[v9_18] Add Fedora 36

See merge request isc-projects/bind9!6820
2022-09-27 07:42:14 +00:00
Michal NowakandMichał Kępień 50405ba413 Add Fedora 36
(cherry picked from commit a313c49a3b)
2022-09-27 09:40:19 +02:00
Petr Špaček b8c92ad51f Merge branch 'bug/main/doc-arm-rhel9-v9_18' into 'v9_18'
Compatibility for building ARM on older sphinx [v9_18]

See merge request isc-projects/bind9!6817
2022-09-26 15:23:34 +00:00
Petr MenšíkandPetr Špaček ad59ef103f Simplify allowing warnings during ARM build
RHEL8 Sphinx does not support all features used in ARM building. But
with few emitted warnings it can build the documentation fine. Simplify
warnings acceptance by allowing make doc SPHINX_W=''.

(cherry picked from commit 3db7e241d2)
2022-09-26 17:16:42 +02:00
Petr MenšíkandPetr Špaček dfc7b630db Compatibility for building ARM on older sphinx
Make documentation building successful even on RHEL9 sphinx 3.4.3. It
does not like case-insensitive matching of terms, so provide lowercase
text description with Uppercase word reference.

(cherry picked from commit bc6c6b1184)
2022-09-26 17:16:38 +02:00
Petr Špaček 98ba68fe02 Merge branch 'ondrej-add-dns_message_checktsig-fuzzer-v9_18' into 'v9_18'
Add dns_message_checksig() fuzzer [v9_18]

See merge request isc-projects/bind9!6816
2022-09-26 15:16:01 +00:00
Petr Špaček c00f76b37e Add seed to reproduce issue memory leak in dns_message_checktsig
Related: #3547
(cherry picked from commit 983822abcf)
2022-09-26 16:53:06 +02:00
Mark AndrewsandPetr Špaček 431a2159e5 Add CHANGES notes for [GL !5923]
(cherry picked from commit 6237273205)
2022-09-26 16:53:06 +02:00
Mark AndrewsandPetr Špaček 339bd12c88 Add the ability to dig to specify the signing time
(cherry picked from commit 805e2ba31d)
2022-09-26 16:53:06 +02:00
Mark AndrewsandPetr Špaček 86fc284f74 Allow dig to SIG(0) sign a message
(cherry picked from commit 4d248ee78e)
2022-09-26 16:53:06 +02:00
Mark AndrewsandPetr Špaček 3a3a6367d2 Add a SIG(0) request seed
(cherry picked from commit c127a2aefc)
2022-09-26 16:53:06 +02:00
Mark AndrewsandPetr Špaček ed307fa179 Add TSIG reply seed
(cherry picked from commit 3c28608c9f)
2022-09-26 16:53:06 +02:00
Mark AndrewsandPetr Špaček 5eae4b78cc Add TSIG request seed
(cherry picked from commit f3d47bc8e0)
2022-09-26 16:53:06 +02:00
Ondřej SurýandPetr Špaček e57b933fbe Add dns_message_checksig() fuzzer
dns_message_checksig is called in a number of scenarios

	* on requests and responses
	* on multiple opcodes
	* with and without signatures
	* with TSIG signatures
	* with SIG(0) signatures
	* with and without configured TSIG keys
	* with and without KEY records being present
	* signing performed now, in the future and in the past

we use the first two octets of the seed to configure the calling
environment with the remainder of the seed being the rdata of the
TSIG/SIG(0) record.

(cherry picked from commit 4da0180ba2)

Adapted to v9_18 - removed third dns_zone_create() parameter.
2022-09-26 16:53:06 +02:00
Ondřej SurýandPetr Špaček c66c687bd6 Add the ability specify the signing / verification time
When fuzzing it is useful for all signing operations to happen
at a specific time for reproducability.  Add two variables to
the message structure (fuzzing and fuzztime) to specify if a
fixed time should be used and the value of that time.

(cherry picked from commit 3e85d8c3d6)
2022-09-26 16:30:36 +02:00
Petr Špaček c460041ad1 Merge branch '3547-dns_message_checksig-leak-fix-v9_18' into 'v9_18'
Fix memory leak in dns_message_checksig() - SIG(0) sigs [v9_18]

See merge request isc-projects/bind9!6812
2022-09-26 10:44:51 +00:00
Mark AndrewsandPetr Špaček 1488ef19f8 Stop passing mctx to dns_rdata_tostruct as it is unnecessary for SIG
dns_rdata_tostruct doesn't need a mctx passed to it for SIG (the signer
is already expanded at this point). About the only time when mctx is
needed is when the structure is to be used after the rdata has been
destroyed.

(cherry picked from commit d6ad56bd9e)
2022-09-26 12:01:44 +02:00
Petr Špaček 9a971bb8b0 Fix memory leak in dns_message_checksig() - SIG(0) sigs
Impact should be visible only in tests or tools because named never
uses view == NULL, which is a necessary condition to trigger this leak.

(cherry picked from commit 69256b3553)
2022-09-26 12:01:40 +02:00
Mark Andrews dc9c5f5cbd Merge branch 'bug/main/sha1-disabled-fedora-rhbz2122841-v9_18' into 'v9_18'
Engine pkcs11 cannot work with OSSL_PARAM on OpenSSL 3.0 [v9_18]

See merge request isc-projects/bind9!6805
2022-09-23 04:26:58 +00:00
Mark Andrews b53b69ca3c Add release note for [GL !6711]
(cherry picked from commit e27b063f67)
2022-09-23 14:07:53 +10:00
Mark Andrews e24c1f54ff Add a CHANGES note for [GL !6711]
(cherry picked from commit 54916b4e45)
2022-09-23 14:07:51 +10:00
Mark Andrews ebe0f68e99 Report how named was built
(cherry picked from commit 979062ee5d)
2022-09-23 14:07:21 +10:00
Mark Andrews 103b6948fb Build against OpenSSL 3.0 in OpenSSL 1.1.0 compatibility mode
(cherry picked from commit 9b13dd7b4d)
2022-09-23 14:07:21 +10:00
Michal NowakandMark Andrews c59c904e11 Let Debian sid image leverage PKCS#11 with OpenSSL 3
(cherry picked from commit 3dec2deebc)
2022-09-23 14:07:21 +10:00
Mark Andrews 98cc24d9fe Update reference to point to doc/arm/build.inc.rst
(cherry picked from commit 6d668b8c34)
2022-09-23 14:07:21 +10:00
Mark Andrews 7b2236c431 Document -DOPENSSL_API_COMPAT=10100 in OPTIONS.md
(cherry picked from commit f32c52c5ca)
2022-09-23 14:07:21 +10:00
Petr MenšíkandMark Andrews 8a425dbac4 Remove engine related parts for OpenSSL 3.0
OpenSSL just cannot work with mixing ENGINE_* api mixed with OSSL_PARAM
builders. But it can be built in legacy mode, where deprecated but still
working API would be used.

It can work under OpenSSL 3.0, but only if using legacy code paths
matching OpenSSL 1.1 calls and functions.

Remove fromlabel processing by OpenSSL 3.0 only functions. They can
return later with a proper provider support for pkcs11.

(cherry picked from commit 6c55ea17c6)
2022-09-23 14:07:21 +10:00
Petr MenšíkandMark Andrews d6806c9fe7 Do not use OSSL_PARAM when engine API is compiled
OpenSSL has deprecated many things in version 3.0. If pkcs11 engine
should work then no builder from OpenSSL 3.0 API can be used.

Allow switching to OpenSSL 1.1 like calls even on OpenSSL 3.0 when
OPENSSL_API_COMPAT=10100 is defined. It would still compile and allow
working keys loading from the engine passed on command line.

(cherry picked from commit f92950bb64)
2022-09-23 14:07:14 +10:00
Petr MenšíkandMark Andrews 306f1008cc Add ENGINE_init and ENGINE_finish calls
According to manual page of ENGINE_init, it should be called explicitly
before any key operations happens. Make it active whole lifetime.

(cherry picked from commit 71a8f1e7cd)
2022-09-23 14:05:16 +10:00
Petr Špaček da4eae91b5 Merge branch 'pspacek/fix-out-of-tree-junit-v9_18' into 'v9_18'
Improve JUnit test status generator for Gitlab CI [v9_18]

See merge request isc-projects/bind9!6804
2022-09-22 14:36:53 +00:00
Petr Špaček bbe089615f Unify Python interpreter used by TSAN and JUnit helpers
Reportedly we don't have python2-enabled TSAN builds, so we can remove
one more hardcoded python3 call from .gitlab-ci.yaml.

(cherry picked from commit 8d095550a8)
2022-09-22 16:17:28 +02:00
Petr Špaček 1067f114f9 Fix JUnit test status generator for out-of-tree system tests
- Use separate paths for tests results and test script
- For tarball tests include the conversion script in the `make dist`

(cherry picked from commit c46ad4aec2)
2022-09-22 16:17:25 +02:00
Arаm Sаrgsyаn 588ee1f581 Merge branch 'aram/arm-xot-and-ddns-update-forwarding-v9_18' into 'v9_18'
[v9_18] Document dynamic update forwarding limitation when XoT is enabled

See merge request isc-projects/bind9!6765
2022-09-22 11:43:53 +00:00
Aram Sargsyan f6f828989f Add a known issue release note for [GL #3512] 2022-09-22 10:54:56 +00:00
Aram Sargsyan e20cda5928 Document dynamic update forwarding limitation when XoT is enabled
BIND 9.18 does not support sending forwarded DDNS update requests
through DoT.
2022-09-22 10:54:56 +00:00
Evan Hunt f05297fe5a Merge branch '3553-httpd-cleanup-v9_18' into 'v9_18'
additional code cleanups in httpd.c

See merge request isc-projects/bind9!6799
2022-09-21 20:14:31 +00:00
Evan Hunt 357b59ec68 additional code cleanups in httpd.c
- use isc_buffer functions when appropriate, rather than converting
  to and from isc_region unnecessarily
- use the zlib total_out value instead of calculating it
- use c99 struct initialization

(cherry picked from commit 4b7248545e)
2022-09-21 12:54:27 -07:00
Michał Kępień 0a53f61727 Merge tag 'v9_18_7' into v9_18
BIND 9.18.7
2022-09-21 13:13:30 +02:00
Evan Hunt c00f22e8b2 Merge branch 'each-cleanup-dns_request-v9_18' into 'v9_18'
remove dns_request_create(), rename dns_request_createvia()

See merge request isc-projects/bind9!6784
2022-09-15 23:53:42 +00:00
Evan Hunt 8f61d07918 merge dns_request_createvia() into dns_request_create()
dns_request_create() was a front-end to dns_request_createvia() that
was only used by test binaries. dns_request_createvia() has been
renamed to dns_request_create(), and the test programs that formerly
used dns_request_create() have been updated to use the new parameters.

(cherry picked from commit ebf7b31aa3)
2022-09-15 16:49:04 -07:00
Mark Andrews af27dd052d Merge branch '3525-key-id-clashes-across-algorithms-cause-problems-with-statistics-v9_18' into 'v9_18'
Resolve "key id clashes across algorithms cause problems with statistics" [v9_18]

See merge request isc-projects/bind9!6746
2022-09-15 23:42:39 +00:00
Mark Andrews ea1d3476a8 Suppress manykeys test on duplicate key ids
If there are duplicate key ids across multiple algorithms expected
output is no met.  We have fixed this in on main but decided to not
back port the fix as it will change the statistics channel output.

This change detects when there are duplicate key id across algorithms
as skips the sub test.
2022-09-16 09:17:14 +10:00
Evan Hunt 9ac426db8f Merge branch '3522-update-detach-v9_18' into 'v9_18'
fix an incorrect detach in update processing

See merge request isc-projects/bind9!6782
2022-09-15 18:53:30 +00:00
Evan Hunt 16fbe33478 CHANGES for [GL #3522]
(cherry picked from commit fdc35928eb)
2022-09-15 11:34:33 -07:00
Evan Hunt 592c7b1049 fix an incorrect detach in update processing
when processing UDPATE requests, hold the request handle until
we either drop the request or respond to it.

(cherry picked from commit 00e0758e12)
2022-09-15 11:34:33 -07:00
Michal Nowak bc53176c54 Merge branch '3427-tcp-system-test-bump-socket.create_connection-timeout-v9_18' into 'v9_18'
[v9_18] Bump socket.create_connection() timeout to 10 seconds

See merge request isc-projects/bind9!6780
2022-09-15 10:46:58 +00:00
Michal Nowak ec3a17f718 Bump socket.create_connection() timeout to 10 seconds
The tcp Pytest on OpenBSD fairly reliably fails when receive_tcp()
on a socket is attempted:

    >           (response, rtime) = dns.query.receive_tcp(sock, timeout())

    tests-tcp.py:50:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    /usr/local/lib/python3.9/site-packages/dns/query.py:659: in receive_tcp
        ldata = _net_read(sock, 2, expiration)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
    count = 2, expiration = 1662719959.8106785

        def _net_read(sock, count, expiration):
            """Read the specified number of bytes from sock.  Keep trying until we
            either get the desired amount, or we hit EOF.
            A Timeout exception will be raised if the operation is not completed
            by the expiration time.
            """
            s = b''
            while count > 0:
                try:
    >               n = sock.recv(count)
    E               socket.timeout: timed out

This is because the socket is already closed.

Bump the socket connection timeout to 10 seconds.

(cherry picked from commit 658cae9fad)
2022-09-15 12:21:28 +02:00
Ondřej Surý 47a40b48dc Merge branch '3542-gracefuly-handle-cancelled-http-read-during-sending-v9_18' into 'v9_18'
Handle canceled read during sending data over stats channel

See merge request isc-projects/bind9!6779
2022-09-15 09:49:10 +00:00
Ondřej Surý c9c4de0626 Add CHANGES and release note for [GL #3542]
(cherry picked from commit e29563173b)
2022-09-15 10:58:28 +02:00
Ondřej Surý 474676a38c Provide stronger wording about the security of statistics channel
Add more text about the importance of properly securing the statistics
channel and what is and what is not considered a security vulnerability.

(cherry picked from commit 6869c98d36)
2022-09-15 10:58:09 +02:00
Ondřej Surý 2adaa53619 Handle canceled read during sending data over stats channel
An assertion failure would be triggered when the TCP connection
is canceled during sending the data back to the client.

Don't require the state to be `RECV` on non successful read to
gracefully handle canceled TCP connection during the SEND state of the
HTTPD channel.

(cherry picked from commit 6562227cc8)
2022-09-15 10:58:09 +02:00
Petr Špaček 5e51ccf9b6 Merge branch 'pspacek/log-no-recursion-reason-v9_18' into 'v9_18'
Log reasons why ACL denied recursion or cache peek [v9_18]

See merge request isc-projects/bind9!6775
2022-09-15 08:08:23 +00:00
Evan HuntandPetr Špaček 4bf1dcc96a Add tests for the new log messages with refusal reason
Update the allow-query test to check for the new log messages.

(cherry picked from commit a2bbe578bf)
2022-09-15 09:41:32 +02:00
Petr Špaček d1d1bc67bd CHANGES note for [GL !6669]
(cherry picked from commit 67c3a3439b)
2022-09-15 09:41:31 +02:00
Petr Špaček c095ac9ad1 Log reason why cache peek is not available
Log which ACL caused RD=0 query into cache to be refused.
Expected performance impact is negligible.

(cherry picked from commit fdf7456643)
2022-09-15 09:41:01 +02:00
Petr Špaček e067d11396 Log reason why recursion is not available
Log which ACL caused RA=0 condition.
Expected performance impact is negligible.

(cherry picked from commit 95fc05c454)
2022-09-15 09:40:57 +02:00
Evan Hunt c8ac45057b Merge branch '3399-random-device-obsolete' into 'v9_18'
flag "random-device" as obsolete

See merge request isc-projects/bind9!6768
2022-09-14 16:49:41 +00:00
Evan Hunt 90117edc49 CHANGES for [GL #3399] 2022-09-14 09:37:25 -07:00
Evan Hunt 17da7dee5c flag "random-device" as obsolete
the "random-device" option was made non-functional in 9.13, but was
not marked as obsolete at that time. this is now fixed; configuring
"random-device" will trigger a warning.
2022-09-14 09:37:25 -07:00
Tony Finch 0ffef8ceba Merge branch '3519-macos-tests-v9_18' into 'v9_18'
The system tests are using another IP address

See merge request isc-projects/bind9!6772
2022-09-14 12:06:28 +00:00
Tony Finch 1c6627f6e3 Skip the xfer test when Net::DNS is too old
This allows the system tests to run to completion on macOS
without requiring extra modules from CPAN.

(cherry picked from commit d8053785b0)
2022-09-14 11:49:43 +01:00
Tony Finch de747f9b6b The system tests are using another IP address
Reduce the number of places that know about the number of IP addresses
required by the system tests, by changing `testsock.pl` to read the
`max` from `ifconfig.sh.in`. This should make the test runner fail
early with a clear message when the interfaces have been set up by an
obsolete script.

Add comments to cross-reference `ifconfig.sh.in`, `testsock.pl`, and
`org.isc.bind.system` to make it easier to remember what needs
updating when an IP address is added.

(cherry picked from commit 258a896a0c)
2022-09-14 11:49:43 +01:00
Evan Hunt db830aa8aa Merge branch '3520-rndc-detach' into 'v9_18'
fix a possible use-after-detach bug in rndc

See merge request isc-projects/bind9!6724
2022-09-12 21:25:59 +00:00
Evan Hunt 7513aeead8 fix a possible use-after-detach bug in rndc
we need to detach the rndc task when calling isc_app_shutdown(),
otherwise it may be detached before the last reference to it.
while this does not prevent rndc from working, it causes a spurious
core dump on shutdown.
2022-09-12 14:03:05 -07:00
Evan Hunt 4252ee5c5f Merge branch '3520-rndc-shutdown-hang-v9_18' into 'v9_18'
prevent a possible shutdown hang in rndc

See merge request isc-projects/bind9!6764
2022-09-12 21:02:36 +00:00
Evan Hunt 9e0af151e9 prevent a possible shutdown hang in rndc
In rndc_recvdone(), if 'sends' was not 0, then 'recvs' was not
decremented, in which case isc_loopmgr_shutdown() was never reached,
which could cause a hang. (This has not been observed to happen, but
the code was incorrect on examination.)

(cherry picked from commit 9683439d73)
2022-09-12 13:34:58 -07:00
Tony Finch de40d702b0 Merge branch '3531-initialize-struct-server-v9_18' into 'v9_18'
Ensure that named_server_t is properly initialized

See merge request isc-projects/bind9!6762
2022-09-12 11:21:57 +00:00
Tony Finch 0470a4f521 Ensure that named_server_t is properly initialized
There was a ubsan error reporting an invalid value for interface_auto
(a boolean value cannot be 190) because it was not initialized. To
avoid this problem happening again, ensure the whole of the server
structure is initialized to zero before setting the (relatively few)
non-zero elements.
2022-09-12 11:26:33 +01:00
Michał Kępień f2fc2cef60 Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.18.8' into 'v9_18'
Set up version and release notes for BIND 9.18.8

See merge request isc-projects/bind9!6759
2022-09-09 18:23:11 +00:00
Michał Kępień 6081ba7604 Set up release notes for BIND 9.18.8 2022-09-09 19:58:46 +02:00
Michał Kępień 7cea6c4211 Update BIND version to 9.18.8-dev 2022-09-09 19:58:46 +02:00
Michał Kępień 85a6eb108e Update BIND version for release 2022-09-08 14:39:47 +02:00
Michał Kępień 3d55ae3d2f Add a CHANGES marker 2022-09-08 14:39:47 +02:00
Michał Kępień f0f3c56cd5 Merge branch 'michal/prepare-documentation-for-bind-9.18.7' into 'security-v9_18'
Prepare documentation for BIND 9.18.7

See merge request isc-private/bind9!459
2022-09-08 12:26:53 +00:00
Michał Kępień 212c9f1239 Tweak and reword release notes 2022-09-08 14:03:54 +02:00
Michał Kępień 364bdb5ec8 Prepare release notes for BIND 9.18.7 2022-09-08 14:03:54 +02:00
Michał Kępień c58fb22a74 Merge branch '3487-eddsa-verify-leak-v9_18' into 'security-v9_18'
[v9_18] [CVE-2022-38178] eddsa verify leak

See merge request isc-private/bind9!439
2022-09-08 09:57:42 +00:00
Mark AndrewsandMichał Kępień 06e13c5a8d Add release note for [GL #3487]
(cherry picked from commit e6cb1de20b)
2022-09-08 11:55:29 +02:00
Mark AndrewsandMichał Kępień 79655301ab Add CHANGES note for [GL #3487]
(cherry picked from commit b3277f2e10)
2022-09-08 11:55:29 +02:00
Mark AndrewsandMichał Kępień 7c0028cfad Free ctx on invalid siglen
(cherry picked from commit 6ddb480a84)
2022-09-08 11:55:29 +02:00
Michał Kępień 21af7869d1 Merge branch '3517-serve-stale-client-timeout-0-cname-crash-v9_18' into 'security-v9_18'
[v9_18] [CVE-2022-3080] Fix serve-stale-client-timeout 0 CNAME crash

See merge request isc-private/bind9!447
2022-09-08 09:53:06 +00:00
Matthijs MekkingandMichał Kępień 175e4e963b Add release notes for #3517
(cherry picked from commit 97c6c3712e)
2022-09-08 11:50:44 +02:00
Matthijs MekkingandMichał Kępień 55946cebb6 Add CHANGES entry for 3517
(cherry picked from commit e394902965)
2022-09-08 11:50:44 +02:00
Matthijs MekkingandMichał Kępień b9e2f3333d Only refresh RRset once
Don't attempt to resolve DNS responses for intermediate results. This
may create multiple refreshes and can cause a crash.

One scenario is where for the query there is a CNAME and canonical
answer in cache that are both stale. This will trigger a refresh of
the RRsets because we encountered stale data and we prioritized it over
the lookup. It will trigger a refresh of both RRsets. When we start
recursing, it will detect a recursion loop because the recursion
parameters will eventually be the same. In 'dns_resolver_destroyfetch'
the sanity check fails, one of the callers did not get its event back
before trying to destroy the fetch.

Move the call to 'query_refresh_rrset' to 'ns_query_done', so that it
is only called once per client request.

Another scenario is where for the query there is a stale CNAME in the
cache that points to a record that is also in cache but not stale. This
will trigger a refresh of the RRset (because we encountered stale data
and we prioritized it over the lookup).

We mark RRsets that we add to the message with
DNS_RDATASETATTR_STALE_ADDED to prevent adding a duplicate RRset when
a stale lookup and a normal lookup conflict with each other. However,
the other non-stale RRset when following a CNAME chain will be added to
the message without setting that attribute, because it is not stale.

This is a variant of the bug in #2594. The fix covered the same crash
but for stale-answer-client-timeout > 0.

Fix this by clearing all RRsets from the message before refreshing.
This requires the refresh to happen after the query is send back to
the client.

(cherry picked from commit d939d2ecde)
2022-09-08 11:50:44 +02:00
Michał Kępień df94f18583 Merge branch '3491-security-fix-openssl-dh-memory-leaks-v9_18' into 'security-v9_18'
[v9_18] [CVE-2022-2906] Fix memory leaks in DH code

See merge request isc-private/bind9!433
2022-09-08 09:48:18 +00:00
Aram SargsyanandMichał Kępień 8ac3682c7e Add release note for [GL #3491]
(cherry picked from commit 113e949b34)
2022-09-08 11:46:20 +02:00
Aram SargsyanandMichał Kępień 919e2d195f Add CHANGES note for [GL #3491]
(cherry picked from commit 5b5f2353d4)
2022-09-08 11:46:20 +02:00
Aram SargsyanandMichał Kępień 73df5c8053 Fix memory leaks in DH code
When used with OpenSSL v3.0.0+, the `openssldh_compare()`,
`openssldh_paramcompare()`, and `openssldh_todns()` functions
fail to cleanup the used memory on some error paths.

Use `DST_RET` instead of `return`, when there is memory to be
released before returning from the functions.

(cherry picked from commit 73d6bbff4e)
2022-09-08 11:46:20 +02:00
Michał Kępień 648eca7698 Merge branch '3493-confidential-compression-buffer-reuse-v9_18' into 'security-v9_18'
[v9_18][CVE-2022-2881] compression buffer was not reused correctly

See merge request isc-private/bind9!436
2022-09-08 09:43:50 +00:00
Evan HuntandMichał Kępień 2312c45ff2 CHANGES and release notes for CVE-2022-2881 [GL #3493]
(cherry picked from commit 430ee6c427)
2022-09-08 11:40:18 +02:00
Evan HuntandMichał Kępień 13333db69f compression buffer was not reused correctly
when the compression buffer was reused for multiple statistics
requests, responses could grow beyond the correct size. this was
because the buffer was not cleared before reuse; compressed data
was still written to the beginning of the buffer, but then the size
of used region was increased by the amount written, rather than set
to the amount written. this caused responses to grow larger and
larger, potentially reading past the end of the allocated buffer.

(cherry picked from commit 47e9fa981e)
2022-09-08 11:40:18 +02:00
Michał Kępień 74ba7f89d7 Merge branch '3394-security-cve-2022-2795-mitigation-v9_18' into 'security-v9_18'
[CVE-2022-2795] [v9_18] Bound the amount of work performed for delegations

See merge request isc-private/bind9!452
2022-09-08 09:37:26 +00:00
Michał Kępień 7f6cb0d0cc Add release note for GL #3394
(cherry picked from commit 672072812c)
2022-09-08 11:11:30 +02:00
Michał Kępień 97a9f586c4 Add CHANGES entry for GL #3394
(cherry picked from commit e802beedfc)
2022-09-08 11:11:30 +02:00
Michał Kępień e2014ba9e3 Bound the amount of work performed for delegations
Limit the amount of database lookups that can be triggered in
fctx_getaddresses() (i.e. when determining the name server addresses to
query next) by setting a hard limit on the number of NS RRs processed
for any delegation encountered.  Without any limit in place, named can
be forced to perform large amounts of database lookups per each query
received, which severely impacts resolver performance.

The limit used (20) is an arbitrary value that is considered to be big
enough for any sane DNS delegation.

(cherry picked from commit 3a44097fd6)
2022-09-08 11:11:30 +02:00
Michał Kępień 7e27db0023 Merge branch '3459-rrl-wildcard-handling-v9_18' into 'v9_18'
[v9_18] Make RRL code treat all QNAMEs subject to wildcard processing within a given zone as the same name

See merge request isc-projects/bind9!6748
2022-09-08 08:14:29 +00:00
Aram SargsyanandMichał Kępień bcf0f951e0 Add CHANGES and release notes for [GL #3459]
(cherry picked from commit 0b0cf12741)
2022-09-08 09:36:50 +02:00
Aram SargsyanandMichał Kępień f2982a5d3f Document RRL processing for wildcard names
All valid wildcard domain names are interpreted as the zone's origin
name concatenated to the "*" name.

(cherry picked from commit 89c2032421)
2022-09-08 09:36:50 +02:00
Aram SargsyanandMichał Kępień 35e37505f0 Fix RRL responses-per-second bypass using wildcard names
It is possible to bypass Response Rate Limiting (RRL)
`responses-per-second` limitation using specially crafted wildcard
names, because the current implementation, when encountering a found
DNS name generated from a wildcard record, just strips the leftmost
label of the name before making a key for the bucket.

While that technique helps with limiting random requests like
<random>.example.com (because all those requests will be accounted
as belonging to a bucket constructed from "example.com" name), it does
not help with random names like subdomain.<random>.example.com.

The best solution would have been to strip not just the leftmost
label, but as many labels as necessary until reaching the suffix part
of the wildcard record from which the found name is generated, however,
we do not have that information readily available in the context of RRL
processing code.

Fix the issue by interpreting all valid wildcard domain names as
the zone's origin name concatenated to the "*" name, so they all will
be put into the same bucket.

(cherry picked from commit baa9698c9d)
2022-09-08 09:36:50 +02:00
Matthijs Mekking fe162c74c1 Merge branch 'matthijs-fix-intermittent-inline-system-test-failure-v9_18' into 'v9_18'
[v9_18]  Fix intermittent inline system test failure

See merge request isc-projects/bind9!6739
2022-09-07 15:12:22 +00:00
Matthijs Mekking d1315d1bc4 Update inline system test, zone 'retransfer3.'
The zone 'retransfer3.' tests whether zones that 'rndc signing
-nsec3param' requests are queued even if the zone is not loaded.

The test assumes that if 'rndc signing -list' shows that the zone is
done signing with two keys, and there are no NSEC3 chains pending, the
zone is done handling the '-nsec3param' queued requests. However, it
is possible that the 'rndc signing -list' command is received before
the corresponding privatetype records are added to the zone (the records
that are used to retrieve the signing status with 'rndc signing').

This is what happens in test failure
https://gitlab.isc.org/isc-projects/bind9/-/jobs/2722752.

The 'rndc signing -list retransfer3' is thus an unreliable check.
It is simpler to just remove the check and wait for a certain amount
of time and check whether ns3 has re-signed the zone using NSEC3.

(cherry picked from commit 8b71cbd09c)
2022-09-07 16:26:12 +02:00
Evan Hunt d245253eb8 Merge branch 'each-interface-magic-v9_18' into 'v9_18'
when creating an interface, set magic before linking

See merge request isc-projects/bind9!6736
2022-09-07 06:14:56 +00:00
Evan Hunt acfca3f4fa when creating an interface, set magic before linking
set the magic number in a newly-created interface object
before appending it to mgr->interfaces in order to prevent
a possible assertion.

(cherry picked from commit 8c01662048)
2022-09-06 21:48:28 -07:00
Arаm Sаrgsyаn 5c44aad640 Merge branch '3518-libxml2-deprecated-functions-v9_18' into 'v9_18'
[v9_18] Do not use libxml2 deprecated functions

See merge request isc-projects/bind9!6731
2022-09-06 10:03:31 +00:00
Aram Sargsyan 93c39696f4 Add CHANGES note for [GL #3518]
(cherry picked from commit 87920661b1)
2022-09-06 09:21:02 +00:00
Aram Sargsyan 97197ef78e Do not use libxml2 deprecated functions
The usage of xmlInitThreads() and xmlCleanupThreads() functions in
libxml2 is now marked as deprecated, and these functions will be made
private in the future.

Use xmlInitParser() and xmlCleanupParser() instead of them.

(cherry picked from commit a5d412d924)
2022-09-06 09:20:55 +00:00
Matthijs Mekking 7be0594be9 Merge branch '3381-dnssec-policy-explicit-inline-signing-v9_18' into 'v9_18'
[v9_18] dnssec-policy now requires inline-signing

See merge request isc-projects/bind9!6729
2022-09-06 08:48:46 +00:00
Matthijs Mekking b232fabe89 Add change and release note for #3381
Because folks want to know.

(cherry picked from commit 2b95c11905a1a5faff9efa97a4f2498aadfa467b)
2022-09-06 09:55:06 +02:00
Matthijs Mekking 5c4c32114f Remove implicit inline-signing code
Remove the code that sets implicit inline-signing on zones using
dnssec-policy.

(cherry picked from commit a6b09c9c69186e81a9be54e8b7bb413b1ac4d650)
2022-09-06 09:55:06 +02:00
Matthijs Mekking c6e2d7d54d Update system tests
Update checkconf and kasp related system tests after requiring
inline-signing.

(cherry picked from commit 8fd75e8a4e1035ce0e81bf47d954a3f5b8a4d571)
2022-09-06 09:55:06 +02:00
Matthijs Mekking d7175c41a7 dnssec-policy now requires inline-signing
Having implicit inline-signing set for dnssec-policy when there is no
update policy is confusing, so lets make this explicit.

(cherry picked from commit 5ca02fe6e7e591d1fb85936ea4dda720c3d741ef)
2022-09-06 09:02:59 +02:00
Ondřej Surý a6b6a1c9dd Merge branch '3485-dig-fallback-to-idna2003-v9_18' into 'v9_18'
Allow fallback to IDNA2003 processing

See merge request isc-projects/bind9!6725
2022-09-05 09:43:43 +00:00
Ondřej Surý 05499232a7 Add CHANGES and release note for [GL #3485]
(cherry picked from commit 0fe7acb4e6)
2022-09-05 10:21:28 +02:00
Ondřej Surý a22b0bebc2 Enable the IDNA2003 domain names in the idna system test
Allow the IDNA2003 tests to succeed after the fallback to IDNA2003 was
implemented.

(cherry picked from commit 87de726f5c)
2022-09-05 10:21:28 +02:00
Ondřej Surý abc0382738 Allow fallback to IDNA2003 processing
In several cases where IDNA2008 mappings do not exist whereas IDNA2003
mappings do, dig was failing to process the suplied domain name.  Take a
backwards compatible approach, and convert the domain to IDNA2008 form,
and if that fails try the IDNA2003 conversion.

(cherry picked from commit 10923f9d87)
2022-09-05 10:21:28 +02:00
Arаm Sаrgsyаn bf70a66ed8 Merge branch '3515-mctx-attach-detach-for-isc_mempool_t-v9_18' into 'v9_18'
[v9_18] Add mctx attach/detach when creating/destroying a memory pool

See merge request isc-projects/bind9!6720
2022-09-02 09:03:31 +00:00
Aram Sargsyan 1017083de7 Add CHANGES note for [GL #3515]
(cherry picked from commit 362ead8d85)
2022-09-02 08:17:54 +00:00
Aram Sargsyan 982b491d7c Add mctx attach/detach when creating/destroying a memory pool
This should make sure that the memory context is not destroyed
before the memory pool, which is using the context.

(cherry picked from commit e97c3eea95)
2022-09-02 08:17:47 +00:00
Evan Hunt 19b98dc74f Merge branch '3511-quote-yaml-addresses-v9_18' into 'v9_18'
quote addresses in YAML output

See merge request isc-projects/bind9!6717
2022-08-31 23:39:50 +00:00
Evan Hunt 3ea267f29d CHANGES for [GL #3511]
(cherry picked from commit f72bf1375a)
2022-08-31 16:17:56 -07:00
Evan Hunt 3304c694c8 quote addresses in YAML output
YAML strings should be quoted if they contain colon characters.
Since IPv6 addresses do, we now quote the query_address and
response_address strings in all YAML output.

(cherry picked from commit 66eaf6bb73)
2022-08-31 16:17:56 -07:00
Evan Hunt d84cff6d4b Merge branch '3501-dnstap-response-v9_18' into 'v9_18'
dnstap query_message field was erroneously set with responses

See merge request isc-projects/bind9!6715
2022-08-31 22:44:41 +00:00
Evan Hunt 07b3cbbba1 CHANGES for [GL #3501]
(cherry picked from commit fea9751f13)
2022-08-31 15:24:23 -07:00
Evan Hunt 7bb503ca75 dnstap query_message field was erroneously set with responses
The dnstap query_message field was in some cases being filled in
with response messages, along with the response_message field.
The query_message field should only be used when logging requests,
and the response_message field only when logging responses.

(cherry picked from commit 3ccfff8ab6)
2022-08-31 15:24:00 -07:00
Arаm Sаrgsyаn cdf1871066 Merge branch 'aram/rpz-doc-update-v9_18' into 'v9_18'
[v9_18] Update RPZ documentation in ARM

See merge request isc-projects/bind9!6709
2022-08-31 08:54:04 +00:00
Aram Sargsyan 5e868be3cc Update RPZ documentation
The RPZ documentation section with response policy rules and actions
is incomplete.

Add information about the 'RPZ-CLIENT-IP' rule, and 'TCP-Only' and
'DROP' actions.

(cherry picked from commit 0fbd07ac22)
2022-08-30 10:36:14 +00:00
Mark Andrews eb5492beeb Merge branch '3505-missing-isc_mutex_destroy-v9_18' into 'v9_18'
Call isc_mutex_destroy(&lasttime_mx); [v9_18]

See merge request isc-projects/bind9!6697
2022-08-24 07:38:01 +00:00
Mark Andrews 41cfd1c783 Call isc_mutex_destroy(&lasttime_mx);
(cherry picked from commit 8109f495c8b5d7c7f88d581f7905650add0c184e)
2022-08-24 17:03:57 +10:00
Matthijs Mekking b88762debb Merge branch '3500-nsec3-missing-detach-node-9_18' into 'v9_18'
nsec3.c: Add a missing dns_db_detachnode() call

See merge request isc-projects/bind9!6693
2022-08-23 11:24:56 +00:00
Matthijs Mekking d386ef9a0e Add CHANGES entry for #3500
There is no need for a release because this case was nearly impossible
to trigger (except for when 'sig-signing-type' was set to 0).

(cherry picked from commit 545ecb64b043617ea609f4f115d280bb5990e221)
2022-08-23 12:04:14 +02:00
Matthijs Mekking e54ab3f586 nsec3.c: Add a missing dns_db_detachnode() call
There is one case in 'dns_nsec3_activex()' where it returns but forgets
to detach the db node. Add the missing 'dns_db_detachnode()' call.

This case only triggers if 'sig-signing-type' (privatetype) is set to 0
(which by default is not), or if the function is called with 'complete'
is set to 'true' (which at this moment do not exist).

(cherry picked from commit 0cf6c18ccb2205a1fc81431f908c8310f6136bbb)
2022-08-23 12:04:08 +02:00
Matthijs Mekking 9d6de16c57 Merge branch '3486-checkconf-dnssec-policy-nsec3-incompatible-algorithm-v9_18' into 'v9_18'
[v9_18]  Graceful dnssec-policy transition from NSEC only to NSEC3

See merge request isc-projects/bind9!6691
2022-08-22 17:42:11 +00:00
Matthijs Mekking ba71f93e44 Fix nsec3 system test issues
The wait_for_zone_is_signed function was never called, which could lead
to test failures due to timing issues (where a zone was not fully signed
yet, but the test was trying to verify the zone).

Also add two missing set_nsec3param calls to ensure the ITERATIONS
value is set for these test cases.

(cherry picked from commit 08505651d1d9278314f61076ac7cd119a7790428)
2022-08-22 19:21:39 +02:00
Matthijs Mekking ffc0c321ca Add change entry and release note for #3486
News worthy.

(cherry picked from commit 2669eb2a34ef65935f8045a6c9d271af486f38d5)
2022-08-22 19:21:39 +02:00
Matthijs Mekking 73431eef8f Add test case for #3486
Add two scenarios where we change the dnssec-policy from using RSASHA1
to something with NSEC3.

The first case should work, as the DS is still in hidden state and we
can basically do anything with DNSSEC.

The second case should fail, because the DS of the predecessor is
published and we can't immediately remove the predecessor DNSKEY. So
in this case we should keep the NSEC chain for a bit longer.

Add two more scenarios where we change the dnssec-policy from using
NSEC3 to something NSEC only. Both should work because there are no
restrictions on using NSEC when it comes to algorithms, but in the
cases where the DS is published we can't bluntly remove the predecessor.

Extend the nsec3 system test by also checking the DNSKEY RRset for the
expected DNSKEY records. This requires some "kasp system"-style setup
for each test (setting key properties and key states). Also move the
dnssec-verify check inside the check_nsec/check_nsec3 functions because
we will have to do that every time.

(cherry picked from commit 21729dd94efc9fc7b7317688dd9ff0ec45181bfd)
2022-08-22 19:21:39 +02:00
Matthijs Mekking 39c0c5022d Wait with NSEC3 during a DNSSEC policy change
When doing a dnssec-policy reconfiguration from a zone with NSEC only
keys to a zone that uses NSEC3, figure out to wait with building the
NSEC3 chain.

Previously, BIND 9 would attempt to sign such a zone, but failed to
do so because the NSEC3 chain conflicted with existing DNSKEY records
in the zone that were not compatible with NSEC3.

There exists logic for detecting such a case in the functions
dnskey_sane() (in lib/dns/zone.c) and check_dnssec() (in
lib/ns/update.c). Both functions look very similar so refactor them
to use the same code and call the new function (called
dns_zone_check_dnskey_nsec3()).

Also update the dns_nsec_nseconly() function to take an additional
parameter 'diff' that, if provided, will be checked whether an
offending NSEC only DNSKEY will be deleted from the zone. If so,
this key will not be considered when checking the zone for NSEC only
DNSKEYs. This is needed to allow a transition from an NSEC zone with
NSEC only DNSKEYs to an NSEC3 zone.

(cherry picked from commit 09a81dc84ce0fee37442f03cdbd63c2398215376)
2022-08-22 19:21:39 +02:00
Matthijs Mekking b0ae2e4da7 Test checkconf NSEC3 and incompatible algorithm
The check code for this already exists, but was untested.

(cherry picked from commit 1996eaee547e046c8314cdb4a50a02eb9e59ce3f)
2022-08-22 16:37:38 +02:00
Arаm Sаrgsyаn 92fda68e22 Merge branch '3463-httpd.c-non-empty-post-requests-bugfix-v9_18' into 'v9_18'
[v9_18] Fix statistics channel multiple request processing with non-empty HTTP bodies

See merge request isc-projects/bind9!6689
2022-08-19 09:01:19 +00:00
Aram Sargsyan cbb5d4f08b Add pipelined POST requests check in the statschannel system test
Use `nc` to check that multiple POST requests with non-empty HTTP
body are serviced normally by the statistics channel.

(cherry picked from commit bc32885ba981cab6308981936f49ab625af84bf2)
2022-08-19 08:27:24 +00:00
Aram Sargsyan 8e37e5f27f Replace expr commands with $((expression)) shell constucts
Update the "statschannel" system test to use the $((expression))
shell constucts instead of executing the `expr` program.

(cherry picked from commit 8034819b53789b52dd1c80b0256880b506a3f31b)
2022-08-19 08:27:17 +00:00
Aram Sargsyan 95452d9a47 Add CHANGES not for [GL #3463]
(cherry picked from commit a00d787f2cf909fe0d8dce016488916997e8d67e)
2022-08-19 08:27:09 +00:00
Aram Sargsyan d4c5d1c650 Fix statistics channel multiple request processing with non-empty bodies
When the HTTP request has a body part after the HTTP headers, it is
not getting processed and is being prepended to the next request's data,
which results in an error when trying to parse it.

Improve the httpd.c:process_request() function with the following
additions:

1. Require that HTTP POST requests must have Content-Length header.
2. When Content-Length header is set, extract its value, and make sure
   that it is valid and that the whole request's body is received before
   processing the request.
3. Discard the request's body by consuming Content-Length worth of data
   in the buffer.

(cherry picked from commit c2bbdc8a648c9630b2c9cea5227ad5c309c2ade5)
2022-08-19 08:27:01 +00:00
Aram Sargsyan 1005dd74d9 Enhance the have_header() function to find the HTTP header's value
Add a new `const char **fvalue` parameter to the httpd.c:have_header()
function which, when set, will point to the found header's value.

(cherry picked from commit 376e698dc21f4117d6461101c4cfbaef2b724592)
2022-08-19 08:26:18 +00:00
Mark Andrews 616702ad63 Merge branch 'bug/main/delv-cfg_parser_reset-v9_18' into 'v9_18'
Reset parser before parsing of internal trust anchor [v9_18]

See merge request isc-projects/bind9!6688
2022-08-19 05:42:24 +00:00
Mark Andrews f94e658d05 Add CHANGES entry for [GL !6468]
(cherry picked from commit 23a8c15cb2efd3486a4e7ea41c1581cb2ed07912)
2022-08-19 15:21:41 +10:00
Petr MenšíkandMark Andrews fdd9e39dfe Reset parser before parsing of internal trust anchor
It might be reused if /etc/bind.keys exists, but failed correct parsing.
Release traces of previous parsing attempt of different data.

(cherry picked from commit dc07394c4724c1e1235af85dd8c044af70da93ae)
2022-08-19 15:21:41 +10:00
Mark Andrews b6caedd07c Merge branch '3499-duration-c-66-6-warning-array-subscript-is-of-type-char-on-netbsd-9-v9_18' into 'v9_18'
Silence negative array index warning with toupper [v9_18]

See merge request isc-projects/bind9!6686
2022-08-19 04:30:06 +00:00
Mark Andrews f7590c1c5a Silence negative array index warning with toupper
Cast to (unsigned char).

(cherry picked from commit d3f790340e8590ad5da1472c99d25acbc9818496)
2022-08-19 12:31:04 +10:00
Michal Nowak 8fd0b14324 Merge branch 'mnowak/freebsd-13.1-v9_18' into 'v9_18'
[v9_18] Add FreeBSD 13.1

See merge request isc-projects/bind9!6683
2022-08-18 15:57:42 +00:00
Michal Nowak 9c9f773386 Add FreeBSD 13.1
(cherry picked from commit bc425be55e1736d4f2ffada5e8d76f96b08c8351)
2022-08-18 17:30:50 +02:00
Artem Boldariev 94b129ddb7 Merge branch 'artem-dig-http-plain-get-post-support-fix-v9-18' into 'v9_18'
[Backport to 9.18] DIG: fix handling of +http-plain-get and +http-plain-post options

See merge request isc-projects/bind9!6682
2022-08-18 11:47:36 +00:00
Artem Boldariev 31435f7bc5 Modify CHANGES (+http-plain-{get, post} support fix in dig)
This commit modifies the CHANGES file to mention that +http-plain-get
and +http-plain-post options support in dig was fixed.

(cherry picked from commit 0ab40c223b524b2d65a2b67a2eb76f4d63fbfb3e)
2022-08-18 14:25:46 +03:00
Artem Boldariev c8e551299c Modify the doth system test to verify HTTP method usage
Before the commit some checks in the system test would try to verify
that different HTTP methods can be used and are functional. However,
until recently, it was not possible to tell from the output which
method was in fact used, so it turned out that +http-plain-get option
is broken.

This commit add the additional checks to prevent that from happening
in the future.

(cherry picked from commit 625991c810b4086a5fbfc48ecb54974f6b6e3f9a)
2022-08-18 14:25:03 +03:00
Artem Boldariev 3c4d6c4ee0 DIG: mark HTTP GET method in output
This commit makes dig mark the usage of HTTP(S) GET protocol usage in
its output.

(cherry picked from commit f86d8c62b01a7ae88a3543ba85c41834e64d011a)
2022-08-18 14:24:43 +03:00
Artem Boldariev bd033f92fd DIG: fix handling of +http-plain-{get, post} options
Support for parsing +http-plain-get and +http-plain-post options was
broken. This commit fixes that.

(cherry picked from commit fb135867644684a21d79bc3a5cebe3c83217a221)
2022-08-18 14:24:27 +03:00
Michal Nowak b76c2ad366 Merge tag 'v9_18_6' into v9_18
BIND 9.18.6
2022-08-18 11:43:29 +02:00
Mark Andrews f412537065 Merge branch '3494-dnssec-awk-test-is-not-precise-enough-v9_18' into 'v9_18'
Improve awk tests to prevent false negatives [v9_18]

See merge request isc-projects/bind9!6676
2022-08-18 04:40:10 +00:00
Mark Andrews d19916bde4 Improve awk tests to prevent false negatives
The old code could incorrectly match "INSOA" in the RRSIG rdata
when looking for the SOA record.

(cherry picked from commit 2fc5f6fb2831697c79f75c50a769449ac561aad0)
2022-08-18 13:43:33 +10:00
Michal Nowak 5b04e29554 Merge branch 'mnowak/coverity-scan-2022.06-v9_18' into 'v9_18'
[v9_18] Use Coverity Scan 2022.06

See merge request isc-projects/bind9!6673
2022-08-17 14:00:38 +00:00
Michal Nowak 0955942b1f Use Coverity Scan 2022.06
(cherry picked from commit 3d683c704e271f1c8107a5b108c93db4bde7db7f)
2022-08-17 15:59:21 +02:00
Arаm Sаrgsyаn a177b9494c Merge branch '3492-fix-tkey.c-buildquery-cleanup-v9_18' into 'v9_18'
[v9_18] Fix tkey.c:buildquery() function's error handling

See merge request isc-projects/bind9!6664
2022-08-17 09:10:38 +00:00
Aram Sargsyan c9ac6623cc Add CHANGES note for [GL #3492]
(cherry picked from commit 8dd12db505892640d885e81dc6701607da1df67f)
2022-08-17 08:36:08 +00:00
Aram Sargsyan b46e53a2e3 Fix tkey.c:buildquery() function's error handling
Add the missing cleanup code.

(cherry picked from commit 4237ab9550eeaea7121e3e3392fd14c26b5150f0)
2022-08-17 08:36:07 +00:00
Michal Nowak b4ab890c71 Merge branch 'mnowak/openbsd-7.1-v9_18' into 'v9_18'
[v9_18] Add OpenBSD 7.1

See merge request isc-projects/bind9!6665
2022-08-16 15:17:14 +00:00
Michal Nowak fdf85d8877 Add OpenBSD 7.1
(cherry picked from commit 7edf8ab47cfd0cc3a633e941b2880ee11d75d6cd)
2022-08-16 17:02:06 +02:00
Petr Špaček 000fb86614 Merge branch 'sgoldlust-edit-statements' into 'v9_18'
Edit tag/statement for glue-cache and reserved-sockets

See merge request isc-projects/bind9!6638
2022-08-15 07:22:05 +00:00
Suzanne GoldlustandPetr Špaček cb6bf93298 Edit tag/statement for glue-cache and reserved-sockets 2022-08-15 09:17:36 +02:00
Evan Hunt 96a66e1c61 Merge branch '3488-prevent-adb-dump-race-v9_18' into 'v9_18'
Lock the address entry bucket when dumping ADB namehook

See merge request isc-projects/bind9!6657
2022-08-13 00:10:14 +00:00
Evan Hunt f841f545b7 Lock the address entry bucket when dumping ADB namehook
When dumping an ADB address entry associated with a name,
the name bucket lock was held, but the entry bucket lock was
not; this could cause data races when other threads were updating
address entry info. (These races are probably not operationally
harmful, but they triggered TSAN error reports.)
2022-08-12 15:55:41 -07:00
Michal Nowak 1f12e1de3a Merge branch '3348-move-pkcs11-interface-test-to-debian-v9_18' into 'v9_18'
[v9_18] Move OpenSSL-based PKCS#11 interface job to Debian "bullseye"

See merge request isc-projects/bind9!6653
2022-08-11 19:18:56 +00:00
Michal Nowak f2c0c65dca Move OpenSSL-based PKCS#11 interface job to Debian "bullseye"
Fedora 36 uses OpenSSL 3.0.2 by default, but the OpenSSL engine API
which we use for PKCS#11 is deprecated in OpenSSL 3.0.0. For the
keyfromlabel system test to work operating system with OpenSSL 1.1 needs
to be used.

(cherry picked from commit 2eecebdea91868be571e3c7a5fb3324505fbd2ff)
2022-08-11 20:31:40 +02:00
Michal Nowak b1213d6a4d Merge branch '3458-reintroduce-without-cmocka-and-without-gssapi-v9_18' into 'v9_18'
[v9_18] Configure Ubuntu 18.04 "bionic" without cmocka and GSS-API

See merge request isc-projects/bind9!6651
2022-08-11 16:23:14 +00:00
Michal Nowak 2f1a3738f5 Configure Ubuntu 18.04 "bionic" without cmocka and GSS-API
--without-cmocka and --without-gssapi ./configure options have been lost
when Debian 9 "stretch" was dropped from the CI. This reintroduces them,
albeit to a slightly different platform.

(cherry picked from commit a2c8703967e7b6ba2a0d02ab414172588a3cb17a)
2022-08-11 17:57:46 +02:00
Michal Nowak 07b43da612 Merge branch 'mnowak/add-oracle-linux-9-v9_18' into 'v9_18'
[v9_18] Add Oracle Linux 9

See merge request isc-projects/bind9!6644
2022-08-10 12:27:20 +00:00
Mark AndrewsandMichal Nowak d48f9f84e3 Fix mkeys to work with DEFAULT_ALGORITHM properly
Stop using a RSASHA1 fixed key in ns3's named.conf as the
trusted key and instead compute a broken digest from the
real digest to use in trusted-keys.

(cherry picked from commit be4cbe2b80)
2022-08-10 14:06:57 +02:00
Mark Andrews 7e1b02fc4e kasp: stop using RSASHA1 unless necessary for the test
Moves tests from being RSASHA1 based to RSASHA256 based where possible
and split out the remaining RSASHA1 based tests so that they are not
run on OS's that don't support RSASHA1.

(cherry picked from commit db028684e5)
2022-08-10 17:26:29 +10:00
Mark Andrews 62ddc10933 keymgr2kasp: use FIPS compliant algorithms and key sizes
migrate-nomatch-alglen: switched to RSASHA256 instead of RSASHA1
and the key size now changes from 2048 bits to 3072 bits instead
of 1024 bits to 2048 bits.

migrate-nomatch-algnum: switched to RSASHA256 instead of RSASHA1
as initial algorithm and adjusted mininum key size to 2048 bits.

rsasha256: adjusted minimum key size to 2048 bits.

(cherry picked from commit 048b015166)
2022-08-10 17:26:29 +10:00
Mark Andrews 945f901722 dnssec/signer/general: Replace RSASHA1 keys with RSASHA512 keys
RSASHA1 is verify only in FIPS mode. Use RSASHA256 instead.

(cherry picked from commit 9c6de6d12d)
2022-08-10 17:26:29 +10:00
Mark Andrews b81e93673f Check if RSASHA1 is supported by the OS
(cherry picked from commit 1690cb7bb4)
2022-08-10 17:26:29 +10:00
Mark Andrews c652c94024 autosign: use FIPS compatible algorithms and key sizes
The nsec-only.example zone was not converted as we use it to
test nsec-only DNSSEC algorithms to nsec3 conversion failure.
The subtest is skipped in fips mode.

Update "checking revoked key with duplicate key ID" test
to use FIPS compatible algorithm.

(cherry picked from commit 99ad09975e)
2022-08-10 17:26:29 +10:00
Mark Andrews 5b3c17f330 rsabigexponent: convert the test from RSASHA1 to RSASHA256
RSASHA1 is not supported on some platforms.

(cherry picked from commit 8c3c011860)
2022-08-10 17:26:29 +10:00
Michal NowakandMark Andrews 20b7c1d49f Add Oracle Linux 9
(cherry picked from commit be08cf41d9)
2022-08-10 17:26:29 +10:00
Mark Andrews ff17c10d7d notify: remove duplicate test number
(cherry picked from commit d396aa227e)
2022-08-10 17:26:29 +10:00
Mark Andrews 69a8132d7d mkeys: use $() instead of back quotes
(cherry picked from commit 0e45a2b02c)
2022-08-10 17:26:29 +10:00
Mark Andrews aff8219f3e Upgrade uses of hmac-sha1 to DEFAULT_HMAC
where the test is not hmac-sha1 specific

(cherry picked from commit c533e8bc5b)
2022-08-10 17:26:29 +10:00
Mark Andrews 2c2fc8fdbd Add CHANGES not for [GL #3440]
(cherry picked from commit be88c583bd)
2022-08-10 17:26:27 +10:00
Mark Andrews c6adebb22c zonechecks: use $DEFAULT_ALGORITHM
(cherry picked from commit 459e6980e5)
2022-08-10 17:25:26 +10:00
Mark Andrews 2e3554fe68 wildcard: use $DEFAULT_ALGORITHM
(cherry picked from commit 3f65c9cf85)
2022-08-10 17:25:26 +10:00
Mark Andrews 23e087131a views: use $DEFAULT_ALGORITHM
(cherry picked from commit 86b29606c3)
2022-08-10 17:25:26 +10:00
Mark Andrews 0b05da9f29 verify: use $DEFAULT_ALGORITHM
(cherry picked from commit 93f7c7cdcd)
2022-08-10 17:25:26 +10:00
Mark Andrews d3a502f19e upforwd: use $DEFAULT_ALGORITHM
(cherry picked from commit 5585909904)
2022-08-10 17:25:26 +10:00
Mark Andrews 620a16bcff unknown: use $DEFAULT_ALGORITHM
(cherry picked from commit 9970d4317d)
2022-08-10 17:25:26 +10:00
Mark Andrews 6d544309a0 synthfromdnssec: use $DEFAULT_ALGORITHM
(cherry picked from commit 73fd49f8bb)
2022-08-10 17:25:26 +10:00
Mark Andrews 2144febc9d staticstub: use $DEFAULT_ALGORITHM
(cherry picked from commit 32337b9dbf)
2022-08-10 17:25:26 +10:00
Mark Andrews b380473ca2 smartsign: use $DEFAULT_ALGORITHM
(cherry picked from commit 941b95edb0)
2022-08-10 17:25:26 +10:00
Mark Andrews bb981e0d68 rpz: use $DEFAULT_ALGORITHM
(cherry picked from commit 1861c3e503)
2022-08-10 17:25:26 +10:00
Mark Andrews b57457e754 rootkeysentinel: use $DEFAULT_ALGORITHM
(cherry picked from commit b0e1d9b1b3)
2022-08-10 17:25:26 +10:00
Mark Andrews e756c4c0f3 resolver: use $DEFAULT_ALGORITHM
(cherry picked from commit 05ef8c81dd)
2022-08-10 17:25:26 +10:00
Mark Andrews 62d50d3b23 redirect: use $DEFAULT_ALGORITHM
(cherry picked from commit e0e03602ba)
2022-08-10 17:25:26 +10:00
Mark Andrews c1f7fd282a pending: use $DEFAULT_ALGORITHM
(cherry picked from commit 6fd50b9fda)
2022-08-10 17:25:26 +10:00
Mark Andrews c5d5e20c8f nsupdate: use $DEFAULT_ALGORITHM
(cherry picked from commit c2d18567fc)
2022-08-10 17:25:26 +10:00
Mark Andrews 64d2dc174b mkeys: use $DEFAULT_ALGORITHM
(cherry picked from commit 78fa082999)
2022-08-10 17:25:26 +10:00
Mark Andrews 647e4c0d9b mirror: use $DEFAULT_ALGORITHM
(cherry picked from commit ff95bafa39)
2022-08-10 17:25:26 +10:00
Mark Andrews 7c100effd2 metadata: use $DEFAULT_ALGORITHM
(cherry picked from commit 3f1dc83bfb)
2022-08-10 17:25:26 +10:00
Mark Andrews db5eb04f4a inline: use $DEFAULT_ALGORITHM
(cherry picked from commit e3acddefd1)
2022-08-10 17:25:26 +10:00
Mark Andrews 73f2c501a5 dsdigest: use $DEFAULT_ALGORITHM
(cherry picked from commit 49de14cb9e)
2022-08-10 17:25:26 +10:00
Mark Andrews 5aad0a38e8 dnssec: use $DEFAULT_ALGORITHM
(cherry picked from commit d0b0139c90)
2022-08-10 17:25:26 +10:00
Mark Andrews 642d5963d9 dns64: use $DEFAULT_ALGORITHM
(cherry picked from commit 5cbf1e1598)
2022-08-10 17:25:26 +10:00
Mark Andrews f3658af717 chain: use $DEFAULT_ALGORITHM
(cherry picked from commit 3419178bd2)
2022-08-10 17:25:26 +10:00
Mark Andrews 2cbfb22d2f cds: use $DEFAULT_ALGORITHM
(cherry picked from commit 6cf0b73ede)
2022-08-10 17:25:26 +10:00
Mark Andrews f970186979 autosign: use $DEFAULT_ALGORITHM
(cherry picked from commit bb810b0ac9)
2022-08-10 17:25:26 +10:00
Mark Andrews c06815dede Use DEFAULT_HMAC for rndc
(cherry picked from commit ce324ae8ba)
2022-08-10 17:25:26 +10:00
Evan Hunt 55d0fd0a11 Merge branch '3483-memstat-assertion-v9_18' into 'v9_18'
fix overflow error in mem_putstats()

See merge request isc-projects/bind9!6645
2022-08-09 18:42:48 +00:00
Evan Hunt 1843780151 fix overflow error in mem_putstats()
an integer overflow could cause an assertion failure when
freeing memory.

(cherry picked from commit 0401e0867b)
2022-08-09 11:21:35 -07:00
Matthijs Mekking 5d200cb2bd Merge branch '2982-servfail-servestale-duplicate-queries-v9_18' into 'v9_18'
[v9_18] Don't enable serve-stale on duplicate queries

See merge request isc-projects/bind9!6642
2022-08-09 09:02:41 +00:00
Matthijs Mekking 350cc2df28 Add release note and change entry for #2982
News worthy.

(cherry picked from commit 2bd4486766)
2022-08-09 09:36:17 +02:00
Matthijs Mekking 5e908a988f Don't enable serve-stale on duplicate queries
When checking if we should enable serve-stale, add an early out case
when the result is an error signalling a duplicate query or a query
that would be dropped.

(cherry picked from commit 059a4c2f4d)
2022-08-09 09:36:11 +02:00
Arаm Sаrgsyаn 18bdce8477 Merge branch '3478-dig-lookup-reference-counting-bug-v9_18' into 'v9_18'
[v9_18] DiG: fix lookup reference counting bug

See merge request isc-projects/bind9!6640
2022-08-08 11:43:13 +00:00
Aram Sargsyan b83ff9cb20 Add CHANGES note for [GL #3478]
(cherry picked from commit 8eea655053)
2022-08-08 10:48:46 +00:00
Aram Sargsyan b23d88947a DiG: fix lookup reference counting bug
When DiG finishes its work with a lookup (due to success or error), it
calls the clear_current_lookup() function, which decreases the lookup's
reference count. That decrease action is the counterpart of the initial
creation of the reference counter, so this function was designed in such
a way that it should decrease the reference count only once, when there
are no more active queries in the lookup.

The way it checks whether there are any active queries is by looking
at the queries list of the lookup object - if it's NULL then there are
no active queries. But that is not always true - the cancel_lookup()
function, when canceling the queries one by one, also removes them
from the lookup's list, but in NSSEARCH mode, when the queries are
working in parallel, some of those queries can be still active. And
when their recv_done() callback gets called, it sees that the lookup
has been canceled, calls clear_current_lookup(), which decreases the
reference count every time for each query that was still active
(because ISC_LIST_HEAD(lookup->q) is NULL) and results in a reference
counting error.

Fix the issue by introducing a new "cleared" property for the lookup,
which will ensure that the clear_current_lookup() function does its
job only once per lookup.

(cherry picked from commit 08ba2732e0)
2022-08-08 10:48:38 +00:00
Matthijs Mekking e8758c0d81 Merge branch '3479-mysql-is-not-ldap-v9_18' into 'v9_18'
[v9_18] Fix mysql bindings

See merge request isc-projects/bind9!6639
2022-08-08 08:47:57 +00:00
Matthijs Mekking 4078990717 Fix mysql bindings
There was a copy paste error in the Makefile of the mysql dlz modules,
instead of setting the MYSQL_LIBS, LDAP_LIBS where set. This caused
the mysql bindings not to be generated.

(cherry picked from commit 38c740053b)
2022-08-08 09:45:49 +02:00
Michał Kępień 5cb75e3c7a Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.18.7' into 'v9_18'
Set up version and release notes for BIND 9.18.7

See merge request isc-projects/bind9!6633
2022-08-05 06:40:36 +00:00
Michał Kępień 3cd90c9a39 Set up release notes for BIND 9.18.7 2022-08-05 06:57:18 +02:00
Michał Kępień f63ffe40bb Update BIND version to 9.18.7-dev 2022-08-05 06:57:18 +02:00
Michał Kępień 8dbd488a50 Update BIND version for release 2022-08-04 23:46:28 +02:00
Michał Kępień 63c748406a Add a CHANGES marker 2022-08-04 23:46:28 +02:00
Michał Kępień 8bf5b66670 Merge branch 'michal/prepare-documentation-for-bind-9.18.6' into 'v9_18_6-release'
Prepare documentation for BIND 9.18.6

See merge request isc-private/bind9!419
2022-08-04 21:44:58 +00:00
Michał Kępień 8aaf84dad7 Tweak and reword release notes 2022-08-04 23:37:41 +02:00
Michał Kępień dc0d7027cf Prepare release notes for BIND 9.18.6 2022-08-04 23:37:41 +02:00
Artem Boldariev 4552658d1b Merge branch 'tls-fix-readpaused-usage-v9-18' into 'v9_18'
[Backport v9.18] TLS: do not ignore readpaused flag in certain circumstances

See merge request isc-projects/bind9!6629
2022-08-02 16:17:21 +00:00
Artem Boldariev c2fa72027c TLS: do not ignore readpaused flag in certain circumstances
In some circumstances generic TLS code could have resumed data reading
unexpectedly on the TCP layer code. Due to this, the behaviour of
isc_nm_pauseread() and isc_nm_resumeread() might have been
unexpected. This commit fixes that.

The bug does not seems to have real consequences in the existing code
due to the way the code is used. However, the bug could have lead to
unexpected behaviour and, at any rate, makes the TLS code behave
differently from the TCP code, with which it attempts to be as
compatible as possible.

(cherry picked from commit ec0647d546)
2022-08-02 17:31:15 +03:00
Arаm Sаrgsyаn 097a57e804 Merge branch '3461-fetches-per-zone-final-log-message-v9_18' into 'v9_18'
[v9_18] Resolve "Do a better job of logging when fetches-per-zone is triggered"

See merge request isc-projects/bind9!6625
2022-08-01 14:34:27 +00:00
Aram Sargsyan 0179459d83 Add CHANGES and release notes for [GL #3461]
(cherry picked from commit 0d64f55f5d)
2022-08-01 13:55:03 +00:00
Aram Sargsyan 47e4ef0696 Improve fetch limit logging
When initially hitting the `fetches-per-zone` value, a log message
is being generated for the event of dropping the first fetch, then
any further log events occur only when another fetch is being dropped
and 60 seconds have been passed since the last logged message.

That logic isn't ideal because when the counter of the outstanding
fetches reaches zero, the structure holding the counters' values will
get deleted, and the information about the dropped fetches accumulated
during the last minute will not be logged.

Improve the fcount_logspill() function to makie sure that the final
values are getting logged before the counter object gets destroyed.

(cherry picked from commit 039871ceb7)
2022-08-01 13:54:46 +00:00
Petr Špaček 8801d2668e Merge branch 'ron-tags-3-v9_18' into 'v9_18'
Add tags and short descriptions to all configuration statements [v9_18]

See merge request isc-projects/bind9!6624
2022-08-01 09:00:46 +00:00
Petr Špaček a2c59b949f Add tags and short description to statements not documented in v9_19 2022-08-01 10:53:25 +02:00
Petr Špaček 67e8e8ff20 Add last missing tags, finishing touches
(cherry picked from commit 43c6a6a48b)
2022-08-01 10:12:13 +02:00
Suzanne GoldlustandPetr Špaček c0177bfe4a Add descriptions of each tag
(cherry picked from commit 8d76584090)
2022-08-01 10:12:13 +02:00
Suzanne GoldlustandPetr Špaček b2159d42b2 Text edits to Statements and Statements by Tag sections
(cherry picked from commit d4b93c4bd6)
2022-08-01 10:12:13 +02:00
Suzanne GoldlustandPetr Špaček 17d5e43e71 Reorder Statements and Statements by Tag sections
(cherry picked from commit 2cd32eb06d)
2022-08-01 10:12:13 +02:00
Suzanne GoldlustandPetr Špaček ac7d65557b Rephrase parental-agents description
(cherry picked from commit 21c9166abb)
2022-08-01 10:12:12 +02:00
Suzanne GoldlustandPetr Špaček 7e13992ee7 Add short description for plugin statement
(cherry picked from commit d14828c5a7)
2022-08-01 10:12:12 +02:00
Suzanne GoldlustandPetr Špaček 16773a53ed Add tag and short description for dyndb statement
(cherry picked from commit 5b90f4caa4)
2022-08-01 10:12:12 +02:00
Suzanne GoldlustandPetr Špaček 8b0b402ec8 Add tags and short descriptions for dlz and search statements
(cherry picked from commit 93bb1a42f9)
2022-08-01 10:12:12 +02:00
Suzanne GoldlustandPetr Špaček c1c0197c9a Add tag and short description for catalog-zones statement
(cherry picked from commit e4f991c1d4)
2022-08-01 10:12:12 +02:00
Suzanne GoldlustandPetr Špaček 3c45f366a6 Add short descriptions and some tags to statements through line 1766
(cherry picked from commit 21b8988f80)
2022-08-01 10:12:07 +02:00
Arаm Sаrgsyаn d82f56b972 Merge branch '3471-dig-add-qid-into-usage-summary-v9_18' into 'v9_18'
[v9_18] DiG: document +qid=<num> option in the usage summary

See merge request isc-projects/bind9!6621
2022-07-28 10:16:39 +00:00
Aram Sargsyan 80094e4503 DiG: document +qid=<num> option in the usage summary
The +qid=<num> option, which sets the outgoing query ID, was missing
from the usage summary printed using `dig -h` command.

(cherry picked from commit 4dcc855093)
2022-07-28 09:14:56 +00:00
Mark Andrews 78a14a5f07 Merge branch 'marka-set-suffix-in-ans.py-v9_18' into 'v9_18'
Ensure suffix is always valid in bin/tests/system/qmin/ans4/ans.py [v9_18]

See merge request isc-projects/bind9!6619
2022-07-27 19:07:11 +00:00
Mark Andrews 8fa29c5699 Ensure suffix is always valid in bin/tests/system/qmin/ans4/ans.py
initalise suffix to ""

    170        r.answer.append(
    171            dns.rrset.from_text(
    172                lqname + suffix, 1, IN, NS, "a.bit.longer.ns.name." + suffix
    173            )
    174        )
    175        r.flags |= dns.flags.AA
           15. Condition endswith(lqname, "icky.ptang.zoop.boing."), taking true branch.
    176    elif endswith(lqname, "icky.ptang.zoop.boing."):
           CID 350722 (#7 of 7): Bad use of null-like value (FORWARD_NULL)
           16. invalid_operation: Invalid operation on null-like value suffix.
    177        r.authority.append(
    178            dns.rrset.from_text(
    179                "icky.ptang.zoop.boing." + suffix,
    180                1,
    181                IN,
    182                SOA,
    183                "ns2." + suffix + " hostmaster.arpa. 2018050100 1 1 1 1",
    184            )
    185        )

(cherry picked from commit eb798d0478)
2022-07-27 14:27:18 -04:00
Artem Boldariev a524cef8af Merge branch 'artem-tls-streamdns-fixes-part2-v9-18' into 'v9_18'
[Backport to v9.18] TLS-related fixes from Stream DNS and Loop Manager branches

See merge request isc-projects/bind9!6617
2022-07-26 13:03:42 +00:00
Artem Boldariev a957511734 TLS: fix double resumption in isc__nm_tls_resumeread()
This commit fixes an obvious error in isc__nm_tls_resumeread() so that
read cannot be resumed twice.
2022-07-26 15:27:40 +03:00
Artem Boldariev a165b66fc7 TLS: clear 'errno' when handling SSL status
Sometimes tls_do_bio() might be called when there is no new data to
process (most notably, when resuming reads), in such a case internal
TLS session state will remain untouched and old value in 'errno' will
alter the result of SSL_get_error() call, possibly making it to return
SSL_ERROR_SYSCALL. This value will be treated as an error, and will
lead to closing the connection, which is not what expected.
2022-07-26 15:27:40 +03:00
Mark Andrews 80f777ccfe Merge branch '3469-auto-disable-rsasha1-and-nsec3rsasha1-when-not-supported-by-the-os-v9_18' into 'v9_18'
Check that we can verify a signature at initialisation time [v9_18]

See merge request isc-projects/bind9!6614
2022-07-25 15:51:23 +00:00
Mark Andrews 676a6456e8 Add release note for [GL #3469]
(cherry picked from commit 16b133af40)
2022-07-25 10:59:38 -04:00
Mark Andrews d0b48df8ea CHANGES note for [GL #3469]
(cherry picked from commit c549249cb9)
2022-07-25 10:59:38 -04:00
Mark Andrews f3a0dac057 Check that we can verify a signature at initialisation time
Fedora 33 doesn't support RSASHA1 in future mode.  There is no easy
check for this other than by attempting to perform a verification
using known good signatures.  We don't attempt to sign with RSASHA1
as that would not work in FIPS mode.  RSASHA1 is verify only.

The test vectors were generated using OpenSSL 3.0 and
util/gen-rsa-sha-vectors.c.  Rerunning will generate a new set of
test vectors as the private key is not preserved.

e.g.
	cc util/gen-rsa-sha-vectors.c -I /opt/local/include \
		-L /opt/local/lib -lcrypto

(cherry picked from commit cd3f00874f)
2022-07-25 10:59:38 -04:00
Matthijs Mekking c3ab2a25ef Merge branch '3462-rndc-dumpdb-expired-doesnt-always-work-v9_18' into 'v9_18'
[v9_18] Fix rndc dumpdb -expired for stuck cache contents

See merge request isc-projects/bind9!6612
2022-07-25 14:54:30 +00:00
Matthijs Mekking acdde6f0a4 Add change entry and release note for #3462
News worthy.

(cherry picked from commit 44bbc0175c)
2022-07-25 16:29:41 +02:00
Matthijs Mekking 56f1bf250d Fix rndc dumpdb -expired for stuck cache contents
The command 'rndc dumpdb -expired' will include expired RRsets in the
output, but only for the RBTDB_VIRTUAL time (of 5 minutes). This means
that if there is a cache cleaning problem and contents are not cleaned
up, the rndc command has little diagnostic value. Fix this by including
all RRsets in the dumpdb output if the '-expired' flag is set.

(cherry picked from commit 930ba2c914)
2022-07-25 16:28:18 +02:00
Evan Hunt 78ea0a36a4 Merge branch '2918-deprecate-max-zone-ttl-v9_18' into 'v9_18'
dnssec-policy max-zone-ttl was not fully effective

See merge request isc-projects/bind9!6599
2022-07-22 20:34:16 +00:00
Evan Hunt 3c533374da CHANGES and release note for [GL #2918] 2022-07-22 13:13:43 -07:00
Evan Hunt 4720f13730 warn about zones with both dnssec-policy and max-zone-ttl
max-zone-ttl in zone/view/options is a no-op if dnssec-policy
is in use, so generate a warning.
2022-07-22 13:13:24 -07:00
Evan Hunt a8e596e32c clarify "max-zone-ttl" documentation
The "max-zone-ttl" option should now be configured as part of
dnssec-policy. Use of this option in zone/view/options will be ignored
in any zone that also has dnssec-policy configured.
2022-07-22 13:13:24 -07:00
Matthijs MekkingandEvan Hunt 793554c6ce Reject zones with TTL higher than dnssec-policy max-zone-ttl
Reject loading of zones with TTL higher than the max-zone-ttl
from the dnssec-policy.

With this change, any zone with a dnssec-policy in use will ignore
the max-zone-ttl option in zone/view/options.
2022-07-22 13:13:24 -07:00
Matthijs MekkingandEvan Hunt 9c872756c3 Test dnssec-policy max-zone-ttl rejects zone with too high TTL
Similar to the 'max-zone-ttl' zone option, the 'dnssec-policy' option
should reject zones with TTLs that are out of range.
2022-07-22 13:13:24 -07:00
Arаm Sаrgsyаn d8acad751e Merge branch '3419-dig-nssearch-query-failure-robustness-v9_18' into 'v9_18'
[v9_18] Fix DiG query error handling robustness in NSSEARCH mode

See merge request isc-projects/bind9!6609
2022-07-22 10:24:48 +00:00
Aram Sargsyan 525c0e9d38 Add CHANGES note for [GL #3419]
(cherry picked from commit e038970872)
2022-07-22 09:41:53 +00:00
Aram Sargsyan ab8343a5f6 dig +nssearch: send more queries even if setting up one of them fails
In the NSSEARCH followup lookup, when one of the queries fails to be
set up (UDP) or connected (TCP), DiG doesn't start the next query.
This is a mistake, because in NSSEARCH mode the queries are independent
and DiG shouldn't stop the lookup process just because setting up (or
connecting to) one of the name servers returns an error code in the
`udp_ready()` or `tcp_connected()` callbacks.

Write a new `nssearch_next()` function which takes care of starting the
next query in NSSEARCH mode, so it can be used in several places without
code repetition.

Make sure that the `udp_ready()` and `tcp_connected()` functions call
`nssearch_next()` in case they won't be calling `send_udp()` and
`send_tcp()` respectively, because in that case the `send_done()`
callback, which usually does the job, won't be called.

Refactor `send_done()` to use the newly written `nssearch_next()`
function.

(cherry picked from commit 76bee507b7)
2022-07-22 09:41:47 +00:00
Aram Sargsyan 8fecc9dc1e dig +nssearch: send more queries even if sending the previous one fails
In the NSSEARCH followup lookup, when one of the queries fails to be
sent, DiG doesn't start the next query. This is a mistake, because in
NSSEARCH mode the queries are independent and DiG shouldn't stop the
lookup process just because sending a query to one of the name servers
returns an error code.

Restructure the `send_done()` function to unconditionally send the next
query in NSSEARCH mode, if it exists.

(cherry picked from commit 49ac879dfa)
2022-07-22 09:41:41 +00:00
Arаm Sаrgsyаn 5d47d4e342 Merge branch '3407-dighost-udp-fail-over-other-nameservers-v9_18' into 'v9_18'
[v9_18] Fix DiG UDP query retry and fail-over bug

See merge request isc-projects/bind9!6608
2022-07-22 09:37:53 +00:00
Aram Sargsyan c0bb75e9ef Suppress warning/error comments in dig outputs for "rrsetorder" test
In the CI dig sometimes produces warning/error comments when
communicating with the server, which produces problems when comparing
the outputs.

Here is an example of a dig output with a warning message which
is benign, because dig, after a retry, managed to query the server.

;; communications error to 10.53.0.3#7529: timed out
1.2.3.1
1.2.3.2
1.2.3.3
1.2.3.4

When comparing this to the expected output, which doesn't contain
the comment line (starting with double ';'), the outputs don't match.

Use grep inverse logic to strip the comments from the dig outputs.

(cherry picked from commit a5b2aa7c97)
2022-07-22 09:03:54 +00:00
Aram Sargsyan 8bdc4e40de Add CHANGES note for [GL #3407]
(cherry picked from commit 1554faa476)
2022-07-22 09:03:39 +00:00
Aram Sargsyan 048a035267 Add "digdelv" test to simulate DiG network unreachable error
There are existing tests for simulating timeouts, read errors, and
refused connecion errors. Implement also "network unreachable"
simulation.

Use "fixed" string search mode `-F` for `grep` in more places where
it is appropriate to do so.

(cherry picked from commit 626fbf325e)
2022-07-22 09:00:31 +00:00
Aram Sargsyan 29057d9911 DiG: use the same retry and fail-over logic for different failure types
DiG implements different logic in the `recv_done()` callback function
when processing a failure:

1. For a timed-out query it applies the "retries" logic first, then,
   when it fails, fail-overs to the next server.

2. For an EOF (end-of-file, or unexpected disconnect) error it tries to
   make a single retry attempt (even if the user has requested more
   retries), then, when it fails, fail-overs to the next server.

3. For other types of failures, DiG does not apply the "retries" logic,
   and tries to fail-over to the next servers (again, even if the user
   has requested to make retries).

Simplify the logic and apply the same logic (1) of first retries, and
then fail-over, for different types of failures in `recv_done()`.

(cherry picked from commit abfd0d363f)
2022-07-22 09:00:21 +00:00
Aram Sargsyan 6efb73d4bb Fix DiG query retry and fail-over bug
When the `send_done()` callback function gets called with a failure
result code, DiG erroneously cancels the lookup.

Stop canceling the lookup and give DiG a chance to retry the failed
query, or fail-over to another server, using the logic implemented in
the `recv_done()` callback function.

(cherry picked from commit c2329dd110)
2022-07-22 09:00:15 +00:00
Aram Sargsyan be8ec6ef18 Fix DiG UDP query retry and fail-over bug
When the `udp_ready()` callback function gets called with a failure
result code, DiG erroneously cancels the lookup.

Copy the logic behind `tcp_connected()` callback function into
`udp_ready()` so that DiG will now retry the failed query (if retries
are enabled) and then, if it fails again, it will fail-over to the next
server in the list, which synchronizes the behavior between TCP and UDP
modes.

Also, `udp_ready()` was calling `lookup_detach()` without calling
`lookup_attach()` first, but the issue was masked behind the fact
that `clear_current_lookup()` wasn't being called when needed, and
`lookup_detach()` was compensating for that. This also has been fixed.

(cherry picked from commit 3f31085525)
2022-07-22 09:00:08 +00:00
Petr Špaček c003127717 Merge branch 'pspacek/arm-zombie-support-v9_18' into 'v9_18'
Support ancient build tools for the ARM [v9_18]

See merge request isc-projects/bind9!6605
2022-07-21 13:30:27 +00:00
Petr Špaček c56bcbdb6a Support Sphinx 1.6.7
Luckily we don't rely on SphinxDirective functionality which does not
exist in 1.6.7. Replace it with docutils Directive.

transform_content() callback was added only in Sphinx 3.0.0.
Detect if it was not called and call it manually.
The transform_content() function requires access to inner "contentnode"
which is created inside run(). This workaround relies on the order of
node as it was in the pre-3.0.0 versions, but it should not matter as
new versions will not trigger the workaround.

(cherry picked from commit 8796ad7fe8)
2022-07-21 15:26:26 +02:00
Petr Špaček 5864cac5d4 Support docutils 0.14+dfsg-4
Ancient versions of docutils cannot cope with bare text inside a table
cell. Wrap text in a paragraph to work around that.

(cherry picked from commit af5bbb433a)
2022-07-21 15:26:22 +02:00
Petr Špaček 3818a87e95 Merge branch 'pspacek/minor-arm-tweaks-and-fixes-v9_18' into 'v9_18'
Fix dnssec-signzone examples in DNSSEC Guide [v9_18]

See merge request isc-projects/bind9!6603
2022-07-21 13:19:24 +00:00
Petr Špaček d40615d881 Avoid opt-out flag in dnssec-signzone examples
Since !6413 we discourage opt-out, so we should not be advertising it in
the examples. Even worse, it was just thrown into the command line
without even mentioning its meaning in the surrounding text.

Related: !6413
(cherry picked from commit beae857288)
2022-07-21 15:18:55 +02:00
Petr Špaček a927799e84 Remove errorneous shell output redirection from dnssec-signzone example
The > looked like shell output redirection. It was present since we
imported DNSSEC Guide into the ARM.

(cherry picked from commit 1ab564d605)
2022-07-21 15:18:50 +02:00
Michal Nowak d4b00b1dc1 Merge tag 'v9_18_5' into v9_18
BIND 9.18.5
2022-07-21 12:31:03 +02:00
Michał Kępień 98258e21b5 Merge branch 'michal/run-a-short-respdiff-test-for-all-merge-requests-v9_18' into 'v9_18'
[v9_18] Run a short respdiff test for all merge requests

See merge request isc-projects/bind9!6590
2022-07-18 13:33:49 +00:00
Michał Kępień f3e647a4c1 Run a short respdiff test for all merge requests
Running a respdiff test for every merge request would be useful for
catching protocol-breaking changes before they are applied to the source
code.  However, the existing respdiff-based tests take a while to
complete (about half an hour with our current CI infrastructure), which
does not make them a good fit for this purpose.  Add a new GitLab CI
job, "respdiff-short", which uses a smaller query set that gets
processed within a couple of minutes on our current CI infrastructure.
Rename the existing respdiff-based jobs to make distinguishing them
easier.

(cherry picked from commit 31ee43a314)
2022-07-18 15:25:17 +02:00
Michał Kępień 82b6a388fc Extract respdiff job definition to a YAML anchor
Ensure the common parts of all jobs using respdiff are available in the
form of a reusable YAML anchor, to reduce code duplication and to
simplify adding more respdiff-based jobs to GitLab CI.

(cherry picked from commit ca20a189f7)
2022-07-18 15:25:17 +02:00
Michał Kępień 7d02e1088c Use a pre-built executable as the reference named
The "respdiff" GitLab CI job compares DNS responses produced by the
current version of named with those produced by a reference version.
The latter is built from source in each "respdiff" job, despite the fact
that the reference version changes very rarely.  Use a pre-built named
executable as the reference version instead, assuming it is available in
the OS image used for "respdiff" tests.

(cherry picked from commit ab90a4705a)
2022-07-18 15:25:17 +02:00
Ondřej Surý 116b825b8d Merge branch '3453-cope-with-too-small-BUFSIZ-v9_18' into 'v9_18'
Increase the BUFSIZ-long buffers [v9.18]

See merge request isc-projects/bind9!6586
2022-07-15 20:40:03 +00:00
Ondřej Surý 3c1d6e164e Increase the BUFSIZ-long buffers
The BUFSIZ value varies between platforms, it could be 8K on Linux and
512 bytes on mingw.  Make sure the buffers are always big enough for the
output data to prevent truncation of the output by appropriately
enlarging or sizing the buffers.

(cherry picked from commit b19d932262)
2022-07-15 21:16:51 +02:00
Michał Kępień c447008196 Merge branch '3443-memory-related-cleanups-v9_18' into 'v9_18'
[v9_18] Memory-related cleanups

See merge request isc-projects/bind9!6568
2022-07-15 08:36:18 +00:00
Michał Kępień 93ded5cca2 Update documentation for named's -M option
Remove "external" from the list of legal values for the -M command-line
option as it has not been allowed since the internal memory allocator
was removed by commit 55ace5d3aa.

Make the style of the relevant paragraph more in line with the next one
and split its contents up into an unordered list of options for improved
readability.

(cherry picked from commit f0c31ceb3b)
2022-07-15 10:31:53 +02:00
Evan Hunt ba16ff2da5 Merge branch '3456-dispatch-connect-race-v9_18' into 'v9_18'
remove unnecessary assertion in dns_dispatch_connect()

See merge request isc-projects/bind9!6584
2022-07-15 04:18:05 +00:00
Evan Hunt 7903bffbc4 remove unnecessary assertion in dns_dispatch_connect()
When a thread calls dns_dispatch_connect() on an unconnected TCP socket
it sets `tcpstate` from `DNS_DISPATCHSTATE_NONE` to `_CONNECTING`.
Previously, it then INSISTed that there were no pending connections
before calling isc_nm_tcpdnsconnect().

If a second thread called dns_dispatch_connect() during that window
of time, it could add a pending connection to the list, and trigger
an assertion failure.

This commit removes the INSIST since the condition is actually
harmless.

(cherry picked from commit 25ddec8a0a)
2022-07-14 19:27:24 -07:00
Ondřej Surý 93757acfe5 Merge branch 'ondrej-fix-timing-error-in-statistics-system-test-v9_18' into 'v9_18'
Wait for TCP connection refused in the statistics system test [v9.18]

See merge request isc-projects/bind9!6583
2022-07-14 20:53:10 +00:00
Ondřej Surý c6b4d82557 Wait for TCP connection refused in the statistics system test
The statistics system test makes a query to foo.info to check for the
pending connections because the ans4 doesn't respond to the query.

This might or might not (depending on exact timing) increment the failed
TCP connection counter when the query is retried over TCP because ans4
doesn't listen on the TCP.

Wait for the 'connection refused' in the ns3 log file to be able to
count the exactly 1 failed TCP connection.

(cherry picked from commit 0227d82dc8)
2022-07-14 22:34:08 +02:00
Ondřej Surý 54ec179723 Merge branch '3451-handle-transient-TCP-connect-EADDRINUSE-on-BSDs-v9_18' into 'v9_18'
Handle the transient TCP connect() failures on FreeBSD [v9.18]

See merge request isc-projects/bind9!6582
2022-07-14 20:13:12 +00:00
Ondřej Surý c79ee8daa1 Add CHANGES note for [GL #3451]
(cherry picked from commit a9c54ecdc6)
2022-07-14 21:48:48 +02:00
Ondřej Surý d242ced18f Cleanup the STATID_CONNECT and STATID_CONNECTFAIL stat counters
The STATID_CONNECT and STATID_CONNECTFAIL statistics were used
incorrectly. The STATID_CONNECT was incremented twice (once in
the *_connect_direct() and once in the callback) and STATID_CONNECTFAIL
would not be incremented at all if the failure happened in the callback.

Closes: #3452
(cherry picked from commit 59e1703b50)
2022-07-14 21:48:44 +02:00
Ondřej Surý 259f4481bd Handle the transient TCP connect() failures on FreeBSD
On FreeBSD (and perhaps other *BSD) systems, the TCP connect() call (via
uv_tcp_connect()) can fail with transient UV_EADDRINUSE error.  The UDP
code already handles this by trying three times (is a charm) before
giving up.  Add a code for the TCP, TCPDNS and TLSDNS layers to also try
three times before giving up by calling uv_tcp_connect() from the
callback two more time on UV_EADDRINUSE error.

Additionally, stop the timer only if we succeed or on hard error via
isc__nm_failed_connect_cb().

(cherry picked from commit b21f507c0a)
2022-07-14 21:47:47 +02:00
Mark Andrews 5ba1038a1b Merge branch '3447-lib-dns-tkey-c-free_namelist-should-be-disassociating-associated-rdatatsets-v9_18' into 'v9_18'
disassociate rdatasets when cleaning up [v9_18]

See merge request isc-projects/bind9!6577
2022-07-14 00:58:59 +00:00
Mark Andrews 937794c2da disassociate rdatasets when cleaning up
free_namelist could be passed names with associated rdatasets
when handling errors.  These need to be disassociated before
calling dns_message_puttemprdataset.

(cherry picked from commit 745d5edc3a)
2022-07-14 10:21:38 +10:00
Mark Andrews 4ae0a18a51 Merge branch '3449-kasp-system-test-failed-to-log-some-zones-during-setup-v9_18' into 'v9_18'
kasp: add missing logging during setup [v9_18]

See merge request isc-projects/bind9!6575
2022-07-14 00:13:30 +00:00
Mark Andrews 190784a779 kasp: add missing logging during setup
Some zones where not being logged when just DNSSEC keys where being
generated in system test setup phase.  Add logging for these zones.

(cherry picked from commit 04627997eb)
2022-07-14 09:46:06 +10:00
Ondřej Surý 7af589693f Merge branch 'ondrej-update-dir-locals-for-libtest-v9_18' into 'v9_18'
Update the .dir-locals.el for libtest [v9.18]

See merge request isc-projects/bind9!6566
2022-07-13 10:22:55 +00:00
Ondřej Surý d2bdb6fe3d Update the .dir-locals.el for libtest
The tests/libtest directory is missing from the .dir-locals.el, so the
emacs flycheck would not work for the unit tests.  Add it to the
configuration.

(cherry picked from commit 80fbd849d5)
2022-07-13 12:20:16 +02:00
Michał Kępień 788939a510 Merge branch '3439-stop-resolving-invalid-names-in-resume_dslookup-v9_18' into 'v9_18'
[v9_18] Stop resolving invalid names in resume_dslookup()

See merge request isc-projects/bind9!6564
2022-07-13 09:32:55 +00:00
Michał Kępień 410456d3d8 Add CHANGES entry and release note for GL #3439
(cherry picked from commit cfa398ad37)
2022-07-13 11:00:32 +02:00
Michał Kępień b855c6b6c9 Stop resolving invalid names in resume_dslookup()
Commit 7b2ea97e46 introduced a logic bug
in resume_dslookup(): that function now only conditionally checks
whether DS chasing can still make progress.  Specifically, that check is
only performed when the previous resume_dslookup() call invokes
dns_resolver_createfetch() with the 'nameservers' argument set to
something else than NULL, which may not always be the case.  Failing to
perform that check may trigger assertion failures as a result of
dns_resolver_createfetch() attempting to resolve an invalid name.

Example scenario that leads to such outcome:

 1. A validating resolver is configured to forward all queries to
    another resolver.  The latter returns broken DS responses that
    trigger DS chasing.

 2. rctx_chaseds() calls dns_resolver_createfetch() with the
    'nameservers' argument set to NULL.

 3. The fetch fails, so resume_dslookup() is called.  Due to
    fevent->result being set to e.g. DNS_R_SERVFAIL, the default branch
    is taken in the switch statement.

 4. Since 'nameservers' was set to NULL for the fetch which caused the
    resume_dslookup() callback to be invoked
    (fctx->nsfetch->private->nameservers), resume_dslookup() chops off
    one label off fctx->nsname and calls dns_resolver_createfetch()
    again, for a name containing one label less than before.

 5. Steps 3-4 are repeated (i.e. all attempts to find the name servers
    authoritative for the DS RRset being chased fail) until fctx->nsname
    becomes stripped down the the root name.

 6. Since resume_dslookup() does not check whether DS chasing can still
    make progress, it strips off a label off the root name and continues
    its attempts at finding the name servers authoritative for the DS
    RRset being chased, passing an invalid name to
    dns_resolver_createfetch().

Fix by ensuring resume_dslookup() always checks whether DS chasing can
still make progress when a name server fetch fails.  Update code
comments to ensure the purpose of the relevant dns_name_equal() check is
clear.

(cherry picked from commit 1a79aeab44)
2022-07-13 11:00:32 +02:00
Evan Hunt 2d5ad9cd49 Merge branch '2962-invalid-fctx-v9_18' into 'v9_18'
clear fctx->magic and fetch->magic when destroying

See merge request isc-projects/bind9!6554
2022-07-13 05:43:04 +00:00
Evan HuntandMark Andrews b66cd7b2fc clear fctx->magic and fetch->magic when destroying
fctx_destroy() and dns_resolver_destroyfetch() did not clear the
'magic' field during destruction.

(cherry picked from commit 5ec077e6aa)
2022-07-13 02:12:35 +00:00
Mark Andrews b8d5763494 Merge branch '3446-autosign-s-checking-revoked-key-with-duplicate-key-id-test-was-incomplete-v9_18' into 'v9_18'
Make "checking revoked key with duplicate key ID" work [v9_18]

See merge request isc-projects/bind9!6559
2022-07-13 01:54:03 +00:00
Mark Andrews 484c74f5f4 Make "checking revoked key with duplicate key ID" work
There should be 2 keys with the same key id after the numerically
lower one is revoked (serial space arithmetic).  The DS points
at the non-revoked key so validation should still succeed.

(cherry picked from commit 513cb24b55)
2022-07-13 11:22:52 +10:00
Mark Andrews f62e6d870d Merge branch '3445-update-libdns_la_libadd-instead-of-libdns_la_ldflags-v9_18' into 'v9_18'
Update libdns_la_LIBADD rather than libdns_la_LDFLAGS [v9_18]

See merge request isc-projects/bind9!6557
2022-07-13 01:02:14 +00:00
Mark Andrews 7f101aeb53 Update libdns_la_LIBADD rather than libdns_la_LDFLAGS
the wrong macro was being update with MAXMINDDB_LIBS making
it difficult to adjust link order.

(cherry picked from commit 5b51610174)
2022-07-13 10:46:37 +10:00
Evan Hunt 7994f1368c Merge branch '2683-ixfr-logging-v9_18' into 'v9_18'
log the reason for falling back to AXFR from IXFR at level info

See merge request isc-projects/bind9!6551
2022-07-12 23:52:38 +00:00
Evan Hunt cc3070a0b3 log the reason for falling back to AXFR from IXFR at level info
messages indicating the reason for a fallback to AXFR (i.e, because
the requested serial number is not present in the journal, or because
the size of the IXFR response would exceeed "max-ixfr-ratio") are now
logged at level info instead of debug(4).

(cherry picked from commit df1d81cf96)
2022-07-12 16:26:13 -07:00
Matthijs Mekking 06c6c3d2f3 Merge branch '3438-dnssec-policy-does-not-set-inline-signing-v9_18' into 'v9_18'
[v9_18] Fix inheritance for dnssec-policy when checking for inline-signing

See merge request isc-projects/bind9!6546
2022-07-12 15:23:09 +00:00
Matthijs Mekking 383fe2f4ba Add release note and change entry for #3438
Bug worth mentioning.

(cherry picked from commit 689215a675)
2022-07-12 17:22:39 +02:00
Matthijs Mekking 235b89dbcd Inherit dnssec-policy in check for inline-signing
When dnssec-policy is used, and the zone is not dynamic, BIND will
assume that the zone is inline-signed. But the function responsible
for this did not inherit the dnssec-policy option from the view or
options level, and thus never enabled inline-signing, while the zone
should have been.

This is fixed by this commit.

(cherry picked from commit 576b21b168)
2022-07-12 17:22:39 +02:00
Matthijs Mekking 718d7bdeb9 Test setting of inline-signing with dnssec-policy
When dnssec-policy is used, and the zone is not dynamic, BIND will
assume that the zone is inline-signed. Add test cases to verify this.

(cherry picked from commit efa8a4e88d)
2022-07-12 17:22:39 +02:00
Matthijs Mekking 3f54a0f051 Fix kasp system test bugs
Fix a comment, ensuring the right parameters are used (zone is
parameter $3, not $2) and add view and policy parameters to the comment.

Fix the view tests and test the correct view (example3 instead of
example2).

Fix placement of "n=$((n+1)" for two test cases.

(cherry picked from commit ff65f07779)
2022-07-12 17:22:39 +02:00
Artem Boldariev 3d98312a7b Merge branch 'artem-backport-tls-related-fixes-from-loopmgr-branch-v9-18' into 'v9_18'
[Backport to 9.18] Backport TLS-related fixes from the loopmgr-branch

See merge request isc-projects/bind9!6550
2022-07-12 13:13:39 +00:00
Artem Boldariev 814baa3e6b TLS: do not ignore accept callback result
Before this change the TLS code would ignore the accept callback result,
and would not try to gracefully close the connection. This had not been
noticed, as it is not really required for DoH. Now the code tries to
shut down the TLS connection gracefully when accepting it is not
successful.

(cherry picked from commit ffcb54211e)
2022-07-12 15:32:45 +03:00
Artem Boldariev d6041e5d45 *_noresponse, tlsdns_listen_noalpn: csends == 1 is not guaranteed
This commit removes an assertion from the unit test which cannot be
guaranteed.

According to the test, exactly one client send must succeed. However,
it cannot really be guaranteed, as do not start to read data in the
accept callback on the server nor attach to the accepted handle. Thus,
we can expect the connection to be closed soon after we have returned
from the callback.

Interestingly enough, the test would pass just fine on TCP because:

a) there are fewer layers involved and thus there is less processing;

b) it is possible for the data to be sent and end up in an internal OS
socket buffer without being touched by an application's code on the
server. In such a case the client's write callback still would be
called successfully;

There is a chance for the test to succeed over TLS as well (as it
happily did before), but as the code has been changed to close unused
connections as soon as possible, the chance is far slimmer now.

What can be guaranteed is:

* cconnects == 1 (number client connections equals 1);
* saccepts == 1 (number of accepted connections equals 1).

(cherry picked from commit 0f9b6a7bc1)
2022-07-12 15:31:20 +03:00
Artem Boldariev c85949fbe1 TLSDNS: try pass incoming data to OpenSSL if there are any
Otherwise the code path will lead to a call to SSL_get_error()
returning SSL_ERROR_SSL, which in turn might lead to closing
connection to early in an unexpected way, as it is clearly not what is
intended.

The issue was found when working on loppmgr branch and appears to
be timing related as well. Might be responsible for some unexpected
transmission failures e.g. on zone transfers.

(cherry picked from commit 8585b92f98)
2022-07-12 15:29:36 +03:00
Artem Boldariev ba7fabde01 TLS: bail out earlier when NM is stopping
In some operations - most prominently when establishing connection -
it might be beneficial to bail out earlier when the network manager
is stopping.

The issue is backported from loopmgr branch, where such a change is
not only beneficial, but required.

(cherry picked from commit fc74b15e67)
2022-07-12 15:28:15 +03:00
Artem Boldariev 0754def85d TLS: sometimes TCP conn. handle might be NULL on when connecting
In some cases - in particular, in case of errors, NULL might be passed
to a connection callback instead of a handle that could have led to
an abort. This commit ensures that such a situation will not occur.

The issue was found when working on the loopmgr branch.

(cherry picked from commit ac4fb34f18)
2022-07-12 15:26:50 +03:00
Artem Boldariev c44633feb2 TLS: try to close sockets whenever there are no pending operations
This commit ensures that the underlying TCP socket of a TLS connection
gets closed earlier whenever there are no pending operations on it.

In the loop-manager branch, in some circumstances the connection
could have remained opened for far too long for no reason. This
commit ensures that will not happen.

(cherry picked from commit 88524e26ec)
2022-07-12 15:25:30 +03:00
Artem Boldariev 3e69cc35b8 TLS: Implement isc_nmhandle_setwritetimeout()
This commit adds a proper implementation of
isc_nmhandle_setwritetimeout() for TLS connections. Now it passes the
value to the underlying TCP handle.

(cherry picked from commit 237ce05b89)
2022-07-12 15:22:57 +03:00
Michal Nowak 4884ac3355 Merge branch 'mnowak/alpine-3.16-v9_18' into 'v9_18'
[v9_18] Add Alpine Linux 3.16

See merge request isc-projects/bind9!6548
2022-07-12 11:33:24 +00:00
Michal Nowak 1e386c5489 Add Alpine Linux 3.16
(cherry picked from commit 0d0ab3db10)
2022-07-12 13:11:48 +02:00
Mark Andrews bcc5fc4a10 Merge branch '3389-unexpected-badkey-in-upforwd-system-test-v9_18' into 'v9_18'
Clone the message buffer before forwarding UPDATE messages [v9_18]

See merge request isc-projects/bind9!6544
2022-07-12 10:05:54 +00:00
Mark Andrews 4be9aba39e Add CHANGES note for [GL #3389]
(cherry picked from commit 09d8ed3970)
2022-07-12 19:01:18 +10:00
Mark Andrews 44bfc8a9b2 Clone the message buffer before forwarding UPDATE messages
this prevents named forwarding a buffer that may have been over
written.

(cherry picked from commit 7a42417d61)
2022-07-12 19:00:38 +10:00
Michał Kępień 068741dbe6 Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.18.6' into 'v9_18'
Set up version and release notes for BIND 9.18.6

See merge request isc-projects/bind9!6539
2022-07-11 07:05:55 +00:00
Michał Kępień c7f1ee665b Set up release notes for BIND 9.18.6 2022-07-11 08:51:32 +02:00
Michał Kępień be9c6f44f3 Update BIND version to 9.18.6-dev 2022-07-11 08:51:32 +02:00
Michał Kępień 6593103e39 Update BIND 9 version for release 2022-07-07 16:47:02 +02:00
Michał Kępień 6160acd95f Add a CHANGES marker 2022-07-07 16:47:02 +02:00
Michał Kępień ca10113ebc Merge branch 'michal/prepare-documentation-for-bind-9.18.5' into 'v9_18_5-release'
Prepare documentation for BIND 9.18.5

See merge request isc-private/bind9!413
2022-07-07 14:45:28 +00:00
Michał Kępień a6e2b60441 Add release note for GL #3415 2022-07-07 16:34:14 +02:00
Michał Kępień 26fb108f1a Add release note for GL #3152 2022-07-07 16:34:14 +02:00
Michał Kępień 6fbda28db5 Reorder release notes 2022-07-07 16:34:14 +02:00
Michał Kępień 9eb6e06f57 Tweak and reword release notes 2022-07-07 16:34:14 +02:00
Michał Kępień f213447546 Prepare release notes for BIND 9.18.5 2022-07-07 16:34:14 +02:00
Mark Andrews a93f5ed51d Merge branch '3433-support-default-hmac-v9_18' into 'v9_18'
Support DEFAULT_HMAC [v9_18]

See merge request isc-projects/bind9!6533
2022-07-07 05:06:48 +00:00
Mark Andrews ba45075acb Add DEFAULT_HMAC to conf.sh.common
(cherry picked from commit 972d7fd682)
2022-07-07 13:26:16 +10:00
Mark Andrews d4297eed9c Merge branch '3061-ifconfig-sh-down-messes-up-loopback-interfaces-v9_18' into 'v9_18'
update ifconfig.sh [v9_18]

See merge request isc-projects/bind9!6530
2022-07-07 00:52:51 +00:00
Mark Andrews 6311d9d2f6 Add CHANGES note for [GL #3061]
(cherry picked from commit e0708c8950)
2022-07-07 10:13:00 +10:00
Mark Andrews 5a58e8af8d update ifconfig.sh
* make it harder to get the interface numbers wrong by using 'max'
to specify the upper bound of the sequence of interfaces and use 'max'
when calculating the interface number
* extract the platform specific instruction into 'up' and 'down'
and call them from the inner loop so that the interface number is
calculated in one place.
* calculate the A and AAAA address in a single place rather than
in each command
* use /sbin/ipadm on Solaris 2.11 and greater

(cherry picked from commit abfb5b1173)
2022-07-07 10:13:00 +10:00
Evan Hunt 382cac0f4f Merge branch '3152-retry-on-formerr-v9_18' into 'v9_18'
try other servers when receiving FORMERR

See merge request isc-projects/bind9!6529
2022-07-06 22:39:36 +00:00
Evan HuntandMark Andrews 19be66772c CHANGES for [GL #3152]
(cherry picked from commit 43e38a21ef)
2022-07-06 22:19:20 +00:00
Evan HuntandMark Andrews 30534b125e try other servers when receiving FORMERR
previously, when an iterative query returned FORMERR, resolution
would be stopped under the assumption that other servers for
the same domain would likely have the same capabilities. this
assumption is not correct; some domains have been reported for
which some but not all servers will return FORMERR to a given
query; retrying allows recursion to succeed.

(cherry picked from commit f6abb80746)
2022-07-06 22:19:20 +00:00
Mark Andrews 12224771d0 Merge branch '3402-create-synth-from-dnssec-namespaces-v9_18' into 'v9_18'
Add a mechanism to record namespaces for synth-from-dnssec [v9_18]

See merge request isc-projects/bind9!6528
2022-07-06 22:18:23 +00:00
Mark Andrews 1872105f09 Add release note for [GL #3402]
(cherry picked from commit 07d5c23cac)
2022-07-07 07:47:45 +10:00
Mark Andrews fa4eb975b8 Add CHANGES note for [GL #3402]
(cherry picked from commit 682c6eb533)
2022-07-07 07:47:45 +10:00
Mark Andrews 443fb79a2c Test grafting and synth-from-dnssec using primary zone
(cherry picked from commit 33454fb0e9)
2022-07-07 07:47:45 +10:00
Mark Andrews 00db079f79 Add system test for forward only grafted zone with synth-from-dnssec
We are grafting on an unsigned zone "example.internal" where the higher
zone (".") is signed and would otherwise cause named to synthesise a
NXDOMAIN for example.internal.  We prime the cache by performing a
lookup for "internal" and then lookup "example.internal".

(cherry picked from commit 8af5d0ad68)
2022-07-07 07:47:45 +10:00
Mark Andrews 30d4e3ee89 Add synth-from-dnssec namespaces for keytable entries
We do this by adding callbacks for when a node is added or deleted
from the keytable.  dns_keytable_add and dns_keytable_delete where
extended to take a callback.  dns_keytable_deletekey does not remove
the node so it was not extended.

(cherry picked from commit a5b57ed293)
2022-07-07 07:47:45 +10:00
Mark Andrews 90467f4127 Add synth-from-dnssec namespace entries for forward only namespaces
Currently forward entries are only removed on view destruction so
there is no matching dns_view_sfd_del call.

(cherry picked from commit a559d6fdd1)
2022-07-07 07:47:45 +10:00
Mark Andrews 107c3a452a Add entries to the synth-from-dnssec namespace tree for zones
When a zone is attached or detached from the view (zone->view is
updated) update the synth-from-dnssec namespace tree.

(cherry picked from commit f716bd68d4)
2022-07-07 07:47:45 +10:00
Mark Andrews 4d9287dca5 Check the synth-form-dnssec namespace when synthesising responses
Call dns_view_sfd_find to find the namespace to be used to verify
the covering NSEC records returned for the given QNAME.  Check that
the NSEC owner names are within that namespace.

(cherry picked from commit 228dadb026)
2022-07-07 07:47:45 +10:00
Mark Andrews b979b6be40 Add a mechanism to record namespaces for synth-from-dnssec
When namespace is grafted on, the DNSSEC proofs for non existance
need to come from that namespace and not a higher namespace.  We
add 3 function dns_view_sfd_add, dns_view_sfd_del and dns_view_sfd_find
to add, remove and find the namespace that should be used when
checking NSEC records.

dns_view_sfd_add adds a name to a tree, creating the tree if needed.
If the name already existed in the tree the reference count is
increased otherwise it is initalised to 1.

dns_view_sfd_del removes a reference to a name in the tree, if the
count goes to 0 the node is removed.

dns_view_sfd_find returns the namespace to be used to entered name.
If there isn't an enclosing name in the tree, or the tree does not
yet exist, the root name is returned.

Access to the tree is controlled by a read/write lock.

(cherry picked from commit 3619cad141)
2022-07-07 07:47:45 +10:00
Mark Andrews f94fb633ef Merge branch '3429-detect-overflow-in-generate-directive-v9_18' into 'v9_18'
Check for overflow in $GENERATE computations [v9_18]

See merge request isc-projects/bind9!6526
2022-07-06 02:04:45 +00:00
Mark Andrews ea80e643f7 Add CHANGES note for [GL #3429]
(cherry picked from commit d935ead14b)
2022-07-06 11:26:02 +10:00
Evan HuntandMark Andrews 2936264dc4 Improve $GENERATE documentation
Clarify the documentation of $GENERATE modifiers and add an example.

(cherry picked from commit 13fb2faf7a)
2022-07-06 11:25:20 +10:00
Mark Andrews 656e33ce18 Tighten $GENERATE directive parsing
The original sscanf processing allowed for a number of syntax errors
to be accepted.  This included missing the closing brace in
${modifiers}

Look for both comma and right brace as intermediate seperators as
well as consuming the final right brace in the sscanf processing
for ${modifiers}.  Check when we got right brace to determine if
the sscanf consumed more input than expected and if so behave as
if it had stopped at the first right brace.

(cherry picked from commit 7be64c0e94)
2022-07-06 11:25:20 +10:00
Mark Andrews 72999440bd Check for overflow in $GENERATE computations
$GENERATE uses 'int' for its computations and some constructions
can overflow values that can be represented by an 'int' resulting
in undefined behaviour.  Detect these conditions and return a
range error.

(cherry picked from commit 5327b9708f)
2022-07-06 11:25:20 +10:00
Evan Hunt 301d8f9fe0 Merge branch 'each-require-has-side-effects-v9_18' into 'v9_18'
REQUIRE should not have side effects

See merge request isc-projects/bind9!6525
2022-07-05 21:08:17 +00:00
Evan Hunt b061e86d17 REQUIRE should not have side effects
it's a style violation to have REQUIRE or INSIST contain code that
must run for the server to work. this was being done with some
atomic_compare_exchange calls. these have been cleaned up.  uses
of atomic_compare_exchange in assertions have been replaced with
a new macro atomic_compare_exchange_enforced, which uses RUNTIME_CHECK
to ensure that the exchange was successful.

(cherry picked from commit a499794984)
2022-07-05 13:04:17 -07:00
Mark Andrews e8a5d0444e Merge branch '3437-cds-error-window-too-small-v9_18' into 'v9_18'
Only report not matching stderr content when we look for it [v9_18]

See merge request isc-projects/bind9!6523
2022-07-05 18:34:20 +00:00
Mark Andrews aedcc7c725 Increase the amount of time allowed for signing to occur in
On slow systems we have seen this take 9 seconds.  Increased the
allowance from 3 seconds to 10 seconds to reduce the probabilty of
a false negative from the system test.

(cherry picked from commit 4db847e80e)
2022-07-05 23:12:12 +10:00
Mark Andrews 287241d449 Only report not matching stderr content when we look for it
The previous test code could emit "D:cds:stderr did not match ''" rather
that just showing the contents of stderr.  Moved the debug line inside
the if/else block.

Replaced backquotes with $() and $(()) as approriate.

(cherry picked from commit 304d33fb32)
2022-07-05 23:12:12 +10:00
Petr Špaček 5f382729bf Merge branch 'pspacek/arm-hyperlinks-v9_18' into 'v9_18'
ARM hyperlinking [v9_18]

See merge request isc-projects/bind9!6519
2022-07-04 14:27:33 +00:00
Petr Špaček 5b8fe7d47e Hyperlink adjustments for v9_18
Release notes subdirectory did not match content of the main branch so
we had to do couple more manual tweaks to replace obsolete explicit
links with references to statement link anchors.
2022-07-04 16:22:12 +02:00
Petr Špaček 8db3a6789b Manually hyperlink algorithm, key, options, secret, and server
These statements/block are ambiguos because they occur in named.conf and
rndc.conf as well. All occurences now link link to the matching
definition.

(cherry picked from commit c3fed5ce40)
2022-07-04 16:09:25 +02:00
Petr Špaček 61ecaf55f5 Remove links from logging category names
Some logging categories have the same names as configuration statements.
This caused some category names to be replaced with links to statement
definitions, which confuses util/check-categories.sh script.

(cherry picked from commit e5a12144bd)
2022-07-04 16:09:25 +02:00
Suzanne GoldlustandPetr Špaček e78ef65ef7 Grammar fixes and assorted text edits in the ARM
(cherry picked from commit 6db988e7e3)
2022-07-04 16:09:25 +02:00
Petr Špaček 9ee192d412 Add tables with statements by tag
(cherry picked from commit dd4dc78899)
2022-07-04 16:09:24 +02:00
Petr Špaček 6ef0b58026 Define topmost configuration blocks
(cherry picked from commit f91cbcf996)
2022-07-04 16:09:24 +02:00
Petr Špaček 6e8ee641a0 Alphabetize grammar glossary
(cherry picked from commit 8aea6694bf)
2022-07-04 16:09:24 +02:00
Petr Špaček 53993da1d9 Rename yes_or_no to boolean
The name yes_or_no was used only in two places and rest of the ARM
(except for the grammar glossary...) uses term boolean. Let's stick to
it.

(cherry picked from commit 0138e5c1d5)
2022-07-04 16:09:24 +02:00
Petr Špaček 40a060e22e Deduplicate definitions of address_match_list and address_match_element
It would be better if it fit into the grammar glossary, but it is too
long. A link must do.

(cherry picked from commit decb4643d1)
2022-07-04 16:09:24 +02:00
Petr Špaček 845a2870df Rework size_spec and size_or_percentage definitions
Except for a single case they were not referenced in the text, but at
the same time doc/misc grammar uses terms "size", "sizeval", and
"percetage".

Keywords "default" and "unlimited" are expanded in statement's grammar
anyway, but I kept their description in place because they are generally
allowed at places which accept sizes.

Percentage is also expanded in doc/misc grammars and thus requires
separate definition.

(cherry picked from commit 4915b1f3a1)
2022-07-04 16:09:24 +02:00
Petr Špaček 0edd5bf77b Remove incorrect hyperlinks to file and unix definitions
Terms file and unix have overloaded meaning and were incorrectly linked
during the mass-linking campain.

(cherry picked from commit 1233c86ff7)
2022-07-04 16:09:24 +02:00
Petr Špaček eeb05d5665 Rename port_list to portrange
The old name was not referenced anywhere but the new name is used in
grammar of {avoid,use}-v{4,6}-udp-ports statement.

(cherry picked from commit 8d9c2368a9)
2022-07-04 16:09:24 +02:00
Petr Špaček 2f0c9d4570 Remove path_name grammar definition
It was literally not used anywhere.

(cherry picked from commit 443fb5f34b)
2022-07-04 16:09:24 +02:00
Petr Špaček 4d62710be5 Hyperlink integer to its definition
(cherry picked from commit 55bc6d02a0)
2022-07-04 16:09:24 +02:00
Petr Špaček 69cda54461 Rename number to integer
The term number was used only in other definitions, and at the same time
doc/misc grammar uses term integer.

(cherry picked from commit 9885bf658d)
2022-07-04 16:09:24 +02:00
Petr Špaček 051d72a7ee Clarify and hyperlink tls_id definition
(cherry picked from commit 6f754dae20)
2022-07-04 16:09:24 +02:00
Petr Špaček 2fd8ce0c46 Hyperlink server_id to its definition
(cherry picked from commit 116573a4a7)
2022-07-04 16:09:24 +02:00
Petr Špaček 830e118d6b Rename key_id to server_key
The old name was used in the ARM and rndc manual page but was
inconsistent with doc/misc grammar.

(cherry picked from commit c972fad7b0)
2022-07-04 16:09:23 +02:00
Petr Špaček 3f93e5d9f9 Remove key_list grammar definition
It was used in a single place (inet statement) and it defined it in the
text anyway. Let's not clutter the glossary.

(cherry picked from commit 818219b36a)
2022-07-04 16:09:23 +02:00
Petr Špaček 38436b58d3 Hyperlink port references to appropriate definitions
``port`` used to refer to grammar elements and also to named.conf
option. Both cases are now linked to respective definitions.

(cherry picked from commit 686a15d30f)
2022-07-04 16:09:23 +02:00
Petr Špaček 388e36a4c4 Rename ip_port to port
The old name was used only in couple places, and was inconsistent with
doc/misc grammar.

(cherry picked from commit 7b51a027e7)
2022-07-04 16:09:23 +02:00
Petr Špaček 441e94fe48 Rename ip_dscp to dscp
The old name was literally not used anywhere, not even in the source
code. The new name is used by doc/misc grammar.

(cherry picked from commit d1644f420c)
2022-07-04 16:09:23 +02:00
Petr Špaček aec7ae2d96 Hyperlink netprefix grammar references to the definition
(cherry picked from commit 5ce45d1c04)
2022-07-04 16:09:23 +02:00
Petr Špaček f005a870d9 Hyperlink ip??_address grammar references to their definition
(cherry picked from commit a35c1ae0c2)
2022-07-04 16:09:23 +02:00
Petr Špaček 5268de4007 Rename ip_prefix to netprefix
Let's standardize on netprefix which matches grammar used in doc/misc.

(cherry picked from commit b22bdb3a1b)
2022-07-04 16:09:23 +02:00
Petr Špaček e1757784de Rename ip_addr, ipv4_addr, and ipv6_addr to *_address
The longer variant matches grammar used in doc/misc.

(cherry picked from commit 57f218e65e)
2022-07-04 16:09:23 +02:00
Petr Špaček 70ba197538 Remove dotted_decimal from grammar glossary
This definition was dererenced only once, from ip4_addr definition on
the next line. These two are now collapsed into new ip4_addr definition.

(cherry picked from commit 44c24f3c94)
2022-07-04 16:09:23 +02:00
Petr Špaček a6e4dbe741 Remove namelist from grammar glossary
This definition was used only for deny-answer-aliases statement
description, and moreover the term did not match grammar listed in
doc/misc/options.

I've replaced it with textual expansion of "list of `domain_name`s"
which is used more often.

(cherry picked from commit fe427a8460)
2022-07-04 16:09:23 +02:00
Petr Špaček 77345f7180 Rename remoteserver_list to remote-servers
Name remoteserver_list was not referenced anywhere but the grammar uses
name remote-servers. Rename and add a reference to primaries for more
information.

(cherry picked from commit e59cedea1f)
2022-07-04 16:09:23 +02:00
Petr Špaček da9a247057 Hyperlink domain_name grammar elements
Hyperlinked manually to avoid needless repetition in the Rset ordering
chapter.

(cherry picked from commit 309dbeac7b)
2022-07-04 16:09:22 +02:00
Petr Špaček b6948bf7ce Hyperlink ACL grammar elements
Manual edit required to restore the first occurence of "definition"
inside .. glossary directive.

Generated using:
    N=acl_name; sed -i -e "s/\`\`$N\`\`/:term:\`$N\`/g" $ARMFILES
    N=address_match_list; sed -i -e "s/\`\`$N\`\`/:term:\`$N\`/g" $ARMFILES

(cherry picked from commit 69d0632dc0)
2022-07-04 16:09:22 +02:00
Petr Špaček 557d674583 Remove unreferences dialup_option grammar
I dunno why it was a separate entity in the grammar glossary. It is not
referenced anywhere else except for the the dialup statement, and the
statement describes all its possible values verbosely.

(cherry picked from commit 14c7fb36e7)
2022-07-04 16:09:22 +02:00
Petr Špaček d28f6972ce Manual fixups for new hyperlinks
It turns out that many manual edits were required:
- Heading underlines were too short because :any:`` is longer than ````
- Some statement names clashed with manually defined _link_anchors
  (notify, trust-anchors etc.)
- Zone types are defined like "type primary" in the internal grammar and
  that caused mayhem in the replacement script as it took "type" and
  individual types ("primary", "secondary") as separate statements.
  For that reason :any:`primary` had to be manually replaced with
  :any:`primary <type primary>` where appropriate.
- Sometimes option name is also the same as a value name (e.g. "notify")
  and then it did not make sense to do the replacement.

(cherry picked from commit 9bbcff225b)
2022-07-04 16:09:22 +02:00
Petr Špaček dba86ce710 Add hyperlinks to all unique statement names
This shell script added hyperlinks to all unique statement names:

    UNIQSTATEMENTS=$(\
        sort \
            <(git grep '.. namedconf:statement::' '*.rst' | sed -e 's/^.*:: //') \
            <(git grep '.. rndcconf:statement::' '*.rst' | sed -e 's/^.*:: //') \
        | uniq --unique)
    ARMFILES=$(git ls-files 'doc/*.rst' | grep -v 'doc/man')
    for STATEMENT in $UNIQSTATEMENTS; \
        do sed -i -e "s/\`\`$STATEMENT\`\`/:any:\`$STATEMENT\`/g" $ARMFILES; \
    done

This needs manual cleanup (see next commit) to fix syntax errors.
2022-07-04 16:08:59 +02:00
Petr Špaček f238a5d820 Use the new term Block in ARM headings "Statement Definition and Usage"
The underline is not shortened on purpose, see subsequent commits.

Generated by:
    sed -i -e 's/ Statement Definition and Usage$/ Block Definition and Usage/g' doc/arm/reference.rst

(cherry picked from commit 9804cdc4de)
2022-07-04 16:07:37 +02:00
Petr Špaček bbedf1bc95 Use the new term Block in ARM headings "Statement Grammar"
Long live new terminology.
The underline is now shortened on purpose, see subsequent commits.

Generated by:
    sed -i -e 's/ Statement Grammar$/ Block Grammar/g' doc/arm/reference.rst

(cherry picked from commit 452593fc94)
2022-07-04 16:07:33 +02:00
Petr Špaček 79249d3539 Merge branch 'pspacek/arm-tables-parse-short-rst-v9_18' into 'v9_18'
Parse and render rst syntax in auto-generated tables [v9_18]

See merge request isc-projects/bind9!6518
2022-07-04 13:50:05 +00:00
Petr Špaček 96691c5873 Parse and render rst syntax in :short: statement descriptions in tables
Without this change tables generated by .. namedconf:statementlist::
contained raw text and displayed rst syntax to users.

The raw docutil node returned by rst parser can contain unresolved
references (pending_xref nodes). We just store those nodes and let
Sphinx to resolve them later on.

Beware: This would not work if we injected nodes in later stages of
processing. All unresolved references must be in place before
'doctree-resolved' event is emitted (i.e. before resolve_references() is
called inside Sphinx).

(cherry picked from commit 62f3cf98d3)
2022-07-04 15:36:44 +02:00
Petr Špaček 6ac047cfaa Generate tables of statements in doctree-read phase
This change allows us to generate "unresolved" references and let Sphinx
deal with dereferencing them in later stages. It is not useful by itself
but it serves as preparation for the next commit.

(cherry picked from commit b109c86805)
2022-07-04 15:36:44 +02:00
Petr Špaček 824ff41f32 Optimize resolve_xref to avoid O(n^2) iteration
Formerly resolve_xref() in Sphinx extension called get_objects() from
Sphinx API which subsequently iterated the whole list of objects,
causing single iteration per single reference, which is essentially.
O(n^2). Avoid using get_objects() and access internal dictionary
directly intead.

The docs build time was still dominated by other factors but speedup is
about 10 % on my machine.

(cherry picked from commit 8a5f20121e)
2022-07-04 15:36:40 +02:00
Petr Špaček 6d3c318538 Merge branch 'marka-cobertura-replaced-by-coverage_report-v9_18' into 'v9_18'
Fix for GitLab 15.0: cobertura replaced by coverage_report [v9_18]

See merge request isc-projects/bind9!6513
2022-07-04 05:31:05 +00:00
Mark AndrewsandPetr Špaček 9ca645bdaf Fix for GitLab 15.0: cobertura replaced by coverage_report
From Gitlab 15.0 release notes:

   artifacts:reports:cobertura keyword

   As of GitLab 15.0, the artifacts:reports:cobertura keyword has
   been replaced by artifacts:reports:coverage_report. Cobertura
   is the only supported report file, but this is the first step
   towards GitLab supporting other report types.

(cherry picked from commit 008032d268)
2022-07-04 07:11:14 +02:00
Petr Špaček 34a1e3db92 Merge branch 'pspacek/arm-grammar-render-v9_18' into 'v9_18'
Render grammar snippets in the ARM [v9_18]

See merge request isc-projects/bind9!6507
2022-07-01 08:43:16 +00:00
Petr Špaček 85626adeb8 Add note that named.conf man page is not a complete manual
We cannot simply do URL because it would make our lives more complicated
with -S edition.

(cherry picked from commit 908acd5d70)
2022-07-01 10:21:06 +02:00
Petr Špaček e8cb9cceb7 Cleanup tag filtering code for statementlist:: RST directive
Technically this is fixup for
33931c97fa
but that commit is already merged.

(cherry picked from commit f5faddd08a)
2022-07-01 10:21:06 +02:00
Petr Špaček 666f0f1d40 Add link anchor and hyperlinks to keys statement
This is super confusing because statement "keys" exists in context
controls and server blocks where it refers to symmetric TSIG key, and it
_also_ exists in dnssec-policy block where it specifies public-private
key pair parameters.

In an (unsuccessful) attempt to disambiguate these two I added bunch of
hyperlinks and a warning.

(cherry picked from commit d88fefbb4a)
2022-07-01 10:21:06 +02:00
Petr Špaček af15c21bc3 Describe rndc server block using .. rndcconf syntax
We need to split the description to silence warnings about undescribed
statements.

(cherry picked from commit 82e2f0b37e)
2022-07-01 10:21:06 +02:00
Petr Špaček 990ec8f15b Define default-source-address, default-source-address-v6 for rndc
(cherry picked from commit 10f88bffe5)
2022-07-01 10:21:06 +02:00
Petr Špaček 763e40de22 Document ipv4only-* options in the ARM
Statements ipv4only-contact, ipv4only-enable, ipv4only-server did not
have their own section in the ARM. Now they have.

(cherry picked from commit 1687b40849)
2022-07-01 10:21:06 +02:00
Petr Špaček d6005488b8 Add missing link anchor for dlz search statement
(cherry picked from commit 40b3ce727c)
2022-07-01 10:21:06 +02:00
Petr Špaček 07cfcf8691 Special-case zone in-view
It is not really a zone type, so let's not generate "type in-view"
anchor for it.

(cherry picked from commit 261bdc7358)
2022-07-01 10:21:06 +02:00
Petr Špaček e55682f6f7 Remove extra whitespace in grammar for null statement
(cherry picked from commit 1af157eb20)
2022-07-01 10:21:06 +02:00
Petr Špaček fa871ffa67 Add ability to filter tables using blocks
A new syntax
.. namedconf:statementlist::
   :filter_blocks: type secondary
allows to generate tables with statements allowed within specified
blocks.

(cherry picked from commit 08a8acffdc)
2022-07-01 10:21:06 +02:00
Petr Špaček ca866c7e92 Sort grammar map keys while pretty printing them
It would be too easy if we could just call sorted(). Thanks to zone
grammar the most important key "type" gets sorted near end, so we pull
it up to the top using a hack.

(cherry picked from commit 5c04e3c524)
2022-07-01 10:21:05 +02:00
Petr Špaček 9b2bf0f8be Pretty-print grammar for zones
It turns out the tree of dictionaries is not the best structure to
represent our grammar, unfortunatelly. The problem is that "zone" has
several context-dependent variants which change meaning of "zone" based
on inner field "type".

Redesigning the whole structure does not seem to be worth, so I settled
on this terrible hack.

(cherry picked from commit 0392144e99)
2022-07-01 10:21:05 +02:00
Petr Špaček c4133e8779 Add zone definitions into the view grammar
I cannot see a reasonable way to achieve this without the hack in this
commit.

(cherry picked from commit 435cbb61ba)
2022-07-01 10:21:05 +02:00
Petr Špaček bc729e39da Add option to suppress grammar rendering
A new flag
.. namedconf:statement::
   :suppress_grammar:
suppresses pretty-printing grammar.

It is useful mostly for zones because each zone has it's own grammar, so
printing all of them at once usually does not make sense.

(cherry picked from commit 1f5bc4fe3b)
2022-07-01 10:21:05 +02:00
Petr Špaček 243ae3b6a7 Remove auto-generated rst files in repo in favour of grammar pretty printer
(cherry picked from commit 0bbbdc6244)
2022-07-01 10:20:56 +02:00
Petr Špaček f34c1034f2 Warn about experimental and deprecated options
(cherry picked from commit 7b4ad8a3ff)
2022-07-01 10:00:28 +02:00
Petr Špaček 3a692b068c Render statement's grammar
This is replacement for auto-generated *.rst files stored in the repo.

(cherry picked from commit c6fe8970f6)
2022-07-01 10:00:28 +02:00
Petr Špaček 2df4072d43 Render list of blocks accepting a given statement
(cherry picked from commit eba3b1ad16)
2022-07-01 10:00:28 +02:00
Petr Špaček a486e6e294 Detect unsupported statement:: directives with multiple names
(cherry picked from commit d61d998e3b)
2022-07-01 10:00:28 +02:00
Petr Špaček 4c53d6f906 Warn about statements not found in the grammar
(cherry picked from commit ebe6ede2ec)
2022-07-01 10:00:28 +02:00
Petr Špaček b11b1c6414 Warn about statements in grammar not described in docs
Skip over obsolete options.

(cherry picked from commit cbad1803a5)
2022-07-01 10:00:27 +02:00
Petr Špaček 7fe582629a Give Sphinx configuration domains access to grammar
(cherry picked from commit 1c6f2c5ad1)
2022-07-01 10:00:27 +02:00
Petr Špaček 160428a0f7 Add helper to unify options and zone block grammars
A helper is needed to combine cfg_test output for generic options and
all the type-dependent zone block variants.

(cherry picked from commit a691ebd0c9)
2022-07-01 10:00:27 +02:00
Petr Špaček ec9af7dbc7 Add pretty printer for JSON grammar
It produces the same format as cfg_test --grammar. The advantage is that
it allows to print any node in configuration the tree, not just whole
blocks.

(cherry picked from commit 190004e46c)
2022-07-01 10:00:27 +02:00
Petr Špaček aabdff9551 Add utility to search for context-dependent configuration statements
The utility detects statements which use the same name (e.g.
max-zone-ttl) but use different grammar in different contexts. These
typically need special case in docs.

(cherry picked from commit 8960d51aa3)
2022-07-01 10:00:27 +02:00
Petr Špaček a78b461653 Add a new library to parse grammar format produced by cfg_test
It transforms named.conf/rndc.conf grammar from text format into Python
dictionary. This allows granular access to grammar elements.

Beware: It heavity depens on cfg_test output format!
(cherry picked from commit df08982930)
2022-07-01 10:00:27 +02:00
Petr Špaček e9d21cee3b Add rndc.conf grammar into doc/misc
It uses the same mechanism as all other grammars, but the file is named
differently to distinguish it from named.conf grammars.

(cherry picked from commit fb474de3ab)
2022-07-01 10:00:27 +02:00
Petr Špaček 214da1de67 Un-format grammar files in doc/misc
The next commit is going to add parser for ISC configuration format.
To simplify the parser the grammar files in doc/misc are no longer
line-wrapped as handling it would make the grammar parser unnecessairly
complicated.

This affects visible output in the ARM, but in the end we are going to
replace the auto-generated .rst files with grammar pretty printed, so
formatting of these files does not matter in practical terms.

(cherry picked from commit 699570cdec)
2022-07-01 10:00:20 +02:00
Petr Špaček a46f671a30 Add missing comment markers to doc/misc/ grammar files
These files can be consumed by scripts, so obviously missing comment
markers wreak havoc.

(cherry picked from commit af3683f436)
2022-07-01 09:26:18 +02:00
Petr Špaček 19e40f34bc Merge branch 'sgoldlust/arm-tag-query-transfer-v9_18' into 'v9_18'
Add tags and short descriptions for query and transfer statements [v9_18]

See merge request isc-projects/bind9!6504
2022-06-30 16:16:00 +00:00
Petr Špaček 364a15da16 Accept rst syntax in .. statement:: short: text
Nested rst syntax is now parsed and rendered. E.g.:

.. namedconf:statement:: example
   :short: Use ``this`` **cool** syntax!

(cherry picked from commit 563eb8e1b9)
2022-06-30 18:12:01 +02:00
Petr Špaček 5513f47e53 Disambiguate address_match_list link anchor
Let's keep just the :term: produced by grammar glossary.

(cherry picked from commit 0e7ca5b5e0)
2022-06-30 18:12:01 +02:00
Suzanne GoldlustandPetr Špaček d4b1916a59 Add the :tags: and :short: descriptions for the category "transfer"
(cherry picked from commit 3cf976bd78)
2022-06-30 18:12:01 +02:00
Suzanne GoldlustandPetr Špaček 51057d3c85 Add the :tags: and :short: descriptions for the category "query"
(cherry picked from commit 7187a5cf77)
2022-06-30 18:12:01 +02:00
Petr Špaček 62958590cd Resurrect DNS NOTIFY chapter in the ARM
It was accidentally removed in the heat of
25eb91d23c.

(cherry picked from commit 2630cf8e76)
2022-06-30 18:11:54 +02:00
Michal Nowak 783be731bf Merge branch '2371-add-stress-testing-with-rpz-v9_18' into 'v9_18'
[v9_18] Add stress testing with RPZ

See merge request isc-projects/bind9!6497
2022-06-28 19:47:05 +00:00
Michal Nowak 46a8cf94c6 Add stress testing with RPZ
(cherry picked from commit d272574653)
2022-06-28 20:37:40 +02:00
Petr Špaček 2de747d246 Merge branch '3408-drop-debian-9-stretch-v9_18' into 'v9_18'
Drop support for Debian 9 (Stretch) [v9_18]

See merge request isc-projects/bind9!6495
2022-06-28 15:57:20 +00:00
Petr Špaček ccb608ebea Declare Debian 9 (Stretch) community-maintained
(cherry picked from commit 4ce1f25210)
2022-06-28 17:56:34 +02:00
Petr Špaček 85de8f8c15 Drop Debian 9 (Stretch) from CI
(cherry picked from commit aa86a8bcf0)
2022-06-28 17:56:34 +02:00
Artem Boldariev 07cbd5500e Merge branch '3415-update-http-listeners-on-reconfig-v9-18' into 'v9_18'
[Backport to 9.18]: Update HTTP listeners settings on reconfiguration

See merge request isc-projects/bind9!6494
2022-06-28 14:27:31 +00:00
Artem Boldariev 69e1d3804e doth test: extend with HTTP endpoints reconfiguration check
This commit add a check which verifies that HTTP endpoints are being
picked up properly by the BIND instance on a reconfiguration.

(cherry picked from commit 7822670d0f)
2022-06-28 16:38:21 +03:00
Artem Boldariev 12a6fafae2 Update CHANGES [GL #3415]
Mention that the settings are now applied properly on reconfiguration.

(cherry picked from commit 502c78c339)
2022-06-28 16:38:18 +03:00
Artem Boldariev b6b07c5646 Update the set of HTTP endpoints on reconfiguration
This commit ensures that on reconfiguration the set of HTTP
endpoints (=paths) is being updated within HTTP listeners.

(cherry picked from commit d2e13ddf22)
2022-06-28 16:37:31 +03:00
Artem Boldariev bb8ba2c027 Update max concurrent streams limit in HTTP listeners on reconfig
This commit ensures that HTTP listeners concurrent streams limit gets
updated properly on reconfiguration.

(cherry picked from commit e72962d5f1)
2022-06-28 16:37:31 +03:00
Artem Boldariev 1ccbb24078 Update HTTP listeners quotas on reconfiguration
This commit ensures that on reconfiguration a proper value for HTTP
connections limit is picked up.

The commit also refactors how listeners settings are updated so that
there is less code duplication.

(cherry picked from commit a2379135fa)
2022-06-28 16:37:31 +03:00
Artem Boldariev 63a4c12227 Store HTTP quota size inside a listenlist instead of the quota
This way only quota size is passed to the interface/listener
management code instead of a quota object. Thus, we can implement
updating the quota object size instead of recreating the object.

(cherry picked from commit 3f0b310772)
2022-06-28 16:37:31 +03:00
Matthijs Mekking 1330732872 Merge branch 'matthijs-dnssec-policy-defaults-in-config-dot-c-v9_18' into 'v9_18'
[v9_18] Move built-in dnssec-policies into defaultconf

See merge request isc-projects/bind9!6493
2022-06-28 13:30:26 +00:00
Matthijs Mekking 35f6cabab4 Add isccfg duration utility functions
Add function isccfg_duration_toseconds and isccfg_parse_duration to get
rid of code duplication.

(cherry picked from commit d8dae61832)
2022-06-28 14:37:26 +02:00
Matthijs Mekking feaf3950fd Fix a bug in the duration_fromtext function
The function actually did not enforce that the duration string starts
with a P (or p), just that there is a P (or p) in the string.

(cherry picked from commit 8e18fa5874)
2022-06-28 14:37:19 +02:00
Matthijs Mekking 8af88d4111 Also inherit from "default" for "insecure" policy
Remove the duplication from the defaultconf and inherit the values
not set in the "insecure" policy from the "default" policy. Therefore,
we must insist that the first read built-in policy is the default one.

(cherry picked from commit c2a7950417)
2022-06-28 14:37:10 +02:00
Matthijs Mekking bd15b7c3c6 Add change entry for dnssec-policy in defaultconf
(cherry picked from commit 80b55f9cfa)
2022-06-28 14:37:02 +02:00
Matthijs Mekking fd34ea8523 Nit changes in keymgr and kasp
Use the ISC_MAX define instead of "x = a > b ? a : b" paradigm.

Remove an unneeded include.

(cherry picked from commit 5d6f0de84b)
2022-06-28 14:36:53 +02:00
Matthijs Mekking e16cfce91d When loading dnssec-policies, inherit from default
Most of the settings (durations) are already inheriting from the default
because they use the constants from lib/dns/kasp.h. We need them as
constants so we can use them in named-checkconf to verify the policy
parameters.

The NSEC(3) parameters and keys should come from the actual default
policy. Change the call to cfg_kasp_fromconfig() to include the default
kasp. We also no longer need to corner case where config is NULL we load
the built-in policy: the built-in policies are now loaded when config is
set to named_g_config.

Finally, add a debug log (it is useful to see which policies are being
loaded).

(cherry picked from commit 20acb8d3a3)
2022-06-28 14:36:45 +02:00
Matthijs Mekking 03c0c72aeb Store built-in dnssec-policies in defaultconf
Update the defaultconf with the built-in policies. These will now be
printed with "named -C".

Change the defines in kasp.h to be strings, so they can be concatenated
in the defaultconf. This means when creating a kasp structure, we no
longer initialize the defaults (this is fine because only kaspconf.c
uses dns_kasp_create() and it inherits from the default policy).

In kaspconf.c, the default values now need to be parsed from string.

Introduce some variables so we don't need to do get_duration multiple
times on the same configuration option.

Finally, clang-format-14 decided to do some random formatting changes.

(cherry picked from commit 5ff414e986)
2022-06-28 14:36:38 +02:00
Matthijs Mekking 4fb2ecd444 Move duration structure to libisccfg/duration
Having the duration structure and parsing code here, it becomes
more accessible to be used in other places.

(cherry picked from commit a28d919503)
2022-06-28 14:36:31 +02:00
Michał Kępień d75ce232a6 Merge branch '3216-run-sslyze-in-gitlab-ci-v9_18' into 'v9_18'
[CVE-2022-1183] [v9_18] Run sslyze in GitLab CI

See merge request isc-projects/bind9!6492
2022-06-27 21:19:49 +00:00
Michał Kępień a649bd2148 Also test DNS-over-TLS code using sslyze
Since sslyze can test any TLS-enabled server, also use it for exercising
DNS-over-TLS code rather than just DNS-over-HTTPS code.

(cherry picked from commit 4f12892740)
2022-06-27 23:10:00 +02:00
Michał Kępień 4cda066de2 Add regression test for CVE-2022-1183
If sslyze is available in PATH, run it in a loop as part of the "doth"
system test.

(cherry picked from commit e97b4697cf)
2022-06-27 23:10:00 +02:00
Matthijs Mekking 11abb69fb4 Merge branch '3422-dnssec-policy-clarifications-v9_18' into 'v9_18'
[v9_18] Add some clarifications wrt dynamic zones

See merge request isc-projects/bind9!6489
2022-06-27 09:54:52 +00:00
Matthijs Mekking f2fc0e9c9e Add some clarifications wrt dynamic zones
These were suggested by GitLab user @elmaimbo.

(cherry picked from commit fb517eb52a)
2022-06-27 11:04:11 +02:00
Tom Krizek def7601987 Merge branch '3169-named-conf-intro-and-links-v9_18' into 'v9_18'
Reworked named.conf introduction and link anchors [v9_18]

See merge request isc-projects/bind9!6488
2022-06-24 14:55:08 +00:00
Ron AitchisonandPetr Špaček 22ac5003b5 Added explanations or Argument, Value, and Directive to the ARM
(cherry picked from commit d44cb9f194)
2022-06-24 16:47:28 +02:00
Petr Špaček 5fbeebc6f3 Add link to glob definition for include directive
(cherry picked from commit bb2a19d655)
2022-06-24 16:47:28 +02:00
Suzanne GoldlustandPetr Špaček 1fc681cce6 Minor text nitpicking around dnssec-policy grammar reference
(cherry picked from commit f4503061ba)
2022-06-24 16:47:28 +02:00
Petr Špaček 19fde8b8f1 Remove ambiguous link anchors for logging { file } statement
Unfortunatelly logging and zone blocks use file statements with
different semantics but the same name.

There is no sane way to disambiguate them in text, so let's remove the
link anchor from logging so we can link to the file statement in zone.

My assumption is that linking to logging { file } is very unlikely
because logging is self-contained in one block but zone config is all
over the place.

(cherry picked from commit fbcaa44851)
2022-06-24 16:47:28 +02:00
Petr Špaček 1b9c74152e Remove ambiguous link anchors for keys statement
Unfortunatelly dnssec-policy and servers blocks use keys statements with
a totally different grammar and semantics but the same name.
There is no sane way to disambiguate them in text, so let's remove the
link anchors to prevent errorneous linking.

(cherry picked from commit d6b2423c99)
2022-06-24 16:47:28 +02:00
Petr Špaček a7da2d4993 Change statement->argument terminology for control channel
control { inet ... allow keys read-only }; are not actual statements
but in fact arguments of a statement. Remove .. namedconf:statement::
syntax to avoid collisions with other statements of the same name.

(cherry picked from commit caf2675ef8)
2022-06-24 16:47:28 +02:00
Petr Špaček 70924290ca Deduplicate dnssec-policy definition in the ARM
(cherry picked from commit 3233414a53)
2022-06-24 16:47:28 +02:00
Petr Špaček b023b62b8d Deduplicate null definition in the ARM logging section
(cherry picked from commit fa2ba5423b)
2022-06-24 16:47:28 +02:00
Petr Špaček c496ffe4f4 Deduplicate {use,avoid}-v{4,6}-udp-ports definitions in the ARM
Statements affected:
use-v4-udp-ports
use-v6-udp-ports
avoid-v4-udp-ports
avoid-v6-udp-ports

(cherry picked from commit cd1b9aa052)
2022-06-24 16:47:28 +02:00
Petr Špaček df2c19c19b Deduplicate request-expire definition in the ARM
(cherry picked from commit 6e634c43cd)
2022-06-24 16:47:27 +02:00
Petr Špaček 8af0d9eca7 Deduplicate provide-ixfr definition in the ARM
(cherry picked from commit 22e6c8a29e)
2022-06-24 16:47:27 +02:00
Petr Špaček 98445cc32b Deduplicate request-ixfr definition in the ARM
Let's be consistent and put all definitions in the options block.

(cherry picked from commit 14389bc446)
2022-06-24 16:47:27 +02:00
Petr Špaček 0dd45cb17f Deduplicate notify-source, notify-source-v6 definitions in the ARM
(cherry picked from commit 08a3cd7ae4)
2022-06-24 16:47:27 +02:00
Petr Špaček 3688d706da Deduplicate request-nsid definition in the ARM
(cherry picked from commit e91529a48b)
2022-06-24 16:47:27 +02:00
Petr Špaček c611110c9b Deduplicate query-source, query-source-v6 definitions in the ARM
(cherry picked from commit 92a125b9c4)
2022-06-24 16:47:27 +02:00
Petr Špaček 8e5925c25a Deduplicate transfer-source, transfer-source-v6 definitions in the ARM
(cherry picked from commit 538f5a7520)
2022-06-24 16:47:27 +02:00
Petr Špaček 8a2470d559 Deduplicate transfer-format definition in the ARM
(cherry picked from commit b6eb0b298d)
2022-06-24 16:47:27 +02:00
Petr Špaček 97530e74e0 Deduplicate send-cookie definition in the ARM
(cherry picked from commit 7937c4bc9c)
2022-06-24 16:47:27 +02:00
Petr Špaček 7390e1e113 Deduplicate max-udp-size definition in the ARM
(cherry picked from commit 8ac82b4f30)
2022-06-24 16:47:27 +02:00
Petr Špaček 9ccadcc310 Deduplicate edns-udp-size definition in the ARM
(cherry picked from commit 624bbf403c)
2022-06-24 16:47:27 +02:00
Petr Špaček 40b9aa2e0b Deduplicate max-zone-ttl definition in the ARM
This is confusing as hell, but we cannot fix that in the manual itself.
At least now the user is made aware of two distinct defaults.

(cherry picked from commit 405a0931ea)
2022-06-24 16:47:27 +02:00
Petr Špaček e28050e7a4 Deduplicate allow-update definition in the ARM
(cherry picked from commit 420a7331a8)
2022-06-24 16:47:27 +02:00
Ron AitchisonandPetr Špaček 0c52d244ba Reference new named.conf description instead of man page
(cherry picked from commit cf85e776c6)
2022-06-24 16:47:26 +02:00
Ron AitchisonandPetr Špaček b8fa35789e Remove line numbering from config file examples
(cherry picked from commit 31e3d1aaf7)
2022-06-24 16:47:26 +02:00
Ron AitchisonandPetr Špaček 309a75e56b Changed all references from clause to block
(cherry picked from commit c40a983334)
2022-06-24 16:47:26 +02:00
Ron AitchisonandPetr Špaček f16cfcebe4 Restructure introduction to named.conf in the ARM
(cherry picked from commit b01262b7f2)
2022-06-24 16:47:26 +02:00
Petr Špaček 667335bd1c Add link anchors to statements and blocks in the ARM
All statements now use .. namedconf:statement:: or
.. rndcconf:statement:: syntax provided by our Sphinx extension.

This has several consequences:
- It changes how statement headings are rendered
- Statements are indexed and show up as separate items in doc
  search results (in the HTML version)
- Statements can be linked to using either :any:`statement` or
  :namedconf:ref:`statement` syntax (not used in this commit)
- Statements can be categorized and printed using ..
  namedconf:statatementlist:: syntax (not used in this commit)

(cherry picked from commit e5b7022dcb)
2022-06-24 16:47:25 +02:00
Michał Kępień 22ac7b0a4a Merge branch '3416-document-key-lifetime-min-length-v9_18' into 'v9_18'
[v9_18] Document what is a too short key lifetime

See merge request isc-projects/bind9!6483
2022-06-23 10:53:54 +00:00
Matthijs Mekking b18e6455d1 Document what is a too short key lifetime
To give a hint to users that get an error that the key lifetime is
shorter than the time it takes to do a rollover.

(cherry picked from commit c47735b86b)
2022-06-23 12:40:47 +02:00
Mark Andrews 9d8972ce72 Merge branch '3420-rrsetorder-update-status-v9_18' into 'v9_18'
Add missing update of status variable in rrsetorder system test [v9_18]

See merge request isc-projects/bind9!6480
2022-06-23 07:53:27 +00:00
Mark Andrews 7901261121 Replace expr's with $((expression)) shell constucts
Also make indenting consistent.

(cherry picked from commit 669c42cd95)
2022-06-23 17:27:13 +10:00
Mark Andrews f7d5957f95 Add missing update of status variable in rrsetorder system test
(cherry picked from commit da63e63c41)
2022-06-23 17:27:13 +10:00
Michał Kępień b372af4de8 Merge branch '3143-add-a-note-to-the-arm-on-dnstap-and-resolver-traffic-v9_18' into 'v9_18'
[v9_18] Add a note to the ARM on dnstap & resolver traffic

See merge request isc-projects/bind9!6479
2022-06-22 19:46:56 +00:00
Michał Kępień 35840d2d03 Check IPs in a dnstap capture of resolver traffic
Add a system test that checks whether IP addresses are present in a
dnstap capture of resolver traffic if "query-source" is explicitly set.

(cherry picked from commit 1f5c2ea8e5)
2022-06-22 21:14:40 +02:00
Michał Kępień 40aceeb96a Add a note to the ARM on dnstap & resolver traffic
Warn users that server-side IP addresses are not stored in dnstap
captures of resolver traffic unless "query-source(-v6)" is explicitly
set, explaining why it is so.

(cherry picked from commit 366f7a938b)
2022-06-22 21:14:40 +02:00
Matthijs Mekking 2eddca913e Merge branch '3320-rewrite-arm-dnssec-chapter-v9_18' into 'v9_18'
[v9_18] Rewrite DNSSEC ARM Chapter

See merge request isc-projects/bind9!6478
2022-06-22 14:45:33 +00:00
Petr ŠpačekandMatthijs Mekking 504cbd2353 Mention zone storage in the DNSSEC chapter
Let's not duplicate texts, link to description elsewhere instead.

(cherry picked from commit 146c125988)
2022-06-22 15:58:59 +02:00
Suzanne GoldlustandMatthijs Mekking 003423974b Minor grammar improvements in the Signing chapter of the DNSSEC Guide
(cherry picked from commit 6b1ad4dcfb)
2022-06-22 15:58:51 +02:00
Matthijs Mekking 342baee607 Add a section about key rollover
Describe how to do key rollovers with dnssec-policy. Update the
revert to unsigned recipe in the DNSSEC guide.

(cherry picked from commit f721986589)
2022-06-22 15:58:45 +02:00
Petr ŠpačekandMatthijs Mekking 595eb27b7e Deduplicate Manual Signing between DNSSEC chapter and DNSSEC Guide
The two procedures were essentially the same, but each instance was
missing some details from the other. They are now combined into one text
in the DNSSEC Guide and linked from DNSSEC chapter.

(cherry picked from commit 7d25027898)
2022-06-22 15:58:39 +02:00
Petr ŠpačekandMatthijs Mekking 99ef4f254f Deduplicate key filename description in the DNSSEC Guide
Third time ...

(cherry picked from commit 7e96801841)
2022-06-22 15:58:31 +02:00
Petr ŠpačekandMatthijs Mekking 06b02f2b4a Use ECDSAP256SHA256 in DNSSEC signing examples
(cherry picked from commit 3eb6898a14)
2022-06-22 15:58:08 +02:00
Petr ŠpačekandMatthijs Mekking eda822a1fc Use code-block directive for complete command lines
Minor rendering nit, not really important.

(cherry picked from commit 915237a28f)
2022-06-22 15:58:00 +02:00
Petr ŠpačekandMatthijs Mekking f1d71dff5a Deduplicate key filename description in the DNSSEC chapter
(cherry picked from commit 1dcc34f076)
2022-06-22 15:57:53 +02:00
Petr ŠpačekandMatthijs Mekking 5b30bffaaa Move Private Type Records in DNSSEC chapter to higher level
Private Type Records are not specific to manually signing, so it is
better to move it to the end of the "Zone Signing" section shared by all
three methods.

(cherry picked from commit 5ba618fd28)
2022-06-22 15:57:45 +02:00
Petr ŠpačekandMatthijs Mekking 1d07cf4883 Rewrite DNSSEC Validation subchapter in the ARM
Mostly deduplicating and linking information across the ARM.
Generally people should not touch it unless they what they are doing, so
let's try to discourage them a bit.

(cherry picked from commit bffa3063f0)
2022-06-22 15:57:37 +02:00
Petr ŠpačekandMatthijs Mekking c6a82e0ff1 Add hints about secure delegation to DNSSEC chapter of the ARM
Let's not duplicate texts from elsewhere, just point to different parts
of documentation.

(cherry picked from commit 29030fa5d7)
2022-06-22 15:57:29 +02:00
Petr ŠpačekandMatthijs Mekking b51c7be326 Reorder chapters about Zone Signing in the DNSSEC chapter of ARM
Let's make more automated methods more prominent:
- KASP first
- dynamic updates second
- command-line tools only as last resort

(cherry picked from commit 28a533322b)
2022-06-22 15:57:21 +02:00
Petr ŠpačekandMatthijs Mekking b288a7e48a Rewrite KASP section of DNSSEC chapter in the ARM
The goal is simplicity. Copy&paste to do the right thing, or read
referenced material and make up your mind if you need specialities.

NSEC discussion is already present in the DNSSEC guide so I merged
KASP examples with example for NSEC3 and removed NSEC text from the
DNSSEC chapter.

(cherry picked from commit 744763f8f2)
2022-06-22 15:57:14 +02:00
Petr ŠpačekandMatthijs Mekking b502211060 Rewrite introduction for DNSSEC chapter of the ARM
I've attempted to drop most of DNSSEC-specific jargon from the intro
paragraph, and to convince readers to read on.

(cherry picked from commit 0dc9c33149)
2022-06-22 15:57:07 +02:00
Matthijs Mekking 72ad0ed7cf Use NSEC3 guidance values in nsec3 config examples
Use best practice values in examples that follow new guidance from
draft-ietf-dnsop-nsec3-guidance:

   ; SHA-1, no extra iterations, empty salt:
   ;
   bcp.example. IN NSEC3PARAM 1 0 0 -

(cherry picked from commit 93601d8325)
2022-06-22 15:57:00 +02:00
Matthijs Mekking ef9dcad036 Move "DNSSEC" chapter before "Advanced" and "Security"
DNSSEC is mainstream nowadays, so let's give it more attention.

(cherry picked from commit 024c15f03b)
2022-06-22 15:56:49 +02:00
Matthijs Mekking cd348f3d60 Move Dynamic Zones section up
Move this section up so that DNSSEC signing topics are grouped together
(and not split by the DNSSEC Validation chapter).

(cherry picked from commit 7824c5c967)
2022-06-22 15:56:40 +02:00
Matthijs Mekking 205805f5ca Rewrite Dynamic Zones section
Restructure the section about dynamic zones and automatic signing:
- Focus on dynamic zones with 'auto-dnssec allow;'.
- Add a section about multi-signer models.
- Move NSEC3 related topics into one section.
- Remove any text that does not concern dynamic zones (mostly duplicate
  text anyway).

(cherry picked from commit be54c08d2b)
2022-06-22 15:56:34 +02:00
Matthijs Mekking 966645c3a7 Add a section about Denial of Existence
Move bits from the "DNSSEC, Dynamic Zones, and Automatic Signing"
about denial of existence to a separate section below the "Key and
Signing Policy" section.

Add a brief introduction about denial of existence to this section.

(cherry picked from commit 71490a5a2d)
2022-06-22 15:56:27 +02:00
Matthijs Mekking 65498441b0 Rewrap a paragraph in DNSSEC Validation section
No textual changes, just rewrapping to 80 characters.

(cherry picked from commit 34dea43f9c)
2022-06-22 15:56:19 +02:00
Matthijs Mekking 63c0f70266 Rewrite DNSSEC chapter - signing
Restructure the first part of the DNSSEC chapter that deals with zone
signing. Put dnssec-policy first. Mention Key and Signing Policy.
Only then talk about the DNSSEC tools.

(cherry picked from commit a1c95e8e7c)
2022-06-22 15:56:12 +02:00
Matthijs Mekking e0c12a4bd5 Nit changes in introduction of DNSSEC chapter
DNSSEC-bis is an uncommon term. Other servers are typically resolvers
and they usually are configured with the root key.

(cherry picked from commit fb24454c58)
2022-06-22 15:55:18 +02:00
Michal Nowak a8502a0ad9 Merge branch 'mnowak/add-system_gcc_bullseye_unstable_amd64-ci-job-v9_18' into 'v9_18'
[v9_18] Add system:gcc:bullseye:unstable:amd64 CI job

See merge request isc-projects/bind9!6476
2022-06-22 13:27:55 +00:00
Michal Nowak 77f71e4ad4 Put default-triggering-rules anchor in alphabetical order
(cherry picked from commit db1a72d581)
2022-06-22 14:51:34 +02:00
Michal Nowak 2438566964 Rename schedules_tags_web_triggering_rules anchor
The schedules_tags_web_triggering_rules anchor name should match it's
content, hence api_schedules_tags_triggers_web_triggering_rules anchor
name.

(cherry picked from commit 0629f53431)
2022-06-22 14:51:30 +02:00
Michal Nowak d67a62cb24 Extract API, schedules, triggers, and web triggering rules
(cherry picked from commit fbc1345dd7)
2022-06-22 14:51:24 +02:00
Michal Nowak 6984b1a61e Add system:gcc:bullseye:unstable:amd64 CI job
Without this CI job long pytest jobs are not being run in the CI.

(cherry picked from commit d606f39022)
2022-06-22 14:51:19 +02:00
Michał Kępień d1c94a70c8 Merge branch '3309-fix-destination-port-extraction-for-client-queries-v9_18' into 'v9_18'
[v9_18] Fix destination port extraction for client queries

See merge request isc-projects/bind9!6474
2022-06-22 11:59:17 +00:00
Michał Kępień 1cc7d243c6 Add CHANGES entry for GL #3309
(cherry picked from commit 58c3513fa6)
2022-06-22 13:46:42 +02:00
Mark AndrewsandMichał Kępień 5b56aa68af Check that the UDP destination port is logged via dnstap
(cherry picked from commit 8d8396c3a7)
2022-06-22 13:46:42 +02:00
Michał Kępień 457b666c6f Fix destination port extraction for client queries
The current logic for determining the address of the socket to which a
client sent its query is:

 1. Get the address:port tuple from the netmgr handle using
    isc_nmhandle_localaddr().

 2. Convert the address:port tuple from step 1 into an isc_netaddr_t
    using isc_netaddr_fromsockaddr().

 3. Convert the address from step 2 back into a socket address with the
    port set to 0 using isc_sockaddr_fromnetaddr().

Note that the port number (readily available in the netmgr handle) is
needlessly lost in the process, preventing it from being recorded in
dnstap captures of client traffic produced by named.

Fix by first storing the address:port tuple returned by
isc_nmhandle_localaddr() in client->destsockaddr and then creating an
isc_netaddr_t from that structure.  This allows the port number to be
retained in client->destsockaddr, which is what subsequently gets passed
to dns_dt_send().

(cherry picked from commit 2f945703f2)
2022-06-22 13:46:42 +02:00
Michał Kępień 423516b812 Merge branch 'ondrej-fix-out-of-tree-artifacts-v9_18' into 'v9_18'
[v9_18] Move the out of tree directory into the project directory

See merge request isc-projects/bind9!6473
2022-06-22 11:04:32 +00:00
Michał Kępień 3777b4b6c0 Clean up convert-trs-to-junit.py invocations
- Use absolute paths when invoking the convert-trs-to-junit.py script
    so that it also works correctly for out-of-tree and tarball-based
    test jobs.

  - Quote the variables used in convert-trs-to-junit.py invocations to
    future-proof the code.

  - Use "&&" instead of ";" in shell pipelines invoking the
    convert-trs-to-junit.py script in order to prevent "source" errors
    from being silently ignored.

  - Ensure convert-trs-to-junit.py is invoked from the correct directory
    for out-of-tree and tarball-based unit test jobs by adding
    appropriate "cd" invocations.

  - Ensure the convert-trs-to-junit.py invocations are always the last
    step in each 'after_script', in order to run that script from the
    correct directory for out-of-tree and tarball-based system test jobs
    and to ensure that any potential errors in that script do not
    prevent more important steps in the 'after_script' from being
    executed.

(cherry picked from commit 2cd20ee370)
2022-06-22 13:01:42 +02:00
Michał Kępień 024d1980dd Move out-of-tree workspace back to $CI_PROJECT_DIR
Out-of-tree build & test jobs currently defined in GitLab CI use
/tmp/out_of_tree_workspace as the working directory.  This requires
juggling that directory around as it gets passed from the build job to
the test jobs and then again after the test jobs are finished, so that
artifacts can be collected for the purpose of investigating test
failures.  The original intention of doing this was to ensure that
bin/tests/system/run.sh does not rely on being executed from within a
Git working copy (which happens e.g. if the out-of-tree workspace is a
subdirectory of $CI_PROJECT_DIR, i.e. the path into which GitLab
Runner clones the project in each job).

However, even with these complications in place, not all possible
scenarios that should be handled properly by the system test framework
(e.g. invoking a given test one time after another from the same
out-of-tree build directory) are tested in GitLab CI anyway.  Meanwhile,
the requirement for moving the out-of-tree workspace into
$CI_PROJECT_DIR in the 'after_script' for each out-of-tree job makes
these jobs less robust than they could be; for example, if any step in
the 'after_script' returns a non-zero exit code, the job's artifacts
will not include the out-of-tree workspace, hindering troubleshooting.

Simplify job definitions in .gitlab-ci.yml by moving the workspace used
by out-of-tree build & test jobs back to a subdirectory of
$CI_PROJECT_DIR.  Whether the out-of-tree workspace exists within a Git
working copy or not does not matter for Autotools, so this is considered
to be a reasonable trade-off in terms of test coverage.

(cherry picked from commit e6aebf10cc)
2022-06-22 13:01:42 +02:00
Michal Nowak 81f02e27b6 Merge branch 'mnowak/ubuntu-22.04-jammy-jellyfish-v9_18' into 'v9_18'
[v9_18] Add Ubuntu 22.04 LTS (Jammy Jellyfish)

See merge request isc-projects/bind9!6470
2022-06-22 10:25:03 +00:00
Michal Nowak 4265c0e6d6 Do not run Ubuntu 18.04 jobs in MR-triggered pipelines
With the addition of Ubuntu 22.04 three more CI jobs were added. To
compensate for that, move Ubuntu 18.04 jobs out of MR-triggered
pipelines to schedule-triggered ones.

Also, move --disable-geoip ./configure options from Ubuntu 18.04 to
Ubuntu 20.04 jobs to keep these options in the more frequent
MR-triggered pipelines.

(cherry picked from commit 06c591667e)
2022-06-22 11:38:53 +02:00
Michal Nowak 9b78663110 Add Ubuntu 22.04 LTS (Jammy Jellyfish)
(cherry picked from commit 4c2af3bdfa)
2022-06-22 11:38:53 +02:00
Matthijs Mekking 15bf7deec1 Merge branch '3412-system-test-passthru-virtualenv-perl5lib-v9_18' into 'v9_18'
[v9_18] System tests pass through virtualenv and perlmods

See merge request isc-projects/bind9!6469
2022-06-22 09:28:02 +00:00
Matthijs Mekking de5b25b386 System tests pass through virtualenv and perlmods
Have system tests use required Python (dnspython) and PERL modules
(Digest::HMAC and Net::DNS) from user directories, avoid using
privileges.

Note: The pythonenv must be setup to use the same version of python as
the test uses, for example /usr/bin/python.

Thanks to Stacey Marshall.

(cherry picked from commit 53eb127be1)
2022-06-22 10:24:03 +02:00
Matthijs Mekking 9d05898483 Merge branch '3397-document-interaction-dnssec-update-config-options-v9_18' into 'v9_18'
[v9_18] Document where updates and DNSSEC records are stored

See merge request isc-projects/bind9!6463
2022-06-20 14:20:57 +00:00
Matthijs Mekking ea50826dca Add comment on DNSSEC signing zone configuration
I was slightly confused here, so IMO it can use a comment.

(cherry picked from commit c80531758c)
2022-06-20 15:29:05 +02:00
Matthijs Mekking 0ba0ef4e20 Document where updates and DNSSEC records are stored
Make clear that inline-signing stores DNSSEC records in a signed
version of the zone, using the zone's filename plus ".signed" extension.

Tell that dynamic zones store updates in the zone's filename.

DNSSEC records for dynamic zones also go in the zone's filename, unless
inline-signing is enabled.

Then, dnssec-policy assumes inline-signing, but only if the zone is
not dynamic.

(cherry picked from commit 8860f6b4ff)
2022-06-20 15:28:58 +02:00
Michal Nowak d2b83e8b4a Merge branch 'mnowak/bump-clang-to-version-14-v9_18' into 'v9_18'
[v9_18] Update clang to version 14

See merge request isc-projects/bind9!6455
2022-06-17 06:35:09 +00:00
Michal Nowak 0819f7ecac Extract Clang version to $CLANG_VERSION
Extracting Clang version helps with updating Clang version in one place
and not missing one of its instances.

(cherry picked from commit bd17dec045)
2022-06-16 18:09:33 +02:00
Michal Nowak 82268504c9 Fix external_symbolizer_path on Fedora
The external_symbolizer_path was wrong on Fedora since moving gcc:tsan
jobs from Debian to Fedora.

(cherry picked from commit e98b9c5009)
2022-06-16 18:09:33 +02:00
Michal Nowak d3eb307e3c Update clang to version 14
(cherry picked from commit 1c45a9885a)
2022-06-16 18:09:33 +02:00
Michal Nowak b8134e4c78 Merge branch 'mnowak/checkds-pylint-implicit-str-concat-fixes-v9_18' into 'v9_18'
[v9_18] Fix implicit string concatenation in tests-checkds.py

See merge request isc-projects/bind9!6453
2022-06-16 11:47:29 +00:00
Michal Nowak 8b77533ac3 Fix implicit string concatenation in tests-checkds.py
pylint 2.14.2 reports the following warnings:

    bin/tests/system/checkds/tests-checkds.py:265:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
    bin/tests/system/checkds/tests-checkds.py:273:0: W1404: Implicit string concatenation found in call (implicit-str-concat)

(cherry picked from commit 831ac8add1)
2022-06-16 13:41:06 +02:00
Tom Krizek b7ff587512 Merge branch 'tkrizek/pytest-skipped-reason-v9_18' into 'v9_18'
Report reasons for skipped/xfailed system pytests [v9_18]

See merge request isc-projects/bind9!6451
2022-06-16 07:55:08 +00:00
Tom Krizek 1d847def2a Report reasons for skipped/xfailed system pytests
If skip/xfail is used in pytest, it can have a reason string associated
with it. When evaluating these tests, it can be useful to be able to
differentiate the reason why the test was skipped/xfailed/xpassed,
because there might be multiple possible reasons for that.

The extra options passed to pytest ensure that the string with the
reason appears in the test summary and thus we're able to find the
string with the reason in the log output.

See https://docs.pytest.org/en/7.1.x/how-to/skipping.html for more info

(cherry picked from commit f6d368167a)
2022-06-16 09:19:50 +02:00
Petr Špaček 6d46fa4052 Merge branch 'pspacek/nsec3-doc-update-v9_18' into 'v9_18'
Update NSEC3 guidance to match draft-ietf-dnsop-nsec3-guidance-10 [v9_18]

See merge request isc-projects/bind9!6447
2022-06-15 16:11:24 +00:00
Petr Špaček bd1ad27ff4 Update NSEC3 guidance to match draft-ietf-dnsop-nsec3-guidance-10
https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-nsec3-guidance-10
is on it's way to become RFC, so let's update our recommendations in the
docs to be in line with it.

(cherry picked from commit 2ee3f4e6c8)
2022-06-15 17:57:40 +02:00
Artem Boldariev 63aef08ea2 Merge branch 'artem-client-tls-sessions-reuse-backport-v9_18' into 'v9_18'
[Backport to 9.18]: TLS session resumption support

See merge request isc-projects/bind9!6445
2022-06-15 15:08:11 +00:00
Artem Boldariev b3490213eb CID 352848: split xfrin_start() and remove dead code
This commit separates TLS context creation code from xfrin_start() as
it has become too large and hard to follow into a new
function (similarly how it is done in dighost.c)

The dead code has been removed from the cleanup section of the TLS
creation code:

* there is no way 'tlsctx' can equal 'found';
* there is no way 'sess_cache' can be non-NULL in the cleanup section.

Also, it fixes a bug in the older version of the code, where TLS
client session context fetched from the cache would not get passed to
isc_nm_tlsdnsconnect().

(cherry picked from commit 98f758ed4f)
2022-06-15 17:02:45 +03:00
Artem Boldariev a954eacbac CID 352849: refactor get_create_tls_context() within dighost.c
This commit removes dead code from cleanup handling part of the
get_create_tls_context().

In particular, currently:

* there is no way 'found_ctx' might equal 'ctx';
* there is no way 'session_cache' might equal a non-NULL value while
cleaning up after a TLS initialisation error.

(cherry picked from commit 095b608412)
2022-06-15 17:02:45 +03:00
Artem Boldariev 334eeef5a1 Do not provide a shim for SSL_SESSION_is_resumable()
The recently added TLS client session cache used
SSL_SESSION_is_resumable() to avoid polluting the cache with
non-resumable sessions. However, it turned out that we cannot provide
a shim for this function across the whole range of OpenSSL versions
due to the fact that OpenSSL 1.1.0 does uses opaque pointers for
SSL_SESSION objects.

The commit replaces the shim for SSL_SESSION_is_resumable() with a non
public approximation of it on systems shipped with OpenSSL 1.1.0. It
is not turned into a proper shim because it does not fully emulate the
behaviour of SSL_SESSION_is_resumable(), but in our case it is good
enough, as it still helps to protect the cache from pollution.

For systems shipped with OpenSSL 1.0.X and derivatives (e.g. older
versions of LibreSSL), the provided replacement perfectly mimics the
function it is intended to replace.

(cherry picked from commit 40be3c9263)
2022-06-15 17:02:45 +03:00
Artem Boldariev 7bd5f4972f Dig: Do not call isc_nm_cancelread() for HTTP sockets
This commit ensures that isc_nm_cancelread() is not called from within
dig code for HTTP sockets, as these lack its implementation.

It does not have much sense to have it due to transactional nature of
HTTP.

Every HTTP request-response pair is represented by a virtual socket,
where read callback is called only when full DNS message is received
or when an error code is being passed there. That is, there is nothing
to cancel at the time of the call.

(cherry picked from commit 90c52ca12b)
2022-06-15 17:02:45 +03:00
Artem Boldariev 0cec9cca37 Fix an abort in DoH (client-side) when writing on closing sock
The commit fixes a corner case in client-side DoH code, when a write
attempt is done on a closing socket (session).

The change ensures that the write call-back will be called with a
proper error code (see failed_send_cb() call in client_httpsend()).

(cherry picked from commit 9abb00bb5f)
2022-06-15 17:02:45 +03:00
Artem Boldariev cb6591f277 Avoid aborting when uv_timer_start() is used on a closing socket
In such a case it will return UV_EINVAL (-EINVAL), leading to
aborting, as the code expects the function to succeed.

(cherry picked from commit 245f7cec2e)
2022-06-15 17:02:45 +03:00
Artem Boldariev 3393ec19c2 Modify CHANGES
Mention that TLS session resumption is now fully supported in the
client side code.

(cherry picked from commit aa8c258fba)
2022-06-15 17:02:45 +03:00
Artem Boldariev 5154bac7c5 Add SSL_SESSION_is_resumable() implementation shim
This commit adds SSL_SESSION_is_resumable() implementation if it is
missing.

(cherry picked from commit 35338b4105)
2022-06-15 17:02:45 +03:00
Artem Boldariev e02284354a DoT: implement TLS client session resumption
This commit extends DoT code with TLS client session resumption
support implemented on top of the TLS client session cache.

(cherry picked from commit 86465c1dac)
2022-06-15 17:02:45 +03:00
Artem Boldariev 0a4a76ff7a TLS stream/DoH: implement TLS client session resumption
This commit extends TLS stream code and DoH code with TLS client
session resumption support implemented on top of the TLS client
session cache.

(cherry picked from commit 90bc13a5d5)
2022-06-15 17:02:45 +03:00
Artem Boldariev 6ec48f1e78 Extend TLS context cache with TLS client session cache
This commit extends TLS context cache with TLS client session cache so
that an associated session cache can be stored alongside the TLS
context within the context cache.

(cherry picked from commit 987892d113)
2022-06-15 17:02:45 +03:00
Artem Boldariev 7c8d76c458 Add TLS client session cache implementation
This commit adds an implementation of a client TLS session cache. TLS
client session cache is an object which allows efficient storing and
retrieval of previously saved TLS sessions so that they can be
resumed. This object is supposed to be a foundation for implementing
TLS session resumption - a standard technique to reduce the cost of
re-establishing a connection to the remote server endpoint.

OpenSSL does server-side TLS session caching transparently by
default. However, on the client-side, a TLS session to resume must be
manually specified when establishing the TLS connection. The TLS
client session cache is precisely the foundation for that.

(cherry picked from commit 4ef40988f3)
2022-06-15 17:02:45 +03:00
Michał Kępień 64fcf1e464 Merge tag 'v9_18_4' into v9_18
BIND 9.18.4
2022-06-15 15:58:14 +02:00
Artem Boldariev 8cea314705 Merge branch 'artem-tlsdns-do-not-call-acceptcb-twice-v9_18' into 'v9_18'
[Backport to 9.18] TLS DNS: do not call accept callback twice

See merge request isc-projects/bind9!6440
2022-06-15 13:40:30 +00:00
Artem Boldariev 9b320b1682 TLS DNS: do not call accept callback twice
Before the changes from this commit were introduced, the accept
callback function will get called twice when accepting connection
during two of these stages:

* when accepting the TCP connection;
* when handshake has completed.

That is clearly an error, as it should have been called only once. As
far as I understand it the mistake is a result of TLS DNS transport
being essentially a fork of TCP transport, where calling the accept
callback immediately after accepting TCP connection makes sense.

This commit fixes this mistake. It did not have any very serious
consequences because in BIND the accept callback only checks an ACL
and updates stats.

(cherry picked from commit e616d7f240)
2022-06-15 15:32:49 +03:00
Petr Špaček b0ac324a02 Merge branch 'pspacek/doc-cleanup-dnssec-prereq-v9_18' into 'v9_18'
Update intro texts in the DNSSEC Guide [v9_18]

See merge request isc-projects/bind9!6434
2022-06-14 16:24:18 +00:00
Petr Špaček d1d5531c6a Update FAQ in the DNSSEC Guide
Mention DoT/DoH, update stats, remove mentions of early stages of
deployment.

(cherry picked from commit fd3a2c7854)
2022-06-14 18:20:50 +02:00
Petr Špaček a04d6200e0 Update Authoritative Server Hardware requirements in DNSSEC Guide
Based on measurements done on BIND v9_19_2 using bank. TLD and a
synthetitc fullly signed zone, using RSASHA256 and ECDSAP256SHA256
algorithms with NSEC and NSEC3 without opt-out.

(cherry picked from commit 635885afe6)
2022-06-14 18:20:50 +02:00
Petr Špaček 08a5f5cea2 Update DNSSEC validation deployment stats in DNSSEC Guide
(cherry picked from commit 832c172985)
2022-06-14 18:20:50 +02:00
Petr Špaček 8961105b98 Rewrite Recursive Server Hardware requirements in DNSSEC Guide
This section was completely out of date. Current measurements on dataset
Telco EU 2022-02 and BIND 9.19.1 indicate absolutely different results
than described in the old version of the text.

(cherry picked from commit 6cf8066b9c)
2022-06-14 18:20:50 +02:00
Petr Špaček a85d0286a9 Remove outdated software requirements from DNSSEC Guide
Guide in this repo is tied to latest version anyway, so let's not even
mention ancient versions of BIND.

This also solves the OpenSSL question because it is now mandatory for
build, which subsequently removes the entropy problem - so let's not
mention it either.

(cherry picked from commit 6e79877759)
2022-06-14 18:20:50 +02:00
Arаm Sаrgsyаn 2d85fda569 Merge branch '3401-race-condition-in-route_connected-v9_18' into 'v9_18'
[v9_18] Resolve "race condition in route_connected() leads to crash on startup/shutdown"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.. statementlist:: is currently not parametrized.

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

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

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

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

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

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

This commit adds a single new directive:

.. statement:: max-cache-size

It is namespaced like this:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

There have been no manual changes.

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

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

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

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

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

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

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

Add a retry quiet to mitigate against it.

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

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

(cherry picked from commit b0f59cb5cb)
2022-06-03 12:11:29 +02:00
Michał Kępień b020a19563 Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.18.5' into 'v9_18'
Set up version and release notes for BIND 9.18.5

See merge request isc-projects/bind9!6390
2022-06-03 09:27:03 +00:00
Michał Kępień 05a320b476 Set up release notes for BIND 9.18.5 2022-06-03 11:03:26 +02:00
Michał Kępień cb817234b2 Update BIND version to 9.18.5-dev 2022-06-03 11:03:26 +02:00
Michał Kępień 727d0d68d8 Update BIND 9 version for release 2022-06-02 21:06:44 +02:00
Michał Kępień 93a8f1766e Add a CHANGES marker 2022-06-02 21:06:44 +02:00
Michał Kępień 8c7809e840 Merge branch 'michal/prepare-documentation-for-bind-9.18.4' into 'v9_18_4-release'
Prepare documentation for BIND 9.18.4

See merge request isc-private/bind9!407
2022-06-02 19:05:30 +00:00
Michał Kępień 9a36774aee Add release note for GL #3327 2022-06-02 20:43:07 +02:00
Michał Kępień f353ea526b Reorder release notes 2022-06-02 20:43:07 +02:00
Michał Kępień 71d315a461 Tweak and reword release notes 2022-06-02 20:43:07 +02:00
Michał Kępień 16006e959f Prepare release notes for BIND 9.18.4 2022-06-02 20:43:07 +02:00
Petr Špaček e9ceb03db9 Merge branch 'pspacek/rtd-style-changes-v9_18' into 'v9_18'
ReadTheDocs style changes [v9_18]

See merge request isc-projects/bind9!6386
2022-06-02 15:27:08 +00:00
Petr Špaček 58a7e19c59 ARM style change: render literals in black color
After enormous amount of bikesheding about colors we decided to override
ReadTheDocs default style for literals (``literal`` in the RST markup).

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

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

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

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

I hereby declare the bikeshed painted.

(cherry picked from commit 833af31e7b)
2022-06-02 17:23:31 +02:00
Petr Špaček 15f1517727 Allow wrapping for ARM table content
RTD style default never wraps <th> and <td> elements and that just does
not work for real sentences or any other long lines.

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

(cherry picked from commit a5dd98ac1b)
2022-06-02 17:23:27 +02:00
Arаm Sаrgsyаn 8bef862607 Merge branch 'aram/catz-processing-skip-warnings-for-some-rrset-types-v9_18' into 'v9_18'
[v9_18] Don't process DNSSEC-related and ZONEMD records in catz

See merge request isc-projects/bind9!6383
2022-06-02 10:56:24 +00:00
Aram Sargsyan ee7d54164e Add CHANGES and release note for [GL #3380]
(cherry picked from commit b8073cbe72)
2022-06-02 10:21:35 +00:00
Aram Sargsyan 1355fc6a04 Don't process DNSSEC-related and ZONEMD records in catz
When processing a catalog zone update, skip processing records with
DNSSEC-related and ZONEMD types, because we are not interested in them
in the context of a catalog zone, and processing them will fail and
produce an unnecessary warning message.

(cherry picked from commit 73d6643137)
2022-06-02 10:20:11 +00:00
Mark Andrews 58760fb7d5 Merge branch '3388-missing-indent-call-v9_18' into 'v9_18'
Add missing INDENT call for UPDATE messages [v9_18]

See merge request isc-projects/bind9!6380
2022-06-01 22:50:59 +00:00
Mark Andrews 7d14346e5f Add missing INDENT call for UPDATE messages
Reported by Peter <pmc@citylink.dinoex.sub.org> on bind-users.

(cherry picked from commit 03132c93ca)
2022-06-02 08:28:15 +10:00
Ondřej Surý 81ac722b24 Merge branch 'fanf-tests-build-deps-v9_18' into 'v9_18'
Add missing CFLAGS and LDADD to unit tests [v9.18]

See merge request isc-projects/bind9!6378
2022-06-01 16:51:18 +00:00
Ondřej Surý 33057fc891 Properly adjust the srcdir vs builddir paths
Affected unit tests load testdata from the srcdir.  Previously, there
was a kludge that chdir()ed to the tests srcdir, but that get removed
during refactoring.  Instead of introducing the kludge again, the paths
were fixed to be properly prefixed with TESTS_DIR as needed.

(cherry picked from commit 16595cdde0)
2022-06-01 17:45:34 +02:00
Ondřej Surý c4fd0c3e4b Don't list libtest.la headers in HEADERS variable
The libtest.la headers were installed in very weird place, in fact, we
don't need to list them in the HEADERS variable, listing them in SOURCES
is enough for autotools to figure out how to compile the convenience
library.

(cherry picked from commit 714fe2f617)
2022-06-01 17:45:34 +02:00
Ondřej Surý 36184beb10 Fix the path to tsan files in the tsan unit test job
The tsan unit test job still referenced lib/*/tests/tsan.*, change this
to the correct tests/*/tsan.*.

(cherry picked from commit 90f0a765d8)
2022-06-01 17:45:34 +02:00
Ondřej Surý 1cc234f5d8 Add tests/isc/uv_wrap.h to Makefile.am
The automake was missing reference to uv_wrap.h, so it was not added to
the distribution.  Add uv_wrap.h to SOURCES for both doh and netmgr unit
tests.

(cherry picked from commit dec845017b)
2022-06-01 17:45:34 +02:00
Tony FinchandOndřej Surý 3ae606932d Add missing CFLAGS and LDADD to unit tests
A number of unit tests needed to be told where to find their libraries
and matching headers.

(cherry picked from commit 24d420f20b)
2022-06-01 17:45:34 +02:00
Arаm Sаrgsyаn 1d8689f936 Merge branch 'aram/update-top-level-gitignore-add-ide-files-v9_18' into 'v9_18'
[v9_18] Update top-level .gitignore to ignore files generated by some IDEs

See merge request isc-projects/bind9!6374
2022-06-01 11:41:00 +00:00
Aram Sargsyan aab7ed38a8 Update top-level .gitignore to ignore files generated by some IDEs
(cherry picked from commit ec3bc4142b)
2022-06-01 10:21:26 +00:00
Mark Andrews a6456581ce Merge branch '3345-fix-keyless-example-generation-v9_18' into 'v9_18'
Make modifications to keyless.example deterministic

See merge request isc-projects/bind9!6370
2022-06-01 01:08:35 +00:00
Mark Andrews 23c46338ef Make modifications to keyless.example deterministic
The perl modifation code for keyless.example was not deterministic
(/NXT/ matched part of signature) resulting in different error
strings being returned.  Replaced /NXT/ with /A RRSIG NSEC/ and
updated expected error string,

(cherry picked from commit 69d5e22e58)
2022-06-01 10:42:44 +10:00
Matthijs Mekking ca0faba3fd Merge branch '1611-detect-insane-dnssec-policies-v9_18' into 'v9_18'
[v9_18] Add some dnssec-policy configuration checks

See merge request isc-projects/bind9!6367
2022-05-31 15:59:56 +00:00
Matthijs Mekking 42711dae88 Only log "new successor in ..." if prepub != 0
If 'prepub' is 0, this has the special meaning that no rollover is
scheduled. If so, don't log "new successor in x seconds".

(cherry picked from commit 955a69109e)
2022-05-31 17:17:05 +02:00
Matthijs Mekking c18dce4c49 Add CHANGE and release note for #1611
Feature change.

(cherry picked from commit 92f98002e7)
2022-05-31 17:16:59 +02:00
Matthijs Mekking 3cfbe31176 Error if key lifetime is too short
The key lifetime should not be shorter than the time it costs to
introduce the successor key, otherwise keys will be created faster than
they are removed, resulting in a large key set.

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

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

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

(cherry picked from commit 8134d46cdb)
2022-05-31 17:16:53 +02:00
Matthijs Mekking 2036a8b161 Update signatures-refresh documentation
Mention in the ARM the new restriction about signatures-refresh.

(cherry picked from commit 74d2e7704f)
2022-05-31 17:16:46 +02:00
Matthijs Mekking 46636b8563 Error if signatures-refresh is too high
The signatures-refresh should not near the signatures-validity value,
to prevent operational instability. Same is true when checking against
signatures-validity-dnskey.

(cherry picked from commit 82fd89107f)
2022-05-31 17:16:40 +02:00
Matthijs Mekking b32a39dd27 Warn if key lifetime is short
Log a warning if the key lifetime is less than 30 days.

(cherry picked from commit e7322e8f78)
2022-05-31 17:16:35 +02:00
Matthijs Mekking 58690ec11c Warn if multiple keys have same role
If a dnssec-policy has multiple keys configured with the
same algorithm and role.

(cherry picked from commit f54dad005e)
2022-05-31 17:16:29 +02:00
Matthijs Mekking 125cad030b Merge branch '3341-servestale-extendederrors-test-failure-v9_18' into 'v9_18'
[v9_18] Tweak timings in serve-stale system test

See merge request isc-projects/bind9!6350
2022-05-31 14:27:39 +00:00
Matthijs Mekking 659804eab0 Tweak timings in serve-stale system test
Give a little bit more time if we wait on a time out from the
authoritative (aka resolver failure), and give up after one try
(because the second attempt will likely result in a different EDE).

(cherry picked from commit f764cee136)
2022-05-31 13:51:51 +00:00
Ondřej Surý 178442f735 Merge branch 'ondrej-unit-tests-refactoring-v9_18' into 'v9_18'
Give the unit tests a big overhaul [v9.18]

See merge request isc-projects/bind9!6366
2022-05-31 10:31:58 +00:00
Ondřej Surý 45584af257 Add CHANGES note for [GL !6243]
(cherry picked from commit cd1f9c3d36)
2022-05-31 12:06:00 +02:00
Evan HuntandOndřej Surý a0bf5ab2c5 Exclude unit tests from gcov
Modify the .gitlab-ci.yml to match the previous lib/.*/tests/.* pattern
for excluding the unit tests from the gcov.

(cherry picked from commit 2321cab4ee)
2022-05-31 12:06:00 +02:00
Evan HuntandOndřej Surý a67ba6e0b9 Stop the unit tests from running twice
Move the libtest code into a 'libtest' subdirectory and make it
one of the SUBDIRS in the tests Makefile. having it at the top level
required having "." as one of the subdirs, and that caused the
unit tests to be executed twice.

(cherry picked from commit 568f65cc56)
2022-05-31 12:06:00 +02:00
Ondřej Surý f128a9bcf2 Move all the unit tests to /tests/<libname>/
The unit tests are now using a common base, which means that
lib/dns/tests/ code now has to include lib/isc/include/isc/test.h and
link with lib/isc/test.c and lib/ns/tests has to include both libisc and
libdns parts.

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

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

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

(cherry picked from commit 2c3b2dabe9)
2022-05-31 12:06:00 +02:00
Ondřej Surý f0df0d679a Give the unit tests a big overhaul
The unit tests contain a lot of duplicated code and here's an attempt
to reduce code duplication.

This commit does several things:

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

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

   A simple example of a unit test would be:

    ISC_RUN_TEST_IMPL(test1) { assert_true(true); }

    ISC_TEST_LIST_START
    ISC_TEST_ENTRY(test1)
    ISC_TEST_LIST_END

    ISC_TEST_MAIN (Discussion: Should this be ISC_TEST_RUN ?)

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

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

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

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

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

(cherry picked from commit 63fe9312ff)
2022-05-31 11:34:54 +02:00
Ondřej Surý 5e9c9e3539 Merge branch '2801-unittest-isc-netmgr-s390x-v9_18' into 'v9_18'
Fix failures in isc netmgr_test on big endian machines

See merge request isc-projects/bind9!6353
2022-05-24 18:28:09 +00:00
Petr MenšíkandOndřej Surý d074386ef1 Fix failures in isc netmgr_test on big endian machines
Typing from libuv structure to isc_region_t is not possible, because
their sizes differ on 64 bit architectures. Little endian machines seems
to be lucky and still result in test passed. But big endian machine such
as s390x fails the test reliably.

Fix by directly creating the buffer as isc_region_t and skipping the
type conversion. More readable and still more correct.

(cherry picked from commit 057438cb45)
2022-05-24 20:22:57 +02:00
Tony Finch 44c4ff2d2d Merge branch '3361-dnssec-settime-unset-v9_18' into 'v9_18'
Teach dnssec-settime to read unset times that it writes (backport to v9.18)

See merge request isc-projects/bind9!6349
2022-05-23 14:01:23 +00:00
Tony Finch 84113b237a Teach dnssec-settime to read unset times that it writes
When there is no time in a key file, `dnssec-settime` will print
"UNSET", but to unset a time the user must specify "none" or "never".
This change allows "unset" or "UNSET" as well as "none" or "never".
The "UNSET" output remains the same to avoid compatibility problems
with wrapper scripts.

I have also re-synchronized the "Timing Options" sections of the man
pages.

(cherry picked from commit 4c96efac5c)
2022-05-23 15:15:10 +02:00
Tony Finch 0486bdeae3 Merge branch 'u/fanf2/dnssec-settime-ctime-v9_18' into 'v9_18'
Teach dnssec-settime to read times that it writes

See merge request isc-projects/bind9!6324
2022-05-23 12:58:50 +00:00
Tony FinchandTony Finch fa5d44becf Add CHANGES note for [GL !6324]
(cherry picked from commit fcca62859d)
2022-05-23 13:46:07 +02:00
Tony FinchandTony Finch f84cd02b0c 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.

(cherry picked from commit c38a323082)
2022-05-23 13:44:50 +02:00
Matthijs Mekking 1b15ff89b5 Merge branch '3354-cid-352776-missing_lock-v9_18' into 'v9_18'
[v9_18] Fix CID 352776: Concurrent data access violations

See merge request isc-projects/bind9!6344
2022-05-23 10:39:43 +00:00
Matthijs Mekking 0ae48af8b2 Require valid key for dst_key functions
Make sure that the key structure is valid when calling the following
functions:
- dst_key_setexternal
- dst_key_isexternal
- dst_key_setmodified
- dst_key_ismodified

(cherry picked from commit 888ec4e0d4)
2022-05-23 12:00:53 +02:00
Matthijs Mekking ca7e3e25c4 Fix CID 352776: Concurrent data access violations
*** CID 352776:  Concurrent data access violations  (MISSING_LOCK)
/lib/dns/dst_api.c: 474 in dst_key_setmodified()
468     dst_key_isexternal(dst_key_t *key) {
469		return (key->external);
470     }
471
472     void
473     dst_key_setmodified(dst_key_t *key, bool value) {
>>>     CID 352776:  Concurrent data access violations  (MISSING_LOCK)
>>>     Accessing "key->modified" without holding lock
>>>	"dst_key.mdlock". Elsewhere, "dst_key.modified" is accessed with
>>>	"dst_key.mdlock" held 8 out of 11 times (8 of these accesses
>>>	strongly imply that it is necessary).
474		key->modified = value;
475     }
476
477     bool
478     dst_key_ismodified(dst_key_t *key) {
479		return (key->modified);

(cherry picked from commit 1fa24d0afb)
2022-05-23 12:00:45 +02:00
Ondřej Surý 18881c15aa Merge branch '3344-threadsanitizer-data-race-in-isc__nm_tcpdns_send-v9_18' into 'v9_18'
Move setting the sock->write_timeout to the async_*send [v9.18]

See merge request isc-projects/bind9!6341
2022-05-19 20:53:11 +00:00
Ondřej Surý eabee4d7d9 Move setting the sock->write_timeout to the async_*send
Setting the sock->write_timeout from the TCP, TCPDNS, and TLSDNS send
functions could lead to (harmless) data race when setting the value for
the first time when the isc_nm_send() function would be called from
thread not-matching the socket we are sending to.  Move the setting the
sock->write_timeout to the matching async function which is always
called from the matching thread.

(cherry picked from commit 61117840c1)
2022-05-19 22:37:52 +02:00
Ondřej Surý acfec1bff0 Merge branch '3371-check-for-__attribute__-fallthrough-support-is-sometimes-incorrect-v9_18' into 'v9_18'
Use C2x [[fallthrough]] when supported by LLVM/clang [v9.18]

See merge request isc-projects/bind9!6339
2022-05-19 20:34:20 +00:00
Ondřej Surý b4521486ed Use C2x [[fallthrough]] when supported by LLVM/clang
Clang added support for the gcc-style fallthrough
attribute (i.e. __attribute__((fallthrough))) in version 10.  However,
__has_attribute(fallthrough) will return 1 in C mode in older versions,
even though they only support the C++11 fallthrough attribute. At best,
the unsupported attribute is simply ignored; at worst, it causes errors.

The C2x fallthrough attribute has the advantages of being supported in
the broadest range of clang versions (added in version 9) and being easy
to check for support. Use C2x [[fallthrough]] attribute if possible, and
fall back to not using an attribute for clang versions that don't have
it.

Courtesy of Joshua Root

(cherry picked from commit 14c8d43863)
2022-05-19 22:01:59 +02:00
Michal Nowak 4dde80f655 Merge tag 'v9_18_3' into v9_18
BIND 9.18.3
2022-05-19 12:07:45 +02:00
Evan Hunt c00545a168 Merge branch '3350-rndc-dnssec-checkds-doc-v9_18' into 'v9_18'
specify time format in the documentation for 'rdnc dnssec -checkds'

See merge request isc-projects/bind9!6331
2022-05-18 22:37:35 +00:00
Evan Hunt dfe196844c specify time format in the documentation for 'rdnc dnssec -checkds'
also clarified the writing in the surrounding paragraph.

(cherry picked from commit 83f9466d61)
2022-05-18 15:30:18 -07:00
Ondřej Surý 98e13fbc09 Merge branch '3366-configure-fails-to-find-uv-h-on-bsd-v9_18' into 'v9_18'
Use libuv CFLAGS and LIBS when checking for features [v9.18]

See merge request isc-projects/bind9!6329
2022-05-18 20:01:50 +00:00
Ondřej Surý a50231adc1 Use libuv CFLAGS and LIBS when checking for features
When autoconf was checking for libuv features, the LIBUV_CFLAGS was not
added to CFLAGS and LIBUV_LIBS to LIBS which resulted in false
negatives.

Use AX_SAVE_FLAGS and AX_RESTORE_FLAGS to temporarily add LIBUV_CFLAGS
and LIBUV_LIBS to their respective variables.

(cherry picked from commit f063ee276e)
2022-05-18 21:22:03 +02:00
Michal Nowak 48012449de Merge branch 'mnowak/fix-typo-in-ednscompliance-test-v9_18' into 'v9_18'
[v9_18] Fix typo in ednscompliance test

See merge request isc-projects/bind9!6327
2022-05-18 17:19:23 +00:00
Michal Nowak 9c8fdec57b Fix typo in ednscompliance test
Caused by ba0313e649, an incomplete fix of
spelling errors.

(cherry picked from commit 9de2c06a21)
2022-05-18 19:16:43 +02:00
Mark Andrews d7fd8faa57 Merge branch '3356-wrong-path-for-geoip-directory-v9_18' into 'v9_18'
Remove extraneous '$' in AS_VAR_COPY([MAXMINDDB_PREFIX], [with_maxminddb])

See merge request isc-projects/bind9!6318
2022-05-17 19:34:40 +00:00
Mark Andrews d6b07d2787 Remove extraneous '$' in AS_VAR_COPY([MAXMINDDB_PREFIX], [with_maxminddb])
(cherry picked from commit 686d691fa9)
2022-05-18 05:03:05 +10:00
Matthijs Mekking d4d516ca89 Merge branch '3352-kasp-test-broken-on-freebsd-v9_18' into 'v9_18'
[v9_18] Fix "kasp test broken on freebsd"

See merge request isc-projects/bind9!6312
2022-05-16 16:38:55 +00:00
Matthijs Mekking 646e00fbb2 Replace stat with PERL stat in kasp system test
7249bad7 introduced the -c option to stat(1) command, but BSD systems
do not know about it. Replace the stat(1) command with a PERL script
that achieves the same.

Why PERL? For consistency purposes, there are more places in the
system test where we use the same method.

(cherry picked from commit fe601c5915)
2022-05-16 18:02:38 +02:00
Matthijs Mekking b777649fda Merge branch '3302-keymgr-updates-key-files-each-run-v9_18' into 'v9_18'
[v9_18] Fix "keymgr updates key files each run"

See merge request isc-projects/bind9!6300
2022-05-16 15:36:50 +00:00
Matthijs Mekking 7cfc5e51ed Add changes and release notes for #3302
Add a comment to make danger happy.

(cherry picked from commit 0f89f0b134)
2022-05-16 10:37:39 +02:00
Matthijs Mekking 9b6a20b42e Check if key metadata is modified before writing
Add a new parameter to the dst_key structure, mark a key modified if
dst_key_(un)set[bool,num,state,time] is called. Only write out key
files during a keymgr run if the metadata has changed.

(cherry picked from commit 1da91b3ab4)
2022-05-16 10:37:23 +02:00
Matthijs Mekking 90ceb24b1c Add kasp test for #3302
Add a test case that triggers a keymgr run that will not trigger any
metadata changes. Ensure that the last status change of the key files
is unmodified.

(cherry picked from commit 7249bad706)
2022-05-16 10:37:23 +02:00
Evan Hunt c77fcc61eb Merge branch '3327-fetches-per-server-quota-v9_18' into 'v9_18'
fix the fetches-per-server quota calculation

See merge request isc-projects/bind9!6307
2022-05-14 08:29:03 +00:00
Evan Hunt ef963cf5e4 Add CHANGES note for [GL #3327]
(cherry picked from commit 3f478a3bed)
2022-05-14 00:59:12 -07:00
Evan Hunt 37bd035d39 Add lower bound checks to fetchlimit test
Check that the recursing client count is above a reasonable
minimum, as well as below a maximum, so that we can detect
bugs that cause recursion to fail too early or too often.

(cherry picked from commit 8834c44683)
2022-05-14 00:59:12 -07:00
Evan Hunt 60e25826c6 Cleanup: always count ns_statscounter_recursclients
The ns_statscounter_recursclients counter was previously only
incremented or decremented if client->recursionquota was non-NULL.
This was harmless, because that value should always be non-NULL if
recursion is enabled, but it made the code slightly confusing.

(cherry picked from commit 0201eab655)
2022-05-14 00:59:09 -07:00
Evan Hunt fa8b33ce56 Disable EDNS for the fetchlimit test server
The fetchlimit test depends on a resolver continuing to try UDP
and timing out while the client waits for resolution to succeed.
but since commit bb990030 (flag day 2020), a fetch will always
switch to TCP after two timeouts, unless EDNS was disabled for
the query.

This commit adds "edns no;" to server statements in the fetchlimit
resolver, to restore the behavior expected by the test.

(cherry picked from commit 81deb24deb)
2022-05-14 00:43:17 -07:00
Evan Hunt bca7f19541 Fix the fetches-per-server quota calculation
Since commit bad5a523c2, when the fetches-per-server quota
was increased or decreased, instead of the value being set to
the newly calculated quota, it was set to the *minimum* of
the new quota or 1 - which effectively meant it was always set to 1.
it should instead have been the maximum, to prevent the value from
ever dropping to zero.

(cherry picked from commit 694bc50273)
2022-05-14 00:43:17 -07:00
Evan Hunt eaf5745554 Merge branch '3351-checkconf-overflow-v9_18' into 'v9_18'
prevent a possible buffer overflow in configuration check

See merge request isc-projects/bind9!6304
2022-05-14 03:49:45 +00:00
Evan Hunt e117244850 prevent a possible buffer overflow in configuration check
corrected code that could have allowed a buffer overfow while
parsing named.conf.

(cherry picked from commit 921043b541)
2022-05-13 20:29:36 -07:00
Ondřej Surý 57f50fcd13 Merge branch 'ondrej-fix-trampoline-locking-v9_18' into 'v9_18'
Lock the trampoline when attaching [v9.18]

See merge request isc-projects/bind9!6298
2022-05-13 12:05:47 +00:00
Ondřej Surý 71b0e9e5b7 Lock the trampoline when attaching
When attaching to the trampoline, the isc__trampoline_max was access
unlocked.  This would not manifest under normal circumstances because we
initialize 65 trampolines by default and that's enough for most
commodity hardware, but there are ARM machines with 128+ cores where
this would be reported by ThreadSanitizer.

Add locking around the code in isc__trampoline_attach().  This also
requires the lock to leak on exit (along with memory that we already)
because a new thread might be attaching to the trampoline while we are
running the library destructor at the same time.

(cherry picked from commit 933162ae14)
2022-05-13 13:21:49 +02:00
Matthijs Mekking 9eb02cc50a Merge branch '3335-confusing-parental-source-documentation-v9_18' into 'v9_18'
[v9_18] Remove confusing parental-source line

See merge request isc-projects/bind9!6286
2022-05-11 15:06:50 +00:00
Matthijs Mekking 4dbfa40e95 Remove confusing parental-source line
Remove the line "This address must appear in the secondary server’s
parental-agents zone clause". This line is a copy paste error from
notify-source.

Rewrap.

(cherry picked from commit 313f606692)
2022-05-11 15:02:58 +00:00
Michał Kępień 8d42fda54b Merge branch 'michal/drop-post-merge-pipelines-v9_18' into 'v9_18'
[v9_18] Drop post-merge pipelines

See merge request isc-projects/bind9!6293
2022-05-11 13:06:02 +00:00
Michał Kępień 3d59d61291 Drop post-merge pipelines
Commit 24961f6068 introduced the concept
of post-merge pipelines.  These were used to build documentation after
each merge to any of the maintained branches, to allow up-to-date
documentation to be subsequently published on the bind.isc.org
microsite.  As the latter no longer downloads documentation from GitLab,
instead linking to Read the Docs for all currently maintained branches,
post-merge pipelines have become redundant since running the
"autoreconf" and "docs" jobs after each merge is not necessary any more.
Drop the "release_branch_triggering_rules" YAML anchor and revert to
default triggering rules for the "autoconf" and "docs" jobs, effectively
preventing pipelines from being created after each merge to any of the
maintained branches.

(cherry picked from commit 7b8c9e04fc)
2022-05-11 15:03:55 +02:00
Michał Kępień ecaf773652 Merge branch '565-do-not-trigger-gitlab-pages-pipelines-any-more-v9_18' into 'v9_18'
Do not trigger GitLab Pages pipelines any more

See merge request isc-projects/bind9!6290
2022-05-11 12:17:33 +00:00
Michał Kępień 6d1d244f17 Do not set up ccache in CI jobs building docs
Building documentation for Automake-based BIND 9 versions does not
require running "make all" beforehand.  Drop ccache setup code from the
definitions of GitLab CI jobs building documentation as it is redundant.

(cherry picked from commit 59c8321ac9)
2022-05-11 14:11:47 +02:00
Michał Kępień 6c2827eac6 Do not trigger GitLab Pages pipelines any more
The bind.isc.org microsite no longer downloads documentation from
GitLab, instead linking to Read the Docs for all currently maintained
branches.  This makes it redundant to trigger GitLab Pages pipelines
after each merge to any of the maintained branches.  Revert changes
introduced by commit 31bde118db: remove
the "push:docs" job along with the "push" stage it is associated with
and revert artifact expiry time for the "docs" job to the default value.

(cherry picked from commit a7fccaee82)
2022-05-11 14:11:47 +02:00
Petr Špaček 5bd62835dd Merge branch 'pspacek/arm-remove-solaris251-v9_18' into 'v9_18'
Remove ARM notes about Solaris 2.5.1 [v9_18]

See merge request isc-projects/bind9!6288
2022-05-11 10:53:41 +00:00
Petr Špaček be7ee4137c Remove ARM notes about Solaris 2.5.1
It was released in May 1996 and hopefully is not used to run BIND
anymore.

(cherry picked from commit 4388656f60)
2022-05-11 12:53:05 +02:00
Petr Špaček 767b36b9c5 Merge branch '3169-arm-restructuring-v9_18' into 'v9_18'
Restructure ARM [v9_18]

See merge request isc-projects/bind9!6284
2022-05-11 09:12:50 +00:00
Suzanne GoldlustandPetr Špaček 1369885c2b Add RPZ section to the ARM
Closes: #1223

(cherry picked from commit 8a3c4cbcdd)
2022-05-11 11:08:18 +02:00
Ron AitchisonandPetr Špaček 3f816768cc Rewrite Configurations and Zone Files section in the ARM
(cherry picked from commit 5d432d40a1)
2022-05-11 11:07:32 +02:00
Ron AitchisonandPetr Špaček 55d325e420 Tweak zones.inc.rst now separated from Reference section
(cherry picked from commit 178fc50b42)
2022-05-11 11:07:32 +02:00
Ron AitchisonandPetr Špaček 98143a2b93 Move zone file material from Reference to new subsection of chapter 3
(cherry picked from commit d505090965)
2022-05-11 11:07:32 +02:00
Ron AitchisonandPetr Špaček f43ff3f9c8 Minor DNSSEC guide tweaks
(cherry picked from commit 4ac383e9ae)
2022-05-11 11:07:32 +02:00
Ron AitchisonandPetr Špaček 0040b99c6f Restructure includes for chapter 9 Troubleshooting
(cherry picked from commit 7842a0ca8f)
2022-05-11 11:07:32 +02:00
Ron AitchisonandPetr Špaček 820cdffbc6 Split chapter Advanced DNS Features in the ARM into chapters 5, 6, 7
(cherry picked from commit 25eb91d23c)
2022-05-11 11:07:32 +02:00
Ron AitchisonandPetr Špaček 8e49e918db Split Configuration chapter in the ARM into chapters 3 and 4
(cherry picked from commit cd1c230ff6)
2022-05-11 11:07:32 +02:00
Ron AitchisonandPetr Špaček 4f95b81888 Add new ARM section Installing BIND 9
(cherry picked from commit 63e12b511f)
2022-05-11 11:07:29 +02:00
Ron AitchisonandPetr Špaček 7a57b24289 Rewrite Introduction chapters of the ARM
(cherry picked from commit 0951922028)
2022-05-11 11:05:43 +02:00
Petr Špaček d012689eee License PNG and DIA images in the ARM under MPL-2.0 as usual
(cherry picked from commit 647318c9b7)
2022-05-11 11:05:43 +02:00
Petr Špaček f82a42559e Remove build from chapter 2 and move it to the end of ARM
(cherry picked from commit 9d15decc41)
2022-05-11 11:05:43 +02:00
Ron AitchisonandPetr Špaček 2f53384e84 Change title and add extra link to Resource Requirements in the ARM
(cherry picked from commit 0c3b75f80b)
2022-05-11 11:05:43 +02:00
Ron AitchisonandPetr Špaček daaab5fc52 Add link anchors into Configuration Reference section of the ARM
(cherry picked from commit dc7efb8e60)
2022-05-11 11:05:43 +02:00
Petr Špaček 90c5127f2a Restructure includes for ARM chapters 1 (Intro) and 2 (Requirements)
We have had perpetual problem with Sphinx implicitly double-including
files. To avoid that problem all files with name suffix .inc.rst are now
ignored by Sphinx, and writter can conveniently include them without
modifying conf.py for each and every file.

(cherry picked from commit 1322372a0c)
2022-05-11 11:05:43 +02:00
Michal Nowak f100a34b0e Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.18.4' into 'v9_18'
Set up version and release notes for BIND 9.18.4

See merge request isc-projects/bind9!6282
2022-05-11 09:00:33 +00:00
Michal Nowak bcd564089a Set up release notes for BIND 9.18.4 2022-05-11 10:52:47 +02:00
Michal Nowak 8134aac39c Update BIND version to 9.18.4-dev 2022-05-11 10:50:38 +02:00
Michal Nowak 16aefa34b0 Update BIND 9 version for release 2022-05-09 18:07:17 +02:00
Michal Nowak eea876716f Add a CHANGES marker 2022-05-09 18:06:43 +02:00
Michal Nowak 350829f21c Merge branch 'mnowak/prepare-documentation-for-bind-9.18.3' into 'security-v9_18'
Prepare documentation for BIND 9.18.3

See merge request isc-private/bind9!403
2022-05-09 16:05:38 +00:00
Michal Nowak 87f017bec3 Reorder release notes 2022-05-09 11:29:18 +02:00
Michal Nowak b2e3ecf859 Tweak and reword release notes 2022-05-09 11:26:57 +02:00
Michal Nowak 46819373e3 Prepare release notes for BIND 9.18.3 2022-05-06 17:02:29 +02:00
Michal Nowak edcf58c800 Merge branch '3216-sslyze-crash-fix-v9_18' into 'security-v9_18'
[CVE-2022-1183][v9_18] Fix a crash by avoiding destroying TLS stream socket too early

See merge request isc-private/bind9!401
2022-05-05 08:49:44 +00:00
Artem BoldarievandMichal Nowak ea223b9b44 Add release note entry for [GL #3216]
(cherry picked from commit 6791500e96)
2022-05-04 19:57:37 +02:00
Artem BoldarievandMichal Nowak 6edbd0692f Add CHANGES entry for [GL #3216]
(cherry picked from commit 65c0de8e6f)
2022-05-04 19:57:25 +02:00
Artem BoldarievandMichal Nowak bd41100295 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.

(cherry picked from commit a696be6a2d)
2022-05-04 19:56:57 +02:00
Mark Andrews 2d44b863cc Merge branch '3232-rpz-rpz-nsip-rules-seem-not-to-understand-stub-and-static-stub-zones-and-don-t-handle-v9_18' into 'v9_18'
Add test cases using static and static-stub zones

See merge request isc-projects/bind9!6262
2022-05-04 14:13:06 +00:00
Mark Andrews 4513c21f77 Add CHANGES entry for [GL #3232]
(cherry picked from commit 63f420c89a)
2022-05-04 23:52:59 +10:00
Mark Andrews 3b490950af Allow DNS_RPZ_POLICY_ERROR to be converted to a string
(cherry picked from commit f498d2db0d)
2022-05-04 23:52:29 +10:00
Mark Andrews a742b7c5d7 Check the cache as well when glue NS are returned processing RPZ
(cherry picked from commit 8fb72012e3)
2022-05-04 23:52:29 +10:00
Mark Andrews 83cb796dcd Process learned records as well as glue
(cherry picked from commit 07c828531c)
2022-05-04 23:52:29 +10:00
Mark Andrews 9b467801ac Process the delegating NS RRset when checking rpz rules
(cherry picked from commit cf97c61f48)
2022-05-04 23:52:29 +10:00
Mark Andrews de5814ba8a 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

(cherry picked from commit 30cb70c826)
2022-05-04 23:52:29 +10:00
Ondřej Surý 3562fc9887 Merge branch 'ondrej-add-missing-void-in-named_config_default-v9_18' into 'v9_18'
Add missing void in named_config_getdefault() definition [v9.18]

See merge request isc-projects/bind9!6260
2022-05-04 11:05:47 +00:00
Ondřej Surý 79b045d03d 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:03:21 +02:00
Ondřej Surý bef3c76b51 Merge branch 'ondrej-use--Wl,--export-dynamic-v9_18' into 'v9_18'
Add -Wl,--export-dynamic to standard LDFLAGS if supported

See merge request isc-projects/bind9!6255
2022-05-03 22:16:06 +00:00
Ondřej Surý 7fef5fc46c 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.

(cherry picked from commit b05e20c968)
2022-05-03 21:14:25 +02:00
Arаm Sаrgsyаn ae8b335c11 Merge branch 'aram/catz-schema-v2-release-note-v9_18' into 'v9_18'
[v9_18] Add release note for catalog zones schema version 2 support

See merge request isc-projects/bind9!6254
2022-05-03 17:24:06 +00:00
Aram Sargsyan 50b804cf4c Add release note for catalog zones schema version 2 support
(cherry picked from commit bc3dc2eb41)
2022-05-03 16:44:14 +00:00
Artem Boldariev 79a6952346 Merge branch 'artem-rename-tls-hostname-to-tls-remote-hostname-backport-v9_18' into 'v9_18'
Rename "hostname" to "remote-hostname" within "tls" (backport to v9.18)

See merge request isc-projects/bind9!6253
2022-05-03 15:33:56 +00:00
Artem Boldariev 4bb410de98 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:42:43 +03:00
Artem Boldariev 7fb09a23c6 Merge branch 'artem-update-arm-tls-warnings-backport-v9_18' into 'v9_18'
Update TLS-related warnings within ARM (backport to v9.18)

See merge request isc-projects/bind9!6251
2022-05-03 11:27:44 +00:00
Artem Boldariev 8828e003d4 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 14:20:28 +03:00
Mark Andrews 4798db16c0 Merge branch '3266-rndc-system-test-fails-due-to-rate-limit-of-built-in-_bind-view-v9_18' into 'v9_18'
Improve forensics for the querylog section of rndc system test

See merge request isc-projects/bind9!6245
2022-05-02 23:44:42 +00:00
Mark Andrews 542661cc7c 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.

(cherry picked from commit 614cf5a030)
2022-05-02 19:51:11 +00:00
Petr Špaček 02f49fbf2d Merge branch 'pspacek/fix-rtd-file-path-substitution-v9_18' into 'v9_18'
Fix default file path substitution in the ARM and man pages [v9_18]

See merge request isc-projects/bind9!6247
2022-05-02 15:15:11 +00:00
Petr Špaček 005a535bf6 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
(cherry picked from commit cd31391294)
2022-05-02 17:11:44 +02:00
Mark Andrews c28ee3521a Merge branch '3317-cid-352554-1-of-1-dereference-before-null-check-reverse_inull-v9_18' into 'v9_18'
Remove unnecessary NULL pointer check

See merge request isc-projects/bind9!6244
2022-05-02 14:17:32 +00:00
Mark Andrews fde1294d05 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        }

(cherry picked from commit 30f3d51368)
2022-05-02 23:58:41 +10:00
Mark Andrews c0282b7d56 Merge branch 'bug/main/dlz-modules-v9_18' into 'v9_18'
Fix few warnings in DLZ modules

See merge request isc-projects/bind9!6242
2022-05-02 05:27:35 +00:00
Mark Andrews 06d9fa4419 Add CHANGES entry for [GL !5778]
(cherry picked from commit c938d41976)
2022-05-02 15:08:56 +10:00
Petr MensikandMark Andrews ae42ff5c15 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.

(cherry picked from commit be39b3d84c)
2022-05-02 15:08:17 +10:00
Mark Andrews 7cff5ce8fe Merge branch '3318-typo-in-rndc-man-page-v9_18' into 'v9_18'
Fix typo, withdraw should be withdrawn

See merge request isc-projects/bind9!6241
2022-05-02 04:18:21 +00:00
Mark Andrews 41cf041b55 Fix typo, withdraw should be withdrawn
(cherry picked from commit 22c2402393)
2022-05-02 13:05:09 +10:00
Matthijs Mekking 18a344208b Merge branch 'matthijs-kasp-system-test-failure-v9_18' into 'v9_18'
[v9_18] Fix kasp system test failures

See merge request isc-projects/bind9!6236
2022-04-29 13:11:32 +00:00
Matthijs Mekking 7803319cfd 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.

(cherry picked from commit 3e1d09ac66)
2022-04-29 13:57:31 +02:00
Matthijs Mekking a7aedd5bca Minor fixes in kasp system test
Fix two typos and two grep calls.

(cherry picked from commit 2b34b326fc)
2022-04-29 13:57:26 +02:00
Petr Špaček f8737d2a1a Merge branch 'feature/main/default-config-print-v9_18' into 'v9_18'
Export built-in default configuration for named binary [v9_18]

See merge request isc-projects/bind9!6233
2022-04-29 08:49:42 +00:00
Petr MenšíkandPetr Špaček 1c04a88a1e 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
(cherry picked from commit cf722d18b3)
2022-04-29 10:33:31 +02:00
Mark Andrews d8146be859 Merge branch 'bug/main/new-zones-dir-null-v9_18' into 'v9_18'
Don't test new-zones-directory argument validity

See merge request isc-projects/bind9!6230
2022-04-29 02:06:12 +00:00
Petr MenšíkandMark Andrews 02f80b4c75 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.

(cherry picked from commit 656a0f076f)
2022-04-29 11:46:22 +10:00
Petr MenšíkandMark Andrews 2cdebaf702 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.

(cherry picked from commit 59132bd3ec)
2022-04-29 11:46:22 +10:00
Petr MenšíkandMark Andrews ca952e22ff 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".

(cherry picked from commit 67e773c93c)
2022-04-29 11:46:22 +10:00
Petr MenšíkandMark Andrews 5e635d4c84 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.

(cherry picked from commit 0a7d04367a)
2022-04-29 11:46:22 +10:00
Mark Andrews f1f94d1159 Merge branch '3306-undefined-macros-in-contrib-dlz-modules-wildcard-dlz_wildcard_dynamic-c-v9_18' into 'v9_18'
Define local instances of FALLTHROUGH and UNREACHABLE

See merge request isc-projects/bind9!6228
2022-04-29 01:13:57 +00:00
Mark Andrews ac5f018d8f Add CHANGES note for [GL #3306]
(cherry picked from commit c57363fb7d)
2022-04-29 10:53:40 +10:00
Mark Andrews 9ced9a6202 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

(cherry picked from commit 6d68a22954)
2022-04-29 10:53:12 +10:00
Arаm Sаrgsyаn 3e74a046db Merge branch '3225-catz-member-zone-reset-v9_18' into 'v9_18'
[v9_18] [5/5] Document catalog zones member zone reset by change of unique label

See merge request isc-projects/bind9!6224
2022-04-28 16:58:47 +00:00
Aram Sargsyan e3839fc3e8 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.

(cherry picked from commit 2f2e02ff0c)
2022-04-28 16:10:23 +00:00
Ondřej Surý 982103594c Merge branch '2813-build-named-with-dlz-is-broken-with-MariaDB-10-v9_18' into 'v9_18'
Use MARIADB_BASE_VERSION instead of LIBMARIADB to detect Maria DB [v9.18]

See merge request isc-projects/bind9!6225
2022-04-28 16:06:20 +00:00
Ondřej SurýandOndřej Surý cf4e08d9cb 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.

(cherry picked from commit 5835aae694)
2022-04-28 18:05:17 +02:00
Arаm Sаrgsyаn d04fb79f1f Merge branch '3224-catz-broken-catalog-zones-concept-support-v9_18' into 'v9_18'
[v9_18] [4/5] Introduce the concept of broken catalog zones

See merge request isc-projects/bind9!6214
2022-04-28 13:22:44 +00:00
Aram Sargsyan 2dac9b119a 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.

(cherry picked from commit 84d3aba4f3)
2022-04-28 12:49:30 +00:00
Aram Sargsyan a8f9d4e418 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).

(cherry picked from commit 5bfe655835)
2022-04-28 12:49:24 +00:00
Aram Sargsyan 7dc8b2f79b 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.

(cherry picked from commit 247ae534a0)
2022-04-28 12:49:17 +00:00
Aram Sargsyan 951d582593 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.

(cherry picked from commit dfd5a01eba)
2022-04-28 12:49:08 +00:00
Aram Sargsyan f0bb090afe Add CHANGES note for [GL #3224]
(cherry picked from commit 92d1e1e347)
2022-04-28 12:48:51 +00:00
Aram Sargsyan 6539f73e3a 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.

(cherry picked from commit a8228d5f19)
2022-04-28 12:48:41 +00:00
Artem Boldariev 9a11c7a570 Merge branch 'artem-strict-tls-backport-v9_18' into 'v9_18'
Add remote TLS certificate verification support, implement Strict and Mutual TLS authentication in BIND and dig (backport to v9.18)

See merge request isc-projects/bind9!6210
2022-04-28 11:02:32 +00:00
Artem Boldariev 02208acbb5 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-28 13:39:22 +03:00
Artem Boldariev 4637b72da6 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-28 13:39:22 +03:00
Artem Boldariev 26feac0c61 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-28 13:39:22 +03:00
Artem Boldariev a86575034c 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-04-28 13:39:21 +03:00
Artem Boldariev 8c9532f8cf 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-04-28 13:39:21 +03:00
Artem Boldariev 337943c047 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-04-28 13:39:21 +03:00
Artem Boldariev d03b4026d5 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-04-28 13:39:21 +03:00
Artem Boldariev 2b3b8f354b 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-04-28 13:39:21 +03:00
Artem Boldariev 6c05fb09c3 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-04-28 13:39:21 +03:00
Artem Boldariev 05091f0095 Restore disabled unused 'tls' options: 'ca-file' and 'hostname'
This commit restores the 'tls' options disabled in
78b73d0865.
2022-04-28 13:39:21 +03:00
Artem Boldariev 1f60b32a51 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-04-28 13:39:21 +03:00
Artem Boldariev 9b0eb3e5a3 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-04-28 13:39:21 +03:00
Artem Boldariev e2a3ec2ba5 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-04-28 13:39:21 +03:00
Artem Boldariev 6fdc03102a 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-04-28 13:39:21 +03:00
Artem Boldariev b975ee7be4 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-04-28 13:39:21 +03:00
Matthijs Mekking cfcbdb6712 Merge branch '2267-extended-errors-stale-data-v9_18' into 'v9_18'
[v9_18] Add stale answer extended errors

See merge request isc-projects/bind9!6209
2022-04-28 09:56:59 +00:00
Matthijs Mekking 7ad1603ac3 Add CHANGES and release notes for #2267
(cherry picked from commit a320f4ed04)
2022-04-28 11:21:28 +02:00
Matthijs Mekking 125603a543 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.

(cherry picked from commit c66b9abc0b)
2022-04-28 11:21:22 +02:00
Evan Hunt 44a935cbdc Merge branch '3272-shutdown-deadlock-v9_18' into 'v9_18'
prevent a deadlock in the shutdown system test

See merge request isc-projects/bind9!6207
2022-04-28 06:58:38 +00:00
Evan Hunt d7c2752d3c CHANGES for [GL #3272]
(cherry picked from commit 6bcf3e5c31)
2022-04-27 23:57:18 -07:00
Evan Hunt af37c6f60c 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.

(cherry picked from commit 5c4cf3fcc4)
2022-04-27 23:56:59 -07:00
Evan Hunt 5c97200cfb Merge branch '2969-refactor-fctx_done-v9_18' into 'v9_18'
refactor fctx_done() to set fctx to NULL

See merge request isc-projects/bind9!6202
2022-04-28 01:19:17 +00:00
Evan Hunt d3728056db CHANGES for [GL #2969]
(cherry picked from commit f8c0cabca1)
2022-04-27 16:12:55 -07:00
Evan Hunt 9296be2130 refactor resume_dsfetch()
clean up resume_dsfetch() so that the fctx reference counting is
saner and easier to follow.

(cherry picked from commit 7b2ea97e46)
2022-04-27 16:12:55 -07:00
Evan Hunt 759e0b030e refactor validated()
minor changes to ensure that fctx reference counting is clear and correct.

(cherry picked from commit d2f407cca3)
2022-04-27 16:12:55 -07:00
Evan Hunt 50ef4a8cae rename maybe_destroy() to maybe_cancel_validators()
the maybe_destroy() function no longer destroys the fctx,
so rename it and update the comments.

(cherry picked from commit 7c5afebcdc)
2022-04-27 16:12:55 -07:00
Evan Hunt 8a90a62d0f 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.

(cherry picked from commit b4592d02a1)
2022-04-27 16:12:55 -07:00
Artem Boldariev 24655a4704 Merge branch 'artem-tls-ctx-refcount-backport-v9_18' into 'v9_18'
Implement reference counting for TLS contexts, Resolve #3122 DoT stops working after "rndc reconfigure" when running named as non-root (backport to v9.18)

See merge request isc-projects/bind9!6204
2022-04-27 21:36:02 +00:00
Artem Boldariev 67b9f97664 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-28 00:03:22 +03:00
Artem Boldariev 70a4c8ed95 Update CHANGES [GL #3122]
Add an entry that reloading TLS certificates without destroying
underlying TCP listening sockets.
2022-04-28 00:03:22 +03:00
Artem Boldariev f39041ee65 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-27 23:58:38 +03:00
Artem Boldariev 3a75b33287 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-27 23:58:38 +03:00
Artem Boldariev f52c06054b 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-27 23:58:38 +03:00
Artem Boldariev 28460151ca 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-27 23:58:38 +03:00
Artem Boldariev ff987957e7 Use isc_tlsctx_attach() in TLS stream code
This commit adds proper reference counting for TLS contexts into
generic TLS stream code.
2022-04-27 23:58:38 +03:00
Artem Boldariev 677819d22d 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-27 23:58:38 +03:00
Arаm Sаrgsyаn 95d1e9ee62 Merge branch '3300-dispatch-udp_recv-handle-deactivated-resp-returning-success-v9_18' into 'v9_18'
[v9_18] Handle ISC_R_SUCCESS on a deactivated response in udp_recv()

See merge request isc-projects/bind9!6200
2022-04-27 19:07:45 +00:00
Aram Sargsyan e1aca8d575 Add CHANGES note for [GL #3300]
(cherry picked from commit bbdd139e20)
2022-04-27 18:08:42 +00:00
Aram Sargsyan 4de1f65e4d 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.

(cherry picked from commit e3a88862c0)
2022-04-27 18:08:42 +00:00
Artem Boldariev f46e46e730 Merge branch '3274-fix-test-server-for-solaris-backport-v9_18' into 'v9_18'
Rename yield() to the test_server_yield() (backport to 9.18)

See merge request isc-projects/bind9!6201
2022-04-27 17:23:22 +00:00
Artem Boldariev f83d128ece 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 20:13:24 +03:00
Artem Boldariev 65d929e0d3 Merge branch '3271-tlsdns-call-write-callbacks-after-send-backport-v9_18' into 'v9_18'
TLSDNS: call send callbacks only after the data was sent  (backport to 9.18)

See merge request isc-projects/bind9!6198
2022-04-27 17:06:52 +00:00
Artem Boldariev 8b19f62ac5 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:57:11 +03:00
Petr Špaček 66080a6d91 Merge branch 'pspacek/pin-sphinx-packages-for-rtd-v9_18' into 'v9_18'
Pin Sphinx related package versions to match ReadTheDocs and our CI [v9_18]

See merge request isc-projects/bind9!6192
2022-04-27 12:35:36 +00:00
Petr Špaček 77873b1a5a 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

(cherry picked from commit 6088ba3837)
2022-04-27 14:34:56 +02:00
Ondřej Surý 9fd2c7e66a Merge branch 'ondrej-fix-route_recv-use-after-free-v9_18' into 'v9_18'
The route socket and its storage was detached while still reading [v9_18]

See merge request isc-projects/bind9!6181
2022-04-26 14:41:39 +00:00
Ondřej Surý 192df8d2f1 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.

(cherry picked from commit 9ae34a04e8)
2022-04-26 16:41:24 +02:00
Ondřej Surý 0cdb2f497a Merge branch '3230-remove-task-exclusive-mode-from-ns_clientmgr-v9_18' into 'v9_18'
Remove task exclusive mode from ns_clientmgr [v9.18]

See merge request isc-projects/bind9!6187
2022-04-26 14:40:42 +00:00
Ondřej Surý 4520ecc471 Add CHANGES mode for [GL #3230]
(cherry picked from commit a243860562)
2022-04-26 15:57:03 +02:00
Ondřej Surý 8beaee0b08 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.

(cherry picked from commit 4f74e1010e)
2022-04-26 15:56:30 +02:00
Ondřej Surý bc36f3e723 Merge branch '3299-fix-AX_PROG_CC_FOR_BUILD-macro-v9_18' into 'v9_18'
Fix the cached value of ac_cv_c_compiler_gnu [v9.18]

See merge request isc-projects/bind9!6185
2022-04-26 13:49:31 +00:00
Ondřej Surý 1bcd20d4bb 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.

(cherry picked from commit 4a9f899b5c)
2022-04-26 15:49:16 +02:00
Petr Špaček d5fd2a53ef Merge branch 'pspacek/rtd-requirements-update-v9_18' into 'v9_18'
Fix mismatch between docutils version in CI and ReadTheDocs [v9_18]

See merge request isc-projects/bind9!6184
2022-04-26 13:48:24 +00:00
Petr Špaček 243cd069fc 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

(cherry picked from commit 2a8eda0084)
2022-04-26 15:46:55 +02:00
Ondřej Surý 77fde4a112 Merge branch '3229-remove-exclusive-mode-from-ns_interfacemgr-v9_18' into 'v9_18'
Remove exclusive mode from ns_interfacemgr [v9.18]

See merge request isc-projects/bind9!6179
2022-04-26 12:22:19 +00:00
Ondřej Surý 95a55d0968 Add CHANGES note for [GL #3229]
(cherry picked from commit 70e58897c7)
2022-04-26 14:21:57 +02:00
Ondřej Surý ce8ffdda69 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.

(cherry picked from commit c0995bc380)
2022-04-26 14:21:57 +02:00
Ondřej Surý ab528a0fcb 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.

(cherry picked from commit 8138a595d9)
2022-04-26 14:21:57 +02:00
Petr Špaček a180f66b06 Merge branch '3301-support-sphinx-149-v9_18' into 'v9_18'
Split negative and positive dig/mdig/delv options to support Sphinx 1.4.9 [v9_18]

See merge request isc-projects/bind9!6180
2022-04-26 12:18:38 +00:00
Petr Špaček a84871ccca Add hyperlinks to dig/mdig/delv +options
(cherry picked from commit ac0c2378ca)
2022-04-26 14:06:33 +02:00
Petr Špaček 4c21534009 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
(cherry picked from commit 0342dddce7)
2022-04-26 14:00:38 +02:00
Ondřej Surý d751514215 Merge branch 'ondrej-enforce-minimal-libuv-version-v9_18' into 'v9_18'
Abort when libuv at runtime mismatches libuv at compile time [v9.18]

See merge request isc-projects/bind9!6177
2022-04-26 10:12:08 +00:00
Ondřej Surý 2a648b9078 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 12:11:51 +02:00
Petr Špaček b3e1c9060b Merge branch '3295-support-sphinx-185-v9_18' into 'v9_18'
Use unique program + option names for link anchors to support Sphinx 1.8.5 [v9_18]

See merge request isc-projects/bind9!6170
2022-04-26 10:07:32 +00:00
Petr Špaček 355aebc6df 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
(cherry picked from commit bbb24264bb)
2022-04-25 14:46:37 +02:00
Ondřej Surý 08feb4c23e Merge branch 'ondrej-use-correct-task-for-resume_dslookup-v9_18' into 'v9_18'
Run resume_dslookup() from the correct task [v9.18]

See merge request isc-projects/bind9!6164
2022-04-22 14:57:40 +00:00
Ondřej Surý 7e72c55ff9 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().

(cherry picked from commit 741a7096fc)
2022-04-22 15:57:22 +02:00
Michał Kępień aa3a3e7cda Merge branch 'michal/fix-loading-plugins-using-just-their-filenames-v9_18' into 'v9_18'
[v9_18] Fix loading plugins using just their filenames

See merge request isc-projects/bind9!6162
2022-04-22 11:37:07 +00:00
Michał Kępień 4ac4640c40 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).

(cherry picked from commit 5065c4686e)
2022-04-22 13:29:10 +02:00
Michał Kępień 83eaff2851 Merge branch 'michal/regenerate-man-pages-with-sphinx-4.5.0-v9_18' into 'v9_18'
[v9_18] Regenerate man pages with Sphinx 4.5.0

See merge request isc-projects/bind9!6160
2022-04-22 11:21:11 +00:00
Michał Kępień c1ba7c685d 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.

(cherry picked from commit e80ce6cfe2)
2022-04-22 13:11:35 +02:00
Michał Kępień ccea861632 Merge branch '3297-fix-a-pylint-2.13.7-error-v9_18' into 'v9_18'
[v9_18] Fix a PyLint 2.13.7 error

See merge request isc-projects/bind9!6151
2022-04-22 10:34:57 +00:00
Michał Kępień fd1f39fe59 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.

(cherry picked from commit 3f5318f094)
2022-04-22 12:14:50 +02:00
Michał Kępień f8d17c6263 Fix "digdelv" system test requirements
Commit f64cd23e7b 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.

(cherry picked from commit aaa0223752)
2022-04-22 12:14:50 +02:00
Michał Kępień 1735e589d1 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.

(cherry picked from commit beaaa7f4e2)
2022-04-22 12:14:50 +02:00
Michał Kępień 0f59e1e270 Merge branch '3287-prevent-memory-bloat-caused-by-a-jemalloc-quirk-v9_18' into 'v9_18'
[v9_18] Prevent memory bloat caused by a jemalloc quirk

See merge request isc-projects/bind9!6153
2022-04-21 12:42:06 +00:00
Michał Kępień 5e4855a25d Add CHANGES entry for GL #3287
(cherry picked from commit e33aef4e39)
2022-04-21 14:22:13 +02:00
Michał Kępień 2da371d005 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] https://github.com/jemalloc/jemalloc/commit/c259323ab3082324100c708109dbfff660d0f4b8

(cherry picked from commit 7aa7b6474b)
2022-04-21 14:22:13 +02:00
Michał Kępień 0deec48487 Merge tag 'v9_18_2' into v9_18
BIND 9.18.2
2022-04-21 09:44:56 +02:00
Tony Finch 05c88b18da Merge branch '3275-notify-test-fix-v9_18' into 'v9_18'
Avoid timeouts in the notify system test (backport to 9.18)

See merge request isc-projects/bind9!6143
2022-04-20 17:12:36 +00:00
Tony Finch 037223211c 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.

(cherry picked from commit f4c2909353)
2022-04-20 17:51:40 +01:00
Tony Finch 19cf15313c 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

(cherry picked from commit 4a30733ae5)
2022-04-20 17:51:40 +01:00
Mark Andrews e618bdd2df Merge branch '3279-lib-dns-ncache-c-rdataset_settrust-fails-to-set-trust-on-called-rdataset-v9_18' into 'v9_18'
Check that pending negative cache entries for DS can be used successfully

See merge request isc-projects/bind9!6135
2022-04-19 00:05:39 +00:00
Mark Andrews b66e00f73a Add CHANGES entry for [GL #3279]
(cherry picked from commit 14ca6270d3)
2022-04-19 09:44:09 +10:00
Mark Andrews 40bfb70d6a 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.

(cherry picked from commit d043a41499)
2022-04-19 09:44:09 +10:00
Mark Andrews b597ea863e 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.

(cherry picked from commit d2d9910da2)
2022-04-19 09:44:09 +10:00
Evan Hunt 230b2b8c56 Merge branch '3235-dig-exitcode-v9_18' into 'v9_18'
ensure dig sets exitcode after local UDP connection failure

See merge request isc-projects/bind9!6134
2022-04-15 18:10:08 +00:00
Evan Hunt 5739f13063 CHANGES for [GL #3235]
(cherry picked from commit d646aca282)
2022-04-15 11:08:46 -07:00
Evan Hunt 50dc4f1587 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.

(cherry picked from commit 4eee6460ff)
2022-04-15 11:08:46 -07:00
Arаm Sаrgsyаn 94d2d349d2 Merge branch '3223-catz-change-of-ownership-aka-coo-support-v9_18' into 'v9_18'
[v9_18] [3/5] Implement catalog zones change of ownership (coo) support

See merge request isc-projects/bind9!6133
2022-04-14 22:48:48 +00:00
Aram Sargsyan 546732546f 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.

(cherry picked from commit 99d1ec6c4b)
2022-04-14 20:53:59 +00:00
Aram Sargsyan 5037aeb5d2 Replace CATZ_OPT_MASTERS with CATZ_OPT_PRIMARIES
Update the enum entry in the continued effort of replacing some
DNS terminology.

(cherry picked from commit 59c486391d)
2022-04-14 20:53:53 +00:00
Aram Sargsyan c5d523d8e9 Add CHANGES note for [GL #3223]
(cherry picked from commit 1c33dbd27d)
2022-04-14 20:53:46 +00:00
Aram Sargsyan c37a75df5d 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.

(cherry picked from commit bb837db4ee)
2022-04-14 20:53:31 +00:00
Arаm Sаrgsyаn 1a9dc2fcad Merge branch '3222-catz-options-new-syntax-based-on-custom-properties-v9_18' into 'v9_18'
[v9_18] [2/5] Implement catalog zones options new syntax based on custom properties

See merge request isc-projects/bind9!6132
2022-04-14 20:27:54 +00:00
Aram Sargsyan 581d7bece0 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.

(cherry picked from commit 0b2d5490cd)
2022-04-14 19:51:45 +00:00
Aram Sargsyan d8e1f51a04 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.

(cherry picked from commit 6035980bb1)
2022-04-14 19:51:37 +00:00
Aram Sargsyan 3e07e505b0 Add CHANGES note for [GL #3222]
(cherry picked from commit 321c93c05d)
2022-04-14 19:51:30 +00:00
Aram Sargsyan f75c39811d 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.

(cherry picked from commit cedfebc64a)
2022-04-14 19:51:22 +00:00
Arаm Sаrgsyаn 55dd09098f Merge branch '3144-dig-+trace-or-+nssearch-with-+tcp-always-crashes-v9_18' into 'v9_18'
[v9_18] Unify dig +nssearch next query starting code for TCP and UDP protocols

See merge request isc-projects/bind9!6130
2022-04-14 11:30:43 +00:00
Aram Sargsyan c97b23a152 Add CHANGES note for [GL #3144]
(cherry picked from commit 2a9867d512)
2022-04-14 09:40:59 +00:00
Evan HuntandAram Sargsyan 7c0ef393d8 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.

(cherry picked from commit 6bf8535542)
2022-04-14 09:40:50 +00:00
Aram Sargsyan 7683d6ce69 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.

(cherry picked from commit b944bf4120)
2022-04-14 09:40:37 +00:00
Matthijs Mekking da30a638a2 Merge branch '2931-cds-delete-removed-on-signing-v9_18' into 'v9_18'
[v9_18] Don't delete CDS DELETE after zone sign

See merge request isc-projects/bind9!6126
2022-04-13 13:12:04 +00:00
Matthijs Mekking bff9a568c8 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.

(cherry picked from commit f088657eb1)
2022-04-13 14:44:25 +02:00
Matthijs Mekking c678065eaa Add CHANGE and release note for #2931
Release note worthy.

(cherry picked from commit ebbcf4c34f)
2022-04-13 14:44:18 +02:00
Matthijs Mekking c3ab09deb5 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.

(cherry picked from commit 3d05c99abb)
2022-04-13 14:43:40 +02:00
Matthijs Mekking d975d07155 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'.

(cherry picked from commit f08277f9fb)
2022-04-13 14:43:34 +02:00
Michał Kępień 4a622db88d Merge branch 'michal/fix-forward-system-test-requirements-v9_18' into 'v9_18'
[v9_18] Fix "forward" system test requirements

See merge request isc-projects/bind9!6123
2022-04-12 13:32:25 +00:00
Michał Kępień 80089f52e5 Fix "forward" system test requirements
Commit 3b3495a631 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.

(cherry picked from commit 806f457147)
2022-04-12 15:30:31 +02:00
Michał Kępień 41ddf9ce8c Merge branch 'michal/set-up-release-notes-for-bind-9.18.3' into 'v9_18'
Set up release notes for BIND 9.18.3

See merge request isc-projects/bind9!6119
2022-04-12 12:15:07 +00:00
Michał Kępień 55221e61c0 Set up release notes for BIND 9.18.3 2022-04-12 14:13:32 +02:00
Michał Kępień 4360b7532c Merge branch 'michal/update-bind-version-to-9.18.3-dev' into 'v9_18'
Update BIND version to 9.18.3-dev

See merge request isc-projects/bind9!6115
2022-04-12 11:12:20 +00:00
Michał Kępień 09ffa6cdd2 Update BIND version to 9.18.3-dev 2022-04-12 13:11:12 +02:00
Michał Kępień 3babb1557a Update BIND version to 9.18.2 2022-04-11 16:00:43 +02:00
Michał Kępień f78abdc474 Add a CHANGES marker 2022-04-11 16:00:43 +02:00
Michał Kępień 1983c3a45a Merge branch 'michal/prepare-documentation-for-bind-9.18.2' into 'v9_18_2-release'
Prepare documentation for BIND 9.18.2

See merge request isc-private/bind9!397
2022-04-11 13:59:32 +00:00
Michał Kępień 4ec20be2ae Prepare release notes for BIND 9.18.2 2022-04-11 15:56:43 +02:00
Michał Kępień b91083494e Add release note for miscellaneous dig fixes 2022-04-11 15:56:43 +02:00
Michał Kępień a4cc916c5b Reorder release notes 2022-04-11 15:56:43 +02:00
Michał Kępień 5c0e3a1d8d Tweak and reword release notes 2022-04-11 15:56:43 +02:00
Michał Kępień d0e094e81e Fix CHANGES marker location for BIND 9.17.22 2022-04-11 15:56:43 +02:00
Michal Nowak cb17d68ae7 Merge branch '3129-test-check-fetch-shutting-down-in-resume_dslookup-v9_18' into 'v9_18'
[v9_18] [CVE-2022-0667] Add a hung fetch check while chasing DS in the forward system test

See merge request isc-projects/bind9!6110
2022-04-08 10:49:59 +00:00
Aram SargsyanandMichal Nowak db3ab0b46e 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.

(cherry picked from commit 848094d6f7)
2022-04-08 12:19:04 +02:00
Petr Špaček d9da0a55b9 Merge branch '2950-cache-acceptance-rules-test-v9_18' into 'v9_18'
[CVE-2021-25220] Add tests for forwarder cache poisoning scenarios [v9_18]

See merge request isc-projects/bind9!6105
2022-04-07 18:00:03 +00:00
Mark AndrewsandPetr Špaček 3b3495a631 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).

(cherry picked from commit bf3fffff67)
2022-04-07 19:30:43 +02:00
Michal Nowak 4f44fe804d Merge branch '3112-test-lingering-tcp-sockets-in-closewait-v9_18' into 'v9_18'
[v9_18] Add system test lingering CLOSE_WAIT TCP sockets

See merge request isc-projects/bind9!6103
2022-04-07 16:44:16 +00:00
Ondřej SurýandMichal Nowak f1d1594e0a 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.

(cherry picked from commit b6eb31a0e3)
2022-04-07 18:07:14 +02:00
Matthijs MekkingandMichal Nowak b79c04d5f6 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

(cherry picked from commit b9ebde705b)
2022-04-07 18:07:08 +02:00
Michał Kępień 24f8670e3a Merge branch '3208-add-CHANGES-entry-v9_18' into 'v9_18'
[v9_18] Add CHANGES entry for GL #3208

See merge request isc-projects/bind9!6100
2022-04-07 13:08:01 +00:00
Michał Kępień 3008142393 Add CHANGES entry for GL #3208
(cherry picked from commit 059a602551)
2022-04-07 15:04:19 +02:00
Petr Špaček a7c8c41172 Merge branch 'pspacek/junit-report-v9_18' into 'v9_18'
Generate JUnit reports for unit & system tests [v9_18]

See merge request isc-projects/bind9!6097
2022-04-06 19:39:59 +00:00
Petr Špaček 8961dc452e 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.

(cherry picked from commit d26d4f289f)
2022-04-06 21:16:00 +02:00
Tony Finch b6f13cd43d Merge branch '3242-notify-notimeout-v9_18' into 'v9_18'
Ensure that zone maintenance queries have a retry limit (backport to 9.18)

See merge request isc-projects/bind9!6096
2022-04-06 17:36:16 +00:00
Tony Finch 4191fd01be 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.)

(cherry picked from commit 71ce8b0a51)
2022-04-06 18:17:55 +01:00
Tony Finch 9bcc537882 Make notify test shellcheck clean
Use POSIX shell syntax, and use functions to reduce repetition.

(cherry picked from commit 5867c1b727)
2022-04-06 18:16:44 +01:00
Ondřej Surý 8fef3e0efd Merge branch '3249-rename-configuration-option-to-reuseport-v9_18' into 'v9_18'
Rename the configuration option to load balance sockets to reuseport [v9.18]

See merge request isc-projects/bind9!6094
2022-04-06 15:42:08 +00:00
Ondřej Surý a1f3ff0dd1 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").

(cherry picked from commit 7e71c4d0cc)
2022-04-06 17:24:13 +02:00
Ondřej Surý fd9a2fc0ba Merge branch '3190-offload-rpz-updates-revert-v9_18' into 'v9_18'
Revert "Run the RPZ update as offloaded work" [v9.18]

See merge request isc-projects/bind9!6091
2022-04-06 11:49:11 +00:00
Ondřej Surý 25bc461446 Revert "General cleanup of dns_rpz implementation"
This reverts commit bfee462403.
2022-04-06 10:42:29 +02:00
Ondřej Surý 242500909a Revert "Refactor the dns_rpz_add/delete to use local rpz copy"
This reverts commit f4cba0784e.
2022-04-06 10:42:22 +02:00
Ondřej Surý 9b78612e7d Revert "Run the RPZ update as offloaded work"
This reverts commit e128b6a951.
2022-04-06 10:30:06 +02:00
Ondřej Surý c8a0899ddd Revert "Add CHANGES and release note for [GL #3190]"
This reverts commit f3ae14d8c3.
2022-04-06 10:30:04 +02:00
Arаm Sаrgsyаn b670334e6d Merge branch '3244-dig-use-after-free-v9_18' into 'v9_18'
[v9_18] When using +qr in dig print the data of the current query

See merge request isc-projects/bind9!6085
2022-04-05 12:26:09 +00:00
Aram Sargsyan 3914408950 Add CHANGES note for [GL #3244]
(cherry picked from commit ef9bd8533a)
2022-04-05 11:54:13 +00:00
Aram Sargsyan bf9bec6f91 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.

(cherry picked from commit 5b2b3e589c)
2022-04-05 11:54:06 +00:00
Aram Sargsyan 927f00e15d 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.

(cherry picked from commit 2771a5b64d)
2022-04-05 11:53:52 +00:00
Aram Sargsyan 8e57030f69 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.

(cherry picked from commit f831e758d1)
2022-04-05 11:53:45 +00:00
Michal Nowak b47c22677b Merge branch '3158-only-set-foundname-on-success-test-v9_18' into 'v9_18'
[v9_18] Add regression test for CVE-2022-0635

See merge request isc-projects/bind9!6082
2022-04-05 10:02:35 +00:00
Mark AndrewsandMichal Nowak 072e77dc9d Add regression test for CVE-2022-0635
(cherry picked from commit 56fbed2f0f)
2022-04-05 11:03:20 +02:00
Mark Andrews 702ab284c7 Merge branch '3220-digdelv-test-uses-address-outside-of-our-control-v9_18' into 'v9_18'
Use multiple fixed expressions for portable grep usage

See merge request isc-projects/bind9!6081
2022-04-05 05:04:18 +00:00
Mark Andrews 88265211cb Use multiple fixed expressions for portable grep usage
Additionally add "network unreachable" as an expected error message.

(cherry picked from commit 9ef4d2b583)
2022-04-05 14:34:40 +10:00
Ondřej Surý 70c8e77e36 Merge branch 'ondrej-dont-use-shutdown-function-name-v9_18' into 'v9_18'
Rename shutdown() to test_shutdown() in timer_test.c [v9.18]

See merge request isc-projects/bind9!6080
2022-04-05 00:02:04 +00:00
Ondřej Surý df91d61dc7 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().

(cherry picked from commit 7868d8145b)
2022-04-05 01:56:09 +02:00
Ondřej Surý 6c7fb350d7 Merge branch '3249-add-configuration-option-to-disable-SO_REUSEPORT_LB-fix-v9_18' into 'v9_18'
Enable the load-balance-sockets configuration [v9.18]

See merge request isc-projects/bind9!6077
2022-04-04 23:54:18 +00:00
Ondřej Surý cd24556e14 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.

(cherry picked from commit 142c63dda8)
2022-04-05 01:38:49 +02:00
Ondřej Surý 00d16d26b9 Merge branch '3249-add-configuration-option-to-disable-SO_REUSEPORT_LB-v9_18' into 'v9_18'
Add option to configure load balance sockets [v9.18]

See merge request isc-projects/bind9!6073
2022-04-04 22:42:26 +00:00
Ondřej Surý eef9459d87 Merge branch '3190-offload-rpz-updates-v9_18' into 'v9_18'
General cleanup of dns_rpz implementation [v9.18]

See merge request isc-projects/bind9!6072
2022-04-04 22:00:27 +00:00
Ondřej Surý 4c8e94fa71 Add CHANGES and release note for [GL #3249]
(cherry picked from commit 855f49cfba)
2022-04-05 00:00:17 +02:00
Ondřej Surý 64265f1c0e 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.

(cherry picked from commit 85c6e797aa)
2022-04-04 23:59:59 +02:00
Ondřej Surý f3ae14d8c3 Add CHANGES and release note for [GL #3190]
(cherry picked from commit 23a4559b34)
2022-04-04 22:59:59 +02:00
Ondřej Surý e128b6a951 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.

(cherry picked from commit f106d0ed2b)
2022-04-04 22:59:59 +02:00
Ondřej Surý f4cba0784e 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.

(cherry picked from commit b6e885c97f)
2022-04-04 22:59:59 +02:00
Ondřej Surý bfee462403 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)

(cherry picked from commit 840179a247)
2022-04-04 22:59:59 +02:00
Tony Finch cc1988187c Merge branch 'fanf/macos-ifconfig-v9_18' into 'v9_18'
MacOS needs more IP addresses to run the system tests (backport to 9.18)

See merge request isc-projects/bind9!6069
2022-04-04 14:24:30 +00:00
Tony Finch 541222043d 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.

(cherry picked from commit 29a3e77425)
2022-04-04 15:06:31 +01:00
Arаm Sаrgsyаn 83b7563111 Merge branch '3248-dig-stuck-using-a-server-with-a-mapped-ip-address-v9_18' into 'v9_18'
[v9_18] Fix dig hanging issue in cases when the lookup's next query can't start

See merge request isc-projects/bind9!6068
2022-04-04 10:20:35 +00:00
Aram Sargsyan 5c6580b31f Add CHANGES note for [GL #3248]
(cherry picked from commit 438e9b5587)
2022-04-04 09:19:44 +00:00
Aram Sargsyan 1294de8e36 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.

(cherry picked from commit 7e2f50c369)
2022-04-04 09:18:46 +00:00
Evan Hunt 2c4e7c1702 Merge branch '3250-resolver-test-non-querytrace-v9_18' into 'v9_18'
fix resolver test when built without --enable-querytrace

See merge request isc-projects/bind9!6065
2022-04-01 17:30:01 +00:00
Evan Hunt a18c824f6a 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.

(cherry picked from commit 5319d8adea)
2022-04-01 10:17:00 -07:00
Arаm Sаrgsyаn 71201fa71e Merge branch '3145-dig-+nssearch-does-not-exit-until-interrupted-v9_18' into 'v9_18'
[v9_18] Fix "dig +nssearch" indefinitely hanging issue

See merge request isc-projects/bind9!6057
2022-04-01 12:25:54 +00:00
Aram Sargsyan cfdf95d437 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`.

(cherry picked from commit 4477f71868)
2022-04-01 11:53:47 +00:00
Aram Sargsyan 09e9aabb11 Add CHANGES note for [GL #3145]
(cherry picked from commit 3a5793ece2)
2022-04-01 11:53:40 +00:00
Aram Sargsyan 16bdced2ca 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.

(cherry picked from commit 7d360bd05e)
2022-04-01 11:53:33 +00:00
Mark Andrews 49320f73df Merge branch '3191-issue-45178-in-oss-fuzz-bind9-dns_master_load_fuzzer-integer-overflow-in-generate-v9_18' into 'v9_18'
Prevent arithmetic overflow of 'i' in master.c:generate

See merge request isc-projects/bind9!6055
2022-04-01 11:01:42 +00:00
Evan HuntandMark Andrews 953f62c1e7 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.

(cherry picked from commit bd814b79d4)
2022-04-01 21:42:35 +11:00
Evan HuntandMark Andrews 8ac8197f0d update shell syntax
clean up the shell syntax in the checkzone test prior to adding
a new test.

(cherry picked from commit 2261c853b5)
2022-04-01 21:42:35 +11:00
Mark Andrews 3a3219fd3f Add test case for issue-45178
(cherry picked from commit 9039aad0f8)
2022-04-01 21:42:35 +11:00
Mark Andrews 1eff9bbf37 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.

(cherry picked from commit 5abdee9004)
2022-04-01 21:42:35 +11:00
Tony Finch 05224c32a7 Merge branch '3209-notauth-subdomain-v9_18' into 'v9_18'
Log "not authoritative for update zone" more clearly (v9.18)

See merge request isc-projects/bind9!6047
2022-03-30 13:20:58 +00:00
Tony Finch ec54de9e47 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

(cherry picked from commit 84c4eb02e7)
2022-03-30 13:19:46 +01:00
Ondřej Surý d45abcbd2f Merge branch 'ondrej/cleanup-unreachable-calls-v9_18' into 'v9_18'
Consistenly use UNREACHABLE() instead of ISC_UNREACHABLE()

See merge request isc-projects/bind9!6043
2022-03-28 21:56:42 +00:00
Ondřej Surý fc500b96eb 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:27:33 +02:00
Arаm Sаrgsyаn 8799add75e Merge branch '3221-catz-lightweight-cleanup-v9_18' into 'v9_18'
[v9_18] [1/5] Catalog zones lightweight cleanup

See merge request isc-projects/bind9!6038
2022-03-28 11:30:48 +00:00
Aram Sargsyan 8d3141ac10 Add CHANGES note for [GL #3221]
(cherry picked from commit 7fd24ded90)
2022-03-28 10:28:32 +00:00
Aram Sargsyan a20acee77d 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.

(cherry picked from commit a5a6362e92)
2022-03-28 10:26:58 +00:00
Aram Sargsyan 68bbce9813 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.

(cherry picked from commit f57c51fe05)
2022-03-28 10:26:49 +00:00
Aram Sargsyan 263b9d69af 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.

(cherry picked from commit 9b84bfb5f4)
2022-03-28 10:26:42 +00:00
Aram Sargsyan c79c059c4e 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.

(cherry picked from commit d29e5f197b)
2022-03-28 10:26:35 +00:00
Aram Sargsyan 3c3653ad2a 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.

(cherry picked from commit e861224cf4)
2022-03-28 10:26:26 +00:00
Ondřej Surý 78d6a20c88 Merge branch '3210-dns64-errors-v9_18' into 'v9_18'
More explicit dns64 prefix errors [v9.18]

See merge request isc-projects/bind9!6030
2022-03-25 20:21:32 +00:00
Tony FinchandOndřej Surý fef36e6b6f Add CHANGES note for [GL #3210]
(cherry picked from commit 132f30b623)
2022-03-25 16:08:43 +01:00
Tony FinchandOndřej Surý 775281d14a 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

(cherry picked from commit 496c02d32a)
2022-03-25 16:08:22 +01:00
Ondřej Surý 310169af9d Merge branch 'ondrej/statements-following-return-break-continue-or-goto-will-never-be-executed-v9_18' into 'v9_18'
Remove UNREACHABLE() statements after exit() [v9.18]

See merge request isc-projects/bind9!6028
2022-03-25 09:20:14 +00:00
Ondřej Surý d3727a52d7 Remove UNREACHABLE() statements after exit()
Couple of UNREACHABLE() statements following exit() were found and
removed.

(cherry picked from commit 81fdc4a822)
2022-03-25 10:07:25 +01:00
Ondřej Surý 010583541a Merge branch 'ondrej/use-newer-compiler-features-v9_18' into 'v9_18'
Use modern C and modern compiler features [v9.18]

See merge request isc-projects/bind9!6025
2022-03-25 08:41:06 +00:00
Ondřej Surý cd13d24ba2 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.

(cherry picked from commit ae508c17bc)
2022-03-25 08:42:19 +01:00
Ondřej SurýandOndřej Surý 5e19bbb48a 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.

(cherry picked from commit 20f0936cf2)
2022-03-25 08:42:18 +01:00
Ondřej SurýandOndřej Surý 07022525ff 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.

(cherry picked from commit 04d0b70ba2)
2022-03-25 08:42:18 +01:00
Ondřej SurýandOndřej Surý 128c550a95 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.

(cherry picked from commit 584f0d7a7e)
2022-03-25 08:42:16 +01:00
Ondřej SurýandOndřej Surý c62a94363d 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.

(cherry picked from commit fe7ce629f4)
2022-03-25 08:41:09 +01:00
Ondřej Surý 3a4f6ae775 Merge branch 'ondrej-save-tsan-files-with-txt-extension-v9_18' into 'v9_18'
Save parsed tsan files with .txt extension [v9.18]

See merge request isc-projects/bind9!6020
2022-03-23 19:32:12 +00:00
Ondřej Surý 5f56fac2b9 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.

(cherry picked from commit 80582073a5)
2022-03-23 20:30:52 +01:00
Matthijs Mekking 554d63fb51 Merge branch 'matthijs-engine_pkcs11-save-error-output-v9_18' into 'v9_18'
[v9_18] Save keyfromlabel error output

See merge request isc-projects/bind9!6008
2022-03-21 10:28:57 +00:00
Matthijs Mekking 61fcbdfd7c Save keyfromlabel error output
Save the error output from pkcs11-tool and dnssec-keyfromlabel in the
engine_pkcs11 system test.

(cherry picked from commit d6d107d804)
2022-03-21 10:36:09 +01:00
Tony Finch 54e37e89ce Merge branch '3201-no-vla-v9_18' into 'v9_18'
Avoid using C99 variable-length arrays

See merge request isc-projects/bind9!6003
2022-03-18 16:42:57 +00:00
Tony Finch 03e0083e3b 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.

(cherry picked from commit 599c1d2a6b)
2022-03-18 16:05:56 +00:00
Tony Finch ac5d61541d 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.

(cherry picked from commit eeead1cfe7)
2022-03-18 16:05:56 +00:00
Arаm Sаrgsyаn 312bdb9e5c Merge branch '3205-dig-tcp-next-server-on-connection-error-crash-v9_18' into 'v9_18'
[v9_18] Fix dig error when trying the next server after a TCP connection failure

See merge request isc-projects/bind9!6001
2022-03-18 11:19:33 +00:00
Aram Sargsyan 964abb938f Add CHANGES note for [GL #3205]
(cherry picked from commit ced79790b3)
2022-03-18 10:31:17 +00:00
Aram Sargsyan 3c2816a5be 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.

(cherry picked from commit 03697f1bcc)
2022-03-18 10:31:10 +00:00
Aram Sargsyan 19787fb752 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).

(cherry picked from commit 0fb4fc1897)
2022-03-18 10:31:03 +00:00
Arаm Sаrgsyаn 893b6f2404 Merge branch '3128-dig-does-not-recover-from-a-isc_nm_udpconnect-failure-v9_18' into 'v9_18'
[v9_18] After dig request errors, try to use other servers when they exist

See merge request isc-projects/bind9!6000
2022-03-18 10:25:31 +00:00
Aram Sargsyan 956f022a2b Add CHANGES entry for [GL #3128]
(cherry picked from commit b3a058e7bb)
2022-03-18 09:21:07 +00:00
Aram Sargsyan df7616ec09 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.

(cherry picked from commit e8a64d0cbe)
2022-03-18 09:20:57 +00:00
Aram Sargsyan 992997967b 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.

(cherry picked from commit bc203d6082)
2022-03-18 09:20:50 +00:00
Arаm Sаrgsyаn da7e4da2de Merge branch '3020-dighost-servfail-bug-v9_18' into 'v9_18'
[v9_18] When resending a UDP request, insert the query to the lookup's list

See merge request isc-projects/bind9!5998
2022-03-18 09:03:32 +00:00
Aram Sargsyan f64cd23e7b 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.

(cherry picked from commit 3ec5d2d6ed)
2022-03-18 08:29:13 +00:00
Aram Sargsyan 1e17d5a130 Add CHANGES note for [GL #3020]
(cherry picked from commit e353700189)
2022-03-18 08:28:42 +00:00
Aram Sargsyan 58685cd573 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.

(cherry picked from commit a962475948)
2022-03-18 08:27:07 +00:00
Aram Sargsyan b6bd2a5311 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.

(cherry picked from commit e888c62fbd)
2022-03-18 08:27:00 +00:00
Ondřej Surý 3d27a75eca Merge branch '3208-fix-xfrout-maxtimer-timer-log-message-log-level-v9_18' into 'v9_18'
Change xfer-out timer message log level to DEBUG(1)

See merge request isc-projects/bind9!5996
2022-03-17 20:40:26 +00:00
Ondřej Surý 5e253fd629 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).

(cherry picked from commit 8f6e4dfa15)
2022-03-17 21:38:24 +01:00
Ondřej Surý c965b315c5 Merge branch 'ondrej/add-missing-braces-clang-format-15-v9_18' into 'v9_18'
Add couple missing braces around single-line statements [v9.18]

See merge request isc-projects/bind9!5969
2022-03-17 19:42:49 +00:00
Ondřej Surý 485a2b329e 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:29:57 +01:00
Michał Kępień d5cf60ab3d Merge branch 'v9_18_1-release' into 'v9_18'
Merge 9.18.1 release branch

See merge request isc-projects/bind9!5990
2022-03-16 22:36:26 +00:00
Michał Kępień cc59e6fd3f Set up release notes for BIND 9.18.2 2022-03-16 23:18:18 +01:00
Michał Kępień bd24843fa7 Update BIND version to 9.18.1 2022-03-16 23:18:18 +01:00
Michał Kępień d76bab0c8c Add a CHANGES marker 2022-03-16 23:18:18 +01:00
Michał Kępień 6b5f682ff1 Merge branch 'michal/prepare-documentation-for-bind-9.18.1' into 'security-v9_18'
Prepare documentation for BIND 9.18.1

See merge request isc-private/bind9!392
2022-03-16 23:18:18 +01:00
Michał Kępień 29eee12ccb Merge branch '3129-check-fetch-shutting-down-in-resume_dslookup-v9_18' into 'security-v9_18'
[CVE-2022-0667] [v9_18] Check if the fetch is shutting down in resume_dslookup()

See merge request isc-private/bind9!379
2022-03-16 23:18:18 +01:00
Michał Kępień 2841d81160 Prepare release notes for BIND 9.18.1 2022-03-16 23:18:18 +01:00
Michał Kępień 4158b69eb0 Merge branch '3158-confidential-issue-only-set-foundname-on-success-v9_18' into 'security-v9_18'
[v9_18] [CVE-2022-0635] DNAME lookups can trigger INSIST when synth-from-dnssec is enabled

See merge request isc-private/bind9!391
2022-03-16 23:18:18 +01:00
Aram SargsyanandMichał Kępień 897e332b6c Add CHANGES and release note for [GL #3129] 2022-03-16 23:18:18 +01:00
Michał Kępień 4f51dc7408 Reorder release notes 2022-03-16 23:18:18 +01:00
Michał Kępień a64496ef02 Merge branch '3112-ensure-correct-ordering-in-isc__nm_process_sock_buffer-v9_18' into 'security-v9_18'
[CVE-2022-0396] [v9_18] Resolve #3112 TCP sockets stuck in CLOSE_WAIT

See merge request isc-private/bind9!375
2022-03-16 23:18:18 +01:00
Mark AndrewsandMichał Kępień 4a23672009 Add CHANGES and release note for [GL #3158] 2022-03-16 23:18:18 +01:00
Aram SargsyanandMichał Kępień 09ec28dc9e 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 23:18:18 +01:00
Michał Kępień 305c5bb5fa Tweak and reword release notes 2022-03-16 23:18:18 +01:00
Michał Kępień f4a911ea5f Merge branch '2950-confidential-cache-acceptance-rules-v9_18' into 'security-v9_18'
[CVE-2021-25220] [v9_18] prevent cache poisoning from forwarder responses

See merge request isc-private/bind9!382
2022-03-16 23:18:18 +01:00
Ondřej SurýandMichał Kępień 4a025c19b9 Add CHANGES and release note for [GL #3112] 2022-03-16 23:18:18 +01:00
Mark AndrewsandMichał Kępień bc8f721d59 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 23:18:18 +01:00
Michał Kępień ddd5c6aace Fix typo in CHANGES 2022-03-16 23:18:18 +01:00
Petr ŠpačekandMichał Kępień 1e11351d50 Add Release Note for [GL #2950] 2022-03-16 23:18:18 +01:00
Ondřej SurýandMichał Kępień 6ec223a539 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 23:18:18 +01:00
Mark AndrewsandMichał Kępień 1d32fbcd34 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 23:18:18 +01:00
Michał Kępień 5a7c04b520 Remove outdated release notes 2022-03-16 23:18:18 +01:00
Petr ŠpačekandMichał Kępień 7b03643483 Add CHANGES note for [GL #2950] 2022-03-16 23:18:18 +01:00
Mark AndrewsandMichał Kępień 4baf22c0f0 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 23:18:18 +01:00
Mark AndrewsandMichał Kępień 0347eed567 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 23:18:18 +01:00
Mark AndrewsandMichał Kępień 67179e8973 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 23:18:18 +01:00
Mark AndrewsandMichał Kępień f7cb79b66a 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 23:18:18 +01:00
Matthijs Mekking f2c813c635 Merge branch '3185-follow-up-fix-zone-documentation-v9_18' into 'v9_18'
[v9_18] Fix zone named.conf man page documentation

See merge request isc-projects/bind9!5981
2022-03-15 16:00:07 +00:00
Matthijs Mekking 617b1d7f28 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.

(cherry picked from commit 01b125ff05)
2022-03-15 14:15:26 +01:00
Petr Špaček 5f3713852b Merge branch 'pspacek/manpage-hyperlinks-v9_18' into 'v9_18'
Add hyperlinks to manual pages [v9_18]

See merge request isc-projects/bind9!5975
2022-03-14 10:38:11 +00:00
Petr Špaček 4daef4a2a7 Fix dig option hyperlinks in the TSIG section of hte 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.
2022-03-14 11:28:02 +01:00
Tony FinchandPetr Špaček 4b96f17ab2 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.

(cherry picked from commit ad5b0402c9)
2022-03-14 11:01:32 +01:00
Petr Špaček 680869cbe2 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.

(cherry picked from commit 1d4d008fc9)
2022-03-14 11:01:32 +01:00
Petr Špaček 4063ed938a Remove reference to ndc utility from BIND 8
(cherry picked from commit 420a71df57)
2022-03-14 11:01:32 +01:00
Petr Špaček 07044325eb 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.

(cherry picked from commit 53a5776025)
2022-03-14 11:01:31 +01:00
Petr Špaček 52a20d646d 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"

(cherry picked from commit c7085be211)
2022-03-14 10:57:29 +01:00
Petr Špaček d13066ca5b 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.

(cherry picked from commit 7e7a946d44)
2022-03-14 10:57:29 +01:00
Tony FinchandPetr Špaček 1538326417 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.

(cherry picked from commit ccc6378355)
2022-03-14 10:57:29 +01:00
Petr Špaček 8066485ea3 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.

(cherry picked from commit a85df3ff9c)
2022-03-14 10:57:23 +01:00
Petr Špaček e0c336f337 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.

(cherry picked from commit 8537878c01)
2022-03-14 10:56:19 +01:00
Petr Špaček b4e46de257 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.

(cherry picked from commit ec30944aa4)
2022-03-14 10:56:19 +01:00
Michał Kępień ed7c208616 Merge branch 'michal/tidy-setup-of-python-based-tests-v9_18' into 'v9_18'
[v9_18] Tidy setup of Python-based tests

See merge request isc-projects/bind9!5973
2022-03-14 08:55:15 +00:00
Michał Kępień 0af0e49b20 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").

(cherry picked from commit 173ad9cf46)
2022-03-14 09:04:10 +01:00
Michał Kępień 3fa2cc5c3d 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

(cherry picked from commit 00392921f0)
2022-03-14 09:04:10 +01:00
Michał Kępień ac229a2fd5 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.

(cherry picked from commit 49312d6bb2)
2022-03-14 09:04:10 +01:00
Michał Kępień 238781de4a 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.

(cherry picked from commit 05c97f2329)
2022-03-14 09:04:10 +01:00
Michał Kępień dbddc22187 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.

(cherry picked from commit 704ad2907f)
2022-03-14 09:04:10 +01:00
Michał Kępień 4fac33c9d5 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.

(cherry picked from commit 286b57c7f1)
2022-03-14 09:04:10 +01:00
Michał Kępień 3680763577 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.

(cherry picked from commit 0a76f186a5)
2022-03-14 09:04:10 +01:00
Michał Kępień f37e0f2cbe 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.

(cherry picked from commit 96b7f9f9aa)
2022-03-14 09:04:10 +01:00
Michał Kępień 4847de9de1 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

(cherry picked from commit 4e0d576858)
2022-03-14 09:04:10 +01:00
Michał Kępień 0cc4ff04ec 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.

(cherry picked from commit 53ef8835c1)
2022-03-14 09:04:10 +01:00
Ondřej Surý 5ac5ec11e0 Merge branch '3203-fix-the-build-flag-order-v9_18' into 'v9_18'
Fix the remaining cases of <prog>_CFLAGS -> <prog>_CPPFLAGS [v9.18]

See merge request isc-projects/bind9!5972
2022-03-13 18:23:04 +00:00
Ondřej Surý 651af0bf65 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.

(cherry picked from commit 41a60a0e21)
2022-03-13 18:53:19 +01:00
Petr Špaček c74d78a9ff Merge branch '2799-doc-build-fixes-v9_18' into 'v9_18'
Fix docs build [v9_18]

See merge request isc-projects/bind9!5964
2022-03-11 11:28:12 +00:00
Petr Špaček 7130576276 Fix docs build from tarball broken by MR !5254
Related: !5254
(cherry picked from commit 524fce77fe)
2022-03-11 12:23:20 +01:00
Petr Špaček 25328e2ca4 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.

(cherry picked from commit b0f6fc7f2f)
2022-03-11 12:23:19 +01:00
Petr Špaček 31d572d580 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.

(cherry picked from commit 188684a31d)
2022-03-11 12:23:15 +01:00
Ondřej Surý c1f995cc17 Merge branch '3200-add-per-send-timer-v9_18' into 'v9_18'
Change single write timer to per-send timers [v9.18]

See merge request isc-projects/bind9!5963
2022-03-11 10:26:40 +00:00
Ondřej Surý ab2dfec43f Add CHANGES and release note for [GL #3200]
(cherry picked from commit 8ace9e0c62)
2022-03-11 10:52:43 +01:00
Ondřej Surý 6fbf582f18 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.

(cherry picked from commit 49c804f8b7)
2022-03-11 10:52:22 +01:00
Ondřej Surý fd351a60ff 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.

(cherry picked from commit 6ddac2d56d)
2022-03-11 10:52:22 +01:00
Ondřej Surý 27e47c5101 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.

(cherry picked from commit a761aa59e3)
2022-03-11 10:52:22 +01:00
Petr Špaček 923ea06654 Merge branch '2799-documentation-for-administrative-tools-is-out-of-sync-with-manual-pages-v9_18' into 'v9_18'
Fix Administrative Tools section in the ARM [v9_18]

See merge request isc-projects/bind9!5958
2022-03-10 19:23:08 +00:00
Tony FinchandPetr Špaček 98604b21a5 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.

(cherry picked from commit 178aef5b8c)
2022-03-10 20:18:52 +01:00
Petr Špaček 42069e5f16 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.

(cherry picked from commit 785f6d470f)
2022-03-10 20:18:52 +01:00
Suzanne GoldlustandPetr Špaček 3554ec4615 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
(cherry picked from commit 2d2d87a615)
2022-03-10 20:18:52 +01:00
Tony FinchandPetr Špaček 85a8e8f21a In the ARM appendix, sort man page sections alphabetically
(cherry picked from commit 315b3c3a1a)
2022-03-10 20:18:52 +01:00
Petr Špaček 158092f9b7 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
(cherry picked from commit 9992f7808c)
2022-03-10 20:18:52 +01:00
Petr Špaček bab233d766 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
(cherry picked from commit 2e42414522)
2022-03-10 20:18:52 +01:00
Petr Špaček 1ffe6d19cb Remove nonexistent option -r from confgen man pages
Fixes omission in !269.

Fixes: #2826
(cherry picked from commit 473d5a8d03)
2022-03-10 20:18:46 +01:00
Tony Finch cb4f8d5348 Merge branch '3199-doc-dev-v9_18' into 'v9_18'
Remove documentation for `rndc keydone`

See merge request isc-projects/bind9!5957
2022-03-10 15:42:46 +00:00
Tony Finch 59372ede60 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.

(cherry picked from commit e532d39146)
2022-03-10 14:53:21 +00:00
Tony Finch 20ee59d6a9 Drop references to Windows in doc/dev
Windows is not a supported platform any more.

(cherry picked from commit 037468f6a4)
2022-03-10 14:53:21 +00:00
Tony Finch 9aeec183cf 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.

(cherry picked from commit 328d11297d)
2022-03-10 14:53:21 +00:00
Tony Finch c9b6dba4a9 Drop documents that have been folded into doc/dev/dev.md
There is no need to keep obsolete duplicate docs around.

(cherry picked from commit ec1e8e7001)
2022-03-10 14:53:21 +00:00
Tony Finch 8f7f5b5941 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.

(cherry picked from commit 6be83f2eb7)
2022-03-10 14:53:21 +00:00
Ondřej Surý f462590546 Merge branch 'ondrej/remove-ATOMIC_VAR_INIT-v9_18' into 'v9_18'
Remove usage of deprecated ATOMIC_VAR_INIT() macro

See merge request isc-projects/bind9!5950
2022-03-09 09:33:25 +00:00
Ondřej Surý 913e64e8e1 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

(cherry picked from commit f251d69eba)
2022-03-09 09:25:37 +01:00
Ondřej Surý b37b98cf3b Merge branch 'ondrej/lib/isc/ht.c-cleanup-v9_18' into 'v9_18'
Make isc_ht_init() and isc_ht_iter_create() return void [v9.18]

See merge request isc-projects/bind9!5946
2022-03-08 19:47:21 +00:00
Ondřej Surý ebe2baec95 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.

(cherry picked from commit d128656d2e)
2022-03-08 20:47:06 +01:00
Ondřej Surý ce9908cb4e 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.

(cherry picked from commit 8fa27365ec)
2022-03-08 20:47:06 +01:00
Ondřej Surý ddc6479792 Merge branch 'ondrej/lib/isc/heap.c-cleanup-v9_18' into 'v9_18'
Make isc_heap_create() and isc_heap_insert() return void

See merge request isc-projects/bind9!5944
2022-03-08 19:25:46 +00:00
Ondřej SurýandOndřej Surý b3d0c95e68 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.

(cherry picked from commit bbb4cdb92d)
2022-03-08 20:24:54 +01:00
Ondřej Surý 09aede730b Merge branch '2201-reimplement-set_tcp_maxseg-for-netmgr-v9_18' into 'v9_18'
Set minimum MTU (1280) on IPv6 sockets

See merge request isc-projects/bind9!5942
2022-03-08 10:58:04 +00:00
Ondřej Surý b1878aa2ac Add CHANGES note for [GL #2201]
(cherry picked from commit 67dbe0ae4d)
2022-03-08 11:12:44 +01:00
Ondřej SurýandOndřej Surý 445ce0c165 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.

(cherry picked from commit 8098a58581)
2022-03-08 11:12:43 +01:00
Ondřej SurýandOndřej Surý 2a31f19817 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.

(cherry picked from commit 5d34a14f22)
2022-03-08 11:12:43 +01:00
Ondřej Surý fea6d595e2 Merge branch 'aram-fix-dns_request_createraw-cleanup-bug-v9_18' into 'v9_18'
[v9_18] Fix a function cleanup bug in dns_request_createraw()

See merge request isc-projects/bind9!5939
2022-03-08 09:00:50 +00:00
Aram SargsyanandOndřej Surý 8f2e287a56 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.

(cherry picked from commit 963f6a2203)
2022-03-08 10:00:00 +01:00
Ondřej Surý df3a9e1286 Merge branch '3193-null-pointer-dereferences-in-udp_ready-v9_18' into 'v9_18'
Fix null pointer dereferences in udp_ready() (v9.18)

See merge request isc-projects/bind9!5936
2022-03-08 08:59:21 +00:00
Ondřej Surý c13e191e52 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.

(cherry picked from commit 9d8e8a4fcc)
2022-03-08 09:59:06 +01:00
Ondřej Surý 1996d1b91b Merge branch 'ondrej/refactor-tooling-around-lib/gen/dns.c-v9_18' into 'v9_18'
Merge lib/dns/gen.h contents to lib/dns/gen.c (v9.18)

See merge request isc-projects/bind9!5933
2022-03-08 08:57:36 +00:00
Ondřej SurýandOndřej Surý 898d0f8ee2 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.

(cherry picked from commit b5a5eed7a0)
2022-03-08 09:55:28 +01:00
Ondřej SurýandOndřej Surý d9e54ad0dd 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.

(cherry picked from commit f24b26188d)
2022-03-08 09:55:28 +01:00
Ondřej Surý 22b8eaf11d Merge branch 'ondrej-use-locked-queue-v9_18' into 'v9_18'
Replace netievent lock-free queue with simple locked queue (v9.18)

See merge request isc-projects/bind9!5932
2022-03-08 08:54:46 +00:00
Ondřej Surý 6c29cba8c5 Add CHANGES note for [GL #3180]
(cherry picked from commit d75b953489)
2022-03-08 09:52:54 +01:00
Ondřej Surý 555bdb9f82 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.

(cherry picked from commit 6bd025942c)
2022-03-08 09:52:39 +01:00
Ondřej Surý 3fff8ee18d Merge branch '3105-assertion-failure-on-shutdown-in-req_senddone-v9_18' into 'v9_18'
Add attach/detach for the dns_dispatch_send() (v9.18)

See merge request isc-projects/bind9!5931
2022-03-08 08:51:50 +00:00
Ondřej Surý 122cfb2d45 Add CHANGES file for [GL #3105]
(cherry picked from commit a53ed01d03)
2022-03-08 09:50:29 +01:00
Ondřej Surý 2e461b9012 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.

(cherry picked from commit be34b1c535)
2022-03-08 09:50:13 +01:00
Ondřej Surý c6f8e68dd8 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.

(cherry picked from commit f3ca90a804)
2022-03-08 09:50:13 +01:00
Ondřej Surý 1687f4f243 Merge branch '3184-query-context-management-issues-in-dighost-c-v9_18' into 'v9_18'
Fix query context management issues in dighost.c (v9.18)

See merge request isc-projects/bind9!5929
2022-03-08 08:48:44 +00:00
Ondřej Surý 97608c25fd Add CHANGES note for [GL #3184]
(cherry picked from commit f3228df622)
2022-03-08 09:14:34 +01:00
Aram SargsyanandOndřej Surý 5f5e1c0ac2 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`.

(cherry picked from commit 4043fe9090)
2022-03-08 09:14:06 +01:00
Aram SargsyanandOndřej Surý 8b6245e298 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.

(cherry picked from commit 98820aef7e)
2022-03-08 09:14:06 +01:00
Mark Andrews 74c98d82f0 Merge branch '3142-add-checkconf-check-for-dnssec-policy-keys-algorithm-v9_18' into 'v9_18'
Add test configurations with invalid dnssec-policy clauses

See merge request isc-projects/bind9!5941
2022-03-08 04:06:24 +00:00
Mark Andrews 63f194995a Add release note for [GL #3142]
(cherry picked from commit e48af36981)
2022-03-08 14:29:32 +11:00
Mark Andrews d1766d4515 Add CHANGES entry for [GL #3142]
(cherry picked from commit d4c2395fff)
2022-03-08 14:29:30 +11:00
Mark Andrews d752bbfb22 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.

(cherry picked from commit 9bcf45f4ce)
2022-03-08 14:28:53 +11:00
Mark Andrews 1b54642535 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

(cherry picked from commit f23e86b96b)
2022-03-08 14:28:53 +11:00
Petr Špaček abdc967ce8 Merge branch 'pspacek/relnote-python-tools-removal' into 'v9_18'
Add release note about removal of Python tools [v9_18]

See merge request isc-projects/bind9!5803
2022-03-03 09:38:21 +00:00
Petr Špaček 51180dc3e4 Add release note about removal of Python tools
The release note should have been added in commit
98b3b93791.

Related: !985
2022-03-03 10:36:07 +01:00
Arаm Sаrgsyаn 3ea74d43e5 Merge branch '3172-libressl-3.5.0-compat-v9_18' into 'v9_18'
[v9_18] Resolve "BIND is not compatible with LibreSSL 3.5.0"

See merge request isc-projects/bind9!5913
2022-03-02 11:39:58 +00:00
Aram Sargsyan 9fb6bb9e9d Add CHANGES entry for [GL #3172]
(cherry picked from commit 0f399851d88b7958a45bfbc4f626e82bdc34c771)
2022-03-02 10:50:11 +00:00
Aram Sargsyan 8336e9b90d 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.

(cherry picked from commit 749973f3259b7638a6af02b7da2f40ae28bdd402)
2022-03-02 10:49:47 +00:00
Aram Sargsyan b7e84e8a26 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.

(cherry picked from commit a3789053682b57a2031de8c544134f1923e76cf3)
2022-03-02 10:49:47 +00:00
Evan Hunt b8c1ba897f Merge branch '3174-fix-zone-documentation-v9_18' into 'v9_18'
fix zone documentation in named.conf man page

See merge request isc-projects/bind9!5922
2022-03-02 10:13:29 +00:00
Evan Hunt 0a8dece1be 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.

(cherry picked from commit 4ca74eee49)
2022-03-02 01:58:18 -08:00
Mark Andrews 5d84a24082 Merge branch '3175-add-missing-grow-data-call-in-isc-lex-gettoken-v9_18' into 'v9_18'
Grow the lex token buffer in one more place

See merge request isc-projects/bind9!5920
2022-03-02 02:13:46 +00:00
Mark Andrews ba3862197b Add CHANGES note for [GL #3175]
(cherry picked from commit ce8703a79e)
2022-03-02 01:05:14 +00:00
Mark Andrews bc9aa8aa42 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.

(cherry picked from commit d36938321e)
2022-03-02 01:05:14 +00:00
Mark Andrews 651ef3ebb8 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.

(cherry picked from commit 4c356d2770)
2022-03-02 01:05:14 +00:00
Mark Andrews 9668d72f3c Merge branch '3176-issue-45110-by-clusterfuzz-external-bind9-dns_master_load_fuzzer-undefined-shift-in-soa_get-v9_18' into 'v9_18'
Use unsigned arithmetic when shifting by 24

See merge request isc-projects/bind9!5917
2022-03-02 01:01:51 +00:00
Mark Andrews c5519265df 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.

(cherry picked from commit b8b99603f1)
2022-03-02 11:06:39 +11:00
Ondřej Surý 69ebb69b0e Merge branch '3177-add-missing-isc_nm_tcpsocket-to-isc__nmsocket_reset-v9_18' into 'v9_18'
Handle TCP sockets in isc__nmsocket_reset()

See merge request isc-projects/bind9!5911
2022-02-28 11:13:57 +00:00
Ondřej Surý 806848a440 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().

(cherry picked from commit b220fb32bd)
2022-02-28 11:17:41 +01:00
Evan Hunt 8ebce219f5 Merge branch '2802-fix-missed-occurrences-of-renaming-masters-to-primaries-v9_18' into 'v9_18'
Resolve "Fix missed occurrences of renaming masters to primaries"

See merge request isc-projects/bind9!5908
2022-02-26 00:57:13 +00:00
Evan Hunt 7b604df69d remove old zone type documentation
we now document zone type as either "primary" or "secondary",
omitting the old terms (though they are still accepted).

(cherry picked from commit 0bde07261b)
2022-02-25 16:51:44 -08:00
Evan Hunt 87be8fea0d 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.

(cherry picked from commit 0e57fc160e)
2022-02-25 16:51:44 -08:00
Mark Andrews bb98147d7a Merge branch '3170-tiny-typo-in-doc-build-script-v9_18' into 'v9_18'
correctly exclude logging-categories.rst

See merge request isc-projects/bind9!5902
2022-02-24 22:14:07 +00:00
Mark Andrews 76a16e319c correctly exclude logging-categories.rst
(cherry picked from commit 0069a689a6)
2022-02-25 01:20:45 +11:00
Petr Špaček 56096360be Merge branch 'pspacek/fuzz-rdata-from-text-v9_18' into 'v9_18'
Add dns_rdata_fromtext() fuzzer [v9_18]

See merge request isc-projects/bind9!5901
2022-02-24 10:54:55 +00:00
Petr Špaček e2c627a067 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.

(cherry picked from commit dc9ba2d3ef)
2022-02-24 11:40:19 +01:00
Petr Špaček 5da2913ee9 Fix configure options in FUZZING.md
(cherry picked from commit 759ad04eb8)
2022-02-24 11:40:19 +01:00
Petr Špaček 0323234e8e Merge branch 'pspacek/fuzz_zonefile-v9_18' into 'v9_18'
Add dns_master_loadbuffer() fuzzer [v9_18]

See merge request isc-projects/bind9!5900
2022-02-24 09:16:38 +00:00
Petr Špaček e6befc2ad5 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.

(cherry picked from commit 5076355822)
2022-02-24 10:13:10 +01:00
Ondřej Surý 3d3b7de309 Merge branch '3166-disable-inactivehandles-caching-with-address-sanitizer-v9_18' into 'v9_18'
Disable inactive handles caching when compiled with sanitizers

See merge request isc-projects/bind9!5896
2022-02-23 23:50:18 +00:00
Ondřej Surý 408b79ba24 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.

(cherry picked from commit be339b3c83)
2022-02-24 00:16:25 +01:00
Ondřej Surý dad941a288 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.

(cherry picked from commit 92cce1da65)
2022-02-24 00:11:03 +01:00
Ondřej Surý c90af66acd Merge branch '3167-remove-isc__nmsocket_t-ah_handles-v9_18' into 'v9_18'
Remove active handles tracking from isc__nmsocket_t

See merge request isc-projects/bind9!5894
2022-02-23 22:55:16 +00:00
Ondřej Surý 51040c2806 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.

(cherry picked from commit e2555a306f)
2022-02-23 23:49:13 +01:00
Ondřej Surý 405559e4f3 Merge branch '3166-delay-isc__nm_uvreq_t-deallocation-v9_18' into 'v9_18'
Delay isc__nm_uvreq_t deallocation to connection callback

See merge request isc-projects/bind9!5892
2022-02-23 22:47:48 +00:00
Ondřej Surý afe8a60f98 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.

(cherry picked from commit 3268627916)
2022-02-23 23:31:18 +01:00
Ondřej Surý dc750e090b Merge branch 'ondrej-cleanup-nm_destroy-dequeue-v9_18' into 'v9_18'
Properly free up enqueued netievents in nm_destroy()

See merge request isc-projects/bind9!5889
2022-02-23 22:25:42 +00:00
Ondřej Surý 74948421a6 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.

(cherry picked from commit 88418c3372)
2022-02-23 22:53:31 +01:00
Michał Kępień 9862265cc9 Merge branch '3147-fix-more-ns_statscounter_recursclients-underflows-v9_18' into 'v9_18'
[v9_18] Fix more ns_statscounter_recursclients underflows

See merge request isc-projects/bind9!5880
2022-02-23 14:02:57 +00:00
Michał Kępień 87d5dff4a3 Add CHANGES entry for GL #3147
(cherry picked from commit 600f9010d2)
2022-02-23 14:43:09 +01:00
Michał Kępień d1f27a336a Add release note for GL #3147
(cherry picked from commit 1c462a63ec)
2022-02-23 14:43:09 +01:00
Michał Kępień 5929411f90 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.

(cherry picked from commit f7482b68b9)
2022-02-23 14:43:09 +01:00
Petr Špaček e5cc4be4b4 Merge branch 'pspacek/windows-bat-removal-v9_18' into 'v9_18'
Remove leftover .bat file [v9_18]

See merge request isc-projects/bind9!5876
2022-02-22 15:09:37 +00:00
Petr Špaček 414cbdbee3 Remove last .bat file from the source tree
This fixes an omission in !5739, "Remove leftover test code for Windows".

(cherry picked from commit 653db956f0)
2022-02-22 16:05:29 +01:00
Matthijs Mekking 2c972005f6 Merge branch '3164-fix-parental-agents-documentation-v9_18' into 'v9_18'
Fix typo in DNSSEC guide parental-agents example

See merge request isc-projects/bind9!5873
2022-02-22 13:47:02 +00:00
Matthijs Mekking 7012680a11 Fix typo in DNSSEC guide parental-agents example
The example will not load because of the typo, the comma should be a
semicolon.

(cherry picked from commit fd5e39cc76)
2022-02-22 14:06:59 +01:00
Michał Kępień 01074e26f2 Merge branch 'michal/handle-fctx-in-FCTXTRACE-macro-stubs-v9_18' into 'v9_18'
[v9_18] Add "UNUSED(fctx);" to FCTXTRACE*() macro stubs

See merge request isc-projects/bind9!5871
2022-02-21 10:09:04 +00:00
Michał Kępień 08b2c1be44 Add "UNUSED(fctx);" to FCTXTRACE*() macro stubs
Commit 21ae6bb1b2 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.

(cherry picked from commit b645e28167)
2022-02-21 11:06:28 +01:00
Evan Hunt 92fc6c2221 Merge branch '3141-remove-the-artificial-stream-clients-limit-v9_18' into 'v9_18'
Remove the limit on the number of simultaneous TCP queries

See merge request isc-projects/bind9!5865
2022-02-18 02:36:35 +00:00
Ondřej SurýandEvan Hunt bf21c4de6a Add CHANGES and release note for [GL #3141]
(cherry picked from commit 2bcf5a5315)
2022-02-17 16:57:34 -08:00
Ondřej SurýandEvan Hunt 780a89012d 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.

(cherry picked from commit 4f5b4662b6)
2022-02-17 16:57:34 -08:00
Ondřej Surý d96ac73bd4 Merge branch '1897-fix-max-transfer-timeouts-v9_18' into 'v9_18'
Reimplement the max-transfer-time-out and max-transfer-idle-out (v9.18)

See merge request isc-projects/bind9!5862
2022-02-17 22:00:20 +00:00
Ondřej Surý c625e791af Merge branch 'ondrej/v9_18-is-not-a-main-branch' into 'v9_18'
Disable main branch checking for v9_18 branch

Closes #3120 and #1918

See merge request isc-projects/bind9!5864
2022-02-17 21:29:36 +00:00
Ondřej Surý f66edb7ee9 Add CHANGES and release note for [GL #1897]
(cherry picked from commit 987ad32fac)
2022-02-17 22:29:29 +01:00
Ondřej Surý 9157fcdec6 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.

(cherry picked from commit 8fed1b6461)
2022-02-17 22:29:29 +01:00
Ondřej Surý 0ccc14fae9 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.

(cherry picked from commit 8643bbab84)
2022-02-17 22:29:29 +01:00
Ondřej Surý 8f39c9a8d7 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.

(cherry picked from commit 037549c405)
2022-02-17 22:29:29 +01:00
Ondřej Surý 8b2ae8cc84 Add network manager based timer API
This commits adds API that allows to create arbitrary timers associated
with the network manager handles.

(cherry picked from commit 3c7b04d015)
2022-02-17 22:29:29 +01:00
Ondřej Surý 7d12f734f1 Disable main branch checking for v9_18 branch
The util/check-changes script has two modes of operation - more relaxed
release branch mode and strict development branch mode.  When we forked
the v9_18 branch, the stricter mode stayed enabled.

Disable the strict CHANGES file checking suitable only for development
branch.
2022-02-17 22:24:51 +01:00
Ondřej Surý aec1ce9f52 Merge branch '3149-drop-TCP-connection-when-garbage-is-received-v9_18' into 'v9_18'
Reset the TCP connection when garbage is received

See merge request isc-projects/bind9!5861
2022-02-17 20:24:00 +00:00
Ondřej Surý c5f4887ee8 Add CHANGES and release note for [GL #3149]
(cherry picked from commit 9f1c439335)
2022-02-17 21:02:02 +01:00
Ondřej Surý 8a66d6d58d 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

(cherry picked from commit ebfdb50ac7)
2022-02-17 21:02:02 +01:00
Ondřej Surý 2514f41ade 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.

(cherry picked from commit 4716c56ebb)
2022-02-17 21:02:02 +01:00
Ondřej Surý d7bcb0b5b7 Merge branch '3133-tcp-error-handling-v9_18' into 'v9_18'
correct TCP error handling in dispatch and resolver

See merge request isc-projects/bind9!5857
2022-02-17 15:50:26 +00:00
Evan HuntandOndřej Surý 4a448d09ee Add CHANGES note for [GL #3133]
(cherry picked from commit 1b25b76921)
2022-02-17 16:03:39 +01:00
Evan HuntandOndřej Surý 21ae6bb1b2 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.

(cherry picked from commit b6d40b3c4e)
2022-02-17 16:03:39 +01:00
Ondřej Surý 4d912e0dec Merge branch '3132-add-send-timeout-v9_18' into 'v9_18'
Add TCP, TCPDNS and TLSDNS write timer

See merge request isc-projects/bind9!5855
2022-02-17 09:07:25 +00:00
Ondřej Surý 6a0e82b379 Add CHANGES and release note for [GL #3132]
(cherry picked from commit 0c35bda762)
2022-02-17 09:47:43 +01:00
Ondřej Surý a0bc051782 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.

(cherry picked from commit ee359d6ffa)
2022-02-17 09:47:43 +01:00
Ondřej Surý da34d1d69c 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.

(cherry picked from commit a89d9e0fa6)
2022-02-17 09:47:43 +01:00
Ondřej Surý 531406c2b1 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).

(cherry picked from commit b735182ae0)
2022-02-17 09:47:43 +01:00
Ondřej Surý b5265eedfb 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.

(cherry picked from commit 408b362169)
2022-02-17 09:47:43 +01:00
Ondřej Surý e262aff29b 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.

(cherry picked from commit cd3b58622c)
2022-02-17 09:47:43 +01:00
Ondřej Surý a532533aab 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.

(cherry picked from commit 45a73c113f)
2022-02-17 09:47:43 +01:00
Ondřej Surý 091284936b Merge branch '3157-blackhole-request-v9_18' into 'v9_18'
negative match on the 'blackhole' ACL could be treated as positive

See merge request isc-projects/bind9!5854
2022-02-17 08:46:56 +00:00
Evan Hunt 839a17186e CHANGES and release note for [GL #3157]
(cherry picked from commit 04361b0ad5)
2022-02-16 22:20:25 -08:00
Evan Hunt da029f10ba 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.

(cherry picked from commit 4444b168db)
2022-02-16 22:20:25 -08:00
Michał Kępień 01529bf791 Merge branch '3139-log-the-result-of-each-resolver-priming-attempt-v9_18' into 'v9_18'
[v9_18] Log the result of each resolver priming attempt

See merge request isc-projects/bind9!5847
2022-02-16 12:54:03 +00:00
Michał Kępień 899e5a7e3f Add CHANGES entry for [GL #3139]
(cherry picked from commit 39df399d9f)
2022-02-16 13:28:00 +01:00
Michał Kępień a74e60a325 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.

(cherry picked from commit f286c845b0)
2022-02-16 13:28:00 +01:00
Ondřej Surý 5f77292475 Merge branch 'ondrej/add-UV_RUNTIME_CHECK-macro-v9_18' into 'v9_18'
Add UV_RUNTIME_CHECK() macro to print uv_strerror()

See merge request isc-projects/bind9!5845
2022-02-16 11:19:55 +00:00
Ondřej Surý c30735707c 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.

(cherry picked from commit 62bd5cb08c)
2022-02-16 11:46:00 +01:00
Ondřej Surý f641507022 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.

(cherry picked from commit 8715be1e4b)
2022-02-16 11:46:00 +01:00
Ondřej Surý b8be8048b5 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.

(cherry picked from commit 62e15bb06d)
2022-02-16 11:46:00 +01:00
Ondřej Surý 33b5f979ba Merge branch 'ondrej/remove-dns_timer-API-v9_18' into 'v9_18'
Remove unused dns_timer API

See merge request isc-projects/bind9!5844
2022-02-16 10:10:01 +00:00
Ondřej Surý aed1a0497d Remove unused dns_timer API
The dns_timer API was unused, and this commit just removes it.

(cherry picked from commit cdce681cf7)
2022-02-16 11:07:04 +01:00
Matthijs Mekking d360a273af Merge branch 'matthijs-document-dnssec-policy-keys-algorithm-match-v9_18' into 'v9_18'
Update documentation wrt key algorithms

See merge request isc-projects/bind9!5842
2022-02-16 10:00:36 +00:00
Matthijs Mekking 3060ffb7d0 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.

(cherry picked from commit 7365400610)
2022-02-16 10:22:40 +01:00
Michal Nowak 588c60208e Merge branch 'mnowak/make-cocci-parallel-v9_18' into 'v9_18'
[v9_18] Run spatch jobs in parallel

See merge request isc-projects/bind9!5832
2022-02-14 19:01:12 +00:00
Michal Nowak 35ce85fa0b 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.

(cherry picked from commit 48c44fe6d4)
2022-02-14 19:50:41 +01:00
Michal Nowak 2093ca16aa Merge branch 'mnowak/coverity-scan-2021.12-v9_18' into 'v9_18'
[v9_18] Update Coverity Scan CI job to 2021.12.1

See merge request isc-projects/bind9!5829
2022-02-14 17:45:09 +00:00
Michal Nowak d63da7431d Update Coverity Scan CI job to 2021.12.1
(cherry picked from commit f0edf07fbc)
2022-02-14 17:38:08 +01:00
Petr Špaček 1aecd7b093 Merge branch 'pspacek/rfc-nits-v9_18' into 'v9_18'
Update and deduplicate list of RFCs in documentation [v9_18]

See merge request isc-projects/bind9!5827
2022-02-14 11:15:37 +00:00
Artem BoldarievandPetr Špaček 02aa76a2ad Mention DoT/DoH related RFCs in the ARM
Mention RFC 7858 (DoT), 8484 (DoH), and 8945 (XoT).

(cherry picked from commit 8058d64dda)
2022-02-14 12:11:24 +01:00
Petr Špaček 9703df2058 Remove rfc-compliance list in plaintext - ARM deduplication
The plaintext version is now fully replaced by the doc/arm/general.rst.

(cherry picked from commit 63989e98ac)
2022-02-14 12:11:24 +01:00
Petr Špaček 5f10218e6f 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.

(cherry picked from commit 7fd61f9403)
2022-02-14 12:11:24 +01:00
Petr Špaček 0aacacbb38 Replace obsolete RFC2845 reference with RFC8945 (TSIG)
(cherry picked from commit 4dbad65bfd)
2022-02-14 12:11:23 +01:00
Petr Špaček 8582c49ea5 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
(cherry picked from commit 2774b497a6)
2022-02-14 12:11:23 +01:00
Petr Špaček 6191cf8abf Replace obsolete RFC6944 reference with RFC8624 (DNSSEC algorithm status)
(cherry picked from commit 3c83a9d503)
2022-02-14 12:11:23 +01:00
Petr Špaček 841ac7dd03 Replace obsolete RFC5966 reference with RFC7766 (TCP)
(cherry picked from commit bd3b310eae)
2022-02-14 12:11:23 +01:00
Petr Špaček d01ff38e58 Replace obsolete RFC4408 reference with RFC7208 (SPF)
(cherry picked from commit f8cb0ac141)
2022-02-14 12:11:23 +01:00
Petr Špaček d5c4c2d4b5 Replace obsolete RFC2915 reference with RFC3403 (NAPTR)
(cherry picked from commit 16dec1ff58)
2022-02-14 12:11:23 +01:00
Petr Špaček 69271cae55 Add link to RFC8749 (DLV is historic)
(cherry picked from commit f7225db822)
2022-02-14 12:11:23 +01:00
Petr Špaček 7c07656dc4 Add newer version of IDNA RFC to docs
(cherry picked from commit 09d6cf89df)
2022-02-14 12:11:23 +01:00
Petr Špaček 4141a7dfd7 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.

(cherry picked from commit 9437ea08e1)
2022-02-14 12:11:23 +01:00
Petr Špaček 7a7c90e72e Replace obsolete RFC6488 reference with RFC8659 (CAA)
(cherry picked from commit 2b5b777c07)
2022-02-14 12:11:23 +01:00
Petr Špaček 3cafc168b8 Remove obsolete book reference from ARM
(cherry picked from commit b686b5c161)
2022-02-14 12:11:23 +01:00
Petr Špaček 6d56ef50ba Use Sphinx footnotes for DNS Reference Information
It limits risk of errors while doing updates, which are next in the
pipeline.

(cherry picked from commit f713984886)
2022-02-14 12:11:18 +01:00
Ondřej Surý 953a31cdf4 Merge branch '3151-bump-minimal-automake-version-to-1.14-v9_18' into 'v9_18'
Bump the required automake version to 1.14

See merge request isc-projects/bind9!5826
2022-02-14 09:04:55 +00:00
Ondřej Surý a8718a782a 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.

(cherry picked from commit 4abd58aa8f)
2022-02-14 09:46:35 +01:00
Ondřej Surý bdefa08a8d Merge branch 'ondrej/change-bug-reporting-address-v9_18' into 'v9_18'
Change the bug reporting address from email to gitlab URI

See merge request isc-projects/bind9!5821
2022-02-11 08:19:53 +00:00
Ondřej Surý 8f5a1f3f22 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.

(cherry picked from commit bb60622250)
2022-02-11 08:53:26 +01:00
Ondřej Surý 38da361408 Merge branch '3137-create-new-log-messages-when-entering-and-exiting-exlusive-task-mode-v9_18' into 'v9_18'
Log when starting and ending task exclusive mode

See merge request isc-projects/bind9!5819
2022-02-10 20:42:29 +00:00
Ondřej Surý 5d48602479 Add CHANGES and release note for [GL #3137]
(cherry picked from commit 44aa8ef997)
2022-02-10 21:22:35 +01:00
Ondřej Surý 1591d78559 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.

(cherry picked from commit b9cb29076f)
2022-02-10 21:22:35 +01:00
Ondřej Surý 5d7a6c0bf8 Merge branch '2717-fix-sysconfdir-in-manpages-v9_18' into 'v9_18'
Use compile-time paths in the manual pages

See merge request isc-projects/bind9!5815
2022-02-10 16:33:28 +00:00
Ondřej Surý 74b1c37f2c Add CHANGES note for [GL #2717]
(cherry picked from commit 9e70c6887a)
2022-02-10 17:08:24 +01:00
Ondřej Surý 3f78c60539 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.

(cherry picked from commit b42681c4e9)
2022-02-10 17:08:24 +01:00
Ondřej Surý faf395ce98 Merge branch '3130-cleanup-pthread-api-usage-v9_18' into 'v9_18'
Remove unused functions from isc_thread API

See merge request isc-projects/bind9!5808
2022-02-09 17:02:22 +00:00
Ondřej Surý 67af3c7a3b 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.

(cherry picked from commit 0500345513)
2022-02-09 17:41:34 +01:00
Michal Nowak d69b3b3ec1 Merge branch '2599-run-less-stable-unit-tests-in-aws-v9_18' into 'v9_18'
[v9_18] Run unstable unit tests in CI

See merge request isc-projects/bind9!5806
2022-02-09 12:01:17 +00:00
Michal Nowak 4084dd1dd5 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.

(cherry picked from commit 1d8788464e)
2022-02-09 12:34:04 +01:00
Michal Nowak 7e8073dea2 Merge branch 'mnowak/fix-lsan-suppression-file-path-v9_18' into 'v9_18'
[v9_18] Fix path to suppr-lsan.txt file

See merge request isc-projects/bind9!5804
2022-02-07 14:04:36 +00:00
Michal Nowak cd20453576 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 c3f35147a3.

(cherry picked from commit 3de17e9185)
2022-02-07 13:40:56 +01:00
Matthijs Mekking 7f466b049e Merge branch 'matthijs-engine_pkcs11-system-test-v9_18' into 'v9_18'
Add system test for engine_pkcs11

See merge request isc-projects/bind9!5799
2022-02-04 14:43:49 +00:00
Matthijs Mekking 9f2b89fa77 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.

(cherry picked from commit 7845f51178)
2022-02-04 15:08:41 +01:00
Aram SargsyanandMatthijs Mekking 25cb2704b4 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.

(cherry picked from commit a449709441)
2022-02-04 15:08:33 +01:00
Matthijs Mekking b3e5e12ddf 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.

(cherry picked from commit 468cf3cdc2)
2022-02-04 15:08:27 +01:00
Matthijs Mekking a9f7e4badb 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.

(cherry picked from commit bfe287f4a4)
2022-02-04 15:08:21 +01:00
Matthijs Mekking 28093e56a9 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.

(cherry picked from commit 11a0b41370)
2022-02-04 15:08:15 +01:00
Evan Hunt 6089dc5ba5 Merge branch 'each-missing-relnotes-v9_18' into 'v9_18'
Release notes for [GL #3082] and [GL #3111]

See merge request isc-projects/bind9!5797
2022-02-02 20:04:28 +00:00
Evan Hunt 4c205fb69a Release notes for [GL #3082] and [GL #3111]
(cherry picked from commit d45f0e1d9e)
2022-02-02 12:02:06 -08:00
Petr Špaček 478a10e318 Merge branch '2974-improve-directory-documentation-v9_18' into 'v9_18'
Clarify effect of "directory" configuration option [v9_18]

See merge request isc-projects/bind9!5793
2022-02-02 11:33:46 +00:00
Ondřej SurýandPetr Špaček faafbfa98f 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.

(cherry picked from commit 00ba6967b1)
2022-02-02 12:29:30 +01:00
Ondřej Surý cc94730ab9 Merge branch '3125-log-hard-quota-when-not-accepting-the-connection-v9_18' into 'v9_18'
Add log message when hard quota is reached in TCP accept

See merge request isc-projects/bind9!5789
2022-02-01 20:42:11 +00:00
Ondřej Surý b7fb29397a Add CHANGES and release notes for [GL #3125]
(cherry picked from commit 932fc7b826703f8b0f30ed11c496f94a02e6ebbb)
2022-02-01 21:13:07 +01:00
Ondřej Surý 916b301fd4 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.

(cherry picked from commit 2ae84702ad)
2022-02-01 21:02:44 +01:00
Petr Špaček f1923ed6cd Merge branch '3120-recent-editions-9-17-22-onwards-of-arm-have-many-empty-grammar-descriptions-v9_18' into 'v9_18'
Fix empty grammar descriptions in the ARM [v9_18]

See merge request isc-projects/bind9!5785
2022-02-01 17:49:28 +00:00
Petr Špaček 724a051820 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
(cherry picked from commit 34a3b35b08)
2022-02-01 18:25:08 +01:00
Mark AndrewsandPetr Špaček 2262bb9538 Regenerate .rst files with grammars after changes to rst generators
$ make -C doc/misc all

(cherry picked from commit e97c35b3bc)
2022-02-01 18:25:08 +01:00
Mark AndrewsandPetr Špaček f51fe1e714 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
(cherry picked from commit d975e6630f)
2022-02-01 18:25:07 +01:00
Mark AndrewsandPetr Špaček 9eac4401b4 Add missing rst-grammars.pl dependecy to config grammar build
(cherry picked from commit f5c66f311a)
2022-02-01 18:25:03 +01:00
Mark Andrews 9e1aba9cbc Merge branch '3117-9-18-0-nslookup-debugging-output-v9_18' into 'v9_18'
Remove spurious 'debugging = true;'

See merge request isc-projects/bind9!5783
2022-01-31 23:40:29 +00:00
Mark Andrews 4a6078673b Check that no debugging / errors are reported normally
(cherry picked from commit 123b57db36)
2022-02-01 10:22:41 +11:00
Evan HuntandMark Andrews 84baff1d00 make nslookup test shellcheck safe
(cherry picked from commit 6de4dfcc8c)
2022-02-01 10:22:41 +11:00
Mark Andrews ccfa2562a5 Remove spurious 'debugging = true;'
This appears to be left over from the developement phase while
adding reference counting to the lookup structure.

(cherry picked from commit c068c3c771)
2022-02-01 10:22:41 +11:00
Evan Hunt f1977e5017 Merge branch 'each-dlz-pthreads-v9_18' into 'v9_18'
complete removal of !PTHREADS code from DLZ modules

See merge request isc-projects/bind9!5781
2022-01-31 18:41:20 +00:00
Evan Hunt 7923f86bdd 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.

(cherry picked from commit c3a715123b)
2022-01-31 10:37:45 -08:00
Evan Hunt 9b0ffbbe2d Merge branch 'each-fix-contrib-dlz-v9_18' into 'v9_18'
update dlz_minimal.h

See merge request isc-projects/bind9!5777
2022-01-28 00:25:32 +00:00
Evan Hunt 8bd431a251 update dlz_minimal.h
the addition of support for ECS client information in DLZ
modules omitted some necessary changes to build modules
in contrib.

(cherry picked from commit d3fed6f400)
2022-01-27 16:18:34 -08:00
Evan Hunt 9d5e023cc5 Merge branch 'each-dns-clientinfo-v9_18' into 'v9_18'
allow dns_clientinfo to store client ECS data

See merge request isc-projects/bind9!5773
2022-01-27 22:52:23 +00:00
Evan Hunt cee56e3a53 CHANGES for [GL #3082]
(cherry picked from commit e42f7d2722)
2022-01-27 14:51:11 -08:00
Evan Hunt 60f97b6432 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".

(cherry picked from commit 79ddedabf8)
2022-01-27 14:51:11 -08:00
Petr ŠpačekandEvan Hunt 34f6cce2c6 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.

(cherry picked from commit f81debe1c8)
2022-01-27 14:51:11 -08:00
Evan Hunt 317ef804c0 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.

(cherry picked from commit 737e658602)
2022-01-27 14:51:11 -08:00
Ondřej Surý f9926228e1 Merge branch '3108-cacheline-detection-propagate-v9_18' into 'v9_18'
Use detected cache line size

See merge request isc-projects/bind9!5771
2022-01-27 12:37:14 +00:00
Ondřej Surý 6c578f232e Add CHANGES note for [GL #3108]
(cherry picked from commit f386fab2e2)
2022-01-27 13:07:31 +01:00
Petr MenšíkandOndřej Surý b465b29eaf 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.

(cherry picked from commit f00f521e9c)
2022-01-27 13:07:31 +01:00
Ondřej Surý 5e25081edc Merge branch '3115-qname-wait-recurse-typo-v9_18' into 'v9_18'
Fix typo in qname-wait-recurse

See merge request isc-projects/bind9!5769
2022-01-27 11:58:08 +00:00
Ondřej Surý 6b681e7019 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.

(cherry picked from commit 1e711dcccb)
2022-01-27 12:55:40 +01:00
Matthijs Mekking dbf55d5ebd Merge branch 'matthijs-keyfromlabel-system-test-9_18' into 'v9_18'
keyfromlabel system test (9.18)

See merge request isc-projects/bind9!5767
2022-01-27 11:24:50 +00:00
Matthijs Mekking 79d14cacd3 Update pkcs11 documentation on openssl_conf
The user should make sure there are no other 'openssl_conf = ...' lines
in the file.

(cherry picked from commit a90f4c4ffa)
2022-01-27 12:23:22 +01:00
Matthijs Mekking 4895b10884 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.

(cherry picked from commit 0af8bbd49b)
2022-01-27 12:23:22 +01:00
Matthijs Mekking c3f35147a3 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.

(cherry picked from commit 8a4f098dee)
2022-01-27 12:23:22 +01:00
Matthijs Mekking 9926ea647f 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.

(cherry picked from commit eba66665a5)
2022-01-27 12:23:12 +01:00
Matthijs Mekking 1329e89927 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.

(cherry picked from commit 221e1bc2a3)
2022-01-27 12:21:58 +01:00
Matthijs Mekking a373b821ee Remove prepare-softhsm2.sh from runtime test
This script is obsoleted because SoftHSM2 is now installed in the
image.

(cherry picked from commit 0725fcad38)
2022-01-27 12:21:58 +01:00
Matthijs Mekking 90480c0d54 Add CHANGES for keyfromlabel test
(cherry picked from commit ad01bca9fd)
2022-01-27 12:21:58 +01:00
Michal Nowak 612341a1da Merge branch 'mnowak/drop-some-system-test-scrips-v9_18' into 'v9_18'
[v9_18] Remove leftover test code for Windows

See merge request isc-projects/bind9!5766
2022-01-27 10:49:21 +00:00
Evan HuntandMichal Nowak 018f8be52a 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.

(cherry picked from commit 1d706f328c)
2022-01-27 10:35:54 +01:00
Michał Kępień c2c7b36f5e Merge branch 'ondrej/use-utc-for-reproducible-builds-v9_18' into 'v9_18'
[v9_18] Use UTC datetime for reproducible builds

See merge request isc-projects/bind9!5765
2022-01-27 05:56:35 +00:00
Ondřej SurýandMichał Kępień 9bfbff4a3c 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.

(cherry picked from commit 8c4d5d5623)
2022-01-27 06:53:15 +01:00
Arаm Sаrgsyаn ab061cbc69 Merge branch '3087-tls-ephemeral-certificate-set-not-before-in-past-v9_18' into 'v9_18'
[v9_18] Set the ephemeral certificate's "not before" a short time in the past

See merge request isc-projects/bind9!5762
2022-01-26 18:29:16 +00:00
Aram Sargsyan 3d835107af 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.

(cherry picked from commit 81d3584116)
2022-01-26 17:28:37 +00:00
Michał Kępień e82c8c6105 Merge branch 'michal/misc-test-framework-fixes-v9_18' into 'v9_18'
[v9_18] Miscellaneous test framework fixes

See merge request isc-projects/bind9!5763
2022-01-26 14:40:46 +00:00
Michał Kępień 7d7199f18c 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.

(cherry picked from commit a938db2170)
2022-01-26 15:21:14 +01:00
Michał Kępień 17fbf25676 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.

(cherry picked from commit fb87022115)
2022-01-26 15:21:14 +01:00
Michał Kępień b1063d2de6 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.

(cherry picked from commit 65abbca79b)
2022-01-26 15:21:14 +01:00
Arаm Sаrgsyаn 1447ae57f5 Merge branch '3060-revert-view-on-failed-reconfig-v9_18' into 'v9_18'
[v9_18] Improve the view configuration error handling and reverting logic

See merge request isc-projects/bind9!5761
2022-01-26 12:47:14 +00:00
Aram Sargsyan b31c836e1b 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.

(cherry picked from commit 4a6c66288f)
2022-01-26 12:08:01 +00:00
Aram Sargsyan bb76e644c1 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.

(cherry picked from commit 5f9d4b5db4)
2022-01-26 12:07:53 +00:00
Aram Sargsyan 7f6dc9ba4d 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.

(cherry picked from commit 62337d433f)
2022-01-26 12:07:45 +00:00
Aram Sargsyan 5e98b3c202 Add CHANGES and release notes for [GL #3060]
(cherry picked from commit d7dfa2dc4b)
2022-01-26 12:07:29 +00:00
Aram Sargsyan 3aa0c56d4c 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.

(cherry picked from commit 2fd967136a)
2022-01-26 12:06:17 +00:00
Aram Sargsyan 2d570f7343 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.

(cherry picked from commit 6b937ed5f6)
2022-01-26 12:06:05 +00:00
Aram Sargsyan b7fd46f50a 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.

(cherry picked from commit 3697560f04)
2022-01-26 12:05:53 +00:00
Michał Kępień 8db45afa1a Update BIND version to 9.18.0 2022-01-24 21:04:14 +01:00
Michał Kępień cbf9916216 Add a CHANGES marker 2022-01-24 21:04:14 +01:00
Michał Kępień 006923ec16 Merge branch 'pspacek/prepare-documentation-for-bind-9.18.0' into 'v9_18_0-release'
Prepare documentation for BIND 9.18.0

See merge request isc-private/bind9!347
2022-01-24 20:02:55 +00:00
Petr ŠpačekandMichał Kępień 4b0ac74137 Create release notes for 9.18.0
We started with compilation of _all_ 9.17.z notes into one file:
$ ls *.17*.rst | sort -V | xargs cat > notes-9.18.0.rst

Then removed removed duplicate extra copyright headers:
$ grep -v '^\.\. [^_]' notes-9.18.0.rst  > notes-9.18.0.rst.copy
$ grep -v '^\.\.$' notes-9.18.0.rst.copy > notes-9.18.0.rst
$ vim notes-9.17.0.rst notes-9.18.0.rst

Next step was to find notes referencing the changes which were
backported to 9.16.25 and remove these. Duplicites were checked
by diffing corresponding texts in 9.16 and 9.17, and it revealed that
some backports were either partial, or code was backported but the
release note was lost in 9.16 branch. In that case we did not
re-introduce the relnote and considered it also duplicate.

Most notable cases of "missing in 9.16 relnote but in fact fixed"
were notes for CVE-2020-8616 and CVE-2020-8617.
These were accidentally omitted from 9.16 release docs, and we are going
to fix it in separate MR !5722.

Further removals include:
- Security issue #2787: The bug was introduced & fixed in 9.17.z,
  so there is no need to tell about it to people upgrading to 9.18.0.
- Bugfix !3135: Backported but with unclear reference in relnotes.
- Bugfix !3137: Backported but with unclear reference in relnotes.
- Bugfix #2460: Introduced & fixed in 9.17.z.
- Bugfix #2504: The bug was introduced & fixed in 9.17.z.
- Bugfix #2562: Introduced & fixed in 9.17.z.
- Bugfix #2917: Introduced & fixed in 9.17.z
- Bugfix #3040: Introduced & fixed in 9.17.z.
- Bugfix #3062: Introduced & fixed in 9.17.z.
- Change #4: Introduced & "finished" in 9.17.z.
- Change #1610: Introduced & reverted in 9.17.z.
- Change #1958: No user visible impact.
- Change #2016: No user visible impact.
- Change #2022: No user visible impact.
- Change #2264: Affects a feature introduced only to 9.17 branch.
- Change #2401: No user visible impact.
- Known issue about libuv: Got fixed later in the cycle.
- Known issue about port clash: It is now config error.

Then tweaking started to clarify meaning of various notes to people
upgrading from 9.16.

While doing so, bugfix #2927 was omited because the change just makes
9.18 SERVFAIL faster than 9.16, so even though it is technically bugfix
it is so minor that it is not worth bragging about in release notes.

TLS/DoT/DoH features were summarized from many independent
notes into one giant note per feature.

All notes were rearranged according to their "perceived priority".
2022-01-24 09:27:55 +01:00
Petr ŠpačekandMichał Kępień caa2be37b4 Update boilerplate text in Release Notes
It's taken from 9.16 branch, with dates updated and reference to CHANGES
file removed. Note on Version Numbering was was already removed in !3517.
2022-01-24 09:27:55 +01:00
Petr ŠpačekandMichał Kępień f8850e1188 Fix incorrect RFC footnote about A6 RR type in RFC4033
A6 type is not mentioned anywhere in RFC4033.
2022-01-24 09:27:55 +01:00
Petr ŠpačekandMichał Kępień 7eb0428d1f 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 09:27:55 +01:00
Petr ŠpačekandMichał Kępień 164272ae77 Reword RFC section in the ARM
Add couple links and caveant for uninitiated readers.
2022-01-24 09:27:55 +01:00
Petr ŠpačekandMichał Kępień 6908b46011 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 09:27:55 +01:00
Petr ŠpačekandMichał Kępień 0841a12742 Rework doc/arm/build.rst
- Revise the list of required libraries.
  - Apply miscellaneous tweaks to style, formatting, and ordering.
2022-01-24 09:27:55 +01:00
Petr ŠpačekandMichał Kępień e8a29b0b7f 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 09:27:55 +01:00
Petr ŠpačekandMichał Kępień 7ac8fb317d Replace Building BIND 9 section in README with reference to ARM 2022-01-24 09:27:55 +01:00
Petr ŠpačekandMichał Kępień a8a1fbf421 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 09:27:55 +01:00
Petr ŠpačekandMichał Kępień 2e7a13515f Link to ISC KB for most up-to-date platform support statuses 2022-01-24 09:27:55 +01:00
Petr ŠpačekandMichał Kępień 626affbbc2 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 09:27:55 +01:00
Petr ŠpačekandMichał Kępień d5b82c9877 Replace duplicate Supported Operating Systems in the ARM by PLATFORMS.rst 2022-01-24 09:27:55 +01:00
Petr ŠpačekandMichał Kępień 627ac5a88a 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 09:27:55 +01:00
Petr ŠpačekandMichał Kępień aebb209461 Update BIND version number in PLATFORMS.md to 9.18 2022-01-24 09:27:55 +01:00
Petr ŠpačekandMichał Kępień 7dc14372f2 Document that tls statement is subject to change 2022-01-24 09:27:55 +01:00
Petr ŠpačekandMichał Kępień 6d279ad49a Clarify XoT usage and warn about the unauthenticated mode 2022-01-24 09:27:55 +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čekandMichał Kępień 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čekandMichał Kępień 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čekandMichał Kępień 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 HuntandMichał Kępień 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 HuntandMichał Kępień 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 TheisenandOndřej Surý 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 HuntandOndřej Surý 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 PerssonandMark Andrews 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ýandEvan Hunt 5563d06d62 Add CHANGES and release note for [GL #3079] 2022-01-06 10:34:04 -08:00
Ondřej SurýandEvan Hunt 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ýandOndř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ńandOndřej Surý 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ńandOndřej Surý 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ýandOndř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ýandOndř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ýandOndř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ýandOndř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 HuntandOndřej Surý 81c09b005b Add CHANGES note for [GL #3074] 2022-01-05 13:15:40 +01:00
Evan HuntandOndřej Surý 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ýandOndřej Surý 4d71a3b309 Add CHANGES and release note for [GL #3071] 2022-01-05 10:29:15 +01:00
Michał KępieńandOndřej Surý 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 AndrewsandEvan Hunt 6de041f19c Add CHANGES for [GL #3065] 2022-01-03 11:49:27 -08:00
Mark AndrewsandEvan Hunt 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 AndrewsandEvan Hunt 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 MensikandMichał Kępień 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 MensikandMichał Kępień 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ýandOndř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ńandPetr Špaček 7d42bee183 Prepare release notes for BIND 9.17.21 2021-12-16 13:17:12 +01:00
Michał KępieńandPetr Špaček 513dfd4fcc Reorder release notes 2021-12-16 13:17:12 +01:00
Michał KępieńandPetr Špaček a8d5fd88e3 Mention GL #3040 in the release notes 2021-12-16 13:17:12 +01:00
Michał KępieńandPetr Špaček da1e73cd4d Add release note for GL #853 2021-12-16 13:17:12 +01:00
Michał KępieńandPetr Špaček 413e369137 Tweak and reword release notes 2021-12-16 13:17:12 +01:00
Michał KępieńandPetr Špaček 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 BoldarievandEvan Hunt 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 BoldarievandEvan Hunt 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ýandArаm Sаrgsyаn 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šíkandMatthijs Mekking 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ýandOndř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 HuntandMichał Kępień 3a52250286 CHANGES for [GL #3040] 2021-12-03 09:51:06 +01:00
Evan HuntandMichał Kępień 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 AndrewsandPetr Špaček 41d14210de Check reject-000-label 2021-12-02 14:27:18 +01:00
Mark AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 8878adcd61 Check SOA without DNSKEY behaviour 2021-12-02 14:27:18 +01:00
Mark AndrewsandPetr Špaček dfe31e61d2 Check 'server { broken-nsec yes; };' 2021-12-02 14:27:18 +01:00
Mark AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček d733eeba75 Add data lookups into nodata tests 2021-12-02 14:24:37 +01:00
Mark AndrewsandPetr Špaček b25ff302ac Check synthesis of wildcard NODATA with 2 NSEC 2021-12-02 14:24:37 +01:00
Mark AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 94935e7e34 Check synthesis of wildcard NODATA with 1 NSEC 2021-12-02 14:24:37 +01:00
Mark AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 12c64d55f2 Add CHANGES and release note for [GL #1265] 2021-12-02 14:24:31 +01:00
Mark AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 571f3af6e8 Check 'rndc stats' output for 'cache NSEC auxiliary database nodes' 2021-12-02 14:18:41 +01:00
Mark AndrewsandPetr Špaček 0e1048ff25 Check synth-from-dnssec JSON counters 2021-12-02 14:18:41 +01:00
Mark AndrewsandPetr Špaček 6dcea1531d Check synth-from-dnssec XML counters 2021-12-02 14:18:41 +01:00
Mark AndrewsandPetr Špaček 98cab76295 Check reported synthesized responses in named.stats 2021-12-02 14:18:41 +01:00
Mark AndrewsandPetr Špaček 48bf5f143b Correct spelling of synthesized 2021-12-02 14:18:41 +01:00
Mark AndrewsandPetr Špaček fe8bc79f2b Check 'rndc stats' output for 'covering nsec returned' 2021-12-02 14:18:41 +01:00
Mark AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 90dbdb2cb5 Restore 'synth-from-dnssec yes;' as the default 2021-12-02 14:18:41 +01:00
Mark AndrewsandPetr Špaček 62dd9ec9c1 Report Cache NSEC auxilary database size 2021-12-02 14:18:41 +01:00
Mark AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček e906fefb7d Extend synthfromdnssec to test with dnssec validation disabled 2021-12-02 14:18:41 +01:00
Mark AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 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 AndrewsandPetr Špaček 67d4c783fa Check synthesis of CNAME record from wildcard CNAME 2021-12-02 14:18:40 +01:00
Mark AndrewsandPetr Špaček 25915e81b4 Check synthesis of A record from wildcard A 2021-12-02 14:18:40 +01:00
Mark AndrewsandPetr Špaček b8563db96a Check whether soa responses are synthesised or not 2021-12-02 14:18:40 +01:00
Mark AndrewsandPetr Špaček 95ec47a460 Add and use check_status 2021-12-02 14:18:40 +01:00
Mark AndrewsandPetr Špaček d06e8366b4 Add and use check_ad_flag 2021-12-02 14:18:40 +01:00
Mark AndrewsandPetr Špaček 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ýandEvan Hunt 4e779b11f6 Add CHANGES and release notes for [GL #3026] 2021-12-01 11:48:15 -08:00
Ondřej SurýandEvan Hunt 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ýandEvan Hunt 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ýandEvan Hunt 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ýandEvan Hunt 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ýandEvan Hunt 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 FinchandMark Andrews 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 HuntandAram Sargsyan 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ńandMark Andrews 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ńandMark Andrews 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 HuntandOndřej Surý 465353d9ca CHANGES for [GL #3018] 2021-11-22 11:35:34 +01:00
Evan HuntandOndřej Surý 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 TheisenandMatthijs Mekking 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 HuntandArtem Boldariev 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čekandEvan Hunt 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 AndrewsandEvan Hunt 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 AndrewsandEvan Hunt 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 AndrewsandEvan Hunt 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 HuntandMark Andrews 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ýandMichał Kępień 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ýandMichał Kępień 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ýandMichał Kępień 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 AndrewsandAram Sargsyan df1d8c9e9b Add release note for [GL #2843] 2021-10-28 07:40:10 +00:00
Mark AndrewsandAram Sargsyan 58d4326766 Add CHANGES note for [GL #2843] 2021-10-28 07:40:08 +00:00
Mark AndrewsandAram Sargsyan 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 AndrewsandAram Sargsyan 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 AndrewsandAram Sargsyan 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 MekkingandMark Andrews 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ýandOndř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ýandOndř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ýandOndř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 MensikandMichał Kępień 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ýandEvan Hunt 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ýandEvan Hunt 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ýandEvan Hunt 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ýandOndř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ýandOndř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 AndrewsandEvan Hunt 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 HuntandOndřej Surý 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ýandEvan Hunt 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 MekkingandEvan Hunt 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 MekkingandEvan Hunt 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 MekkingandEvan Hunt 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 MekkingandEvan Hunt 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 MekkingandEvan Hunt 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 MekkingandOndřej Surý 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 AndrewsandOndřej Surý 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ýandEvan Hunt 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ýandEvan Hunt 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 HuntandOndřej Surý 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 HuntandOndřej Surý 9fd375217d Remove DNS_DISPATCHATTR_MAKEQUERY
This attribute was set but was no longer being used.
2021-10-02 10:21:46 +02:00
Evan HuntandOndřej Surý 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 HuntandOndřej Surý 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 HuntandOndřej Surý 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 HuntandOndřej Surý 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 HuntandOndřej Surý 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 HuntandOndřej Surý 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 AndrewsandOndřej Surý c04bce278f Add CHANGES note for [GL #2908] 2021-09-29 17:36:19 +02:00
Mark AndrewsandOndřej Surý 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ýandOndřej Surý d72d0149b0 Add CHANGES note for [GL !5440] 2021-09-23 22:17:15 +02:00
Ondřej SurýandOndř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ýandOndř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ýandEvan Hunt 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ýandOndřej Surý c518036988 Add CHANGES and releases notes for [GL #2882] 2021-09-17 05:58:02 +02:00
Ondřej SurýandOndř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ýandOndř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 HuntandOndřej Surý 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ýandOndřej Surý 23624a7adb Add CHANGES and release note for [GL #2852] 2021-09-14 14:51:31 +02:00
Ondřej SurýandOndř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ýandOndř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ýandMichał Kępień 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 BoldarievandMichał Kępień 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 HuntandPetr Špaček 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 HuntandOndřej Surý 18ab2cc578 Add CHANGES note for [GL !2420] 2021-08-30 09:17:45 +02:00
Evan HuntandOndřej Surý 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čekandEvan Hunt 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 FronzaandEvan Hunt 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 FronzaandEvan Hunt 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 FronzaandEvan Hunt 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 FronzaandEvan Hunt 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 FronzaandEvan Hunt 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 FronzaandEvan Hunt 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 FronzaandEvan Hunt 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 FinchandEvan Hunt 9557d6f70f Add CHANGES and release note for [GL !2946] 2021-08-18 22:42:00 -07:00
Tony FinchandEvan Hunt 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 NowakandMichał Kępień 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 HuntandMichał Kępień 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ýandMichał Kępień 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 HuntandMichał Kępień 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 NowakandMichał Kępień 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šíkandEvan Hunt 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šíkandEvan Hunt abfbb575a5 CHANGES [GL #2785] 2021-08-12 09:53:35 -07:00
Petr MenšíkandEvan Hunt 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šíkandEvan Hunt 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ńandMichal Nowak 4b18384e60 Drop Windows zips from release tarballs 2021-07-23 09:19:37 +02:00
Michał KępieńandMichal Nowak 7aa7b0b419 Update BIND version to 9.17.16 2021-07-23 09:19:37 +02:00
Michał KępieńandMichal Nowak c5fc7c22f0 Add a CHANGES marker 2021-07-23 09:19:36 +02:00
Michał KępieńandMichal Nowak 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ńandMichal Nowak 3cc71752d9 Prepare release notes for BIND 9.17.16 2021-07-23 09:19:36 +02:00
Michał KępieńandMichal Nowak 565ed6f76a Add release note for GL #2758 2021-07-23 09:19:36 +02:00
Michał KępieńandMichal Nowak db2e1de052 Add release note for GL #2686 2021-07-23 09:19:36 +02:00
Michał KępieńandMichal Nowak 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ńandMichal Nowak 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 MekkingandEvan Hunt 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 MekkingandEvan Hunt 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ýandOndřej Surý 41afe6bc5e Add CHANGES and release notes for [GL #2822] 2021-07-13 15:44:08 +02:00
Ondřej SurýandOndř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ýandOndř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 SuryandOndřej Surý 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 HuntandOndřej Surý 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 BoldarievandOndřej Surý 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 BoldarievandOndřej Surý 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 HuntandOndřej Surý 68a28cbc0a update the "memory" section of the developer doc
Information about memory allocation was outdated.
2021-07-09 15:58:02 +02:00
Evan HuntandOndřej Surý 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 HuntandOndřej Surý 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 HuntandOndřej Surý 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ýandOndř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ýandOndř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ýandOndř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ýandOndř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ýandOndř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 MekkingandOndřej Surý 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 MekkingandOndřej Surý 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 HuntandOndřej Surý 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čekandMichał Kępień 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ýandArtem Boldariev 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ýandArtem Boldariev 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ýandOndř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 FronzaandOndřej Surý 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 HuntandArtem Boldariev 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 AndrewsandMichał Kępień 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 AndrewsandMichał Kępień 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 AndrewsandMichał Kępień 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
4282 changed files with 115757 additions and 147694 deletions
+2
View File
@@ -58,6 +58,8 @@ IncludeCategories:
Priority: 55
- Regex: '^".*"'
Priority: 99
- Regex: '^<tests/'
Priority: 100
- Regex: '<openssl/'
Priority: 1
- Regex: '<(mysql|protobuf-c)/'
+2
View File
@@ -48,6 +48,8 @@ IncludeCategories:
Priority: 7
- Regex: '^(<[^/]*)/)'
Priority: 8
- Regex: '^<tests/'
Priority: 10
- Regex: '<[[:alnum:].]+>'
Priority: 1
- Regex: '".*"'
+10 -6
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
@@ -53,6 +49,10 @@
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/bind9/include"))
;; libtest
(expand-file-name
(concat directory-of-current-dir-locals-file "tests/include"))
;; bin
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/check"))
@@ -77,6 +77,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 +110,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")))
)
+55
View File
@@ -0,0 +1,55 @@
name: "CodeQL"
on:
push:
branches: [ "v9_16", "v9_18", "main" ]
schedule:
- cron: '39 8 * * 3'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install build dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libuv1-dev libssl-dev libnghttp2-dev libxml2-dev liblmdb-dev libjson-c-dev pkg-config autoconf automake autotools-dev libtool-bin libjemalloc-dev libedit-dev libcap-dev libidn2-dev libkrb5-dev libmaxminddb-dev zlib1g-dev python3-ply
version: 1.0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
+2 -2
View File
@@ -54,6 +54,7 @@ __pycache__/
/test-driver
Makefile
Makefile.in
Makefile.user
ans.run
gen.dSYM/
named.memstats
@@ -62,8 +63,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
@@ -90,6 +89,7 @@ doc/man/pkcs11-list.8in
doc/man/pkcs11-tokens.8in
# clangd index directory
/\.cache/
/\.*_clangd/
# GNU Global index files
/GPATH
/GRTAGS
+628 -582
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -31,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
+6 -2
View File
@@ -36,6 +36,7 @@
- [ ] ***(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)*** Announce (on Mattermost) that the code freeze is in effect.
### Before the Tagging Deadline
@@ -56,6 +57,7 @@
### Before the ASN Deadline (for ASN Releases) or the Public Release Date (for Regular Releases)
- [ ] ***(QA)*** Verify GitLab CI results for the tags created and prepare a QA report for the releases to be published.
- [ ] ***(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.
@@ -74,7 +76,9 @@
- [ ] ***(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.
@@ -87,7 +91,7 @@
- [ ] ***(QA)*** Prepare empty release notes for the next set of releases.
- [ ] ***(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`.
- [ ] ***(QA)*** Update QA tools used in GitLab CI (e.g. Black, 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.
-34
View File
@@ -1,34 +0,0 @@
extraction:
cpp:
prepare:
packages:
- "libxml2-dev"
- "libjson-c-dev"
- "libssl-dev"
- "zlib1g-dev"
- "libcmocka-dev"
- "pkg-config"
- "libcap2-dev"
- "libedit-dev"
- "libidn2-dev"
- "libmaxminddb-dev"
- "libuv1-dev"
configure:
command:
- "autoreconf -fi"
- "CFLAGS=\"-Og -g\" ./configure --enable-developer"
path_classifiers:
test:
- "lib/*/tests/"
- "bin/tests/"
docs:
- "**/*.xml"
- "**/*.docbook"
- "**/*.html"
- "**/*.1"
- "**/*.5"
- "**/*.8"
queries:
- exclude: fuzz/
- exclude: "bin/tests/system/*/ans*/*.py"
- exclude: cpp/use-of-goto
+3 -2
View File
@@ -1,8 +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
C0415,# import-outside-toplevel
+186
View File
@@ -0,0 +1,186 @@
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/*.dia
doc/arm/*.png
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/rndc.grammar
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
+16
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 %}
+1463 -30
View File
File diff suppressed because it is too large Load Diff
+13
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
+10 -8
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*
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (C) 1996-2021 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 1996-2023 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
-632
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.
+1 -1
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
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.
+26
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.
+9
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
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
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
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.
+117
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
+232
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
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.
+15
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.
@@ -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
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
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.
+5 -1
View File
@@ -2,6 +2,10 @@ include $(top_srcdir)/Makefile.top
SUBDIRS = . lib doc bin fuzz
if HAVE_CMOCKA
SUBDIRS += tests
endif HAVE_CMOCKA
BUILT_SOURCES = bind.keys.h
CLEANFILES = bind.keys.h
@@ -12,7 +16,7 @@ dist_sysconf_DATA = bind.keys
.PHONY: doc
EXTRA_DIST = \
EXTRA_DIST = \
util/bindkeys.pl \
contrib \
CHANGES \
+36 -25
View File
@@ -2,6 +2,7 @@ SPHINX_V = $(SPHINX_V_@AM_V@)
SPHINX_V_ = $(SPHINX_V_@AM_DEFAULT_V@)
SPHINX_V_0 = -q
SPHINX_V_1 = -n
SPHINX_W = -W
AM_V_SPHINX = $(AM_V_SPHINX_@AM_V@)
AM_V_SPHINX_ = $(AM_V_SPHINX_@AM_DEFAULT_V@)
@@ -9,26 +10,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 \
$(SPHINX_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@)
@@ -38,15 +61,3 @@ AM_V_SED_0 = @echo " SED $@";
AM_V_CFG_TEST = $(AM_V_CFG_TEST_@AM_V@)
AM_V_CFG_TEST_ = $(AM_V_CFG_TEST_@AM_DEFAULT_V@)
AM_V_CFG_TEST_0 = @echo " CFG_GEN $@";
AM_V_RST_OPTIONS = $(AM_V_CFG_TEST_@AM_V@)
AM_V_RST_OPTIONS_ = $(AM_V_RST_OPTIONS_@AM_DEFAULT_V@)
AM_V_RST_OPTIONS_0 = @echo " RST_OPTIONS $@";
AM_V_RST_ZONEOPT = $(AM_V_CFG_TEST_@AM_V@)
AM_V_RST_ZONEOPT_ = $(AM_V_RST_ZONEOPT_@AM_DEFAULT_V@)
AM_V_RST_ZONEOPT_0 = @echo " RST_ZONEOPT $@";
AM_V_RST_GRAMMARS = $(AM_V_CFG_TEST_@AM_V@)
AM_V_RST_GRAMMARS_ = $(AM_V_RST_GRAMMARS_@AM_DEFAULT_V@)
AM_V_RST_GRAMMARS_0 = @echo " RST_GRAMMARS $@";
+15 -3
View File
@@ -1,11 +1,23 @@
# Hey Emacs, this is -*- makefile-automake -*- file!
# vim: filetype=automake
unit-local: check
if HAVE_CMOCKA
TESTS = $(check_PROGRAMS)
endif HAVE_CMOCKA
LOG_COMPILER = $(top_builddir)/tests/unit-test-driver.sh
AM_CFLAGS += \
-I$(top_srcdir)/tests/include \
$(TEST_CFLAGS)
AM_CPPFLAGS += \
$(CMOCKA_CFLAGS) \
-DNAMED_PLUGINDIR=\"$(libdir)/named\" \
-DSKIPPED_TEST_EXIT_CODE=77 \
-DNAMED_PLUGINDIR=\"$(pkglibdir)\" \
-DTESTS_DIR=\"$(abs_srcdir)\"
LDADD = \
LDADD += \
$(top_builddir)/tests/libtest/libtest.la \
$(CMOCKA_LIBS)
+3 -3
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
+11 -8
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
@@ -24,3 +26,4 @@ Some of these settings are:
| `-DISC_MEM_TRACKLINES=0` | Don't track memory allocations by file and line number; this improves performance but makes debugging more difficult |
| `-DNAMED_RUN_PID_DIR=0` | Create default PID files in `${localstatedir}/run` rather than `${localstatedir}/run/named/` |
| `-DNS_CLIENT_DROPPORT=0` | Disable dropping queries from particular well-known ports |
| `-DOPENSSL_API_COMPAT=10100` | Build using the deprecated OpenSSL APIs so that the `engine` API is available when building with OpenSSL 3.0.0 for PKCS#11 support |
-105
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 18.04, 20.04
* Fedora 34
* Red Hat Enterprise Linux / CentOS 7, 8
* FreeBSD 11.4, 12.2, 13.0
* OpenBSD 6.9
* 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 20.10+
* 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, 16.04 (Ubuntu ESM releases are not supported)
* 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
+16 -154
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.inc.rst) section in the BIND 9
Administrator Reference Manual.
### <a name="testing"/> Automated testing
-4
View File
@@ -1,5 +1 @@
SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen tests plugins
if HAVE_PKCS11
SUBDIRS += pkcs11
endif
+2 -2
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) \
+10 -129
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>
@@ -207,7 +205,8 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
*/
cur = ai;
while (cur != NULL && cur->ai_canonname == NULL &&
cur->ai_next != NULL) {
cur->ai_next != NULL)
{
cur = cur->ai_next;
}
if (cur != NULL && cur->ai_canonname != NULL &&
@@ -409,7 +408,8 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
*/
cur = ai;
while (cur != NULL && cur->ai_canonname == NULL &&
cur->ai_next != NULL) {
cur->ai_next != NULL)
{
cur = cur->ai_next;
}
if (cur != NULL && cur->ai_canonname != NULL &&
@@ -495,7 +495,8 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
*/
cur = ai;
while (cur != NULL && cur->ai_canonname == NULL &&
cur->ai_next != NULL) {
cur->ai_next != NULL)
{
cur = cur->ai_next;
}
if (cur != NULL && cur->ai_canonname != NULL &&
@@ -575,96 +576,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,
@@ -687,7 +598,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
CHECK(dns_zone_create(&zone, mctx));
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 +639,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 +691,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 */
+3 -11
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 */
+24 -37
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
@@ -276,7 +277,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 +306,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 +325,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 +355,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 +374,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,13 +397,23 @@ 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;
}
obj = NULL;
if (get_maps(maps, "check-wildcard", &obj)) {
if (cfg_obj_asboolean(obj)) {
zone_options |= DNS_ZONEOPT_CHECKWILDCARD;
} else {
zone_options &= ~DNS_ZONEOPT_CHECKWILDCARD;
}
} else {
zone_options |= DNS_ZONEOPT_CHECKWILDCARD;
}
obj = NULL;
if (get_checknames(maps, &obj)) {
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
@@ -419,8 +426,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 +441,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 +456,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 +614,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 +681,7 @@ main(int argc, char **argv) {
fprintf(stderr, "%s: invalid argument -%c\n",
program, isc_commandline_option);
}
/* FALLTHROUGH */
FALLTHROUGH;
case 'h':
usage();
@@ -714,14 +711,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 +749,5 @@ main(int argc, char **argv) {
isc_mem_destroy(&mctx);
#ifdef _WIN32
DestroySockets();
#endif /* ifdef _WIN32 */
return (exit_status);
}
+52 -49
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.
+12 -23
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);
@@ -474,12 +472,11 @@ main(int argc, char **argv) {
outputformat = dns_masterformat_raw;
rawversion = strtol(outputformatstr + 4, &end, 10);
if (end == outputformatstr + 4 || *end != '\0' ||
rawversion > 1U) {
rawversion > 1U)
{
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);
@@ -515,22 +512,17 @@ main(int argc, char **argv) {
}
if (argc - isc_commandline_index < 1 ||
argc - isc_commandline_index > 2) {
argc - isc_commandline_index > 2)
{
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 +564,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);
}
+102 -93
View File
@@ -1,80 +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
named-checkzone, named-compilezone - zone file validity checking or converting tool
-----------------------------------------------------------------------------------
.. BEWARE: Do not forget to edit also named-compilezone.rst!
.. iscman:: named-checkzone
.. program:: named-checkzone
.. _man_named-checkzone:
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``.
@@ -100,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
.. 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
``named``.
: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.
+224
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.
@@ -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>
-144
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>
-3
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>
@@ -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>
-124
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>
-3
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>
@@ -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>
-152
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>
-3
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>
+4 -4
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
+96
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.
+3 -4
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 */
+3 -26
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>
@@ -34,29 +34,6 @@
#include "util.h"
/*%
* Convert algorithm type to string.
*/
const char *
alg_totext(dns_secalg_t alg) {
switch (alg) {
case DST_ALG_HMACMD5:
return ("hmac-md5");
case DST_ALG_HMACSHA1:
return ("hmac-sha1");
case DST_ALG_HMACSHA224:
return ("hmac-sha224");
case DST_ALG_HMACSHA256:
return ("hmac-sha256");
case DST_ALG_HMACSHA384:
return ("hmac-sha384");
case DST_ALG_HMACSHA512:
return ("hmac-sha512");
default:
return ("(unknown)");
}
}
/*%
* Convert string to algorithm type.
*/
@@ -175,7 +152,7 @@ void
write_key_file(const char *keyfile, const char *user, const char *keyname,
isc_buffer_t *secret, dns_secalg_t alg) {
isc_result_t result;
const char *algname = alg_totext(alg);
const char *algname = dst_hmac_algorithm_totext(alg);
FILE *fd = NULL;
DO("create keyfile", isc_file_safecreate(keyfile, &fd));
+3 -4
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 */
@@ -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/.
+4 -4
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
@@ -222,7 +222,7 @@ main(int argc, char **argv) {
if (keysize < 0) {
keysize = alg_bits(alg);
}
algname = alg_totext(alg);
algname = dst_hmac_algorithm_totext(alg);
isc_mem_create(&mctx);
isc_buffer_init(&key_txtbuffer, &key_txtsecret, sizeof(key_txtsecret));
+61 -59
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.
+7 -15
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,14 +121,14 @@ main(int argc, char **argv) {
} else if (PROGCMP("ddns-confgen")) {
progmode = progmode_confgen;
} else {
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv, "a:hk:Mmr:qs:y:z:")) !=
-1) {
-1)
{
switch (ch) {
case 'a':
algname = isc_commandline_argument;
@@ -217,7 +209,7 @@ main(int argc, char **argv) {
}
/* Use canonical algorithm name */
algname = alg_totext(alg);
algname = dst_hmac_algorithm_totext(alg);
isc_mem_create(&mctx);
+28 -75
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.
+2
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/.
+4 -6
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 */
@@ -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>
-128
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>
@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
@@ -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>
-132
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>
@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
@@ -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>
-143
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>
@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
+42 -55
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,19 +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>
#include <isc/netmgr.h>
#ifdef WIN32
#include <isc/ntpaths.h>
#endif /* ifdef WIN32 */
#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>
@@ -55,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>
@@ -64,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>
@@ -217,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
@@ -467,7 +458,8 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
result = dns_rdataset_next(rdataset))
{
if ((rdataset->attributes &
DNS_RDATASETATTR_NEGATIVE) != 0) {
DNS_RDATASETATTR_NEGATIVE) != 0)
{
continue;
}
@@ -491,7 +483,8 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
} else {
dns_indent_t indent = { " ", 2 };
if (!yaml && (rdataset->attributes &
DNS_RDATASETATTR_NEGATIVE) != 0) {
DNS_RDATASETATTR_NEGATIVE) != 0)
{
isc_buffer_putstr(&target, "; ");
}
result = dns_master_rdatasettotext(
@@ -793,7 +786,8 @@ load_keys(const cfg_obj_t *keys, dns_client_t *client) {
keylist = cfg_listelt_value(elt);
for (elt2 = cfg_list_first(keylist); elt2 != NULL;
elt2 = cfg_list_next(elt2)) {
elt2 = cfg_list_next(elt2))
{
key = cfg_listelt_value(elt2);
CHECK(key_fromconfig(key, client));
}
@@ -821,14 +815,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) {
@@ -861,6 +848,7 @@ setup_dnsseckeys(dns_client_t *client) {
isc_buffer_init(&b, anchortext, sizeof(anchortext) - 1);
isc_buffer_add(&b, sizeof(anchortext) - 1);
cfg_parser_reset(parser);
result = cfg_parse_buffer(parser, &b, NULL, 0,
&cfg_type_bindkeys, 0, &bindkeys);
if (result != ISC_R_SUCCESS) {
@@ -958,7 +946,8 @@ addserver(dns_client_t *client) {
result = ISC_R_SUCCESS;
for (cur = res; cur != NULL; cur = cur->ai_next) {
if (cur->ai_family != AF_INET &&
cur->ai_family != AF_INET6) {
cur->ai_family != AF_INET6)
{
continue;
}
sa = isc_mem_get(mctx, sizeof(*sa));
@@ -1341,7 +1330,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;
@@ -1352,10 +1340,8 @@ dash_option(char *option, char *next, bool *open_type_class) {
case 'v':
fprintf(stderr, "delv %s\n", PACKAGE_VERSION);
exit(0);
/* NOTREACHED */
default:
INSIST(0);
ISC_UNREACHABLE();
UNREACHABLE();
}
if (strlen(option) > 1U) {
option = &option[1];
@@ -1461,7 +1447,8 @@ dash_option(char *option, char *next, bool *open_type_class) {
warn("extra query type");
}
if (rdtype == dns_rdatatype_ixfr ||
rdtype == dns_rdatatype_axfr) {
rdtype == dns_rdatatype_axfr)
{
fatal("Transfer not supported");
}
qtype = rdtype;
@@ -1493,7 +1480,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
fprintf(stderr, "Invalid option: -%s\n", option);
usage();
}
/* NOTREACHED */
UNREACHABLE();
return (false);
}
@@ -1540,7 +1527,8 @@ preparse_args(int argc, char **argv) {
/* Look for dash value option. */
if (strpbrk(option, dash_opts) != &option[0] ||
strlen(option) > 1U) {
strlen(option) > 1U)
{
/* Error or value in option. */
continue;
}
@@ -1578,13 +1566,15 @@ parse_args(int argc, char **argv) {
} else if (argv[0][0] == '-') {
if (argc <= 1) {
if (dash_option(&argv[0][1], NULL,
&open_type_class)) {
&open_type_class))
{
argc--;
argv++;
}
} else {
if (dash_option(&argv[0][1], argv[1],
&open_type_class)) {
&open_type_class))
{
argc--;
argv++;
}
@@ -1603,7 +1593,8 @@ parse_args(int argc, char **argv) {
warn("extra query type");
}
if (rdtype == dns_rdatatype_ixfr ||
rdtype == dns_rdatatype_axfr) {
rdtype == dns_rdatatype_axfr)
{
fatal("Transfer not supported");
}
qtype = rdtype;
@@ -1740,12 +1731,9 @@ main(int argc, char *argv[]) {
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);
@@ -1753,17 +1741,16 @@ 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);
result = dst_lib_init(mctx, NULL);
if (result != ISC_R_SUCCESS) {
fatal("dst_lib_init failed: %d", result);
}
CHECK(isc_appctx_create(mctx, &actx));
isc_managers_create(mctx, 1, 0, 0, &netmgr, &taskmgr, &timermgr,
&socketmgr);
isc_managers_create(mctx, 1, 0, &netmgr, &taskmgr, &timermgr);
parse_args(argc, argv);
@@ -1773,17 +1760,15 @@ main(int argc, char *argv[]) {
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_create(mctx, actx, taskmgr, socketmgr, timermgr, 0,
result = dns_client_create(mctx, actx, taskmgr, netmgr, timermgr, 0,
&client, srcaddr4, srcaddr6);
if (result != ISC_R_SUCCESS) {
delv_log(ISC_LOG_ERROR, "dns_client_create: %s",
@@ -1864,9 +1849,11 @@ cleanup:
dns_master_styledestroy(&style, mctx);
}
if (client != NULL) {
dns_client_destroy(&client);
dns_client_detach(&client);
}
isc_managers_destroy(&netmgr, &taskmgr, &timermgr, &socketmgr);
isc_managers_destroy(&netmgr, &taskmgr, &timermgr);
if (actx != NULL) {
isc_appctx_destroy(&actx);
}
@@ -1875,7 +1862,7 @@ cleanup:
}
isc_mem_detach(&mctx);
dns_lib_shutdown();
dst_lib_destroy();
return (0);
}
+136 -108
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``
.. option:: -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.
"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`.
-22
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>
-133
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>
-3
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>
+3 -3
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
+250 -103
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
@@ -211,9 +212,6 @@ help(void) {
"from ipv4only.arpa)\n"
" +[no]dnssec (Request DNSSEC records)\n"
" +domain=### (Set default domainname)\n"
" +[no]dscp[=###] (Set the DSCP value to "
"### "
"[0..63])\n"
" +[no]edns[=###] (Set EDNS version) [0]\n"
" +ednsflags=### (Set EDNS flag bits)\n"
" +[no]ednsnegotiation (Set EDNS version "
@@ -228,10 +226,15 @@ help(void) {
"SERVFAIL)\n"
" +[no]header-only (Send query without a "
"question section)\n"
" +[no]https[=###] (DNS over HTTPS mode) "
" +[no]https[=###] (DNS-over-HTTPS mode) "
"[/]\n"
" +[no]https-get (Use GET instead of "
"default POST method\n"
"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
@@ -247,8 +250,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"
@@ -261,6 +262,8 @@ help(void) {
"request)\n"
" +padding=### (Set padding block size "
"[0])\n"
" +qid=### (Specify the query ID to "
"use when sending queries)\n"
" +[no]qr (Print question before "
"sending)\n"
" +[no]question (Control display of "
@@ -282,6 +285,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 "
@@ -294,7 +298,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"
@@ -329,11 +341,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));
@@ -350,13 +358,15 @@ 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";
proto = query->lookup->https_get ? "HTTP-GET"
: "HTTP";
} else {
proto = "HTTPS";
proto = query->lookup->https_get ? "HTTPS-GET"
: "HTTPS";
}
} else if (query->lookup->tcp_mode) {
proto = "TCP";
@@ -368,23 +378,11 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
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",
@@ -512,10 +510,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) {
@@ -585,7 +585,7 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags, isc_buffer_t *buf,
static bool
isdotlocal(dns_message_t *msg) {
isc_result_t result;
static unsigned char local_ndata[] = { "\005local\0" };
static unsigned char local_ndata[] = { "\005local" };
static unsigned char local_offsets[] = { 0, 6 };
static dns_name_t local = DNS_NAME_INITABSOLUTE(local_ndata,
local_offsets);
@@ -698,7 +698,8 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
flags |= DNS_MESSAGETEXTFLAG_NOCOMMENTS;
}
if (query->lookup->onesoa &&
query->lookup->rdtype == dns_rdatatype_axfr) {
query->lookup->rdtype == dns_rdatatype_axfr)
{
flags |= (query->msg_count == 0) ? DNS_MESSAGETEXTFLAG_ONESOA
: DNS_MESSAGETEXTFLAG_OMITSOA;
}
@@ -787,7 +788,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
strlcat(sockstr, "0", sizeof(sockstr));
}
printf(" response_address: %s\n", sockstr);
printf(" response_address: \"%s\"\n", sockstr);
printf(" response_port: %u\n", sport);
}
@@ -804,7 +805,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
strlcat(sockstr, "0", sizeof(sockstr));
}
printf(" query_address: %s\n", sockstr);
printf(" query_address: \"%s\"\n", sockstr);
printf(" query_port: %u\n", sport);
}
@@ -925,8 +926,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);
@@ -1034,6 +1036,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
@@ -1063,31 +1187,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)
#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)
switch (cmd[0]) {
case 'a':
switch (cmd[1]) {
@@ -1298,20 +1397,10 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
strlcpy(domainopt, value, sizeof(domainopt));
break;
case 's': /* dscp */
/* obsolete */
FULLCHECK("dscp");
if (!state) {
lookup->dscp = -1;
break;
}
if (value == NULL) {
goto need_value;
}
result = parse_uint(&num, value, 0x3f, "DSCP");
if (result != ISC_R_SUCCESS) {
warn("Couldn't parse DSCP value");
goto exit_or_usage;
}
lookup->dscp = num;
fprintf(stderr, ";; +dscp option is obsolete "
"and has no effect");
break;
default:
goto invalid_option;
@@ -1429,8 +1518,31 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
}
break;
case 'f': /* fail */
FULLCHECK("fail");
lookup->servfail_stops = state;
switch (cmd[1]) {
case 'a':
FULLCHECK("fail");
lookup->servfail_stops = state;
break;
case 'u':
FULLCHECK("fuzztime");
lookup->fuzzing = state;
if (lookup->fuzzing) {
if (value == NULL) {
lookup->fuzztime = 0x622acce1;
break;
}
result = parse_uint(&num, value, 0xffffffff,
"fuzztime");
if (result != ISC_R_SUCCESS) {
warn("Couldn't parse fuzztime");
goto exit_or_usage;
}
lookup->fuzztime = num;
}
break;
default:
goto invalid_option;
}
break;
case 'h':
switch (cmd[1]) {
@@ -1442,6 +1554,7 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
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;
@@ -1458,12 +1571,12 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
FULLCHECK("http-plain");
break;
case '-':
switch (cmd[6]) {
switch (cmd[11]) {
case 'p':
FULLCHECK("https-plain-post");
FULLCHECK("http-plain-post");
break;
case 'g':
FULLCHECK("https-plain-get");
FULLCHECK("http-plain-get");
lookup->https_get = true;
break;
}
@@ -1496,11 +1609,22 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
}
if (value == NULL) {
lookup->https_path = isc_mem_strdup(
mctx, DEFAULT_HTTPS_PATH);
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;
@@ -1586,7 +1710,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");
@@ -1665,7 +1789,8 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
}
for (num = 0;
num < sizeof(opcodetext) / sizeof(opcodetext[0]);
num++) {
num++)
{
if (strcasecmp(opcodetext[num], value) == 0) {
break;
}
@@ -1807,10 +1932,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:
@@ -1928,10 +2063,16 @@ 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':
@@ -2106,7 +2247,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;
@@ -2116,7 +2257,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;
@@ -2267,7 +2408,8 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
result = dns_rdatatype_fromtext(
&rdtype, (isc_textregion_t *)&tr);
if (result == ISC_R_SUCCESS &&
rdtype == dns_rdatatype_ixfr) {
rdtype == dns_rdatatype_ixfr)
{
result = DNS_R_UNKNOWN;
}
}
@@ -2340,7 +2482,8 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
}
*need_clone = true;
if (get_reverse(textname, sizeof(textname), value, false) ==
ISC_R_SUCCESS) {
ISC_R_SUCCESS)
{
strlcpy((*lookup)->textname, textname,
sizeof((*lookup)->textname));
debug("looking up %s", (*lookup)->textname);
@@ -2368,7 +2511,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
fprintf(stderr, "Invalid option: -%s\n", option);
usage();
}
/* NOTREACHED */
UNREACHABLE();
return (false);
}
@@ -2522,7 +2665,8 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
}
if (batchfp != NULL) {
while (fgets(batchline, sizeof(batchline), batchfp) !=
0) {
0)
{
debug("config line %s", batchline);
bargc = split_batchline(batchline, bargv, 62,
".digrc argv");
@@ -2614,7 +2758,8 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
&rdtype,
(isc_textregion_t *)&tr);
if (result == ISC_R_SUCCESS &&
rdtype == dns_rdatatype_ixfr) {
rdtype == dns_rdatatype_ixfr)
{
fprintf(stderr, ";; Warning, "
"ixfr requires "
"a "
@@ -2654,7 +2799,8 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
lookup->rdtype = rdtype;
lookup->rdtypeset = true;
if (rdtype ==
dns_rdatatype_axfr) {
dns_rdatatype_axfr)
{
lookup->section_question =
plusquest;
lookup->comments =
@@ -2662,7 +2808,8 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
}
if (rdtype ==
dns_rdatatype_any &&
!lookup->tcp_mode_set) {
!lookup->tcp_mode_set)
{
lookup->tcp_mode = true;
}
lookup->ixfr_serial = false;
+349 -205
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,103 @@ 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
know the key and algorithm that is being used. In BIND, this is done
by providing appropriate ``key`` and ``server`` statements in
``named.conf``.
.. option:: -h
Print a usage summary.
.. option:: -k keyfile
This option tells :program:`dig` to sign queries using TSIG or
SIG(0) 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 :iscman:`named.conf` for TSIG and by looking up the KEY record
in zone data for SIG(0).
.. 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 +178,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 +207,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 +226,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 +252,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,63 +326,84 @@ 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``
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.
.. option:: +dscp=value
This option formerly set the DSCP value used when sending a query.
It is now obsolete, and has no effect.
.. option:: +edns[=#], +noedns
``+[no]edns[=#]``
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:: +fuzztime[=value], +nofuzztime
This option allows the signing time to be specified when generating
signed messages. If a value is specified it is the seconds since
00:00:00 January 1, 1970 UTC ignoring leap seconds. If no value
is specified 1646972129 (Fri 11 Mar 2022 04:15:29 UTC) is used.
The default is ``+nofuzztime`` and the current time is used.
.. 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]https[=value]``
This option indicates whether to use DNS-over-HTTPS (DoH) when querying
.. 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.
@@ -358,94 +411,108 @@ abbreviation is unambiguous; for example, ``+cd`` is equivalent to
query URI; the default is ``/dns-query``. So, for example, ``dig
@example.com +https`` will use the URI ``https://example.com/dns-query``.
``+[no]https-get[=value]``
Similar to ``+https``, except that the HTTP GET request mode is used
.. option:: +https-get[=value], +nohttps-get
Similar to :option:`+https`, except that the HTTP GET request mode is used
when sending the query.
``+[no]https-post[=value]``
Same as ``+https``.
.. option:: +https-post[=value], +nohttps-post
``+[no]http-plain[=value]``
Similar to ``+https``, except that HTTP queries will be sent over a
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.
``+[no]http-plain-get[=value]``
Similar to ``+http-plain``, except that the HTTP request mode is GET.
.. option:: +http-plain-get[=value], +nohttp-plain-get
``+[no]http-plain-post[=value]``
Same as ``+http-plain``.
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
``+[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
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.
``+[no]idnin``
.. option:: +idnin, +noidnin
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,
@@ -454,75 +521,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.
.. option:: +retry=T
``+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 ``+tries``, this does not include
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.
@@ -531,33 +619,61 @@ 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``
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.
.. 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. To prevent retry over TCP when
TC=1 is returned from a UDP query, use ``+ignore``.
.. option:: +timeout=T
``+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``
This option indicates whether to use DNS-over-TLS (DoT) when querying
.. option:: +tls, +notls
This option indicates whether to use DNS over TLS (DoT) when querying
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.
@@ -565,49 +681,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``
.. 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.
@@ -620,33 +744,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:`+noqr` 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
~~~~~
@@ -657,7 +801,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
~~~~
+777 -256
View File
File diff suppressed because it is too large Load Diff
+37 -25
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,7 +77,6 @@
#define DEFAULT_EDNS_VERSION 0
#define DEFAULT_EDNS_BUFSIZE 1232
#define DEFAULT_HTTPS_PATH "/dns-query"
#define DEFAULT_HTTPS_QUERY "?dns="
/*%
@@ -105,24 +105,25 @@ typedef struct dig_searchlist dig_searchlist_t;
struct dig_lookup {
unsigned int magic;
isc_refcount_t references;
bool aaonly, adflag, badcookie, besteffort, cdflag, comments,
bool aaonly, adflag, badcookie, besteffort, cdflag, cleared, comments,
dns64prefix, dnssec, doing_xfr, done_as_is, ednsneg, expandaaaa,
expire, header_only, identify, /*%< Append an "on server <foo>"
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 */
nsid, /*% Name Server ID (RFC 5001) */
onesoa, pending, /*%< Pending a successful answer */
expire, fuzzing, header_only, identify, /*%< Append an "on
server <foo>" message
*/
identify_previous_line, /*% Prepend a "Nameserver <foo>:"
message, with newline and tab */
idnin, idnout, ignore, multiline, need_search, new_search,
noclass, nocrypto, nottl, ns_search_only, /*%< dig +nssearch,
host -C */
ns_search_success, 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 */
@@ -165,11 +166,9 @@ struct dig_lookup {
char *cookie;
dns_ednsopt_t *ednsopts;
unsigned int ednsoptscnt;
isc_dscp_t dscp;
unsigned int ednsflags;
dns_opcode_t opcode;
int rrcomments;
unsigned int eoferr;
uint16_t qid;
struct {
bool http_plain;
@@ -177,17 +176,30 @@ struct dig_lookup {
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;
};
isc_stdtime_t fuzztime;
};
/*% 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;
@@ -208,7 +220,6 @@ struct dig_query {
isc_time_t time_recv;
uint64_t byte_count;
isc_timer_t *timer;
isc_tlsctx_t *tlsctx;
};
struct dig_server {
@@ -275,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
@@ -446,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
+22 -21
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
@@ -212,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);
@@ -540,7 +533,8 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
}
if (!ISC_LIST_EMPTY(msg->sections[DNS_SECTION_AUTHORITY]) &&
!short_form) {
!short_form)
{
printf("\n");
result = printsection(msg, DNS_SECTION_AUTHORITY, "AUTHORITY",
true, query);
@@ -549,7 +543,8 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
}
}
if (!ISC_LIST_EMPTY(msg->sections[DNS_SECTION_ADDITIONAL]) &&
!short_form) {
!short_form)
{
printf("\n");
result = printsection(msg, DNS_SECTION_ADDITIONAL, "ADDITIONAL",
true, query);
@@ -603,10 +598,12 @@ pre_parse_args(int argc, char **argv) {
{
isc_mem_debugging |= ISC_MEM_DEBUGTRACE;
} else if (strcasecmp("record",
isc_commandline_argument) == 0) {
isc_commandline_argument) == 0)
{
isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
} else if (strcasecmp("usage",
isc_commandline_argument) == 0) {
isc_commandline_argument) == 0)
{
isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
}
break;
@@ -717,7 +714,8 @@ parse_args(bool is_batchfile, int argc, char **argv) {
break;
case 't':
if (strncasecmp(isc_commandline_argument, "ixfr=", 5) ==
0) {
0)
{
rdtype = dns_rdatatype_ixfr;
/* XXXMPA add error checking */
serial = strtoul(isc_commandline_argument + 5,
@@ -736,7 +734,8 @@ parse_args(bool is_batchfile, int argc, char **argv) {
isc_commandline_argument);
}
if (!lookup->rdtypeset ||
lookup->rdtype != dns_rdatatype_axfr) {
lookup->rdtype != dns_rdatatype_axfr)
{
lookup->rdtype = rdtype;
}
lookup->rdtypeset = true;
@@ -777,10 +776,11 @@ 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) {
lookup->rdtype != dns_rdatatype_axfr)
{
lookup->rdtype = dns_rdatatype_any;
}
list_type = dns_rdatatype_any;
@@ -854,6 +854,7 @@ parse_args(bool is_batchfile, int argc, char **argv) {
break;
case 'p':
port = atoi(isc_commandline_argument);
port_set = true;
break;
}
}
+85 -73
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>`.
+4 -3
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/.
@@ -580,6 +582,7 @@ set_port(const char *value) {
isc_result_t result = parse_uint(&n, value, 65535, "port");
if (result == ISC_R_SUCCESS) {
port = (uint16_t)n;
port_set = true;
}
}
@@ -619,8 +622,6 @@ 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 +855,7 @@ get_next_command(void) {
}
}
ISC_NORETURN static void
noreturn static void
usage(void);
static void
+22 -30
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>`.
+2
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/.
-27
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>
-142
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>
-3
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>
-18
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>
-132
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>
-3
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>
-18
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>
-139
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>

Some files were not shown because too many files have changed in this diff Show More