2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 18:19:42 +00:00

446 Commits

Author SHA1 Message Date
Mark Andrews
fe7ce99270 Dig now supports selecting FIPS mode at runtime
To enable FIPS mode at runtime use 'dig -F'.  The operating system
must have FIPS support available for this to succeed.  This is on
by default when built with --enable-fips-mode.
2024-11-22 09:40:46 +11:00
Ondřej Surý
0258850f20
Remove redundant parentheses from the return statement 2024-11-19 12:27:22 +01:00
Evan Hunt
5ea1f6390d corrected code style errors
- add missing brackets around one-line statements
- add paretheses around return values
2024-10-18 19:31:27 +00:00
Mark Andrews
df5b4ba894 Correctly get final token 2024-10-18 01:24:32 +00:00
Mark Andrews
609d96aa12 Restore seperator values
strtok_r is destructive.  Restore the seperators so that the command
line can be properly displayed.
2024-10-18 01:24:32 +00:00
Aydın Mercan
f58ed932d8
use only c23 or c11 noreturn specifiers
Since we require C11 or greater, we can depend on using either _Noreturn
or [[noreturn]].
2024-08-07 18:27:40 +03:00
Yedaya Katsman
1dd76fe780 Remove newlines from dighost errors calls
Not all invocations had it, and this makes it more consistent with
dighost_warning. Also remove the conditional newline when not outputting
yaml
2024-08-05 02:43:06 +00:00
Yedaya Katsman
8986dda74a Remove extra newline from +yaml output
The newlines weren't needed for the yaml syntax, and took up space.
2024-08-05 02:43:06 +00:00
Mark Andrews
d74bba4fae Re-enable EDNS if an EDNS flag gets set to 1 by +ednsflags
This is consistent with +dnssec and +nsid which only re-enable
EDNS if do is set to 1 or nsid is requested.
2024-03-16 16:07:55 +11:00
Ondřej Surý
76997983fd
Use EXIT_SUCCESS and EXIT_FAILURE
Instead of randomly using -1 or 1 as a failure status, properly utilize
the EXIT_FAILURE define that's platform specific (as it should be).
2024-02-08 08:01:58 +01:00
Mark Andrews
bb75676f90 Error if proxy ports are too big 2024-01-09 23:27:45 +00:00
Mark Andrews
fd077c2661 NetBSD has added 'hmac' to libc so rename out uses of hmac 2023-12-13 22:27:38 +00:00
Evan Hunt
c8f43b9160 remove some long-deprecated arguments from dig
certain dig options which were deprecated and became nonoperational
several releases ago still had documentation in the dig man page and
warnings printed when they were used: these included +mapped,
+sigchase, +topdown, +unexpected, +trusted-key, and the -i and -n
options. these are now all fatal errors.

another option was described as deprecated in the man page, but
the code to print a warning was never added. it has been added now.
2023-12-06 17:32:09 -08:00
Artem Boldariev
e0afd614c3 Integrate PROXYv2 support into dig
This commit adds PROXYv2 support into dig by the means of adding
+[no]proxy and +[no]proxy-plain options. Since this commit dig
supports sending PROXYv2 headers on all supported DNS-transports.

The support for PROXYv2 is modelled after that one in kdig.
2023-12-06 15:15:25 +02:00
Evan Hunt
a290ed5bd0 remove dns_name_fromstring2()
we don't need two versions of dns_name_fromstring() any longer; we
can just specify an origin value of dns_rootname for absolute names.
2023-08-31 10:29:16 -07:00
Aram Sargsyan
77d1476c46 Fix dig help message typo in the http-plain-get option
The option name is misspelled as 'https-plain-get'. Fix the error.
2023-08-01 10:38:44 +00:00
Evan Hunt
ffacf0aec6 use algorithm number instead of name to create TSIG keys
the prior practice of passing a dns_name containing the
expanded name of an algorithm to dns_tsigkey_create() and
dns_tsigkey_createfromkey() is unnecessarily cumbersome;
we can now pass the algorithm number instead.
2023-06-14 08:14:38 +00:00
Evan Hunt
a52b17d39b
remove isc_task completely
as there is no further use of isc_task in BIND, this commit removes
it, along with isc_taskmgr, isc_event, and all other related types.

functions that accepted taskmgr as a parameter have been cleaned up.
as a result of this change, some functions can no longer fail, so
they've been changed to type void, and their callers have been
updated accordingly.

the tasks table has been removed from the statistics channel and
the stats version has been updated. dns_dyndbctx has been changed
to reference the loopmgr instead of taskmgr, and DNS_DYNDB_VERSION
has been udpated as well.
2023-02-16 18:35:32 +01:00
Mark Andrews
e27fc4bbc5 Cleanup OpenSSL reference on bad option
Another exit path that needs to be cleaned up.
2023-02-16 10:55:42 +11:00
Tony Finch
6927a30926 Remove do-nothing header <isc/print.h>
This one really truly did nothing. No lines added!
2023-02-15 16:44:47 +00:00
Evan Hunt
3a1bb8dac8 remove some unused functions
removed some functions that are no longer used and unlikely to
be resurrected, and also some that were only used to support Windows
and can now be replaced with generic versions.
2023-02-13 11:50:59 -08:00
Evan Hunt
287722ac12 fully remove DSCP
The "dscp" option is now marked as "ancient" and it is a configuration
error to use it or to configure DSCP values for any source-address
option.
2023-01-17 16:18:21 -08:00
Evan Hunt
916ea26ead remove nonfunctional DSCP implementation
DSCP has not been fully working since the network manager was
introduced in 9.16, and has been completely broken since 9.18.
This seems to have caused very few difficulties for anyone,
so we have now marked it as obsolete and removed the
implementation.

To ensure that old config files don't fail, the code to parse
dscp key-value pairs is still present, but a warning is logged
that the feature is obsolete and should not be used. Nothing is
done with configured values, and there is no longer any
range checking.
2023-01-09 12:15:21 -08:00
Mark Andrews
8ce163bbc5 Properly initialise local_ndata in isdotlocal in dig
Remove the trailing '\0' so that the length field of the dns_name_t
structure is correct.  The old data just happens to work with
dns_name_issubdomain but would fail with dns_name_equal.
2022-12-13 23:05:30 +00:00
Michal Nowak
afdb41a5aa
Update sources to Clang 15 formatting 2022-11-29 08:54:34 +01:00
Ondřej Surý
c0598d404c
Use designated initializers instead of memset()/MEM_ZERO for structs
In several places, the structures were cleaned with memset(...)) and
thus the semantic patch converted the isc_mem_get(...) to
isc_mem_getx(..., ISC_MEM_ZERO).  Use the designated initializer to
initialized the structures instead of zeroing the memory with
ISC_MEM_ZERO flag as this better matches the intended purpose.
2022-10-05 16:44:05 +02:00
Mark Andrews
805e2ba31d
Add the ability to dig to specify the signing time 2022-09-26 16:28:23 +02:00
Tony Finch
f820ef49bf More lenient IDNA processing in dig
If there are any problems with IDN processing, DiG will now quietly
handle the name as if IDN were disabled. This means that international
query names are rendered verbatim on the wire, and ACE names are
printed raw without conversion to UTF8.

If you want to check the syntax of international domain names,
use the `idn2` utility.
2022-09-12 11:40:08 +01:00
Evan Hunt
66eaf6bb73 quote addresses in YAML output
YAML strings should be quoted if they contain colon characters.
Since IPv6 addresses do, we now quote the query_address and
response_address strings in all YAML output.
2022-08-31 15:32:24 -07:00
Ondřej Surý
49b149f5fd
Update isc_timer to use isc_loopmgr
* isc_timer was rewritten using the uv_timer, and isc_timermgr_t was
  completely removed; isc_timer objects are now directly created on the
  isc_loop event loops.

* the isc_timer API has been simplified. the "inactive" timer type has
  been removed; timers are now stopped by calling isc_timer_stop()
  instead of resetting to inactive.

* isc_manager now creates a loop manager rather than a timer manager.

* modules and applications using isc_timer have been updated to use the
  new API.
2022-08-25 17:17:07 +02:00
Artem Boldariev
bd29705a9f DIG: mark HTTP GET method in output
This commit makes dig mark the usage of HTTP(S) GET protocol usage in
its output.
2022-08-18 13:34:22 +03:00
Artem Boldariev
b2f2fed65b DIG: fix handling of +http-plain-{get, post} options
Support for parsing +http-plain-get and +http-plain-post options was
broken. This commit fixes that.
2022-08-18 13:34:21 +03:00
Aram Sargsyan
244bf0b3e4 DiG: document +qid=<num> option in the usage summary
The +qid=<num> option, which sets the outgoing query ID, was missing
from the usage summary printed using `dig -h` command.
2022-07-28 09:08:13 +00:00
Artem Boldariev
7b9318bf72 Add missing plain HTTP options to dig's help output
A couple of dig options were missing in the help output, while been
properly documented and supported. This commit fixes this overlook.
2022-03-28 16:22:53 +03:00
Artem Boldariev
fd38a4e1bf Add support for Strict/Mutual TLS to dig
This commit adds support for Strict/Mutual TLS to dig.

The new command-line options and their behaviour are modelled after
kdig (+tls-ca, +tls-hostname, +tls-certfile, +tls-keyfile) for
compatibility reasons. That is, using +tls-* is sufficient to enable
DoT in dig, implying +tls-ca

If there is no other DNS transport specified via command-line,
specifying any of +tls-* options makes dig use DoT. In this case, its
behaviour is the same as if +tls-ca is specified: that is, the remote
peer's certificate is verified using the platform-specific
intermediate CA certificates store. This behaviour is introduced for
compatibility with kdig.
2022-03-28 16:22:53 +03:00
Ondřej Surý
04d0b70ba2 Replace ISC_NORETURN with C11's noreturn
C11 has builtin support for _Noreturn function specifier with
convenience noreturn macro defined in <stdnoreturn.h> header.

Replace ISC_NORETURN macro by C11 noreturn with fallback to
__attribute__((noreturn)) if the C11 support is not complete.
2022-03-25 08:33:43 +01:00
Ondřej Surý
584f0d7a7e Simplify way we tag unreachable code with only ISC_UNREACHABLE()
Previously, the unreachable code paths would have to be tagged with:

    INSIST(0);
    ISC_UNREACHABLE();

There was also older parts of the code that used comment annotation:

    /* NOTREACHED */

Unify the handling of unreachable code paths to just use:

    UNREACHABLE();

The UNREACHABLE() macro now asserts when reached and also uses
__builtin_unreachable(); when such builtin is available in the compiler.
2022-03-25 08:33:43 +01:00
Ondřej Surý
ff22498849 Add couple missing braces around single-line statements
The clang-format-15 has new option InsertBraces that could add missing
branches around single line statements.  Use that to our advantage
without switching to not-yet-released LLVM version to add missing braces
in couple of places.
2022-03-17 18:27:45 +01:00
Tony Finch
6bcfa0c4ec Consistently print version numbers to stdout
Since the user asked for the version number it is logical to make it a
non-error, i.e. print to stdout (not stderr) and exit(0).

Closes #3189
2022-03-09 17:37:07 +00:00
Tony Finch
ae73a8d87a Stop dig complaining about +noidn when it can't IDN
When dig was built without IDN support, it reported an error if the
+noidnin and/or +noidnout options were used. This means the options
were not useful for a script that wants consistent lack of IDN
translation regardless of how BIND is built.

Make dig complain about lack of built-in IDN support only when the
user asks for IDN translation.

Closes #3188
2022-03-09 13:13:15 +00:00
Ondřej Surý
f251d69eba Remove usage of deprecated ATOMIC_VAR_INIT() macro
The C17 standard deprecated ATOMIC_VAR_INIT() macro (see [1]).  Follow
the suite and remove the ATOMIC_VAR_INIT() usage in favor of simple
assignment of the value as this is what all supported stdatomic.h
implementations do anyway:

  * MacOSX.plaform: #define ATOMIC_VAR_INIT(__v) {__v}
  * Gcc stdatomic.h: #define ATOMIC_VAR_INIT(VALUE)	(VALUE)

1. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1138r0.pdf
2022-03-08 23:55:10 +01:00
Michał Kępień
18db2269bf Fix spelling of "DNS over HTTPS" & "DNS over TLS"
The terms "DNS over HTTPS" and "DNS over TLS" should be hyphenated when
they are used as adjectives and non-hyphenated otherwise.  Ensure all
occurrences of these terms in the source tree follow the above rule.
(CHANGES and release notes are intentionally left intact.)

Tweak a related ARM snippet, fixing a typo in the process.
2022-01-20 15:40:37 +01:00
Ondřej Surý
7267c39323 Remove +mapped option from dig
The network manager doesn't have support for IPv4-mapped IPv6 addresses,
thus we are removing the +mapped option from dig command.
2022-01-17 22:16:27 +01:00
Ondřej Surý
58bd26b6cf Update the copyright information in all files in the repository
This commit converts the license handling to adhere to the REUSE
specification.  It specifically:

1. Adds used licnses to LICENSES/ directory

2. Add "isc" template for adding the copyright boilerplate

3. Changes all source files to include copyright and SPDX license
   header, this includes all the C sources, documentation, zone files,
   configuration files.  There are notes in the doc/dev/copyrights file
   on how to add correct headers to the new files.

4. Handle the rest that can't be modified via .reuse/dep5 file.  The
   binary (or otherwise unmodifiable) files could have license places
   next to them in <foo>.license file, but this would lead to cluttered
   repository and most of the files handled in the .reuse/dep5 file are
   system test files.
2022-01-11 09:05:02 +01:00
Evan Hunt
a55589f881 remove all references to isc_socket and related types
Removed socket.c, socket.h, and all references to isc_socket_t,
isc_socketmgr_t, isc_sockevent_t, etc.
2021-10-15 01:01:25 -07:00
Ondřej Surý
2e3a2eecfe Make isc_result a static enum
Remove the dynamic registration of result codes.  Convert isc_result_t
from unsigned + #defines into 32-bit enum type in grand unified
<isc/result.h> header.  Keep the existing values of the result codes
even at the expense of the description and identifier tables being
unnecessary large.

Additionally, add couple of:

    switch (result) {
    [...]
    default:
        break;
    }

statements where compiler now complains about missing enum values in the
switch statement.
2021-10-06 11:22:20 +02:00
Artem Boldariev
0d5e0b9922 Validate HTTP path passed to dig
The commit makes sure that the HTTP path passed to dig is a valid one.
2021-09-29 19:42:03 +03:00
Ondřej Surý
8cb2ba5dd3 Remove native PKCS#11 support
The native PKCS#11 support has been removed in favour of better
maintained, more performance and easier to use OpenSSL PKCS#11 engine
from the OpenSC project.
2021-09-09 15:35:39 +02:00
Artem Boldariev
db1ba15ff2 Replace multiple /dns-query constants with a global one
This commit replaces the constants defining /dns-query, the default
DoH endpoint, with a global definition.
2021-08-30 10:32:17 +03:00
Mark Andrews
4f9a1b03dc Add the ability to display the BADCOOKIE message in dig when
+badcookie is in effect.
2021-08-18 09:44:50 +10:00