Commit Graph

36947 Commits

Author SHA1 Message Date
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ń
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ček
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 Andrews
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