Commit Graph

37549 Commits

Author SHA1 Message Date
Michal Nowak
ae33a8ddea 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.
2022-11-14 19:54:42 +00:00
Michal Nowak
00c3b1e309 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'
2022-11-14 19:54:42 +00:00
Michal Nowak
02a4a95395 Remove unused $@ array from cds/setup.sh
posh, the Policy-compliant Ordinary SHell, failed with:

    setup.sh:57: @: parameter not set
2022-11-14 19:54:42 +00:00
Michal Nowak
ac3fcb612d 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.
2022-11-14 19:54:42 +00:00
Michal Nowak
9eb2f6b0e8 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\";
2022-11-14 19:54:42 +00:00
Michal Nowak
7640fc5b39 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
2022-11-14 19:54:42 +00:00
Michal Nowak
9e68997cbb 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
2022-11-14 19:54:42 +00:00
Ondřej Surý
845aa359a5 Merge branch '3676-deprecate-operating-system-resource-limits' into 'main'
Deprecate setting operating system limits from named.conf

Closes #3676

See merge request isc-projects/bind9!7078
2022-11-14 17:18:52 +00:00
Ondřej Surý
65156afb8c Add CHANGES and release note [GL #3676] 2022-11-14 16:48:52 +01:00
Ondřej Surý
379929e052 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.
2022-11-14 16:48:52 +01:00
Ondřej Surý
9625426dd9 Merge branch '3664-remote-with-tuning-large' into 'main'
Remove the last remnants of --with-tuning=large

Closes #3664

See merge request isc-projects/bind9!7052
2022-11-14 09:03:28 +00:00
Ondřej Surý
24bda93dde Add CHANGES and release note for [GL #3664] 2022-11-14 10:01:36 +01:00
Ondřej Surý
76725718f4 Update the build requirements in the ARM
The build requirements have been updated to state that libcap is now
required on Linux and removed mention of --with-tuning configure option.
2022-11-14 10:01:20 +01:00
Ondřej Surý
0bf7014f85 Remove the last remnants of --with-tuning=large
The small/large tuning has been completely removed from the code with
last remnant of the dead code in ns_interfacemgr.  Remove the dead code
and the configure option.
2022-11-14 10:01:20 +01:00
Mark Andrews
4613dca35b Merge branch '3468-statistics-xml-rendering-does-not-seem-to-protect-against-concurrent-changes' into 'main'
Resolve "Statistics XML rendering does not seem to protect against concurrent changes"

Closes #3468

See merge request isc-projects/bind9!6695
2022-11-11 15:56:04 +00:00
Mark Andrews
a4383c906c Add CHANGES note for [GL #3468] 2022-11-11 15:26:46 +00:00
Mark Andrews
f053d5b414 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.
2022-11-11 15:26:11 +00:00
Matthijs Mekking
849785cc20 Merge branch 'matthijs-tweak-kasp-test' into 'main'
Tweak kasp system test script

See merge request isc-projects/bind9!7064
2022-11-11 14:03:46 +00:00
Matthijs Mekking
6ef0417274 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.
2022-11-11 15:02:44 +01:00
Michal Nowak
c6877fe053 Merge branch 'mnowak/add-git-fsck' into 'main'
Verify Git repo validity

See merge request isc-projects/bind9!7048
2022-11-11 13:39:01 +00:00
Michal Nowak
be83e203ce Verify Git repo validity
This check should help catching issues like [1] early.

[1] https://gitlab.isc.org/isc-projects/bind9/-/wikis/%22main%22-branch-partial-history-rewrite-in-August-2022
2022-11-11 13:55:05 +01:00
Matthijs Mekking
9e6c449f7b Merge branch '3570-nsec3param-ttl-default-soa-minimum' into 'main'
Change default NSEC3PARAM TTL

Closes #3570

See merge request isc-projects/bind9!6897
2022-11-11 11:07:15 +00:00
Matthijs Mekking
16c827599f Test NSEC3PARAM TTL is not preserved
Now that we are setting the NSEC3PARAM TTL to SOA MINIMUM, we should
not preserve the TTL, otherwise a SOA MINIMUM change would not be
picked up.
2022-11-11 12:06:33 +01:00
Matthijs Mekking
0f99020748 Add change and release note for #3570
Feature change.
2022-11-11 12:06:33 +01:00
Matthijs Mekking
53eab06083 Change default TTL of NSEC3PARAM to SOA MINIMUM
Despite the RFC says that the NSEC3PARAM is not something that is
intended for the resolver to be cached, and thus the TTL of 0 is most
logical, a zero TTL RRset can be abused by bad actors.

Change the default to SOA MINIMUM.
2022-11-11 12:06:33 +01:00
Matthijs Mekking
f51901eaca Add test that checks NSEC3PARAM TTL
The TTL should be equal to the SOA MINIMUM by default.
2022-11-11 12:06:33 +01:00
Ondřej Surý
9eaa7e7d37 Merge branch 'ondrej-dns_view-resolver-can-be-NULL' into 'main'
Don't use view->resolver directly when priming in dns_view_find()

See merge request isc-projects/bind9!7065
2022-11-11 10:49:35 +00:00
Ondřej Surý
417097450a Check view->adb in dns_view_flushcache()
The call to dns_view_flushcache() is done under exclusive mode, but we
still need to check if view->adb is still attached before calling
dns_adb_flush() because the shutdown might have been already
initialized.  This most likely only a theoretical problem on shutdown
because there's either no way how to initiate cache flush when shutting
down or very slim window where the `rndc flush` would have to hit the
slim time during named shutdown.
2022-11-11 11:47:44 +01:00
Ondřej Surý
a8ba240325 Don't use view->resolver directly when priming in dns_view_find()
When starting priming from dns_view_find(), the dns_view shutdown could
be initiated by different thread, detaching from the resolver.  Use
dns_view_getresolver() to attach to the resolver under view->lock, so we
don't try to call dns_resolver_prime() with NULL pointer.

There are more accesses to view->resolver, (and also view->adb and
view->requestmgr that suffer from the same problem) in the dns_view
module, but they are all done in exclusive mode or under a view->lock.
2022-11-11 11:47:44 +01:00
Petr Špaček
54a425ab57 Merge branch '3669-update-policy-external-synchronous-doc' into 'main'
Document that update-policy external is synchronous

See merge request isc-projects/bind9!7066
2022-11-11 09:37:40 +00:00
Petr Špaček
7d352741a0 Document that update-policy external is synchronous 2022-11-11 10:32:14 +01:00
Ondřej Surý
ba5bd5f104 Merge branch '3670-fix-http-headers-test' into 'main'
Update the HTTP headers test to check for 101 headers

Closes #3670

See merge request isc-projects/bind9!7070
2022-11-11 09:23:43 +00:00
Ondřej Surý
9e5edb0b26 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:19:41 +01:00
Ondřej Surý
d1d0c93ac0 Merge branch '3670-bump-statschannel-headers' into 'main'
Bump the allowed HTTP headers in statschannel to 100

Closes #3670

See merge request isc-projects/bind9!7068
2022-11-10 18:27:44 +00:00
Ondřej Surý
c65666dc97 Add CHANGES and release note for [GL #3670] 2022-11-10 16:41:25 +01:00
Ondřej Surý
e4654d1a6a 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.
2022-11-10 16:34:26 +01:00
Ondřej Surý
48a926536e Merge branch 'ondrej-add-isc_hashmap' into 'main'
Add isc_hashmap API that implements Robin Hood hashing

See merge request isc-projects/bind9!6790
2022-11-10 14:08:30 +00:00
Ondřej Surý
86f3cba854 Add CHANGES note for [GL !6790] 2022-11-10 15:07:19 +01:00
Ondřej Surý
b7eabb6394 Use isc_hashmap instead of isc_ht in the dns_resolver API
Replace the use of isc_ht API with isc_hashmap API in the dns_resolver
implementation.  This requires extending the fctxbucket_t structure to
include keysize and copy of the key because the isc_hashmap API needs
the raw key in case of resizing the hashmap table.
2022-11-10 15:07:19 +01:00
Ondřej Surý
e1220a2d4f Use isc_hashmap instead of isc_ht in the dns_adb API
Replace the use of isc_ht API with isc_hashmap API in the dns_adb
database implementation.  This requires extending the
dns_adbnamebucket_t and dns_adbentrybucket_t structures to include
keysize and copy of the key because the isc_hashmap API needs the raw
key in case of resizing the hashmap table.
2022-11-10 15:07:19 +01:00
Ondřej Surý
f46ce447a6 Add isc_hashmap API that implements Robin Hood hashing
Add new isc_hashmap API that differs from the current isc_ht API in
several aspects:

1. It implements Robin Hood Hashing which is open-addressing hash table
   algorithm (e.g. no linked-lists)

2. No memory allocations - the array to store the nodes is made of
   isc_hashmap_node_t structures instead of just pointers, so there's
   only allocation on resize.

3. The key is not copied into the hashmap node and must be also stored
   externally, either as part of the stored value or in any other
   location that's valid as long the value is stored in the hashmap.

This makes the isc_hashmap_t a little less universal because of the key
storage requirements, but the inserts and deletes are faster because
they don't require memory allocation on isc_hashmap_add() and memory
deallocation on isc_hashmap_delete().
2022-11-10 15:07:19 +01:00
Mark Andrews
0744ebe220 Merge branch '3630-nextpart-is-not-compatible-with-set-x' into 'main'
Resolve "'nextpart' is not compatible with 'set -x'"

Closes #3630

See merge request isc-projects/bind9!6995
2022-11-08 16:42:13 +00:00
Mark Andrews
10f67938db 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.
2022-11-08 15:35:28 +00:00
Tom Krizek
2ea0eaacd6 Merge branch 'tkrizek/danger-approve' into 'main'
ci: add danger checks - approve workflow & wip commits

Closes #3651

See merge request isc-projects/bind9!7041
2022-11-08 13:37:33 +00:00
Tom Krizek
5ecb277090 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).
2022-11-08 14:34:58 +01:00
Tom Krizek
402b11431c 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.
2022-11-08 14:34:58 +01:00
Tom Krizek
e901342dd9 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.
2022-11-08 14:34:56 +01:00
Ondřej Surý
0f46bcc86e Merge branch 'ondrej-name-loop-memory-contexts' into 'main'
Properly name the loop->mctx

See merge request isc-projects/bind9!7046
2022-11-08 12:33:17 +00:00
Ondřej Surý
9d2f22e666 Properly name the loop->mctx
The per loop memory context were unnamed, properly name them as
'loop<tid>'.
2022-11-08 13:32:13 +01:00
Michał Kępień
2c37b3f01b Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.8' into 'main'
Set up version and release notes for BIND 9.19.8

See merge request isc-projects/bind9!7053
2022-11-08 12:30:09 +00:00