Commit Graph

35440 Commits

Author SHA1 Message Date
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 Andrews
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 Andrews
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 Andrews
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 Hunt
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ček
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šík
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 Hunt
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ý
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