2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

55 Commits

Author SHA1 Message Date
Ondřej Surý
5777c44ad0 Reformat using the new rules 2020-02-14 09:31:05 +01:00
Evan Hunt
e851ed0bb5 apply the modified style 2020-02-13 15:05:06 -08:00
Ondřej Surý
056e133c4c Use clang-tidy to add curly braces around one-line statements
The command used to reformat the files in this commit was:

./util/run-clang-tidy \
	-clang-tidy-binary clang-tidy-11
	-clang-apply-replacements-binary clang-apply-replacements-11 \
	-checks=-*,readability-braces-around-statements \
	-j 9 \
	-fix \
	-format \
	-style=file \
	-quiet
clang-format -i --style=format $(git ls-files '*.c' '*.h')
uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h')
clang-format -i --style=format $(git ls-files '*.c' '*.h')
2020-02-13 22:07:21 +01:00
Ondřej Surý
f50b1e0685 Use clang-format to reformat the source files 2020-02-12 15:04:17 +01:00
Ondřej Surý
bc1d4c9cb4 Clear the pointer to destroyed object early using the semantic patch
Also disable the semantic patch as the code needs tweaks here and there because
some destroy functions might not destroy the object and return early if the
object is still in use.
2020-02-09 18:00:17 -08:00
Mark Andrews
a038f77d92 'buffer' must be non-NULL as isc_buffer_allocate can no longer fail.
1636 cleanup:

CID 1458130 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking buffer suggests that it may be
null, but it has already been dereferenced on all paths leading to
the check.

1637        if (buffer != NULL)
1638                isc_buffer_free(&buffer);
2020-02-05 18:37:17 +11:00
Evan Hunt
dba0163dac Correctly handle catalog zone entries containing slashes
- Add quotes before and after zone name when generating "addzone"
  input so avoid "unexpected token" errors.
- Use a hex digest for zone filenames when the zone or view name
  contains a slash.
- Test with a domain name containing a slash.
- Incidentally added 'catzhash.py' to contrib/scripts to generate
  hash labels for catalog zones, as it was needed to write the test.
2020-02-03 16:08:20 -08:00
Ondřej Surý
c73e5866c4 Refactor the isc_buffer_allocate() usage using the semantic patch
The isc_buffer_allocate() function now cannot fail with ISC_R_MEMORY.
This commit removes all the checks on the return code using the semantic
patch from previous commit, as isc_buffer_allocate() now returns void.
2020-02-03 08:29:00 +01:00
Ondřej Surý
edd97cddc1 Refactor dns_name_dup() usage using the semantic patch 2019-11-29 14:00:37 +01:00
Ondřej Surý
ae83801e2b Remove blocks checking whether isc_mem_get() failed using the coccinelle 2019-07-23 15:32:35 -04:00
Ondřej Surý
78d0cb0a7d Use coccinelle to remove explicit '#include <config.h>' from the source files 2019-03-08 15:15:05 +01:00
Mark Andrews
9a9dc4072f declarations before assertions 2019-02-18 17:40:56 -05:00
Mark Andrews
a487473fc5 add missing DBC checks for catz and add isc_magic checks; add DBC checks to ht.c 2018-11-29 12:39:20 +11:00
Mark Andrews
0708e43d3f update zname with the current zone anme 2018-11-28 15:59:30 +11:00
Witold Kręcicki
929ea7c2c4 - Make isc_mutex_destroy return void
- Make isc_mutexblock_init/destroy return void
- Minor cleanups
2018-11-22 11:52:08 +00:00
Ondřej Surý
2f3eee5a4f isc_mutex_init returns 'void' 2018-11-22 11:51:49 +00:00
Ondřej Surý
c1d111cd2e Destroy task first when destroying catzs.
When freeing catzs structures we need to kill the updater task first.
    Otherwise we might race with the updater and there might be a crash
    on shutdown.
2018-10-30 14:01:01 +01:00
Ondřej Surý
7fd3dc63de Add generic message digest API (isc_md) to replace specific MD functions md5/sha1/sha256 2018-10-25 08:15:42 +02:00
Ondřej Surý
0f24c55d38 Refactor *_destroy and *_detach functions to unified order of actions.
This properly orders clearing the freed pointer and calling isc_refcount_destroy
as early as possible to have ability to put proper memory barrier when cleaning
up reference counting.
2018-08-28 13:15:59 +02:00
Ondřej Surý
bef8ac5bae Rewrite isc_refcount API to fetch_and_<op>, instead of former <op>_and_<fetch> 2018-08-28 12:15:39 +02:00
Ondřej Surý
0a7535ac81 isc_refcount_init() now doesn't return isc_result_t and asserts on failed initialization 2018-08-28 12:15:39 +02:00
Ondřej Surý
994e656977 Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
Ondřej Surý
cb6a185c69 Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
Michał Kępień
4df4a8e731 Use dns_fixedname_initname() where possible
Replace dns_fixedname_init() calls followed by dns_fixedname_name()
calls with calls to dns_fixedname_initname() where it is possible
without affecting current behavior and/or performance.

This patch was mostly prepared using Coccinelle and the following
semantic patch:

    @@
    expression fixedname, name;
    @@
    -	dns_fixedname_init(&fixedname);
    	...
    -	name = dns_fixedname_name(&fixedname);
    +	name = dns_fixedname_initname(&fixedname);

The resulting set of changes was then manually reviewed to exclude false
positives and apply minor tweaks.

It is likely that more occurrences of this pattern can be refactored in
an identical way.  This commit only takes care of the low-hanging fruit.
2018-04-09 12:14:16 +02:00
Evan Hunt
ab0fe63f07 minor cleanup and addressed a sprintf format warning 2018-02-24 17:56:17 -08:00
Ondřej Surý
843d389661 Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
Mark Andrews
b1b9257c8f test for >= 0 and use %d instead of %u 2018-02-16 10:20:38 +11:00
Mark Andrews
fdd8838bf9 4869. [bug] Address some cases where NULL with zero length could
be passed to memmove which is undefined behaviour and
                        can lead to bad optimisation. [RT #46888]
2018-01-22 09:36:12 +11:00
Tinderbox User
ed9fea3a6e update copyright notice / whitespace 2018-01-15 23:46:16 +00:00
Michał Kępień
ae51a676c9 [master] Ensure all master definitions in a catalog zone contain an IP address
4864.	[bug]		named acting as a slave for a catalog zone crashed if
			the latter contained a master definition without an IP
			address. [RT #45999]
2018-01-15 20:50:09 +01:00
Mark Andrews
fe79e2efbf 4774. [bug] <isc/util.h> was incorrectly included in several
header files. [RT #46311]
2017-10-19 12:26:32 +11:00
Mark Andrews
f9f3f20d2d 4739. [cleanup] Address clang static analysis warnings. [RT #45952] 2017-09-27 10:27:09 +10:00
Mark Andrews
ff8d856db0 4675. [cleanup] Don't use C++ keyword class. [RT #45726] 2017-08-10 08:42:04 +10:00
Evan Hunt
bd5b0b39e6 [master] add print.h 2017-07-26 01:24:25 -07:00
Michał Kępień
383240d572 [master] Process "port" and "dscp" for "default-masters"
4656.	[bug]		Apply "port" and "dscp" values specified in catalog
			zone's "default-masters" option to the generated
			configuration of its member zones. [RT #45545]
2017-07-26 09:28:28 +02:00
Mark Andrews
abe5cf42b3 4649. [bug] The wrong zone was logged when a catalog zone is added.
[RT #45520]
2017-07-10 10:36:56 +10:00
Tinderbox User
7c655c5b24 update copyright notice / whitespace 2017-07-09 23:45:34 +00:00
Mark Andrews
1e9b39fe26 4648. [bug] "rndc reconfig" on a slave no longer causes all member
zones of configured catalog zones to be removed from
                        configuration. [RT #45310]
2017-07-10 09:06:13 +10:00
Mark Andrews
52e2aab392 4546. [func] Extend the use of const declarations. [RT #43379] 2016-12-30 15:45:08 +11:00
Mark Andrews
4cb2ad343f use explict casts to silence truncation warnings 2016-08-16 12:29:09 +10:00
Tinderbox User
2bc4d454e1 update copyright notice / whitespace 2016-07-21 23:46:03 +00:00
Witold Krecicki
e4d4de075a 4419. [bug] Don't cause undefined result if the label of an
entry in catalog zone is changed. [RT #42708]
2016-07-21 13:08:50 +02:00
Mark Andrews
0c27b3fe77 4401. [misc] Change LICENSE to MPL 2.0. 2016-06-27 14:56:38 +10:00
Mark Andrews
980c504b30 fix null pointer comparisons 2016-06-26 17:23:58 +10:00
Witold Krecicki
4681ab1fc2 4387. [test] Rewritten test suite for catalog zones. [RT #42676]
4386.	[func]		Support for master entries with TSIG keys in catalog
			zones. [RT #42577]
2016-06-22 10:50:09 +02:00
Witold Krecicki
3f06b888ae 4385. [func] Add support for allow-query and allow-transfer ACLs
to catalog zones. [RT #42578]
2016-06-20 13:39:44 +02:00
Francis Dupont
e211ffb1f1 Check isc_timer_reset return 2016-06-04 09:08:48 +02:00
Francis Dupont
aee6412db2 Address CID 1362495: tbuf covered by an INSIST so never NULL 2016-06-04 08:49:10 +02:00
Witold Krecicki
1c1ab955ed Catalog zones: use iterators instead of isc_ht_walk [RT #42529] 2016-05-31 23:01:53 +02:00
Evan Hunt
3d0b7d5cc3 [master] zone-directory option for catalog zones
4380.	[experimental]	Added a "zone-directory" option to "catalog-zones"
			syntax, allowing local masterfiles for slaves
			that are provisioned by catalog zones to be stored
			in a directory other than the server's working
			directory. [RT #42527]
2016-05-31 10:36:27 -07:00