Commit Graph

34753 Commits

Author SHA1 Message Date
Petr Špaček
b57241ddbb Allow system tests to run under root user when inside CI
https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
says variable CI_SERVER="yes" is available in all versions of Gitlab.

(cherry picked from commit ddf46056ca)

Adapted to v9_16's version of run.sh.
2022-10-18 15:18:13 +02:00
Petr Špaček
6a7ec0c01c Build gcc:oraclelinux9:amd64 CI jobs with --disable-developer
Purpose of this is to guard against tests which rely on querytrace or
other optional features enabled by --enable-developer switch.

(cherry picked from commit d6db5c5335)
2022-10-18 15:16:16 +02:00
Ondřej Surý
b3cb637a67 Merge branch 'ondrej-add-ISC_LIST,LINK_INITIALIZER-v9_16' into 'v9_16'
Add ISC_{LIST,LINK}_INITIALIZER for designated initializers

See merge request isc-projects/bind9!6935
2022-10-18 13:15:29 +00:00
Ondřej Surý
7b4cf67261 Replace (void *)-1 with ISC_LINK_TOMBSTONE
Instead of having "arbitrary" (void *)-1 to define non-linked, add a
ISC_LINK_TOMBSTONE(type) macro that replaces the "magic" value with a
define.

(cherry picked from commit 5e20c2ccfb)
2022-10-18 14:30:49 +02:00
Ondřej Surý
a317b2ea1c Add ISC_{LIST,LINK}_INITIALIZER for designated initializers
Since we are using designated initializers, we were missing initializers
for ISC_LIST and ISC_LINK, add them, so you can do

    *foo = (foo_t){ .list = ISC_LIST_INITIALIZER };

Instead of:

    *foo = (foo_t){ 0 };
    ISC_LIST_INIT(foo->list);

(cherry picked from commit cb3c36b8bf)
2022-10-18 14:30:49 +02:00
Arаm Sаrgsyаn
3c34c54b6c Merge branch '3584-ns_statscounter_recursclients-bug-v9_16' into 'v9_16'
[v9_16] Fix ns_statscounter_recursclients counting bug

See merge request isc-projects/bind9!6929
2022-10-18 11:26:10 +00:00
Aram Sargsyan
8dbdf6bc1b Add a release note for [GL #3584]
(cherry picked from commit d83642b3ac)
2022-10-18 10:38:04 +00:00
Aram Sargsyan
f82f78d7f6 Add a CHANGES note for [GL #3584]
(cherry picked from commit 5b1ef41897)
2022-10-18 10:38:04 +00:00
Aram Sargsyan
b6aeccf697 Fix ns_statscounter_recursclients counting bug
The incrementing and decrementing of 'ns_statscounter_recursclients'
were not properly balanced: for example, it would be incremented for
a prefetch query but not decremented if the query failed.

This commit ensures that the recursion quota and the recursive clients
counter are always in sync with each other.

(cherry picked from commit 82991451b4)
2022-10-18 10:38:04 +00:00
Michal Nowak
b4158582fe Merge branch 'mnowak/grep-warnings-fix-ci-check' into 'v9_16'
Check systests.output for Grep warnings

See merge request isc-projects/bind9!6923
2022-10-18 09:20:31 +00:00
Michal Nowak
18b639c222 Check systests.output for Grep warnings
The v9_16 branch does not have "*.log" system test artifact BIND 9.18+
has and systests.output file needs to be checked for Grep warnings
instead.
2022-10-18 11:12:47 +02:00
Petr Špaček
816148bbce Merge branch 'pspacek/doc-nsupdate-server-gsstsig-v9_16' into 'v9_16'
Document that nsupdate ignores server command in GSS-TSIG mode [v9_16]

See merge request isc-projects/bind9!6926
2022-10-18 08:23:06 +00:00
Petr Špaček
b7cae87b2b Document that nsupdate ignores server command in GSS-TSIG mode
This behavior is present since introduction of GSS-TSIG support,
commit 289ae548d5.

(cherry picked from commit c8a38d70f0)
2022-10-18 10:14:54 +02:00
Arаm Sаrgsyаn
8a6b239000 Merge branch 'aram/cfg_print_duration-uninitialized-length-v9_16' into 'v9_16'
[v9_16] Fix a logical bug in cfg_print_duration()

See merge request isc-projects/bind9!6921
2022-10-17 12:02:03 +00:00
Aram Sargsyan
790db0a344 Handle large numbers when parsing/printing a duration
The duration_fromtext() function is truncating large numbers
to 32 bits instead of capping or rejecting them, i.e. 64424509445,
which is 0xf00000005, gets parsed as 32-bit value 5 (0x00000005).

Fail parsing a duration if any of its components is bigger than
32 bits. Using those kind of big numbers has no practical use case
for a duration.

The cfg_obj_asduration() function can overflow the 32 bit
seconds variable when calculating the duration from its component
parts.

To avoid that, use 64-bit calculation and return UINT32_MAX if the
calculated value is bigger than UINT32_MAX. Again, a number this big
has no practical use case anyway.

The buffer for the generated duration string is limited to 64 bytes,
which, in theory, is smaller than the longest possible generated
duration string.

Use 80 bytes instead, calculated by the '7 x (10 + 1) + 3' formula,
where '7' is the count of the duration's parts (year, month, etc.), '10'
is their maximum length when printed as a decimal number, '1' is their
indicator character (Y, M, etc.), and 3 is two more indicators (P and T)
and the terminating NUL character.

(cherry picked from commit fddaebb285)
2022-10-17 11:09:06 +00:00
Aram Sargsyan
12560d1736 Add a CHANGES note for [GL !6880]
(cherry picked from commit 190aab84d7)
2022-10-17 11:09:06 +00:00
Aram Sargsyan
d9a8c43107 Fix an off-by-one error in cfg_print_duration()
The cfg_print_duration() checks added previously in the 'duration_test'
unit test uncovered a bug in cfg_print_duration().

When calculating the current 'str' pointer of the generated text in the
buffer 'buf', it erroneously adds 1 byte to compensate for that part's
indicator character. For example, to add 12 minutes, it needs to add
2 + 1 = 3 characters, where 2 is the length of "12", and 1 is the length
of "M" (for minute). The mistake was that the length of the indicator
is already included in 'durationlen[i]', so there is no need to
calculate it again.

In the result of this mistake the current pointer can advance further
than needed and end up after the zero-byte instead of right on it, which
essentially cuts off any further generated text. For example, for a
5 minutes and 30 seconds duration, instead of having this:

    'P', 'T', '5', 'M', '3', '0', 'S', '\0'

The function generates this:

    'P', 'T', '5', 'M', '\0', '3', '0', 'S', '\0'

Fix the bug by adding to 'str' just 'durationlen[i]' instead of
'durationlen[i] + 1'.

(cherry picked from commit dc55f1ebb9)
2022-10-17 11:09:06 +00:00
Aram Sargsyan
b7c5e95d6d Test cfg_print_duration() in duration_test.c
Currently the 'duration_test' unit test checks only the
cfg_obj_asduration() function.

Extend the test so it checks also the reverse operation using the
cfg_print_duration() function, which is used in named-checkconf.

(cherry picked from commit 39290bb7cd)
2022-10-17 11:09:06 +00:00
Aram Sargsyan
f458f6496d Fix a logical bug in cfg_print_duration()
The cfg_print_duration() function prints a ISO 8601 duration value
converted from an array of integers, where the parts of the date and
time are stored.

durationlen[6], which holds the "seconds" part of the duration, has
a special case in cfg_print_duration() to ensure that when there are
no values in the duration, the result still can be printed as "PT0S",
instead of just "P", so it can be a valid ISO 8601 duration value.

There is a logical error in one of the two special case code paths,
when it checks that no value from the "date" part is defined, and no
"hour" or "minute" from the "time" part are defined.

Because of the error, durationlen[6] can be used uninitialized, in
which case the second parameter passed to snprintf() (which is the
maximum allowed length) can contain a garbage value.

This can not be exploited because the buffer is still big enough to
hold the maximum possible amount of characters generated by the "%u%c"
format string.

Fix the logical bug, and initialize the 'durationlen' array to zeros
to be a little safer from other similar errors.

(cherry picked from commit 9440910187)
2022-10-17 09:17:56 +00:00
Ondřej Surý
cda3b93232 Merge branch 'mnowak/fix-grep-3.8-warnings-v9_16' into 'v9_16'
Fix GNU Grep 3.8 warnings [v9_16]

See merge request isc-projects/bind9!6919
2022-10-17 07:39:47 +00:00
Michal Nowak
e0625baf3f Add CI check for Grep warnings
(cherry picked from commit 759e8a6671)
2022-10-17 09:12:51 +02:00
Michal Nowak
4be4deb740 Replace fgrep and egrep with grep -F/-E
GNU Grep 3.8 reports the following warnings:

    egrep: warning: egrep is obsolescent; using grep -E
    fgrep: warning: fgrep is obsolescent; using grep -F

(cherry picked from commit 212c4de043)
2022-10-17 09:12:02 +02:00
Michal Nowak
52b86104ca Remove stray backslashes
GNU Grep 3.8 reports several instances of stray backslashes in matching
patterns:

    grep: warning: stray \ before /
    grep: warning: stray \ before :

(cherry picked from commit 65e91ef5e6)
2022-10-17 09:11:20 +02:00
Tom Krizek
d3b8050793 Merge branch 'tkrizek/remove-system-test-delzone-v9_16' into 'v9_16'
Remove system test delzone [v9_16]

See merge request isc-projects/bind9!6912
2022-10-14 16:26:23 +00:00
Tom Krizek
2637043f01 Remove system test delzone
There are multiple reasons to remove this test as obsolete:

- The test may not possibly work for over 2.5 years, since
  98b3b93791 removed the rndc.py python
  tool on which this test relies.
- It isn't part of the test suite either in CI or locally unless it is
  explicitly enabled. As a result, there are many issues which prevent
  the test from being executed caused by various refactoring efforts
  accumulated over time.
- Even if the test could be executed, it has no clear failure condition.
  If the python script(s) fail, the test still passes.

(cherry picked from commit 05180154d9)
2022-10-14 16:48:38 +02:00
Michał Kępień
042c33a381 Merge branch '3592-fix-startup-detection-after-restart-in-start.pl-v9_16' into 'v9_16'
[v9_16] Fix startup detection after restart in start.pl

See merge request isc-projects/bind9!6891
2022-10-11 10:27:43 +00:00
Michał Kępień
e535dc2b59 Fix startup detection after restart in start.pl
The bin/tests/system/start.pl script waits until a "running" message is
logged by a given name server instance before attempting to send a
version.bind/CH/TXT query to it.  The idea behind this was to make the
script wait until named loads all the zones it is configured to serve
before telling the system test framework that a given server is ready to
use; this prevents the need to add boilerplate code that waits for a
specific zone to be loaded to each test expecting that.

The problem is that when it looks for "running" messages, the
bin/tests/system/start.pl script assumes that the existence of any such
message in the named.run file indicates that a given named instance has
already finished loading all zones.  Meanwhile, some system tests
restart all the named instances they use throughout their lifetime (some
even do that a few times), for example to run Python-based tests.  The
bin/tests/system/start.pl script handles such a scenario incorrectly: as
soon as it finds any "running" message in the named.run file it inspects
and it gets a response to a version.bind/CH/TXT query, it tells the
system test framework that a given server is ready to use, which might
not be true - it is possible that only the "version.bind" zone is loaded
at that point and the "running" message found was logged by a
previously-shutdown named instance. This triggers intermittent failures
for Python-based tests.

Fix by improving the logic that the bin/tests/system/start.pl script
uses to detect server startup: check how many "running" lines are
present in a given named.run file before attempting to start a named
instance and only proceed with version.bind/CH/TXT queries when the
number of "running" lines found in that named.run file increases after
the server is started.

(cherry picked from commit 18e20f95f6)
2022-10-11 11:59:02 +02:00
Michał Kępień
c11f286d34 Do not truncate ns2 logs in the "rrsetorder" test
In the "rrsetorder" system test, the ns2 named instance is restarted
without passing the --restart option to bin/tests/system/start.pl.  This
causes the log file for that named instance to be needlessly truncated.
Prevent this from happening by restarting the affected named instance
in the same way as all the other named instances used in system tests.

(cherry picked from commit 9146b956ae)
2022-10-11 11:59:02 +02:00
Michał Kępień
5e926b444d Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.16.35' into 'v9_16'
Set up version and release notes for BIND 9.16.35

See merge request isc-projects/bind9!6886
2022-10-10 21:36:43 +00:00
Michał Kępień
aa85812c26 Set up release notes for BIND 9.16.35 2022-10-10 23:20:13 +02:00
Michał Kępień
6263e04544 Update BIND version to 9.16.35-dev 2022-10-10 23:20:13 +02:00
Petr Špaček
6e3ca66116 Merge branch '3554-improve-dnssec-policy-inline-signing-err-msg-v9_16' into 'v9_16'
Clarify new configuration incompabitility: dnssec-policy vs. inline-signing [v9_16]

See merge request isc-projects/bind9!6872
2022-10-06 08:55:44 +00:00
Petr Špaček
21c58497e2 Add Known Issue about config incompatibility
(cherry picked from commit 5589d0a49c)

Adapted for v9_16 branch: Removed hyperlinks, removed note about 9.18.
2022-10-06 10:32:52 +02:00
Petr Špaček
d63bc6af08 Clarify error message about missing inline-signing & dnssec-policy
(cherry picked from commit 058c1744ba)
2022-10-06 10:31:15 +02:00
Mark Andrews
1920c3d073 Merge branch '3577-reloads-in-ixfr-system-test-happen-too-fast-v9_16' into 'v9_16'
Add sleeps to ixfr system test [v9_16]

See merge request isc-projects/bind9!6870
2022-10-05 22:04:04 +00:00
Mark Andrews
03d363d0ee Add sleeps to ixfr system test
ensure that at least a second has passed since a zone was last loaded
to prevent it accidentally being skipped as up to date.

(cherry picked from commit 491a8cfe96)
2022-10-06 08:36:38 +11:00
Michal Nowak
2227974961 Merge branch 'mnowak/drop-flake8-ignore-lists-v9_16' into 'v9_16'
[v9_16] Drop flake8 ignore lists

See merge request isc-projects/bind9!6868
2022-10-05 16:40:05 +00:00
Michal Nowak
9f27c3f95e Drop flake8 ignore lists
flake8 is not used in BIND 9 CI and inline ignore lists are not needed
anymore.

(cherry picked from commit f5d9fa6ea4)
2022-10-05 18:33:34 +02:00
Petr Špaček
4fab54454d Merge branch 'pspacek/tsan-ci-artifacts-fix-v9_16' into 'v9_16'
Fix TSAN artifact gathering in CI [v9_16]

See merge request isc-projects/bind9!6859
2022-10-05 08:20:31 +00:00
Petr Špaček
815f89dbf9 Fix TSAN artifact gathering in CI
Fixup for 2c3b2dabe9.

We forgot to update TSAN paths when moving all the unit tests to
/tests/.  Let's remove paths from find to make it less dependent on
exact location, and store all untracked files as we do in the normal
unit test template.

Related: !6243

(cherry picked from commit 9559eb3b21)
Adapted for v9_16 branch.
2022-10-05 09:50:54 +02:00
Evan Hunt
5770858152 Merge branch '3493-clear-httpd-buffer-v9_16' into 'v9_16'
compression buffer was not cleared properly

See merge request isc-projects/bind9!6854
2022-10-05 06:06:49 +00:00
Evan Hunt
7b6140e756 compression buffer was not cleared properly
clear the compression buffer before use. this eliminates the
possibility of a latent bug that, when combined with other changes,
allowed an overread in a later version of BIND.
2022-10-04 10:12:24 -07:00
Mark Andrews
59230bb58f Merge branch '3544-add-dohpath-parsing-to-svbc-v9_16' into 'v9_16'
Add support for 'dohpath' to SVCB (and HTTPS) [v9_16]

See merge request isc-projects/bind9!6850
2022-10-04 06:24:57 +00:00
Mark Andrews
9bb5157adf Use strnstr implementation from FreeBSD if not provided by OS
(cherry picked from commit 5f07fe8cbb)
2022-10-04 17:05:18 +11:00
Mark Andrews
5568aca5a5 Add release note for [GL #3544]
(cherry picked from commit 2f3441b40a)
2022-10-04 15:34:10 +11:00
Mark Andrews
14f4dadfe5 Add CHANGES note for [GL #3544]
(cherry picked from commit 335b397e15)
2022-10-04 15:34:08 +11:00
Mark Andrews
e396d5d72d Add support for 'dohpath' to SVCB (and HTTPS)
dohpath is specfied in draft-ietf-add-svcb-dns and has a value
of 7.  It must be a relative path (start with a /), be encoded
as UTF8 and contain the variable dns ({?dns}).

(cherry picked from commit 6d561d3886)
2022-10-04 15:33:49 +11:00
Michal Nowak
120077bcc2 Merge branch 'mnowak/add-oracle-linux-9-v9_16' into 'v9_16'
[v9_16] Add Oracle Linux 9

See merge request isc-projects/bind9!6808
2022-10-03 13:17:57 +00:00
Michal Nowak
7ae22392da Add Oracle Linux 9
(cherry picked from commit be08cf41d9)
2022-10-03 13:28:26 +02:00
Mark Andrews
47e8a98240 keymgr: use DEFAULT_ALGORITHM instead of {nsec3}rsasha1 2022-10-03 13:28:26 +02:00