Compare commits

...
Author SHA1 Message Date
Mark Andrews 6c0747fc2b add missing decrements; set *versionp to NULL at start of closeversion 2020-08-19 12:31:38 +10:00
Mark Andrews ac67436758 Merge branch '2077-negative-hook-point-value-in-filter-aaaa-c' into 'main'
Resolve "negative hook point value in filter-aaaa.c"

Closes #2077

See merge request isc-projects/bind9!3985
2020-08-19 00:17:05 +00:00
Mark Andrews 2fd5ba6507 Remove stray '-' from filter-aaaa initialisation 2020-08-19 09:21:59 +10:00
Ondřej Surý e51c8613e4 Merge branch 'ondrej/dns_rdata_fromwire_text-corpus-update' into 'main'
Expand, but minimize (tmin, cmin) dns_rdata_fromwire_text corpus

See merge request isc-projects/bind9!3981
2020-08-18 15:44:11 +00:00
Ondřej Surý df26656e4b Expand, but minimize (tmin, cmin) dns_rdata_fromwire_text corpus 2020-08-18 16:39:23 +02:00
Ondřej Surý 2a8c0282da Merge branch 'marka-fuzz-consolidated' into 'main'
Consolidated fuzz fixes

See merge request isc-projects/bind9!3975
2020-08-18 09:07:47 +00:00
Ondřej Surý 62c448beaf Merge branch 'ondrej/update-readline-support' into 'main'
Update and cleanup the readline library support

See merge request isc-projects/bind9!3942
2020-08-18 09:05:51 +00:00
Mark AndrewsandOndřej Surý 8452404bd7 A6: return FORMERR in fromwire if bits are non zero.
oss_fuzz: Issue 24864: bind9:dns_rdata_fromwire_text_fuzzer: Overwrites-const-input in dns_rdata_fromwire_text_fuzzer
2020-08-18 11:04:05 +02:00
Mark AndrewsandOndřej Surý f6d7b8c20d RRSIG: reject records with empty SIG section 2020-08-18 11:04:05 +02:00
Mark AndrewsandOndřej Surý 3e743da1bd Disable compression in dns_rdata_fromwire_text() 2020-08-18 11:04:05 +02:00
Mark AndrewsandOndřej Surý aa811801cb dns_rdata_fromwire() only accepts input up to 2^16-1 octets. 2020-08-18 11:04:05 +02:00
Mark AndrewsandOndřej Surý e4d30cb007 Print out input if dns_rdata_fromtext() fails in debug mode. 2020-08-18 11:04:05 +02:00
Mark AndrewsandOndřej Surý 2e748ba397 Add the ability to specify an input file 2020-08-18 11:04:05 +02:00
Ondřej Surý be8c589f28 Add CHANGES note for GL !3942 2020-08-18 10:27:37 +02:00
Ondřej Surý ba2376b9e0 Update and cleanup the readline library support
This commit updates and simplifies the checks for the readline support
in nslookup and nsupdate:

  * Change the autoconf checks to pkg-config only, all supported
    libraries have accompanying .pc files now.
  * Add editline support in addition to libedit and GNU readline
  * Add isc/readline.h shim header that defines dummy readline()
    function when no readline library is available
2020-08-18 10:27:14 +02:00
Michal Nowak 99ca842e0a Merge branch 'mnowak/gcovr' into 'main'
Report coverage with gcovr

Closes isc-private/bind-qa#23

See merge request isc-projects/bind9!3606
2020-08-17 15:21:41 +00:00
Michal Nowak 8d15bef0dd Report coverage with gcovr 2020-08-17 17:19:32 +02:00
Michal Nowak d5350db5bc Merge branch 'mnowak/broaden-abi-check-scope' into 'main'
Broaden scope of abi-check

See merge request isc-projects/bind9!3927
2020-08-17 13:07:15 +00:00
Michal Nowak 8e43f5e860 Broaden scope of abi-check
For abi-check we should use as broad 'configure' options as possible.
2020-08-17 14:58:32 +02:00
Mark Andrews f85bb0691c Merge branch 'patch-3' into 'main'
Option -s is not supported in tsig-keygen

See merge request isc-projects/bind9!3966
2020-08-17 02:35:33 +00:00
JP Mens b01d26c608 Option -s is not supported in tsig-keygen 2020-08-16 16:23:48 +00:00
Mark Andrews 4005cc3864 Merge branch 'marka-bad-bool-value' into 'main'
Ensure that a bool is stored in 'eol'

See merge request isc-projects/bind9!3960
2020-08-14 04:42:23 +00:00
Mark Andrews 8b75833aaa Ensure that a bool is stored in 'eol'
oss-fuzz: Issue 24875: bind9:isc_lex_getmastertoken_fuzzer: Invalid-bool-value in isc_lex_getmastertoken.c
2020-08-14 08:35:17 +10:00
Ondřej Surý 53f229f499 Merge branch 'ondrej/fix-oss-fuzz-debug' into 'main'
Move the debug variable from main.c to individual fuzzer

See merge request isc-projects/bind9!3959
2020-08-13 16:00:08 +00:00
Ondřej Surý 915616a34e Move the debug variable from main.c to individual fuzzer
The fuzzers needs to be completely independent of the main.c for
OSS-Fuzz to work.
2020-08-13 17:55:38 +02:00
Mark Andrews dd29e2550c Merge branch 'marka-fuzz-fixes' into 'main'
Add issues found by dns_rdata_fromwiretext fuzzer.

See merge request isc-projects/bind9!3953
2020-08-13 14:08:50 +00:00
Mark Andrews 80d69ba04c Add CHANGES note 2020-08-13 23:16:18 +10:00
Mark Andrews 7ae055cef1 Add previously detected dns_rdata_fromwire_text failures 2020-08-13 23:16:18 +10:00
Mark Andrews 7e49689746 X25: Check that record is all ASCII digits 2020-08-13 23:06:55 +10:00
Mark Andrews 9d446142d8 WKS: reject records with zero octets at the end of the bitmap 2020-08-13 23:06:55 +10:00
Mark Andrews 3429c35f52 TLSA: fix fromwire length checks 2020-08-13 23:06:55 +10:00
Mark Andrews 9b93e5d684 SIG: reject records with a zero length signature 2020-08-13 23:06:55 +10:00
Mark Andrews 73dd849655 NXT: fix fromwire bitmap checks 2020-08-13 23:06:55 +10:00
Mark Andrews 7dc8e720ff NSEC3PARAM: check that saltlen is consistent with the rdata length 2020-08-13 23:06:55 +10:00
Mark Andrews 031ee9e279 NSEC3: reject records with a zero length hash field 2020-08-13 23:06:55 +10:00
Mark Andrews d7f7014803 IPSECKEY: require non-zero length public keys 2020-08-13 23:06:55 +10:00
Mark Andrews a238f37239 CERT: reject records with a empty certificate field 2020-08-13 23:06:55 +10:00
Mark Andrews 3c492b3ef1 Get rid of type 'RESERVED0'. 2020-08-13 23:06:55 +10:00
Mark Andrews a92d973430 dns_rdata_fromwire_text fixes:
* Disallow compression pointers in names as we are not
  reading from a packet and as a result length checks fail.
* Increase totext buffer size as fuzzer ran out of space on
  big bitmaps.
* NUL terminate totext to make fault diagnosis easier.
* Add debugging messages to make fault diagnosie easier.
2020-08-13 23:06:55 +10:00
Mark Andrews 6c7e50c267 base32_decode*() could incorrectly decode a input.
base32_decode_char() added a extra zero octet to the output
if the fifth character was a pad character.  The length
of octets to copy to the output was set to 3 instead of 2.
2020-08-13 23:06:55 +10:00
Matthijs Mekking 9bb966d579 Merge branch 'matthijs-fix-kasp-test-next-key-event' into 'main'
Update check next key events after rndc checkds

See merge request isc-projects/bind9!3937
2020-08-13 10:04:10 +00:00
Matthijs Mekking 262b52a154 Fix check next key event check in kasp test
Prevent intermittent false positives on slow platforms by subtracting
the number of seconds which passed between key creation and invoking
'rndc dnssec -checkds'.

This particularly fails for the step3.csk-roll2.autosign zone because
the closest next key event is when the zone signatures become
omnipresent. Running 'rndc dnssec -checkds' some time later means
that the next key event is in fact closer than the calculated time
and thus we need to adjust the expected time by the time already
passed.
2020-08-13 10:30:31 +02:00
Ondřej Surý eeb8b80547 Merge branch 'marka-handle-eof' into 'main'
Address infinite loop on EOF.

See merge request isc-projects/bind9!3954
2020-08-13 07:21:19 +00:00
Mark Andrews c59ab04f6f Address infinite loop on EOF. 2020-08-13 16:42:40 +10:00
Ondřej Surý 191887ef2b Merge branch 'ondrej/oss-fuzz' into 'main'
Couple of minor changes to the autoconf for the OSS-Fuzz project

See merge request isc-projects/bind9!3951
2020-08-12 20:56:50 +00:00
Ondřej Surý f9aba90342 Add explicit support of OSS-Fuzz
The --enable-fuzzing option now allows third choice "ossfuzz" that just
adds $LIB_FUZZING_ENGINE to FUZZ_LDFLAGS to make the fuzzer builds
compatible with OSS-Fuzz project that has some special quirks (the
main() routine is provided in the static library the project provides).
2020-08-12 21:58:45 +02:00
Ondřej Surý eb0d5a9526 Allow static linking in the developer mode
Previously, we have disallowed static linking (for good reasons).
However, there are legitimate reasons where static linking might be
useful, and one of the reasons is the OSS-Fuzz project that doesn't have
the libraries used for build, so static linking is the sane option here.

The static linking is still disallowed in the "production" builds, but
it's not possible to disable shared and enable static libraries when
used together with --enable-developer.
2020-08-12 21:56:37 +02:00
Ondřej Surý c8538c50b4 Merge branch '2064-fix-isc_lex_getmastertoken-fuzzing' into 'main'
Really fuzz isc_lex_getmastertoken() in the test

Closes #2064

See merge request isc-projects/bind9!3949
2020-08-12 19:53:49 +00:00
Ondřej SurýandOndřej Surý 790476332e Really fuzz isc_lex_getmastertoken() in the test
There was a copy&paste error in fuzz/isc_lex_getmastertoken.c where we
didn't really test the function we wanted to test.  Update the test to
have the input data to always include expected 'tokentype' in the first
byte, `eol` argument in the second byte and the rest of the input is the
data to parse.
2020-08-12 21:49:31 +02:00
Michal Nowak 88ad7b85e6 Merge branch 'mnowak/fix-core-dumps-were-found-line' into 'main'
Make sure .txt files are not identified as crashed test

See merge request isc-projects/bind9!3909
2020-08-12 07:48:05 +00:00
Michal Nowak c2dcd95966 Make sure .txt files are not identified as crashed test
Previously .txt files with full backtrace may be identified as a
crashed test:

    I:Core dumps were found for the following system tests:
    I:	 core.19948-backtrace.txt
    I:   shutdown

Now .txt files are removed from the list.

Change 'run.sh.in' to match the core matching pattern in
'testsummary.sh'.
2020-08-12 09:45:56 +02:00
Mark Andrews 852a2d834f Merge branch '2045-readline-rltypedefs-h-35-22-error-this-function-declaration-is-not-a-prototype-on-netbsd-9' into 'main'
Resolve "readline/rltypedefs.h:35:22: error: this function declaration is not a prototype on NetBSD 9"

Closes #2045

See merge request isc-projects/bind9!3926
2020-08-11 23:34:55 +00:00
Mark Andrews fd126553d4 Ensure rl_message() gets prototype. 2020-08-11 23:21:17 +00:00
Mark Andrews 1532a34658 Stop deprecated functions being defined 2020-08-11 23:21:17 +00:00
Michal Nowak a53a0a8df1 Merge branch 'mnowak/run-tarball-tests-in-schedule' into 'main'
Run unit and system tarball tests on schedules

See merge request isc-projects/bind9!3928
2020-08-11 14:59:35 +00:00
Michal Nowak 439fe9bc3c Run unit and system tarball tests on schedules
To prevent problems with unit and system tarball tests being revealed
during release process, run these tests on schedules.
2020-08-11 16:58:28 +02:00
Mark Andrews ba6af6d507 Merge branch '2067-nta-related-crash-in-checkbogus-after-an-rndc-reload' into 'main'
Resolve "NTA-related crash in checkbogus() after an "rndc reload""

Closes #2067

See merge request isc-projects/bind9!3930
2020-08-11 01:45:43 +00:00
Mark Andrews 0b2555e8cf Address use after free between view, resolver and nta.
Hold a weak reference to the view so that it can't go away while
nta is performing its lookups.  Cancel nta timers once all external
references to the view have gone to prevent them triggering new work.
2020-08-11 11:00:49 +10:00
Mark Andrews f9537a6f2a Merge branch '2027-update-managed-keys-log-messages' into 'main'
Resolve "Slightly misleading diagnostic when revoked key is removed from managed-keys zone"

Closes #2027

See merge request isc-projects/bind9!3934
2020-08-11 00:54:39 +00:00
Mark Andrews c9f019c931 Update managed keys log messages to be less confusing. 2020-08-11 00:10:10 +00:00
Evan Hunt fec73c7e79 Merge branch 'each-fix-typo' into 'main'
fix ARM typo

See merge request isc-projects/bind9!3938
2020-08-10 19:38:49 +00:00
Evan Hunt a69afb37e0 fix ARM typo 2020-08-10 12:36:29 -07:00
Michał Kępień e151eb3aa3 Merge branch '1775-pick-smaller-default-rbt-hash-table-size' into 'main'
Reduce the default rbt hashtable size to 16 entries (4 bits)

Closes #1775

See merge request isc-projects/bind9!3935
2020-08-10 09:29:16 +00:00
Ondřej Surý 1e043a011b Reduce the default RBT hash table size to 16 entries (4 bits)
The hash table rework MRs (!3865, !3871) increased the default RBT hash
table size from 64 to 65,536 entries (for 64-bit architectures, that is
512 bytes before vs. 524,288 bytes after).  This works fine for RBTs
used for cache databases, but since three separate RBT databases are
created for every zone loaded (RRs, NSEC, NSEC3), memory usage would
skyrocket when BIND 9 is used as an authoritative DNS server with many
zones.

The default RBT hash table size before the rework was 64 entries, this
commit reduces it to 16 entries because our educated guess is that most
zones are just couple of entries (SOA, NS, A, AAAA, MX) and rehashing
small hash tables is actually cheap.  The rework we did in the previous
MRs tries to avoid growing the hash tables for big-to-huge caches where
growing the hash table comes at a price because the whole cache needs to
be locked.
2020-08-10 10:31:19 +02:00
Michal Nowak cde7f982eb Merge branch 'michal/do-not-run-make-recheck-if-the-test-suite-fails' into 'main'
Do not run "make recheck" if the test suite fails

See merge request isc-projects/bind9!3932
2020-08-07 14:38:38 +00:00
Michał Kępień 5a4076fc40 Do not run "make recheck" if the test suite fails
Running "make recheck" after the test suite fails hides intermittent
system test failures in GitLab CI.  This makes it hard to identify which
branches are affected by a particular test failure mode and causes CI
results to be overly optimistic.  Prevent "make recheck" from being run
when "make check" fails to ensure GitLab CI results properly reflect the
stability of the "main" branch.
2020-08-07 14:35:05 +02:00
Matthijs Mekking 82e9287459 Merge branch '1613-rndc-dnssec-checkds' into 'main'
Resolve "Signal DS submitting via rndc"

Closes #1613

See merge request isc-projects/bind9!3906
2020-08-07 11:19:09 +00:00
Matthijs Mekking 46fcd927e7 rndc dnssec -checkds set algorithm
In the rare case that you have multiple keys acting as KSK and that
have the same keytag, you can now set the algorithm when calling
'-checkds'.
2020-08-07 11:26:09 +02:00
Matthijs Mekking e4c82fc7ae Add notes for #1613 (rndc dnssec -checkds)
This is a new feature that should be mentioned in the notes.
2020-08-07 11:26:09 +02:00
Matthijs Mekking a43bb41909 Test 'rndc dnssec -checkds' on multiple zones
Make sure the 'checkds' command correctly sets the right key timing
metadata and also make sure that it rejects setting the key timing
metadata if there are multiple keys with the KSK role and no key
identifier is provided.
2020-08-07 11:26:09 +02:00
Matthijs Mekking a25f49f153 Make 'parent-registration-delay' obsolete
With the introduction of 'checkds', the 'parent-registration-delay'
option becomes obsolete.
2020-08-07 11:26:09 +02:00
Matthijs Mekking 38cb43bc86 Adjust kasp tests to use 'checkds'
With 'checkds' replacing 'parent-registration-delay', the kasp
test needs the expected times to be adjusted. Also the system test
needs to call 'rndc dnssec -checkds' to progress the rollovers.

Since we pretend that the KSK is active as soon as the DS is
submitted (and parent registration delay is no longer applicable)
we can simplify the 'csk_rollover_predecessor_keytimes' function
to take only one "addtime" parameter.

This commit also slightly changes the 'check_dnssecstatus' function,
passing the zone as a parameter.
2020-08-07 11:26:09 +02:00
Matthijs Mekking e3eb55fd1c Fix time printing in key files
Don't strip off the final character when printing times in key files.

With the introduction of 'rndc dnssec -status' we introduced
'isc_stdtime_tostring()'. This changed in behavior such that it was no
longer needed to strip of the final '\n' of the string format
datetime. However, in 'printtime()' it still stripped the final
character.
2020-08-07 11:26:09 +02:00
Matthijs Mekking 04d8fc0143 Implement 'rndc dnssec -checkds'
Add a new 'rndc' command 'dnssec -checkds' that allows the user to
signal named that a new DS record has been seen published in the
parent, or that an existing DS record has been withdrawn from the
parent.

Upon the 'checkds' request, 'named' will write out the new state for
the key, updating the 'DSPublish' or 'DSRemoved' timing metadata.

This replaces the "parent-registration-delay" configuration option,
this was unreliable because it was purely time based (if the user
did not actually submit the new DS to the parent for example, this
could result in an invalid DNSSEC state).

Because we cannot rely on the parent registration delay for state
transition, we need to replace it with a different guard. Instead,
if a key wants its DS state to be moved to RUMOURED, the "DSPublish"
time must be set and must not be in the future. If a key wants its
DS state to be moved to UNRETENTIVE, the "DSRemoved" time must be set
and must not be in the future.

By default, with '-checkds' you set the time that the DS has been
published or withdrawn to now, but you can set a different time with
'-when'. If there is only one KSK for the zone, that key has its
DS state moved to RUMOURED. If there are multiple keys for the zone,
specify the right key with '-key'.
2020-08-07 11:26:09 +02:00
Michał Kępień f0fa6f0245 Merge branch 'michal/remove-arm64-jobs-from-gitlab-ci' into 'main'
Remove arm64 jobs from GitLab CI

See merge request isc-projects/bind9!3920
2020-08-05 10:07:20 +00:00
Michał Kępień 49f245f7c0 Remove arm64 jobs from GitLab CI
The only arm64 runner we have at our disposal is suffering from
intermittent connectivity issues which make it unusable for extended
periods of time.  Remove arm64 jobs from GitLab CI until we manage to
set up an arm64 runner with more reliable connectivity.
2020-08-05 12:04:59 +02:00
Michał Kępień 72786a27c7 Merge branch '2065-set-max-cache-size-in-the-geoip2-system-test' into 'main'
Set "max-cache-size" in the "geoip2" system test

Closes #2065

See merge request isc-projects/bind9!3919
2020-08-05 09:07:52 +00:00
Michał Kępień 4292d5bdfe Set "max-cache-size" in the "geoip2" system test
The named configuration files used in the "geoip2" system test cause a
rather large number of views (6-8) to be set up in each tested named
instance.  Each view has its own cache.

Commit e24bc324b4 caused the RBT hash
table to be pre-allocated to a size derived from "max-cache-size", so
that it never needs to be rehashed.  The size of that hash table is not
expected to be significant enough to cause memory use issues in typical
conditions even for large "max-cache-size" settings.

However, these two factors combined can cause memory exhaustion issues
in GitLab CI, where we run multiple "instances" of the test suite in
parallel on the same runner, each test suite executes multiple system
tests concurrently, and each system test may potentially start multiple
named instances at the same time.  In practice, this problem currently
only seems to be affecting the "geoip2" system test, which is failing
intermittently due to named instances used by that test getting killed
by oom-killer.

Prevent the "geoip2" system test from failing intermittently by setting
"max-cache-size" in named configuration files used in that test to a low
value in order to keep memory usage at bay even with a large number of
views configured.
2020-08-05 10:38:06 +02:00
Michał Kępień 550b82e27b Merge branch '2030-bind-arm-incorrectly-documents-the-processing-of-forwarders-still-has-the-pre-9-3-0-explanation' into 'main'
Resolve "BIND ARM incorrectly documents the processing of forwarders (still has the pre 9.3.0 explanation)"

Closes #2030

See merge request isc-projects/bind9!3881
2020-08-04 19:44:27 +00:00
Suzanne GoldlustandMichał Kępień 30e126ad02 Update description of forwarding behavior in ARM 2020-08-04 21:39:31 +02:00
Michał Kępień 500527b4da Merge branch 'michal/add-placeholder-for-1475' into 'main'
Add placeholder for #1475

See merge request isc-projects/bind9!3916
2020-08-04 13:49:37 +00:00
Michał Kępień 232297142d Add placeholder for #1475 2020-08-04 15:46:34 +02:00
Mark Andrews dc8fe44224 Merge branch 'marka-DNS_R_BADTSIG-map-to-FORMERR' into 'main'
Map DNS_R_BADTSIG to FORMERR

See merge request isc-projects/bind9!3877
2020-08-04 13:02:24 +00:00
Mark Andrews 88ff6b846c Check rcode is FORMERR 2020-08-04 12:20:37 +00:00
Mark Andrews 20488d6ad3 Map DNS_R_BADTSIG to FORMERR
Now that the log message has been printed set the result code to
DNS_R_FORMERR.  We don't do this via dns_result_torcode() as we
don't want upstream errors to produce FORMERR if that processing
end with DNS_R_BADTSIG.
2020-08-04 12:20:37 +00:00
Matthijs Mekking bf760383e8 Merge branch 'ondrej/serve-stale-improvements' into 'main'
Serve-stale improvements

Closes #1712 and #1829

See merge request isc-projects/bind9!3872
2020-08-04 12:17:57 +00:00
Ondřej SurýandMatthijs Mekking dd62275152 Add CHANGES and release notes for GL #1712 and GL #1829 2020-08-04 10:51:09 +02:00
Ondřej SurýandMatthijs Mekking abc2ab9223 Add tests with stale-cache-disabled into serve-stale system test
Add a fifth named (ns5) that runs with `stale-cache-enable no;` and
check that there are no stale records in the cache.
2020-08-04 10:50:31 +02:00
Ondřej SurýandMatthijs Mekking 6ffa2ddae0 Expire the 0 TTL RRSet quickly rather using them for serve-stale
When a received RRSet has TTL 0, they would be preserved for
serve-stale (default `max-stale-cache` is 12 hours) rather than expiring
them quickly from the cache database.

This commit makes sure the RRSet didn't have TTL 0 before marking the
entry in the database as "stale".
2020-08-04 10:50:31 +02:00
Ondřej SurýandMatthijs Mekking ce53db34d6 Add stale-cache-enable option and disable serve-stable by default
The current serve-stale implementation in BIND 9 stores all received
records in the cache for a max-stale-ttl interval (default 12 hours).

This allows DNS operators to turn the serve-stale answers in an event of
large authoritative DNS outage.  The caching of the stale answers needs
to be enabled before the outage happens or the feature would be
otherwise useless.

The negative consequence of the default setting is the inevitable
cache-bloat that happens for every and each DNS operator running named.

In this MR, a new configuration option `stale-cache-enable` is
introduced that allows the operators to selectively enable or disable
the serve-stale feature of BIND 9 based on their decision.

The newly introduced option has been disabled by default,
e.g. serve-stale is disabled in the default configuration and has to be
enabled if required.
2020-08-04 10:50:31 +02:00
Mark Andrews f2040a0039 Merge branch '2026-readme-md-typo' into 'main'
Resolve "README.md -- typo"

Closes #2026

See merge request isc-projects/bind9!3912
2020-08-04 02:23:54 +00:00
Mark Andrews 532bf267af Fixup typo in 'xcode-select --install' 2020-08-04 12:19:15 +10:00
Michał Kępień 4b6113379a Merge branch 'michal/restore-placeholder-entry-at-sequence-number-5481' into 'main'
Restore placeholder entry at sequence number 5481

See merge request isc-projects/bind9!3910
2020-08-03 20:13:12 +00:00
Michał Kępień 029e32c01a Restore placeholder entry at sequence number 5481 2020-08-03 22:09:47 +02:00
Ondřej Surý 0c85c4c424 Merge branch 'ondrej/add-isc_lex-fuzzing-test' into 'main'
Re-enable tests in fuzz directory and add isc_lex_gettoken() and isc_lex_getmastertoken() tests

See merge request isc-projects/bind9!3908
2020-07-31 15:55:58 +00:00
Ondřej SurýandOndřej Surý ba99bdbf6f Add fuzzing for the isc_lex (isc_lex_gettoken,isc_lex_getmastertoken) API
In this commit, the simple fuzzing tests for the isc_lex_gettoken() and
isc_lex_getmastertoken() functions have been added.

As part of this commit, the initialization has been moved from fuzz.h
constructor/destructor to LLVMFuzzerInitialize() in each fuzz test.  The
main.c of no-fuzzing and AFL modes have been modified to run the
LLVMFuzzerInitialize() at the start of the main() function mimicking
the libfuzzer mode of operation.
2020-07-31 17:28:35 +02:00
Ondřej Surý 23b1caabae Re-enable the fuzzing tests
The fuzzing tests were temporarily disabled when the build system has been
converted to automake.  This commit restores the functionality to run the
fuzzing tests as part of the `make check`.  When the afl or libfuzzer
is enabled via ./configure, it uses a custom LOG_DRIVER (fuzz/<fuzzer.sh>).

Currently only libfuzzer.sh has been implemented that runs each fuzz
test for 5 seconds each.
2020-07-31 17:28:35 +02:00
Ondřej Surý 8acdccc955 Merge branch '2038-use-freebind-when-bind-fails' into 'main'
Resolve "Bind not handling interfaces changes correctly when listen-on-v6  any  specified"

Closes #2038

See merge request isc-projects/bind9!3873
2020-07-31 11:32:40 +00:00
Witold KręcickiandOndřej Surý 94eda43ab2 Add CHANGES and release note for GL #2038 2020-07-31 12:44:22 +02:00
Witold KręcickiandOndřej Surý a0f7d28967 netmgr: retry binding with IP_FREEBIND when EADDRNOTAVAIL is returned.
When a new IPv6 interface/address appears it's first in a tentative
state - in which we cannot bind to it, yet it's already being reported
by the route socket. Because of that BIND9 is unable to listen on any
newly detected IPv6 addresses. Fix it by setting IP_FREEBIND option (or
equivalent option on other OSes) and then retrying bind() call.
2020-07-31 12:44:22 +02:00
Ondřej Surý 2ac7748d2b Merge branch 'ondrej/remove-distros-near-eol' into 'main'
Remove CentOS 6 from GitLab CI, it will EOL before BIND 9.18 is released

See merge request isc-projects/bind9!3799
2020-07-31 10:27:03 +00:00
Ondřej Surý db1b344020 Remove CentOS 6 from GitLab CI
CentOS 6 will reach EoL on November 30th, 2020, i.e. before BIND 9.18
will be released.  Remove it from GitLab CI.
2020-07-31 12:09:17 +02:00
Ondřej Surý fcdf0d3bc3 Merge branch 'ondrej/documentation-rebuild' into 'main'
Rebuild the documentation

See merge request isc-projects/bind9!3905
2020-07-31 08:52:28 +00:00
Ondřej Surý 4a8670ddaf Rebuild the documentation 2020-07-31 10:02:23 +02:00
Ondřej Surý 12c9a767eb Merge branch 'ondrej/august-release-placeholders-1' into 'main'
Add placeholders for August release

See merge request isc-projects/bind9!3903
2020-07-31 07:28:38 +00:00
Ondřej Surý 852c5cde5a Add CHANGES placeholder for [GL #2055] 2020-07-31 09:27:00 +02:00
Ondřej Surý c50fb6f30d Add CHANGES placeholder for [GL #1997] 2020-07-31 09:24:56 +02:00
Ondřej Surý 107e6997fb Add CHANGES placeholder for [GL #1996] 2020-07-31 09:23:52 +02:00
Ondřej Surý ec4883ff52 Add CHANGES placeholder for [GL #2037] 2020-07-31 09:21:32 +02:00
Mark Andrews 649cb54400 Merge branch '2020-configure-call-needs-to-be-cleaned-up-main-gcc-centos6-amd64' into 'main'
Resolve "configure call needs to be cleaned up main: gcc:centos6:amd64"

Closes #2020

See merge request isc-projects/bind9!3853
2020-07-31 06:26:11 +00:00
Mark Andrews 305ca032a0 remove --with-python from summary 2020-07-31 05:21:40 +00:00
Mark Andrews 355b7899ee remove references to --with-libtool 2020-07-31 05:21:40 +00:00
Mark Andrews 11207eacd5 Remove --with-libtool comment from README 2020-07-31 05:21:40 +00:00
Mark Andrews 2cd8fc02b0 Remove no longer valid configure flags from configure calls:
--with-libtool, --without-make-clean, --with-python
2020-07-31 05:21:40 +00:00
Mark Andrews 9b0b045554 Merge branch '1456-always-check-return-from-isc_refcount_decrement' into 'main'
Resolve "always check return from isc_refcount_decrement"

Closes #1456

See merge request isc-projects/bind9!2707
2020-07-31 00:56:45 +00:00
Mark Andrews bde5c7632a Always check the return from isc_refcount_decrement.
Created isc_refcount_decrement_expect macro to test conditionally
the return value to ensure it is in expected range.  Converted
unchecked isc_refcount_decrement to use isc_refcount_decrement_expect.
Converted INSIST(isc_refcount_decrement()...) to isc_refcount_decrement_expect.
2020-07-31 10:15:44 +10:00
Mark Andrews 92059fc7db Merge branch '2033-rndc-dnstap-roll-fix-was-incomplete' into 'main'
Resolve "'rndc dnstap --roll' fix was incomplete"

Closes #2033

See merge request isc-projects/bind9!3868
2020-07-30 23:59:42 +00:00
Mark Andrews aca18b8b5b Refactor the code that counts the last log version to keep
When silencing the Coverity warning in remove_old_tsversions(), the code
was refactored to reduce the indentation levels and break down the long
code into individual functions.  This improve fix for [GL #1989].
2020-07-31 09:30:12 +10:00
Michal Nowak d9f862337a Merge branch '48-drop-systemtesttop-from-bin-tests-system' into 'main'
Drop $SYSTEMTESTTOP from bin/tests/system/

Closes #48

See merge request isc-projects/bind9!3623
2020-07-30 14:14:39 +00:00
Michal Nowak 954731cfa3 Make sure we don't introduce SYSTEMTESTTOP anymore
':!.gitlab-ci.yml' is a pathspec pattern used to limit paths in the "git
grep" command to all but the .gitlab-ci.yml file which includes the
checked word itself. This requires Git 2.13.
2020-07-30 15:58:54 +02:00
Michal Nowak a3b02d627f Remove cross-test dependency on ckdnsrps.sh 2020-07-30 15:58:54 +02:00
Michal Nowak 68488dd98c Fix name of the test directory of stop.pl in masterformat test 2020-07-30 15:58:54 +02:00
Michal Nowak 32ee08e21a Ensure test fails if packet.pl does not work as expected 2020-07-30 15:58:54 +02:00
Michal Nowak 14bc22d7a4 Source config.guess from source root
It seems that config.guess gets always created in source root, so for
that sake of out-of-tree system test, we should expect the file there
instead of where configure was run.
2020-07-30 15:58:53 +02:00
Michal Nowak 093af1c00a Drop $SYSTEMTESTTOP from bin/tests/system/
The $SYSTEMTESTTOP shell variable if often set to .. in various shell
scripts inside bin/tests/system/, but most of the time it is only
used one line later, while sourcing conf.sh. This hardly improves
code readability.

$SYSTEMTESTTOP is also used for the purpose of referencing
scripts/files living in bin/tests/system/, but given that the
variable is always set to a short, relative path, we can drop it and
replace all of its occurrences with the relative path without adversely
affecting code readability.
2020-07-30 15:58:50 +02:00
Michał Kępień 6237be992f Merge branch 'michal/only-run-system-tests-as-root-in-developer-mode' into 'main'
Only run system tests as root in developer mode

See merge request isc-projects/bind9!3894
2020-07-30 13:45:00 +00:00
Michał Kępień 3ef106f69d Only run system tests as root in developer mode
Running system tests with root privileges is potentially dangerous.
Only allow it when explicitly requested (by building with
--enable-developer).
2020-07-30 14:07:49 +02:00
Michał Kępień 1ce582ca47 Merge branch '2024-fix-idle-timeout-for-connected-tcp-sockets' into 'main'
Fix idle timeout for connected TCP sockets

Closes #2024

See merge request isc-projects/bind9!3854
2020-07-30 09:32:07 +00:00
Michał Kępień 18efb2456f Add CHANGES for GL #2024 2020-07-30 10:58:39 +02:00
Michał Kępień 953d704bd2 Fix idle timeout for connected TCP sockets
When named acting as a resolver connects to an authoritative server over
TCP, it sets the idle timeout for that connection to 20 seconds.  This
fixed timeout was picked back when the default processing timeout for
each client query was hardcoded to 30 seconds.  Commit
000a8970f8 made this processing timeout
configurable through "resolver-query-timeout" and decreased its default
value to 10 seconds, but the idle TCP timeout was not adjusted to
reflect that change.  As a result, with the current defaults in effect,
a single hung TCP connection will consistently cause the resolution
process for a given query to time out.

Set the idle timeout for connected TCP sockets to half of the client
query processing timeout configured for a resolver.  This allows named
to handle hung TCP connections more robustly and prevents the timeout
mismatch issue from resurfacing in the future if the default is ever
changed again.
2020-07-30 10:58:39 +02:00
Mark Andrews e7771dc902 Merge branch 'marka-placeholder' into 'main'
placeholder for [GL #2028]

See merge request isc-projects/bind9!3893
2020-07-29 23:39:16 +00:00
Mark Andrews 8e142e6e80 placeholder for [GL #2028] 2020-07-30 09:34:58 +10:00
Evan Hunt c99381ce20 Merge branch '2050-libuv-version' into 'main'
report libuv version string in `named -V`

Closes #2050

See merge request isc-projects/bind9!3887
2020-07-28 02:49:19 +00:00
Evan Hunt 1036338a10 report libuv version string in named -V 2020-07-28 02:41:39 +00:00
Evan Hunt 730226b674 Merge branch '2031-win32-fix' into 'main'
Resolve "Windows crashes with netmgr-based statschannel"

Closes #2031

See merge request isc-projects/bind9!3888
2020-07-27 21:33:07 +00:00
Evan Hunt 881b635141 initialize, rather than invalidating, new http buffers
when building without ISC_BUFFER_USEINLINE (which is the default on
Windows) an assertion failure could occur when setting up a new
isc_httpd_t object for the statistics channel.
2020-07-27 14:29:37 -07:00
Diego dos Santos Fronza 83b50bb901 Merge branch '1619-rpz-wildcard-passthru-ignored' into 'main'
Resolve "RPZ wildcard passthru ignored"

Closes #1619

See merge request isc-projects/bind9!3682
2020-07-27 14:34:08 +00:00
Diego FronzaandEvan Hunt ad6f65649a Add CHANGES entry 2020-07-24 11:48:14 -07:00
Diego FronzaandEvan Hunt c5a4bc8bcc Add test for RPZ wildcard passthru ignored fix 2020-07-24 11:48:14 -07:00
Diego FronzaandEvan Hunt c2928c2ed4 Fix rpz wildcard name matching
Whenever an exact match is found by dns_rbt_findnode(),
the highest level node in the chain will not be put into
chain->levels[] array, but instead the chain->end
pointer will be adjusted to point to that node.

Suppose we have the following entries in a rpz zone:
example.com     CNAME rpz-passthru.
*.example.com   CNAME rpz-passthru.

A query for www.example.com would result in the
following chain object returned by dns_rbt_findnode():

chain->level_count = 2
chain->level_matches = 2
chain->levels[0] = .
chain->levels[1] = example.com
chain->levels[2] = NULL
chain->end = www

Since exact matches only care for testing rpz set bits,
we need to test for rpz wild bits through iterating the nodechain, and
that includes testing the rpz wild bits in the highest level node found.

In the case of an exact match, chain->levels[chain->level_matches]
will be NULL, to address that we must use chain->end as the start point,
then iterate over the remaining levels in the chain.
2020-07-24 11:34:40 -07:00
Michal Nowak 5ab7d1c920 Merge branch '1999-add-a-regular-make-dist-job-to-ci' into 'main'
Add a regular "make dist" job to CI

Closes #1999

See merge request isc-projects/bind9!3803
2020-07-24 13:53:54 +00:00
Michal Nowak 654c64c60b Add a regular "make dist" job to CI
It's easy to break "make dist" by adding and moving files around.
We should test this scenario regularly, to prevent release-time
surprises.
2020-07-24 15:27:25 +02:00
Mark Andrews a14445d472 Merge branch '2043-dns_rdata_hip_next-fails-to-return-isc_r_nomore-at-the-right-time' into 'main'
Resolve "dns_rdata_hip_next() fails to return ISC_R_NOMORE at the right time."

Closes #2043

See merge request isc-projects/bind9!3880
2020-07-24 05:19:45 +00:00
Mark Andrews bcd049f116 Add CHANGES note 2020-07-24 04:15:56 +00:00
Mark Andrews 78db46d746 Check walking the hip rendezvous servers.
Also fixes extraneous white space at end of record when
there are no rendezvous servers.
2020-07-24 04:15:56 +00:00
Mark Andrews e31bcac441 Merge branch 'marka-add-fallthrough' into 'main'
Add fallthrough and braces

See merge request isc-projects/bind9!3884
2020-07-24 04:15:03 +00:00
Mark Andrews 70c060120f Add fallthrough and braces 2020-07-24 13:49:56 +10:00
Mark Andrews 1ba814a28c Merge branch 'feature/master/unix-cleanup' into 'main'
Remove few lines in unix socket handling

See merge request isc-projects/bind9!2687
2020-07-24 03:02:07 +00:00
Petr MenšíkandMark Andrews 72d81c4768 Remove few lines in unix socket handling
Reuse the same checks two times, make difference minimal.
2020-07-24 12:59:38 +10:00
Mark Andrews cc1b77a0c7 Merge branch 'dstlib-failure-abort' into 'main'
Prevent crash on dst initialization failure

See merge request isc-projects/bind9!3876
2020-07-23 00:46:12 +00:00
Petr MenšíkandMark Andrews c5e7152cf0 Prevent crash on dst initialization failure
server might be created, but not yet fully initialized, when fatal
function is called. Check both server and task before attaching
exclusive task.
2020-07-23 00:31:52 +00:00
Michal Nowak 064e314df7 Merge branch '1727-drop-use-of-featuretest-have-dlopen' into 'main'
Drop feature test for dlopen()

Closes #1727

See merge request isc-projects/bind9!3625
2020-07-21 09:24:38 +00:00
Michal Nowak 2064e01cd0 Drop feature test for dlopen()
With libtool being mandatory from 9.17 on, so is dlopen() (via libltdl).
2020-07-21 11:22:13 +02:00
Ondřej Surý 451ed397f0 Merge branch '1775-resizing-growing-of-cache-hash-tables-causes-delays-in-processing-of-client-queries' into 'main'
Fix the rbt hashtable and grow it when setting max-cache-size

Closes #1775

See merge request isc-projects/bind9!3865
2020-07-21 08:38:26 +00:00
Ondřej Surý 2b4f0f03f5 Add CHANGES and release note for #1775 2020-07-21 08:44:26 +02:00
Ondřej Surý a9182c89a6 Change the dns_name hashing to use 32-bit values
Change the dns_hash_name() and dns_hash_fullname() functions to use
isc_hash32() as the maximum hashtable size in rbt is 0..UINT32_MAX
large.
2020-07-21 08:44:26 +02:00
Ondřej Surý f59fd49fd8 Add isc_hash32() and rename isc_hash_function() to isc_hash64()
As the names suggest the original isc_hash64 function returns 64-bit
long hash values and the isc_hash32() returns 32-bit values.
2020-07-21 08:44:26 +02:00
Ondřej Surý 344d66aaff Add HalfSipHash 2-4 reference implementation
The HalfSipHash implementation has 32-bit keys and returns 32-bit
value.
2020-07-21 08:44:26 +02:00
Ondřej Surý 21d751dfc7 Remove OpenSSL based SipHash 2-4 implementation
Creation of EVP_MD_CTX and EVP_PKEY is quite expensive, so until we fix the code
to reuse the OpenSSL contexts and keys we'll use our own implementation of
siphash instead of trying to integrate with OpenSSL.
2020-07-21 08:44:26 +02:00
Ondřej Surý e24bc324b4 Fix the rbt hashtable and grow it when setting max-cache-size
There were several problems with rbt hashtable implementation:

1. Our internal hashing function returns uint64_t value, but it was
   silently truncated to unsigned int in dns_name_hash() and
   dns_name_fullhash() functions.  As the SipHash 2-4 higher bits are
   more random, we need to use the upper half of the return value.

2. The hashtable implementation in rbt.c was using modulo to pick the
   slot number for the hash table.  This has several problems because
   modulo is: a) slow, b) oblivious to patterns in the input data.  This
   could lead to very uneven distribution of the hashed data in the
   hashtable.  Combined with the single-linked lists we use, it could
   really hog-down the lookup and removal of the nodes from the rbt
   tree[a].  The Fibonacci Hashing is much better fit for the hashtable
   function here.  For longer description, read "Fibonacci Hashing: The
   Optimization that the World Forgot"[b] or just look at the Linux
   kernel.  Also this will make Diego very happy :).

3. The hashtable would rehash every time the number of nodes in the rbt
   tree would exceed 3 * (hashtable size).  The overcommit will make the
   uneven distribution in the hashtable even worse, but the main problem
   lies in the rehashing - every time the database grows beyond the
   limit, each subsequent rehashing will be much slower.  The mitigation
   here is letting the rbt know how big the cache can grown and
   pre-allocate the hashtable to be big enough to actually never need to
   rehash.  This will consume more memory at the start, but since the
   size of the hashtable is capped to `1 << 32` (e.g. 4 mio entries), it
   will only consume maximum of 32GB of memory for hashtable in the
   worst case (and max-cache-size would need to be set to more than
   4TB).  Calling the dns_db_adjusthashsize() will also cap the maximum
   size of the hashtable to the pre-computed number of bits, so it won't
   try to consume more gigabytes of memory than available for the
   database.

   FIXME: What is the average size of the rbt node that gets hashed?  I
   chose the pagesize (4k) as initial value to precompute the size of
   the hashtable, but the value is based on feeling and not any real
   data.

For future work, there are more places where we use result of the hash
value modulo some small number and that would benefit from Fibonacci
Hashing to get better distribution.

Notes:
a. A doubly linked list should be used here to speedup the removal of
   the entries from the hashtable.
b. https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/
2020-07-21 08:44:26 +02:00
Michal Nowak 9dcf229634 Merge branch 'mnowak/try-harder-to-analyze-cores' into 'main'
Rationalize backtrace logging, fail on core file presence

See merge request isc-projects/bind9!3867
2020-07-20 08:13:37 +00:00
Michal NowakandMichał Kępień 1b13123c45 Check tests for core files regardless of test status
Failed test should be checked for core files et al. and have
backtrace generated.
2020-07-17 10:04:59 +02:00
Michal NowakandMichał Kępień 05c13e50d3 Rationalize backtrace logging
GDB backtrace generated via "thread apply all bt full" is too long for
standard output, lets save them to .txt file among other log files.
2020-07-17 10:04:04 +02:00
Michal NowakandMichał Kępień b232e8585a Ensure various test issues are treated as failures
Make sure bin/tests/system/run.sh returns a non-zero exit code if any of
the following happens:

  - the test being run produces a core dump,
  - assertion failures are found in the test's logs,
  - ThreadSanitizer reports are found after the test completes,
  - the servers started by the test fail to shut down cleanly.

This change is necessary to always fail a test in such cases (before the
migration to Automake, test failures were determined based on the
presence of "R:<test-name>:FAIL" lines in the test suite output and thus
it was not necessary for bin/tests/system/run.sh to return a non-zero
exit code).
2020-07-17 10:00:21 +02:00
Michał Kępień f27c0c3257 Merge branch 'michal/update-release-checklist' into 'main'
Update release checklist

See merge request isc-projects/bind9!3864
2020-07-16 09:31:09 +00:00
Michał Kępień 4fa2dfe72e Update release checklist
Add an item to the release checklist to make sure confidential issues
assigned to the relevant milestone are made public after the BIND
versions addressing them are released.
2020-07-16 11:28:09 +02:00
Evan Hunt b4cdd00fa3 Merge branch '2022-stats-netmgr' into 'main'
Resolve "use netmgr for statschannel"

Closes #2022

See merge request isc-projects/bind9!3847
2020-07-16 06:04:21 +00:00
Evan Hunt efa5639934 CHANGES, release note 2020-07-15 22:35:07 -07:00
Evan Hunt 69c1ee1ce9 rewrite statschannel to use netmgr
modify isc_httpd to use the network manager instead of the
isc_socket API.

also cleaned up bin/named/statschannel.c to use CHECK.
2020-07-15 22:35:07 -07:00
Michał Kępień d8e6b32a18 Merge branch 'v9_17_3-release' into 'main'
Merge 9.17.3 release branch

See merge request isc-projects/bind9!3860
2020-07-15 21:09:46 +00:00
Michał Kępień 2b2e97a815 Set up release notes for BIND 9.17.4 2020-07-15 23:06:25 +02:00
Michał Kępień 02de51d957 Bump BIND_BASELINE_VERSION for ABI checks 2020-07-15 23:06:25 +02:00
Michał Kępień 49c62f3e8e Fix "make dist" 2020-07-15 22:54:13 +02:00
Michał Kępień fc6d0a932b Update BIND version to 9.17.3 2020-07-15 22:54:13 +02:00
Michał Kępień 28d32ca7da Add a CHANGES marker 2020-07-15 22:54:13 +02:00
Michał Kępień 97a2733ef9 Update library API versions 2020-07-15 22:54:13 +02:00
Michał Kępień 3e74f894d4 Merge branch 'michal/prepare-release-notes-for-bind-9.17.3' into v9_17_3-release 2020-07-15 22:51:33 +02:00
Michał Kępień fba5ce8a75 Reorder release notes 2020-07-15 22:51:33 +02:00
Michał Kępień af35a186d0 Add release note for #1958 2020-07-15 22:51:33 +02:00
Michał Kępień eedbd6ecf5 Add release note for #1938 2020-07-15 22:51:33 +02:00
Michał Kępień 41a79d068c Add release note for #1937 2020-07-15 22:51:33 +02:00
Michał Kępień e9a869f51e Tweak and reword release notes 2020-07-15 22:51:33 +02:00
Michał Kępień aa1d6a46ab Prepare release notes for BIND 9.17.3 2020-07-15 22:51:32 +02:00
Michał Kępień 267794244f Tweak and reword recent CHANGES entries 2020-07-15 22:50:16 +02:00
Matthijs Mekking f8ef2c0439 Merge branch '2006-coverity-checked-return-keymgr' into 'main'
Fix Coverity keymgr reports

Closes #2006

See merge request isc-projects/bind9!3808
2020-07-14 15:46:56 +00:00
Matthijs Mekking e645d2ef1e Check return value of dst_key_getbool()
Fix Coverity CHECKED_RETURN reports for dst_key_getbool().  In most
cases we do not really care about its return value, but it is prudent
to check it.

In one case, where a dst_key_getbool() error should be treated
identically as success, cast the return value to void and add a relevant
comment.
2020-07-14 12:53:54 +00:00
Michał Kępień df72c52239 Merge branch 'michal/use-image-key-in-qemu-based-ci-job-templates' into 'main'
Use "image" key in QEMU-based CI job templates

See merge request isc-projects/bind9!3855
2020-07-14 08:24:42 +00:00
Michał Kępień 72201badf0 Use "image" key in QEMU-based CI job templates
Our GitLab Runner Custom executor scripts now use the "image" key
instead of the job name for determining the QCOW2 image to use for a
given CI job.  Update .gitlab-ci.yml to reflect that change.
2020-07-14 09:58:04 +02:00
Mark Andrews c53bfb30e8 Merge branch 'u/fanf2/fix-signing' into 'main'
Fix re-signing when `sig-validity-interval` has two arguments

See merge request isc-projects/bind9!3735
2020-07-14 02:07:28 +00:00
Mark Andrews 3ff60b881f Add release note for [GL !3735] 2020-07-14 10:59:59 +10:00
Mark Andrews f4fbca6e16 Add CHANGES note for [GL !3735] 2020-07-14 10:59:59 +10:00
Mark Andrews 11ecf7901b Add regression test for [GL !3735]
Check that resign interval is actually in days rather than hours
by checking that RRSIGs are all within the allowed day range.
2020-07-14 10:59:59 +10:00
Tony FinchandMark Andrews 030674b2a3 Fix re-signing when sig-validity-interval has two arguments
Since October 2019 I have had complaints from `dnssec-cds` reporting
that the signatures on some of my test zones had expired. These were
zones signed by BIND 9.15 or 9.17, with a DNSKEY TTL of 24h and
`sig-validity-interval 10 8`.

This is the same setup we have used for our production zones since
2015, which is intended to re-sign the zones every 2 days, keeping
at least 8 days signature validity. The SOA expire interval is 7
days, so even in the presence of zone transfer problems, no-one
should ever see expired signatures. (These timers are a bit too
tight to be completely correct, because I should have increased
the expiry timers when I increased the DNSKEY TTLs from 1h to 24h.
But that should only matter when zone transfers are broken, which
was not the case for the error reports that led to this patch.)

For example, this morning my test zone contained:

        dev.dns.cam.ac.uk. 86400 IN RRSIG DNSKEY 13 5 86400 (
                                20200701221418 20200621213022 ...)

But one of my resolvers had cached:

        dev.dns.cam.ac.uk. 21424 IN RRSIG DNSKEY 13 5 86400 (
                                20200622063022 20200612061136 ...)

This TTL was captured at 20200622105807 so the resolver cached the
RRset 64976 seconds previously (18h02m56s), at 20200621165511
only about 12h before expiry.

The other symptom of this error was incorrect `resign` times in
the output from `rndc zonestatus`.

For example, I have configured a test zone

        zone fast.dotat.at {
                file "../u/z/fast.dotat.at";
                type primary;
                auto-dnssec maintain;
                sig-validity-interval 500 499;
        };

The zone is reset to a minimal zone containing only SOA and NS
records, and when `named` starts it loads and signs the zone. After
that, `rndc zonestatus` reports:

        next resign node: fast.dotat.at/NS
        next resign time: Fri, 28 May 2021 12:48:47 GMT

The resign time should be within the next 24h, but instead it is
near the signature expiry time, which the RRSIG(NS) says is
20210618074847. (Note 499 hours is a bit more than 20 days.)
May/June 2021 is less than 500 days from now because expiry time
jitter is applied to the NS records.

Using this test I bisected this bug to 09990672d which contained a
mistake leading to the resigning interval always being calculated in
hours, when days are expected.

This bug only occurs for configurations that use the two-argument form
of `sig-validity-interval`.
2020-07-14 10:57:43 +10:00
Mark Andrews 2ac2d83265 Merge branch '1994-netscope-c-23-50-error-unused-parameter-addr-when-have_if_nametoindex-undefined-on-illumos' into 'main'
Resolve "netscope.c:23:50: error: unused parameter 'addr' when HAVE_IF_NAMETOINDEX undefined on illumos"

Closes #1994

See merge request isc-projects/bind9!3829
2020-07-14 00:51:22 +00:00
Mark Andrews e7662c4c63 Mark 'addr' as unused if HAVE_IF_NAMETOINDEX is not defined
Also 'zone' should be initialised to zero.
2020-07-14 00:13:40 +00:00
Mark Andrews 1a1e52b7fe Merge branch '1995-gssapictx-c-681-10-error-implicit-declaration-of-function-gsskrb5_register_acceptor_identity' into 'main'
Resolve "gssapictx.c:681:10: error: implicit declaration of function 'gsskrb5_register_acceptor_identity' on illumos"

Closes #1995

See merge request isc-projects/bind9!3830
2020-07-14 00:05:39 +00:00
Mark Andrews 488eef63ca Only call gsskrb5_register_acceptor_identity if we have gssapi_krb5.h. 2020-07-14 08:55:13 +10:00
Mark Andrews 35ea733e2c Merge branch '1993-check-c-1576-37-error-expected-identifier-before-numeric-constant-on-illumos' into 'main'
Resolve "check.c:1576:37: error: expected identifier before numeric constant on illumos"

Closes #1993

See merge request isc-projects/bind9!3828
2020-07-13 22:06:48 +00:00
Mark Andrews 18eef20241 Handle namespace clash over 'SEC' on illumos. 2020-07-14 07:46:10 +10:00
Mark Andrews bc5bd577d7 Merge branch '2005-coverity-is-reporting-double-unlock' into 'main'
Resolve "Coverity is reporting double unlock."

Closes #2005

See merge request isc-projects/bind9!3807
2020-07-13 21:28:10 +00:00
Mark Andrews 4e03bfac86 Add CHANGES for [GL #2005] 2020-07-14 07:07:58 +10:00
Mark Andrews cc0089c66b Address potential double unlock in process_fd 2020-07-14 07:07:14 +10:00
Evan Hunt d97710acdc Merge branch 'each-rndc-netmgr-pt2' into 'main'
RNDC using netmgr

See merge request isc-projects/bind9!3724
2020-07-13 20:39:49 +00:00
Evan Hunt 7c703c851f CHANGES, release note 2020-07-13 13:17:08 -07:00
Witold KręcickiandEvan Hunt ae5d316f64 isccc: merge recv_message and recv_nonce into one function
- make isccc message receiving code clearer by merging recv_nonce and
  recv_message into a single recv_data function and adding a boolean
  state field.
2020-07-13 13:17:08 -07:00
Evan Hunt 55896df79d use handles for isc_nm_pauseread() and isc_nm_resumeread()
by having these functions act on netmgr handles instead of socket
objects, they can be used in callback functions outside the netgmr.
2020-07-13 13:17:08 -07:00
Evan Hunt 29dcdeba1b purge pending command events when shutting down
When we're shutting the system down via "rndc stop" or "rndc halt",
or reconfiguring the control channel, there are potential shutdown
races between the server task and network manager.  These are adressed by:

- purging any pending command tasks when shutting down the control channel
- adding an extra handle reference before the command handler to
  ensure the handle can't be deleted out from under us before calling
  command_respond()
2020-07-13 13:17:08 -07:00
Evan Hunt 45ab0603eb use an isc_task to execute rndc commands
- using an isc_task to execute all rndc functions makes it relatively
  simple for them to acquire task exclusive mode when needed
- control_recvmessage() has been separated into two functions,
  control_recvmessage() and control_respond(). the respond function
  can be called immediately from control_recvmessage() when processing
  a nonce, or it can be called after returning from the task event
  that ran the rndc command function.
2020-07-13 13:16:53 -07:00
Evan Hunt 3551d3ffd2 convert rndc and control channel to use netmgr
- updated libisccc to use netmgr events
- updated rndc to use isc_nm_tcpconnect() to establish connections
- updated control channel to use isc_nm_listentcp()

open issues:

- the control channel timeout was previously 60 seconds, but it is now
  overridden by the TCP idle timeout setting, which defaults to 30
  seconds. we should add a function that sets the timeout value for
  a specific listener socket, instead of always using the global value
  set in the netmgr. (for the moment, since 30 seconds is a reasonable
  timeout for the control channel, I'm not prioritizing this.)
- the netmgr currently has no support for UNIX-domain sockets; until
  this is addressed, it will not be possible to configure rndc to use
  them. we will need to either fix this or document the change in
  behavior.
2020-07-13 13:16:53 -07:00
Evan Hunt 002c328437 don't use exclusive mode for rndc commands that don't need it
"showzone" and "tsig-list" both used exclusive mode unnecessarily;
changing this will simplify future refactoring a bit.
2020-07-13 13:12:33 -07:00
Evan Hunt 0580d9cd8c style cleanup
clean up style in rndc and the control channel in preparation for
changing them to use the new network manager.
2020-07-13 12:41:04 -07:00
Evan Hunt e7602e2d51 Merge branch 'each-lmdb-lock-fix' into 'main'
ensure new_zone_lock is released after count_newzones()

See merge request isc-projects/bind9!3833
2020-07-13 19:26:46 +00:00
Evan Hunt ed37c63e2b make sure new_zone_lock is locked before unlocking it
it was possible for the count_newzones() function to try to
unlock view->new_zone_lock on return before locking it, which
caused a crash on shutdown.
2020-07-13 12:06:26 -07:00
Diego dos Santos Fronza 4aaef76c58 Merge branch '1719-observed-stats-underflow-in-multiple-stats' into 'main'
Resolve "Observed stats underflow in multiple stats"

Closes #1719

See merge request isc-projects/bind9!3818
2020-07-13 18:28:58 +00:00
Diego Fronza a22e61d554 Add CHANGES and release note for #1719 2020-07-13 11:48:55 -03:00
Diego Fronza aab691d512 Fix ns_statscounter_recursclients underflow
The basic scenario for the problem was that in the process of
resolving a query, if any rrset was eligible for prefetching, then it
would trigger a call to query_prefetch(), this call would run in
parallel to the normal query processing.

The problem arises due to the fact that both query_prefetch(), and,
in the original thread, a call to ns_query_recurse(), try to attach
to the recursionquota, but recursing client stats counter is only
incremented if ns_query_recurse() attachs to it first.

Conversely, if fetch_callback() is called before prefetch_done(),
it would not only detach from recursionquota, but also decrement
the stats counter, if query_prefetch() attached to te quota first
that would result in a decrement not matched by an increment, as
expected.

To solve this issue an atomic bool was added, it is set once in
ns_query_recurse(), allowing fetch_callback() to check for it
and decrement stats accordingly.

For a more compreensive explanation check the thread comment below:
https://gitlab.isc.org/isc-projects/bind9/-/issues/1719#note_145857
2020-07-13 11:46:18 -03:00
Mark Andrews 600128ac27 Merge branch '1235-system-tests-fail-with-new-etc-bind-keys-installed' into 'main'
Fallback to built in trust-anchors, managed-keys, or trusted-keys

Closes #1235

See merge request isc-projects/bind9!3827
2020-07-13 05:09:10 +00:00
Mark Andrews d02a14c795 Fallback to built in trust-anchors, managed-keys, or trusted-keys
if the bind.keys file cannot be parsed.
2020-07-13 14:12:14 +10:00
Mark Andrews 1d739a95dd Merge branch '1989-rndc-dnstap-roll-with-too-big-a-argument-128-can-cause-a-buffer-overflow' into 'main'
Resolve "'rndc dnstap --roll' with too big a argument (>128) can cause a buffer overflow."

Closes #1989

See merge request isc-projects/bind9!3788
2020-07-13 03:52:02 +00:00
Mark Andrews 42b2290c3a Add changes for [GL #1989] 2020-07-13 13:10:45 +10:00
Mark Andrews 6ca78bc57d Address overrun in remove_old_tsversions
If too many versions of log / dnstap files to be saved where requests
the memory after to_keep could be overwritten.  Force the number of
versions to be saved to a save level.  Additionally the memmove length
was incorrect.
2020-07-13 13:10:45 +10:00
Mark Andrews 98de853740 Merge branch '2012-add-assertion-check-to-silence-dereference-before-null-check-in-tsig_test-c-v9_11' into 'main'
Resolve "Add assertion check to silence dereference before NULL check in tsig_test.c"

Closes #2012

See merge request isc-projects/bind9!3814
2020-07-13 03:06:25 +00:00
Mark Andrews 827746e89b Assert tsigout is non-NULL 2020-07-13 02:26:06 +00:00
Mark Andrews 1c73ea491b Merge branch '2014-statschannel-system-test-failed-at-setup-stage' into 'main'
Resolve "Statschannel system test failed at setup stage."

Closes #2014

See merge request isc-projects/bind9!3823
2020-07-13 02:22:09 +00:00
Mark Andrews a0e8a11cc6 Don't verify the zone when setting expire to "now+1s" as it can fail
as too much wall clock time may have elapsed.

Also capture signzone output for forensic analysis
2020-07-13 01:39:13 +00:00
Mark Andrews ef55dbf4fc Merge branch '2013-unchecked-returns-of-inet_pton-in-geoip_test-c' into 'main'
Resolve "Unchecked returns of inet_pton in geoip_test.c"

Closes #2013

See merge request isc-projects/bind9!3815
2020-07-13 01:21:52 +00:00
Mark Andrews 9499adeb5e check returns from inet_pton() 2020-07-13 00:31:29 +00:00
Mark Andrews 2e89dd7cb8 Merge branch 'marka-placeholder' into 'main'
placeholder for [GL #2010]

See merge request isc-projects/bind9!3834
2020-07-13 00:23:01 +00:00
Mark Andrews 93a336e248 placeholder for [GL #2010] 2020-07-13 00:21:22 +00:00
Mark Andrews b02c3e4f8e Merge branch '2003-remove-redundant-listener-null-check' into 'main'
Resolve "Remove redundant listener != NULL check"

Closes #2003

See merge request isc-projects/bind9!3806
2020-07-13 00:13:52 +00:00
Mark Andrews c91dc92410 Remove redundant check for listener being non-NULL 2020-07-12 23:46:35 +00:00
Michał Kępień a87ac96b56 Merge branch '1976-fix-locking-for-lmdb-0.9.26' into 'main'
Fix locking for LMDB 0.9.26

Closes #1976

See merge request isc-projects/bind9!3758
2020-07-10 09:50:47 +00:00
Michał Kępień 7fffa5abba Add CHANGES for GL #1976 2020-07-10 11:29:18 +02:00
Michał Kępień 53120279b5 Fix locking for LMDB 0.9.26
When "rndc reconfig" is run, named first configures a fresh set of views
and then tears down the old views.  Consider what happens for a single
view with LMDB enabled; "envA" is the pointer to the LMDB environment
used by the original/old version of the view, "envB" is the pointer to
the same LMDB environment used by the new version of that view:

 1. mdb_env_open(envA) is called when the view is first created.
 2. "rndc reconfig" is called.
 3. mdb_env_open(envB) is called for the new instance of the view.
 4. mdb_env_close(envA) is called for the old instance of the view.

This seems to have worked so far.  However, an upstream change [1] in
LMDB which will be part of its 0.9.26 release prevents the above
sequence of calls from working as intended because the locktable mutexes
will now get destroyed by the mdb_env_close() call in step 4 above,
causing any subsequent mdb_txn_begin() calls to fail (because all of the
above steps are happening within a single named process).

Preventing the above scenario from happening would require either
redesigning the way we use LMDB in BIND, which is not something we can
easily backport, or redesigning the way BIND carries out its
reconfiguration process, which would be an even more severe change.

To work around the problem, set MDB_NOLOCK when calling mdb_env_open()
to stop LMDB from controlling concurrent access to the database and do
the necessary locking in named instead.  Reuse the view->new_zone_lock
mutex for this purpose to prevent the need for modifying struct dns_view
(which would necessitate library API version bumps).  Drop use of
MDB_NOTLS as it is made redundant by MDB_NOLOCK: MDB_NOTLS only affects
where LMDB reader locktable slots are stored while MDB_NOLOCK prevents
the reader locktable from being used altogether.

[1] https://git.openldap.org/openldap/openldap/-/commit/2fd44e325195ae81664eb5dc36e7d265927c5ebc
2020-07-10 11:29:18 +02:00
504 changed files with 6074 additions and 4271 deletions
+2
View File
@@ -1,6 +1,8 @@
*.sln.in eol=crlf
*.vcxproj.* eol=crlf
/fuzz/dns_rdata_fromwire_text.in/input-* -text
.gitignore export-ignore
/conftools export-ignore
/doc/design export-ignore
+86 -109
View File
@@ -44,9 +44,7 @@ stages:
### Runner Tag Templates
# Note: BSD runners extract the operating system version to use from job name
.freebsd-amd64: &freebsd_amd64
.libvirt-amd64: &libvirt_amd64
tags:
- libvirt
- amd64
@@ -56,21 +54,11 @@ stages:
- linux
- amd64
.linux-arm64: &linux_arm64
tags:
- linux
- arm64
.linux-i386: &linux_i386
tags:
- linux
- i386
.openbsd-amd64: &openbsd_amd64
tags:
- libvirt
- amd64
### Docker Image Templates
# Alpine Linux
@@ -81,10 +69,6 @@ stages:
# CentOS
.centos-centos6-amd64: &centos_centos6_amd64_image
image: "$CI_REGISTRY_IMAGE:centos-centos6-amd64"
<<: *linux_amd64
.centos-centos7-amd64: &centos_centos7_amd64_image
image: "$CI_REGISTRY_IMAGE:centos-centos7-amd64"
<<: *linux_amd64
@@ -107,10 +91,6 @@ stages:
image: "$CI_REGISTRY_IMAGE:debian-sid-amd64"
<<: *linux_amd64
.debian-sid-arm64: &debian_sid_arm64_image
image: "$CI_REGISTRY_IMAGE:debian-sid-arm64"
<<: *linux_arm64
.debian-sid-i386: &debian_sid_i386_image
image: "$CI_REGISTRY_IMAGE:debian-sid-i386"
<<: *linux_i386
@@ -143,6 +123,20 @@ stages:
.base: &base_image
<<: *debian_buster_amd64_image
### QCOW2 Image Templates
.freebsd-11-amd64: &freebsd_11_amd64_image
image: "freebsd-11.4-x86_64"
<<: *libvirt_amd64
.freebsd-12-amd64: &freebsd_12_amd64_image
image: "freebsd-12.1-x86_64"
<<: *libvirt_amd64
.openbsd-amd64: &openbsd_amd64_image
image: "openbsd-6.7-x86_64"
<<: *libvirt_amd64
### Job Templates
.default-triggering-rules: &default_triggering_rules
@@ -180,13 +174,10 @@ stages:
${CONFIGURE} \
--disable-maintainer-mode \
--enable-developer \
--with-libtool \
--with-cmocka \
--with-libxml2 \
--with-json-c \
--prefix=$HOME/.local \
--without-make-clean \
--with-python=python3 \
$EXTRA_CONFIGURE \
|| cat config.log
@@ -257,7 +248,7 @@ stages:
- *setup_softhsm
script:
- cd bin/tests/system
- make -j${TEST_PARALLEL_JOBS:-1} -k check V=1 || make -j${TEST_PARALLEL_JOBS:-1} -k recheck V=1
- make -j${TEST_PARALLEL_JOBS:-1} -k check V=1
after_script:
- cat bin/tests/system/test-suite.log
@@ -397,6 +388,7 @@ misc:
- xmllint --noout --nonet `git ls-files '*.xml' '*.docbook'`
- sh util/check-win32util-configure
- sh util/check-categories.sh
- if git grep SYSTEMTESTTOP -- ':!.gitlab-ci.yml'; then echo 'Please use relative paths instead of $SYSTEMTESTTOP.'; exit 1; fi
needs: []
artifacts:
paths:
@@ -460,6 +452,7 @@ pylint:
tarball-create:
stage: precheck
<<: *base_image
<<: *default_triggering_rules
script:
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} all V=1
@@ -470,8 +463,6 @@ tarball-create:
needs:
- job: autoreconf
artifacts: true
only:
- tags
# Jobs for doc builds on Debian 10 "buster" (amd64)
@@ -532,30 +523,6 @@ unit:gcc:alpine3.12:amd64:
- job: gcc:alpine3.12:amd64
artifacts: true
# Jobs for regular GCC builds on CentOS 6 (amd64)
gcc:centos6:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2 --disable-warn-error --without-python"
<<: *centos_centos6_amd64_image
<<: *build_job
system:gcc:centos6:amd64:
<<: *centos_centos6_amd64_image
<<: *system_test_job
needs:
- job: gcc:centos6:amd64
artifacts: true
unit:gcc:centos6:amd64:
<<: *centos_centos6_amd64_image
<<: *unit_test_job
needs:
- job: gcc:centos6:amd64
artifacts: true
# Jobs for regular GCC builds on CentOS 7 (amd64)
gcc:centos7:amd64:
@@ -742,6 +709,7 @@ gcc:tarball:
- job: tarball-create
artifacts: true
only:
- schedules
- tags
system:gcc:tarball:
@@ -754,6 +722,7 @@ system:gcc:tarball:
- job: gcc:tarball
artifacts: true
only:
- schedules
- tags
unit:gcc:tarball:
@@ -765,39 +734,16 @@ unit:gcc:tarball:
- job: gcc:tarball
artifacts: true
only:
- schedules
- tags
# Jobs for regular GCC builds on Debian "sid" (arm64)
gcc:sid:arm64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_sid_arm64_image
<<: *build_job
system:gcc:sid:arm64:
<<: *debian_sid_arm64_image
<<: *system_test_job
needs:
- job: gcc:sid:arm64
artifacts: true
unit:gcc:sid:arm64:
<<: *debian_sid_arm64_image
<<: *unit_test_job
needs:
- job: gcc:sid:arm64
artifacts: true
# Jobs for regular GCC builds on Debian "sid" (i386)
gcc:sid:i386:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2 --without-python"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_sid_i386_image
<<: *build_job
@@ -821,7 +767,7 @@ gcc:tumbleweed:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2 --with-python --with-gssapi=/usr/lib/mit/bin/krb5-config"
EXTRA_CONFIGURE: "--with-libidn2 --with-gssapi=/usr/lib/mit/bin/krb5-config"
<<: *tumbleweed_latest_amd64_image
<<: *build_job
@@ -1029,7 +975,6 @@ clang:buster:amd64:
variables:
CC: ${CLANG}
CFLAGS: "${CFLAGS_COMMON} -Wenum-conversion"
EXTRA_CONFIGURE: "--with-python=python3"
<<: *debian_buster_amd64_image
<<: *build_job
@@ -1095,78 +1040,75 @@ unit:gcc:softhsm2.6:
- job: gcc:softhsm2.6
artifacts: true
# Jobs for Clang builds on FreeBSD 11.4 (amd64)
# Jobs for Clang builds on FreeBSD 11 (amd64)
clang:freebsd11.4:amd64:
clang:freebsd11:amd64:
variables:
CFLAGS: "${CFLAGS_COMMON}"
USER: gitlab-runner
# Temporarily disable LMDB support [GL #1976]
EXTRA_CONFIGURE: "--without-lmdb"
<<: *freebsd_amd64
<<: *freebsd_11_amd64_image
<<: *build_job
system:clang:freebsd11.4:amd64:
<<: *freebsd_amd64
system:clang:freebsd11:amd64:
<<: *freebsd_11_amd64_image
<<: *system_test_job
variables:
USER: gitlab-runner
TEST_PARALLEL_JOBS: 4
needs:
- job: clang:freebsd11.4:amd64
- job: clang:freebsd11:amd64
artifacts: true
unit:clang:freebsd11.4:amd64:
<<: *freebsd_amd64
unit:clang:freebsd11:amd64:
<<: *freebsd_11_amd64_image
<<: *unit_test_job
needs:
- job: clang:freebsd11.4:amd64
- job: clang:freebsd11:amd64
artifacts: true
# Jobs for Clang builds on FreeBSD 12.1 (amd64)
# Jobs for Clang builds on FreeBSD 12 (amd64)
clang:freebsd12.1:amd64:
clang:freebsd12:amd64:
variables:
CFLAGS: "${CFLAGS_COMMON}"
# Temporarily disable LMDB support [GL #1976]
EXTRA_CONFIGURE: "--enable-dnstap --without-lmdb"
EXTRA_CONFIGURE: "--enable-dnstap"
USER: gitlab-runner
<<: *freebsd_amd64
<<: *freebsd_12_amd64_image
<<: *build_job
system:clang:freebsd12.1:amd64:
<<: *freebsd_amd64
system:clang:freebsd12:amd64:
<<: *freebsd_12_amd64_image
<<: *system_test_job
variables:
USER: gitlab-runner
TEST_PARALLEL_JOBS: 4
needs:
- job: clang:freebsd12.1:amd64
- job: clang:freebsd12:amd64
artifacts: true
unit:clang:freebsd12.1:amd64:
<<: *freebsd_amd64
unit:clang:freebsd12:amd64:
<<: *freebsd_12_amd64_image
<<: *unit_test_job
needs:
- job: clang:freebsd12.1:amd64
- job: clang:freebsd12:amd64
artifacts: true
# Jobs for Clang builds on OpenBSD 6.7 (amd64)
# Jobs for Clang builds on OpenBSD (amd64)
clang:openbsd6.7:amd64:
clang:openbsd:amd64:
variables:
CC: clang
USER: gitlab-runner
<<: *openbsd_amd64
<<: *openbsd_amd64_image
<<: *build_job
system:clang:openbsd6.7:amd64:
<<: *openbsd_amd64
system:clang:openbsd:amd64:
<<: *openbsd_amd64_image
<<: *system_test_job
variables:
USER: gitlab-runner
needs:
- job: clang:openbsd6.7:amd64
- job: clang:openbsd:amd64
artifacts: true
only:
- schedules
@@ -1319,13 +1261,13 @@ respdiff:
BIND_BASELINE_VERSION: v9_11_3
script:
- autoreconf -fi
- ./configure --without-make-clean
- ./configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- *setup_interfaces
- git clone --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.isc.org/isc-private/bind-qa.git
- git clone --branch "${BIND_BASELINE_VERSION}" --depth 1 https://gitlab.isc.org/isc-projects/bind9.git refbind
- cd refbind/
- ./configure --without-make-clean
- ./configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- cd ../bind-qa/bind9/respdiff
- bash respdiff.sh -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}/refbind" "${CI_PROJECT_DIR}"
@@ -1352,7 +1294,8 @@ abi-check:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
BIND_BASELINE_VERSION: v9_17_2
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
BIND_BASELINE_VERSION: v9_17_3
script:
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
@@ -1372,3 +1315,37 @@ abi-check:
only:
- main@isc-projects/bind9
- /^v9_[1-9][0-9]$/@isc-projects/bind9
gcov:
<<: *base_image
stage: build
needs:
- job: autoreconf
artifacts: true
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} --coverage -O0"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
script:
- *configure
- *setup_interfaces
- *setup_softhsm
- make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
- make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1 || true
- make -C bin/tests/system -j${TEST_PARALLEL_JOBS:-1} -k check V=1 || cat bin/tests/system/test-suite.log
# *.gcno and *.gcda files generated for shared library objects are created
# in directories in which gcovr is unable to process them properly
# (.../.libs/...). Move such *.gcno and *.gcda files one level higher.
- find . -regex ".*/\.libs/.*\.\(gcda\|gcno\)" -execdir mv "{}" .. \;
# Help gcovr process the nasty tricks in lib/dns/code.h, where we include C
# source files from lib/dns/rdata/*/, using an even nastier trick.
- find lib/dns/rdata/* -name "*.c" -execdir cp -f "{}" ../../ \;
- gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories libltdl --exclude-directories lib/samples --exclude 'lib/.*/tests/.*' --html-details -o coverage.html
- gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories libltdl --exclude-directories lib/samples --exclude 'lib/.*/tests/.*' -o coverage.txt
- tail -n 3 coverage.txt
artifacts:
paths:
- coverage*.html
only:
- main@isc-projects/bind9
- /^v9_[1-9][0-9]$/@isc-projects/bind9
+1
View File
@@ -67,6 +67,7 @@
- [ ] ***(SwEng)*** Push tags for the published releases to the public repository.
- [ ] ***(QA)*** For each maintained branch, update the `BIND_BASELINE_VERSION` variable for the `abi-check` job in `.gitlab-ci.yml` to the latest published BIND version tag for a given branch.
- [ ] ***(QA)*** Prepare empty release notes for the next set of releases.
- [ ] ***(QA)*** Sanitize all confidential issues assigned to the release milestone and make them public.
- [ ] ***(QA)*** Update QA tools used in GitLab CI (e.g. Flake8, PyLint) by modifying the relevant `Dockerfile`.
[^1]: If not, use the time remaining until the tagging deadline to ensure all outstanding issues are either resolved or moved to a different milestone.
+127 -18
View File
@@ -1,3 +1,112 @@
5490. [func] Refactor the readline support to use pkg-config and
add support for editline library. [GL !3942]
5489. [bug] Named failed to reject some invalid records resulting
in records that, after being printed, could not be
loaded or would result in DNSSEC validation failures
when re-read from zone files as the wire format
differed. The covered records records are: CERT,
IPSECKEY, NSEC3, NSEC3PARAM, NXT, SIG, TLSA, WKS, and
X25. [GL !3953]
5488. [bug] nta needed to have a weak reference on view to prevent
the view being deleted while nta tests are being
performed. [GL #2067]
5487. [cleanup] Update managed keys log messages to be less confusing.
[GL #2027]
5486. [func] Add 'rndc dnssec -checkds' command to tell named
that the DS record has been published in the parent.
[GL #1613]
5485. [placeholder]
5484. [func] Expire the 0 TTL RRSet quickly rather using them for
stale answers. [GL #1829]
5483. [func] Keeping "stale" answers in cache has been disabled by
default and can be re-enabled with a new configuration
option "stale-cache-enable". [GL #1712]
5482. [bug] BIND 9 would fail to bind to IPv6 addresses in a
tentative state when a new IPv6 address was added to the
system, but the Duplicate Address Detection (DAD)
mechanism had not yet finished. [GL #2038]
5481. [placeholder]
5480. [placeholder]
5479. [placeholder]
5478. [placeholder]
5477. [bug] The idle timeout for connected TCP sockets is now
derived from the client query processing timeout
configured for a resolver. [GL #2024]
5476. [placeholder]
5475. [bug] Fix RPZ wildcard passthru ignored when a rejection
would overwrite a passthru action matching some
rule in a previously loaded passthru rpz zone.
[GL #1619]
5474. [bug] dns_rdata_hip_next() failed to return ISC_R_NOMORE
when it should have. [GL !3880]
5473. [func] The rbt hashtable implementation has been changed
to use faster hash-function (HalfSipHash2-4) and
uses Fibonacci hashing for better distribution.
Setting the max-cache-size now preallocates fixed
size hashtable, so the rehashing doesn't cause
resolution brownouts when growing the hashtable.
[GL #1775]
5472. [func] The statistics channel has been updated to use the
new network manager. [GL #2022]
5471. [bug] The introduction of KASP support broke whether the
second field of sig-validity-interval was treated as
days or hours. (Thanks to Tony Finch.) [GL !3735]
5470. [port] illumos: only call gsskrb5_register_acceptor_identity
if we have gssapi_krb5.h. [GL #1995]
5469. [port] illumos: SEC is defined in <sys/time.h> which
conflicted with our use of SEC. [GL #1993]
5468. [bug] Address potential double unlock in process_fd().
[GL #2005]
5467. [func] The control channel and the rndc utility have been
updated to use the new network manager. To support
this, the network manager was updated to enable
wthe initiation of client TCP connections. Its
internal reference counting has been refactored.
Note: As side effects of this change, rndc cannot
currently be used with UNIX-domain sockets, and its
default timeout has changed from 60 seconds to 30.
These will be addressed in a future release.
[GL #1759]
5466. [bug] Addressed an error in recursive clients stats reporting.
[GL #1719]
5465. [func] Fallback to built in trust-anchors, managed-keys, or
trusted-keys if the bindkeys-file (bind.keys) cannot
be parsed. [GL #1235]
5464. [bug] Specifying saving more than 128 files when rolling
dnstap / log files would cause buffer overflow.
[GL #1989]
5463. [placeholder]
5462. [bug] Move LMDB locking from LMDB itself to named. [GL #1976]
5461. [bug] The header STALE attribute was not being updated with
the write lock being held leading to incorrect
statistics. Convert the header attributes to use atomic
@@ -11,6 +120,8 @@
5459. [bug] Bad isc_mem_put() size when an invalid type was
specified in a update-policy rule. [GL #1990]
--- 9.17.3 released ---
5458. [bug] Prevent a theoretically possible NULL dereference caused
by a data race between zone_maintenance() and
dns_zone_setview_helper(). [GL #1627]
@@ -19,23 +130,21 @@
5456. [func] Added "primaries" as a synonym for "masters" in
named.conf, and "primary-only" as a synonym for
"master-only" in the parameters to "notify",
in order to bring terminology up to date with
RFC 8499. [GL #1948]
"master-only" in the parameters to "notify", to bring
terminology up-to-date with RFC 8499. [GL #1948]
5455. [bug] `named` could crash when cleaning dead nodes
in lib/dns/rbtdb.c that have been reused meanwhile.
[GL #1968]
5455. [bug] named could crash when cleaning dead nodes in
lib/dns/rbtdb.c that were being reused. [GL #1968]
5454. [bug] Address a startup crash happening when server is
under load and root zone is not yet loaded. [GL #1862]
5454. [bug] Address a startup crash that occurred when the server
was under load and the root zone had not yet been
loaded. [GL #1862]
5453. [bug] `named` would crash on shutdown when new `rndc`
connection is received at the same time as
shutting down. [GL #1747]
5453. [bug] named crashed on shutdown when a new rndc connection was
received during shutdown. [GL #1747]
5452. [bug] The "blackhole" ACL was accidentally disabled with
respect to client queries. [GL #1936]
5452. [bug] The "blackhole" ACL was accidentally disabled for client
queries. [GL #1936]
5451. [func] Add 'rndc dnssec -status' command. [GL #1612]
@@ -53,14 +162,14 @@
5446. [bug] The validator could fail to accept a properly signed
RRset if an unsupported algorithm appeared earlier in
the DNSKEY RRset than a supported algorithm. It could
the DNSKEY RRset than a supported algorithm. It could
also stop if it detected a malformed public key.
[GL #1689]
5445. [cleanup] Disable and disallow static linking. [GL #1933]
5444. [bug] 'rndc dnstap -roll <value>' was not limiting the
number of saved files to <value>. [GL !3728]
5444. [bug] 'rndc dnstap -roll <value>' did not limit the number of
saved files to <value>. [GL !3728]
5443. [bug] The "primary" and "secondary" keywords, when used
as parameters for "check-names", were not
@@ -73,8 +182,8 @@
5440. [placeholder]
5439. [bug] The dsset returned by dns_keynode_dsset() was not
thread safe. [GL #1926]
5439. [bug] The DS RRset returned by dns_keynode_dsset() was used in
a non-thread-safe manner. [GL #1926]
--- 9.17.2 released ---
+1 -1
View File
@@ -1,6 +1,6 @@
include $(top_srcdir)/Makefile.top
SUBDIRS = . libltdl lib doc bin
SUBDIRS = . libltdl lib doc bin fuzz
BUILT_SOURCES = bind.keys.h
CLEANFILES = bind.keys.h
+5
View File
@@ -33,6 +33,11 @@ LIBISC_CFLAGS += \
$(LIBXML2_CFLAGS)
endif HAVE_LIBXML2
if HAVE_READLINE
LIBISC_CFLAGS += \
$(READLINE_CFLAGS)
endif HAVE_READLINE
LIBISC_LIBS = $(top_builddir)/lib/isc/libisc.la
LIBDNS_CFLAGS = \
+2 -6
View File
@@ -185,9 +185,8 @@ command:
Building on macOS assumes that the "Command Tools for Xcode" are installed.
These can be downloaded from
[https://developer.apple.com/download/more/](https://developer.apple.com/download/more/)
or, if you have Xcode already installed, you can run
`xcode-select--install`. (Note that an Apple ID may be required to access the download
page.)
or, if you have Xcode already installed, you can run `xcode-select --install`.
(Note that an Apple ID may be required to access the download page.)
#### <a name="dependencies"> Dependencies
@@ -208,9 +207,6 @@ installed:
To see a full list of configuration options, run `configure --help`.
To build shared libraries, specify `--with-libtool` on the `configure`
command line.
For the server to support DNSSEC, you need to build it with crypto support.
To use OpenSSL, you should have OpenSSL 1.0.2e or newer installed. If the
OpenSSL library is installed in a nonstandard location, specify the prefix
+1 -1
View File
@@ -28,7 +28,7 @@ tsig-keygen, ddns-confgen - TSIG key generation tool
Synopsis
~~~~~~~~
:program:`tsig-keygen` [**-a** algorithm] [**-h**] [**-r** randomfile] [**-s** name]
:program:`tsig-keygen` [**-a** algorithm] [**-h**] [**-r** randomfile] [name]
:program:`ddns-confgen` [**-a** algorithm] [**-h**] [**-k** keyname] [**-q**] [**-r** randomfile] [**-s** name] [**-z** zone]
+7 -3
View File
@@ -25,6 +25,10 @@ libdighost_la_SOURCES = \
bin_PROGRAMS = dig host nslookup
nslookup_LDADD = \
$(LDADD) \
$(READLINE_LIB)
nslookup_LDADD = \
$(LDADD)
if HAVE_READLINE
nslookup_LDADD += \
$(READLINE_LIBS)
endif HAVE_READLINE
+9 -35
View File
@@ -22,6 +22,7 @@
#include <isc/netaddr.h>
#include <isc/parseint.h>
#include <isc/print.h>
#include <isc/readline.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/util.h>
@@ -38,22 +39,6 @@
#include "dighost.h"
#if defined(HAVE_READLINE)
#if defined(HAVE_EDIT_READLINE_READLINE_H)
#include <edit/readline/readline.h>
#if defined(HAVE_EDIT_READLINE_HISTORY_H)
#include <edit/readline/history.h>
#endif /* if defined(HAVE_EDIT_READLINE_HISTORY_H) */
#elif defined(HAVE_EDITLINE_READLINE_H)
#include <editline/readline.h>
#elif defined(HAVE_READLINE_READLINE_H)
#include <readline/readline.h>
#if defined(HAVE_READLINE_HISTORY_H)
#include <readline/history.h>
#endif /* if defined(HAVE_READLINE_HISTORY_H) */
#endif /* if defined(HAVE_EDIT_READLINE_READLINE_H) */
#endif /* if defined(HAVE_READLINE) */
static bool short_form = true, tcpmode = false, tcpmode_set = false,
identify = false, stats = true, comments = true,
section_question = true, section_answer = true,
@@ -848,38 +833,27 @@ do_next_command(char *input) {
static void
get_next_command(void) {
char *buf;
char *ptr;
char cmdlinebuf[COMMSIZE];
char *cmdline, *ptr = NULL;
fflush(stdout);
buf = isc_mem_allocate(mctx, COMMSIZE);
isc_app_block();
if (interactive) {
#ifdef HAVE_READLINE
ptr = readline("> ");
if (ptr != NULL) {
cmdline = ptr = readline("> ");
if (ptr != NULL && *ptr != 0) {
add_history(ptr);
}
#else /* ifdef HAVE_READLINE */
fprintf(stderr, "> ");
fflush(stderr);
ptr = fgets(buf, COMMSIZE, stdin);
#endif /* ifdef HAVE_READLINE */
} else {
ptr = fgets(buf, COMMSIZE, stdin);
cmdline = fgets(cmdlinebuf, COMMSIZE, stdin);
}
isc_app_unblock();
if (ptr == NULL) {
if (cmdline == NULL) {
in_use = false;
} else {
do_next_command(ptr);
do_next_command(cmdline);
}
#ifdef HAVE_READLINE
if (interactive) {
if (ptr != NULL) {
free(ptr);
}
#endif /* ifdef HAVE_READLINE */
isc_mem_free(mctx, buf);
}
ISC_NORETURN static void
+2
View File
@@ -15,6 +15,7 @@ AM_CPPFLAGS += \
$(LMDB_CFLAGS) \
$(MAXMINDDB_CFLAGS) \
$(DNSTAP_CFLAGS) \
$(LIBUV_CFLAGS) \
$(ZLIB_CFLAGS)
if HAVE_JSON_C
@@ -102,6 +103,7 @@ named_LDADD = \
$(LMDB_LIBS) \
$(MAXMINDDB_LIBS) \
$(DNSTAP_LIBS) \
$(LIBUV_LIBS) \
$(LIBXML2_LIBS) \
$(ZLIB_LIBS)
+1
View File
@@ -196,6 +196,7 @@ options {\n\
# sortlist <none>\n\
stale-answer-enable false;\n\
stale-answer-ttl 1; /* 1 second */\n\
stale-cache-enable false;\n\
synth-from-dnssec no;\n\
# topology <none>\n\
transfer-format many-answers;\n\
+459 -510
View File
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -38,6 +38,7 @@
#define NAMED_EVENTCLASS ISC_EVENTCLASS(0x4E43)
#define NAMED_EVENT_RELOAD (NAMED_EVENTCLASS + 0)
#define NAMED_EVENT_DELZONE (NAMED_EVENTCLASS + 1)
#define NAMED_EVENT_COMMAND (NAMED_EVENTCLASS + 2)
/*%
* Name server state. Better here than in lots of separate global variables.
@@ -80,8 +81,6 @@ struct named_server {
uint32_t interface_interval;
uint32_t heartbeat_interval;
isc_mutex_t reload_event_lock;
isc_event_t * reload_event;
named_reload_t reload_status;
bool flushonshutdown;
+4
View File
@@ -16,6 +16,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <uv.h>
#include <isc/app.h>
#include <isc/attributes.h>
@@ -525,6 +526,9 @@ printversion(bool verbose) {
printf("linked to OpenSSL version: %s\n",
SSLeay_version(SSLEAY_VERSION));
#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
printf("compiled with libuv version: %d.%d.%d\n", UV_VERSION_MAJOR,
UV_VERSION_MINOR, UV_VERSION_PATCH);
printf("linked to libuv version: %s\n", uv_version_string());
#ifdef HAVE_LIBXML2
printf("compiled with libxml2 version: %s\n", LIBXML_DOTTED_VERSION);
printf("linked to libxml2 version: %s\n", xmlParserVersion);
+2 -1
View File
@@ -68,7 +68,6 @@ DNSSEC-POLICY
max-zone-ttl duration;
parent-ds-ttl duration;
parent-propagation-delay duration;
parent-registration-delay duration;
publish-safety duration;
retire-safety duration;
signatures-refresh duration;
@@ -401,6 +400,7 @@ OPTIONS
stacksize ( default | unlimited | sizeval );
stale-answer-enable boolean;
stale-answer-ttl duration;
stale-cache-enable boolean;
startup-notify-rate integer;
statistics-file quoted_string;
synth-from-dnssec boolean;
@@ -785,6 +785,7 @@ VIEW
sortlist { address_match_element; ... };
stale-answer-enable boolean;
stale-answer-ttl duration;
stale-cache-enable boolean;
synth-from-dnssec boolean;
transfer-format ( many-answers | one-answer );
transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [
+263 -83
View File
@@ -89,6 +89,7 @@
#include <dns/secalg.h>
#include <dns/soa.h>
#include <dns/stats.h>
#include <dns/time.h>
#include <dns/tkey.h>
#include <dns/tsig.h>
#include <dns/ttl.h>
@@ -3895,7 +3896,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
uint32_t max_cache_size_percent = 0;
size_t max_adb_size;
uint32_t lame_ttl, fail_ttl;
uint32_t max_stale_ttl;
uint32_t max_stale_ttl = 0;
dns_tsig_keyring_t *ring = NULL;
dns_view_t *pview = NULL; /* Production view */
isc_mem_t *cmctx = NULL, *hmctx = NULL;
@@ -4358,9 +4359,18 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
view->synthfromdnssec = cfg_obj_asboolean(obj);
obj = NULL;
result = named_config_get(maps, "max-stale-ttl", &obj);
result = named_config_get(maps, "stale-cache-enable", &obj);
INSIST(result == ISC_R_SUCCESS);
max_stale_ttl = ISC_MAX(cfg_obj_asduration(obj), 1);
if (cfg_obj_asboolean(obj)) {
obj = NULL;
result = named_config_get(maps, "max-stale-ttl", &obj);
INSIST(result == ISC_R_SUCCESS);
max_stale_ttl = ISC_MAX(cfg_obj_asduration(obj), 1);
}
/*
* If 'stale-cache-enable' is false, max_stale_ttl is set to 0,
* meaning keeping stale RRsets in cache is disabled.
*/
obj = NULL;
result = named_config_get(maps, "stale-answer-enable", &obj);
@@ -7574,6 +7584,8 @@ count_newzones(dns_view_t *view, ns_cfgctx_t *nzcfg, int *num_zonesp) {
REQUIRE(num_zonesp != NULL);
LOCK(&view->new_zone_lock);
CHECK(migrate_nzf(view));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
@@ -7596,6 +7608,8 @@ cleanup:
*num_zonesp = 0;
}
UNLOCK(&view->new_zone_lock);
return (ISC_R_SUCCESS);
}
@@ -7924,6 +7938,8 @@ typedef isc_result_t (*newzone_cfg_cb_t)(const cfg_obj_t *zconfig,
* Immediately interrupt processing if an error is encountered while
* transforming NZD data into a zone configuration object or if "callback"
* returns an error.
*
* Caller must hold 'view->new_zone_lock'.
*/
static isc_result_t
for_all_newzone_cfgs(newzone_cfg_cb_t callback, cfg_obj_t *config,
@@ -8032,8 +8048,11 @@ configure_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
return (ISC_R_SUCCESS);
}
LOCK(&view->new_zone_lock);
result = nzd_open(view, MDB_RDONLY, &txn, &dbi);
if (result != ISC_R_SUCCESS) {
UNLOCK(&view->new_zone_lock);
return (ISC_R_SUCCESS);
}
@@ -8059,6 +8078,9 @@ configure_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
}
(void)nzd_close(&txn, false);
UNLOCK(&view->new_zone_lock);
return (result);
}
@@ -8079,6 +8101,8 @@ get_newzone_config(dns_view_t *view, const char *zonename,
INSIST(zoneconfig != NULL && *zoneconfig == NULL);
LOCK(&view->new_zone_lock);
CHECK(nzd_open(view, MDB_RDONLY, &txn, &dbi));
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
@@ -8112,6 +8136,8 @@ get_newzone_config(dns_view_t *view, const char *zonename,
cleanup:
(void)nzd_close(&txn, false);
UNLOCK(&view->new_zone_lock);
if (zoneconf != NULL) {
cfg_obj_destroy(named_g_addparser, &zoneconf);
}
@@ -8362,7 +8388,14 @@ load_configuration(const char *filename, named_server_t *server,
result = cfg_parse_file(bindkeys_parser, server->bindkeysfile,
&cfg_type_bindkeys, &bindkeys);
CHECK(result);
if (result != ISC_R_SUCCESS) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"unable to parse '%s' error '%s'; using "
"built-in keys instead",
server->bindkeysfile,
isc_result_totext(result));
}
} else {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
@@ -9641,7 +9674,7 @@ load_zones(named_server_t *server, bool init, bool reconfig) {
isc_refcount_increment(&zl->refs);
result = dns_view_asyncload(view, reconfig, view_loaded, zl);
if (result != ISC_R_SUCCESS) {
(void)isc_refcount_decrement(&zl->refs);
isc_refcount_decrement1(&zl->refs);
goto cleanup;
}
}
@@ -9913,14 +9946,6 @@ named_server_create(isc_mem_t *mctx, named_server_t **serverp) {
&server->in_roothints),
"setting up root hints");
isc_mutex_init(&server->reload_event_lock);
server->reload_event = isc_event_allocate(
named_g_mctx, server, NAMED_EVENT_RELOAD, named_server_reload,
server, sizeof(isc_event_t));
CHECKFATAL(server->reload_event == NULL ? ISC_R_NOMEMORY
: ISC_R_SUCCESS,
"allocating reload event");
server->reload_status = NAMED_RELOAD_IN_PROGRESS;
/*
@@ -10090,9 +10115,6 @@ named_server_destroy(named_server_t **serverp) {
dst_lib_destroy();
isc_event_free(&server->reload_event);
isc_mutex_destroy(&server->reload_event_lock);
INSIST(ISC_LIST_EMPTY(server->kasplist));
INSIST(ISC_LIST_EMPTY(server->viewlist));
INSIST(ISC_LIST_EMPTY(server->cachelist));
@@ -10104,7 +10126,7 @@ named_server_destroy(named_server_t **serverp) {
static void
fatal(named_server_t *server, const char *msg, isc_result_t result) {
if (server != NULL) {
if (server != NULL && server->task != NULL) {
/*
* Prevent races between the OpenSSL on_exit registered
* function and any other OpenSSL calls from other tasks
@@ -10270,7 +10292,7 @@ cleanup:
*/
static void
named_server_reload(isc_task_t *task, isc_event_t *event) {
named_server_t *server = (named_server_t *)event->ev_arg;
named_server_t *server = (named_server_t *)event->ev_sender;
INSIST(task == server->task);
UNUSED(task);
@@ -10280,19 +10302,15 @@ named_server_reload(isc_task_t *task, isc_event_t *event) {
"received SIGHUP signal to reload zones");
(void)reload(server);
LOCK(&server->reload_event_lock);
INSIST(server->reload_event == NULL);
server->reload_event = event;
UNLOCK(&server->reload_event_lock);
isc_event_free(&event);
}
void
named_server_reloadwanted(named_server_t *server) {
LOCK(&server->reload_event_lock);
if (server->reload_event != NULL) {
isc_task_send(server->task, &server->reload_event);
}
UNLOCK(&server->reload_event_lock);
isc_event_t *event = isc_event_allocate(
named_g_mctx, server, NAMED_EVENT_RELOAD, named_server_reload,
NULL, sizeof(isc_event_t));
isc_task_send(server->task, &event);
}
void
@@ -12063,12 +12081,10 @@ cleanup:
isc_result_t
named_server_tsiglist(named_server_t *server, isc_buffer_t **text) {
isc_result_t result;
isc_result_t result = ISC_R_SUCCESS;
dns_view_t *view;
unsigned int foundkeys = 0;
result = isc_task_beginexclusive(server->task);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
for (view = ISC_LIST_HEAD(server->viewlist); view != NULL;
view = ISC_LIST_NEXT(view, link))
{
@@ -12077,7 +12093,6 @@ named_server_tsiglist(named_server_t *server, isc_buffer_t **text) {
&foundkeys);
RWUNLOCK(&view->statickeys->lock, isc_rwlocktype_read);
if (result != ISC_R_SUCCESS) {
isc_task_endexclusive(server->task);
return (result);
}
RWLOCK(&view->dynamickeys->lock, isc_rwlocktype_read);
@@ -12085,11 +12100,9 @@ named_server_tsiglist(named_server_t *server, isc_buffer_t **text) {
&foundkeys);
RWUNLOCK(&view->dynamickeys->lock, isc_rwlocktype_read);
if (result != ISC_R_SUCCESS) {
isc_task_endexclusive(server->task);
return (result);
}
}
isc_task_endexclusive(server->task);
if (foundkeys == 0) {
CHECK(putstr(text, "no tsig keys found."));
@@ -12569,8 +12582,6 @@ nzd_save(MDB_txn **txnp, MDB_dbi dbi, dns_zone_t *zone,
nzd_setkey(&key, dns_zone_getorigin(zone), namebuf, sizeof(namebuf));
LOCK(&view->new_zone_lock);
if (zconfig == NULL) {
/* We're deleting the zone from the database */
status = mdb_del(*txnp, dbi, &key, NULL);
@@ -12650,8 +12661,6 @@ cleanup:
}
*txnp = NULL;
UNLOCK(&view->new_zone_lock);
if (text != NULL) {
isc_buffer_free(&text);
}
@@ -12659,6 +12668,11 @@ cleanup:
return (result);
}
/*
* Check whether the new zone database for 'view' can be opened for writing.
*
* Caller must hold 'view->new_zone_lock'.
*/
static isc_result_t
nzd_writable(dns_view_t *view) {
isc_result_t result = ISC_R_SUCCESS;
@@ -12688,6 +12702,11 @@ nzd_writable(dns_view_t *view) {
return (result);
}
/*
* Open the new zone database for 'view' and start a transaction for it.
*
* Caller must hold 'view->new_zone_lock'.
*/
static isc_result_t
nzd_open(dns_view_t *view, unsigned int flags, MDB_txn **txnp, MDB_dbi *dbi) {
int status;
@@ -12815,6 +12834,13 @@ cleanup:
return (result);
}
/*
* If 'commit' is true, commit the new zone database transaction pointed to by
* 'txnp'; otherwise, abort that transaction.
*
* Caller must hold 'view->new_zone_lock' for the view that the transaction
* pointed to by 'txnp' was started for.
*/
static isc_result_t
nzd_close(MDB_txn **txnp, bool commit) {
isc_result_t result = ISC_R_SUCCESS;
@@ -12837,6 +12863,12 @@ nzd_close(MDB_txn **txnp, bool commit) {
return (result);
}
/*
* Count the zones configured in the new zone database for 'view' and store the
* result in 'countp'.
*
* Caller must hold 'view->new_zone_lock'.
*/
static isc_result_t
nzd_count(dns_view_t *view, int *countp) {
isc_result_t result;
@@ -12869,6 +12901,10 @@ cleanup:
return (result);
}
/*
* Migrate zone configuration from an NZF file to an NZD database.
* Caller must hold view->new_zone_lock.
*/
static isc_result_t
migrate_nzf(dns_view_t *view) {
isc_result_t result;
@@ -13228,6 +13264,7 @@ do_addzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
MDB_dbi dbi;
UNUSED(zoneconf);
LOCK(&view->new_zone_lock);
#endif /* HAVE_LMDB */
/* Zone shouldn't already exist */
@@ -13381,6 +13418,7 @@ cleanup:
if (txn != NULL) {
(void)nzd_close(&txn, false);
}
UNLOCK(&view->new_zone_lock);
#endif /* HAVE_LMDB */
if (zone != NULL) {
@@ -13404,6 +13442,7 @@ do_modzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
#else /* HAVE_LMDB */
MDB_txn *txn = NULL;
MDB_dbi dbi;
LOCK(&view->new_zone_lock);
#endif /* HAVE_LMDB */
/* Zone must already exist */
@@ -13601,6 +13640,7 @@ cleanup:
if (txn != NULL) {
(void)nzd_close(&txn, false);
}
UNLOCK(&view->new_zone_lock);
#endif /* HAVE_LMDB */
if (zone != NULL) {
@@ -13764,6 +13804,7 @@ rmzone(isc_task_t *task, isc_event_t *event) {
if (added && cfg != NULL) {
#ifdef HAVE_LMDB
/* Make sure we can open the NZD database */
LOCK(&view->new_zone_lock);
result = nzd_open(view, 0, &txn, &dbi);
if (result != ISC_R_SUCCESS) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
@@ -13781,6 +13822,11 @@ rmzone(isc_task_t *task, isc_event_t *event) {
"delete zone configuration: %s",
isc_result_totext(result));
}
if (txn != NULL) {
(void)nzd_close(&txn, false);
}
UNLOCK(&view->new_zone_lock);
#else /* ifdef HAVE_LMDB */
result = delete_zoneconf(view, cfg->add_parser, cfg->nzf_config,
dns_zone_getorigin(zone),
@@ -13870,11 +13916,6 @@ rmzone(isc_task_t *task, isc_event_t *event) {
}
}
#ifdef HAVE_LMDB
if (txn != NULL) {
(void)nzd_close(&txn, false);
}
#endif /* ifdef HAVE_LMDB */
if (raw != NULL) {
dns_zone_detach(&raw);
}
@@ -14110,7 +14151,6 @@ named_server_showzone(named_server_t *server, isc_lex_t *lex,
dns_view_t *view = NULL;
dns_zone_t *zone = NULL;
ns_cfgctx_t *cfg = NULL;
bool exclusive = false;
#ifdef HAVE_LMDB
cfg_obj_t *nzconfig = NULL;
#endif /* HAVE_LMDB */
@@ -14135,10 +14175,6 @@ named_server_showzone(named_server_t *server, isc_lex_t *lex,
goto cleanup;
}
result = isc_task_beginexclusive(server->task);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
exclusive = true;
if (!added) {
/* Find the view statement */
vconfig = find_name_in_list_from_map(cfg->config, "view",
@@ -14197,9 +14233,6 @@ cleanup:
if (isc_buffer_usedlength(*text) > 0) {
(void)putnull(text);
}
if (exclusive) {
isc_task_endexclusive(server->task);
}
return (result);
}
@@ -14465,6 +14498,23 @@ cleanup:
return (result);
}
static inline bool
argcheck(char *cmd, const char *full) {
size_t l;
if (cmd == NULL || cmd[0] != '-') {
return (false);
}
cmd++;
l = strlen(cmd);
if (l > strlen(full) || strncasecmp(cmd, full, l) != 0) {
return (false);
}
return (true);
}
isc_result_t
named_server_dnssec(named_server_t *server, isc_lex_t *lex,
isc_buffer_t **text) {
@@ -14473,11 +14523,17 @@ named_server_dnssec(named_server_t *server, isc_lex_t *lex,
dns_kasp_t *kasp = NULL;
dns_dnsseckeylist_t keys;
dns_dnsseckey_t *key;
const char *ptr;
char *ptr;
const char *msg = NULL;
/* variables for -checkds */
bool checkds = false, dspublish = false, use_keyid = false;
dns_keytag_t keyid = 0;
uint8_t algorithm = 0;
/* variables for -status */
bool status = false;
char output[4096];
isc_stdtime_t now;
isc_time_t timenow;
isc_stdtime_t now, when;
isc_time_t timenow, timewhen;
const char *dir;
/* Skip the command name. */
@@ -14492,43 +14548,184 @@ named_server_dnssec(named_server_t *server, isc_lex_t *lex,
return (ISC_R_UNEXPECTEDEND);
}
if (strcasecmp(ptr, "-status") != 0) {
return (DNS_R_SYNTAX);
}
/* Initialize current time and key list. */
TIME_NOW(&timenow);
now = isc_time_seconds(&timenow);
when = now;
ISC_LIST_INIT(keys);
if (strcasecmp(ptr, "-status") == 0) {
status = true;
} else if (strcasecmp(ptr, "-checkds") == 0) {
checkds = true;
/* Check for options */
for (;;) {
ptr = next_token(lex, text);
if (ptr == NULL) {
msg = "Bad format";
CHECK(ISC_R_UNEXPECTEDEND);
} else if (argcheck(ptr, "alg")) {
isc_consttextregion_t alg;
ptr = next_token(lex, text);
if (ptr == NULL) {
msg = "No key algorithm specified";
CHECK(ISC_R_UNEXPECTEDEND);
}
alg.base = ptr;
alg.length = strlen(alg.base);
result = dns_secalg_fromtext(
&algorithm, (isc_textregion_t *)&alg);
if (result != ISC_R_SUCCESS) {
msg = "Bad algorithm";
CHECK(DNS_R_SYNTAX);
}
continue;
} else if (argcheck(ptr, "key")) {
uint16_t id;
ptr = next_token(lex, text);
if (ptr == NULL) {
msg = "No key identifier specified";
CHECK(ISC_R_UNEXPECTEDEND);
}
CHECK(isc_parse_uint16(&id, ptr, 10));
keyid = (dns_keytag_t)id;
use_keyid = true;
continue;
} else if (argcheck(ptr, "when")) {
uint32_t tw;
ptr = next_token(lex, text);
if (ptr == NULL) {
msg = "No time specified";
CHECK(ISC_R_UNEXPECTEDEND);
}
CHECK(dns_time32_fromtext(ptr, &tw));
when = (isc_stdtime_t)tw;
continue;
} else if (ptr[0] == '-') {
msg = "Unknown option";
CHECK(DNS_R_SYNTAX);
} else {
/*
* No arguments provided, so we must be
* parsing "published|withdrawn".
*/
if (strcasecmp(ptr, "published") == 0) {
dspublish = true;
} else if (strcasecmp(ptr, "withdrawn") != 0) {
CHECK(DNS_R_SYNTAX);
}
}
break;
}
if (algorithm > 0 && !use_keyid) {
msg = "Key id is required when setting algorithm";
CHECK(DNS_R_SYNTAX);
}
} else {
CHECK(DNS_R_SYNTAX);
}
/* Get zone. */
CHECK(zone_from_args(server, lex, NULL, &zone, NULL, text, false));
if (zone == NULL) {
msg = "Zone not found";
CHECK(ISC_R_UNEXPECTEDEND);
}
/* Trailing garbage? */
ptr = next_token(lex, text);
if (ptr != NULL) {
msg = "Too many arguments";
CHECK(DNS_R_SYNTAX);
}
/* Get dnssec-policy. */
kasp = dns_zone_getkasp(zone);
if (kasp == NULL) {
CHECK(putstr(text, "zone does not have dnssec-policy"));
CHECK(putnull(text));
msg = "Zone does not have dnssec-policy";
goto cleanup;
}
/* -status */
TIME_NOW(&timenow);
now = isc_time_seconds(&timenow);
/* Get DNSSEC keys. */
dir = dns_zone_getkeydirectory(zone);
LOCK(&kasp->lock);
result = dns_dnssec_findmatchingkeys(dns_zone_getorigin(zone), dir, now,
dns_zone_getmctx(zone), &keys);
UNLOCK(&kasp->lock);
if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND) {
goto cleanup;
}
LOCK(&kasp->lock);
dns_keymgr_status(kasp, &keys, now, &output[0], sizeof(output));
UNLOCK(&kasp->lock);
CHECK(putstr(text, output));
if (status) {
/*
* Output the DNSSEC status of the key and signing policy.
*/
LOCK(&kasp->lock);
dns_keymgr_status(kasp, &keys, now, &output[0], sizeof(output));
UNLOCK(&kasp->lock);
CHECK(putstr(text, output));
} else if (checkds) {
/*
* Mark DS record has been seen, so it may move to the
* rumoured state.
*/
char whenbuf[80];
isc_time_set(&timewhen, when, 0);
isc_time_formattimestamp(&timewhen, whenbuf, sizeof(whenbuf));
LOCK(&kasp->lock);
if (use_keyid) {
result = dns_keymgr_checkds_id(kasp, &keys, dir, when,
dspublish, keyid,
(unsigned int)algorithm);
} else {
result = dns_keymgr_checkds(kasp, &keys, dir, when,
dspublish);
}
UNLOCK(&kasp->lock);
switch (result) {
case ISC_R_SUCCESS:
if (use_keyid) {
char tagbuf[6];
snprintf(tagbuf, sizeof(tagbuf), "%u", keyid);
CHECK(putstr(text, "KSK "));
CHECK(putstr(text, tagbuf));
CHECK(putstr(text, ": "));
}
CHECK(putstr(text, "Marked DS as "));
if (dspublish) {
CHECK(putstr(text, "published "));
} else {
CHECK(putstr(text, "withdrawn "));
}
CHECK(putstr(text, "since "));
CHECK(putstr(text, whenbuf));
break;
case ISC_R_NOTFOUND:
CHECK(putstr(text, "No matching KSK found"));
break;
case ISC_R_FAILURE:
CHECK(putstr(text,
"Error: multiple possible KSKs found, "
"retry command with -key id"));
break;
default:
CHECK(putstr(text, "Error executing checkds command"));
break;
}
}
CHECK(putnull(text));
cleanup:
if (msg != NULL) {
(void)putstr(text, msg);
(void)putnull(text);
}
while (!ISC_LIST_EMPTY(keys)) {
key = ISC_LIST_HEAD(keys);
ISC_LIST_UNLINK(keys, key, link);
@@ -14873,23 +15070,6 @@ cleanup:
return (result);
}
static inline bool
argcheck(char *cmd, const char *full) {
size_t l;
if (cmd == NULL || cmd[0] != '-') {
return (false);
}
cmd++;
l = strlen(cmd);
if (l > strlen(full) || strncasecmp(cmd, full, l) != 0) {
return (false);
}
return (true);
}
isc_result_t
named_server_nta(named_server_t *server, isc_lex_t *lex, bool readonly,
isc_buffer_t **text) {
+171 -293
View File
@@ -22,7 +22,6 @@
#include <isc/socket.h>
#include <isc/stats.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/util.h>
#include <dns/cache.h>
@@ -54,6 +53,14 @@
#include "xsl_p.h"
#define CHECK(m) \
do { \
result = (m); \
if (result != ISC_R_SUCCESS) { \
goto cleanup; \
} \
} while (0)
struct named_statschannel {
/* Unlocked */
isc_httpdmgr_t *httpdmgr;
@@ -170,11 +177,11 @@ static const char *gluecachestats_xmldesc[dns_gluecachestatscounter_max];
#define gluecachestats_xmldesc NULL
#endif /* EXTENDED_STATS */
#define TRY0(a) \
do { \
xmlrc = (a); \
if (xmlrc < 0) \
goto error; \
#define TRY0(a) \
do { \
xmlrc = (a); \
if (xmlrc < 0) \
goto cleanup; \
} while (0)
/*%
@@ -1424,7 +1431,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
}
return (ISC_R_SUCCESS);
#ifdef HAVE_LIBXML2
error:
cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"failed at dump_counters()");
@@ -1486,7 +1493,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
}
return;
#ifdef HAVE_LIBXML2
error:
cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"failed at rdtypestat_dump()");
@@ -1574,7 +1581,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
}
return;
#ifdef HAVE_LIBXML2
error:
cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"failed at rdatasetstats_dump()");
@@ -1629,7 +1636,7 @@ opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
return;
#ifdef HAVE_LIBXML2
error:
cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"failed at opcodestat_dump()");
@@ -1685,7 +1692,7 @@ rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
return;
#ifdef HAVE_LIBXML2
error:
cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"failed at rcodestat_dump()");
@@ -1738,7 +1745,7 @@ dnssecsignstat_dump(dns_keytag_t tag, uint64_t val, void *arg) {
}
return;
#ifdef HAVE_LIBXML2
error:
cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"failed at dnssecsignstat_dump()");
@@ -1772,6 +1779,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
int xmlrc;
stats_dumparg_t dumparg;
const char *ztype;
isc_time_t timestamp;
statlevel = dns_zone_getstatlevel(zone);
if (statlevel == dns_zonestat_none) {
@@ -1814,12 +1822,8 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
* master zones, only include the loaded time. For slave zones, also
* include the expires and refresh times.
*/
isc_time_t timestamp;
result = dns_zone_getloadtime(zone, &timestamp);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dns_zone_getloadtime(zone, &timestamp));
isc_time_formatISO8601(&timestamp, buf, 64);
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "loaded"));
@@ -1827,19 +1831,13 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
TRY0(xmlTextWriterEndElement(writer));
if (dns_zone_gettype(zone) == dns_zone_slave) {
result = dns_zone_getexpiretime(zone, &timestamp);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dns_zone_getexpiretime(zone, &timestamp));
isc_time_formatISO8601(&timestamp, buf, 64);
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "expires"));
TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR buf));
TRY0(xmlTextWriterEndElement(writer));
result = dns_zone_getrefreshtime(zone, &timestamp);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dns_zone_getrefreshtime(zone, &timestamp));
isc_time_formatISO8601(&timestamp, buf, 64);
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "refresh"));
TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR buf));
@@ -1862,14 +1860,11 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
ISC_XMLCHAR "type",
ISC_XMLCHAR "rcode"));
result = dump_counters(zonestats, isc_statsformat_xml,
writer, NULL, nsstats_xmldesc,
ns_statscounter_max,
nsstats_index, nsstat_values,
ISC_STATSDUMP_VERBOSE);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dump_counters(zonestats, isc_statsformat_xml,
writer, NULL, nsstats_xmldesc,
ns_statscounter_max, nsstats_index,
nsstat_values,
ISC_STATSDUMP_VERBOSE));
/* counters type="rcode"*/
TRY0(xmlTextWriterEndElement(writer));
}
@@ -1882,15 +1877,12 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "gluecache"));
result = dump_counters(
CHECK(dump_counters(
gluecachestats, isc_statsformat_xml, writer,
NULL, gluecachestats_xmldesc,
dns_gluecachestatscounter_max,
gluecachestats_index, gluecachestats_values,
ISC_STATSDUMP_VERBOSE);
if (result != ISC_R_SUCCESS) {
goto error;
}
ISC_STATSDUMP_VERBOSE));
/* counters type="rcode"*/
TRY0(xmlTextWriterEndElement(writer));
}
@@ -1906,9 +1898,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
dumparg.result = ISC_R_SUCCESS;
dns_rdatatypestats_dump(rcvquerystats, rdtypestat_dump,
&dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dumparg.result);
/* counters type="qtype"*/
TRY0(xmlTextWriterEndElement(writer));
@@ -1927,9 +1917,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
dns_dnssecsignstats_dump(
dnssecsignstats, dns_dnssecsignstats_sign,
dnssecsignstat_dump, &dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dumparg.result);
/* counters type="dnssec-sign"*/
TRY0(xmlTextWriterEndElement(writer));
@@ -1945,9 +1933,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
dns_dnssecsignstats_dump(
dnssecsignstats, dns_dnssecsignstats_refresh,
dnssecsignstat_dump, &dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dumparg.result);
/* counters type="dnssec-refresh"*/
TRY0(xmlTextWriterEndElement(writer));
@@ -1957,7 +1943,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
TRY0(xmlTextWriterEndElement(writer)); /* zone */
return (ISC_R_SUCCESS);
error:
cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"Failed at zone_xmlrender()");
@@ -1999,7 +1985,7 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
writer = xmlNewTextWriterDoc(&doc, 0);
if (writer == NULL) {
goto error;
goto cleanup;
}
TRY0(xmlTextWriterStartDocument(writer, NULL, "UTF-8", NULL));
TRY0(xmlTextWriterWritePI(writer, ISC_XMLCHAR "xml-stylesheet",
@@ -2037,9 +2023,7 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
dns_opcodestats_dump(server->sctx->opcodestats, opcodestat_dump,
&dumparg, ISC_STATSDUMP_VERBOSE);
if (dumparg.result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dumparg.result);
TRY0(xmlTextWriterEndElement(writer));
@@ -2049,9 +2033,7 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
dns_rcodestats_dump(server->sctx->rcodestats, rcodestat_dump,
&dumparg, ISC_STATSDUMP_VERBOSE);
if (dumparg.result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dumparg.result);
TRY0(xmlTextWriterEndElement(writer));
@@ -2062,23 +2044,19 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
dumparg.result = ISC_R_SUCCESS;
dns_rdatatypestats_dump(server->sctx->rcvquerystats,
rdtypestat_dump, &dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dumparg.result);
TRY0(xmlTextWriterEndElement(writer)); /* counters */
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counters"));
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "nsstat"));
result = dump_counters(ns_stats_get(server->sctx->nsstats),
isc_statsformat_xml, writer, NULL,
nsstats_xmldesc, ns_statscounter_max,
nsstats_index, nsstat_values,
ISC_STATSDUMP_VERBOSE);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dump_counters(ns_stats_get(server->sctx->nsstats),
isc_statsformat_xml, writer, NULL,
nsstats_xmldesc, ns_statscounter_max,
nsstats_index, nsstat_values,
ISC_STATSDUMP_VERBOSE));
TRY0(xmlTextWriterEndElement(writer)); /* /nsstat */
@@ -2086,14 +2064,10 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "zonestat"));
result = dump_counters(server->zonestats, isc_statsformat_xml,
writer, NULL, zonestats_xmldesc,
dns_zonestatscounter_max,
zonestats_index, zonestat_values,
ISC_STATSDUMP_VERBOSE);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dump_counters(server->zonestats, isc_statsformat_xml,
writer, NULL, zonestats_xmldesc,
dns_zonestatscounter_max, zonestats_index,
zonestat_values, ISC_STATSDUMP_VERBOSE));
TRY0(xmlTextWriterEndElement(writer)); /* /zonestat */
@@ -2104,13 +2078,11 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counters"));
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "resstat"));
result = dump_counters(
server->resolverstats, isc_statsformat_xml, writer,
NULL, resstats_xmldesc, dns_resstatscounter_max,
resstats_index, resstat_values, 0);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dump_counters(server->resolverstats, isc_statsformat_xml,
writer, NULL, resstats_xmldesc,
dns_resstatscounter_max, resstats_index,
resstat_values, 0));
TRY0(xmlTextWriterEndElement(writer)); /* resstat */
#ifdef HAVE_DNSTAP
@@ -2127,9 +2099,8 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
dnstapstats_xmldesc, dns_dnstapcounter_max,
dnstapstats_index, dnstapstat_values, 0);
isc_stats_detach(&dnstapstats);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(result);
TRY0(xmlTextWriterEndElement(writer)); /* dnstap */
}
#endif /* ifdef HAVE_DNSTAP */
@@ -2140,14 +2111,10 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "sockstat"));
result = dump_counters(server->sockstats, isc_statsformat_xml,
writer, NULL, sockstats_xmldesc,
isc_sockstatscounter_max,
sockstats_index, sockstat_values,
ISC_STATSDUMP_VERBOSE);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dump_counters(server->sockstats, isc_statsformat_xml,
writer, NULL, sockstats_xmldesc,
isc_sockstatscounter_max, sockstats_index,
sockstat_values, ISC_STATSDUMP_VERBOSE));
TRY0(xmlTextWriterEndElement(writer)); /* /sockstat */
}
@@ -2161,13 +2128,10 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "request-size"));
result = dump_counters(
CHECK(dump_counters(
server->sctx->udpinstats4, isc_statsformat_xml, writer,
NULL, udpinsizestats_xmldesc, dns_sizecounter_in_max,
udpinsizestats_index, udpinsizestat_values, 0);
if (result != ISC_R_SUCCESS) {
goto error;
}
udpinsizestats_index, udpinsizestat_values, 0));
TRY0(xmlTextWriterEndElement(writer)); /* </counters> */
@@ -2175,13 +2139,10 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "response-size"));
result = dump_counters(
CHECK(dump_counters(
server->sctx->udpoutstats4, isc_statsformat_xml, writer,
NULL, udpoutsizestats_xmldesc, dns_sizecounter_out_max,
udpoutsizestats_index, udpoutsizestat_values, 0);
if (result != ISC_R_SUCCESS) {
goto error;
}
udpoutsizestats_index, udpoutsizestat_values, 0));
TRY0(xmlTextWriterEndElement(writer)); /* </counters> */
TRY0(xmlTextWriterEndElement(writer)); /* </udp> */
@@ -2191,27 +2152,20 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "request-size"));
result = dump_counters(
CHECK(dump_counters(
server->sctx->tcpinstats4, isc_statsformat_xml, writer,
NULL, tcpinsizestats_xmldesc, dns_sizecounter_in_max,
tcpinsizestats_index, tcpinsizestat_values, 0);
if (result != ISC_R_SUCCESS) {
goto error;
}
tcpinsizestats_index, tcpinsizestat_values, 0));
TRY0(xmlTextWriterEndElement(writer)); /* </counters> */
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counters"));
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "response-size"));
result = dump_counters(
CHECK(dump_counters(
server->sctx->tcpoutstats4, isc_statsformat_xml, writer,
NULL, tcpoutsizestats_xmldesc, dns_sizecounter_out_max,
tcpoutsizestats_index, tcpoutsizestat_values, 0);
if (result != ISC_R_SUCCESS) {
goto error;
}
tcpoutsizestats_index, tcpoutsizestat_values, 0));
TRY0(xmlTextWriterEndElement(writer)); /* </counters> */
TRY0(xmlTextWriterEndElement(writer)); /* </tcp> */
@@ -2223,13 +2177,10 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "request-size"));
result = dump_counters(
CHECK(dump_counters(
server->sctx->udpinstats6, isc_statsformat_xml, writer,
NULL, udpinsizestats_xmldesc, dns_sizecounter_in_max,
udpinsizestats_index, udpinsizestat_values, 0);
if (result != ISC_R_SUCCESS) {
goto error;
}
udpinsizestats_index, udpinsizestat_values, 0));
TRY0(xmlTextWriterEndElement(writer)); /* </counters> */
@@ -2237,13 +2188,10 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "response-size"));
result = dump_counters(
CHECK(dump_counters(
server->sctx->udpoutstats6, isc_statsformat_xml, writer,
NULL, udpoutsizestats_xmldesc, dns_sizecounter_out_max,
udpoutsizestats_index, udpoutsizestat_values, 0);
if (result != ISC_R_SUCCESS) {
goto error;
}
udpoutsizestats_index, udpoutsizestat_values, 0));
TRY0(xmlTextWriterEndElement(writer)); /* </counters> */
TRY0(xmlTextWriterEndElement(writer)); /* </udp> */
@@ -2253,13 +2201,10 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "request-size"));
result = dump_counters(
CHECK(dump_counters(
server->sctx->tcpinstats6, isc_statsformat_xml, writer,
NULL, tcpinsizestats_xmldesc, dns_sizecounter_in_max,
tcpinsizestats_index, tcpinsizestat_values, 0);
if (result != ISC_R_SUCCESS) {
goto error;
}
tcpinsizestats_index, tcpinsizestat_values, 0));
TRY0(xmlTextWriterEndElement(writer)); /* </counters> */
@@ -2267,13 +2212,10 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "response-size"));
result = dump_counters(
CHECK(dump_counters(
server->sctx->tcpoutstats6, isc_statsformat_xml, writer,
NULL, tcpoutsizestats_xmldesc, dns_sizecounter_out_max,
tcpoutsizestats_index, tcpoutsizestat_values, 0);
if (result != ISC_R_SUCCESS) {
goto error;
}
tcpoutsizestats_index, tcpoutsizestat_values, 0));
TRY0(xmlTextWriterEndElement(writer)); /* </counters> */
TRY0(xmlTextWriterEndElement(writer)); /* </tcp> */
@@ -2296,11 +2238,8 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
if ((flags & STATS_XML_ZONES) != 0) {
TRY0(xmlTextWriterStartElement(writer,
ISC_XMLCHAR "zones"));
result = dns_zt_apply(view->zonetable, true, NULL,
zone_xmlrender, writer);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dns_zt_apply(view->zonetable, true, NULL,
zone_xmlrender, writer));
TRY0(xmlTextWriterEndElement(writer)); /* /zones */
}
@@ -2318,9 +2257,7 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
dumparg.result = ISC_R_SUCCESS;
dns_rdatatypestats_dump(view->resquerystats,
rdtypestat_dump, &dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dumparg.result);
}
TRY0(xmlTextWriterEndElement(writer));
@@ -2329,14 +2266,11 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "resstats"));
if (view->resstats != NULL) {
result = dump_counters(
view->resstats, isc_statsformat_xml, writer,
NULL, resstats_xmldesc, dns_resstatscounter_max,
resstats_index, resstat_values,
ISC_STATSDUMP_VERBOSE);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dump_counters(view->resstats, isc_statsformat_xml,
writer, NULL, resstats_xmldesc,
dns_resstatscounter_max,
resstats_index, resstat_values,
ISC_STATSDUMP_VERBOSE));
}
TRY0(xmlTextWriterEndElement(writer)); /* </resstats> */
@@ -2350,9 +2284,7 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
dumparg.result = ISC_R_SUCCESS;
dns_rdatasetstats_dump(cacherrstats, rdatasetstats_dump,
&dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dumparg.result);
TRY0(xmlTextWriterEndElement(writer)); /* cache */
}
@@ -2361,14 +2293,11 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "type",
ISC_XMLCHAR "adbstat"));
if (view->adbstats != NULL) {
result = dump_counters(
view->adbstats, isc_statsformat_xml, writer,
NULL, adbstats_xmldesc, dns_adbstats_max,
adbstats_index, adbstat_values,
ISC_STATSDUMP_VERBOSE);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dump_counters(view->adbstats, isc_statsformat_xml,
writer, NULL, adbstats_xmldesc,
dns_adbstats_max, adbstats_index,
adbstat_values,
ISC_STATSDUMP_VERBOSE));
}
TRY0(xmlTextWriterEndElement(writer)); /* </adbstats> */
@@ -2411,12 +2340,12 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
xmlDocDumpFormatMemoryEnc(doc, buf, buflen, "UTF-8", 0);
if (*buf == NULL) {
goto error;
goto cleanup;
}
xmlFreeDoc(doc);
return (ISC_R_SUCCESS);
error:
cleanup:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"failed generating XML response");
@@ -2573,18 +2502,11 @@ render_xml_traffic(const char *url, isc_httpdurl_t *urlinfo,
#define STATS_JSON_TRAFFIC 0x20
#define STATS_JSON_ALL 0xff
#define CHECK(m) \
do { \
result = (m); \
if (result != ISC_R_SUCCESS) \
goto error; \
} while (0)
#define CHECKMEM(m) \
do { \
if (m == NULL) { \
result = ISC_R_NOMEMORY; \
goto error; \
goto cleanup; \
} \
} while (0)
@@ -2664,27 +2586,18 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
isc_time_t timestamp;
result = dns_zone_getloadtime(zone, &timestamp);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dns_zone_getloadtime(zone, &timestamp));
isc_time_formatISO8601(&timestamp, buf, 64);
json_object_object_add(zoneobj, "loaded", json_object_new_string(buf));
if (dns_zone_gettype(zone) == dns_zone_slave) {
result = dns_zone_getexpiretime(zone, &timestamp);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dns_zone_getexpiretime(zone, &timestamp));
isc_time_formatISO8601(&timestamp, buf, 64);
json_object_object_add(zoneobj, "expires",
json_object_new_string(buf));
result = dns_zone_getrefreshtime(zone, &timestamp);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dns_zone_getrefreshtime(zone, &timestamp));
isc_time_formatISO8601(&timestamp, buf, 64);
json_object_object_add(zoneobj, "refresh",
json_object_new_string(buf));
@@ -2703,7 +2616,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
json_object *counters = json_object_new_object();
if (counters == NULL) {
result = ISC_R_NOMEMORY;
goto error;
goto cleanup;
}
result = dump_counters(zonestats, isc_statsformat_json,
@@ -2712,7 +2625,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
nsstats_index, nsstat_values, 0);
if (result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -2728,7 +2641,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
json_object *counters = json_object_new_object();
if (counters == NULL) {
result = ISC_R_NOMEMORY;
goto error;
goto cleanup;
}
result = dump_counters(
@@ -2738,7 +2651,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
gluecachestats_index, gluecachestats_values, 0);
if (result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -2762,7 +2675,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
&dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -2787,7 +2700,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
dnssecsignstat_dump, &dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
json_object_put(sign_counters);
goto error;
goto cleanup;
}
if (json_object_get_object(sign_counters)->count != 0) {
@@ -2809,7 +2722,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
dnssecsignstat_dump, &dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
json_object_put(refresh_counters);
goto error;
goto cleanup;
}
if (json_object_get_object(refresh_counters)->count !=
@@ -2827,7 +2740,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
zoneobj = NULL;
result = ISC_R_SUCCESS;
error:
cleanup:
if (zoneobj != NULL) {
json_object_put(zoneobj);
}
@@ -2912,7 +2825,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
&dumparg, ISC_STATSDUMP_VERBOSE);
if (dumparg.result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -2931,7 +2844,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
&dumparg, ISC_STATSDUMP_VERBOSE);
if (dumparg.result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -2950,7 +2863,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
rdtypestat_dump, &dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -2971,7 +2884,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
nsstats_index, nsstat_values, 0);
if (result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -2992,7 +2905,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
zonestats_index, zonestat_values, 0);
if (result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -3014,7 +2927,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
resstats_index, resstat_values, 0);
if (result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -3039,7 +2952,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
isc_stats_detach(&dnstapstats);
if (result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -3069,12 +2982,8 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
CHECKMEM(za);
if ((flags & STATS_JSON_ZONES) != 0) {
result = dns_zt_apply(view->zonetable, true,
NULL, zone_jsonrender,
za);
if (result != ISC_R_SUCCESS) {
goto error;
}
CHECK(dns_zt_apply(view->zonetable, true, NULL,
zone_jsonrender, za));
}
if (json_object_array_length(za) != 0) {
@@ -3107,7 +3016,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
if (result != ISC_R_SUCCESS) {
json_object_put(counters);
result = dumparg.result;
goto error;
goto cleanup;
}
json_object_object_add(res, "stats",
@@ -3127,7 +3036,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
if (dumparg.result != ISC_R_SUCCESS) {
json_object_put(counters);
result = dumparg.result;
goto error;
goto cleanup;
}
json_object_object_add(res, "qtypes",
@@ -3147,7 +3056,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
if (dumparg.result != ISC_R_SUCCESS) {
json_object_put(counters);
result = dumparg.result;
goto error;
goto cleanup;
}
json_object_object_add(res, "cache",
@@ -3161,7 +3070,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
counters);
if (result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
json_object_object_add(res, "cachestats",
@@ -3182,7 +3091,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
if (result != ISC_R_SUCCESS) {
json_object_put(counters);
result = dumparg.result;
goto error;
goto cleanup;
}
json_object_object_add(res, "adb",
@@ -3208,7 +3117,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
sockstats_index, sockstat_values, 0);
if (result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
goto cleanup;
}
if (json_object_get_object(counters)->count != 0) {
@@ -3224,7 +3133,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
result = isc_socketmgr_renderjson(named_g_socketmgr, sockets);
if (result != ISC_R_SUCCESS) {
json_object_put(sockets);
goto error;
goto cleanup;
}
json_object_object_add(bindstats, "socketmgr", sockets);
@@ -3237,7 +3146,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
result = isc_taskmgr_renderjson(named_g_taskmgr, tasks);
if (result != ISC_R_SUCCESS) {
json_object_put(tasks);
goto error;
goto cleanup;
}
json_object_object_add(bindstats, "taskmgr", tasks);
@@ -3250,7 +3159,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
result = isc_mem_renderjson(memory);
if (result != ISC_R_SUCCESS) {
json_object_put(memory);
goto error;
goto cleanup;
}
json_object_object_add(bindstats, "memory", memory);
@@ -3375,7 +3284,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
result = ISC_R_SUCCESS;
error:
cleanup:
if (udpreq4 != NULL) {
json_object_put(udpreq4);
}
@@ -3654,7 +3563,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
static void
destroy_listener(void *arg) {
named_statschannel_t *listener = arg;
named_statschannel_t *listener = (named_statschannel_t *)arg;
REQUIRE(listener != NULL);
REQUIRE(!ISC_LINK_LINKED(listener, link));
@@ -3672,22 +3581,15 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclconfctx,
const char *socktext) {
isc_result_t result;
named_statschannel_t *listener;
isc_task_t *task = NULL;
isc_socket_t *sock = NULL;
const cfg_obj_t *allow;
named_statschannel_t *listener = NULL;
const cfg_obj_t *allow = NULL;
dns_acl_t *new_acl = NULL;
int pf;
listener = isc_mem_get(server->mctx, sizeof(*listener));
listener->httpdmgr = NULL;
listener->address = *addr;
listener->acl = NULL;
listener->mctx = NULL;
*listener = (named_statschannel_t){ .address = *addr };
ISC_LINK_INIT(listener, link);
isc_mutex_init(&listener->lock);
isc_mem_attach(server->mctx, &listener->mctx);
allow = cfg_tuple_get(listen_params, "allow");
@@ -3698,104 +3600,80 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
} else {
result = dns_acl_any(listener->mctx, &new_acl);
}
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
CHECK(result);
dns_acl_attach(new_acl, &listener->acl);
dns_acl_detach(&new_acl);
result = isc_task_create(named_g_taskmgr, 0, &task);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
isc_task_setname(task, "statchannel", NULL);
result = isc_socket_create(named_g_socketmgr, isc_sockaddr_pf(addr),
isc_sockettype_tcp, &sock);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
isc_socket_setname(sock, "statchannel", NULL);
#ifndef ISC_ALLOW_MAPPED
isc_socket_ipv6only(sock, true);
#endif /* ifndef ISC_ALLOW_MAPPED */
result = isc_socket_bind(sock, addr, ISC_SOCKET_REUSEADDRESS);
if (result != ISC_R_SUCCESS) {
goto cleanup;
pf = isc_sockaddr_pf(&listener->address);
if ((pf == AF_INET && isc_net_probeipv4() != ISC_R_SUCCESS) ||
(pf == AF_INET6 && isc_net_probeipv6() != ISC_R_SUCCESS))
{
CHECK(ISC_R_FAMILYNOSUPPORT);
}
result = isc_httpdmgr_create(server->mctx, sock, task, client_ok,
destroy_listener, listener,
named_g_timermgr, &listener->httpdmgr);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
CHECK(isc_httpdmgr_create(named_g_nm, server->mctx, addr, client_ok,
destroy_listener, listener,
&listener->httpdmgr));
#ifdef HAVE_LIBXML2
isc_httpdmgr_addurl(listener->httpdmgr, "/", render_xml_all, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml", render_xml_all, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3", render_xml_all,
isc_httpdmgr_addurl(listener->httpdmgr, "/", false, render_xml_all,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/status",
isc_httpdmgr_addurl(listener->httpdmgr, "/xml", false, render_xml_all,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3", false,
render_xml_all, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/status", false,
render_xml_status, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/server",
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/server", false,
render_xml_server, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/zones",
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/zones", false,
render_xml_zones, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/net", render_xml_net,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/tasks",
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/net", false,
render_xml_net, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/tasks", false,
render_xml_tasks, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/mem", render_xml_mem,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/traffic",
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/mem", false,
render_xml_mem, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/traffic", false,
render_xml_traffic, server);
#endif /* ifdef HAVE_LIBXML2 */
#ifdef HAVE_JSON_C
isc_httpdmgr_addurl(listener->httpdmgr, "/json", render_json_all,
isc_httpdmgr_addurl(listener->httpdmgr, "/json", false, render_json_all,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1", render_json_all,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/status",
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1", false,
render_json_all, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/status", false,
render_json_status, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/server",
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/server", false,
render_json_server, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/zones",
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/zones", false,
render_json_zones, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/tasks",
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/tasks", false,
render_json_tasks, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/net", render_json_net,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/mem", render_json_mem,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/traffic",
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/net", false,
render_json_net, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/mem", false,
render_json_mem, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/traffic", false,
render_json_traffic, server);
#endif /* ifdef HAVE_JSON_C */
isc_httpdmgr_addurl2(listener->httpdmgr, "/bind9.xsl", true, render_xsl,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/bind9.xsl", true, render_xsl,
server);
*listenerp = listener;
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_NOTICE,
"statistics channel listening on %s", socktext);
return (ISC_R_SUCCESS);
cleanup:
if (result != ISC_R_SUCCESS) {
if (listener->acl != NULL) {
dns_acl_detach(&listener->acl);
}
isc_mutex_destroy(&listener->lock);
isc_mem_putanddetach(&listener->mctx, listener,
sizeof(*listener));
}
if (task != NULL) {
isc_task_detach(&task);
}
if (sock != NULL) {
isc_socket_detach(&sock);
if (listener->acl != NULL) {
dns_acl_detach(&listener->acl);
}
isc_mutex_destroy(&listener->lock);
isc_mem_putanddetach(&listener->mctx, listener, sizeof(*listener));
return (result);
}
+4 -4
View File
@@ -67,7 +67,7 @@
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@.\;..\..\..\;@LIBXML2_INC@..\win32\include;..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;..\..\..\lib\bind9\include;..\..\..\lib\ns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>@LIBUV_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@.\;..\..\..\;@LIBXML2_INC@..\win32\include;..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;..\..\..\lib\bind9\include;..\..\..\lib\ns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
@@ -75,7 +75,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@@LIBXML2_LIB@@GSSAPI_LIB@@GEOIP_LIB@libisc.lib;libdns.lib;libisccc.lib;libisccfg.lib;libbind9.lib;libns.lib;version.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@LIBUV_LIB@@OPENSSL_LIB@@LIBXML2_LIB@@GSSAPI_LIB@@GEOIP_LIB@libisc.lib;libdns.lib;libisccc.lib;libisccfg.lib;libbind9.lib;libns.lib;version.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>cd ..
@@ -103,7 +103,7 @@ perl -e "print \";\";" &gt;&gt; xsl.c
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<ForcedIncludeFiles>..\..\..\config.h</ForcedIncludeFiles>
<AdditionalIncludeDirectories>@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@.\;..\..\..\;@LIBXML2_INC@..\win32\include;..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;..\..\..\lib\bind9\include;..\..\..\lib\ns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>@LIBUV_INC@@OPENSSL_INC@@GSSAPI_INC@@GEOIP_INC@.\;..\..\..\;@LIBXML2_INC@..\win32\include;..\include;..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;..\..\..\lib\isccc\include;..\..\..\lib\isccfg\include;..\..\..\lib\bind9\include;..\..\..\lib\ns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
@@ -114,7 +114,7 @@ perl -e "print \";\";" &gt;&gt; xsl.c
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@@LIBXML2_LIB@@GSSAPI_LIB@@GEOIP_LIB@libisc.lib;libdns.lib;libisccc.lib;libisccfg.lib;libbind9.lib;libns.lib;version.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>@LIBUV_LIB@@OPENSSL_LIB@@LIBXML2_LIB@@GSSAPI_LIB@@GEOIP_LIB@libisc.lib;libdns.lib;libisccc.lib;libisccfg.lib;libbind9.lib;libns.lib;version.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>cd ..
+3 -3
View File
@@ -1594,11 +1594,11 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
if (cfg_obj_isvoid(resign)) {
seconds /= 4;
} else if (!sigvalinsecs) {
seconds = cfg_obj_asuint32(resign);
uint32_t r = cfg_obj_asuint32(resign);
if (seconds > 7 * 86400) {
seconds *= 86400;
seconds = r * 86400;
} else {
seconds *= 3600;
seconds = r * 3600;
}
} else {
seconds = cfg_obj_asuint32(resign);
+5 -1
View File
@@ -18,8 +18,12 @@ LDADD = \
$(LIBISCCFG_LIBS) \
$(LIBIRS_LIBS) \
$(LIBBIND9_LIBS) \
$(READLINE_LIB) \
$(GSSAPI_LIBS) \
$(KRB5_LIBS)
if HAVE_READLINE
LDADD += \
$(READLINE_LIBS)
endif
bin_PROGRAMS = nsupdate
+8 -28
View File
@@ -36,6 +36,7 @@
#include <isc/portset.h>
#include <isc/print.h>
#include <isc/random.h>
#include <isc/readline.h>
#include <isc/region.h>
#include <isc/sockaddr.h>
#include <isc/socket.h>
@@ -94,20 +95,6 @@
#include <bind9/getaddresses.h>
#if defined(HAVE_READLINE)
#if defined(HAVE_EDIT_READLINE_READLINE_H)
#include <edit/readline/readline.h>
#if defined(HAVE_EDIT_READLINE_HISTORY_H)
#include <edit/readline/history.h>
#endif /* if defined(HAVE_EDIT_READLINE_HISTORY_H) */
#elif defined(HAVE_EDITLINE_READLINE_H)
#include <editline/readline.h>
#else /* if defined(HAVE_EDIT_READLINE_READLINE_H) */
#include <readline/history.h>
#include <readline/readline.h>
#endif /* if defined(HAVE_EDIT_READLINE_READLINE_H) */
#endif /* if defined(HAVE_READLINE) */
#define MAXCMD (128 * 1024)
#define MAXWIRE (64 * 1024)
#define PACKETSIZE ((64 * 1024) - 1)
@@ -2290,20 +2277,14 @@ static uint16_t
get_next_command(void) {
uint16_t result = STATUS_QUIT;
char cmdlinebuf[MAXCMD];
char *cmdline;
char *cmdline = NULL, *ptr = NULL;
isc_app_block();
if (interactive) {
#ifdef HAVE_READLINE
cmdline = readline("> ");
if (cmdline != NULL) {
add_history(cmdline);
cmdline = ptr = readline("> ");
if (ptr != NULL && *ptr != 0) {
add_history(ptr);
}
#else /* ifdef HAVE_READLINE */
fprintf(stdout, "> ");
fflush(stdout);
cmdline = fgets(cmdlinebuf, MAXCMD, input);
#endif /* ifdef HAVE_READLINE */
} else {
cmdline = fgets(cmdlinebuf, MAXCMD, input);
}
@@ -2319,11 +2300,10 @@ get_next_command(void) {
(void)nsu_strsep(&tmp, "\r\n");
result = do_next_command(cmdline);
}
#ifdef HAVE_READLINE
if (interactive) {
free(cmdline);
if (ptr != NULL) {
free(ptr);
}
#endif /* ifdef HAVE_READLINE */
return (result);
}
+1 -1
View File
@@ -169,7 +169,7 @@ install_hooks(ns_hooktable_t *hooktable, isc_mem_t *mctx,
.action_data = inst,
};
ns_hook_add(hooktable, mctx, -NS_QUERY_QCTX_INITIALIZED, &filter_init);
ns_hook_add(hooktable, mctx, NS_QUERY_QCTX_INITIALIZED, &filter_init);
ns_hook_add(hooktable, mctx, NS_QUERY_RESPOND_BEGIN, &filter_respbegin);
ns_hook_add(hooktable, mctx, NS_QUERY_RESPOND_ANY_FOUND,
&filter_respanyfound);
+138 -123
View File
@@ -55,11 +55,14 @@
#define SERVERADDRS 10
const char *progname;
const char *progname = NULL;
bool verbose;
static const char *admin_conffile;
static const char *admin_keyfile;
static isc_taskmgr_t *taskmgr = NULL;
static isc_task_t *rndc_task = NULL;
static const char *admin_conffile = NULL;
static const char *admin_keyfile = NULL;
static const char *version = PACKAGE_VERSION;
static const char *servername = NULL;
static isc_sockaddr_t serveraddrs[SERVERADDRS];
@@ -68,27 +71,27 @@ static bool local4set = false, local6set = false;
static int nserveraddrs;
static int currentaddr = 0;
static unsigned int remoteport = 0;
static isc_socketmgr_t *socketmgr = NULL;
static isc_buffer_t *databuf;
static isccc_ccmsg_t ccmsg;
static isc_nm_t *netmgr = NULL;
static isc_buffer_t *databuf = NULL;
static isccc_ccmsg_t rndc_ccmsg;
static uint32_t algorithm;
static isccc_region_t secret;
static bool failed = false;
static bool c_flag = false;
static isc_mem_t *rndc_mctx;
static isc_mem_t *rndc_mctx = NULL;
static atomic_uint_fast32_t sends = ATOMIC_VAR_INIT(0);
static atomic_uint_fast32_t recvs = ATOMIC_VAR_INIT(0);
static atomic_uint_fast32_t connects = ATOMIC_VAR_INIT(0);
static char *command;
static char *args;
static char *command = NULL;
static char *args = NULL;
static char program[256];
static isc_socket_t *sock = NULL;
static uint32_t serial;
static bool quiet = false;
static bool showresult = false;
static bool shuttingdown = false;
static void
rndc_startconnect(isc_sockaddr_t *addr, isc_task_t *task);
rndc_startconnect(isc_sockaddr_t *addr);
ISC_NORETURN static void
usage(int status);
@@ -105,6 +108,12 @@ command is one of the following:\n\
Add zone to given view. Requires allow-new-zones option.\n\
delzone [-clean] zone [class [view]]\n\
Removes zone from given view.\n\
dnssec -checkds [-key id [-alg algorithm] [-when time] (published|withdrawn) zone [class [view]]\n\
Mark the DS record for the KSK of the given zone as seen\n\
in the parent. If the zone has multiple KSKs, select a\n\
specific key by providing the keytag with -key id and\n\
optionally the key's algorithm with -alg algorithm.\n\
Requires the zone to have a dnssec-policy.\n\
dnssec -status zone [class [view]]\n\
Show the DNSSEC signing state for the specified zone.\n\
Requires the zone to have a dnssec-policy.\n\
@@ -114,7 +123,7 @@ command is one of the following:\n\
Close, rename and re-open the DNSTAP output file(s).\n\
dumpdb [-all|-cache|-zones|-adb|-bad|-fail] [view ...]\n\
Dump cache(s) to the dump file (named_dump.db).\n\
flush Flushes all of the server's caches.\n\
flush Flushes all of the server's caches.\n\
flush [view] Flushes the server's cache for a view.\n\
flushname name [view]\n\
Flush the given name from the server's cache(s)\n\
@@ -278,51 +287,54 @@ get_addresses(const char *host, in_port_t port) {
}
static void
rndc_senddone(isc_task_t *task, isc_event_t *event) {
isc_socketevent_t *sevent = (isc_socketevent_t *)event;
rndc_senddone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
UNUSED(arg);
UNUSED(task);
if (sevent->result != ISC_R_SUCCESS) {
fatal("send failed: %s", isc_result_totext(sevent->result));
if (result != ISC_R_SUCCESS) {
fatal("send failed: %s", isc_result_totext(result));
}
isc_event_free(&event);
if (atomic_fetch_sub_release(&sends, 1) == 1 &&
atomic_load_acquire(&recvs) == 0)
{
isc_socket_detach(&sock);
isc_task_shutdown(task);
shuttingdown = true;
isc_task_shutdown(rndc_task);
isc_app_shutdown();
isc_nmhandle_unref(handle);
}
}
static void
rndc_recvdone(isc_task_t *task, isc_event_t *event) {
rndc_recvdone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
isccc_ccmsg_t *ccmsg = (isccc_ccmsg_t *)arg;
isccc_sexpr_t *response = NULL;
isccc_sexpr_t *data;
isccc_region_t source;
char *errormsg = NULL;
char *textmsg = NULL;
isc_result_t result;
REQUIRE(ccmsg != NULL);
atomic_fetch_sub_release(&recvs, 1);
if (ccmsg.result == ISC_R_EOF) {
fatal("connection to remote host closed\n"
"This may indicate that\n"
"* the remote server is using an older version of"
" the command protocol,\n"
if (shuttingdown && (result == ISC_R_EOF || result == ISC_R_CANCELED)) {
isc_nmhandle_unref(handle);
return;
} else if (result == ISC_R_EOF) {
fatal("connection to remote host closed.\n"
"* This may indicate that the\n"
"* remote server is using an older\n"
"* version of the command protocol,\n"
"* this host is not authorized to connect,\n"
"* the clocks are not synchronized, or\n"
"* the key is invalid.");
"* the clocks are not synchronized,\n"
"* the key signing algorithm is incorrect,\n"
"* or the key is invalid.");
} else if (result != ISC_R_SUCCESS && result != ISC_R_CANCELED) {
fatal("recv failed: %s", isc_result_totext(result));
}
if (ccmsg.result != ISC_R_SUCCESS) {
fatal("recv failed: %s", isc_result_totext(ccmsg.result));
}
source.rstart = isc_buffer_base(&ccmsg.buffer);
source.rend = isc_buffer_used(&ccmsg.buffer);
source.rstart = isc_buffer_base(ccmsg->buffer);
source.rend = isc_buffer_used(ccmsg->buffer);
DO("parse message",
isccc_cc_fromwire(&source, &response, algorithm, &secret));
@@ -362,22 +374,23 @@ rndc_recvdone(isc_task_t *task, isc_event_t *event) {
}
}
isc_event_free(&event);
isccc_sexpr_free(&response);
if (atomic_load_acquire(&sends) == 0 &&
atomic_load_acquire(&recvs) == 0) {
isc_socket_detach(&sock);
isc_task_shutdown(task);
shuttingdown = true;
isc_nmhandle_unref(handle);
isc_task_shutdown(rndc_task);
isc_app_shutdown();
}
}
static void
rndc_recvnonce(isc_task_t *task, isc_event_t *event) {
rndc_recvnonce(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
isccc_ccmsg_t *ccmsg = (isccc_ccmsg_t *)arg;
isccc_sexpr_t *response = NULL;
isccc_sexpr_t *_ctrl;
isccc_region_t source;
isc_result_t result;
uint32_t nonce;
isccc_sexpr_t *request = NULL;
isccc_time_t now;
@@ -385,25 +398,28 @@ rndc_recvnonce(isc_task_t *task, isc_event_t *event) {
isccc_sexpr_t *data;
isc_buffer_t b;
REQUIRE(ccmsg != NULL);
atomic_fetch_sub_release(&recvs, 1);
if (ccmsg.result == ISC_R_EOF) {
fatal("connection to remote host closed\n"
"This may indicate that\n"
"* the remote server is using an older version of"
" the command protocol,\n"
if (shuttingdown && result == ISC_R_EOF) {
isc_nmhandle_unref(handle);
return;
} else if (result == ISC_R_EOF) {
fatal("connection to remote host closed.\n"
"* This may indicate that the\n"
"* remote server is using an older\n"
"* version of the command protocol,\n"
"* this host is not authorized to connect,\n"
"* the clocks are not synchronized,\n"
"* the key signing algorithm is incorrect, or\n"
"* the key is invalid.");
"* the key signing algorithm is incorrect\n"
"* or the key is invalid.");
} else if (result != ISC_R_SUCCESS) {
fatal("recv failed: %s", isc_result_totext(result));
}
if (ccmsg.result != ISC_R_SUCCESS) {
fatal("recv failed: %s", isc_result_totext(ccmsg.result));
}
source.rstart = isc_buffer_base(&ccmsg.buffer);
source.rend = isc_buffer_used(&ccmsg.buffer);
source.rstart = isc_buffer_base(ccmsg->buffer);
source.rend = isc_buffer_used(ccmsg->buffer);
DO("parse message",
isccc_cc_fromwire(&source, &response, algorithm, &secret));
@@ -451,48 +467,44 @@ rndc_recvnonce(isc_task_t *task, isc_event_t *event) {
r.base = databuf->base;
r.length = databuf->used;
isccc_ccmsg_cancelread(&ccmsg);
DO("schedule recv",
isccc_ccmsg_readmessage(&ccmsg, task, rndc_recvdone, NULL));
isccc_ccmsg_readmessage(ccmsg, rndc_recvdone, ccmsg));
atomic_fetch_add_relaxed(&recvs, 1);
DO("send message",
isc_socket_send(sock, &r, task, rndc_senddone, NULL));
DO("send message", isc_nm_send(handle, &r, rndc_senddone, NULL));
atomic_fetch_add_relaxed(&sends, 1);
isc_event_free(&event);
isccc_sexpr_free(&response);
isccc_sexpr_free(&request);
return;
}
static void
rndc_connected(isc_task_t *task, isc_event_t *event) {
rndc_connected(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
isccc_ccmsg_t *ccmsg = (isccc_ccmsg_t *)arg;
char socktext[ISC_SOCKADDR_FORMATSIZE];
isc_socketevent_t *sevent = (isc_socketevent_t *)event;
isccc_sexpr_t *request = NULL;
isccc_sexpr_t *data;
isccc_time_t now;
isc_region_t r;
isc_buffer_t b;
isc_result_t result;
REQUIRE(ccmsg != NULL);
atomic_fetch_sub_release(&connects, 1);
if (sevent->result != ISC_R_SUCCESS) {
if (result != ISC_R_SUCCESS) {
isc_sockaddr_format(&serveraddrs[currentaddr], socktext,
sizeof(socktext));
if (sevent->result != ISC_R_CANCELED &&
++currentaddr < nserveraddrs) {
if (++currentaddr < nserveraddrs) {
notify("connection failed: %s: %s", socktext,
isc_result_totext(sevent->result));
isc_socket_detach(&sock);
isc_event_free(&event);
rndc_startconnect(&serveraddrs[currentaddr], task);
isc_result_totext(result));
rndc_startconnect(&serveraddrs[currentaddr]);
return;
} else {
fatal("connect failed: %s: %s", socktext,
isc_result_totext(sevent->result));
}
fatal("connect failed: %s: %s", socktext,
isc_result_totext(result));
}
isc_stdtime_get(&now);
@@ -519,50 +531,52 @@ rndc_connected(isc_task_t *task, isc_event_t *event) {
r.base = databuf->base;
r.length = databuf->used;
isccc_ccmsg_init(rndc_mctx, sock, &ccmsg);
isccc_ccmsg_setmaxsize(&ccmsg, 1024 * 1024);
isccc_ccmsg_init(rndc_mctx, handle, ccmsg);
isccc_ccmsg_setmaxsize(ccmsg, 1024 * 1024);
isc_nmhandle_ref(handle);
DO("schedule recv",
isccc_ccmsg_readmessage(&ccmsg, task, rndc_recvnonce, NULL));
isccc_ccmsg_readmessage(ccmsg, rndc_recvnonce, ccmsg));
atomic_fetch_add_relaxed(&recvs, 1);
DO("send message",
isc_socket_send(sock, &r, task, rndc_senddone, NULL));
DO("send message", isc_nm_send(handle, &r, rndc_senddone, NULL));
atomic_fetch_add_relaxed(&sends, 1);
isc_event_free(&event);
isccc_sexpr_free(&request);
}
static void
rndc_startconnect(isc_sockaddr_t *addr, isc_task_t *task) {
rndc_startconnect(isc_sockaddr_t *addr) {
isc_result_t result;
int pf;
isc_sockettype_t type;
char socktext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_t *local = NULL;
isc_sockaddr_format(addr, socktext, sizeof(socktext));
notify("using server %s (%s)", servername, socktext);
pf = isc_sockaddr_pf(addr);
if (pf == AF_INET || pf == AF_INET6) {
type = isc_sockettype_tcp;
} else {
type = isc_sockettype_unix;
}
DO("create socket", isc_socket_create(socketmgr, pf, type, &sock));
switch (isc_sockaddr_pf(addr)) {
case AF_INET:
DO("bind socket", isc_socket_bind(sock, &local4, 0));
local = &local4;
break;
case AF_INET6:
DO("bind socket", isc_socket_bind(sock, &local6, 0));
local = &local6;
break;
case AF_UNIX:
/*
* TODO: support UNIX domain sockets in netgmr.
*/
fatal("UNIX domain sockets not currently supported");
default:
break;
INSIST(0);
ISC_UNREACHABLE();
}
DO("connect",
isc_socket_connect(sock, addr, task, rndc_connected, NULL));
DO("create connection",
isc_nm_tcpconnect(netmgr, (isc_nmiface_t *)local,
(isc_nmiface_t *)addr, rndc_connected, &rndc_ccmsg,
0));
atomic_fetch_add_relaxed(&connects, 1);
}
@@ -570,8 +584,10 @@ static void
rndc_start(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
UNUSED(task);
currentaddr = 0;
rndc_startconnect(&serveraddrs[currentaddr], task);
rndc_startconnect(&serveraddrs[currentaddr]);
}
static void
@@ -652,7 +668,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
if (servers != NULL) {
for (elt = cfg_list_first(servers); elt != NULL;
elt = cfg_list_next(elt)) {
const char *name;
const char *name = NULL;
server = cfg_listelt_value(elt);
name = cfg_obj_asstring(
cfg_map_getname(server));
@@ -689,9 +705,11 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
DO("get config key list", cfg_map_get(config, "key", &keys));
for (elt = cfg_list_first(keys); elt != NULL;
elt = cfg_list_next(elt)) {
const char *name = NULL;
key = cfg_listelt_value(elt);
if (strcasecmp(cfg_obj_asstring(cfg_map_getname(key)),
keyname) == 0) {
name = cfg_obj_asstring(cfg_map_getname(key));
if (strcasecmp(name, keyname) == 0) {
break;
}
}
@@ -851,8 +869,6 @@ int
main(int argc, char **argv) {
isc_result_t result = ISC_R_SUCCESS;
bool show_final_mem = false;
isc_taskmgr_t *taskmgr = NULL;
isc_task_t *task = NULL;
isc_log_t *log = NULL;
isc_logconfig_t *logconfig = NULL;
isc_logdestination_t logdest;
@@ -978,19 +994,23 @@ main(int argc, char **argv) {
argc -= isc_commandline_index;
argv += isc_commandline_index;
if (argc < 1) {
if (argv[0] == NULL) {
usage(1);
} else {
command = argv[0];
if (strcmp(command, "restart") == 0) {
fatal("'%s' is not implemented", command);
}
notify("%s", command);
}
serial = isc_random32();
isc_mem_create(&rndc_mctx);
DO("create socket manager",
isc_socketmgr_create(rndc_mctx, &socketmgr));
netmgr = isc_nm_start(rndc_mctx, 1);
DO("create task manager",
isc_taskmgr_create(rndc_mctx, 1, 0, NULL, &taskmgr));
DO("create task", isc_task_create(taskmgr, 0, &task));
DO("create task", isc_task_create(taskmgr, 0, &rndc_task));
isc_log_create(rndc_mctx, &log, &logconfig);
isc_log_setcontext(log);
isc_log_settag(logconfig, progname);
@@ -1008,8 +1028,6 @@ main(int argc, char **argv) {
isccc_result_register();
command = *argv;
isc_buffer_allocate(rndc_mctx, &databuf, 2048);
/*
@@ -1036,32 +1054,30 @@ main(int argc, char **argv) {
*p++ = '\0';
INSIST(p == args + argslen);
notify("%s", command);
if (strcmp(command, "restart") == 0) {
fatal("'%s' is not implemented", command);
}
if (nserveraddrs == 0 && servername != NULL) {
get_addresses(servername, (in_port_t)remoteport);
}
DO("post event", isc_app_onrun(rndc_mctx, task, rndc_start, NULL));
DO("post event", isc_app_onrun(rndc_mctx, rndc_task, rndc_start, NULL));
result = isc_app_run();
if (result != ISC_R_SUCCESS) {
fatal("isc_app_run() failed: %s", isc_result_totext(result));
}
if (atomic_load_acquire(&connects) > 0 ||
atomic_load_acquire(&sends) > 0 || atomic_load_acquire(&recvs) > 0)
{
isc_socket_cancel(sock, task, ISC_SOCKCANCEL_ALL);
}
isc_task_detach(&task);
isc_task_detach(&rndc_task);
isc_taskmgr_destroy(&taskmgr);
isc_socketmgr_destroy(&socketmgr);
isc_nm_destroy(&netmgr);
/*
* Note: when TCP connections are shut down, there will be a final
* call to the isccc callback routine with &rndc_ccmsg as its
* argument. We therefore need to delay invalidating it until
* after the netmgr is destroyed.
*/
isccc_ccmsg_invalidate(&rndc_ccmsg);
isc_log_destroy(&log);
isc_log_setcontext(NULL);
@@ -1069,7 +1085,6 @@ main(int argc, char **argv) {
cfg_parser_destroy(&pctx);
isc_mem_put(rndc_mctx, args, argslen);
isccc_ccmsg_invalidate(&ccmsg);
isc_buffer_free(&databuf);
+15 -3
View File
@@ -161,9 +161,21 @@ Currently supported commands are:
See also ``rndc addzone`` and ``rndc modzone``.
``dnssec`` [**-status** *zone* [*class* [*view*]]
Show the DNSSEC signing state for the specified zone. Requires the
zone to have a "dnssec-policy".
``dnssec`` ( **-status** | **-checkds** [**-key** *id* [**-alg** *algorithm*]] [**-when** *time*] ( *published* | *withdrawn* )) *zone* [*class* [*view*]]
This command allows you to interact with the "dnssec-policy" of a given
zone.
``rndc dnssec -status`` show the DNSSEC signing state for the specified
zone.
``rndc dnssec -checkds`` will let ``named`` know that the DS for the given
key has been seen published into or withdrawn from the parent. This is
required in order to complete a KSK rollover. If the ``-key id`` argument
is specified, look for the key with the given identifier, otherwise if there
is only one key acting as a KSK in the zone, assume the DS of that key (if
there are multiple keys with the same tag, use ``-alg algorithm`` to
select the correct algorithm). The time that the DS has been published or
withdrawn is set to now, unless otherwise specified with the argument ``-when time``.
``dnstap`` ( **-reopen** | **-roll** [*number*] )
This command closes and re-opens DNSTAP output files. ``rndc dnstap -reopen`` allows
+1 -1
View File
@@ -374,7 +374,7 @@ a run of the full test suite (e.g. the tests are started with "runall.sh").
3. Each script should start with the following lines:
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
"conf.sh" defines a series of environment variables together with functions
useful for the test scripts. (conf.sh.win32 is the Windows equivalent of this
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
$SHELL clean.sh
$SHELL ${TOP_SRCDIR}/bin/tests/system/genzone.sh 2 3 >ns2/example.db
+2 -2
View File
@@ -9,10 +9,10 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocomm +nocmd -p ${PORT}"
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
status=0
t=0
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
$SHELL clean.sh
copy_setports ns1/named1.conf.in ns1/named.conf
+2 -2
View File
@@ -9,10 +9,10 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="-p ${PORT}"
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
status=0
n=0
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
cp -f ns1/redirect.db.1 ns1/redirect.db
cp -f ns2/redirect.db.1 ns2/redirect.db
+2 -2
View File
@@ -9,10 +9,10 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="+tcp +nosea +nostat +nocmd +norec +noques +noauth +noadd +nostats +dnssec -p ${PORT}"
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
check_zonestatus() (
$RNDCCMD "10.53.0.$1" zonestatus -redirect > "zonestatus.out.ns$1.$n" &&
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ../common/controls.conf.in ns2/controls.conf
copy_setports ns1/named.conf.in ns1/named.conf
+1 -1
View File
@@ -50,7 +50,7 @@
# and querying as necessary.
#
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="+tcp +nosea +nostat +nocmd +norec +noques +noauth +noadd +nostats +dnssec -p ${PORT}"
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="+tcp -p ${PORT}"
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../../conf.sh
zone=.
zonefile=root.db
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../../conf.sh
# Have the child generate subdomain keys and pass DS sets to us.
( cd ../ns3 && $SHELL keygen.sh )
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../../conf.sh
SYSTESTDIR=autosign
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
+2 -2
View File
@@ -9,13 +9,13 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
n=0
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd +dnssec -p ${PORT}"
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
# convert private-type records to readable form
showprivate () {
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
+2 -2
View File
@@ -7,10 +7,10 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="-p ${PORT}"
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
status=0
n=0
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
n=0
+1 -1
View File
@@ -7,7 +7,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
cp -f ns1/dynamic.db.in ns1/dynamic.db
copy_setports ns1/named.conf.in ns1/named.conf
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="+tcp +nosea +nostat +noquest +nocomm +nocmd -p ${PORT}"
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
$SHELL clean.sh
+2 -2
View File
@@ -12,14 +12,14 @@
set -e
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../conf.sh
dig_with_opts() {
"$DIG" -p "${PORT}" "$@"
}
rndccmd() (
"$RNDC" -c "$SYSTEMTESTTOP/common/rndc.conf" -p "${CONTROLPORT}" -s "$@"
"$RNDC" -c ../common/rndc.conf -p "${CONTROLPORT}" -s "$@"
)
_wait_for_message() (
+1 -1
View File
@@ -11,7 +11,7 @@
set -eu
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
touch empty
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
n=0
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../../conf.sh
zone=example.
zonefile=example.db
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
+2 -2
View File
@@ -7,10 +7,10 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="-p ${PORT}"
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
sendcmd() {
send 10.53.0.4 "${EXTRAPORT1}"
@@ -24,7 +24,6 @@ dnssec-policy "test" {
max-zone-ttl 86400;
parent-ds-ttl 7200;
parent-propagation-delay PT1H;
parent-registration-delay P1D;
publish-safety PT3600S;
retire-safety PT3600S;
signatures-refresh P3D;
-1
View File
@@ -24,7 +24,6 @@ dnssec-policy "test" {
max-zone-ttl 86400;
parent-ds-ttl 7200;
parent-propagation-delay PT1H;
parent-registration-delay P1D;
publish-safety PT3600S;
retire-safety PT3600S;
signatures-refresh P3D;
+1 -1
View File
@@ -7,7 +7,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
n=0
+1 -1
View File
@@ -7,7 +7,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
$SHELL clean.sh
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
n=1
+1 -1
View File
@@ -7,7 +7,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
ln -s $CHECKZONE named-compilezone
+1 -1
View File
@@ -7,7 +7,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
n=1
@@ -17,7 +17,7 @@ set -e
# and differ from dnsrpz.conf which is used by dnsrpzd.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DNSRPS_CMD=../rpz/dnsrps
+2 -3
View File
@@ -13,8 +13,7 @@
# Clean up after system tests.
#
SYSTEMTESTTOP=.
. $SYSTEMTESTTOP/conf.sh
. ./conf.sh
find . -type f \( \
@@ -25,7 +24,7 @@ find . -type f \( \
status=0
rm -f $SYSTEMTESTTOP/random.data
rm -f ../random.data
for d in $SUBDIRS
do
+1 -1
View File
@@ -9,6 +9,6 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. "$SYSTEMTESTTOP/conf.sh"
. ../conf.sh
[ -x "$TOP_BUILDDIR/bin/pkcs11/pkcs11-destroy" ] && $PK11DEL -w0 > /dev/null 2>&1
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
+2 -2
View File
@@ -9,10 +9,10 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="-p ${PORT}"
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
status=0
n=0
+1 -1
View File
@@ -9,6 +9,6 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named1.conf.in ns1/named.conf
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
n=0
+1 -1
View File
@@ -9,6 +9,6 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
$SHELL clean.sh
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="+tcp +nosea +nostat +nocmd +norec +noques +noauth +noadd +nostats +dnssec -p 5300"
status=0
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
+1 -1
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../../conf.sh
set -e
+1 -1
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../conf.sh
set -e
+1 -1
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../conf.sh
set -e
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
if ! $FEATURETEST --with-dlz-filesystem; then
echo_i "DLZ filesystem driver not supported"
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
$SHELL clean.sh
copy_setports ns1/named.conf.in ns1/named.conf
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
n=0
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
$TSIGKEYGEN ddns-key.example.nil > ns1/ddns.key
+2 -2
View File
@@ -9,13 +9,13 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
n=0
DIGOPTS="@10.53.0.1 -p ${PORT} +nocookie"
RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s"
RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
newtest() {
n=`expr $n + 1`
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../../conf.sh
zone=signed
infile=example.db
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0
n=0
+1 -1
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../../conf.sh
set -e
@@ -0,0 +1,165 @@
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
$TTL 300 ; 5 minutes
@ IN SOA mname1. . (
2000042407 ; serial
20 ; refresh (20 seconds)
20 ; retry (20 seconds)
1814400 ; expire (3 weeks)
3600 ; minimum (1 hour)
)
NS ns2
NS ns3
ns2 A 10.53.0.2
ns3 A 10.53.0.3
a A 10.0.0.1
b A 10.0.0.2
d A 10.0.0.4
; Used for testing ANY queries
foo TXT "testing"
foo A 10.0.1.0
bad-cname CNAME a
bad-dname DNAME @
; Used for testing CNAME queries
cname1 CNAME cname1-target
cname1-target TXT "testing cname"
cname2 CNAME cname2-target
cname2-target TXT "testing cname"
; Used for testing DNAME queries
dname1 DNAME dname1-target
foo.dname1-target TXT "testing dname"
dname2 DNAME dname2-target
foo.dname2-target TXT "testing dname"
; A secure subdomain
secure NS ns3.secure
ns3.secure A 10.53.0.3
; An insecure subdomain
insecure NS ns.insecure
ns.insecure A 10.53.0.3
; A secure subdomain we're going to inject bogus data into
bogus NS ns.bogus
ns.bogus A 10.53.0.3
; A subdomain with a corrupt DS
badds NS ns.badds
ns.badds A 10.53.0.3
; A dynamic secure subdomain
dynamic NS dynamic
dynamic A 10.53.0.3
; A insecure subdomain
mustbesecure NS ns.mustbesecure
ns.mustbesecure A 10.53.0.3
; A subdomain with expired signatures
expired NS ns.expired
ns.expired A 10.53.0.3
; A rfc2535 signed zone w/ CNAME
rfc2535 NS ns.rfc2535
ns.rfc2535 A 10.53.0.3
z A 10.0.0.26
keyless NS ns.keyless
ns.keyless A 10.53.0.3
nsec3 NS ns.nsec3
ns.nsec3 A 10.53.0.3
optout NS ns.optout
ns.optout A 10.53.0.3
nsec3-unknown NS ns.nsec3-unknown
ns.nsec3-unknown A 10.53.0.3
optout-unknown NS ns.optout-unknown
ns.optout-unknown A 10.53.0.3
dnskey-unknown NS ns.dnskey-unknown
ns.dnskey-unknown A 10.53.0.3
dnskey-unsupported NS ns.dnskey-unsupported
ns.dnskey-unsupported A 10.53.0.3
dnskey-nsec3-unknown NS ns.dnskey-nsec3-unknown
ns.dnskey-nsec3-unknown A 10.53.0.3
multiple NS ns.multiple
ns.multiple A 10.53.0.3
*.wild A 10.0.0.27
rsasha256 NS ns.rsasha256
ns.rsasha256 A 10.53.0.3
rsasha512 NS ns.rsasha512
ns.rsasha512 A 10.53.0.3
kskonly NS ns.kskonly
ns.kskonly A 10.53.0.3
update-nsec3 NS ns.update-nsec3
ns.update-nsec3 A 10.53.0.3
auto-nsec NS ns.auto-nsec
ns.auto-nsec A 10.53.0.3
auto-nsec3 NS ns.auto-nsec3
ns.auto-nsec3 A 10.53.0.3
below-cname CNAME some.where.else.
insecure.below-cname NS ns.insecure.below-cname
ns.insecure.below-cname A 10.53.0.3
secure.below-cname NS ns.secure.below-cname
ns.secure.below-cname A 10.53.0.3
ttlpatch NS ns.ttlpatch
ns.ttlpatch A 10.53.0.3
split-dnssec NS ns.split-dnssec
ns.split-dnssec A 10.53.0.3
split-smart NS ns.split-smart
ns.split-smart A 10.53.0.3
upper NS ns.upper
ns.upper A 10.53.0.3
LOWER NS NS.LOWER
NS.LOWER A 10.53.0.3
expiring NS ns.expiring
ns.expiring A 10.53.0.3
future NS ns.future
ns.future A 10.53.0.3
managed-future NS ns.managed-future
ns.managed-future A 10.53.0.3
revkey NS ns.revkey
ns.revkey A 10.53.0.3
dname-at-apex-nsec3 NS ns3
@@ -182,4 +182,13 @@ zone "corp" {
file "corp.db";
};
zone "hours-vs-days" {
type master;
file "hours-vs-days.db.signed";
auto-dnssec maintain;
/* validity 500 days, resign in 499 days */
sig-validity-interval 500 499;
allow-update { any; };
};
include "trusted.conf";
+9 -1
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../../conf.sh
set -e
@@ -308,3 +308,11 @@ sed 's/DNSKEY/CDNSKEY/' "$key1.key" > "$key1.cdnskey"
cat "$infile" "$key1.key" "$key2.key" "$key1.cdnskey" "$key1.cds" > "$zonefile"
# Don't sign, let auto-dnssec maintain do it.
mv $zonefile "$zonefile.signed"
zone=hours-vs-days
infile=hours-vs-days.db.in
zonefile=hours-vs-days.db
key1=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KSK "$zone")
key2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
$SETTIME -P sync now "$key1" > /dev/null
cat "$infile" > "$zonefile.signed"
+1 -1
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../../conf.sh
set -e
+1 -1
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../../conf.sh
set -e
+1 -1
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../../conf.sh
set -e
+1 -1
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../../conf.sh
set -e
+1 -1
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../conf.sh
set -e
+14 -3
View File
@@ -10,7 +10,7 @@
# information regarding copyright ownership.
# shellcheck source=conf.sh
. "$SYSTEMTESTTOP/conf.sh"
. ../conf.sh
set -e
@@ -36,7 +36,7 @@ delv_with_opts() {
}
rndccmd() {
"$RNDC" -c "$SYSTEMTESTTOP/common/rndc.conf" -p "$CONTROLPORT" -s "$@"
"$RNDC" -c ../common/rndc.conf -p "$CONTROLPORT" -s "$@"
}
# TODO: Move loadkeys_on to conf.sh.common
@@ -3806,7 +3806,7 @@ ret=0
dig_with_opts . dnskey +ednsopt=KEY-TAG:fffe +ednsopt=KEY-TAG:fffd @10.53.0.1 > dig.out.ns1.test$n || ret=1
grep "trust-anchor-telemetry './IN' from .* 65534" ns1/named.run > /dev/null || ret=1
grep "trust-anchor-telemetry './IN' from .* 65533" ns1/named.run > /dev/null && ret=1
$PERL $SYSTEMTESTTOP/stop.pl dnssec ns1 || ret=1
$PERL ../stop.pl dnssec ns1 || ret=1
nextpart ns1/named.run > /dev/null
start_server --noclean --restart --port ${PORT} dnssec ns1 || ret=1
n=$(($n+1))
@@ -4270,5 +4270,16 @@ n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "checking sig-validity-interval second field hours vs days ($n)"
ret=0
# zone configured with 'sig-validity-interval 500 499;'
# 499 days in the future w/ a 20 minute runtime to now allowance
min=$(TZ=UTC $PERL -e '@lt=localtime(time() + 499*3600*24 - 20*60); printf "%.4d%0.2d%0.2d%0.2d%0.2d%0.2d\n",$lt[5]+1900,$lt[4]+1,$lt[3],$lt[2],$lt[1],$lt[0];')
dig_with_opts @10.53.0.2 hours-vs-days AXFR > dig.out.ns2.test$n
awk -v min=$min '$4 == "RRSIG" { if ($9 < min) { exit(1); } }' dig.out.ns2.test$n || ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="+short -p ${PORT}"
RNDCCMD="$RNDC -p ${CONTROLPORT} -c ../common/rndc.conf"
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
+1 -1
View File
@@ -7,7 +7,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
DIGOPTS="+tcp +noadd +nosea +nostat +noquest -p ${PORT}"
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../../conf.sh
zone=.
infile=root.db.in
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../../conf.sh
zone1=good
infile1=good.db.in
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
+1 -1
View File
@@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. $SYSTEMTESTTOP/conf.sh
. ../conf.sh
status=0

Some files were not shown because too many files have changed in this diff Show More