Commit Graph
34762 Commits
Author SHA1 Message Date
Evan Hunt 8e4a1f3483 ensure RPZ lookups handle CD=1 correctly
RPZ rewrites called dns_db_findext() without passing through the
client database options; as as result, if the client set CD=1,
DNS_DBFIND_PENDINGOK was not used as it should have been, and
cache lookups failed, resulting in failure of the rewrite.

(cherry picked from commit 305a50dbe1)
2022-10-19 13:16:51 -07:00
Tom Krizek 8097e97d9b Merge branch 'tkrizek/system-tests-fixes-v9_16' into 'v9_16'
Update various system tests and add them to default test suite [v9_16]

See merge request isc-projects/bind9!6950
2022-10-19 14:59:23 +00:00
Tom Krizek a8f286c9a5 Remove generated controls.conf file from system tests
The controls.conf file shouldn't be used directly without templating it
first. Remove this no longer used hard-coded file to avoid confusion.

(cherry picked from commit cbd0355328)
2022-10-19 16:58:56 +02:00
Tom Krizek 456baa7f4a Revive dupsigs system test
Speed up the test from 20 minutes to 2.5 minutes and make it part of the
default test suite executed in CI.
- decrease number of records to sign from 2000 to 500
- decrease the signing interval by a factor of 6
- shorten the final part of the test after last signing (since nothing
  new happens there)

Finally, clarify misleading comments about (in)sufficient time for zone
re-signing. The time used in the test is in fact sufficient for the
re-signing to happen. If it wasn't, the previous ZSK would end up being
deleted while its signatures would still be present, which is a
situation where duplicate signatures can still happen.

(cherry picked from commit cb0a2ae1dd)
2022-10-19 16:58:56 +02:00
Tom Krizek 84d6484c5a Revive the stress system test
Ensure the port numbers are dynamically filled in with copy_setports.

Clarify test fail condition.

Make the stress test part of the default test suite since it doesn't
seem to run too long or interfere with other tests any more (the
original note claiming so is more than 20 years old).

Related !6883

(cherry picked from commit 7495deea3e)
2022-10-19 16:58:56 +02:00
Tom Krizek 81a224f418 Revive dialup system test
Properly template the port number in config files with copy_setports.

The test takes two minutes on my machine which doesn't seem like a
proper justification to exclude it from the test suite, especially
considering we run these tests in parallel nowadays. The resource usage
doesn't seems significantly increased so it shouldn't interfere with
other system tests.

There also exists a precedent for longer running system tests that are
already part of the default system test suite (e.g. serve-stale takes
almost three minutes on the same machine).

(cherry picked from commit 235ae5f344)
2022-10-19 16:58:55 +02:00
Matthijs Mekking 4c70fd2e21 Merge branch 'matthijs-fix-dnssec-signing-log-lovel-v9_16' into 'v9_16'
[v9_16] Change log level when doing rekey

See merge request isc-projects/bind9!6940
2022-10-19 14:27:58 +00:00
Matthijs Mekking cbdf23e5ec Change log level when doing rekey
This log happens when BIND checks the parental-agents if the DS has
been published. But if you don't have parental-agents set up, the list
of keys to check will be empty and the result will be ISC_R_NOTFOUND.
This is not an error, so change the log level to debug in this case.

(cherry picked from commit a1d57fc8cb)
2022-10-18 16:31:01 +02:00
Petr Špaček a6f9d0c7c4 Merge branch 'pspacek/ci-no-developer-mode-v9_16' into 'v9_16'
Add CI job with --disable-developer [v9_16]

See merge request isc-projects/bind9!6936
2022-10-18 13:48:35 +00:00
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 NowakandOndřej Surý e0625baf3f Add CI check for Grep warnings
(cherry picked from commit 759e8a6671)
2022-10-17 09:12:51 +02:00
Michal NowakandOndřej Surý 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 NowakandOndřej Surý 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