Commit Graph

33202 Commits

Author SHA1 Message Date
Matthijs Mekking
4e8dc72717 Add checkconf tests for [#2463]
Add two tests to make sure named-checkconf catches key-directory issues
where a zone in multiple views uses the same directory but has
different dnssec-policies. One test sets the key-directory specifically,
the other inherits the default key-directory (NULL, aka the working
directory).

Also update the good.conf test to allow zones in different views
with the same key-directory if they use the same dnssec-policy.

Also allow zones in different views with different key-directories if
they use different dnssec-policies.

Also allow zones in different views with the same key-directories if
only one view uses a dnssec-policy (the other is set to "none").

Also allow zones in different views with the same key-directories if
no views uses a dnssec-policy (zone in both views has the dnssec-policy
set to "none").

(cherry picked from commit df1aecd5ff)
2021-05-19 00:44:32 +00:00
Matthijs Mekking
d9fa465ff4 Check key-directory duplicates for kasp zones
Don't allow the same zone with different dnssec-policies in separate
views have the same key-directory.

Track zones plus key-directory in a symtab and if there is a match,
check the offending zone's dnssec-policy name. If the name is "none"
(there is no kasp for the offending zone), or if the name is the same
(the zone shares keys), it is fine, otherwise it is an error (zones
in views using different policies cannot share the same key-directory).

(cherry picked from commit 494e8b2cbd)
2021-05-19 00:44:32 +00:00
Mark Andrews
3aac910a01 Merge branch '2550-remove-dns_zone_setflag-v9_16' into 'v9_16'
Remove dns_zone_setflag()

See merge request isc-projects/bind9!5056
2021-05-19 00:43:35 +00:00
Mark Andrews
a417f994b1 Remove dns_zone_setflag()
This function has never been used since it was added to the source tree
by commit 686b27bfd3 back in 1999.  As
the dns_zoneflg_t type is only defined in lib/dns/zone.c, no function
external to that file would be able to use dns_zone_setflag() properly
anyway - the DNS_ZONE_SETFLAG() and DNS_ZONE_CLRFLAG() macros should be
used instead. Zone options that can be set from outside zone.c are set
using dns_zone_setoption().

(cherry picked from commit 314b5362a8)
2021-05-19 09:56:32 +10:00
Mark Andrews
308213ec8a Merge branch '2696-misleading-diagnostic-in-update_soa_serial-indicates-bind-will-use-increment-but-it-doesn-t-v9_16' into 'v9_16'
Adjust returned method from dns_updatemethod_date

See merge request isc-projects/bind9!5054
2021-05-18 13:22:12 +00:00
Mark Andrews
ee07fb854a Adjust returned method from dns_updatemethod_date
if dns_updatemethod_date is used do that the returned method is only
set to dns_updatemethod_increment if the new serial does not encode
the current day (YYYYMMDDXX).

(cherry picked from commit 5d21042ed8)
2021-05-18 22:55:35 +10:00
Michał Kępień
a2dad97eb9 Merge branch 'michal/use-context-managers-as-suggested-by-pylint-2.8.2-v9_16' into 'v9_16'
[v9_16] Use context managers as suggested by PyLint 2.8.2

See merge request isc-projects/bind9!5053
2021-05-18 09:21:45 +00:00
Michał Kępień
e8af7528e1 Use context managers as suggested by PyLint 2.8.2
PyLint 2.8.2 reports the following suggestions for two Python scripts
used in the system test suite:

    ************* Module tests_rndc_deadlock
    bin/tests/system/addzone/tests_rndc_deadlock.py:71:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    ************* Module tests-shutdown
    bin/tests/system/shutdown/tests-shutdown.py:68:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    bin/tests/system/shutdown/tests-shutdown.py:157:8: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)

Implement the above suggestions by using
concurrent.futures.ThreadPoolExecutor() and subprocess.Popen() as
context managers.

(cherry picked from commit a8163551ed)
2021-05-18 11:02:45 +02:00
Mark Andrews
ba470298e9 Merge branch '2706-worker-cond_prio-needs-to-be-initialised-v9_16' into 'v9_16'
initialise worker->cond_prio

See merge request isc-projects/bind9!5052
2021-05-18 09:02:14 +00:00
Mark Andrews
148ccd06dd initialise worker->cond_prio
(cherry picked from commit 7e83c6df94)
2021-05-18 18:43:25 +10:00
Mark Andrews
a09b816f00 Merge branch '2701-gcc-10-fanalyzer-reports-dereference-of-null-label-in-lib-dns-name-c-1167-v9_16' into 'v9_16'
Silence gcc-10-fanalyzer false positive

See merge request isc-projects/bind9!5049
2021-05-18 07:12:59 +00:00
Mark Andrews
db0c4d079a Silence gcc-10-fanalyzer false positive
If 'state == ft_ordinary' then 'label' can't be NULL. Add
INSIST to reflect this.

(cherry picked from commit 29f1c1e677)
2021-05-18 16:45:56 +10:00
Mark Andrews
3229e4a2ba Merge branch '2702-gcc-10-fanalyzer-reports-v9_16' into 'v9_16'
Silence gcc-10-fanalyzer false positive

See merge request isc-projects/bind9!5044
2021-05-18 06:43:42 +00:00
Mark Andrews
7dd85a71ae Silence gcc-10-fanalyzer false positive
Add REQUIRE(type == dns_rdatatype_nsec3 || firstp != NULL); so
that dereferences of *firstp is not flagged as a NULL pointer
dereference.

(cherry picked from commit 683ad6e4bd)
2021-05-18 15:48:08 +10:00
Mark Andrews
f7d597544f Merge branch '2689-cid-331477-resource-leaks-resource_leak-v9_16' into 'v9_16'
Address potential resource leak in dst_key_fromnamedfile

See merge request isc-projects/bind9!5042
2021-05-18 02:48:58 +00:00
Mark Andrews
ae9c74a846 Add CHANGES for [GL #2689]
(cherry picked from commit d24ea068c8)
2021-05-18 11:43:14 +10:00
Mark Andrews
1b0c38c416 Address potential resource leak in dst_key_fromnamedfile
(cherry picked from commit 8eed392add)
2021-05-18 11:42:48 +10:00
Michal Nowak
2d4448c53e Merge branch '2692-grep-from-freebsd-13-0-stumbles-on-r-in-digdelv-test' into 'v9_16'
Do not use escape codes for matching with grep

See merge request isc-projects/bind9!5023
2021-05-17 11:12:17 +00:00
Michal Nowak
253ae96bf1 Do not use escape codes for matching with grep
FreeBSD 13.0 replaced GNU grep with BSD grep and removed support for
"redundant escapes for most ordinary characters" from regex(3) library,
therefore the matching sequence in digdelv/tests.sh needs to be
rewritten otherwise it fails with:

    grep: trailing backslash (\)
2021-05-17 13:10:28 +02:00
Ondřej Surý
21f10fa8c8 Merge branch 'ondrej/remove-netmgr-quantum-v9_16' into 'v9_16'
Replace netmgr quantum with loop-preventing barrier

See merge request isc-projects/bind9!5032
2021-05-17 11:05:38 +00:00
Ondřej Surý
fb9a79ffb6 Replace netmgr quantum with loop-preventing barrier
Instead of using fixed quantum, this commit adds atomic counter for
number of items on each queue and uses the number of netievents
scheduled to run as the limit of maximum number of netievents for a
single process_queue() run.

This prevents the endless loops when the netievent would schedule more
netievents onto the same loop, but we don't have to pick "magic" number
for the quantum.

(cherry picked from commit 9e3cb396b2)
2021-05-17 12:06:07 +02:00
Michal Nowak
570c22da13 Merge branch '2693-add-py-test-to-the-list-of-tested-pytest-names-v9_16' into 'v9_16'
[v9_16] Add py.test to the list of tested pytest names

See merge request isc-projects/bind9!5030
2021-05-17 09:57:54 +00:00
Michal Nowak
cfb8cf5294 Add py.test to the list of tested pytest names
OpenBSD changed the name of the pytest script from py.test-3 in OpenBSD
6.8 to py.test in OpenBSD 6.9.

The py.test-3 name which was added in d5562a3e for the sake of OpenBSD
and CentOS is still required for CentOS.

(cherry picked from commit 510b4b70e9)
2021-05-17 11:28:31 +02:00
Michal Nowak
a06c737377 Merge branch '2386-check-correct-copyright-dates-in-man-pages-v9_16' into 'v9_16'
[v9_16] Set copyright year to the current year

See merge request isc-projects/bind9!5027
2021-05-14 13:24:39 +00:00
Michal Nowak
56cd1f041c Set copyright year to the current year
To ensure that a release with outdated copyright year is not produced at
the beginning of a year, set copyright year to the current year.

(cherry picked from commit 7eb44b05c5)
2021-05-14 14:47:35 +02:00
Ondřej Surý
a822caa3f3 Merge branch 'each-backport-netmgr' into 'v9_16'
Full backport of netmgr/taskmgr to 9.16

See merge request isc-projects/bind9!5018
2021-05-14 11:17:56 +00:00
Evan Hunt
4c9c6a8823 CHANGES, release notes 2021-05-14 12:52:48 +02:00
Ondřej Surý
4d027ab945 Remove TLSDNS, TLS and HTTP protocols from netmgr
For further stabilization of the 9.16 branch, we are removing the unused
protocols from the netmgr.
2021-05-14 12:52:48 +02:00
Ondřej Surý
6a1dba7232 Fix nanosleep and usleep
- Add POSIX nanosleep() and usleep() shim implementation for Windows
  to help implementors use less #ifdef _WIN32 in the code.
- Use uv_sleep when possible in the netmgr code and define usleep based
  shim for libuv << 1.34.0.
2021-05-14 12:52:48 +02:00
Ondřej Surý
6da96c61f8 Fix the outgoing UDP socket selection on Windows
The outgoing UDP socket selection would pick unintialized children
socket on Windows, because we have more netmgr workers than we have
listening sockets.  This commit fixes the selection by keeping the
outgoing socket the same, so it's always run on existing socket.

(cherry picked from commit cd413234f7)
2021-05-14 12:52:48 +02:00
Evan Hunt
e4c9652382 hacks to get dyndb working without libtool
- memory tracing failed if the driver didn't have access
  to the isc_mem_debugging variable.
- remove RTLD_DEEPBIND from dlopen() flags as it causes
  shared libraries to be unable to access thread-local storage,
  which is needed when enqueuing tasks.
2021-05-14 12:52:48 +02:00
Evan Hunt
ef1d909fa9 backport of netmgr/taskmgr to 9.16
this rolls up numerous changes that have been applied to the
main branch, including moving isc_task operations into the
netmgr event loops, and other general stabilization.
2021-05-14 12:52:48 +02:00
Ondřej Surý
d98ad30c0d Merge branch 'ondrej/add-nanosleep-and-usleep-windows-shims-v9_16' into 'v9_16'
Add nanosleep and usleep Windows shims

See merge request isc-projects/bind9!5026
2021-05-14 10:21:36 +00:00
Ondřej Surý
a09822b624 Add nanosleep and usleep Windows shims
This commit adds POSIX nanosleep() and usleep() shim implementation for
Windows to help implementors use less #ifdef _WIN32 in the code.

(cherry picked from commit c37ff5d188)
2021-05-14 12:19:48 +02:00
Ondřej Surý
906cca09dc Merge branch 'ondrej/replace-CreateThreads-with-isc_thread_create-v9_16' into 'v9_16'
Add trampoline around iocompletionport_createthreads()

See merge request isc-projects/bind9!5025
2021-05-14 10:16:00 +00:00
Ondřej Surý
7e8f4b1df6 Add trampoline around iocompletionport_createthreads()
On Windows, the iocompletionport_createthreads() didn't use
isc_thread_create() to create new threads for processing IO, but just a
simple CreateThread() function that completely circumvent the
isc_trampoline mechanism to initialize global isc_tid_v.  This lead to
segmentation fault in isc_hp API because '-1' isn't valid index to the
hazard pointer array.

This commit changes the iocompletionport_createthreads() to use
isc_thread_create() instead of CreateThread() to properly initialize
isc_tid_v.

(cherry picked from commit cd54bbbd9a)
2021-05-14 12:14:23 +02:00
Mark Andrews
5feb6f79b8 Merge branch '2528-check-soa-rdata-v9_16' into 'v9_16'
Check that the first and last SOA of an AXFR are consistent

See merge request isc-projects/bind9!5015
2021-05-13 13:35:48 +00:00
Evan Hunt
6f6ac57cb5 system test
Attempt a zone transfer with mismatched SOA records.

(cherry picked from commit 4d94f82232)
2021-05-13 23:17:06 +10:00
Mark Andrews
eded531bee Add CHANGES entry for [GL #2528]
(cherry picked from commit 7e54d8d2cb)
2021-05-13 16:01:51 +10:00
Mark Andrews
0ec28efe86 Check that the first and last SOA of an AXFR are consistent
(cherry picked from commit e86508708d)
2021-05-13 16:01:27 +10:00
Matthijs Mekking
43dbce7f0b Merge branch '2603-test-dnssec-policy-none-v9_16' into 'v9_16'
dnssec-policy check for duplicate writable file (9.16)

See merge request isc-projects/bind9!5000
2021-05-05 17:12:50 +00:00
Matthijs Mekking
72deed194d Use isdigit instead of checking character range
When looking for key files, we could use isdigit rather than checking
if the character is within the range [0-9].

Use (unsigned char) cast to ensure the value is representable in the
unsigned char type (as suggested by the isdigit manpage).

Change " & 0xff" occurrences to the recommended (unsigned char) type
cast.

(cherry picked from commit 1998ad6c776a9c17c27788b17765dee90d9e25df)
2021-05-05 18:23:53 +02:00
Matthijs Mekking
353161bd3c Changes and release notes for [#2603]
(cherry picked from commit 7663c17f3b3d2b1600a6864bec90bb045763a96a)
2021-05-05 18:23:51 +02:00
Matthijs Mekking
861b2a14bb Check for filename clashes /w dnssec-policy zones
Just like with dynamic and/or inline-signing zones, check if no two
or more zone configurations set the same filename. In these cases,
the zone files are not read-only and named-checkconf should catch
a configuration where multiple zone statements write to the same file.

Add some bad configuration tests where KASP zones reference the same
zone file.

Update the good-kasp test to allow for two zones configure the same
file name, dnssec-policy none.

(cherry picked from commit 0b5fc0afcfd1a0bb7c1f16b63872b7ee26fb2777)
2021-05-05 18:22:42 +02:00
Matthijs Mekking
f42234fef0 Check zonefile is untouched if dnssec-policy none
Make sure no DNSSEC contents are added to the zonefile if dnssec-policy
is set to "none" (and no .state files exist for the zone).

(cherry picked from commit 5246c16f43e6fda7587193a4dd801951cf87db14)
2021-05-05 18:22:32 +02:00
Mark Andrews
9bb1adb347 Merge branch '2670-always-set-rewrite-when-compacting-a-version-1-journal-v9_16' into 'v9_16'
Allow named-journalprint to compact journals at a given serial

See merge request isc-projects/bind9!4999
2021-05-05 13:52:52 +00:00
Mark Andrews
054c2c6490 Add release note for [GL #2670]
(cherry picked from commit a60b54e1df)
2021-05-05 23:36:06 +10:00
Mark Andrews
84dbaad15a Add CHANGES note for [GL #2670]
(cherry picked from commit 79da175a76)
2021-05-05 23:36:06 +10:00
Mark Andrews
966bcfb89d Check journal compaction
(cherry picked from commit ae1ae07b03)
2021-05-05 23:36:06 +10:00
Mark Andrews
c659fed6ad Always perform a re-write when processing a version 1 journal
version 1 journals may have a mix of type 1 and type 2 transaction
headers so always use the recovery code.

(cherry picked from commit 4a8e33b9f0)
2021-05-05 23:36:06 +10:00