2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00
Commit Graph

34964 Commits

Author SHA1 Message Date
Mark Andrews
4202554871 Add tests for {krb5,ms}-subdomain-self-rhs update policy rules
check that updates are accepted and rejected as expected under the
following scenarios:

* check krb5-subdomain-self-rhs match PTR
* check krb5-subdomain-self-rhs no-match PTR
* check krb5-subdomain-self-rhs match SRV
* check krb5-subdomain-self-rhs no listed types match (SRV & TXT)
* check krb5-subdomain-self-rhs no-match RDATA (SRV)
* check krb5-subdomain-self-rhs no-match TYPE (TXT)
* check krb5-subdomain-self-rhs delete PTR (matching PTR)
* check krb5-subdomain-self-rhs delete PTR (matching PTR with non-matching
  PTR)
* check krb5-subdomain-self-rhs delete ANY (matching PTR)
* check krb5-subdomain-self-rhs delete ANY (matching PTR with non-matching
  PTR)
* check krb5-subdomain-self-rhs delete SRV (matching SRV)
* check krb5-subdomain-self-rhs delete SRV (matching SRV with non-matching
  SRV)
* check krb5-subdomain-self-rhs delete ANY (matching SRV)
* check krb5-subdomain-self-rhs delete ANY (matching SRV with non-matching
  SRV)

* check ms-subdomain-self-rhs match (PTR)
* check ms-subdomain-self-rhs no-match (PTR)
* check ms-subdomain-self-rhs match (SRV)
* check ms-subdomain-self-rhs no-match (SRV)
* check ms-subdomain-self-rhs delete SRV (matching SRV)
* check ms-subdomain-self-rhs delete SRV (matching SRV with non-matching
  SRV)
* check ms-subdomain-self-rhs delete PTR (matching PTR)
* check ms-subdomain-self-rhs delete PTR (matching PTR with non-matching
  PTR)
* check ms-subdomain-self-rhs delete ANY (matching PTR)
* check ms-subdomain-self-rhs delete ANY (matching PTR with non-matching
  PTR)
* check ms-subdomain-self-rhs delete ANY (matching SRV)
* check ms-subdomain-self-rhs delete ANY (matching SRV with non-matching
  SRV)
2021-10-15 11:30:51 +11:00
Mark Andrews
93279bb4b3 Add {krb5,ms}-subdomain-self-rhs update policy rules
The new rules compare the target name in PTR and SRV records against
the machine name embedded in the kerberos principal.  This can be
used to further restrict what PTR and SRV records can be added or
deleted via dynamic updates if desired.
2021-10-15 11:18:41 +11:00
Ondřej Surý
d10968936b Merge branch 'ondrej/use-system-ephemeral-ports-in-dispatch' into 'main'
Use system ephemeral ports for default portset

See merge request isc-projects/bind9!5457
2021-10-14 16:21:31 +00:00
Ondřej Surý
6cd548db0b Use system ephemeral ports for default portset
In dispatch, use system ephemeral ports for default portset instead of
hardcoded <1024,65535> range.
2021-10-14 18:20:08 +02:00
Ondřej Surý
e3ac2bd081 Merge branch '2952-remove-manual-branch-prediction-using-__builtin_expect' into 'main'
Stop providing branch prediction information

Closes #2952

See merge request isc-projects/bind9!5496
2021-10-14 13:25:36 +00:00
Ondřej Surý
3f8071af5f Add CHANGES note for [GL #2952] 2021-10-14 15:22:57 +02:00
Ondřej Surý
8be27b308f Remove unused LIBRPZ_(UN)LIKELY macros
The librpz.h defined LIRPZ_LIKELY() and LIBRPZ_UNLIKELY() macros that
were actually unused in the code.  Remove the macros and the autoconf
check for __builtin_expect().
2021-10-14 15:22:57 +02:00
Ondřej Surý
e603983ec9 Stop providing branch prediction information
The __builtin_expect() can be used to provide the compiler with branch
prediction information.  The Gcc manual says[1] on the subject:

    In general, you should prefer to use actual profile feedback for
    this (-fprofile-arcs), as programmers are notoriously bad at
    predicting how their programs actually perform.

Stop using __builtin_expect() and ISC_LIKELY() and ISC_UNLIKELY() macros
to provide the branch prediction information as the performance testing
shows that named performs better when the __builtin_expect() is not
being used.

1. https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fexpect
2021-10-14 10:33:24 +02:00
Mark Andrews
80fedf9231 Merge branch '2326-some-of-the-statschannel-system-test-cases-fail-if-i-build-bind-9-16-9' into 'main'
Resolve "Some of the statschannel system test cases fail if I build BIND 9.16.9"

Closes #2326

See merge request isc-projects/bind9!5424
2021-10-14 06:27:23 +00:00
Mark Andrews
10c01cba61 Don't tests stats channels that haven't been configured
pytest was failing because it was testing features that had
not been configured.  test to see if those features have been
configured before running the tests.
2021-10-13 22:30:45 -07:00
Evan Hunt
ee068e2c39 Merge branch 'each-silence-coverity' into 'main'
silence dead code warning from coverity

See merge request isc-projects/bind9!5494
2021-10-13 16:52:20 +00:00
Evan Hunt
4595536a0d Remove dead code
Remove code from dns_zone_setparentals() that cannot be reached
now that set_serverslist() returns void.
2021-10-13 09:27:46 -07:00
Evan Hunt
068ab04310 Merge branch '828-rewrite-logfileconfig' into 'main'
logfileconfig fixes

Closes #828

See merge request isc-projects/bind9!5411
2021-10-13 16:26:02 +00:00
Evan Hunt
96980adbad CHANGES and release note for [GL #828] 2021-10-13 08:34:36 -07:00
Evan Hunt
9a9e906306 fixed a bug in rolling timestamp logfiles
due to comparing logfile suffixes as 32 bit rather than 64 bit
integers, logfiles with timestamp suffixes that should have been
removed when rolling could be left in place. this has been fixed.
2021-10-13 08:31:47 -07:00
Evan Hunt
76baed3343 rewrite logfileconfig system test
the logfileconfig system test did not conform to the style of
other tests, and was difficult to read and maintain. it has
been cleaned up and simplifeid in several ways:

- named.args used when appropriate so that named can be started with
  specified command line arguments, instead of having it launched
  directly from tests.sh
- unused root zone removed from named configuration
- an existing directory used instead of using 'mkdir' to create one
- dnssec-validation disabled to stop the server sending unnecessary queries

incidental fix: removed leftover debugging printfs from logconf.c.
2021-10-13 08:31:47 -07:00
Artem Boldariev
e857191b20 Merge branch '2940-do-not-free-tlsctx-on-socket-creation-failure' into 'main'
Do not call isc_tlsctx_free() on TLS listener creation failure

Closes #2940

See merge request isc-projects/bind9!5478
2021-10-13 15:09:07 +00:00
Artem Boldariev
6bf0183b19 Do not call isc_tlsctx_free() on TLS listener creation failure
This commit removes a superfluous call to isc_tlsctx_free() which was
leading to double free() error in a case of a TLS listener creation
failure.

The call is superfluous because the TLS context object is supposed to
be destroyed in ns_listenelt_destroy() only.
2021-10-13 17:50:42 +03:00
Ondřej Surý
8a22461fc5 Merge branch 'ondrej/use-pragma-once-header-guards' into 'main'
Use #pragma once as header guards

See merge request isc-projects/bind9!5467
2021-10-13 11:13:57 +00:00
Evan Hunt
31825521b0 Use "pragma once" in automatically generated header files
Files created by gen.c were still using old-style include guards.
2021-10-13 12:44:05 +02:00
Ondřej Surý
2fe5541cb2 Add missing .clang-format in the named headers directory
The .clang-format was missing in bin/named/include/named, add the
symlink to .clang-format.headers to match the rest of the source tree.
2021-10-13 12:43:58 +02:00
Ondřej Surý
f3635bcc14 Use #pragma once as header guards
Unify the header guard style and replace the inconsistent include guards
with #pragma once.

The #pragma once is widely and very well supported in all compilers that
BIND 9 supports, and #pragma once was already in use in several new or
refactored headers.

Using simpler method will also allow us to automate header guard checks
as this is simpler to programatically check.

For reference, here are the reasons for the change taken from
Wikipedia[1]:

> In the C and C++ programming languages, #pragma once is a non-standard
> but widely supported preprocessor directive designed to cause the
> current source file to be included only once in a single compilation.
>
> Thus, #pragma once serves the same purpose as include guards, but with
> several advantages, including: less code, avoidance of name clashes,
> and sometimes improvement in compilation speed. On the other hand,
> #pragma once is not necessarily available in all compilers and its
> implementation is tricky and might not always be reliable.

1. https://en.wikipedia.org/wiki/Pragma_once
2021-10-13 00:49:15 -07:00
Ondřej Surý
46fc798e66 Merge branch '1432-dns_name_dup-post-cleanup' into 'main'
Return void when ISC_R_SUCCESS is only returned value

Closes #1432

See merge request isc-projects/bind9!5471
2021-10-13 04:19:46 +00:00
Ondřej Surý
edfae82c82 dns/resolver.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_zone_setprimaries()
 * dns_zone_setparentals()
 * dns_zone_setparentals()
 * dns_zone_setalsonotify()
2021-10-13 05:48:51 +02:00
Ondřej Surý
f51a9d834c dns/view.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_view_adddelegationonly()
 * dns_view_excludedelegationonly()
2021-10-13 05:47:48 +02:00
Ondřej Surý
8fb4c5bb7a dns/ssu.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_ssutable_addrule()
 * dns_ssutable_create()
 * dns_ssutable_createdlz()
2021-10-13 05:47:48 +02:00
Ondřej Surý
ecb74bae0d dns/resolver.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_resolver_addalternate()
2021-10-13 05:47:48 +02:00
Ondřej Surý
b0a665d947 dns/rdata.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * name_duporclone()
2021-10-13 05:47:48 +02:00
Ondřej Surý
ffd09ec5f0 dns/lookup.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * build_event()
2021-10-13 05:47:48 +02:00
Ondřej Surý
ee735ba79d dns/catz.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_catz_options_copy()
 * dns_catz_options_setdefault()
 * dns_catz_entry_new()
 * dns_catz_entry_copy()
2021-10-13 05:47:48 +02:00
Mark Andrews
e12240150d Merge branch '2905-autoconf-check-for-struct-stat-pulls-in-fcntl-h-not-stat-h' into 'main'
Resolve "autoconf check for struct stat pulls in fcntl.h not stat.h"

Closes #2905

See merge request isc-projects/bind9!5426
2021-10-13 00:21:40 +00:00
Mark Andrews
c177c33c27 Use '#include <sys/stat.h>' for the stat structure definition
POSIX.1-2008 changed the st_atim, st_mtim, and st_ctime members of the
struct stat from time_t to struct timespec and because not all operating
systems already implemented this version of the standard or historically
deviated to include own nanosecond precision in the structure.

The autoconf script used to include <sys/fcntl.h> which contradicts
POSIX.1 as it mandates <sys/stat.h> inclusion.  Change the autoconf
check to include <sys/stat.h>.

Also fix the missing AC_MSG_RESULT([yes/no]) in the check.
2021-10-12 23:50:07 +00:00
Evan Hunt
33035de1de Merge branch 'each-cleanup-ancient' into 'main'
cleanup references to ancient named.conf options

Closes #357

See merge request isc-projects/bind9!5407
2021-10-12 21:43:34 +00:00
Evan Hunt
69e25f41ae cleanup references to ancient named.conf options
some removed options were still referenced in config.c or the ARM.
2021-10-12 14:01:57 -07:00
Evan Hunt
c7a51d24f6 Merge branch '2929-remove-master-slave-keywords' into 'main'
Replace "master/slave" terminology

Closes #2929

See merge request isc-projects/bind9!5466
2021-10-12 20:55:53 +00:00
Matthijs Mekking
d109e4d953 Remove unused bin/tests/named.conf
This file serves no useful purpose anymore and can thus be removed.
2021-10-12 13:12:34 -07:00
Matthijs Mekking
2af05beafa Replace "master/slave" terms in code
Replace some "master/slave" terminology in the code with the preferred
"primary/secondary" keywords. This also changes user output such as
log messages, and fixes a typo ("seconary") in cfg_test.c.

There are still some references to "master" and "slave" for various
reasons:

- The old syntax can still be used as a synonym.
- The master syntax is kept when it refers to master files and formats.
- This commit replaces mainly keywords that are local. If "master" or
  "slave" is used in for example a structure that is all over the
  place, it is considered out of scope for the moment.
2021-10-12 13:11:13 -07:00
Matthijs Mekking
af17ca9704 Replace "master/slave" terms in documentation
Replace those terms with the preferred "primary/secondary" keywords.
2021-10-12 13:09:04 -07:00
Matthijs Mekking
71b92d4d19 Replace "master/slave" terms in code comments
Replace those terms with the preferred "primary/secondary" keywords.
2021-10-12 13:09:00 -07:00
Matthijs Mekking
f3d3a4ff6e Replace "master/slave" terminology in tests
Replace most "master/slave" terminology in tests with the preferred
"primary/secondary", with the following exceptions:

- When testing the old syntax
- When master is used in master file and master file format terms
- When master is used in hostmaster or postmaster terms
- When master used in legacy domain names (for example in dig.batch)
- When there is no replacement (for example default-masters)
2021-10-12 13:04:00 -07:00
Ondřej Surý
570554149f Merge branch '2941-implement-incremental-hashing-resize' into 'main'
Implement incremental hash table resizing

Closes #2941

See merge request isc-projects/bind9!5476
2021-10-12 14:35:37 +00:00
Ondřej Surý
89c41fbd03 Add CHANGES and release note for [GL #2941] 2021-10-12 15:08:23 +02:00
Ondřej Surý
8c819ec366 dns/rbt.c: Implement incremental hash table resizing
Originally, the hash table used in RBT database would be resized when it
reached certain number of elements (defined by overcommit).  This was
causing resolution brownouts for busy resolvers, because the rehashing
could take several seconds to complete.  This was mitigated by
pre-allocating the hash table in the RBT database used for caching to be
large-enough as determined by max-cache-size.  The downside of this
solution was that the pre-allocated hash table could take a significant
chunk of the memory even when the resolver cache would be otherwise
empty because the default value for max-cache-size is 90% of available
memory.

Implement incremental resizing[1] to perform the rehashing gradually:

 1. During the resize, allocate the new hash table, but keep the old
    table unchanged.
 2. In each lookup or delete operation, check both tables.
 3. Perform insertion operations only in the new table.
 4. At each insertion also move r elements from the old table to the new
    table.
 5. When all elements are removed from the old table, deallocate it.

To ensure that the old table is completely copied over before the new
table itself needs to be enlarged, it is necessary to increase the
size of the table by a factor of at least (r + 1)/r during resizing.

In our implementation r is equal to 1.

The downside of this approach is that the old table and the new table
could stay in memory for longer when there are no new insertions into
the hash table for prolonged periods of time as the incremental
rehashing happens only during the insertions.

The upside of this approach is that it's no longer necessary to
pre-allocate large hash table, because the RBT hash table rehashing
doesn't cause resolution brownouts anymore and thus we can use the
memory as needed.

1. https://en.m.wikipedia.org/wiki/Hash_table#Dynamic_resizing
2021-10-12 15:01:53 +02:00
Matthijs Mekking
0590d71977 Merge branch '1316-toggle-the-default-of-dnssec-dnskey-kskonly-to-yes' into 'main'
Change default of dnssec-dnskey-kskonly to yes

Closes #1316

See merge request isc-projects/bind9!5472
2021-10-12 12:38:16 +00:00
Matthijs Mekking
0870d666dc Add CHANGES and release note for [GL #1316] 2021-10-12 13:46:29 +02:00
Matthijs Mekking
2abad4d969 Change default of dnssec-dnskey-kskonly to yes
The extra RRSIG on DNSKEY, CDS and CDNSKEY RRsets add to the payload,
without having added value.
2021-10-12 13:45:44 +02:00
Ondřej Surý
bfabf5489e Merge branch '1610-enable-UseSTD3ASCIIRules-in-idn2' into 'main'
Enable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions

Closes #1610

See merge request isc-projects/bind9!5464
2021-10-12 11:05:19 +00:00
Ondřej Surý
092200bffd Add CHANGES and release note for [GL #1610] 2021-10-12 12:13:33 +02:00
Matthijs Mekking
f275d42a02 Correct --with-idn references to --with-libidn2
The documentation and feature-test were using '--with-idn' but the
configure script doesn't recognize this option. The correct option to
enable IDN support is '--with-libidn2'.
2021-10-12 12:13:33 +02:00
Ondřej Surý
08008c4409 Add idna test for UseSTD3ASCIIRules=true
Add test to encode unicode sequence that encodes differently with
UseSTD3ASCIIRules=false which is default with idn2 >= 2.0.3 and
UseSTD3ASCIIRules=true which is what should be used to encode hostnames
and domains.
2021-10-12 12:11:52 +02:00