Commit Graph

33955 Commits

Author SHA1 Message Date
Evan Hunt
b0aadaac8e rename dns_name_copynf() to dns_name_copy()
dns_name_copy() is now the standard name-copying function.
2021-05-22 00:37:27 -07:00
Evan Hunt
ea7b28f101 remove dns_name_copy() implementation
Remove dns_name_copy() and refactor the underlying code since
it will only be called by dns_name_copynf() now, and can't fail.
2021-05-22 00:22:32 -07:00
Evan Hunt
b1fe1b8ae3 remove the remaining uses of dns_name_copy()
dns_name_copy() has been replaced nearly everywhere with
dns_name_copynf().  this commit changes the last two uses of
the original function.  afterward, we can remove the old
dns_name_copy() implementation, and replace it with _copynf().
2021-05-22 00:22:32 -07:00
Evan Hunt
6803f394c5 Merge branch '2713-intermittent-crashes-in-the-tkey-system-test-caused-by-broken-dns_name_t-structures' into 'main'
Use dns_name_copy() to hold the copied name

Closes #2713

See merge request isc-projects/bind9!5079
2021-05-22 04:30:19 +00:00
Ondřej Surý
ce3e1abc1d Use dns_name_copynf() with dns_message_gettempname() when needed
dns_message_gettempname() returns an initialized name with a dedicated
buffer, associated with a dns_fixedname object.  Using dns_name_copynf()
to write a name into this object will actually copy the name data
from a source name. dns_name_clone() merely points target->ndata to
source->ndata, so it is faster, but it can lead to a use-after-free if
the source is freed before the target object is released via
dns_message_puttempname().

In a few places, clone was being used where copynf should have been;
this is now fixed.

As a side note, no memory was lost, because the ndata buffer used in
the dns_fixedname_t is internal to the structure, and is freed when
the dns_fixedname_t is freed regardless of the .ndata contents.
2021-05-21 21:28:10 -07:00
Brian Conry
10ced46739 Merge branch '2662-fix-broken-SYSTEMTEST_NO_CLEAN' into 'main'
Preserve SYSTEMTEST_NO_CLEAN when run.sh calls make.

Closes #2662

See merge request isc-projects/bind9!5003
2021-05-21 13:38:25 +00:00
Brian Conry
44cadaf31b Preserve additional environment variables with run.sh
When executed in "legacy mode" (i.e. without the '-r' parameter)
run.sh invokes make with a modified environment.

SYSTEMTEST_FORCE_COLOR is now preserved for use by the individual test
scripts.

CYGWIN is now preserved for named, as it controls behavior relating to
crash reporting.
2021-05-21 13:07:28 +00:00
Brian Conry
516de44c9f Preserve SYSTEMTEST_NO_CLEAN when run.sh calls make
This restores legacy behavior in bin/tests/system where running:
  SYSTEMTEST_NO_CLEAN=1 ./run.sh <testname>
would run the test and preserve the output files.

This has been broken since the change that has run.sh invoke "make",
due to SYSTEMTEST_NO_CLEAN not being preserved in the environment
that's set up for "make".

Another option would be to completely remove SYSTEMTEST_NO_CLEAN.

This seems to be the only behavior-changing environment variable
not accounted for in the call to "make".

I don't think this needs a CHANGES entry.
2021-05-21 13:07:28 +00:00
Michał Kępień
97a821399b Merge branch 'michal/regenerate-man-pages-with-sphinx-4.0.2' into 'main'
Regenerate man pages with Sphinx 4.0.2

See merge request isc-projects/bind9!5077
2021-05-21 09:26:16 +00:00
Michał Kępień
9ec83d1f63 Explicitly set "man_make_section_directory"
The default value of the "man_make_section_directory" Sphinx option was
changed in Sphinx 4.0.1, which broke building man pages in maintainer
mode as the shell code in doc/man/Makefile.am expects man pages to be
built in doc/man/_build/man/, not doc/man/_build/man/<section_number>/.
The aforementioned change in defaults was reverted in Sphinx 4.0.2, but
this issue should still be prevented from reoccurring in the future.
Ensure that by explicitly setting the "man_make_section_directory"
option to False.
2021-05-21 10:29:02 +02:00
Michał Kępień
bdb777b2a2 Regenerate man pages with Sphinx 4.0.2
The man pages produced by Sphinx 4.0.2 are slightly different than those
produced by Sphinx 3.5.4.  As Sphinx 4.0.2 is now used in GitLab CI,
update all doc/man/*in files so that they reflect what that version of
Sphinx produces, in order to prevent GitLab CI job failures.
2021-05-21 10:29:02 +02:00
Ondřej Surý
596a3442a3 Merge branch '2515-improve-glue-cache-performance' into 'main'
use a fixedname buffer in dns_message_gettempname()

Closes #2515

See merge request isc-projects/bind9!5071
2021-05-20 19:04:35 +00:00
Ondřej Surý
5ee9edc4ce Optimize rdataset_getownercase not to use bitshifts
The last rdataset_getownercase() left it in a state where the code was
mix of microoptimizations (manual loop unrolling, complicated bitshifts)
with a code that would always rewrite the character even if it stayed
the same after transformation.

This commit makes sure that we modify only the characters that actually
need to change, removes the manual loop unrolling, and replaces the
weird bit arithmetics with a simple shift and bit-and.
2021-05-20 20:41:29 +02:00
Evan Hunt
e31cc1eeb4 use a fixedname buffer in dns_message_gettempname()
dns_message_gettempname() now returns a pointer to an initialized
name associated with a dns_fixedname_t object. it is no longer
necessary to allocate a buffer for temporary names associated with
the message object.
2021-05-20 20:41:29 +02:00
Michał Kępień
869e0feec7 Merge branch 'v9_17_13-release' into 'main'
Merge 9.17.13 release branch

See merge request isc-projects/bind9!5068
2021-05-20 10:10:37 +00:00
Michał Kępień
5a71af44b1 Set up release notes for BIND 9.17.14 2021-05-20 12:03:47 +02:00
Michał Kępień
f73d41d0a0 Update BIND version to 9.17.13 2021-05-20 12:03:47 +02:00
Michał Kępień
39b739b867 Add a CHANGES marker 2021-05-20 12:03:47 +02:00
Michał Kępień
c14a91f06e Merge branch 'michal/prepare-documentation-for-bind-9.17.13' into 'v9_17_13-release'
Prepare documentation for BIND 9.17.13

See merge request isc-private/bind9!293
2021-05-20 12:03:47 +02:00
Michał Kępień
8113dbe5bb Prepare release notes for BIND 9.17.13 2021-05-20 12:03:47 +02:00
Michał Kępień
e49bd0906e Add release note for GL #2626 2021-05-20 12:03:47 +02:00
Michał Kępień
620cccc3fc Reorder release notes 2021-05-20 12:03:47 +02:00
Michał Kępień
ced6c9b23a Tweak and reword release notes 2021-05-20 12:03:47 +02:00
Michał Kępień
43cbc773a7 Tweak and reword recent CHANGES entries 2021-05-20 12:03:47 +02:00
Michal Nowak
ab6060c538 Drop duplicate release note for GL #2347 2021-05-20 12:03:47 +02:00
Michal Nowak
15a345626a Fix typo in doc/dnssec-guide/recipes.rst 2021-05-20 12:03:47 +02:00
Matthijs Mekking
3ecd951da8 Merge branch '1875-kasp-views-keyfile-race' into 'main'
Lock key files when looking for zone keys

Closes #1875

See merge request isc-projects/bind9!4919
2021-05-20 07:55:26 +00:00
Matthijs Mekking
fa1cd0a1f1 Release notes and changes for [#1875] 2021-05-20 09:23:46 +02:00
Matthijs Mekking
252a1ae0a1 Lock kasp when looking for zone keys
We should also lock kasp when reading key files, because at the same
time the zone in another view may be updating the key file.
2021-05-20 09:15:43 +02:00
Michal Nowak
8de2d8137c Merge branch 'mnowak/openbsd-6.9' into 'main'
Add OpenBSD 6.9

See merge request isc-projects/bind9!5031
2021-05-19 17:10:53 +00:00
Michal Nowak
315b8522ba Add OpenBSD 6.9 2021-05-19 17:21:23 +02:00
Michal Nowak
38bc6c8aa3 Merge branch '2694-drop-seq-command-from-views-tests-sh' into 'main'
Replace seq command with POSIX-compliant shell code

Closes #2694

See merge request isc-projects/bind9!5061
2021-05-19 13:55:53 +00:00
Michal Nowak
a4b7eb7188 Make views system test ShellCheck-clean
Also, add "set -e" to all shell scripts of the views test to exit when
any command fails or is unknown, e.g., this on OpenBSD:

    tests.sh[174]: seq: not found
2021-05-19 14:04:48 +02:00
Michal Nowak
a08487ec3d Replace seq command with POSIX-compliant shell code
The seq command is not defined in the POSIX standard and is missing on
OpenBSD. Given that the system test code is meant to be POSIX-compliant
replace it with a shell construct.
2021-05-19 14:04:48 +02:00
Michał Kępień
7d6bcef66e Merge branch '2709-placeholder' into 'main'
Add placeholder for GL #2709

See merge request isc-projects/bind9!5060
2021-05-19 12:00:02 +00:00
Michał Kępień
6962335678 Add placeholder for GL #2709 2021-05-19 13:57:21 +02:00
Artem Boldariev
1a298b28e2 Merge branch 'artem/doh-quota-tests' into 'main'
Add DoH quota tests

See merge request isc-projects/bind9!5024
2021-05-19 08:30:17 +00:00
Artem Boldariev
67c50abe5a Add DoH quota tests
This commit adds unit tests which ensure that DoH code is compatible
with quota functionality.
2021-05-19 10:28:47 +03:00
Mark Andrews
c2c2b0da9a Merge branch '2688-cid331478-forwardnull' into 'main'
Fix possible null dereference (coverity issue 331478)

Closes #2688

See merge request isc-projects/bind9!5034
2021-05-19 01:55:53 +00:00
Matthijs Mekking
19395fd168 Fix coverity issue 331478
Move the "cannot start rollover" warning into code block that checks
if 'active_key' is not NULL.
2021-05-19 00:45:54 +00:00
Mark Andrews
954eb15052 Merge branch '2550-remove-dns_zone_setflag' into 'main'
Resolve "Remove dns_zone_setflag"

Closes #2550

See merge request isc-projects/bind9!4762
2021-05-18 23:54:35 +00:00
Mark Andrews
314b5362a8 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().
2021-05-18 16:02:18 -07:00
Matthijs Mekking
b6f806e023 Merge branch '2463-kasp-views-different-policy-same-keydirectory' into 'main'
Check key-directory duplicates for kasp zones

Closes #2463

See merge request isc-projects/bind9!4989
2021-05-18 14:40:26 +00:00
Matthijs Mekking
a9f4b074c4 Release notes and changes for [GL #2463]
Mention the bugfix.
2021-05-18 15:47:02 +02:00
Matthijs Mekking
df1aecd5ff 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").
2021-05-18 15:47:02 +02:00
Matthijs Mekking
494e8b2cbd 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).
2021-05-18 15:47:02 +02:00
Mark Andrews
8a90139c2c Merge branch '2696-misleading-diagnostic-in-update_soa_serial-indicates-bind-will-use-increment-but-it-doesn-t' into 'main'
Resolve "Misleading diagnostic in update_soa_serial indicates BIND will use increment but it doesn't"

Closes #2696

See merge request isc-projects/bind9!5029
2021-05-18 12:51:00 +00:00
Mark Andrews
5d21042ed8 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).
2021-05-18 12:30:22 +00:00
Michał Kępień
3dc094c8e0 Merge branch 'michal/use-context-managers-as-suggested-by-pylint-2.8.2' into 'main'
Use context managers as suggested by PyLint 2.8.2

See merge request isc-projects/bind9!5041
2021-05-18 08:56:50 +00:00
Michał Kępień
a8163551ed 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:154: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.
2021-05-18 10:53:17 +02:00