Commit Graph
1184 Commits
Author SHA1 Message Date
Evan Hunt 0002377dca adjust the clang-format penalties to reduce string breaking
this corrects some style glitches such as:
```
        long_function_call(arg, arg2, arg3, arg4, arg5, "str"
                                                        "ing");
```
...by adjusting the penalties for breaking strings and call
parameter lists.
2020-02-17 14:23:58 -08:00
Ondřej Surý 3832e3ecc9 Fixup the missing clang-format bits 2020-02-16 17:34:24 +01: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ý f50b1e0685 Use clang-format to reformat the source files 2020-02-12 15:04:17 +01: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ý 5eb3f71a3e Refactor the isc_mempool_create() usage using the semantic patch
The isc_mempool_create() 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_mempool_create() now returns void.
2020-02-03 08:27:16 +01:00
Mark Andrews 938fc81493 document that nslookup defaults to A + AAAA lookups 2020-01-19 23:14:07 +00:00
Tinderbox User 05f2241fcb prep 9.15.8 2020-01-16 08:01:20 +00:00
Evan Hunt 2df13f79ef update copyright year to 2020 2020-01-02 21:45:30 -08:00
Ondřej SurýandMark Andrews b218bf5227 Fix the concurrent access to batchname in dig.c 2019-12-20 03:43:04 +00:00
Ondřej SurýandOndřej Surý 1a66aabd22 Refactor the dns_name API to use ISC_THREAD_LOCAL
Previously, the dns_name API used isc_thread_key API for TLS, which is
fairly complicated and requires initialization of memory contexts, etc.
This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
greatly simplifies the whole code related to storing TLS variables.
2019-12-03 16:27:24 +01:00
Mark AndrewsandOndřej Surý 9936462f31 dns_master_indent and dns_master_indentstr must not be global
The indentation for dumping the master zone was driven by two
global variables dns_master_indent and dns_master_indentstr.  In
threaded mode, this becomes prone to data access races, so this commit
converts the global variables into a local per-context tuple that
consist of count and string.
2019-11-26 13:52:18 +01:00
Mark Andrews e98157b7fe add +[no]yaml to usage() 2019-11-23 00:02:52 +11:00
Evan Hunt 36ee430327 optionally associate a netmgr with a task manager when creating
When a task manager is created, we can now specify an `isc_nm`
object to associate with it; thereafter when the task manager is
placed into exclusive mode, the network manager will be paused.
2019-11-07 11:55:37 -08:00
Ondřej Surý 9366ca769f bin/dig/dighost.c: Fix REQUIRE(!= NULL) condition after the variable has been dereferenced 2019-10-03 09:04:26 +02: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ýandMark Andrews c2dad0dcb2 Replace RUNTIME_CHECK(dns_name_copy(..., NULL)) with dns_name_copynf()
Use the semantic patch from the previous commit to replace all the calls to
dns_name_copy() with NULL as third argument with dns_name_copynf().
2019-10-01 10:43:26 +10:00
Ondřej SurýandMark Andrews 5efa29e03a The final round of adding RUNTIME_CHECK() around dns_name_copy() calls
This commit was done by hand to add the RUNTIME_CHECK() around stray
dns_name_copy() calls with NULL as third argument.  This covers the edge cases
that doesn't make sense to write a semantic patch since the usage pattern was
unique or almost unique.
2019-10-01 10:43:26 +10:00
Ondřej SurýandMark Andrews 35bd7e4da0 Add RUNTIME_CHECK() around plain dns_name_copy(..., NULL) calls using spatch
This commit add RUNTIME_CHECK() around all simple dns_name_copy() calls where
the third argument is NULL using the semantic patch from the previous commit.
2019-10-01 10:43:26 +10:00
Petr MenšíkandOndřej Surý 21371abd72 Emit warning on IDN output failure
Warning is emitted before any dig headers.
2019-09-30 08:52:13 +02:00
Petr MenšíkandOndřej Surý c8a871e908 Fallback to ASCII on output IDN conversion error
It is possible dig used ACE encoded name in locale, which does not
support converting it to unicode. Instead of fatal error, fallback to
ACE name on output.
2019-09-30 08:52:13 +02:00
Michał Kępień 0476e8f1ac Make VS solution upgrading unnecessary
Until now, the build process for BIND on Windows involved upgrading the
solution file to the version of Visual Studio used on the build host.
Unfortunately, the executable used for that (devenv.exe) is not part of
Visual Studio Build Tools and thus there is no clean way to make that
executable part of a Windows Server container.

Luckily, the solution upgrade process boils down to just adding XML tags
to Visual Studio project files and modifying certain XML attributes - in
files which we pregenerate anyway using win32utils/Configure.  Thus,
extend win32utils/Configure with three new command line parameters that
enable it to mimic what "devenv.exe bind9.sln /upgrade" does.  This
makes the devenv.exe build step redundant and thus facilitates building
BIND in Windows Server containers.
2019-09-26 15:11:15 +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
Tinderbox User badb8a474e prep for 9.15.4 2019-09-09 13:13:39 +00:00
Mark Andrews 4906fe975c Don't print ';;' comments in yaml mode. 2019-09-06 14:14:20 +10:00
Diego dos Santos Fronza bc53d68ae6 Added documentation for dig's +unexpected command line option. 2019-09-03 10:15:25 -03:00
Evan HuntandDiego dos Santos Fronza 3ef91562f1 add a toy name server that replies from the wrong address 2019-09-03 10:14:15 -03:00
Diego dos Santos Fronza 460d4d63ee Added +unexpected option so dig will print replies from unexpected
sources.
2019-09-03 10:14:15 -03:00
Ondřej Surý 50e109d659 isc_event_allocate() cannot fail, remove the fail handling blocks
isc_event_allocate() calls isc_mem_get() to allocate the event structure.  As
isc_mem_get() cannot fail softly (e.g. it never returns NULL), the
isc_event_allocate() cannot return NULL, hence we remove the (ret == NULL)
handling blocks using the semantic patch from the previous commit.
2019-08-30 08:55:34 +02:00
Ondřej Surý f1a887a0b9 dighost_error declaration in dig/dig.h was missing extern 2019-08-29 11:24:16 +02:00
Mark Andrews d98f446d3f Add support for displaying EDNS option LLQ. 2019-08-28 16:13:43 +10:00
Evan Hunt 617696fbfc document the +yaml option in dig, mdig and delv 2019-08-25 16:41:38 -07:00
Evan Hunt 71325852f1 add "dig +yaml" output format 2019-08-25 16:41:14 -07:00
Tinderbox User 1b9b826518 prep 9.15.3 2019-08-12 14:08:12 +00:00
Evan Hunt 9679c8c20a clarify descriptions of comment-related options in dig usage and man page 2019-08-05 21:30:34 -07:00
Evan Hunt 6d50f7d924 always check 'printcmd' before printing cmdline message 2019-08-05 21:26:32 -07:00
Mark Andrews 2a047af31e set DNS_STYLEFLAG_EXPANDAAAA flag in say_message if appropriate 2019-07-30 21:05:56 -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
Evan Hunt fea6b5bf10 add a search for GeoIP2 libraries in configure
- "--with-geoip" is used to enable the legacy GeoIP library.
- "--with-geoip2" is used to enable the new GeoIP2 library
  (libmaxminddb), and is on by default if the library is found.
- using both "--with-geoip" and "--with-geoip2" at the same time
  is an error.
- an attempt is made to determine the default GeoIP2 database path at
  compile time if pkg-config is able to report the module prefix. if
  this fails, it will be necessary to set the path in named.conf with
  geoip-directory
- Makefiles have been updated, and a stub lib/dns/geoip2.c has been
  added for the eventual GeoIP2 search implementation.
2019-06-27 14:58:13 -07: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
Tinderbox UserandEvan Hunt 9bb0b30bc2 prep 9.15.1 2019-06-19 15:36:28 -07:00
Ondřej Surý 4d2d3b49ce Cleanup the way we detect json-c library to use only pkg-config 2019-05-29 15:08:52 +02:00
Mark Andrews e65d4989a1 Recurse to find the root server list with 'dig +trace'. 2019-05-22 13:02:15 +10:00
Tinderbox User 25e416fb67 prep 9.15.0 2019-05-10 04:39:43 +00:00
Mark Andrews ee7cf180b3 Recognise EDNS Client Tag and EDNS Server Tag 2019-05-09 17:29:23 +10:00