2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 01:59:26 +00:00

343 Commits

Author SHA1 Message Date
Evan Hunt
ba0313e649 fix spelling errors reported by Fossies. 2020-02-21 15:05:08 +11:00
Ondřej Surý
5777c44ad0 Reformat using the new rules 2020-02-14 09:31:05 +01:00
Ondřej Surý
654927c871 Add separate .clang-format files for headers 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ý
36c6105e4f Use coccinelle to add braces to nested single line statement
Both clang-tidy and uncrustify chokes on statement like this:

for (...)
	if (...)
		break;

This commit uses a very simple semantic patch (below) to add braces around such
statements.

Semantic patch used:

@@
statement S;
expression E;
@@

while (...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

for (...;...;...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

if (...)
- if (E) S
+ { if (E) { S } }
2020-02-13 21:58:55 +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ý
de92c24b56 Replace isc_mem_put()+isc_mem_detach() with isc_mem_putanddetach() in contrib/ 2020-02-08 03:12:09 -08:00
Mark Andrews
bf7a99a3c1 'dir_list' must be non NULL, remove test.
707 complete_allnds:

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

708        if (dir_list != NULL) {
709                /* clean up entries from list. */
2020-02-05 18:37:17 +11:00
Mark Andrews
44b08521ef 'tql' must be non NULL, remove test.
255 flag_fail:
256        /* get rid of what was build of the query list */

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

257        if (tql != NULL)
258                destroy_querylist(mctx, &tql);
2020-02-05 18:37:17 +11:00
Mark Andrews
d64921848d cleanup error handling.
336 cleanup_mem:
337        /* cleanup memory */
338
339        /* free tmpPath memory */

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

340        if (tmpPath != NULL && result != ISC_R_SUCCESS)
341                isc_mem_free(named_g_mctx, tmpPath);
342
343        /* free tmpPath memory */
344        return (result);
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ý
288f5a4b52 Various little fixes found by coccinelle
The coccinellery repository provides many little semantic patches to fix common
problems in the code.  The number of semantic patches in the coccinellery
repository is high and most of the semantic patches apply only for Linux, so it
doesn't make sense to run them on regular basis as the processing takes a lot of
time.

The list of issue found in BIND 9, by no means complete, includes:

- double assignment to a variable
- `continue` at the end of the loop
- double checks for `NULL`
- useless checks for `NULL` (cannot be `NULL`, because of earlier return)
- using `0` instead of `NULL`
- useless extra condition (`if (foo) return; if (!foo) { ...; }`)
- removing & in front of static functions passed as arguments
2019-10-01 16:48:55 +02:00
Ondřej Surý
4957255d13 Use the semantic patch to change the usage isc_mem_create() to new API 2019-09-12 09:26:09 +02:00
Mark Andrews
2de94dd4c4 address NULL pointer dereferences 2019-09-04 11:27:16 +10:00
Michał Kępień
b5cd146033 Always include <errno.h> instead of <sys/errno.h>
Including <sys/errno.h> instead of <errno.h> raises a compiler warning
when building against musl libc.  Always include <errno.h> instead of
<sys/errno.h> to prevent that compilation warning from being triggered
and to achieve consistency in this regard across the entire source tree.
2019-07-30 21:25:18 +02:00
Evan Hunt
a1871e7f1d further cleanup
- removed some dead code
- dns_zone_setdbtype is now void as it could no longer return
  anything but ISC_R_SUCCESS; calls to it no longer check for a result
- controlkeylist_fromconfig() is also now void
- fixed a whitespace error
2019-07-23 15:32:36 -04:00
Ondřej Surý
f0c6aef542 Cleanup stray goto labels from removing isc_mem_allocate/strdup checking blocks 2019-07-23 15:32:36 -04:00
Ondřej Surý
9bdc24a9fd Use coccinelle to cleanup the failure handling blocks from isc_mem_strdup 2019-07-23 15:32:36 -04:00
Ondřej Surý
601cb4e4cc Use coccinelle to cleanup the failure handling blocks from isc_mem_allocate 2019-07-23 15:32:35 -04: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ý
5d1e7be582 Rename OPENSSL_INCLUDES to OPENSSL_CFLAGS in AX_CHECK_OPENSSL() macro
The ax_check_openssl m4 macro used OPENSSL_INCLUDES.  Rename the
subst variable to OPENSSL_CFLAGS and wrap AX_CHECK_OPENSSL() in
action-if-not-found part of PKG_CHECK_MODULE check for libcrypto.
2019-06-25 12:36:01 +02:00
Ondřej Surý
e3e6888946 Make the usage of json-c objects opaque to the caller
The json-c have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:04:20 +02:00
Ondřej Surý
0771dd3be8 Make the usage of libxml2 opaque to the caller
The libxml2 have previously leaked into the global namespace leading
to forced -I<include_path> for every compilation unit using isc/xml.h
header.  This MR fixes the usage making the caller object opaque.
2019-06-25 12:01:32 +02:00
Ondřej Surý
04961a7e6b Revert "Downgrade the dns_clientinfomethod structure to the version in lib/dns/clientinfo.c"
This reverts commit a6f09b2255e323d8c49306ef0af6b4f7565baa61.
2019-06-20 12:46:21 +02:00
Ondřej Surý
a6f09b2255 Downgrade the dns_clientinfomethod structure to the version in lib/dns/clientinfo.c 2019-04-09 10:06:12 +01: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
c9dc59eb90 properly detect period as last character in filename 2019-03-05 13:50:22 -08:00
Evan Hunt
c79e2f12fe remove contrib/sdb
removed the SDB databases in contrib/sdb as they hadn't been
maintained in some time, and were no longer able to link to named
without modification.  also:

- cleaned up contrib/README, which still referred to contrib
  subdirectores that were removed already, and linked to an obsolete URL.
- removed references to sdb in doc/misc/roadmap and doc/misc/sdb.
2019-02-19 17:19:40 -08:00
Mark Andrews
218ce34e7d correct errno to result translation 2019-02-20 09:43:16 +11:00
Evan Hunt
2e3b5db195 added DNAME support to DLZ LDAP schema, and fixed a DLZ compile error
Thanks to Roland Gruber for the schema contribution.
2019-02-10 11:49:01 -08:00
Ondřej Surý
e2cdf066ea Remove message catalogs 2019-01-09 23:44:26 +01:00
Mark Andrews
4c7e6e0799 correctly split query string; cleanups 2019-01-09 19:57:46 +11:00
Mark Andrews
402190df18 return ISC_R_NOTFOUND when name does not match the zone name 2019-01-06 22:21:24 -05:00
Roland Gruber
83903f6f5e Add optional description field to LDAP schema 2018-12-20 09:47:07 +01:00
Ondřej Surý
2f3eee5a4f isc_mutex_init returns 'void' 2018-11-22 11:51:49 +00:00
Ondřej Surý
175f06949f Use strlcpy in place where strncpy(s, ...) + s[sizeof(s)-1] = \0; was used 2018-11-19 07:58:48 +01:00
Mark Andrews
4979d5f31f cleanup allocated memory on error 2018-11-16 18:00:36 -05:00
Ondřej Surý
f4c8e42f3e Update contrib/README with new locations for dnsperf, queryperf, and perftcpdns 2018-08-28 11:44:58 +02:00
Ondřej Surý
7de898777f Remove perftcpdns from BIND 9 repository 2018-08-28 11:42:31 +02:00
Ondřej Surý
1e404fdb0e Remove queryperf from BIND 9 repository 2018-08-28 11:42:14 +02:00
Ondřej Surý
99f17b80b8 Remove dnsperf and dnsperf-patches from BIND 9 repository 2018-08-28 11:41:58 +02:00
Ondřej Surý
62fb0759e9 Assume always working getaddrinfo/getnameinfo implemenation 2018-08-28 10:31:48 +02:00
Ondřej Surý
f0f71420c8 Remove legacy support for AIX 2018-08-28 10:31:47 +02:00
Witold Kręcicki
5cdb38c2c7 Remove unthreaded support 2018-08-16 17:18:52 +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
Ondřej Surý
64fe6bbaf2 Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants 2018-08-08 09:36:44 +02:00
Ondřej Surý
71877806e8 Fix ax_check_openssl to accept yes and improve it to modern autotools standard 2018-07-23 22:10:52 +02:00
Ondřej Surý
c3b8130fe8 Make OpenSSL mandatory 2018-07-19 12:47:03 -04:00