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

240 Commits

Author SHA1 Message Date
Matthijs Mekking
d5f70b2237 Obsolete CLAUSEFLAG NEWDEFAULT
The 'new default' option was introduced in 2002 to signal that a
default option had changed its default value, in this specific case
the value for 'auth-nxdomain'. However, this default has been unchanged
for 18 years now, and logging that the default has changed does not
have significant value nowadays.

This is also a good example that the clause flag 'new default' is
broken: it is easy to get out of date.

It is also easy to forget, because we have changed the default value
for 'max-stale-ttl' and haven't been flagging it with 'new default'

Also, if the operator cares for a specific value it should set it
explicitly. Using the default is telling the software: use whatever
you think is best, and this may change over time. Default value
changes should be mentioned in the release note, but do not require
further special treatment.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
dda3a68efc Obsolete CLAUSEFLAG NOOP
The clause flag 'not operational' is promoted to 'not configured'.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
ff1957e95b Obsolete CLAUSEFLAG NOTIMP and NYI
The clause flags 'not implented' and 'not implemented yet' are the
same as 'obsoleted' when it comes to behavior. These options will
now be treated similar as obsoleted (the idea being that if an
option is implemented it should be functional).

The new options for DoT are new options and rather than flagging them
obsolete, they should have been flagged as experimental, signalling
that these options are subject to change in the future.
2021-01-19 10:12:40 +01:00
Evan Hunt
dcee985b7f update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
Michal Nowak
035bbc5f8f
Fix "array subscript is of type 'char'" 2020-06-04 14:33:06 +02:00
Evan Hunt
f8d753d452 initialize sockaddrdscp to prevent spurious output from 'named-checkconf -p' 2020-05-05 12:48:31 -07:00
Mark Andrews
b02081d423 Escape double quote when printing quoted string.
When we were printing quoted string, the double quotes where unescaped
leading to prematurely ending the quoted string.
2020-05-01 06:51:05 +10:00
Matthijs Mekking
5cc33084af Make clang-format happy 2020-02-25 09:07:45 +01:00
Diego Fronza
9b4e28e155 Added a isc_glob() function that wraps glob() calls for POSIX systems
and implement a custom glob() function on Windows systems.
2020-02-24 13:46:39 -03:00
Diego dos Santos Fronza
fa3fbf62e8 Allowing include directive to use glob expressions, e.g. include
"/opt/named.conf/*.conf".
2020-02-24 13:35:20 -03:00
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
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
Evan Hunt
09e061aef7 make ISO8601 duration parsing case-insensitive for robustness 2020-02-07 19:17:05 +01:00
Evan Hunt
6504e7da95 various style cleanups 2020-02-07 19:17:05 +01:00
Matthijs Mekking
2733edb2a6 Allow for key lifetime unlimited
The keyword 'unlimited' can be used instead of PT0S which means the
same but is more comprehensible for users.

Also fix some redundant "none" parameters in the kasp test.
2020-02-07 09:30:26 -08:00
Matthijs Mekking
60fa5fc760 Fix duration printing on Solaris 2019-12-06 13:12:06 +01:00
Matthijs Mekking
29e6ec3181 KASP timings all uint32_t
Get rid of the warnings in the Windows build.
2019-11-06 22:36:21 +01:00
Matthijs Mekking
b7c5bfb203 Extend ttlval to accept ISO 8601 durations
The ttlval configuration types are replaced by duration configuration
types. The duration is an ISO 8601 duration that is going to be used
for DNSSEC key timings such as key lifetimes, signature resign
intervals and refresh periods, etc. But it is also still allowed to
use the BIND ttlval ways of configuring intervals (number plus
optional unit).

A duration is stored as an array of 7 different time parts.
A duration can either be expressed in weeks, or in a combination of
the other datetime indicators.

Add several unit tests to ensure the correct value is parsed given
different string values.
2019-11-06 22:31:44 +01:00
Mark Andrews
fb87e669fb Detect partial prefixes / incomplete IPv4 address in acls. 2019-10-14 00:28:07 +11:00
Ondřej Surý
f855f09a55 lib/isccfg/parser.c: Fix invalid order of DbC checks that could cause dereference before NULL check 2019-10-03 09:04:27 +02:00
Mark Andrews
b59fe46e76 address or suppress cppcheck warnings 2019-09-12 17:59:28 +10:00
Evan Hunt
02d95d0b62 update docbook grammar, removing dnssec-looksaide
- this required modification to the code that generates grammar text for
  the documentation, because the "dnssec-lookaside" option spanned more
  than one line in doc/misc/options, so grepping out only the lines
  marked "// obsolete" didn't remove the whole option.  this commit adds
  an option to cfg_test to print named.conf clauses only if they don't
  have the obsolete, ancient, test-only, or not-yet-implemented flags
  set.
2019-08-09 09:18:46 -07:00
Ondřej Surý
ae83801e2b Remove blocks checking whether isc_mem_get() failed using the coccinelle 2019-07-23 15:32:35 -04:00
Evan Hunt
787f2a7e03 remove all support for legacy GeoIP 2019-07-04 08:56:45 -07:00
Matthijs Mekking
0b8790967e named-checkconf -i: ignore deprecate warnings
Adds a new option to named-checkconf, -i.  If set, named-checkconf
will not warn you about deprecated options.  This allows people
to use named-checkconf in automated deployment precoesses where an
operator only cares if their conf is valid, even if it is not optimal.

This was added as a request as part of introducing a policy on
removing named.conf options.
2019-06-28 11:02:59 +02:00
Evan Hunt
6e0b93e5a0 implement searching of geoip2 database
- revise mapping of search terms to database types to match the
  GeoIP2 schemas.
- open GeoIP2 databases when starting up; close when shutting down.
- clarify the logged error message when an unknown database type
  is configured.
- add new geoip ACL subtypes to support searching for continent in
  country databases.
- map geoip ACL subtypes to specific MMDB database queries.
- perform MMDB lookups based on subtype, saving state between
  queries so repeated lookups for the same address aren't necessary.
2019-06-27 14:59:03 -07:00
Evan Hunt
fe46d5bc34 add HAVE_GEOIP2 #ifdef branches, without implementing yet 2019-06-27 14:58:14 -07: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
Evan Hunt
ff3dace139 Ancient named.conf options are now a fatal configuration error
- options that were flagged as obsolete or not implemented in 9.0.0
  are now flagged as "ancient", and are a fatal error
- the ARM has been updated to remove these, along with other
  obsolete descriptions of BIND 8 behavior
- the log message for obsolete options explicitly recommends removal
2019-01-31 11:54:26 +01:00
Evan Hunt
cf072d659e cleanup cfg_parse_buffer* functions
cfg_parse_buffer() now has the same signature as the former
cfg_parse_buffer4(). cfg_parse_buffer{2,3,4}() have been removed.
2019-01-24 12:08:54 -08:00
Tinderbox User
5bd855251c prep 9.13.5 2018-12-07 03:41:19 +00:00
Mark Andrews
b2aca96c27 move geoip to parser.c 2018-12-07 12:50:03 +11:00
Michał Kępień
4234968798 add a function for processing a list of configured plugins
Add a new libisccfg function, cfg_pluginlist_foreach(), which allows an
arbitrary callback to be invoked for every "plugin" stanza present in a
configuration object.  Use this function for both loading plugins and
checking their configuration in order to reduce duplication of
configuration processing code present in bin/named/server.c and
lib/bind9/check.c.
2018-12-06 10:36:50 -08:00
Evan Hunt
427e9ca357 clear AD flag when altering response messages
- the AD flag was not being cleared correctly when filtering
- enabled dnssec valdiation in the filter-aaaa test to confirm this
  works correctly now
2018-12-06 10:29:11 -08:00
Evan Hunt
9911c835d3 add a parser to filter-aaaa.so and pass in the parameters
- make some cfg-parsing functions global so they can be run
  from filter-aaaa.so
- add filter-aaaa options to the hook module's parser
- mark filter-aaaa options in named.conf as obsolete, remove
  from named and checkconf, and update the filter-aaaa test not to
  use checkconf anymore
- remove filter-aaaa-related struct members from dns_view
2018-12-06 10:29:11 -08:00
Evan Hunt
d2f4644388 add hook statement to configuration parser
- allow multiple "hook" statements at global or view level
- add "optional bracketed text" type for optional parameter list
- load hook module from specified path rather than hardcoded path
- add a hooktable pointer (and a callback for freeing it) to the
  view structure
- change the hooktable functions so they no longer update ns__hook_table
  by default, and modify PROCESS_HOOK so it uses the view hooktable, if
  set, rather than ns__hook_table. (ns__hook_table is retained for
  use by unit tests.)
- update the filter-aaaa system test to load filter-aaaa.so
- add a prereq script to check for dlopen support before running
  the filter-aaaa system test

not yet done:
- configuration parameters are not being passed to the filter-aaaa
  module; the filter-aaaa ACL and filter-aaaa-on-{v4,v6} settings are
  still stored in dns_view
2018-12-06 10:29:11 -08:00
Ondřej Surý
23fff6c569 Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached 2018-11-08 12:22:17 +07:00
Ondřej Surý
b2b43fd235 Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 12:21:53 +07: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ý
8c526df306 Remove support for legacy systems without sin6_scope_id 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
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