Compare commits

..
Author SHA1 Message Date
Witold Kręcicki 0d6c4ce64a TEST: use jemalloc 2019-05-16 11:33:07 +02:00
Witold Kręcicki a6b12b31fe TEST: use malloc/free directly, no accounting 2019-05-16 11:28:36 +02:00
Witold Kręcicki 5ac49fcb9d TEST: disable tracklines 2019-05-16 11:11:58 +02:00
798 changed files with 16565 additions and 18681 deletions
-17
View File
@@ -53,7 +53,6 @@
(expand-file-name "/usr/local/opt/openssl@1.1/include")
(expand-file-name "/usr/local/opt/libxml2/include/libxml2")
(expand-file-name "/usr/local/opt/json-c/include/json-c/")
(expand-file-name "/usr/local/include")
)
)
@@ -61,7 +60,6 @@
(eval setq flycheck-clang-include-path include-directories)
(eval setq flycheck-cppcheck-include-path include-directories)
(eval setq flycheck-gcc-include-path include-directories)
(eval setq flycheck-clang-args
(list
"-include"
@@ -69,20 +67,5 @@
(concat directory-of-current-dir-locals-file "config.h"))
)
)
(eval setq flycheck-gcc-args
(list
"-include"
(expand-file-name
(concat directory-of-current-dir-locals-file "config.h"))
)
)
(eval setq flycheck-cppcheck-args
(list
"--enable=all"
"--suppress=missingIncludeSystem"
(concat "-include=" (expand-file-name
(concat directory-of-current-dir-locals-file "config.h")))
)
)
)
))
+32 -240
View File
@@ -8,18 +8,10 @@ variables:
CCACHE_DIR: "/ccache"
SOFTHSM2_CONF: "/var/tmp/softhsm2/softhsm2.conf"
# VirtualBox driver needs to set build_dir to "/builds" in gitlab-runner.toml
KYUA_RESULT: "$CI_PROJECT_DIR/kyua.results"
BUILD_PARALLEL_JOBS: 6
TEST_PARALLEL_JOBS: 6
stages:
- precheck
- build
- unit
- system
- docs
- test
- push
### Runner Tag Templates
@@ -36,12 +28,6 @@ stages:
### Docker Image Templates
# Alpine Linux
.alpine-3.10-amd64: &alpine_3_10_amd64_image
image: "$CI_REGISTRY_IMAGE:alpine-3.10-amd64"
<<: *linux_amd64
# CentOS
.centos-centos6-amd64: &centos_centos6_amd64_image
@@ -58,6 +44,10 @@ stages:
image: "$CI_REGISTRY_IMAGE:debian-jessie-amd64"
<<: *linux_amd64
.debian-jessie-i386: &debian_jessie_i386_image
image: "$CI_REGISTRY_IMAGE:debian-jessie-i386"
<<: *linux_i386
.debian-stretch-amd64: &debian_stretch_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-stretch-amd64"
<<: *linux_amd64
@@ -66,10 +56,6 @@ stages:
image: "$CI_REGISTRY_IMAGE:debian-stretch-i386"
<<: *linux_i386
.debian-buster-amd64: &debian_buster_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-buster-amd64"
<<: *linux_i386
.debian-sid-amd64: &debian_sid_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-sid-amd64"
<<: *linux_amd64
@@ -80,8 +66,8 @@ stages:
# Fedora
.fedora-30-amd64: &fedora_30_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-30-amd64"
.fedora-29-amd64: &fedora_29_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-29-amd64"
<<: *linux_amd64
# Ubuntu
@@ -115,64 +101,26 @@ stages:
<<: *debian_sid_amd64_image
stage: precheck
.autoconf: &autoconf_job
<<: *default_triggering_rules
<<: *debian_sid_amd64_image
stage: precheck
script:
- autoreconf -fi
artifacts:
untracked: true
expire_in: "1 hour"
.configure: &configure |
./configure \
--disable-maintainer-mode \
--enable-developer \
--with-libtool \
--disable-static \
--with-cmocka \
--with-libxml2 \
--with-json-c \
--prefix=$HOME/.local \
--without-make-clean \
$EXTRA_CONFIGURE \
|| cat config.log
.build: &build_job
<<: *default_triggering_rules
stage: build
before_script:
- test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
script:
- *configure
- ./configure --enable-developer --with-libtool --disable-static --with-cmocka --prefix=$HOME/.local --without-make-clean $EXTRA_CONFIGURE || cat config.log
- make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
- test -z "${RUN_MAKE_INSTALL}" || make install
dependencies:
- autoreconf:sid:amd64
needs:
- autoreconf:sid:amd64
artifacts:
untracked: true
expire_in: "1 hour"
.setup_interfaces: &setup_interfaces |
if [ "$(id -u)" -eq "0" ]; then
sh -x bin/tests/system/ifconfig.sh up;
else
sudo sh -x bin/tests/system/ifconfig.sh up;
fi
.setup_softhsm: &setup_softhsm |
sh -x util/prepare-softhsm2.sh
.system_test: &system_test_job
<<: *default_triggering_rules
stage: system
stage: test
retry: 2
before_script:
- *setup_interfaces
- *setup_softhsm
- bash -x bin/tests/system/ifconfig.sh up
- bash -x util/prepare-softhsm2.sh
script:
- ( cd bin/tests && make -j${TEST_PARALLEL_JOBS:-1} -k test V=1 )
- test -s bin/tests/system/systests.output
@@ -181,22 +129,16 @@ stages:
expire_in: "1 week"
when: on_failure
.kyua_report: &kyua_report_html |
kyua report-html \
--force \
--results-file "$KYUA_RESULT" \
--results-filter "" \
--output kyua_html
.unit_test: &unit_test_job
<<: *default_triggering_rules
stage: unit
stage: test
before_script:
- *setup_softhsm
- export KYUA_RESULT="$CI_PROJECT_DIR/kyua.results"
- bash -x util/prepare-softhsm2.sh
script:
- make unit
after_script:
- *kyua_report_html
- kyua report-html --force --results-file kyua.results --results-filter "" --output kyua_html
artifacts:
paths:
- kyua.log
@@ -209,9 +151,6 @@ stages:
# Jobs in the precheck stage
autoreconf:sid:amd64:
<<: *autoconf_job
misc:sid:amd64:
<<: *precheck_job
script:
@@ -238,23 +177,17 @@ misc:sid:amd64:
🐞:sid:amd64:
<<: *precheck_job
script:
- util/check-cocci
- if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
script: util/check-cocci
# Jobs for doc builds on Debian Sid (amd64)
docs:sid:amd64:
<<: *debian_sid_amd64_image
stage: docs
stage: build
script:
- ./configure || cat config.log
- make -C doc/misc docbook
- make -C doc/arm Bv9ARM.html
dependencies:
- autoreconf:sid:amd64
needs:
- autoreconf:sid:amd64
artifacts:
paths:
- doc/arm/
@@ -276,30 +209,6 @@ push:docs:sid:amd64:
- master@isc-projects/bind9
- /^v9_[1-9][0-9]$/@isc-projects/bind9
# Jobs for regular GCC builds on Alpine Linux 3.10 (amd64)
gcc:alpine3.10:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--enable-dnstap"
<<: *alpine_3_10_amd64_image
<<: *build_job
system:gcc:alpine3.10:amd64:
<<: *alpine_3_10_amd64_image
<<: *system_test_job
dependencies:
- gcc:alpine3.10:amd64
needs: ["gcc:alpine3.10:amd64"]
unit:gcc:alpine3.10:amd64:
<<: *alpine_3_10_amd64_image
<<: *unit_test_job
dependencies:
- gcc:alpine3.10:amd64
needs: ["gcc:alpine3.10:amd64"]
# Jobs for regular GCC builds on CentOS 6 (amd64)
gcc:centos6:amd64:
@@ -315,14 +224,12 @@ system:gcc:centos6:amd64:
<<: *system_test_job
dependencies:
- gcc:centos6:amd64
needs: ["gcc:centos6:amd64"]
unit:gcc:centos6:amd64:
<<: *centos_centos6_amd64_image
<<: *unit_test_job
dependencies:
- gcc:centos6:amd64
needs: ["gcc:centos6:amd64"]
# Jobs for regular GCC builds on CentOS 7 (amd64)
@@ -330,7 +237,7 @@ gcc:centos7:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *centos_centos7_amd64_image
<<: *build_job
@@ -339,14 +246,12 @@ system:gcc:centos7:amd64:
<<: *system_test_job
dependencies:
- gcc:centos7:amd64
needs: ["gcc:centos7:amd64"]
unit:gcc:centos7:amd64:
<<: *centos_centos7_amd64_image
<<: *unit_test_job
dependencies:
- gcc:centos7:amd64
needs: ["gcc:centos7:amd64"]
# Jobs for regular GCC builds on Debian 8 Jessie (amd64)
@@ -354,7 +259,7 @@ gcc:jessie:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--without-cmocka --with-python --disable-geoip"
EXTRA_CONFIGURE: "--without-cmocka --with-python"
<<: *debian_jessie_amd64_image
<<: *build_job
@@ -363,14 +268,12 @@ system:gcc:jessie:amd64:
<<: *system_test_job
dependencies:
- gcc:jessie:amd64
needs: ["gcc:jessie:amd64"]
unit:gcc:jessie:amd64:
<<: *debian_jessie_amd64_image
<<: *unit_test_job
dependencies:
- gcc:jessie:amd64
needs: ["gcc:jessie:amd64"]
# Jobs for regular GCC builds on Debian 9 Stretch (amd64)
@@ -386,45 +289,20 @@ system:gcc:stretch:amd64:
<<: *system_test_job
dependencies:
- gcc:stretch:amd64
needs: ["gcc:stretch:amd64"]
unit:gcc:stretch:amd64:
<<: *debian_stretch_amd64_image
<<: *unit_test_job
dependencies:
- gcc:stretch:amd64
needs: ["gcc:stretch:amd64"]
# Jobs for regular GCC builds on Debian 10 Buster (amd64)
gcc:buster:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
<<: *debian_buster_amd64_image
<<: *build_job
system:gcc:buster:amd64:
<<: *debian_buster_amd64_image
<<: *system_test_job
dependencies:
- gcc:buster:amd64
needs: ["gcc:buster:amd64"]
unit:gcc:buster:amd64:
<<: *debian_buster_amd64_image
<<: *unit_test_job
dependencies:
- gcc:buster:amd64
needs: ["gcc:buster:amd64"]
# Jobs for regular GCC builds on Debian Sid (amd64)
gcc:sid:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O3 -g"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--with-libidn2"
RUN_MAKE_INSTALL: 1
<<: *debian_sid_amd64_image
<<: *build_job
@@ -434,22 +312,20 @@ system:gcc:sid:amd64:
<<: *system_test_job
dependencies:
- gcc:sid:amd64
needs: ["gcc:sid:amd64"]
unit:gcc:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- gcc:sid:amd64
needs: ["gcc:sid:amd64"]
# Jobs for regular GCC builds on Debian Sid (i386)
gcc:sid:i386:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O3 -g"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --without-python"
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--with-libidn2 --without-python"
<<: *debian_sid_i386_image
<<: *build_job
@@ -458,38 +334,34 @@ system:gcc:sid:i386:
<<: *system_test_job
dependencies:
- gcc:sid:i386
needs: ["gcc:sid:i386"]
unit:gcc:sid:i386:
<<: *debian_sid_i386_image
<<: *unit_test_job
dependencies:
- gcc:sid:i386
needs: ["gcc:sid:i386"]
# Jobs for regular GCC builds on Fedora 30 (amd64)
# Jobs for regular GCC builds on Fedora 29 (amd64)
gcc:fedora30:amd64:
gcc:fedora29:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *fedora_30_amd64_image
<<: *fedora_29_amd64_image
<<: *build_job
system:gcc:fedora30:amd64:
<<: *fedora_30_amd64_image
system:gcc:fedora29:amd64:
<<: *fedora_29_amd64_image
<<: *system_test_job
dependencies:
- gcc:fedora30:amd64
needs: ["gcc:fedora30:amd64"]
- gcc:fedora29:amd64
unit:gcc:fedora30:amd64:
<<: *fedora_30_amd64_image
unit:gcc:fedora29:amd64:
<<: *fedora_29_amd64_image
<<: *unit_test_job
dependencies:
- gcc:fedora30:amd64
needs: ["gcc:fedora30:amd64"]
- gcc:fedora29:amd64
# Jobs for regular GCC builds on Ubuntu 16.04 Xenial Xerus (amd64)
@@ -497,7 +369,6 @@ gcc:xenial:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--disable-geoip"
<<: *ubuntu_xenial_amd64_image
<<: *build_job
@@ -506,14 +377,12 @@ system:gcc:xenial:amd64:
<<: *system_test_job
dependencies:
- gcc:xenial:amd64
needs: ["gcc:xenial:amd64"]
unit:gcc:xenial:amd64:
<<: *ubuntu_xenial_amd64_image
<<: *unit_test_job
dependencies:
- gcc:xenial:amd64
needs: ["gcc:xenial:amd64"]
# Jobs for regular GCC builds on Ubuntu 18.04 Bionic Beaver (amd64)
@@ -530,14 +399,12 @@ system:gcc:bionic:amd64:
<<: *system_test_job
dependencies:
- gcc:bionic:amd64
needs: ["gcc:bionic:amd64"]
unit:gcc:bionic:amd64:
<<: *ubuntu_bionic_amd64_image
<<: *unit_test_job
dependencies:
- gcc:bionic:amd64
needs: ["gcc:bionic:amd64"]
# Jobs for GCC builds with ASAN enabled on Debian Sid (amd64)
@@ -555,60 +422,12 @@ system:asan:sid:amd64:
<<: *system_test_job
dependencies:
- asan:sid:amd64
needs: ["asan:sid:amd64"]
unit:asan:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- asan:sid:amd64
needs: ["asan:sid:amd64"]
rwlock:sid:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g -DISC_MEM_USE_INTERNAL_MALLOC=0"
EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock"
<<: *debian_sid_amd64_image
<<: *build_job
system:rwlock:sid:amd64:
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
- rwlock:sid:amd64
needs: ["rwlock:sid:amd64"]
unit:rwlock:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- rwlock:sid:amd64
needs: ["rwlock:sid:amd64"]
# Jobs for mutex-based atomics on Debian SID (amd64)
mutexatomics:sid:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g -DISC_MEM_USE_INTERNAL_MALLOC=0"
EXTRA_CONFIGURE: "--with-libidn2 --enable-mutex-atomics"
<<: *debian_sid_amd64_image
<<: *build_job
#system:mutexatomics:sid:amd64:
# <<: *debian_sid_amd64_image
# <<: *system_test_job
# dependencies:
# - mutexatomics:sid:amd64
# - mutexatomics:sid:amd64
# allow_failure: true
#unit:mutexatomics:sid:amd64:
# <<: *debian_sid_amd64_image
# <<: *unit_test_job
# dependencies:
# - mutexatomics:sid:amd64
# allow_failure: true
# Jobs for Clang builds on Debian Stretch (amd64)
@@ -625,7 +444,6 @@ unit:clang:stretch:amd64:
<<: *unit_test_job
dependencies:
- clang:stretch:amd64
needs: ["clang:stretch:amd64"]
# Jobs for Clang builds on Debian Stretch (i386)
@@ -652,35 +470,9 @@ system:pkcs11:sid:amd64:
<<: *system_test_job
dependencies:
- pkcs11:sid:amd64
needs: ["pkcs11:sid:amd64"]
unit:pkcs11:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- pkcs11:sid:amd64
needs: ["pkcs11:sid:amd64"]
# Jobs with libtool disabled
nolibtool:sid:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -Og -g"
EXTRA_CONFIGURE: "--with-libidn2 --without-libtool --with-dlopen"
<<: *debian_sid_amd64_image
<<: *build_job
system:nolibtool:sid:amd64:
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
- nolibtool:sid:amd64
needs: ["nolibtool:sid:amd64"]
unit:nolibtool:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- nolibtool:sid:amd64
needs: ["nolibtool:sid:amd64"]
+1 -4
View File
@@ -39,9 +39,6 @@
- [ ] Update tickets in case of waiting support customers.
## Marketing
- [ ] Update BIND Product page if needed
- [ ] Update BIND Significant Features Matrix in KB if needed
- [ ] Update BIND -S Edition data sheet if S Edition feature change
- [ ] Announce on social media
- [ ] Post short note to Twitter.
- [ ] Update [Wikipedia entry for BIND](http://en.wikipedia.org/wiki/BIND).
- [ ] Write blog article (if a major release).
-185
View File
@@ -1,188 +1,3 @@
5280. [protocol] Add support for displaying EDNS option LLQ. [GL #1201]
5279. [bug] When loading, reject zones containing CDS or CDNSKEY
RRsets at the zone apex if they would cause DNSSEC
validation failures if published in the parent zone
as the DS RRset. [GL #1187]
5278. [func] Add YAML output formats for dig, mdig and delv;
use the "+yaml" option to enable. [GL #1145]
--- 9.15.3 released ---
5277. [bug] Cache DB statistics could underflow when serve-stale
was in use, because of a bug in counter maintenance
when RRsets become stale.
Functions for dumping statistics have been updated
to dump active, stale, and ancient statistic
counters. Ancient RRset counters are prefixed
with '~'; stale RRset counters are still prefixed
with '#'. [GL #602]
5276. [func] DNSSEC Lookaside Validation (DLV) is now obsolete;
all code enabling its use has been removed from the
validator, "delv", and the DNSSEC tools. [GL #7]
5275. [bug] Mark DS records included in referral messages
with trust level "pending" so that they can be
validated and cached immediately, with no need to
re-query. [GL #964]
5274. [bug] Address potential use after free race when shutting
down rpz. [GL #1175]
5273. [bug] Check that bits [64..71] of a dns64 prefix are zero.
[GL #1159]
5272. [cleanup] Remove isc-config.sh script as the BIND 9 libraries
are now purely internal. [GL #1123]
5271. [func] The normal (non-debugging) output of dnssec-signzone
and dnssec-verify tools now goes to stdout, instead of
the combination of stderr and stdout.
5270. [bug] 'dig +expandaaaa +short' did not work. [GL #1152]
5269. [port] cygwin: can return ETIMEDOUT on connect() with a
non-blocking socket. [GL #1133]
5268. [placeholder]
5267. [func] Allow statistics groups display to be toggleable.
[GL #1030]
5266. [bug] named-checkconf failed to report dnstap-output
missing from named.conf when dnstap was specified.
[GL #1136]
5265. [bug] DNS64 and RPZ nodata (CNAME *.) rules interacted badly
[GL #1106]
5264. [func] New DNS Cookie algorithm - siphash24 - has been added
to BIND 9, and the old HMAC-SHA DNS Cookie algorithms
have been removed. [GL #605]
--- 9.15.2 released ---
5263. [cleanup] Use atomics and isc_refcount_t wherever possible.
[GL #1038]
5262. [func] Removed support for the legacy GeoIP API. [GL #1112]
5261. [cleanup] Remove SO_BSDCOMPAT socket option usage.
5260. [bug] dnstap-read was producing malformed output for large
packets. [GL #1093]
5259. [func] New option '-i' for 'named-checkconf' to ignore
warnings about deprecated options. [GL #1101]
5258. [func] Added support for the GeoIP2 API from MaxMind. This
will be compiled in by default if the "libmaxminddb"
library is found at compile time, but can be
suppressed using "configure --disable-geoip".
Certain geoip ACL settings that were available with
legacy GeoIP are not available when using GeoIP2.
[GL #182]
5257. [bug] Some statistics data was not being displayed.
Add shading to the zone tables. [GL #1030]
5256. [bug] Ensure that glue records are included in root
priming responses if "minimal-responses" is not
set to "yes". [GL #1092]
5255. [bug] Errors encountered while reloading inline-signing
zones could be ignored, causing the zone content to
be left in an incompletely updated state rather than
reverted. [GL #1109]
5254. [func] Collect metrics to report to the statistics-channel
DNSSEC signing operations (dnssec-sign) and refresh
operations (dnssec-refresh) per zone and per keytag.
[GL #513]
5253. [port] Support platforms that don't define ULLONG_MAX.
[GL #1098]
5252. [func] Report if the last 'rndc reload/reconfig' failed in
rndc status. [GL !2040]
5251. [bug] Statistics were broken in x86 Windows builds.
[GL #1081]
5250. [func] The default size for RSA keys is now 2048 bits,
for both ZSKs and KSKs. [GL #1097]
5249. [bug] Fix a possible underflow in recursion clients
statistics when hitting recursive clients
soft quota. [GL #1067]
--- 9.15.1 released ---
5248. [func] To clarify the configuration of DNSSEC keys,
the "managed-keys" and "trusted-keys" options
have both been deprecated. The new "dnssec-keys"
statement can now be used for all trust anchors,
with the keywords "iniital-key" or "static-key"
to indicate whether the configured trust anchor
should be used for initialization of RFC 5011 key
management, or as a permanent trust anchor.
The "static-key" keyword will generate a warning if
used for the root zone.
Configurations using "trusted-keys" or "managed-keys"
will continue to work with no changes, but will
generate warnings in the log. In a future release,
these options will be marked obsolete. [GL #6]
5247. [cleanup] The 'cleaning-interval' option has been removed.
[GL !1731]
5246. [func] Log TSIG if appropriate in 'sending notify to' message.
[GL #1058]
5245. [cleanup] Reduce logging level for IXFR up-to-date poll
responses. [GL #1009]
5244. [security] Fixed a race condition in dns_dispatch_getnext()
that could cause an assertion failure if a
significant number of incoming packets were
rejected. (CVE-2019-6471) [GL #942]
5243. [bug] Fix a possible race between dispatcher and socket
code in a high-load cold-cache resolver scenario.
[GL #943]
5242. [bug] In relaxed qname minimizatiom mode, fall back to
normal resolution when encountering a lame
delegation, and use _.domain/A queries rather
than domain/NS. [GL #1055]
5241. [bug] Fix Ed448 private and public key ASN.1 prefix blobs.
[GL #225]
5240. [bug] Remove key id calculation for RSAMD5. [GL #996]
5239. [func] Change the json-c detection to pkg-config. [GL #855]
5238. [bug] Fix a possible deadlock in TCP code. [GL #1046]
5237. [bug] Recurse to find the root server list with 'dig +trace'.
[GL #1028]
5236. [func] Add SipHash 2-4 implementation in lib/isc/siphash.c
and switch isc_hash_function() to use SipHash 2-4.
[GL #605]
5235. [cleanup] Refactor lib/isc/app.c to be thread-safe, unused
parts of the API has been removed and the
isc_appctx_t data type has been changed to be
fully opaque. [GL #1023]
5234. [port] arm: just use the compiler's default support for
yield. [GL #981]
-79
View File
@@ -1,79 +0,0 @@
CODE OF CONDUCT
BIND 9 Code of Conduct
Like the technical community as a whole, the BIND 9 team and community is
made up of a mixture of professionals and volunteers from all over the
world, working on every aspect of the mission - including mentorship,
teaching, and connecting people.
Diversity is one of our huge strengths, but it can also lead to
communication issues and unhappiness. To that end, we have a few ground
rules that we ask people to adhere to. This code applies equally to the
core development team, open source contributors and those seeking help and
guidance.
This isn't an exhaustive list of things that you can't do. Rather, take it
in the spirit in which it's intended - a guide to make it easier to enrich
all of us and the technical communities in which we participate.
This code of conduct applies to all spaces managed by the BIND 9 project
or Internet Systems Consortium. This includes chat, the mailing lists, the
issue tracker, and any other fora created by the project team which the
community uses for communication. In addition, violations of this code
outside these spaces may affect a person's ability to participate within
them.
If you believe someone is violating the code of conduct, we ask that you
report it by emailing conduct@isc.org. For more details please see our
Reporting Guidelines.
* Be friendly and patient.
* Be welcoming. We strive to be a community that welcomes and supports
people of all backgrounds and identities. This includes, but is not
limited to members of any race, ethnicity, culture, national origin,
colour, immigration status, social and economic class, educational
level, sex, sexual orientation, gender identity and expression, age,
size, family status, political belief, religion, and mental and
physical ability.
* Be considerate. Your work will be used by other people, and you in
turn will depend on the work of others. Any decision you take will
affect users and colleagues, and you should take those consequences
into account when making decisions. Remember that we're a world-wide
community, so you might not be communicating in someone else's primary
language.
* Be respectful. Not all of us will agree all the time, but disagreement
is no excuse for poor behavior and poor manners. We might all
experience some frustration now and then, but we cannot allow that
frustration to turn into a personal attack. It's important to remember
that a community where people feel uncomfortable or threatened is not
a productive one. Members of the BIND 9 community should be respectful
when dealing with other members as well as with people outside the
BIND 9 community.
* Be careful in the words that you choose. We are a community of
professionals, and we conduct ourselves professionally. Be kind to
others. Do not insult or put down other participants. Harassment and
other exclusionary behavior aren't acceptable. This includes, but is
not limited to:
+ Violent threats or language directed against another person.
+ Discriminatory jokes and language.
+ Posting sexually explicit or violent material.
+ Posting (or threatening to post) other people's personally
identifying information ("doxing").
+ Personal insults, especially those using racist or sexist terms.
+ Unwelcome sexual attention.
+ Advocating for, or encouraging, any of the above behavior.
+ Repeated harassment of others. In general, if someone asks you to
stop, then stop.
* When we disagree, try to understand why. Disagreements, both social
and technical, happen all the time and BIND 9 is no exception. It is
important that we resolve disagreements and differing views
constructively. Remember that we're different. The strength of BIND 9
comes from its varied community, people from a wide range of
backgrounds. Different people have different perspectives on issues.
Being unable to understand why someone holds a viewpoint doesn't mean
that they're wrong. Don't forget that it is human to err and blaming
each other doesn't get us anywhere. Instead, focus on helping to
resolve issues and learning from mistakes.
Original text courtesy of the Django Code of Conduct project.
-71
View File
@@ -1,71 +0,0 @@
# BIND 9 Code of Conduct
Like the technical community as a whole, the BIND 9 team and community is made
up of a mixture of professionals and volunteers from all over the world, working
on every aspect of the mission - including mentorship, teaching, and connecting
people.
Diversity is one of our huge strengths, but it can also lead to communication
issues and unhappiness. To that end, we have a few ground rules that we ask
people to adhere to. This code applies equally to the core development team, open source contributors and those
seeking help and guidance.
This isn't an exhaustive list of things that you can't do. Rather, take it in
the spirit in which it's intended - a guide to make it easier to enrich all of
us and the technical communities in which we participate.
This code of conduct applies to all spaces managed by the BIND 9 project or
Internet Systems Consortium. This includes chat, the mailing lists, the issue
tracker, and any other fora created by the project team which the
community uses for communication. In addition, violations of this code outside
these spaces may affect a person's ability to participate within them.
If you believe someone is violating the code of conduct, we ask that you report
it by emailing [conduct@isc.org](conduct@isc.org). For more details please see
our [Reporting Guidelines](https://www.isc.org/conductreporting/).
* **Be friendly and patient.**
* **Be welcoming.** We strive to be a community that welcomes and supports
people of all backgrounds and identities. This includes, but is not limited to
members of any race, ethnicity, culture, national origin, colour, immigration
status, social and economic class, educational level, sex, sexual orientation,
gender identity and expression, age, size, family status, political belief,
religion, and mental and physical ability.
* **Be considerate.** Your work will be used by other people, and you in turn
will depend on the work of others. Any decision you take will affect users and
colleagues, and you should take those consequences into account when making
decisions. Remember that we're a world-wide community, so you might not be
communicating in someone else's primary language.
* **Be respectful.** Not all of us will agree all the time, but disagreement is
no excuse for poor behavior and poor manners. We might all experience some
frustration now and then, but we cannot allow that frustration to turn into a
personal attack. It's important to remember that a community where people feel
uncomfortable or threatened is not a productive one. Members of the BIND 9
community should be respectful when dealing with other members as well as with
people outside the BIND 9 community.
* **Be careful in the words that you choose.** We are a community of
professionals, and we conduct ourselves professionally. Be kind to others. Do
not insult or put down other participants. Harassment and other exclusionary
behavior aren't acceptable. This includes, but is not limited to:
* Violent threats or language directed against another person.
* Discriminatory jokes and language.
* Posting sexually explicit or violent material.
* Posting (or threatening to post) other people's personally identifying
information ("doxing").
* Personal insults, especially those using racist or sexist terms.
* Unwelcome sexual attention.
* Advocating for, or encouraging, any of the above behavior.
* Repeated harassment of others. In general, if someone asks you to stop, then
stop.
* **When we disagree, try to understand why.** Disagreements, both social and
technical, happen all the time and BIND 9 is no exception. It is important
that we resolve disagreements and differing views constructively. Remember
that we're different. The strength of BIND 9 comes from its varied community,
people from a wide range of backgrounds. Different people have different
perspectives on issues. Being unable to understand why someone holds a
viewpoint doesn't mean that they're wrong. Don't forget that it is human to
err and blaming each other doesn't get us anywhere. Instead, focus on helping
to resolve issues and learning from mistakes.
Original text courtesy of the [Django Code of Conduct](https://www.djangoproject.com/conduct/)
project.
-10
View File
@@ -1,5 +1,3 @@
CONTRIBUTING
BIND Source Access and Contributor Guidelines
Feb 22, 2018
@@ -34,14 +32,6 @@ access to the source repository was restricted just as commit access was.
That's now changing, with the opening of a public git mirror to the BIND
source tree (see below).
At Internet Systems Consortium, we're committed to building communities
that are welcoming and inclusive; environments where people are encouraged
to share ideas, treat each other with respect, and collaborate towards the
best solutions. To reinforce our commitment, the Internet Systems
Consortium has adopted the Contributor Covenant version 1.4 as our Code of
Conduct for BIND 9 project, as well as for the conduct of our developers
throughout the industry.
Access to source code
Public BIND releases are always available from the ISC FTP site.
+1 -9
View File
@@ -41,14 +41,6 @@ a release: read access to the source repository was restricted just
as commit access was. That's now changing, with the opening of a
public git mirror to the BIND source tree (see below).
At [Internet Systems Consortium](https://www.isc.org), we're committed to
building communities that are welcoming and inclusive; environments where people
are encouraged to share ideas, treat each other with respect, and collaborate
towards the best solutions. To reinforce our commitment, the [Internet Systems
Consortium](https://www.isc.org) has adopted the Contributor Covenant version
1.4 as our Code of Conduct for BIND 9 project, as well as for the conduct of our
developers throughout the industry.
### <a name="access"></a>Access to source code
Public BIND releases are always available from the
@@ -116,7 +108,7 @@ ISC's Security Vulnerability Disclosure Policy is documented at [https://kb.isc.
If you have a crash, you may want to consult
[What to do if your BIND or DHCP server has crashed.](https://kb.isc.org/article/AA-00340/89/What-to-do-if-your-BIND-or-DHCP-server-has-crashed.html)
### <a name="contrib"></a>Contributing code
### <a name="bugs"></a>Contributing code
BIND is licensed under the
[Mozilla Public License 2.0](http://www.isc.org/downloads/software-support-policy/isc-license/).
+4 -6
View File
@@ -1,5 +1,3 @@
HISTORY
Functional enhancements from prior major releases of BIND 9
BIND 9.14
@@ -507,11 +505,11 @@ BIND 9.4.0
* Detect duplicates of UDP queries we are recursing on and drop them.
New stats category "duplicates".
* "USE INTERNAL MALLOC" is now runtime selectable.
* The lame cache is now done on a <qname,qclass,qtype> basis as some
servers only appear to be lame for certain query types.
* The lame cache is now done on a basis as some servers only appear to
be lame for certain query types.
* Limit the number of recursive clients that can be waiting for a single
query (<qname,qtype,qclass>) to resolve. New options clients-per-query
and max-clients-per-query.
query () to resolve. New options clients-per-query and
max-clients-per-query.
* dig: report the number of extra bytes still left in the packet after
processing all the records.
* Support for IPSECKEY rdata type.
+26 -13
View File
@@ -18,7 +18,11 @@ SUBDIRS = make lib fuzz bin doc
TARGETS =
PREREQS = bind.keys.h
MANOBJS = README HISTORY OPTIONS CONTRIBUTING PLATFORMS CODE_OF_CONDUCT \
MANPAGES = isc-config.sh.1
HTMLPAGES = isc-config.sh.html
MANOBJS = README HISTORY OPTIONS CONTRIBUTING PLATFORMS \
${MANPAGES} ${HTMLPAGES}
@BIND9_MAKE_RULES@
@@ -31,7 +35,7 @@ bind.keys.h: ${top_srcdir}/bind.keys ${srcdir}/util/bindkeys.pl
distclean::
rm -f config.cache config.h config.log config.status TAGS
rm -f libtool configure.lineno
rm -f libtool isc-config.sh configure.lineno
rm -f util/conf.sh docutil/docbook2man-wrapper.sh
# XXX we should clean libtool stuff too. Only do this after we add rules
@@ -50,11 +54,25 @@ installdirs:
${DESTDIR}${localstatedir}/run ${DESTDIR}${sysconfdir}
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
install:: installdirs
install:: isc-config.sh installdirs
${INSTALL_SCRIPT} isc-config.sh ${DESTDIR}${bindir}
rm -f ${DESTDIR}${bindir}/bind9-config
@LN@ ${DESTDIR}${bindir}/isc-config.sh ${DESTDIR}${bindir}/bind9-config
${INSTALL_DATA} ${top_srcdir}/isc-config.sh.1 ${DESTDIR}${mandir}/man1
rm -f ${DESTDIR}${mandir}/man1/bind9-config.1
@LN@ ${DESTDIR}${mandir}/man1/isc-config.sh.1 ${DESTDIR}${mandir}/man1/bind9-config.1
${INSTALL_DATA} ${top_srcdir}/bind.keys ${DESTDIR}${sysconfdir}
uninstall::
rm -f ${DESTDIR}${sysconfdir}/bind.keys
rm -f ${DESTDIR}${mandir}/man1/bind9-config.1
rm -f ${DESTDIR}${mandir}/man1/isc-config.sh.1
rm -f ${DESTDIR}${bindir}/bind9-config
rm -f ${DESTDIR}${bindir}/isc-config.sh
tags:
rm -f TAGS
find lib bin -name "*.[ch]" -print | @ETAGS@ -
test check:
@if test -n "`${PERL} ${top_srcdir}/bin/tests/system/testsock.pl 2>/dev/null || echo fail`"; then \
@@ -79,32 +97,27 @@ test-force:
exit $$status
README: README.md
${PANDOC} --email-obfuscation=none -s --metadata title="README" -f markdown-smart -t html README.md | \
${PANDOC} --email-obfuscation=none -s -t html README.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
HISTORY: HISTORY.md
${PANDOC} --email-obfuscation=none -s --metadata title="HISTORY" -f markdown-smart -t html HISTORY.md | \
${PANDOC} --email-obfuscation=none -s -t html HISTORY.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
OPTIONS: OPTIONS.md
${PANDOC} --email-obfuscation=none -s --metadata title="OPTIONS" -f markdown-smart -t html OPTIONS.md | \
${PANDOC} --email-obfuscation=none -s -t html OPTIONS.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
CONTRIBUTING: CONTRIBUTING.md
${PANDOC} --email-obfuscation=none -s --metadata title="CONTRIBUTING" -f markdown-smart -t html CONTRIBUTING.md | \
${PANDOC} --email-obfuscation=none -s -t html CONTRIBUTING.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
PLATFORMS: PLATFORMS.md
${PANDOC} --email-obfuscation=none -s --metadata title="PLATFORMS" -f markdown-smart -t html PLATFORMS.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
CODE_OF_CONDUCT: CODE_OF_CONDUCT.md
${PANDOC} --email-obfuscation=none -s --metadata title="CODE OF CONDUCT" -f markdown-smart -t html $< | \
${PANDOC} --email-obfuscation=none -s -t html PLATFORMS.md | \
${W3M} -dump -cols 75 -O ascii -T text/html | \
sed -e '$${/^$$/d;}' > $@
+1 -3
View File
@@ -1,12 +1,10 @@
OPTIONS
Setting the STD_CDEFINES environment variable before running configure can
be used to enable certain compile-time options that are not explicitly
defined in configure.
Some of these settings are:
Setting Description
Setting Description
Overwrite memory with tag values when allocating
-DISC_MEM_DEFAULTFILL=1 or freeing it; this impairs performance but
makes debugging of memory problems easier.
+25 -2
View File
@@ -1,5 +1,3 @@
PLATFORMS
Supported platforms
In general, this version of BIND will build and run on any POSIX-compliant
@@ -66,6 +64,31 @@ These are platforms on which BIND 9.15 is known not to build or run:
Platform quirks
ARM
If the compilation ends with following error:
Error: selected processor does not support `yield' in ARM mode
You will need to set -march compiler option to native, so the compiler
recognizes yield assembler instruction. The proper way to set -march=
native would be to put it into CFLAGS, e.g. run ./configure like this:
CFLAGS="-march=native -Os -g" ./configure plus your usual options.
If that doesn't work, you can enforce the minimum CPU and FPU (taken from
Debian armhf documentation):
* The lowest worthwhile CPU implementation is Armv7-A, therefore the
recommended build option is -march=armv7-a.
* FPU should be set at VFPv3-D16 as they represent the minimum
specification of the processors to support here, therefore the
recommended build option is -mfpu=vfpv3-d16.
The configure command should look like this:
CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -Os -g" ./configure
NetBSD 6 i386
The i386 build of NetBSD requires the libatomic library, available from
+28 -54
View File
@@ -1,5 +1,3 @@
README
BIND 9
Contents
@@ -39,7 +37,7 @@ in versions 4 and 8. Internet Systems Consortium (https://www.isc.org), a
501(c)(3) public benefit corporation dedicated to providing software and
services in support of the Internet infrastructure, developed BIND 9 and
is responsible for its ongoing maintenance and improvement. BIND is open
source software licensed under the terms of the Mozilla Public License,
source software licenced under the terms of the Mozilla Public License,
version 2.0.
For a summary of features introduced in past major releases of BIND, see
@@ -87,9 +85,8 @@ ISC maintains a public git repository for BIND; details can be found at
http://www.isc.org/git/.
Information for BIND contributors can be found in the following files: -
General information: CONTRIBUTING.md - Code of Conduct: CODE_OF_CONDUCT.md
- BIND 9 code style: doc/dev/style.md - BIND architecture and developer
guide: doc/dev/dev.md
General information: CONTRIBUTING.md - BIND 9 code style: doc/dev/style.md
- BIND architecture and developer guide: doc/dev/dev.md
Patches for BIND may be submitted as Merge Requests in the ISC GitLab
server at at https://gitlab.isc.org/isc-projects/bind9/merge_requests.
@@ -106,10 +103,7 @@ format-patch.
BIND 9.15 features
BIND 9.15 is the newest development branch of BIND 9. It includes a number
of changes from BIND 9.14 and earlier releases. New features include:
* Support for the new GeoIP2 geolocation API
* Improved DNSSEC key configuration using dnssec-keys
of changes from BIND 9.14 and earlier releases.
Building BIND
@@ -140,7 +134,7 @@ make depend. If you're using Emacs, you might find make tags helpful.
Several environment variables that can be set before running configure
will affect compilation:
Variable Description
Variable Description
CC The C compiler to use. configure tries to figure out the
right one for supported systems.
C compiler flags. Defaults to include -g and/or -O2 as
@@ -193,10 +187,8 @@ operations, specify the path to the PKCS#11 provider library using
To support the HTTP statistics channel, the server must be linked with at
least one of the following: libxml2 http://xmlsoft.org or json-c https://
github.com/json-c. If these are installed at a nonstandard location, then:
* for libxml2, specify the prefix using --with-libxml2=/prefix,
* for json-c, adjust PKG_CONFIG_PATH.
github.com/json-c. If these are installed at a nonstandard location,
specify the prefix using --with-libxml2=/prefix or --with-libjson=/prefix.
To support compression on the HTTP statistics channel, the server must be
linked against libzlib. If this is installed in a nonstandard location,
@@ -206,11 +198,10 @@ To support storing configuration data for runtime-added zones in an LMDB
database, the server must be linked with liblmdb. If this is installed in
a nonstandard location, specify the prefix using with-lmdb=/prefix.
To support MaxMind GeoIP2 location-based ACLs, the server must be linked
with libmaxminddb. This is turned on by default if the library is found;
if the library is installed in a nonstandard location, specify the prefix
using --with-maxminddb=/prefix. GeoIP2 support can be switched off with
--disable-geoip.
To support GeoIP location-based ACLs, the server must be linked with
libGeoIP. This is not turned on by default; BIND must be configured with
--with-geoip. If the library is installed in a nonstandard location,
specify the prefix using --with-geoip=/prefix.
For DNSTAP packet logging, you must have installed libfstrm https://
github.com/farsightsec/fstrm and libprotobuf-c https://
@@ -248,8 +239,11 @@ default, installation is into /usr/local, but this can be changed with the
You may specify the option --sysconfdir to set the directory where
configuration files like named.conf go by default, and --localstatedir to
set the default parent directory of run/named.pid. --sysconfdir defaults
to $prefix/etc and --localstatedir defaults to $prefix/var.
set the default parent directory of run/named.pid. For backwards
compatibility with BIND 8, --sysconfdir defaults to /etc and
--localstatedir defaults to /var if no --prefix option is given. If there
is a --prefix option, sysconfdir defaults to $prefix/etc and localstatedir
defaults to $prefix/var.
Automated testing
@@ -292,7 +286,7 @@ development BIND 9 is included in the file CHANGES, with the most recent
changes listed first. Change notes include tags indicating the category of
the change that was made; these categories are:
Category Description
Category Description
[func] New feature
[bug] General bug fix
[security] Fix for a significant security flaw
@@ -320,46 +314,26 @@ releases (i.e., those with version numbers ending in zero). Some new
functionality may be backported to older releases on a case-by-case basis.
All other change types may be applied to all currently-supported releases.
Bug report identifiers
Most notes in the CHANGES file include a reference to a bug report or
issue number. Prior to 2018, these were usually of the form [RT #NNN] and
referred to entries in the "bind9-bugs" RT database, which was not open to
the public. More recent entries use the form [GL #NNN] or, less often, [GL
!NNN], which, respectively, refer to issues or merge requests in the
Gitlab database. Most of these are publicly readable, unless they include
information which is confidential or security senstive.
To look up a Gitlab issue by its number, use the URL https://
gitlab.isc.org/isc-projects/bind9/issues/NNN. To look up a merge request,
use https://gitlab.isc.org/isc-projects/bind9/merge_requests/NNN.
In rare cases, an issue or merge request number may be followed with the
letter "P". This indicates that the information is in the private ISC
Gitlab instance, which is not visible to the public.
Acknowledgments
* The original development of BIND 9 was underwritten by the following
organizations:
Sun Microsystems, Inc.
Hewlett Packard
Compaq Computer Corporation
IBM
Process Software Corporation
Silicon Graphics, Inc.
Network Associates, Inc.
U.S. Defense Information Systems Agency
USENIX Association
Stichting NLnet - NLnet Foundation
Nominum, Inc.
Sun Microsystems, Inc.
Hewlett Packard
Compaq Computer Corporation
IBM
Process Software Corporation
Silicon Graphics, Inc.
Network Associates, Inc.
U.S. Defense Information Systems Agency
USENIX Association
Stichting NLnet - NLnet Foundation
Nominum, Inc.
* This product includes software developed by the OpenSSL Project for
use in the OpenSSL Toolkit. http://www.OpenSSL.org/
* This product includes cryptographic software written by Eric Young
(eay@cryptsoft.com)
* This product includes software written by Tim Hudson
(tjh@cryptsoft.com)
+14 -39
View File
@@ -48,7 +48,7 @@ used in versions 4 and 8. Internet Systems Consortium
corporation dedicated to providing software and services in support of the
Internet infrastructure, developed BIND 9 and is responsible for its
ongoing maintenance and improvement. BIND is open source software
licensed under the terms of the Mozilla Public License, version 2.0.
licenced under the terms of the Mozilla Public License, version 2.0.
For a summary of features introduced in past major releases of BIND,
see the file [HISTORY](HISTORY.md).
@@ -98,8 +98,7 @@ ISC maintains a public git repository for BIND; details can be found
at [http://www.isc.org/git/](http://www.isc.org/git/).
Information for BIND contributors can be found in the following files:
- General information: [CONTRIBUTING.md](CONTRIBUTING.md)
- Code of Conduct: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
- General information: [CONTRIBUTING.md](CONTRIBUTING)
- BIND 9 code style: [doc/dev/style.md](doc/dev/style.md)
- BIND architecture and developer guide: [doc/dev/dev.md](doc/dev/dev.md)
@@ -121,12 +120,7 @@ including your patch as an attachment, preferably generated by
### <a name="features"/> BIND 9.15 features
BIND 9.15 is the newest development branch of BIND 9. It includes a
number of changes from BIND 9.14 and earlier releases. New features
include:
* Support for the new GeoIP2 geolocation API
* Improved DNSSEC key configuration using `dnssec-keys`
* YAML output for dig, mdig, and delv.
number of changes from BIND 9.14 and earlier releases.
### <a name="build"/> Building BIND
@@ -206,10 +200,8 @@ To support the HTTP statistics channel, the server must be linked with at
least one of the following: libxml2
[http://xmlsoft.org](http://xmlsoft.org) or json-c
[https://github.com/json-c](https://github.com/json-c). If these are
installed at a nonstandard location, then:
* for libxml2, specify the prefix using `--with-libxml2=/prefix`,
* for json-c, adjust `PKG_CONFIG_PATH`.
installed at a nonstandard location, specify the prefix using
`--with-libxml2=/prefix` or `--with-libjson=/prefix`.
To support compression on the HTTP statistics channel, the server must be
linked against libzlib. If this is installed in a nonstandard location,
@@ -219,11 +211,10 @@ To support storing configuration data for runtime-added zones in an LMDB
database, the server must be linked with liblmdb. If this is installed in a
nonstandard location, specify the prefix using `with-lmdb=/prefix`.
To support MaxMind GeoIP2 location-based ACLs, the server must be linked
with `libmaxminddb`. This is turned on by default if the library is
found; if the library is installed in a nonstandard location,
specify the prefix using `--with-maxminddb=/prefix`. GeoIP2 support
can be switched off with `--disable-geoip`.
To support GeoIP location-based ACLs, the server must be linked with
libGeoIP. This is not turned on by default; BIND must be configured with
`--with-geoip`. If the library is installed in a nonstandard location,
specify the prefix using `--with-geoip=/prefix`.
For DNSTAP packet logging, you must have installed libfstrm
[https://github.com/farsightsec/fstrm](https://github.com/farsightsec/fstrm)
@@ -262,8 +253,11 @@ default, installation is into /usr/local, but this can be changed with the
You may specify the option `--sysconfdir` to set the directory where
configuration files like `named.conf` go by default, and `--localstatedir`
to set the default parent directory of `run/named.pid`. `--sysconfdir`
defaults to `$prefix/etc` and `--localstatedir` defaults to `$prefix/var`.
to set the default parent directory of `run/named.pid`. For backwards
compatibility with BIND 8, `--sysconfdir` defaults to `/etc` and
`--localstatedir` defaults to `/var` if no `--prefix` option is given. If
there is a `--prefix` option, sysconfdir defaults to `$prefix/etc` and
localstatedir defaults to `$prefix/var`.
### <a name="testing"/> Automated testing
@@ -329,25 +323,6 @@ releases (i.e., those with version numbers ending in zero). Some new
functionality may be backported to older releases on a case-by-case basis.
All other change types may be applied to all currently-supported releases.
#### Bug report identifiers
Most notes in the CHANGES file include a reference to a bug report or
issue number. Prior to 2018, these were usually of the form `[RT #NNN]`
and referred to entries in the "bind9-bugs" RT database, which was not open
to the public. More recent entries use the form `[GL #NNN]` or, less often,
`[GL !NNN]`, which, respectively, refer to issues or merge requests in the
Gitlab database. Most of these are publicly readable, unless they include
information which is confidential or security senstive.
To look up a Gitlab issue by its number, use the URL
[https://gitlab.isc.org/isc-projects/bind9/issues/NNN](https://gitlab.isc.org/isc-projects/bind9/issues).
To look up a merge request, use
[https://gitlab.isc.org/isc-projects/bind9/merge_requests/NNN](https://gitlab.isc.org/isc-projects/bind9/merge_requests).
In rare cases, an issue or merge request number may be followed with the
letter "P". This indicates that the information is in the private ISC
Gitlab instance, which is not visible to the public.
### <a name="ack"/> Acknowledgments
* The original development of BIND 9 was underwritten by the
Vendored
-89
View File
@@ -288,98 +288,9 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# Default is to disable them, unless 'enable' is passed literally.
# For symmetry, 'disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
[enable], [m4_define([am_maintainer_other], [disable])],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
[AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
am_maintainer_other[ make rules and dependencies not useful
(and sometimes confusing) to the casual installer])],
[USE_MAINTAINER_MODE=$enableval],
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST([MAINT])dnl
]
)
# Copyright (C) 2006-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
m4_include([m4/ax_check_compile_flag.m4])
m4_include([m4/ax_check_openssl.m4])
m4_include([m4/ax_posix_shell.m4])
m4_include([m4/ax_pthread.m4])
m4_include([m4/ax_restore_flags.m4])
m4_include([m4/ax_save_flags.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
+4 -5
View File
@@ -16,16 +16,15 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${NS_INCLUDES} ${BIND9_INCLUDES} ${DNS_INCLUDES} ${ISCCFG_INCLUDES} \
${ISC_INCLUDES} \
${OPENSSL_CFLAGS}
${ISC_INCLUDES} @OPENSSL_INCLUDES@
CDEFINES = -DNAMED_CONFFILE=\"${sysconfdir}/named.conf\"
CWARNINGS =
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
NSLIBS = ../../lib/ns/libns.@A@
+3 -1
View File
@@ -140,6 +140,8 @@ add(char *key, int value) {
}
key = isc_mem_strdup(sym_mctx, key);
if (key == NULL)
return;
symvalue.as_pointer = NULL;
result = isc_symtab_define(symtab, key, value, symvalue,
@@ -664,7 +666,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
origin = dns_fixedname_initname(&fixorigin);
CHECK(dns_name_fromtext(origin, &buffer, dns_rootname, 0, NULL));
CHECK(dns_zone_setorigin(zone, origin));
dns_zone_setdbtype(zone, 1, (const char * const *) dbtype);
CHECK(dns_zone_setdbtype(zone, 1, (const char * const *) dbtype));
CHECK(dns_zone_setfile(zone, filename, fileformat,
&dns_master_style_default));
if (journal != NULL)
-5
View File
@@ -86,11 +86,6 @@ Check "core" configuration only\&. This suppresses the loading of plugin modules
statements to be ignored\&.
.RE
.PP
\-i
.RS 4
Ignore warnings on deprecated options\&.
.RE
.PP
\-p
.RS 4
Print out the
+2 -13
View File
@@ -28,7 +28,6 @@
#include <isc/util.h>
#include <isccfg/namedconf.h>
#include <isccfg/grammar.h>
#include <bind9/check.h>
@@ -62,7 +61,7 @@ usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
fprintf(stderr, "usage: %s [-chijlvz] [-p [-x]] [-t directory] "
fprintf(stderr, "usage: %s [-chjlvz] [-p [-x]] [-t directory] "
"[named.conf]\n", program);
exit(1);
}
@@ -556,7 +555,6 @@ main(int argc, char **argv) {
bool load_zones = false;
bool list_zones = false;
bool print = false;
bool nodeprecate = false;
unsigned int flags = 0;
isc_commandline_errprint = false;
@@ -564,7 +562,7 @@ main(int argc, char **argv) {
/*
* Process memory debugging argument first.
*/
#define CMDLINE_FLAGS "cdhijlm:t:pvxz"
#define CMDLINE_FLAGS "cdhjlm:t:pvxz"
while ((c = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (c) {
case 'm':
@@ -597,10 +595,6 @@ main(int argc, char **argv) {
debug++;
break;
case 'i':
nodeprecate = true;
break;
case 'j':
nomerge = false;
break;
@@ -681,16 +675,11 @@ main(int argc, char **argv) {
RUNTIME_CHECK(cfg_parser_create(mctx, logc, &parser) == ISC_R_SUCCESS);
if (nodeprecate) {
cfg_parser_setflags(parser, CFG_PCTX_NODEPRECATED, true);
}
cfg_parser_setcallback(parser, directory_callback, NULL);
if (cfg_parse_file(parser, conffile, &cfg_type_namedconf, &config) !=
ISC_R_SUCCESS)
{
exit(1);
}
result = bind9_check_namedconf(config, loadplugins, logc, mctx);
if (result != ISC_R_SUCCESS) {
-9
View File
@@ -126,15 +126,6 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-i</term>
<listitem>
<para>
Ignore warnings on deprecated options.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-p</term>
<listitem>
-6
View File
@@ -96,12 +96,6 @@
<span class="command"><strong>plugin</strong></span> statements to be ignored.
</p>
</dd>
<dt><span class="term">-i</span></dt>
<dd>
<p>
Ignore warnings on deprecated options.
</p>
</dd>
<dt><span class="term">-p</span></dt>
<dd>
<p>
+3 -3
View File
@@ -27,9 +27,9 @@ CWARNINGS =
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
ISCCCLIBS = ../../lib/isccc/libisccc.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
+2
View File
@@ -222,6 +222,8 @@ main(int argc, char **argv) {
if (suffix != NULL) {
len = strlen(keyname) + strlen(suffix) + 2;
keybuf = isc_mem_get(mctx, len);
if (keybuf == NULL)
fatal("failed to allocate memory for keyname");
snprintf(keybuf, len, "%s.%s", keyname, suffix);
keyname = (const char *) keybuf;
}
+2
View File
@@ -222,6 +222,8 @@ main(int argc, char **argv) {
char *buf;
len = strlen(chrootdir) + strlen(keyfile) + 2;
buf = isc_mem_get(mctx, len);
if (buf == NULL)
fatal("isc_mem_get(%d) failed\n", len);
snprintf(buf, len, "%s%s%s", chrootdir,
(*keyfile != '/') ? "/" : "", keyfile);
+4 -5
View File
@@ -16,17 +16,16 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} ${ISC_INCLUDES} \
${IRS_INCLUDES} ${ISCCFG_INCLUDES} \
${OPENSSL_CFLAGS}
${IRS_INCLUDES} ${ISCCFG_INCLUDES} @OPENSSL_INCLUDES@
CDEFINES = -DVERSION=\"${VERSION}\" \
-DSYSCONFDIR=\"${sysconfdir}\"
CWARNINGS =
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
IRSLIBS = ../../lib/irs/libirs.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
+22 -13
View File
@@ -53,7 +53,7 @@ is a tool for sending DNS queries and validating the results, using the same int
\fBnamed\fR\&.
.PP
\fBdelv\fR
will send to a specified name server all queries needed to fetch and validate the requested data; this includes the original requested query, subsequent queries to follow CNAME or DNAME chains, and queries for DNSKEY and DS records to establish a chain of trust for DNSSEC validation\&. It does not perform iterative resolution, but simulates the behavior of a name server configured for DNSSEC validating and forwarding\&.
will send to a specified name server all queries needed to fetch and validate the requested data; this includes the original requested query, subsequent queries to follow CNAME or DNAME chains, and queries for DNSKEY, DS and DLV records to establish a chain of trust for DNSSEC validation\&. It does not perform iterative resolution, but simulates the behavior of a name server configured for DNSSEC validating and forwarding\&.
.PP
By default, responses are validated using built\-in DNSSEC trust anchor for the root zone ("\&.")\&. Records returned by
\fBdelv\fR
@@ -139,21 +139,21 @@ BIND
.sp
Keys that do not match the root zone name are ignored\&. An alternate key name can be specified using the
\fB+root=NAME\fR
options\&.
options\&. DNSSEC Lookaside Validation can also be turned on by using the
\fB+dlv=NAME\fR
to specify the name of a zone containing DLV records\&.
.sp
Note: When reading the trust anchor file,
\fBdelv\fR
treats
\fBdnssec\-keys\fR\fBinitial\-key\fR
and
\fBstatic\-key\fR
entries identically\&. That is, even if a key is configured with
\fBinitial\-key\fR, indicating that it is meant to be used only as an initializing key for RFC 5011 key maintenance, it is still treated by
\fBmanaged\-keys\fR
statements and
\fBtrusted\-keys\fR
statements identically\&. That is, for a managed key, it is the
\fIinitial\fR
key that is trusted; RFC 5011 key management is not supported\&.
\fBdelv\fR
as if it had been configured as a
\fBstatic\-key\fR\&.
\fBdelv\fR
does not consult the managed keys database maintained by
will not consult the managed\-keys database maintained by
\fBnamed\fR\&. This means that if either of the keys in
/etc/bind\&.keys
is revoked and rolled over, it will be necessary to update
@@ -390,16 +390,25 @@ output\&. The default is to do so\&. Note that (unlike in
control whether to request DNSSEC records or whether to validate them\&. DNSSEC records are always requested, and validation will always occur unless suppressed by the use of
\fB\-i\fR
or
\fB+noroot\fR\&.
\fB+noroot\fR
and
\fB+nodlv\fR\&.
.RE
.PP
\fB+[no]root[=ROOT]\fR
.RS 4
Indicates whether to perform conventional DNSSEC validation, and if so, specifies the name of a trust anchor\&. The default is to validate using a trust anchor of "\&." (the root zone), for which there is a built\-in key\&. If specifying a different trust anchor, then
Indicates whether to perform conventional (non\-lookaside) DNSSEC validation, and if so, specifies the name of a trust anchor\&. The default is to validate using a trust anchor of "\&." (the root zone), for which there is a built\-in key\&. If specifying a different trust anchor, then
\fB\-a\fR
must be used to specify a file containing the key\&.
.RE
.PP
\fB+[no]dlv[=DLV]\fR
.RS 4
Indicates whether to perform DNSSEC lookaside validation, and if so, specifies the name of the DLV trust anchor\&. The
\fB\-a\fR
option must also be used to specify a file containing the DLV key\&.
.RE
.PP
\fB+[no]tcp\fR
.RS 4
Controls whether to use TCP when sending queries\&. The default is to use UDP unless a truncated response has been received\&.
+132 -168
View File
@@ -111,8 +111,7 @@ static bool
nottl = false,
multiline = false,
short_form = false,
print_unknown_format = false,
yaml = false;
print_unknown_format = false;
static bool
resolve_trace = false,
@@ -126,19 +125,21 @@ static bool
static bool
cdflag = false,
no_sigs = false,
root_validation = true;
root_validation = true,
dlv_validation = true;
static bool use_tcp = false;
static char *anchorfile = NULL;
static char *trust_anchor = NULL;
static int num_keys = 0;
static char *dlv_anchor = NULL;
static int trusted_keys = 0;
static dns_fixedname_t afn;
static dns_name_t *anchor_name = NULL;
static dns_fixedname_t afn, dfn;
static dns_name_t *anchor_name = NULL, *dlv_name = NULL;
/* Default bind.keys contents */
static char anchortext[] = DNSSEC_KEYS;
static char anchortext[] = MANAGED_KEYS;
/*
* Static function prototypes
@@ -160,7 +161,7 @@ usage(void) {
" q-opt is one of:\n"
" -x dot-notation (shortcut for reverse lookups)\n"
" -d level (set debugging level)\n"
" -a anchor-file (specify root trust anchor)\n"
" -a anchor-file (specify root and dlv trust anchors)\n"
" -b address[#port] (bind to source address/port)\n"
" -p port (specify port number)\n"
" -q name (specify query name)\n"
@@ -180,8 +181,7 @@ usage(void) {
" +[no]comments (Control display of comment lines)\n"
" +[no]rrcomments (Control display of per-record "
"comments)\n"
" +[no]unknownformat (Print RDATA in RFC 3597 "
"\"unknown\" format)\n"
" +[no]unknownformat (Print RDATA in RFC 3597 \"unknown\" format)\n"
" +[no]short (Short form answer)\n"
" +[no]split=## (Split hex/base64 fields into chunks)\n"
" +[no]tcp (TCP mode)\n"
@@ -190,7 +190,7 @@ usage(void) {
" +[no]rtrace (Trace resolver fetches)\n"
" +[no]mtrace (Trace messages received)\n"
" +[no]vtrace (Trace validation process)\n"
" +[no]dlv (Obsolete)\n"
" +[no]dlv (DNSSEC lookaside validation anchor)\n"
" +[no]root (DNSSEC validation trust anchor)\n"
" +[no]dnssec (Display DNSSEC records)\n"
" -h (print help and exit)\n"
@@ -354,80 +354,53 @@ setup_logging(FILE *errout) {
static void
print_status(dns_rdataset_t *rdataset) {
char buf[1024] = { 0 };
const char *astr = "", *tstr = "";
REQUIRE(rdataset != NULL);
if (!showtrust || !dns_rdataset_isassociated(rdataset)) {
if (!showtrust || !dns_rdataset_isassociated(rdataset))
return;
}
buf[0] = '\0';
if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) {
strlcat(buf, "negative response", sizeof(buf));
strlcat(buf, (yaml ? "_" : ", "), sizeof(buf));
}
if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0)
astr = "negative response, ";
switch (rdataset->trust) {
case dns_trust_none:
strlcat(buf, "untrusted", sizeof(buf));
tstr = "untrusted";
break;
case dns_trust_pending_additional:
strlcat(buf, "signed additional data", sizeof(buf));
if (!yaml) {
strlcat(buf, ", ", sizeof(buf));
}
strlcat(buf, "pending validation", sizeof(buf));
tstr = "signed additional data, pending validation";
break;
case dns_trust_pending_answer:
strlcat(buf, "signed answer", sizeof(buf));
if (!yaml) {
strlcat(buf, ", ", sizeof(buf));
}
strlcat(buf, "pending validation", sizeof(buf));
tstr = "signed answer, pending validation";
break;
case dns_trust_additional:
strlcat(buf, "unsigned additional data", sizeof(buf));
tstr = "unsigned additional data";
break;
case dns_trust_glue:
strlcat(buf, "glue data", sizeof(buf));
tstr = "glue data";
break;
case dns_trust_answer:
if (root_validation) {
strlcat(buf, "unsigned answer", sizeof(buf));
} else {
strlcat(buf, "answer not validated", sizeof(buf));
}
if (root_validation || dlv_validation)
tstr = "unsigned answer";
else
tstr = "answer not validated";
break;
case dns_trust_authauthority:
strlcat(buf, "authority data", sizeof(buf));
tstr = "authority data";
break;
case dns_trust_authanswer:
strlcat(buf, "authoritative", sizeof(buf));
tstr = "authoritative";
break;
case dns_trust_secure:
strlcat(buf, "fully validated", sizeof(buf));
tstr = "fully validated";
break;
case dns_trust_ultimate:
strlcat(buf, "ultimate trust", sizeof(buf));
tstr = "ultimate trust";
break;
}
if (yaml) {
char *p;
/* Convert spaces to underscores for YAML */
for (p = buf; p != NULL && *p != '\0'; p++) {
if (*p == ' ') {
*p = '_';
}
}
printf(" - %s:\n", buf);
} else {
printf("; %s\n", buf);
}
printf("; %s%s\n", astr, tstr);
}
static isc_result_t
@@ -454,9 +427,8 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
return (ISC_R_SUCCESS);
if (first || rdataset->trust != trust) {
if (!first && showtrust && !short_form && !yaml) {
if (!first && showtrust && !short_form)
putchar('\n');
}
print_status(rdataset);
trust = rdataset->trust;
first = false;
@@ -464,6 +436,8 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
do {
t = isc_mem_get(mctx, len);
if (t == NULL)
return (ISC_R_NOMEMORY);
isc_buffer_init(&target, t, len);
if (short_form) {
@@ -495,11 +469,9 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
dns_rdata_reset(&rdata);
}
} else {
if (!yaml && (rdataset->attributes &
DNS_RDATASETATTR_NEGATIVE) != 0)
{
if ((rdataset->attributes &
DNS_RDATASETATTR_NEGATIVE) != 0)
isc_buffer_putstr(&target, "; ");
}
result = dns_master_rdatasettotext(owner, rdataset,
style, &target);
@@ -532,52 +504,38 @@ setup_style(dns_master_style_t **stylep) {
REQUIRE(stylep != NULL || *stylep == NULL);
styleflags |= DNS_STYLEFLAG_REL_OWNER;
if (yaml) {
styleflags |= DNS_STYLEFLAG_YAML;
dns_master_indentstr = " ";
dns_master_indent = 2;
} else {
if (showcomments) {
styleflags |= DNS_STYLEFLAG_COMMENT;
}
if (print_unknown_format) {
styleflags |= DNS_STYLEFLAG_UNKNOWNFORMAT;
}
if (rrcomments) {
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
}
if (nottl) {
styleflags |= DNS_STYLEFLAG_NO_TTL;
}
if (noclass) {
styleflags |= DNS_STYLEFLAG_NO_CLASS;
}
if (nocrypto) {
styleflags |= DNS_STYLEFLAG_NOCRYPTO;
}
if (multiline) {
styleflags |= DNS_STYLEFLAG_MULTILINE;
styleflags |= DNS_STYLEFLAG_COMMENT;
}
if (showcomments)
styleflags |= DNS_STYLEFLAG_COMMENT;
if (print_unknown_format)
styleflags |= DNS_STYLEFLAG_UNKNOWNFORMAT;
if (rrcomments)
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
if (nottl)
styleflags |= DNS_STYLEFLAG_NO_TTL;
if (noclass)
styleflags |= DNS_STYLEFLAG_NO_CLASS;
if (nocrypto)
styleflags |= DNS_STYLEFLAG_NOCRYPTO;
if (multiline) {
styleflags |= DNS_STYLEFLAG_MULTILINE;
styleflags |= DNS_STYLEFLAG_COMMENT;
}
if (multiline || (nottl && noclass)) {
if (multiline || (nottl && noclass))
result = dns_master_stylecreate(&style, styleflags,
24, 24, 24, 32, 80, 8,
splitwidth, mctx);
} else if (nottl || noclass) {
else if (nottl || noclass)
result = dns_master_stylecreate(&style, styleflags,
24, 24, 32, 40, 80, 8,
splitwidth, mctx);
} else {
else
result = dns_master_stylecreate(&style, styleflags,
24, 32, 40, 48, 80, 8,
splitwidth, mctx);
}
if (result == ISC_R_SUCCESS) {
if (result == ISC_R_SUCCESS)
*stylep = style;
}
return (result);
}
@@ -619,30 +577,30 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
dns_fixedname_t fkeyname;
dns_name_t *keyname;
isc_result_t result;
bool match_root = false;
bool match_root = false, match_dlv = false;
keynamestr = cfg_obj_asstring(cfg_tuple_get(key, "name"));
CHECK(convert_name(&fkeyname, &keyname, keynamestr));
if (!root_validation) {
if (!root_validation && !dlv_validation)
return (ISC_R_SUCCESS);
}
if (anchor_name) {
if (anchor_name)
match_root = dns_name_equal(keyname, anchor_name);
}
if (dlv_name)
match_dlv = dns_name_equal(keyname, dlv_name);
if (!match_root) {
if (!match_root && !match_dlv)
return (ISC_R_SUCCESS);
}
if (!root_validation && match_root) {
if ((!root_validation && match_root) || (!dlv_validation && match_dlv))
return (ISC_R_SUCCESS);
}
if (match_root) {
if (match_root)
delv_log(ISC_LOG_DEBUG(3), "adding trust anchor %s",
trust_anchor);
}
if (match_dlv)
delv_log(ISC_LOG_DEBUG(3), "adding DLV trust anchor %s",
dlv_anchor);
flags = cfg_obj_asuint32(cfg_tuple_get(key, "flags"));
proto = cfg_obj_asuint32(cfg_tuple_get(key, "protocol"));
@@ -684,7 +642,7 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
CHECK(dns_client_addtrustedkey(client, dns_rdataclass_in,
keyname, &rrdatabuf));
num_keys++;
trusted_keys++;
cleanup:
if (result == DST_R_NOCRYPTO)
@@ -735,15 +693,13 @@ static isc_result_t
setup_dnsseckeys(dns_client_t *client) {
isc_result_t result;
cfg_parser_t *parser = NULL;
const cfg_obj_t *trusted_keys = NULL;
const cfg_obj_t *keys = NULL;
const cfg_obj_t *managed_keys = NULL;
const cfg_obj_t *dnssec_keys = NULL;
cfg_obj_t *bindkeys = NULL;
const char *filename = anchorfile;
if (!root_validation) {
if (!root_validation && !dlv_validation)
return (ISC_R_SUCCESS);
}
if (filename == NULL) {
#ifndef WIN32
@@ -758,27 +714,27 @@ setup_dnsseckeys(dns_client_t *client) {
if (trust_anchor == NULL) {
trust_anchor = isc_mem_strdup(mctx, ".");
if (trust_anchor == NULL)
fatal("out of memory");
}
if (trust_anchor != NULL) {
if (trust_anchor != NULL)
CHECK(convert_name(&afn, &anchor_name, trust_anchor));
}
if (dlv_anchor != NULL)
CHECK(convert_name(&dfn, &dlv_name, dlv_anchor));
CHECK(cfg_parser_create(mctx, dns_lctx, &parser));
if (access(filename, R_OK) != 0) {
if (anchorfile != NULL) {
if (anchorfile != NULL)
fatal("Unable to read key file '%s'", anchorfile);
}
} else {
result = cfg_parse_file(parser, filename,
&cfg_type_bindkeys, &bindkeys);
if (result != ISC_R_SUCCESS) {
if (anchorfile != NULL) {
if (result != ISC_R_SUCCESS)
if (anchorfile != NULL)
fatal("Unable to load keys from '%s'",
anchorfile);
}
}
}
if (bindkeys == NULL) {
@@ -788,30 +744,26 @@ setup_dnsseckeys(dns_client_t *client) {
isc_buffer_add(&b, sizeof(anchortext) - 1);
result = cfg_parse_buffer(parser, &b, NULL, 0,
&cfg_type_bindkeys, 0, &bindkeys);
if (result != ISC_R_SUCCESS) {
if (result != ISC_R_SUCCESS)
fatal("Unable to parse built-in keys");
}
}
INSIST(bindkeys != NULL);
cfg_map_get(bindkeys, "trusted-keys", &trusted_keys);
cfg_map_get(bindkeys, "trusted-keys", &keys);
cfg_map_get(bindkeys, "managed-keys", &managed_keys);
cfg_map_get(bindkeys, "dnssec-keys", &dnssec_keys);
if (trusted_keys != NULL) {
CHECK(load_keys(trusted_keys, client));
}
if (managed_keys != NULL) {
if (keys != NULL)
CHECK(load_keys(keys, client));
if (managed_keys != NULL)
CHECK(load_keys(managed_keys, client));
}
if (dnssec_keys != NULL) {
CHECK(load_keys(dnssec_keys, client));
}
result = ISC_R_SUCCESS;
if (num_keys == 0) {
if (trusted_keys == 0)
fatal("No trusted keys were loaded");
}
if (dlv_validation)
dns_client_setdlv(client, dns_rdataclass_in, dlv_anchor);
cleanup:
if (bindkeys != NULL) {
@@ -820,10 +772,9 @@ setup_dnsseckeys(dns_client_t *client) {
if (parser != NULL) {
cfg_parser_destroy(&parser);
}
if (result != ISC_R_SUCCESS) {
if (result != ISC_R_SUCCESS)
delv_log(ISC_LOG_ERROR, "setup_dnsseckeys: %s",
isc_result_totext(result));
}
return (result);
}
@@ -850,6 +801,8 @@ addserver(dns_client_t *client) {
fatal("Use of IPv4 disabled by -6");
}
sa = isc_mem_get(mctx, sizeof(*sa));
if (sa == NULL)
return (ISC_R_NOMEMORY);
ISC_LINK_INIT(sa, link);
isc_sockaddr_fromin(sa, &in4, destport);
ISC_LIST_APPEND(servers, sa, link);
@@ -858,6 +811,8 @@ addserver(dns_client_t *client) {
fatal("Use of IPv6 disabled by -4");
}
sa = isc_mem_get(mctx, sizeof(*sa));
if (sa == NULL)
return (ISC_R_NOMEMORY);
ISC_LINK_INIT(sa, link);
isc_sockaddr_fromin6(sa, &in6, destport);
ISC_LIST_APPEND(servers, sa, link);
@@ -885,6 +840,10 @@ addserver(dns_client_t *client) {
cur->ai_family != AF_INET6)
continue;
sa = isc_mem_get(mctx, sizeof(*sa));
if (sa == NULL) {
result = ISC_R_NOMEMORY;
break;
}
memset(sa, 0, sizeof(*sa));
ISC_LINK_INIT(sa, link);
memmove(&sa->type, cur->ai_addr, cur->ai_addrlen);
@@ -957,6 +916,10 @@ findserver(dns_client_t *client) {
struct in_addr localhost;
localhost.s_addr = htonl(INADDR_LOOPBACK);
sa = isc_mem_get(mctx, sizeof(*sa));
if (sa == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup;
}
isc_sockaddr_fromin(sa, &localhost, destport);
ISC_LINK_INIT(sa, link);
@@ -965,6 +928,10 @@ findserver(dns_client_t *client) {
if (use_ipv6) {
sa = isc_mem_get(mctx, sizeof(*sa));
if (sa == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup;
}
isc_sockaddr_fromin6(sa, &in6addr_loopback, destport);
ISC_LINK_INIT(sa, link);
@@ -1060,10 +1027,13 @@ plus_option(char *option) {
switch (cmd[1]) {
case 'l': /* dlv */
FULLCHECK("dlv");
if (state) {
fprintf(stderr, "Invalid option: "
"+dlv is obsolete\n");
exit(1);
if (state && no_sigs)
break;
dlv_validation = state;
if (value != NULL) {
dlv_anchor = isc_mem_strdup(mctx, value);
if (dlv_anchor == NULL)
fatal("out of memory");
}
break;
case 'n': /* dnssec */
@@ -1098,6 +1068,8 @@ plus_option(char *option) {
root_validation = state;
if (value != NULL) {
trust_anchor = isc_mem_strdup(mctx, value);
if (trust_anchor == NULL)
fatal("out of memory");
}
break;
case 'r': /* rrcomments */
@@ -1185,13 +1157,6 @@ plus_option(char *option) {
if (state)
resolve_trace = state;
break;
case 'y': /* yaml */
FULLCHECK("yaml");
yaml = state;
if (state) {
rrcomments = false;
}
break;
default:
invalid_option:
/*
@@ -1255,6 +1220,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
/* NOTREACHED */
case 'i':
no_sigs = true;
dlv_validation = false;
root_validation = false;
break;
case 'm':
@@ -1286,6 +1252,8 @@ dash_option(char *option, char *next, bool *open_type_class) {
switch (opt) {
case 'a':
anchorfile = isc_mem_strdup(mctx, value);
if (anchorfile == NULL)
fatal("out of memory");
return (value_from_next);
case 'b':
hash = strchr(value, '#');
@@ -1349,6 +1317,8 @@ dash_option(char *option, char *next, bool *open_type_class) {
isc_mem_free(mctx, curqname);
}
curqname = isc_mem_strdup(mctx, value);
if (curqname == NULL)
fatal("out of memory");
return (value_from_next);
case 't':
*open_type_class = false;
@@ -1376,6 +1346,8 @@ dash_option(char *option, char *next, bool *open_type_class) {
warn("extra query name");
}
curqname = isc_mem_strdup(mctx, textname);
if (curqname == NULL)
fatal("out of memory");
if (typeset)
warn("extra query type");
qtype = dns_rdatatype_ptr;
@@ -1522,6 +1494,8 @@ parse_args(int argc, char **argv) {
if (curqname == NULL) {
curqname = isc_mem_strdup(mctx, argv[0]);
if (curqname == NULL)
fatal("out of memory");
}
}
}
@@ -1535,6 +1509,8 @@ parse_args(int argc, char **argv) {
if (curqname == NULL) {
qname = isc_mem_strdup(mctx, ".");
if (qname == NULL)
fatal("out of memory");
if (!typeset)
qtype = dns_rdatatype_ns;
@@ -1618,7 +1594,6 @@ main(int argc, char *argv[]) {
isc_result_t result;
dns_fixedname_t qfn;
dns_name_t *query_name, *response_name;
char namestr[DNS_NAME_FORMATSIZE];
dns_rdataset_t *rdataset;
dns_namelist_t namelist;
unsigned int resopt, clopt;
@@ -1647,9 +1622,9 @@ main(int argc, char *argv[]) {
fatal("failed to create mctx");
CHECK(isc_appctx_create(mctx, &actx));
CHECK(isc_taskmgr_createinctx(mctx, 1, 0, &taskmgr));
CHECK(isc_socketmgr_createinctx(mctx, &socketmgr));
CHECK(isc_timermgr_createinctx(mctx, &timermgr));
CHECK(isc_taskmgr_createinctx(mctx, actx, 1, 0, &taskmgr));
CHECK(isc_socketmgr_createinctx(mctx, actx, &socketmgr));
CHECK(isc_timermgr_createinctx(mctx, actx, &timermgr));
parse_args(argc, argv);
@@ -1690,35 +1665,22 @@ main(int argc, char *argv[]) {
/* Set up resolution options */
resopt = DNS_CLIENTRESOPT_ALLOWRUN | DNS_CLIENTRESOPT_NOCDFLAG;
if (no_sigs) {
if (no_sigs)
resopt |= DNS_CLIENTRESOPT_NODNSSEC;
}
if (!root_validation) {
if (!root_validation && !dlv_validation)
resopt |= DNS_CLIENTRESOPT_NOVALIDATE;
}
if (cdflag) {
if (cdflag)
resopt &= ~DNS_CLIENTRESOPT_NOCDFLAG;
}
if (use_tcp) {
if (use_tcp)
resopt |= DNS_CLIENTRESOPT_TCP;
}
/* Perform resolution */
ISC_LIST_INIT(namelist);
result = dns_client_resolve(client, query_name, dns_rdataclass_in,
qtype, resopt, &namelist);
if (result != ISC_R_SUCCESS && !yaml) {
if (result != ISC_R_SUCCESS)
delv_log(ISC_LOG_ERROR, "resolution failed: %s",
isc_result_totext(result));
}
if (yaml) {
printf("type: DELV_RESULT\n");
dns_name_format(query_name, namestr, sizeof(namestr));
printf("query_name: %s\n", namestr);
printf("status: %s\n", isc_result_totext(result));
printf("records:\n");
}
for (response_name = ISC_LIST_HEAD(namelist);
response_name != NULL;
@@ -1735,6 +1697,8 @@ main(int argc, char *argv[]) {
dns_client_freeresanswer(client, &namelist);
cleanup:
if (dlv_anchor != NULL)
isc_mem_free(mctx, dlv_anchor);
if (trust_anchor != NULL)
isc_mem_free(mctx, trust_anchor);
if (anchorfile != NULL)
+28 -25
View File
@@ -96,7 +96,7 @@
<command>delv</command> will send to a specified name server all
queries needed to fetch and validate the requested data; this
includes the original requested query, subsequent queries to follow
CNAME or DNAME chains, and queries for DNSKEY and DS records
CNAME or DNAME chains, and queries for DNSKEY, DS and DLV records
to establish a chain of trust for DNSSEC validation.
It does not perform iterative resolution, but simulates the
behavior of a name server configured for DNSSEC validating and
@@ -211,21 +211,21 @@
<para>
Keys that do not match the root zone name are ignored.
An alternate key name can be specified using the
<option>+root=NAME</option> options.
<option>+root=NAME</option> options. DNSSEC Lookaside
Validation can also be turned on by using the
<option>+dlv=NAME</option> to specify the name of a
zone containing DLV records.
</para>
<para>
Note: When reading the trust anchor file,
<command>delv</command> treats <option>dnssec-keys</option>
<option>initial-key</option> and <option>static-key</option>
entries identically. That is, even if a key is configured
with <command>initial-key</command>, indicating that it is
meant to be used only as an initializing key for RFC 5011
key maintenance, it is still treated by <command>delv</command>
as if it had been configured as a <command>static-key</command>.
<command>delv</command> does not consult the managed keys
database maintained by <command>named</command>. This means
that if either of the keys in
<filename>/etc/bind.keys</filename> is revoked
<command>delv</command> treats <option>managed-keys</option>
statements and <option>trusted-keys</option> statements
identically. That is, for a managed key, it is the
<emphasis>initial</emphasis> key that is trusted; RFC 5011
key management is not supported. <command>delv</command>
will not consult the managed-keys database maintained by
<command>named</command>. This means that if either of the
keys in <filename>/etc/bind.keys</filename> is revoked
and rolled over, it will be necessary to update
<filename>/etc/bind.keys</filename> to use DNSSEC
validation in <command>delv</command>.
@@ -617,7 +617,8 @@
request DNSSEC records or whether to validate them.
DNSSEC records are always requested, and validation
will always occur unless suppressed by the use of
<option>-i</option> or <option>+noroot</option>.
<option>-i</option> or <option>+noroot</option> and
<option>+nodlv</option>.
</para>
</listitem>
</varlistentry>
@@ -626,7 +627,7 @@
<term><option>+[no]root[=ROOT]</option></term>
<listitem>
<para>
Indicates whether to perform conventional
Indicates whether to perform conventional (non-lookaside)
DNSSEC validation, and if so, specifies the
name of a trust anchor. The default is to validate using
a trust anchor of "." (the root zone), for which there is
@@ -637,6 +638,18 @@
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]dlv[=DLV]</option></term>
<listitem>
<para>
Indicates whether to perform DNSSEC lookaside validation,
and if so, specifies the name of the DLV trust anchor.
The <option>-a</option> option must also be used to specify
a file containing the DLV key.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]tcp</option></term>
<listitem>
@@ -658,16 +671,6 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]yaml</option></term>
<listitem>
<para>
Print response data in YAML format.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
+25 -15
View File
@@ -83,7 +83,7 @@
<span class="command"><strong>delv</strong></span> will send to a specified name server all
queries needed to fetch and validate the requested data; this
includes the original requested query, subsequent queries to follow
CNAME or DNAME chains, and queries for DNSKEY and DS records
CNAME or DNAME chains, and queries for DNSKEY, DS and DLV records
to establish a chain of trust for DNSSEC validation.
It does not perform iterative resolution, but simulates the
behavior of a name server configured for DNSSEC validating and
@@ -193,21 +193,21 @@
<p>
Keys that do not match the root zone name are ignored.
An alternate key name can be specified using the
<code class="option">+root=NAME</code> options.
<code class="option">+root=NAME</code> options. DNSSEC Lookaside
Validation can also be turned on by using the
<code class="option">+dlv=NAME</code> to specify the name of a
zone containing DLV records.
</p>
<p>
Note: When reading the trust anchor file,
<span class="command"><strong>delv</strong></span> treats <code class="option">dnssec-keys</code>
<code class="option">initial-key</code> and <code class="option">static-key</code>
entries identically. That is, even if a key is configured
with <span class="command"><strong>initial-key</strong></span>, indicating that it is
meant to be used only as an initializing key for RFC 5011
key maintenance, it is still treated by <span class="command"><strong>delv</strong></span>
as if it had been configured as a <span class="command"><strong>static-key</strong></span>.
<span class="command"><strong>delv</strong></span> does not consult the managed keys
database maintained by <span class="command"><strong>named</strong></span>. This means
that if either of the keys in
<code class="filename">/etc/bind.keys</code> is revoked
<span class="command"><strong>delv</strong></span> treats <code class="option">managed-keys</code>
statements and <code class="option">trusted-keys</code> statements
identically. That is, for a managed key, it is the
<span class="emphasis"><em>initial</em></span> key that is trusted; RFC 5011
key management is not supported. <span class="command"><strong>delv</strong></span>
will not consult the managed-keys database maintained by
<span class="command"><strong>named</strong></span>. This means that if either of the
keys in <code class="filename">/etc/bind.keys</code> is revoked
and rolled over, it will be necessary to update
<code class="filename">/etc/bind.keys</code> to use DNSSEC
validation in <span class="command"><strong>delv</strong></span>.
@@ -517,13 +517,14 @@
request DNSSEC records or whether to validate them.
DNSSEC records are always requested, and validation
will always occur unless suppressed by the use of
<code class="option">-i</code> or <code class="option">+noroot</code>.
<code class="option">-i</code> or <code class="option">+noroot</code> and
<code class="option">+nodlv</code>.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]root[=ROOT]</code></span></dt>
<dd>
<p>
Indicates whether to perform conventional
Indicates whether to perform conventional (non-lookaside)
DNSSEC validation, and if so, specifies the
name of a trust anchor. The default is to validate using
a trust anchor of "." (the root zone), for which there is
@@ -532,6 +533,15 @@
containing the key.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]dlv[=DLV]</code></span></dt>
<dd>
<p>
Indicates whether to perform DNSSEC lookaside validation,
and if so, specifies the name of the DLV trust anchor.
The <code class="option">-a</code> option must also be used to specify
a file containing the DLV key.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]tcp</code></span></dt>
<dd>
<p>
+4 -5
View File
@@ -19,17 +19,16 @@ READLINE_LIB = @READLINE_LIB@
CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} \
${BIND9_INCLUDES} ${ISC_INCLUDES} \
${IRS_INCLUDES} ${ISCCFG_INCLUDES} @LIBIDN2_CFLAGS@ \
${OPENSSL_CFLAGS}
${IRS_INCLUDES} ${ISCCFG_INCLUDES} @LIBIDN2_CFLAGS@ @OPENSSL_INCLUDES@
CDEFINES = -DVERSION=\"${VERSION}\"
CWARNINGS =
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
IRSLIBS = ../../lib/irs/libirs.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
+10 -16
View File
@@ -361,20 +361,14 @@ Display [do not display] the CLASS when printing the record\&.
.PP
\fB+[no]cmd\fR
.RS 4
Toggles the printing of the initial comment in the output, identifying the version of
Toggles the printing of the initial comment in the output identifying the version of
\fBdig\fR
and the query options that have been applied\&. This option always has global effect; it cannot be set globally and then overridden on a per\-lookup basis\&. The default is to print this comment\&.
and the query options that have been applied\&. This comment is printed by default\&.
.RE
.PP
\fB+[no]comments\fR
.RS 4
Toggles the display of some comment lines in the output, containing information about the packet header and OPT pseudosection, and the names of the response section\&. The default is to print these comments\&.
.sp
Other types of comments in the output are not affected by this option, but can be controlled using other command line switches\&. These include
\fB+[no]cmd\fR,
\fB+[no]question\fR,
\fB+[no]stats\fR, and
\fB+[no]rrcomments\fR\&.
Toggle the display of comment lines in the output\&. The default is to print comments\&.
.RE
.PP
\fB+[no]cookie\fR\fB[=####]\fR
@@ -572,12 +566,12 @@ would cause a 48\-byte query to be padded to 64 bytes\&. The default block size
.PP
\fB+[no]qr\fR
.RS 4
Toggles the display of the query message as it is sent\&. By default, the query is not printed\&.
Print [do not print] the query as it is sent\&. By default, the query is not printed\&.
.RE
.PP
\fB+[no]question\fR
.RS 4
Toggles the display of the question section of a query when an answer is returned\&. The default is to print the question section as a comment\&.
Print [do not print] the question section of a query when an answer is returned\&. The default is to print the question section as a comment\&.
.RE
.PP
\fB+[no]raflag\fR
@@ -595,11 +589,11 @@ A synonym for
.RS 4
Toggle the setting of the RD (recursion desired) bit in the query\&. This bit is set by default, which means
\fBdig\fR
normally sends recursive queries\&. Recursion is automatically disabled when using the
normally sends recursive queries\&. Recursion is automatically disabled when the
\fI+nssearch\fR
option, and when using
or
\fI+trace\fR
except for an initial recursive query to get the list of root servers\&.
query options are used\&.
.RE
.PP
\fB+retry=T\fR
@@ -630,7 +624,7 @@ determines if the name will be treated as relative or not and hence whether a se
.PP
\fB+[no]short\fR
.RS 4
Provide a terse answer\&. The default is to print the answer in a verbose form\&. This option always has global effect; it cannot be set globally and then overridden on a per\-lookup basis\&.
Provide a terse answer\&. The default is to print the answer in a verbose form\&.
.RE
.PP
\fB+[no]showsearch\fR
@@ -660,7 +654,7 @@ causes fields not to be split at all\&. The default is 56 characters, or 44 char
.PP
\fB+[no]stats\fR
.RS 4
Toggles the printing of statistics: when the query was made, the size of the reply and so on\&. The default behavior is to print the query statistics as a comment after each lookup\&.
This query option toggles the printing of statistics: when the query was made, the size of the reply and so on\&. The default behavior is to print the query statistics\&.
.RE
.PP
\fB+[no]subnet=addr[/prefix\-length]\fR
+60 -240
View File
@@ -64,8 +64,7 @@ static char hexcookie[81];
static bool short_form = false, printcmd = true,
plusquest = false, pluscomm = false,
ipv4only = false, ipv6only = false, digrc = true,
yaml = false;
ipv4only = false, ipv6only = false, digrc = true;
static uint32_t splitwidth = 0xffffffff;
/*% opcode text */
@@ -174,13 +173,11 @@ help(void) {
" +bufsize=### (Set EDNS0 Max UDP packet size)\n"
" +[no]cdflag (Set checking disabled flag in query)\n"
" +[no]class (Control display of class in records)\n"
" +[no]cmd (Control display of command line -\n"
" global option)\n"
" +[no]comments (Control display of packet header\n"
" and section name comments)\n"
" +[no]cmd (Control display of command line)\n"
" +[no]comments (Control display of comment lines)\n"
" +[no]cookie (Add a COOKIE option to the request)\n"
" +[no]crypto (Control display of cryptographic\n"
" fields in records)\n"
" +[no]crypto (Control display of cryptographic "
"fields in records)\n"
" +[no]defname (Use search list (+[no]search))\n"
" +[no]dnssec (Request DNSSEC records)\n"
" +domain=### (Set default domainname)\n"
@@ -197,13 +194,11 @@ help(void) {
" +[no]identify (ID responders in short answers)\n"
#ifdef HAVE_LIBIDN2
" +[no]idnin (Parse IDN names [default=on on tty])\n"
" +[no]idnout (Convert IDN response "
"[default=on on tty])\n"
" +[no]idnout (Convert IDN response [default=on on tty])\n"
#endif
" +[no]ignore (Don't revert to TCP for TC responses.)\n"
" +[no]keepalive (Request EDNS TCP keepalive)\n"
" +[no]keepopen (Keep the TCP socket open between "
"queries)\n"
" +[no]keepopen (Keep the TCP socket open between queries)\n"
" +[no]mapped (Allow mapped IPv4 over IPv6)\n"
" +[no]multiline (Print records in an expanded format)\n"
" +ndots=### (Set search NDOTS value)\n"
@@ -222,7 +217,7 @@ help(void) {
"comments)\n"
" +[no]search (Set whether to use searchlist)\n"
" +[no]short (Display nothing except short\n"
" form of answers - global option)\n"
" form of answer)\n"
" +[no]showsearch (Search with intermediate results)\n"
" +[no]split=## (Split hex/base64 fields into chunks)\n"
" +[no]stats (Control display of statistics)\n"
@@ -230,13 +225,11 @@ help(void) {
" +[no]tcflag (Set TC flag in query (+[no]tcflag))\n"
" +[no]tcp (TCP mode (+[no]vc))\n"
" +timeout=### (Set query timeout) [5]\n"
" +[no]trace (Trace delegation down from root "
"[+dnssec])\n"
" +[no]trace (Trace delegation down from root [+dnssec])\n"
" +tries=### (Set number of UDP attempts) [3]\n"
" +[no]ttlid (Control display of ttls in records)\n"
" +[no]ttlunits (Display TTLs in human-readable units)\n"
" +[no]unknownformat (Print RDATA in RFC 3597 \"unknown\" "
"format)\n"
" +[no]unknownformat (Print RDATA in RFC 3597 \"unknown\" format)\n"
" +[no]vc (TCP mode (+[no]tcp))\n"
" +[no]zflag (Set Z flag in query)\n"
" global d-opts and servers (before host name) affect all queries.\n"
@@ -263,11 +256,7 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
isc_sockaddr_format(from, fromtext, sizeof(fromtext));
if (short_form || yaml) {
return;
}
if (query->lookup->stats) {
if (query->lookup->stats && !short_form) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
if (query->lookup->use_usec)
printf(";; Query time: %ld usec\n", (long) diff);
@@ -288,15 +277,11 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
*/
if (wcsftime(time_str, sizeof(time_str)/sizeof(time_str[0]),
L"%a %b %d %H:%M:%S %Z %Y", &tmnow) > 0U)
{
printf(";; WHEN: %ls\n", time_str);
}
#else
if (strftime(time_str, sizeof(time_str),
"%a %b %d %H:%M:%S %Z %Y", &tmnow) > 0U)
{
printf(";; WHEN: %s\n", time_str);
}
#endif
if (query->lookup->doing_xfr) {
printf(";; XFR size: %u records (messages %u, "
@@ -307,32 +292,30 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
printf(";; MSG SIZE rcvd: %u\n", bytes);
}
if (tsigkey != NULL) {
if (!validated) {
if (!validated)
puts(";; WARNING -- Some TSIG could not "
"be validated");
}
}
if ((tsigkey == NULL) && (keysecret[0] != 0)) {
puts(";; WARNING -- TSIG key was not used.");
}
puts("");
} else if (query->lookup->identify) {
} else if (query->lookup->identify && !short_form) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
if (query->lookup->use_usec) {
if (query->lookup->use_usec)
printf(";; Received %" PRIu64 " bytes "
"from %s(%s) in %ld us\n\n",
query->lookup->doing_xfr
? query->byte_count
: (uint64_t)bytes,
fromtext, query->userarg, (long) diff);
} else {
else
printf(";; Received %" PRIu64 " bytes "
"from %s(%s) in %ld ms\n\n",
query->lookup->doing_xfr
? query->byte_count
: (uint64_t)bytes,
fromtext, query->userarg, (long) diff / 1000);
}
}
}
@@ -371,24 +354,20 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
styleflags |= DNS_STYLEFLAG_NOCRYPTO;
if (query->lookup->print_unknown_format)
styleflags |= DNS_STYLEFLAG_UNKNOWNFORMAT;
if (query->lookup->expandaaaa)
styleflags |= DNS_STYLEFLAG_EXPANDAAAA;
result = dns_rdata_tofmttext(rdata, NULL, styleflags, 0,
splitwidth, " ", buf);
if (result == ISC_R_NOSPACE) {
if (result == ISC_R_NOSPACE)
return (result);
}
check_result(result, "dns_rdata_totext");
if (query->lookup->identify) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
ADD_STRING(buf, " from server ");
ADD_STRING(buf, query->servname);
if (query->lookup->use_usec) {
snprintf(store, sizeof(store),
" in %" PRIu64 " us.", diff);
snprintf(store, sizeof(store), " in %" PRIu64 " us.", diff);
} else {
snprintf(store, sizeof(store),
" in %" PRIu64 " ms.", diff / 1000);
snprintf(store, sizeof(store), " in %" PRIu64 " ms.", diff / 1000);
}
ADD_STRING(buf, store);
}
@@ -428,7 +407,8 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags,
loopresult = dns_rdataset_first(rdataset);
while (loopresult == ISC_R_SUCCESS) {
dns_rdataset_current(rdataset, &rdata);
result = say_message(&rdata, query, buf);
result = say_message(&rdata, query,
buf);
if (result == ISC_R_NOSPACE)
return (result);
check_result(result, "say_message");
@@ -470,85 +450,62 @@ isdotlocal(dns_message_t *msg) {
* Callback from dighost.c to print the reply from a server
*/
static isc_result_t
printmessage(dig_query_t *query, const isc_buffer_t *msgbuf,
dns_message_t *msg, bool headers)
{
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
isc_result_t result;
dns_messagetextflag_t flags;
isc_buffer_t *buf = NULL;
unsigned int len = OUTPUTBUF;
dns_master_style_t *style = NULL;
unsigned int styleflags = 0;
bool isquery = (msg == query->lookup->sendmsg);
UNUSED(msgbuf);
styleflags |= DNS_STYLEFLAG_REL_OWNER;
if (yaml) {
dns_master_indentstr = " ";
dns_master_indent = 3;
styleflags |= DNS_STYLEFLAG_YAML;
} else {
if (query->lookup->comments) {
styleflags |= DNS_STYLEFLAG_COMMENT;
}
if (query->lookup->print_unknown_format) {
styleflags |= DNS_STYLEFLAG_UNKNOWNFORMAT;
}
/* Turn on rrcomments if explicitly enabled */
if (query->lookup->rrcomments > 0) {
if (query->lookup->comments)
styleflags |= DNS_STYLEFLAG_COMMENT;
if (query->lookup->print_unknown_format)
styleflags |= DNS_STYLEFLAG_UNKNOWNFORMAT;
/* Turn on rrcomments if explicitly enabled */
if (query->lookup->rrcomments > 0)
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
if (query->lookup->ttlunits)
styleflags |= DNS_STYLEFLAG_TTL_UNITS;
if (query->lookup->nottl)
styleflags |= DNS_STYLEFLAG_NO_TTL;
if (query->lookup->noclass)
styleflags |= DNS_STYLEFLAG_NO_CLASS;
if (query->lookup->nocrypto)
styleflags |= DNS_STYLEFLAG_NOCRYPTO;
if (query->lookup->expandaaaa)
styleflags |= DNS_STYLEFLAG_EXPANDAAAA;
if (query->lookup->multiline) {
styleflags |= DNS_STYLEFLAG_OMIT_OWNER;
styleflags |= DNS_STYLEFLAG_OMIT_CLASS;
styleflags |= DNS_STYLEFLAG_REL_DATA;
styleflags |= DNS_STYLEFLAG_OMIT_TTL;
styleflags |= DNS_STYLEFLAG_TTL;
styleflags |= DNS_STYLEFLAG_MULTILINE;
/* Turn on rrcomments unless explicitly disabled */
if (query->lookup->rrcomments >= 0)
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
}
if (query->lookup->ttlunits) {
styleflags |= DNS_STYLEFLAG_TTL_UNITS;
}
if (query->lookup->nottl) {
styleflags |= DNS_STYLEFLAG_NO_TTL;
}
if (query->lookup->noclass) {
styleflags |= DNS_STYLEFLAG_NO_CLASS;
}
if (query->lookup->nocrypto) {
styleflags |= DNS_STYLEFLAG_NOCRYPTO;
}
if (query->lookup->expandaaaa) {
styleflags |= DNS_STYLEFLAG_EXPANDAAAA;
}
if (query->lookup->multiline) {
styleflags |= DNS_STYLEFLAG_OMIT_OWNER;
styleflags |= DNS_STYLEFLAG_OMIT_CLASS;
styleflags |= DNS_STYLEFLAG_REL_DATA;
styleflags |= DNS_STYLEFLAG_OMIT_TTL;
styleflags |= DNS_STYLEFLAG_TTL;
styleflags |= DNS_STYLEFLAG_MULTILINE;
/* Turn on rrcomments unless explicitly disabled */
if (query->lookup->rrcomments >= 0) {
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
}
}
}
if (query->lookup->multiline ||
(query->lookup->nottl && query->lookup->noclass))
{
result = dns_master_stylecreate(&style, styleflags,
24, 24, 24, 32, 80, 8,
splitwidth, mctx);
} else if (query->lookup->nottl || query->lookup->noclass) {
else if (query->lookup->nottl || query->lookup->noclass)
result = dns_master_stylecreate(&style, styleflags,
24, 24, 32, 40, 80, 8,
splitwidth, mctx);
} else {
else
result = dns_master_stylecreate(&style, styleflags,
24, 32, 40, 48, 80, 8,
splitwidth, mctx);
}
check_result(result, "dns_master_stylecreate");
if (query->lookup->cmdline[0] != 0) {
if (!short_form && printcmd) {
if (!short_form)
fputs(query->lookup->cmdline, stdout);
}
query->lookup->cmdline[0] = '\0';
query->lookup->cmdline[0]=0;
}
debug("printmessage(%s %s %s)", headers ? "headers" : "noheaders",
query->lookup->comments ? "comments" : "nocomments",
@@ -569,110 +526,13 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf,
result = isc_buffer_allocate(mctx, &buf, len);
check_result(result, "isc_buffer_allocate");
if (yaml) {
enum { Q = 0x1, R = 0x2 }; /* Q:query; R:ecursive */
unsigned int tflag = 0;
isc_sockaddr_t saddr;
char sockstr[ISC_SOCKADDR_FORMATSIZE];
uint16_t sport;
char *hash;
int pf;
printf("-\n");
printf(" type: MESSAGE\n");
printf(" message:\n");
if (isquery) {
tflag |= Q;
if ((msg->flags & DNS_MESSAGEFLAG_RD) != 0) {
tflag |= R;
}
} else if (((msg->flags & DNS_MESSAGEFLAG_RD) != 0) &&
((msg->flags & DNS_MESSAGEFLAG_RA) != 0))
{
tflag |= R;
}
if (tflag == (Q|R)) {
printf(" type: RECURSIVE_QUERY\n");
} else if (tflag == Q) {
printf(" type: AUTH_QUERY\n");
} else if (tflag == R) {
printf(" type: RECURSIVE_RESPONSE\n");
} else {
printf(" type: AUTH_RESPONSE\n");
}
if (!isc_time_isepoch(&query->time_sent)) {
char tbuf[100];
isc_time_formatISO8601ms(&query->time_sent,
tbuf, sizeof(tbuf));
printf(" query_time: !!timestamp %s\n", tbuf);
}
if (!isquery && !isc_time_isepoch(&query->time_recv)) {
char tbuf[100];
isc_time_formatISO8601ms(&query->time_recv,
tbuf, sizeof(tbuf));
printf(" response_time: !!timestamp %s\n", tbuf);
}
printf(" message_size: %ub\n",
isc_buffer_usedlength(msgbuf));
pf = isc_sockaddr_pf(&query->sockaddr);
if (pf == PF_INET || pf == PF_INET6) {
printf(" socket_family: %s\n",
pf == PF_INET ? "INET" : "INET6");
printf(" socket_protocol: %s\n",
query->lookup->tcp_mode ? "TCP" : "UDP");
sport = isc_sockaddr_getport(&query->sockaddr);
isc_sockaddr_format(&query->sockaddr,
sockstr, sizeof(sockstr));
hash = strchr(sockstr, '#');
if (hash != NULL) {
*hash = '\0';
}
if (strcmp(sockstr, "::") == 0) {
strlcat(sockstr, "0", sizeof(sockstr));
}
printf(" response_address: %s\n", sockstr);
printf(" response_port: %u\n", sport);
}
if (query->sock != NULL &&
isc_socket_getsockname(query->sock, &saddr)
== ISC_R_SUCCESS)
{
sport = isc_sockaddr_getport(&saddr);
isc_sockaddr_format(&saddr, sockstr, sizeof(sockstr));
hash = strchr(sockstr, '#');
if (hash != NULL) {
*hash = '\0';
}
if (strcmp(sockstr, "::") == 0) {
strlcat(sockstr, "0", sizeof(sockstr));
}
printf(" query_address: %s\n", sockstr);
printf(" query_port: %u\n", sport);
}
printf(" %s:\n", isquery ? "query_message_data"
: "response_message_data");
result = dns_message_headertotext(msg, style, flags, buf);
} else if (query->lookup->comments && !short_form) {
if (query->lookup->cmdline[0] != '\0' && printcmd) {
if (query->lookup->comments && !short_form) {
if (query->lookup->cmdline[0] != 0)
printf("; %s\n", query->lookup->cmdline);
}
if (msg == query->lookup->sendmsg) {
if (msg == query->lookup->sendmsg)
printf(";; Sending:\n");
} else {
else
printf(";; Got answer:\n");
}
if (headers) {
if (isdotlocal(msg)) {
@@ -817,9 +677,8 @@ buftoosmall:
}
}
if (headers && query->lookup->comments && !short_form && !yaml) {
if (headers && query->lookup->comments && !short_form)
printf("\n");
}
printf("%.*s", (int)isc_buffer_usedlength(buf),
(char *)isc_buffer_base(buf));
@@ -1603,7 +1462,7 @@ plus_option(char *option, bool is_batchfile,
lookup->trace = state;
lookup->trace_root = state;
if (state) {
lookup->recurse = true;
lookup->recurse = false;
lookup->identify = true;
lookup->comments = false;
lookup->rrcomments = 0;
@@ -1677,15 +1536,6 @@ plus_option(char *option, bool is_batchfile,
lookup->tcp_mode_set = true;
}
break;
case 'y': /* yaml */
FULLCHECK("yaml");
yaml = state;
if (state) {
printcmd = false;
lookup->stats = false;
lookup->rrcomments = -1;
}
break;
case 'z': /* zflag */
FULLCHECK("zflag");
lookup->zflag = state;
@@ -2398,37 +2248,8 @@ query_finished(void) {
}
}
static void
dig_error(const char *format, ...) {
va_list args;
if (yaml) {
printf("-\n");
printf(" type: DIG_ERROR\n");
/*
* Print an indent before a literal block quote.
* Note: this will break if used to print more than
* one line of text as only the first line would be
* indented.
*/
printf(" message: |\n");
printf(" ");
} else {
printf(";; ");
}
va_start(args, format);
vprintf(format, args);
va_end(args);
if (!yaml) {
printf("\n");
}
}
void
dig_setup(int argc, char **argv) {
void dig_setup(int argc, char **argv)
{
isc_result_t result;
ISC_LIST_INIT(lookup_list);
@@ -2442,7 +2263,6 @@ dig_setup(int argc, char **argv) {
dighost_received = received;
dighost_trying = trying;
dighost_shutdown = query_finished;
dighost_error = dig_error;
progname = argv[0];
preparse_args(argc, argv);
+15 -40
View File
@@ -593,11 +593,9 @@
<listitem>
<para>
Toggles the printing of the initial comment in the
output, identifying the version of <command>dig</command>
and the query options that have been applied. This option
always has global effect; it cannot be set globally
and then overridden on a per-lookup basis. The default
is to print this comment.
output identifying the version of <command>dig</command>
and the query options that have been applied. This
comment is printed by default.
</para>
</listitem>
</varlistentry>
@@ -606,18 +604,8 @@
<term><option>+[no]comments</option></term>
<listitem>
<para>
Toggles the display of some comment lines in the output,
containing information about the packet header and
OPT pseudosection, and the names of the response
section. The default is to print these comments.
</para>
<para>
Other types of comments in the output are not affected by
this option, but can be controlled using other command
line switches. These include <command>+[no]cmd</command>,
<command>+[no]question</command>,
<command>+[no]stats</command>, and
<command>+[no]rrcomments</command>.
Toggle the display of comment lines in the output.
The default is to print comments.
</para>
</listitem>
</varlistentry>
@@ -977,8 +965,8 @@
<term><option>+[no]qr</option></term>
<listitem>
<para>
Toggles the display of the query message as it is sent.
By default, the query is not printed.
Print [do not print] the query as it is sent. By
default, the query is not printed.
</para>
</listitem>
</varlistentry>
@@ -987,7 +975,7 @@
<term><option>+[no]question</option></term>
<listitem>
<para>
Toggles the display of the question section of a query
Print [do not print] the question section of a query
when an answer is returned. The default is to print
the question section as a comment.
</para>
@@ -1022,10 +1010,8 @@
in the query. This bit is set by default, which means
<command>dig</command> normally sends recursive
queries. Recursion is automatically disabled when
using the <parameter>+nssearch</parameter> option, and
when using <parameter>+trace</parameter> except for
an initial recursive query to get the list of root
servers.
the <parameter>+nssearch</parameter> or
<parameter>+trace</parameter> query options are used.
</para>
</listitem>
</varlistentry>
@@ -1078,9 +1064,7 @@
<listitem>
<para>
Provide a terse answer. The default is to print the
answer in a verbose form. This option always has global
effect; it cannot be set globally and then overridden on
a per-lookup basis.
answer in a verbose form.
</para>
</listitem>
</varlistentry>
@@ -1125,9 +1109,10 @@
<term><option>+[no]stats</option></term>
<listitem>
<para>
Toggles the printing of statistics: when the query was made,
the size of the reply and so on. The default behavior is to
print the query statistics as a comment after each lookup.
This query option toggles the printing of statistics:
when the query was made, the size of the reply and
so on. The default behavior is to print the query
statistics.
</para>
</listitem>
</varlistentry>
@@ -1292,16 +1277,6 @@
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]yaml</option></term>
<listitem>
<para>
Print the responses (and, if <option>+qr</option> is in use,
also the outgoing queries) in a detailed YAML format.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]zflag</option></term>
<listitem>
+15 -30
View File
@@ -481,28 +481,16 @@
<dd>
<p>
Toggles the printing of the initial comment in the
output, identifying the version of <span class="command"><strong>dig</strong></span>
and the query options that have been applied. This option
always has global effect; it cannot be set globally
and then overridden on a per-lookup basis. The default
is to print this comment.
output identifying the version of <span class="command"><strong>dig</strong></span>
and the query options that have been applied. This
comment is printed by default.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]comments</code></span></dt>
<dd>
<p>
Toggles the display of some comment lines in the output,
containing information about the packet header and
OPT pseudosection, and the names of the response
section. The default is to print these comments.
</p>
<p>
Other types of comments in the output are not affected by
this option, but can be controlled using other command
line switches. These include <span class="command"><strong>+[no]cmd</strong></span>,
<span class="command"><strong>+[no]question</strong></span>,
<span class="command"><strong>+[no]stats</strong></span>, and
<span class="command"><strong>+[no]rrcomments</strong></span>.
Toggle the display of comment lines in the output.
The default is to print comments.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]cookie[<span class="optional">=####</span>]</code></span></dt>
@@ -776,14 +764,14 @@
<dt><span class="term"><code class="option">+[no]qr</code></span></dt>
<dd>
<p>
Toggles the display of the query message as it is sent.
By default, the query is not printed.
Print [do not print] the query as it is sent. By
default, the query is not printed.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]question</code></span></dt>
<dd>
<p>
Toggles the display of the question section of a query
Print [do not print] the question section of a query
when an answer is returned. The default is to print
the question section as a comment.
</p>
@@ -809,10 +797,8 @@
in the query. This bit is set by default, which means
<span class="command"><strong>dig</strong></span> normally sends recursive
queries. Recursion is automatically disabled when
using the <em class="parameter"><code>+nssearch</code></em> option, and
when using <em class="parameter"><code>+trace</code></em> except for
an initial recursive query to get the list of root
servers.
the <em class="parameter"><code>+nssearch</code></em> or
<em class="parameter"><code>+trace</code></em> query options are used.
</p>
</dd>
<dt><span class="term"><code class="option">+retry=T</code></span></dt>
@@ -853,9 +839,7 @@
<dd>
<p>
Provide a terse answer. The default is to print the
answer in a verbose form. This option always has global
effect; it cannot be set globally and then overridden on
a per-lookup basis.
answer in a verbose form.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]showsearch</code></span></dt>
@@ -888,9 +872,10 @@
<dt><span class="term"><code class="option">+[no]stats</code></span></dt>
<dd>
<p>
Toggles the printing of statistics: when the query was made,
the size of the reply and so on. The default behavior is to
print the query statistics as a comment after each lookup.
This query option toggles the printing of statistics:
when the query was made, the size of the reply and
so on. The default behavior is to print the query
statistics.
</p>
</dd>
<dt><span class="term"><code class="option">+[no]subnet=addr[/prefix-length]</code></span></dt>
+57 -55
View File
@@ -193,15 +193,11 @@ dig_lookup_t *current_lookup = NULL;
/* dynamic callbacks */
isc_result_t
(*dighost_printmessage)(dig_query_t *query, const isc_buffer_t *msgbuf,
dns_message_t *msg, bool headers);
(*dighost_printmessage)(dig_query_t *query, dns_message_t *msg,
bool headers);
void
(*dighost_error)(const char *format, ...);
void
(*dighost_received)(unsigned int bytes, isc_sockaddr_t *from,
dig_query_t *query);
(*dighost_received)(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query);
void
(*dighost_trying)(char *frm, dig_lookup_t *lookup);
@@ -450,6 +446,9 @@ make_server(const char *servname, const char *userarg) {
debug("make_server(%s)", servname);
srv = isc_mem_allocate(mctx, sizeof(struct dig_server));
if (srv == NULL)
fatal("memory allocation failure in %s:%d",
__FILE__, __LINE__);
strlcpy(srv->servername, servname, MXNAME);
strlcpy(srv->userarg, userarg, MXNAME);
ISC_LINK_INIT(srv, link);
@@ -577,6 +576,9 @@ make_empty_lookup(void) {
INSIST(!free_now);
looknew = isc_mem_allocate(mctx, sizeof(struct dig_lookup));
if (looknew == NULL)
fatal("memory allocation failure in %s:%d",
__FILE__, __LINE__);
looknew->pending = true;
looknew->textname[0] = 0;
looknew->cmdline[0] = 0;
@@ -679,6 +681,8 @@ cloneopts(dig_lookup_t *looknew, dig_lookup_t *lookold) {
size_t len = sizeof(looknew->ednsopts[0]) * EDNSOPT_OPTIONS;
size_t i;
looknew->ednsopts = isc_mem_allocate(mctx, len);
if (looknew->ednsopts == NULL)
fatal("out of memory");
for (i = 0; i < EDNSOPT_OPTIONS; i++) {
looknew->ednsopts[i].code = 0;
looknew->ednsopts[i].length = 0;
@@ -692,8 +696,10 @@ cloneopts(dig_lookup_t *looknew, dig_lookup_t *lookold) {
len = lookold->ednsopts[i].length;
if (len != 0) {
INSIST(lookold->ednsopts[i].value != NULL);
looknew->ednsopts[i].value = isc_mem_allocate(mctx,
len);
looknew->ednsopts[i].value =
isc_mem_allocate(mctx, len);
if (looknew->ednsopts[i].value == NULL)
fatal("out of memory");
memmove(looknew->ednsopts[i].value,
lookold->ednsopts[i].value, len);
}
@@ -799,6 +805,8 @@ clone_lookup(dig_lookup_t *lookold, bool servers) {
if (lookold->ecs_addr != NULL) {
size_t len = sizeof(isc_sockaddr_t);
looknew->ecs_addr = isc_mem_allocate(mctx, len);
if (looknew->ecs_addr == NULL)
fatal("out of memory");
memmove(looknew->ecs_addr, lookold->ecs_addr, len);
}
@@ -857,6 +865,9 @@ setup_text_key(void) {
isc_buffer_putstr(namebuf, keynametext);
secretsize = (unsigned int) strlen(keysecret) * 3 / 4;
secretstore = isc_mem_allocate(mctx, secretsize);
if (secretstore == NULL)
fatal("memory allocation failure in %s:%d",
__FILE__, __LINE__);
isc_buffer_init(&secretbuf, secretstore, secretsize);
result = isc_base64_decodestring(keysecret, &secretbuf);
if (result != ISC_R_SUCCESS)
@@ -946,6 +957,8 @@ parse_netprefix(isc_sockaddr_t **sap, const char *value) {
fatal("invalid prefix '%s'\n", value);
sa = isc_mem_allocate(mctx, sizeof(*sa));
if (sa == NULL)
fatal("out of memory");
memset(sa, 0, sizeof(*sa));
if (strcmp(buf, "0") == 0) {
@@ -1177,6 +1190,9 @@ static dig_searchlist_t *
make_searchlist_entry(char *domain) {
dig_searchlist_t *search;
search = isc_mem_allocate(mctx, sizeof(*search));
if (search == NULL)
fatal("memory allocation failure in %s:%d",
__FILE__, __LINE__);
strlcpy(search->origin, domain, MXNAME);
search->origin[MXNAME-1] = 0;
ISC_LINK_INIT(search, link);
@@ -1383,7 +1399,6 @@ typedef struct dig_ednsoptname {
} dig_ednsoptname_t;
dig_ednsoptname_t optnames[] = {
{ 1, "LLQ" }, /* draft-sekar-dns-llq */
{ 3, "NSID" }, /* RFC 5001 */
{ 5, "DAU" }, /* RFC 6975 */
{ 6, "DHU" }, /* RFC 6975 */
@@ -1441,7 +1456,9 @@ save_opt(dig_lookup_t *lookup, char *code, char *value) {
if (value != NULL) {
char *buf;
buf = isc_mem_allocate(mctx, strlen(value) / 2 + 1);
buf = isc_mem_allocate(mctx, strlen(value)/2 + 1);
if (buf == NULL)
fatal("out of memory");
isc_buffer_init(&b, buf, (unsigned int) strlen(value)/2 + 1);
result = isc_hex_decodestring(value, &b);
check_result(result, "isc_hex_decodestring");
@@ -2174,14 +2191,12 @@ setup_lookup(dig_lookup_t *lookup) {
lookup->sendmsg->id = (dns_messageid_t)isc_random16();
lookup->sendmsg->opcode = lookup->opcode;
lookup->msgcounter = 0;
/*
* If this is a trace request, completely disallow recursion after
* looking up the root name servers, since it's meaningless for traces.
* If this is a trace request, completely disallow recursion, since
* it's meaningless for traces.
*/
if ((lookup->trace || lookup->ns_search_only) && !lookup->trace_root) {
if (lookup->trace || (lookup->ns_search_only && !lookup->trace_root))
lookup->recurse = false;
}
if (lookup->recurse &&
lookup->rdtype != dns_rdatatype_axfr &&
@@ -2472,6 +2487,10 @@ setup_lookup(dig_lookup_t *lookup) {
serv = ISC_LIST_NEXT(serv, link))
{
query = isc_mem_allocate(mctx, sizeof(dig_query_t));
if (query == NULL) {
fatal("memory allocation failure in %s:%d",
__FILE__, __LINE__);
}
debug("create query %p linked to lookup %p", query, lookup);
query->lookup = lookup;
query->timer = NULL;
@@ -2506,9 +2525,6 @@ setup_lookup(dig_lookup_t *lookup) {
COMMSIZE);
query->sendbuf = lookup->renderbuf;
isc_time_settoepoch(&query->time_sent);
isc_time_settoepoch(&query->time_recv);
ISC_LINK_INIT(query, clink);
ISC_LINK_INIT(query, link);
@@ -2517,6 +2533,16 @@ setup_lookup(dig_lookup_t *lookup) {
ISC_LIST_ENQUEUE(lookup->q, query, link);
}
/* XXX qrflag, print_query, etc... */
if (!ISC_LIST_EMPTY(lookup->q) && lookup->qr) {
extrabytes = 0;
dighost_printmessage(ISC_LIST_HEAD(lookup->q),
lookup->sendmsg, true);
if (lookup->stats) {
printf(";; QUERY SIZE: %u\n\n",
isc_buffer_usedlength(&lookup->renderbuf));
}
}
return (true);
}
@@ -2854,18 +2880,6 @@ send_udp(dig_query_t *query) {
sevent, ISC_SOCKFLAG_NORETRY);
check_result(result, "isc_socket_sendto2");
sendcount++;
/* XXX qrflag, print_query, etc... */
if (!ISC_LIST_EMPTY(query->lookup->q) && query->lookup->qr) {
extrabytes = 0;
dighost_printmessage(ISC_LIST_HEAD(query->lookup->q),
&query->lookup->renderbuf,
query->lookup->sendmsg, true);
if (query->lookup->stats) {
printf(";; QUERY SIZE: %u\n\n",
isc_buffer_usedlength(&query->lookup->renderbuf));
}
}
}
/*%
@@ -2965,11 +2979,11 @@ connect_timeout(isc_task_t *task, isc_event_t *event) {
isc_netaddr_fromsockaddr(&netaddr, &query->sockaddr);
isc_netaddr_format(&netaddr, buf, sizeof(buf));
dighost_error("no response from %s\n", buf);
printf(";; no response from %s\n", buf);
} else {
fputs(l->cmdline, stdout);
dighost_error("connection timed out; "
"no servers could be reached\n");
printf(";; connection timed out; no servers could be "
"reached\n");
}
cancel_lookup(l);
check_next_lookup(l);
@@ -3041,8 +3055,8 @@ tcp_length_done(isc_task_t *task, isc_event_t *event) {
char sockstr[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(&query->sockaddr, sockstr,
sizeof(sockstr));
dighost_error("communications error to %s: %s\n",
sockstr, isc_result_totext(sevent->result));
printf(";; communications error to %s: %s\n",
sockstr, isc_result_totext(sevent->result));
if (keep != NULL)
isc_socket_detach(&keep);
l = query->lookup;
@@ -3141,19 +3155,6 @@ launch_next_query(dig_query_t *query, bool include_question) {
check_result(result, "isc_socket_send");
sendcount++;
debug("sendcount=%d", sendcount);
/* XXX qrflag, print_query, etc... */
if (!ISC_LIST_EMPTY(query->lookup->q) && query->lookup->qr) {
extrabytes = 0;
dighost_printmessage(ISC_LIST_HEAD(query->lookup->q),
&query->lookup->renderbuf,
query->lookup->sendmsg, true);
if (query->lookup->stats) {
printf(";; QUERY SIZE: %u\n\n",
isc_buffer_usedlength(
&query->lookup->renderbuf));
}
}
}
query->waiting_connect = false;
#if 0
@@ -3528,6 +3529,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
query = event->ev_arg;
TIME_NOW(&query->time_recv);
debug("lookup=%p, query=%p", query->lookup, query);
l = query->lookup;
@@ -3556,8 +3558,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
debug("in recv cancel handler");
query->waiting_connect = false;
} else {
dighost_error("communications error: %s\n",
isc_result_totext(sevent->result));
printf(";; communications error: %s\n",
isc_result_totext(sevent->result));
if (keep != NULL)
isc_socket_detach(&keep);
isc_socket_detach(&query->sock);
@@ -3908,19 +3910,19 @@ recv_done(isc_task_t *task, isc_event_t *event) {
if (msg->rcode == dns_rcode_nxdomain &&
(l->origin != NULL || l->need_search)) {
if (!next_origin(query->lookup) || showsearch) {
dighost_printmessage(query, &b, msg, true);
dighost_printmessage(query, msg, true);
dighost_received(isc_buffer_usedlength(&b),
&sevent->address, query);
}
} else if (!l->trace && !l->ns_search_only) {
dighost_printmessage(query, &b, msg, true);
dighost_printmessage(query, msg, true);
} else if (l->trace) {
int nl = 0;
int count = msg->counts[DNS_SECTION_ANSWER];
debug("in TRACE code");
if (!l->ns_search_only)
dighost_printmessage(query, &b, msg, true);
dighost_printmessage(query, msg, true);
l->rdtype = l->qrdtype;
if (l->trace_root || (l->ns_search_only && count > 0)) {
@@ -3951,7 +3953,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
l->trace_root = false;
usesearch = false;
} else {
dighost_printmessage(query, &b, msg, true);
dighost_printmessage(query, msg, true);
}
}
}
+1 -16
View File
@@ -400,16 +400,13 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
}
static isc_result_t
printmessage(dig_query_t *query, const isc_buffer_t *msgbuf,
dns_message_t *msg, bool headers)
{
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
bool did_flag = false;
dns_rdataset_t *opt, *tsig = NULL;
const dns_name_t *tsigname;
isc_result_t result = ISC_R_SUCCESS;
int force_error;
UNUSED(msgbuf);
UNUSED(headers);
/*
@@ -857,17 +854,6 @@ parse_args(bool is_batchfile, int argc, char **argv) {
ISC_LIST_APPEND(lookup_list, lookup, link);
}
static void
host_error(const char *format, ...) {
va_list args;
printf(";; ");
va_start(args, format);
vfprintf(stdout, format, args);
va_end(args);
printf("\n");
}
int
main(int argc, char **argv) {
isc_result_t result;
@@ -885,7 +871,6 @@ main(int argc, char **argv) {
dighost_received = received;
dighost_trying = trying;
dighost_shutdown = host_shutdown;
dighost_error = host_error;
debug("main()");
progname = argv[0];
+2 -11
View File
@@ -380,22 +380,13 @@ set_search_domain(char *domain);
* then assigned to the appropriate function pointer
*/
extern isc_result_t
(*dighost_printmessage)(dig_query_t *query, const isc_buffer_t *msgbuf,
dns_message_t *msg, bool headers);
/*
* Print an error message in the appropriate format.
*/
extern void
(*dighost_error)(const char *format, ...);
(*dighost_printmessage)(dig_query_t *query, dns_message_t *msg, bool headers);
/*%<
* Print the final result of the lookup.
*/
extern void
(*dighost_received)(unsigned int bytes, isc_sockaddr_t *from,
dig_query_t *query);
(*dighost_received)(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query);
/*%<
* Print a message about where and when the response
* was received from, like the final comment in the
+4 -19
View File
@@ -429,21 +429,16 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
}
static isc_result_t
printmessage(dig_query_t *query, const isc_buffer_t *msgbuf,
dns_message_t *msg, bool headers)
{
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
char servtext[ISC_SOCKADDR_FORMATSIZE];
UNUSED(msgbuf);
/* I've we've gotten this far, we've reached a server. */
query_error = 0;
debug("printmessage()");
if(!default_lookups || query->lookup->rdtype == dns_rdatatype_a) {
isc_sockaddr_format(&query->sockaddr, servtext,
sizeof(servtext));
isc_sockaddr_format(&query->sockaddr, servtext, sizeof(servtext));
printf("Server:\t\t%s\n", query->userarg);
printf("Address:\t%s\n", servtext);
@@ -855,6 +850,8 @@ get_next_command(void) {
fflush(stdout);
buf = isc_mem_allocate(mctx, COMMSIZE);
if (buf == NULL)
fatal("memory allocation failure");
isc_app_block();
if (interactive) {
#ifdef HAVE_READLINE
@@ -983,17 +980,6 @@ getinput(isc_task_t *task, isc_event_t *event) {
isc_app_shutdown();
}
static void
nsl_error(const char *format, ...) {
va_list args;
printf(";; ");
va_start(args, format);
vfprintf(stdout, format, args);
va_end(args);
printf("\n");
}
int
main(int argc, char **argv) {
isc_result_t result;
@@ -1011,7 +997,6 @@ main(int argc, char **argv) {
dighost_received = received;
dighost_trying = trying;
dighost_shutdown = query_finished;
dighost_error = nsl_error;
result = isc_app_start();
check_result(result, "isc_app_start");
+4 -5
View File
@@ -15,15 +15,14 @@ VERSION=@BIND9_VERSION@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} \
${OPENSSL_CFLAGS}
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@
CDEFINES = -DVERSION=\"${VERSION}\"
CWARNINGS =
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
+23
View File
@@ -530,6 +530,9 @@ match_keyset_dsset(dns_rdataset_t *keyset, dns_rdataset_t *dsset,
nkey = dns_rdataset_count(keyset);
keytable = isc_mem_get(mctx, sizeof(keyinfo_t) * nkey);
if (keytable == NULL) {
fatal("out of memory");
}
for (result = dns_rdataset_first(keyset), i = 0;
result == ISC_R_SUCCESS;
@@ -607,6 +610,10 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
int i;
algo = isc_mem_get(mctx, nkey);
if (algo == NULL) {
fatal("allocating RRSIG/DNSKEY match list: %s",
isc_result_totext(ISC_R_NOMEMORY));
}
memset(algo, 0, nkey);
for (result = dns_rdataset_first(sigset);
@@ -740,6 +747,10 @@ rdata_get(void) {
dns_rdata_t *rdata;
rdata = isc_mem_get(mctx, sizeof(*rdata));
if (rdata == NULL) {
fatal("allocating DS rdata: %s",
isc_result_totext(ISC_R_NOMEMORY));
}
dns_rdata_init(rdata);
return (rdata);
@@ -824,6 +835,10 @@ make_new_ds_set(ds_maker_func_t *ds_from_rdata,
dns_rdatalist_t *dslist;
dslist = isc_mem_get(mctx, sizeof(*dslist));
if (dslist == NULL) {
fatal("allocating new DS list: %s",
isc_result_totext(ISC_R_NOMEMORY));
}
dns_rdatalist_init(dslist);
dslist->rdclass = rdclass;
@@ -892,6 +907,10 @@ consistent_digests(dns_rdataset_t *dsset) {
n = dns_rdataset_count(dsset);
arrdata = isc_mem_get(mctx, n * sizeof(dns_rdata_t));
if (arrdata == NULL) {
fatal("allocating DS rdata array: %s",
isc_result_totext(ISC_R_NOMEMORY));
}
for (result = dns_rdataset_first(dsset), i = 0;
result == ISC_R_SUCCESS;
@@ -907,6 +926,10 @@ consistent_digests(dns_rdataset_t *dsset) {
* Convert sorted arrdata to more accessible format
*/
ds = isc_mem_get(mctx, n * sizeof(dns_rdata_ds_t));
if (ds == NULL) {
fatal("allocating unpacked DS array: %s",
isc_result_totext(ISC_R_NOMEMORY));
}
for (i = 0; i < n; i++) {
result = dns_rdata_tostruct(&arrdata[i], &ds[i], NULL);
+18 -3
View File
@@ -50,9 +50,11 @@ dnssec-dsfromkey \- DNSSEC DS RR generation tool
.PP
The
\fBdnssec\-dsfromkey\fR
command outputs DS (Delegation Signer) resource records (RRs), or CDS (Child DS) RRs with the
command outputs DS (Delegation Signer) resource records (RRs) and other similarly\-constructed RRs: with the
\fB\-l\fR
option it outputs DLV (DNSSEC Lookaside Validation) RRs; or with the
\fB\-C\fR
option\&.
it outputs CDS (Child DS) RRs\&.
.PP
The input keys can be specified in a number of ways:
.PP
@@ -117,7 +119,9 @@ zone file mode\&.
.PP
\-C
.RS 4
Generate CDS records rather than DS records\&.
Generate CDS records rather than DS records\&. This is mutually exclusive with the
\fB\-l\fR
option for generating DLV records\&.
.RE
.PP
\-f \fIfile\fR
@@ -152,6 +156,15 @@ files in
\fBdirectory\fR\&.
.RE
.PP
\-l \fIdomain\fR
.RS 4
Generate a DLV set instead of a DS set\&. The specified
\fIdomain\fR
is appended to the name for each record in the set\&. This is mutually exclusive with the
\fB\-C\fR
option for generating CDS records\&.
.RE
.PP
\-s
.RS 4
Keyset mode:
@@ -211,6 +224,8 @@ A keyfile error can give a "file not found" even if the file exists\&.
BIND 9 Administrator Reference Manual,
RFC 3658
(DS RRs),
RFC 4431
(DLV RRs),
RFC 4509
(SHA\-256 for DS RRs),
RFC 6605
+40 -13
View File
@@ -208,7 +208,8 @@ loadkey(char *filename, unsigned char *key_buf, unsigned int key_buf_size,
}
static void
logkey(dns_rdata_t *rdata) {
logkey(dns_rdata_t *rdata)
{
isc_result_t result;
dst_key_t *key = NULL;
isc_buffer_t buf;
@@ -227,7 +228,9 @@ logkey(dns_rdata_t *rdata) {
}
static void
emit(dns_dsdigest_t dt, bool showall, bool cds, dns_rdata_t *rdata) {
emit(dns_dsdigest_t dt, bool showall, char *lookaside,
bool cds, dns_rdata_t *rdata)
{
isc_result_t result;
unsigned char buf[DNS_DS_BUFFERSIZE];
char text_buf[DST_KEY_MAXTEXTSIZE];
@@ -259,6 +262,18 @@ emit(dns_dsdigest_t dt, bool showall, bool cds, dns_rdata_t *rdata) {
if (result != ISC_R_SUCCESS)
fatal("can't print name");
/* Add lookaside origin, if set */
if (lookaside != NULL) {
if (isc_buffer_availablelength(&nameb) < strlen(lookaside))
fatal("DLV origin '%s' is too long", lookaside);
isc_buffer_putstr(&nameb, lookaside);
if (lookaside[strlen(lookaside) - 1] != '.') {
if (isc_buffer_availablelength(&nameb) < 1)
fatal("DLV origin '%s' is too long", lookaside);
isc_buffer_putstr(&nameb, ".");
}
}
result = dns_rdata_tofmttext(&ds, (dns_name_t *) NULL, 0, 0, 0, "",
&textb);
@@ -278,24 +293,26 @@ emit(dns_dsdigest_t dt, bool showall, bool cds, dns_rdata_t *rdata) {
isc_buffer_usedregion(&classb, &r);
printf("%.*s", (int)r.length, r.base);
if (cds) {
printf(" CDS ");
} else {
printf(" DS ");
}
if (lookaside == NULL) {
if (cds)
printf(" CDS ");
else
printf(" DS ");
} else
printf(" DLV ");
isc_buffer_usedregion(&textb, &r);
printf("%.*s\n", (int)r.length, r.base);
}
static void
emits(bool showall, bool cds, dns_rdata_t *rdata) {
emits(bool showall, char *lookaside, bool cds, dns_rdata_t *rdata) {
unsigned i, n;
n = sizeof(dtype)/sizeof(dtype[0]);
for (i = 0; i < n; i++) {
if (dtype[i] != 0) {
emit(dtype[i], showall, cds, rdata);
emit(dtype[i], showall, lookaside, cds, rdata);
}
}
}
@@ -321,11 +338,12 @@ usage(void) {
" -f zonefile: read keys from a zone file\n"
" -h: print help information\n"
" -K directory: where to find key or keyset files\n"
" -l zone: print DLV records in the given lookaside zone\n"
" -s: read keys from keyset-<dnsname> file\n"
" -T: TTL of output records (omitted by default)\n"
" -v level: verbosity\n"
" -V: print version information\n");
fprintf(stderr, "Output: DS or CDS RRs\n");
fprintf(stderr, "Output: DS, DLV, or CDS RRs\n");
exit (-1);
}
@@ -334,6 +352,7 @@ int
main(int argc, char **argv) {
char *classname = NULL;
char *filename = NULL, *dir = NULL, *namestr;
char *lookaside = NULL;
char *endp;
int ch;
bool cds = false;
@@ -378,6 +397,9 @@ main(int argc, char **argv) {
add_dtype(strtodsdigest(isc_commandline_argument));
break;
case 'C':
if (lookaside != NULL)
fatal("lookaside and CDS are mutually"
" exclusive");
cds = true;
break;
case 'c':
@@ -396,7 +418,12 @@ main(int argc, char **argv) {
filename = isc_commandline_argument;
break;
case 'l':
fatal("-l option (DLV lookaside) is obsolete");
if (cds)
fatal("lookaside and CDS are mutually"
" exclusive");
lookaside = isc_commandline_argument;
if (strlen(lookaside) == 0U)
fatal("lookaside must be a non-empty string");
break;
case 's':
usekeyset = true;
@@ -501,7 +528,7 @@ main(int argc, char **argv) {
logkey(&rdata);
}
emits(showall, cds, &rdata);
emits(showall, lookaside, cds, &rdata);
}
} else {
unsigned char key_buf[DST_KEY_MAXSIZE];
@@ -509,7 +536,7 @@ main(int argc, char **argv) {
loadkey(argv[isc_commandline_index], key_buf,
DST_KEY_MAXSIZE, &rdata);
emits(showall, cds, &rdata);
emits(showall, lookaside, cds, &rdata);
}
if (dns_rdataset_isassociated(&rdataset)) {
+21 -3
View File
@@ -112,8 +112,10 @@
<para>
The <command>dnssec-dsfromkey</command> command outputs DS (Delegation
Signer) resource records (RRs), or CDS (Child DS) RRs with the
<option>-C</option> option.
Signer) resource records (RRs) and other similarly-constructed RRs:
with the <option>-l</option> option it outputs DLV (DNSSEC Lookaside
Validation) RRs; or with the <option>-C</option> it outputs CDS (Child
DS) RRs.
</para>
<para>
@@ -210,7 +212,9 @@
<term>-C</term>
<listitem>
<para>
Generate CDS records rather than DS records.
Generate CDS records rather than DS records. This is mutually
exclusive with the <option>-l</option> option for generating DLV
records.
</para>
</listitem>
</varlistentry>
@@ -256,6 +260,19 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-l <replaceable class="parameter">domain</replaceable></term>
<listitem>
<para>
Generate a DLV set instead of a DS set. The specified
<replaceable>domain</replaceable> is appended to the name for each
record in the set.
This is mutually exclusive with the <option>-C</option> option
for generating CDS records.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-s</term>
<listitem>
@@ -345,6 +362,7 @@
</citerefentry>,
<citetitle>BIND 9 Administrator Reference Manual</citetitle>,
<citetitle>RFC 3658</citetitle> (DS RRs),
<citetitle>RFC 4431</citetitle> (DLV RRs),
<citetitle>RFC 4509</citetitle> (SHA-256 for DS RRs),
<citetitle>RFC 6605</citetitle> (SHA-384 for DS RRs),
<citetitle>RFC 7344</citetitle> (CDS and CDNSKEY RRs).
+18 -3
View File
@@ -97,8 +97,10 @@
<p>
The <span class="command"><strong>dnssec-dsfromkey</strong></span> command outputs DS (Delegation
Signer) resource records (RRs), or CDS (Child DS) RRs with the
<code class="option">-C</code> option.
Signer) resource records (RRs) and other similarly-constructed RRs:
with the <code class="option">-l</code> option it outputs DLV (DNSSEC Lookaside
Validation) RRs; or with the <code class="option">-C</code> it outputs CDS (Child
DS) RRs.
</p>
<p>
@@ -180,7 +182,9 @@
<dt><span class="term">-C</span></dt>
<dd>
<p>
Generate CDS records rather than DS records.
Generate CDS records rather than DS records. This is mutually
exclusive with the <code class="option">-l</code> option for generating DLV
records.
</p>
</dd>
<dt><span class="term">-f <em class="replaceable"><code>file</code></em></span></dt>
@@ -215,6 +219,16 @@
<code class="option">directory</code>.
</p>
</dd>
<dt><span class="term">-l <em class="replaceable"><code>domain</code></em></span></dt>
<dd>
<p>
Generate a DLV set instead of a DS set. The specified
<em class="replaceable"><code>domain</code></em> is appended to the name for each
record in the set.
This is mutually exclusive with the <code class="option">-C</code> option
for generating CDS records.
</p>
</dd>
<dt><span class="term">-s</span></dt>
<dd>
<p>
@@ -297,6 +311,7 @@
</span>,
<em class="citetitle">BIND 9 Administrator Reference Manual</em>,
<em class="citetitle">RFC 3658</em> (DS RRs),
<em class="citetitle">RFC 4431</em> (DLV RRs),
<em class="citetitle">RFC 4509</em> (SHA-256 for DS RRs),
<em class="citetitle">RFC 6605</em> (SHA-384 for DS RRs),
<em class="citetitle">RFC 7344</em> (CDS and CDNSKEY RRs).
+2
View File
@@ -368,6 +368,8 @@ main(int argc, char **argv) {
len = strlen(label) + 8;
l = isc_mem_allocate(mctx, len);
if (l == NULL)
fatal("cannot allocate memory");
snprintf(l, len, "pkcs11:%s", label);
isc_mem_free(mctx, label);
label = l;
+2 -1
View File
@@ -92,7 +92,8 @@ to generate TSIG keys\&.
.RS 4
Specifies the number of bits in the key\&. The choice of key size depends on the algorithm used\&. RSA keys must be between 1024 and 4096 bits\&. Diffie Hellman keys must be between 128 and 4096 bits\&. Elliptic curve algorithms don\*(Aqt need this parameter\&.
.sp
If the key size is not specified, some algorithms have pre\-defined defaults\&. For instance, RSA keys have a default size of 2048 bits\&.
If the key size is not specified, some algorithms have pre\-defined defaults\&. For example, RSA keys for use as DNSSEC zone signing keys have a default size of 1024 bits; RSA keys for use as key signing keys (KSKs, generated with
\fB\-f KSK\fR) default to 2048 bits\&.
.RE
.PP
\-C
+6 -1
View File
@@ -218,6 +218,7 @@ main(int argc, char **argv) {
bool unsetrev = false, unsetinact = false;
bool unsetdel = false;
bool genonly = false;
bool quiet = false;
bool show_progress = false;
unsigned char c;
isc_stdtime_t syncadd = 0, syncdel = 0;
@@ -553,7 +554,11 @@ main(int argc, char **argv) {
case DST_ALG_NSEC3RSASHA1:
case DST_ALG_RSASHA256:
case DST_ALG_RSASHA512:
size = 2048;
if ((kskflag & DNS_KEYFLAG_KSK) != 0) {
size = 2048;
} else {
size = 1024;
}
if (verbose > 0) {
fprintf(stderr, "key size not "
"specified; defaulting"
+4 -2
View File
@@ -176,8 +176,10 @@
</para>
<para>
If the key size is not specified, some algorithms have
pre-defined defaults. For instance, RSA keys have a default
size of 2048 bits.
pre-defined defaults. For example, RSA keys for use as
DNSSEC zone signing keys have a default size of 1024 bits;
RSA keys for use as key signing keys (KSKs, generated with
<option>-f KSK</option>) default to 2048 bits.
</para>
</listitem>
</varlistentry>
+4 -2
View File
@@ -145,8 +145,10 @@
</p>
<p>
If the key size is not specified, some algorithms have
pre-defined defaults. For instance, RSA keys have a default
size of 2048 bits.
pre-defined defaults. For example, RSA keys for use as
DNSSEC zone signing keys have a default size of 1024 bits;
RSA keys for use as key signing keys (KSKs, generated with
<code class="option">-f KSK</code>) default to 2048 bits.
</p>
</dd>
<dt><span class="term">-C</span></dt>
+4
View File
@@ -113,6 +113,10 @@ main(int argc, char **argv) {
* simplify cleanup later
*/
dir = isc_mem_strdup(mctx, isc_commandline_argument);
if (dir == NULL) {
fatal("Failed to allocate memory for "
"directory");
}
break;
case 'r':
removefile = true;
+4
View File
@@ -253,6 +253,10 @@ main(int argc, char **argv) {
*/
directory = isc_mem_strdup(mctx,
isc_commandline_argument);
if (directory == NULL) {
fatal("Failed to allocate memory for "
"directory");
}
break;
case 'L':
ttl = strtottl(isc_commandline_argument);
+6 -8
View File
@@ -39,7 +39,7 @@
dnssec-signzone \- DNSSEC zone signing tool
.SH "SYNOPSIS"
.HP \w'\fBdnssec\-signzone\fR\ 'u
\fBdnssec\-signzone\fR [\fB\-a\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-d\ \fR\fB\fIdirectory\fR\fR] [\fB\-D\fR] [\fB\-E\ \fR\fB\fIengine\fR\fR] [\fB\-e\ \fR\fB\fIend\-time\fR\fR] [\fB\-f\ \fR\fB\fIoutput\-file\fR\fR] [\fB\-g\fR] [\fB\-h\fR] [\fB\-i\ \fR\fB\fIinterval\fR\fR] [\fB\-I\ \fR\fB\fIinput\-format\fR\fR] [\fB\-j\ \fR\fB\fIjitter\fR\fR] [\fB\-K\ \fR\fB\fIdirectory\fR\fR] [\fB\-k\ \fR\fB\fIkey\fR\fR] [\fB\-L\ \fR\fB\fIserial\fR\fR] [\fB\-l\ \fR\fB\fIdomain\fR\fR] [\fB\-M\ \fR\fB\fImaxttl\fR\fR] [\fB\-N\ \fR\fB\fIsoa\-serial\-format\fR\fR] [\fB\-o\ \fR\fB\fIorigin\fR\fR] [\fB\-O\ \fR\fB\fIoutput\-format\fR\fR] [\fB\-P\fR] [\fB\-Q\fR] [\fB\-q\fR] [\fB\-R\fR] [\fB\-S\fR] [\fB\-s\ \fR\fB\fIstart\-time\fR\fR] [\fB\-T\ \fR\fB\fIttl\fR\fR] [\fB\-t\fR] [\fB\-u\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-V\fR] [\fB\-X\ \fR\fB\fIextended\ end\-time\fR\fR] [\fB\-x\fR] [\fB\-z\fR] [\fB\-3\ \fR\fB\fIsalt\fR\fR] [\fB\-H\ \fR\fB\fIiterations\fR\fR] [\fB\-A\fR] {zonefile} [key...]
\fBdnssec\-signzone\fR [\fB\-a\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-d\ \fR\fB\fIdirectory\fR\fR] [\fB\-D\fR] [\fB\-E\ \fR\fB\fIengine\fR\fR] [\fB\-e\ \fR\fB\fIend\-time\fR\fR] [\fB\-f\ \fR\fB\fIoutput\-file\fR\fR] [\fB\-g\fR] [\fB\-h\fR] [\fB\-i\ \fR\fB\fIinterval\fR\fR] [\fB\-I\ \fR\fB\fIinput\-format\fR\fR] [\fB\-j\ \fR\fB\fIjitter\fR\fR] [\fB\-K\ \fR\fB\fIdirectory\fR\fR] [\fB\-k\ \fR\fB\fIkey\fR\fR] [\fB\-L\ \fR\fB\fIserial\fR\fR] [\fB\-l\ \fR\fB\fIdomain\fR\fR] [\fB\-M\ \fR\fB\fImaxttl\fR\fR] [\fB\-N\ \fR\fB\fIsoa\-serial\-format\fR\fR] [\fB\-o\ \fR\fB\fIorigin\fR\fR] [\fB\-O\ \fR\fB\fIoutput\-format\fR\fR] [\fB\-P\fR] [\fB\-Q\fR] [\fB\-R\fR] [\fB\-S\fR] [\fB\-s\ \fR\fB\fIstart\-time\fR\fR] [\fB\-T\ \fR\fB\fIttl\fR\fR] [\fB\-t\fR] [\fB\-u\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-V\fR] [\fB\-X\ \fR\fB\fIextended\ end\-time\fR\fR] [\fB\-x\fR] [\fB\-z\fR] [\fB\-3\ \fR\fB\fIsalt\fR\fR] [\fB\-H\ \fR\fB\fIiterations\fR\fR] [\fB\-A\fR] {zonefile} [key...]
.SH "DESCRIPTION"
.PP
\fBdnssec\-signzone\fR
@@ -113,6 +113,11 @@ Key repository: Specify a directory to search for DNSSEC keys\&. If not specifie
Treat specified key as a key signing key ignoring any key flags\&. This option may be specified multiple times\&.
.RE
.PP
\-l \fIdomain\fR
.RS 4
Generate a DLV set in addition to the key (DNSKEY) and DS sets\&. The domain is appended to the name of the records\&.
.RE
.PP
\-M \fImaxttl\fR
.RS 4
Sets the maximum TTL for the signed zone\&. Any TTL higher than
@@ -291,13 +296,6 @@ forces
to remove signatures from keys that are no longer active\&. This enables ZSK rollover using the procedure described in RFC 4641, section 4\&.2\&.1\&.1 ("Pre\-Publish Key Rollover")\&.
.RE
.PP
\-q
.RS 4
Quiet mode: Suppresses unnecessary output\&. Without this option, when
\fBdnssec\-signzone\fR
is run it will print to standard output the number of keys in use, the algorithms used to verify the zone was signed correctly and other status information, and finally the filename containing the signed zone\&. With it, that output is suppressed, leaving only the filename\&.
.RE
.PP
\-R
.RS 4
Remove signatures from keys that are no longer published\&.
+59 -36
View File
@@ -32,7 +32,6 @@
#include <unistd.h>
#include <isc/app.h>
#include <isc/atomic.h>
#include <isc/base32.h>
#include <isc/commandline.h>
#include <isc/event.h>
@@ -46,8 +45,8 @@
#include <isc/print.h>
#include <isc/random.h>
#include <isc/rwlock.h>
#include <isc/safe.h>
#include <isc/serial.h>
#include <isc/safe.h>
#include <isc/stdio.h>
#include <isc/string.h>
#include <isc/task.h>
@@ -156,13 +155,14 @@ static unsigned char *gsalt = saltbuf;
static size_t salt_length = 0;
static isc_task_t *master = NULL;
static unsigned int ntasks = 0;
static atomic_bool shuttingdown;
static atomic_bool finished;
static bool shuttingdown = false, finished = false;
static bool nokeys = false;
static bool removefile = false;
static bool generateds = false;
static bool ignore_kskflag = false;
static bool keyset_kskonly = false;
static dns_name_t *dlv = NULL;
static dns_fixedname_t dlv_fixed;
static dns_master_style_t *dsstyle = NULL;
static unsigned int serialformat = SOA_SERIAL_KEEP;
static unsigned int hash_length = 0;
@@ -1454,12 +1454,11 @@ signapex(void) {
cleannode(gdb, gversion, node);
dns_db_detachnode(gdb, &node);
result = dns_dbiterator_first(gdbiter);
if (result == ISC_R_NOMORE) {
atomic_store(&finished, true);
} else if (result != ISC_R_SUCCESS) {
if (result == ISC_R_NOMORE)
finished = true;
else if (result != ISC_R_SUCCESS)
fatal("failure iterating database: %s",
isc_result_totext(result));
}
}
/*%
@@ -1479,12 +1478,11 @@ assignwork(isc_task_t *task, isc_task_t *worker) {
static dns_fixedname_t fzonecut; /* Protected by namelock. */
static unsigned int ended = 0; /* Protected by namelock. */
if (atomic_load(&shuttingdown)) {
if (shuttingdown)
return;
}
LOCK(&namelock);
if (atomic_load(&finished)) {
if (finished) {
ended++;
if (ended == ntasks) {
isc_task_detach(&task);
@@ -1494,6 +1492,8 @@ assignwork(isc_task_t *task, isc_task_t *worker) {
}
fname = isc_mem_get(mctx, sizeof(dns_fixedname_t));
if (fname == NULL)
fatal("out of memory");
name = dns_fixedname_initname(fname);
node = NULL;
found = false;
@@ -1552,7 +1552,7 @@ assignwork(isc_task_t *task, isc_task_t *worker) {
next:
result = dns_dbiterator_next(gdbiter);
if (result == ISC_R_NOMORE) {
atomic_store(&finished, true);
finished = true;
break;
} else if (result != ISC_R_SUCCESS)
fatal("failure iterating database: %s",
@@ -2643,13 +2643,11 @@ loadexplicitkeys(char *keyfiles[], int n, bool setksk) {
static void
report(const char *format, ...) {
if (!quiet) {
FILE *out = output_stdout ? stderr : stdout;
va_list args;
va_start(args, format);
vfprintf(out, format, args);
va_end(args);
}
va_list args;
va_start(args, format);
vfprintf(stderr, format, args);
va_end(args);
putc('\n', stderr);
}
static void
@@ -2904,6 +2902,7 @@ writeset(const char *prefix, dns_rdatatype_t type) {
dns_dbversion_t *dbversion = NULL;
dns_diff_t diff;
dns_difftuple_t *tuple = NULL;
dns_fixedname_t fixed;
dns_name_t *name;
dns_rdata_t rdata, ds;
bool have_ksk = false;
@@ -2927,6 +2926,8 @@ writeset(const char *prefix, dns_rdatatype_t type) {
if (dsdir != NULL)
filenamelen += strlen(dsdir) + 1;
filename = isc_mem_get(mctx, filenamelen);
if (filename == NULL)
fatal("out of memory");
if (dsdir != NULL)
snprintf(filename, filenamelen, "%s/", dsdir);
else
@@ -2936,7 +2937,18 @@ writeset(const char *prefix, dns_rdatatype_t type) {
dns_diff_init(mctx, &diff);
name = gorigin;
if (type == dns_rdatatype_dlv) {
dns_name_t tname;
unsigned int labels;
dns_name_init(&tname, NULL);
name = dns_fixedname_initname(&fixed);
labels = dns_name_countlabels(gorigin);
dns_name_getlabelsequence(gorigin, 0, labels - 1, &tname);
result = dns_name_concatenate(&tname, dlv, name, NULL);
check_result(result, "dns_name_concatenate");
} else
name = gorigin;
for (key = ISC_LIST_HEAD(keylist);
key != NULL;
@@ -2977,6 +2989,8 @@ writeset(const char *prefix, dns_rdatatype_t type) {
DNS_DSDIGEST_SHA256,
dsbuf, &ds);
check_result(result, "dns_ds_buildrdata");
if (type == dns_rdatatype_dlv)
ds.type = dns_rdatatype_dlv;
result = dns_difftuple_create(mctx,
DNS_DIFFOP_ADDRESIGN,
name, 0, &ds, &tuple);
@@ -3071,7 +3085,6 @@ usage(void) {
fprintf(stderr, "\t-j jitter:\n");
fprintf(stderr, "\t\trandomize signature end time up to jitter seconds\n");
fprintf(stderr, "\t-v debuglevel (0)\n");
fprintf(stderr, "\t-q quiet\n");
fprintf(stderr, "\t-V:\tprint version information\n");
fprintf(stderr, "\t-o origin:\n");
fprintf(stderr, "\t\tzone origin (name of zonefile)\n");
@@ -3114,6 +3127,7 @@ usage(void) {
"\t\twith older versions of dnssec-signzone -g\n");
fprintf(stderr, "\t-n ncpus (number of cpus present)\n");
fprintf(stderr, "\t-k key_signing_key\n");
fprintf(stderr, "\t-l lookasidezone\n");
fprintf(stderr, "\t-3 NSEC3 salt\n");
fprintf(stderr, "\t-H NSEC3 iterations (10)\n");
fprintf(stderr, "\t-A NSEC3 optout\n");
@@ -3189,6 +3203,8 @@ main(int argc, char *argv[]) {
int tempfilelen = 0;
dns_rdataclass_t rdclass;
isc_task_t **tasks = NULL;
isc_buffer_t b;
int len;
hashlist_t hashlist;
bool make_keyset = false;
bool set_salt = false;
@@ -3196,12 +3212,9 @@ main(int argc, char *argv[]) {
bool set_iter = false;
bool nonsecify = false;
atomic_init(&shuttingdown, false);
atomic_init(&finished, false);
/* Unused letters: Bb G J q Yy (and F is reserved). */
#define CMDLINE_FLAGS \
"3:AaCc:Dd:E:e:f:FghH:i:I:j:K:k:L:l:m:M:n:N:o:O:PpQqRr:s:ST:tuUv:VX:xzZ:"
"3:AaCc:Dd:E:e:f:FghH:i:I:j:K:k:L:l:m:M:n:N:o:O:PpQRr:s:ST:tuUv:VX:xzZ:"
/*
* Process memory debugging argument first.
@@ -3366,7 +3379,14 @@ main(int argc, char *argv[]) {
break;
case 'l':
fatal("-l option (DLV lookaside) is obsolete");
len = strlen(isc_commandline_argument);
isc_buffer_init(&b, isc_commandline_argument, len);
isc_buffer_add(&b, len);
dlv = dns_fixedname_initname(&dlv_fixed);
result = dns_name_fromtext(dlv, &b, dns_rootname, 0,
NULL);
check_result(result, "dns_name_fromtext(dlv)");
break;
case 'M':
@@ -3455,10 +3475,6 @@ main(int argc, char *argv[]) {
fatal("verbose level must be numeric");
break;
case 'q':
quiet = true;
break;
case 'X':
dnskey_endstr = isc_commandline_argument;
break;
@@ -3558,6 +3574,8 @@ main(int argc, char *argv[]) {
free_output = true;
size = strlen(file) + strlen(".signed") + 1;
output = isc_mem_allocate(mctx, size);
if (output == NULL)
fatal("out of memory");
snprintf(output, size, "%s.signed", file);
}
@@ -3772,8 +3790,10 @@ main(int argc, char *argv[]) {
if (!nokeys) {
writeset("dsset-", dns_rdatatype_ds);
if (make_keyset) {
if (make_keyset)
writeset("keyset-", dns_rdatatype_dnskey);
if (dlv != NULL) {
writeset("dlvset-", dns_rdatatype_dlv);
}
}
@@ -3784,6 +3804,8 @@ main(int argc, char *argv[]) {
} else {
tempfilelen = strlen(output) + 20;
tempfile = isc_mem_get(mctx, tempfilelen);
if (tempfile == NULL)
fatal("out of memory");
result = isc_file_mktemplate(output, tempfile, tempfilelen);
check_result(result, "isc_file_mktemplate");
@@ -3813,6 +3835,8 @@ main(int argc, char *argv[]) {
fatal("failed to create task: %s", isc_result_totext(result));
tasks = isc_mem_get(mctx, ntasks * sizeof(isc_task_t *));
if (tasks == NULL)
fatal("out of memory");
for (i = 0; i < (int)ntasks; i++) {
tasks[i] = NULL;
result = isc_task_create(taskmgr, 0, &tasks[i]);
@@ -3830,7 +3854,7 @@ main(int argc, char *argv[]) {
presign();
TIME_NOW(&sign_start);
signapex();
if (!atomic_load(&finished)) {
if (!finished) {
/*
* There is more work to do. Spread it out over multiple
* processors if possible.
@@ -3843,12 +3867,11 @@ main(int argc, char *argv[]) {
isc_result_totext(result));
}
(void)isc_app_run();
if (!atomic_load(&finished)) {
if (!finished)
fatal("process aborted by user");
}
} else
isc_task_detach(&master);
atomic_store(&shuttingdown, true);;
shuttingdown = true;
for (i = 0; i < (int)ntasks; i++)
isc_task_detach(&tasks[i]);
isc_taskmgr_destroy(&taskmgr);
@@ -3861,7 +3884,7 @@ main(int argc, char *argv[]) {
} else {
vresult = dns_zoneverify_dnssec(NULL, gdb, gversion, gorigin,
NULL, mctx, ignore_kskflag,
keyset_kskonly, report);
keyset_kskonly);
if (vresult != ISC_R_SUCCESS) {
fprintf(output_stdout ? stderr : stdout,
"Zone verification failed (%s)\n",
+10 -17
View File
@@ -80,7 +80,6 @@
<arg choice="opt" rep="norepeat"><option>-O <replaceable class="parameter">output-format</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-P</option></arg>
<arg choice="opt" rep="norepeat"><option>-Q</option></arg>
<arg choice="opt" rep="norepeat"><option>-q</option></arg>
<arg choice="opt" rep="norepeat"><option>-R</option></arg>
<arg choice="opt" rep="norepeat"><option>-S</option></arg>
<arg choice="opt" rep="norepeat"><option>-s <replaceable class="parameter">start-time</replaceable></option></arg>
@@ -224,6 +223,16 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-l <replaceable class="parameter">domain</replaceable></term>
<listitem>
<para>
Generate a DLV set in addition to the key (DNSKEY) and DS sets.
The domain is appended to the name of the records.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-M <replaceable class="parameter">maxttl</replaceable></term>
<listitem>
@@ -534,22 +543,6 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-q</term>
<listitem>
<para>
Quiet mode: Suppresses unnecessary output. Without this
option, when <command>dnssec-signzone</command> is run it
will print to standard output the number of keys in use,
the algorithms used to verify the zone was signed correctly
and other status information, and finally the filename
containing the signed zone. With it, that output is
suppressed, leaving only the filename.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-R</term>
<listitem>
+7 -13
View File
@@ -55,7 +55,6 @@
[<code class="option">-O <em class="replaceable"><code>output-format</code></em></code>]
[<code class="option">-P</code>]
[<code class="option">-Q</code>]
[<code class="option">-q</code>]
[<code class="option">-R</code>]
[<code class="option">-S</code>]
[<code class="option">-s <em class="replaceable"><code>start-time</code></em></code>]
@@ -174,6 +173,13 @@
key flags. This option may be specified multiple times.
</p>
</dd>
<dt><span class="term">-l <em class="replaceable"><code>domain</code></em></span></dt>
<dd>
<p>
Generate a DLV set in addition to the key (DNSKEY) and DS sets.
The domain is appended to the name of the records.
</p>
</dd>
<dt><span class="term">-M <em class="replaceable"><code>maxttl</code></em></span></dt>
<dd>
<p>
@@ -423,18 +429,6 @@
RFC 4641, section 4.2.1.1 ("Pre-Publish Key Rollover").
</p>
</dd>
<dt><span class="term">-q</span></dt>
<dd>
<p>
Quiet mode: Suppresses unnecessary output. Without this
option, when <span class="command"><strong>dnssec-signzone</strong></span> is run it
will print to standard output the number of keys in use,
the algorithms used to verify the zone was signed correctly
and other status information, and finally the filename
containing the signed zone. With it, that output is
suppressed, leaving only the filename.
</p>
</dd>
<dt><span class="term">-R</span></dt>
<dd>
<p>
+1 -8
View File
@@ -39,7 +39,7 @@
dnssec-verify \- DNSSEC zone verification tool
.SH "SYNOPSIS"
.HP \w'\fBdnssec\-verify\fR\ 'u
\fBdnssec\-verify\fR [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-E\ \fR\fB\fIengine\fR\fR] [\fB\-I\ \fR\fB\fIinput\-format\fR\fR] [\fB\-o\ \fR\fB\fIorigin\fR\fR] [\fB\-q\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-V\fR] [\fB\-x\fR] [\fB\-z\fR] {zonefile}
\fBdnssec\-verify\fR [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-E\ \fR\fB\fIengine\fR\fR] [\fB\-I\ \fR\fB\fIinput\-format\fR\fR] [\fB\-o\ \fR\fB\fIorigin\fR\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-V\fR] [\fB\-x\fR] [\fB\-z\fR] {zonefile}
.SH "DESCRIPTION"
.PP
\fBdnssec\-verify\fR
@@ -81,13 +81,6 @@ Sets the debugging level\&.
Prints version information\&.
.RE
.PP
\-q
.RS 4
Quiet mode: Suppresses output\&. Without this option, when
\fBdnssec\-verify\fR
is run it will print to standard output the number of keys in use, the algorithms used to verify the zone was signed correctly and other status information\&. With it, all non\-error output is suppressed, and only the exit code will indicate success\&.
.RE
.PP
\-x
.RS 4
Only verify that the DNSKEY RRset is signed with key\-signing keys\&. Without this flag, it is assumed that the DNSKEY RRset will be signed by all active keys\&. When this flag is set, it will not be an error if the DNSKEY RRset is not signed by zone\-signing keys\&. This corresponds to the
+3 -19
View File
@@ -78,16 +78,6 @@ static dns_name_t *gorigin; /* The database origin */
static bool ignore_kskflag = false;
static bool keyset_kskonly = false;
static void
report(const char *format, ...) {
if (!quiet) {
va_list args;
va_start(args, format);
vfprintf(stdout, format, args);
va_end(args);
}
}
/*%
* Load the zone file from disk
*/
@@ -150,7 +140,6 @@ usage(void) {
fprintf(stderr, "Options: (default value in parenthesis) \n");
fprintf(stderr, "\t-v debuglevel (0)\n");
fprintf(stderr, "\t-q quiet\n");
fprintf(stderr, "\t-V:\tprint version information\n");
fprintf(stderr, "\t-o origin:\n");
fprintf(stderr, "\t\tzone origin (name of zonefile)\n");
@@ -183,7 +172,7 @@ main(int argc, char *argv[]) {
int ch;
#define CMDLINE_FLAGS \
"c:E:hm:o:I:qv:Vxz"
"hm:o:I:c:E:v:Vxz"
/*
* Process memory debugging argument first.
@@ -248,10 +237,6 @@ main(int argc, char *argv[]) {
fatal("verbose level must be numeric");
break;
case 'q':
quiet = true;
break;
case 'x':
keyset_kskonly = true;
break;
@@ -319,7 +304,7 @@ main(int argc, char *argv[]) {
}
gdb = NULL;
report("Loading zone '%s' from file '%s'\n", origin, file);
fprintf(stderr, "Loading zone '%s' from file '%s'\n", origin, file);
loadzone(file, origin, rdclass, &gdb);
gorigin = dns_db_origin(gdb);
gclass = dns_db_class(gdb);
@@ -329,8 +314,7 @@ main(int argc, char *argv[]) {
check_result(result, "dns_db_newversion()");
result = dns_zoneverify_dnssec(NULL, gdb, gversion, gorigin, NULL,
mctx, ignore_kskflag, keyset_kskonly,
report);
mctx, ignore_kskflag, keyset_kskonly);
dns_db_closeversion(gdb, &gversion, false);
dns_db_detach(&gdb);
-15
View File
@@ -49,7 +49,6 @@
<arg choice="opt" rep="norepeat"><option>-E <replaceable class="parameter">engine</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-I <replaceable class="parameter">input-format</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-o <replaceable class="parameter">origin</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-q</option></arg>
<arg choice="opt" rep="norepeat"><option>-v <replaceable class="parameter">level</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-V</option></arg>
<arg choice="opt" rep="norepeat"><option>-x</option></arg>
@@ -141,20 +140,6 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-q</term>
<listitem>
<para>
Quiet mode: Suppresses output. Without this option, when
<command>dnssec-verify</command> is run it will print to
standard output the number of keys in use, the algorithms
used to verify the zone was signed correctly and other
status information. With it, all non-error output is
suppressed, and only the exit code will indicate success.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-x</term>
<listitem>
-12
View File
@@ -37,7 +37,6 @@
[<code class="option">-E <em class="replaceable"><code>engine</code></em></code>]
[<code class="option">-I <em class="replaceable"><code>input-format</code></em></code>]
[<code class="option">-o <em class="replaceable"><code>origin</code></em></code>]
[<code class="option">-q</code>]
[<code class="option">-v <em class="replaceable"><code>level</code></em></code>]
[<code class="option">-V</code>]
[<code class="option">-x</code>]
@@ -113,17 +112,6 @@
Prints version information.
</p>
</dd>
<dt><span class="term">-q</span></dt>
<dd>
<p>
Quiet mode: Suppresses output. Without this option, when
<span class="command"><strong>dnssec-verify</strong></span> is run it will print to
standard output the number of keys in use, the algorithms
used to verify the zone was signed correctly and other
status information. With it, all non-error output is
suppressed, and only the exit code will indicate success.
</p>
</dd>
<dt><span class="term">-x</span></dt>
<dd>
<p>
+1 -2
View File
@@ -57,8 +57,7 @@
#include "dnssectool.h"
int verbose = 0;
bool quiet = false;
int verbose;
uint8_t dtype[8];
static fatalcallback_t *fatalcallback = NULL;
+1 -2
View File
@@ -25,9 +25,8 @@
#define PATH_MAX 1024 /* WIN32, and others don't define this. */
#endif
/*! verbosity: set by -v and -q option in each program, defined in dnssectool.c */
/*! verbosity: set by -v option in each program, defined in dnssectool.c */
extern int verbose;
extern bool quiet;
/*! program name, statically initialized in each program */
extern const char *program;
+8 -16
View File
@@ -46,22 +46,17 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \
${NS_INCLUDES} ${DNS_INCLUDES} \
${BIND9_INCLUDES} ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \
${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \
${DBDRIVER_INCLUDES} \
${OPENSSL_CFLAGS} \
${JSON_C_CFLAGS} \
${LIBXML2_CFLAGS} \
${MAXMINDDB_CFLAGS} \
${ZLIB_CFLAGS}
${DBDRIVER_INCLUDES} @OPENSSL_INCLUDES@
CDEFINES = @CONTRIB_DLZ@
CWARNINGS =
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
ISCCCLIBS = ../../lib/isccc/libisccc.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
NSLIBS = ../../lib/ns/libns.@A@
@@ -89,11 +84,10 @@ SUBDIRS = unix
TARGETS = named@EXEEXT@
GEOIP2LINKOBJS = geoip.@O@
GEOIPLINKOBJS = geoip.@O@
OBJS = builtin.@O@ config.@O@ control.@O@ \
controlconf.@O@ fuzz.@O@ \
@GEOIP2LINKOBJS@ \
controlconf.@O@ fuzz.@O@ @GEOIPLINKOBJS@ \
log.@O@ logconf.@O@ main.@O@ \
server.@O@ statschannel.@O@ \
tkeyconf.@O@ tsigconf.@O@ zoneconf.@O@ \
@@ -103,11 +97,10 @@ UOBJS = unix/os.@O@ unix/dlz_dlopen_driver.@O@
SYMOBJS = symtbl.@O@
GEOIP2LINKSRCS = geoip.c
GEOIPLINKSRCS = geoip.c
SRCS = builtin.c config.c control.c \
controlconf.c fuzz.c \
@GEOIP2LINKSRCS@ \
controlconf.c fuzz.c @GEOIPLINKSRCS@ \
log.c logconf.c main.c \
server.c statschannel.c \
tkeyconf.c tsigconf.c zoneconf.c \
@@ -139,7 +132,6 @@ config.@O@: config.c
-DDYNDB_LIBDIR=\"@libdir@/bind\" \
-DNAMED_LOCALSTATEDIR=\"${localstatedir}\" \
-DNAMED_SYSCONFDIR=\"${sysconfdir}\" \
-DMAXMINDDB_PREFIX=\"@MAXMINDDB_PREFIX@\" \
-c ${srcdir}/config.c
server.@O@: server.c
+40 -81
View File
@@ -15,23 +15,6 @@
<xsl:template match="statistics[@version=&quot;3.11&quot;]">
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript">
$(function($) {
var wid=0;
$('table.zones').each(function(i) { if( $(this).width() > wid ) wid = $(this).width(); return true; });
$('table.zones').css('min-width', wid );
$("h2+table,h3+table,h4+table,h2+div,h3+div,h2+script,h3+script").prev().append(' <a class="tabletoggle" href="#" style="font-size:small">Show/Hide</a>');
$(".tabletoggle").click(function(){
var n = $(this).closest("h2,h3,h4").next();
if (n.is("script")) { n = n.next(); }
if (n.is("div")) { n.toggleClass("hidden"); n = n.next(); }
if (n.is("table")) { n.toggleClass("hidden"); }
return false;
});
});
</script>
<xsl:if test="system-property('xsl:vendor')!='Transformiix'">
<!-- Non Mozilla specific markup -->
<script type="text/javascript" src="https://www.google.com/jsapi"/>
@@ -98,10 +81,6 @@
font-size: 10pt;
}
.hidden{
display: none;
}
.odd{
background-color: #f0f0f0;
}
@@ -242,22 +221,6 @@
background-color: rgb(1,169,206);
color: #ffffff;
}
table.zones {
border: 1px solid grey;
}
table.zones td {
text-align: right;
font-family: monospace;
}
table.zones td:nth-child(2) {
text-align: center;
}
table.zones td:nth-child(3) {
text-align: left;
}
table.zones tr:hover{
background-color: #99ddff;
}
td, th {
padding-right: 5px;
@@ -330,25 +293,25 @@
<hr/>
<h2>Server Status</h2>
<table class="info">
<tr class="odd">
<tr>
<th>Boot time:</th>
<td>
<xsl:value-of select="server/boot-time"/>
</td>
</tr>
<tr class="even">
<tr>
<th>Last reconfigured:</th>
<td>
<xsl:value-of select="server/config-time"/>
</td>
</tr>
<tr class="odd">
<tr>
<th>Current time:</th>
<td>
<xsl:value-of select="server/current-time"/>
</td>
</tr>
<tr class="even">
<tr>
<th>Server version:</th>
<td>
<xsl:value-of select="server/version"/>
@@ -367,13 +330,7 @@
<table class="counters">
<xsl:for-each select="server/counters[@type=&quot;opcode&quot;]/counter[. &gt; 0 or substring(@name,1,3) != 'RES']">
<xsl:sort select="." data-type="number" order="descending"/>
<xsl:variable name="css-class0">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class0}">
<tr>
<th>
<xsl:value-of select="@name"/>
</th>
@@ -654,13 +611,13 @@
<br/>
</xsl:if>
</xsl:for-each>
<xsl:if test="traffic//udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0] or traffic//udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0] or traffic//tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0] or traffic//tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
<xsl:if test="traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0] or traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0] or traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0] or traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
<h2>Traffic Size Statistics</h2>
</xsl:if>
<xsl:if test="traffic//udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
<xsl:if test="traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
<h4>UDP Requests Received</h4>
<table class="counters">
<xsl:for-each select="traffic//udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
<xsl:for-each select="traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
<xsl:variable name="css-class7">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
@@ -668,7 +625,6 @@
</xsl:choose>
</xsl:variable>
<tr class="{$css-class7}">
<th><xsl:value-of select="local-name(../../..)"/></th>
<th>
<xsl:value-of select="@name"/>
</th>
@@ -680,10 +636,10 @@
</table>
<br/>
</xsl:if>
<xsl:if test="traffic//udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
<xsl:if test="traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
<h4>UDP Responses Sent</h4>
<table class="counters">
<xsl:for-each select="traffic//udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
<xsl:for-each select="traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
<xsl:variable name="css-class7">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
@@ -691,7 +647,6 @@
</xsl:choose>
</xsl:variable>
<tr class="{$css-class7}">
<th><xsl:value-of select="local-name(../../..)"/></th>
<th>
<xsl:value-of select="@name"/>
</th>
@@ -703,10 +658,10 @@
</table>
<br/>
</xsl:if>
<xsl:if test="traffic//tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
<xsl:if test="traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
<h4>TCP Requests Received</h4>
<table class="counters">
<xsl:for-each select="traffic//tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
<xsl:for-each select="traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
<xsl:variable name="css-class7">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
@@ -714,7 +669,6 @@
</xsl:choose>
</xsl:variable>
<tr class="{$css-class7}">
<th><xsl:value-of select="local-name(../../..)"/></th>
<th>
<xsl:value-of select="@name"/>
</th>
@@ -726,10 +680,10 @@
</table>
<br/>
</xsl:if>
<xsl:if test="traffic//tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
<xsl:if test="traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
<h4>TCP Responses Sent</h4>
<table class="counters">
<xsl:for-each select="traffic//tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
<xsl:for-each select="traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
<xsl:variable name="css-class7">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
@@ -737,7 +691,6 @@
</xsl:choose>
</xsl:variable>
<tr class="{$css-class7}">
<th><xsl:value-of select="local-name(../../..)"/></th>
<th>
<xsl:value-of select="@name"/>
</th>
@@ -771,29 +724,35 @@
</table>
<br/>
</xsl:if>
<xsl:if test="views/view/zones/zone">
<xsl:for-each select="views/view">
<xsl:for-each select="views/view">
<xsl:if test="zones/zone">
<h3>Zones for View <xsl:value-of select="@name"/></h3>
<table class="zones">
<thead><tr><th>Name</th><th>Class</th><th>Type</th><th>Serial</th></tr></thead>
<tbody>
<xsl:for-each select="zones/zone">
<xsl:variable name="css-class15">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$css-class15}">
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="@rdataclass"/></td>
<td><xsl:value-of select="type"/></td>
<td><xsl:value-of select="serial"/></td></tr>
</xsl:for-each>
</tbody>
<tr>
<th>Name</th>
<th>Class</th>
<th>Type</th>
<th>Serial</th>
</tr>
<xsl:for-each select="zones/zone">
<tr>
<td>
<xsl:value-of select="@name"/>
</td>
<td>
<xsl:value-of select="@rdataclass"/>
</td>
<td>
<xsl:value-of select="type"/>
</td>
<td>
<xsl:value-of select="serial"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:for-each>
</xsl:if>
</xsl:if>
</xsl:for-each>
<xsl:if test="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
<h2>Received QTYPES per view/zone</h2>
<xsl:for-each select="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
+36 -77
View File
@@ -20,23 +20,6 @@ static char xslmsg[] =
" <xsl:template match=\"statistics[@version=&quot;3.11&quot;]\">\n"
" <html>\n"
" <head>\n"
" <script type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\"></script>\n"
" <script type=\"text/javascript\">\n"
" $(function($) {\n"
" var wid=0;\n"
" $('table.zones').each(function(i) { if( $(this).width() > wid ) wid = $(this).width(); return true; });\n"
" $('table.zones').css('min-width', wid );\n"
" $(\"h2+table,h3+table,h4+table,h2+div,h3+div,h2+script,h3+script\").prev().append(' <a class=\"tabletoggle\" href=\"#\" style=\"font-size:small\">Show/Hide</a>');\n"
" $(\".tabletoggle\").click(function(){\n"
" var n = $(this).closest(\"h2,h3,h4\").next();\n"
" if (n.is(\"script\")) { n = n.next(); }\n"
" if (n.is(\"div\")) { n.toggleClass(\"hidden\"); n = n.next(); }\n"
" if (n.is(\"table\")) { n.toggleClass(\"hidden\"); }\n"
" return false;\n"
" });\n"
" });\n"
" </script>\n"
"\n"
" <xsl:if test=\"system-property('xsl:vendor')!='Transformiix'\">\n"
" <!-- Non Mozilla specific markup -->\n"
" <script type=\"text/javascript\" src=\"https://www.google.com/jsapi\"/>\n"
@@ -103,10 +86,6 @@ static char xslmsg[] =
" font-size: 10pt;\n"
" }\n"
"\n"
" .hidden{\n"
" display: none;\n"
" }\n"
"\n"
" .odd{\n"
" background-color: #f0f0f0;\n"
" }\n"
@@ -247,22 +226,6 @@ static char xslmsg[] =
" background-color: rgb(1,169,206);\n"
" color: #ffffff;\n"
" }\n"
" table.zones {\n"
" border: 1px solid grey;\n"
" }\n"
" table.zones td {\n"
" text-align: right;\n"
" font-family: monospace;\n"
" }\n"
" table.zones td:nth-child(2) {\n"
" text-align: center;\n"
" }\n"
" table.zones td:nth-child(3) {\n"
" text-align: left;\n"
" }\n"
" table.zones tr:hover{\n"
" background-color: #99ddff;\n"
" }\n"
"\n"
" td, th {\n"
" padding-right: 5px;\n"
@@ -335,25 +298,25 @@ static char xslmsg[] =
" <hr/>\n"
" <h2>Server Status</h2>\n"
" <table class=\"info\">\n"
" <tr class=\"odd\">\n"
" <tr>\n"
" <th>Boot time:</th>\n"
" <td>\n"
" <xsl:value-of select=\"server/boot-time\"/>\n"
" </td>\n"
" </tr>\n"
" <tr class=\"even\">\n"
" <tr>\n"
" <th>Last reconfigured:</th>\n"
" <td>\n"
" <xsl:value-of select=\"server/config-time\"/>\n"
" </td>\n"
" </tr>\n"
" <tr class=\"odd\">\n"
" <tr>\n"
" <th>Current time:</th>\n"
" <td>\n"
" <xsl:value-of select=\"server/current-time\"/>\n"
" </td>\n"
" </tr>\n"
" <tr class=\"even\">\n"
" <tr>\n"
" <th>Server version:</th>\n"
" <td>\n"
" <xsl:value-of select=\"server/version\"/>\n"
@@ -372,13 +335,7 @@ static char xslmsg[] =
" <table class=\"counters\">\n"
" <xsl:for-each select=\"server/counters[@type=&quot;opcode&quot;]/counter[. &gt; 0 or substring(@name,1,3) != 'RES']\">\n"
" <xsl:sort select=\".\" data-type=\"number\" order=\"descending\"/>\n"
" <xsl:variable name=\"css-class0\">\n"
" <xsl:choose>\n"
" <xsl:when test=\"position() mod 2 = 0\">even</xsl:when>\n"
" <xsl:otherwise>odd</xsl:otherwise>\n"
" </xsl:choose>\n"
" </xsl:variable>\n"
" <tr class=\"{$css-class0}\">\n"
" <tr>\n"
" <th>\n"
" <xsl:value-of select=\"@name\"/>\n"
" </th>\n"
@@ -659,13 +616,13 @@ static char xslmsg[] =
" <br/>\n"
" </xsl:if>\n"
" </xsl:for-each>\n"
" <xsl:if test=\"traffic//udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0] or traffic//udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0] or traffic//tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0] or traffic//tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:if test=\"traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0] or traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0] or traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0] or traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]\">\n"
" <h2>Traffic Size Statistics</h2>\n"
" </xsl:if>\n"
" <xsl:if test=\"traffic//udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:if test=\"traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]\">\n"
" <h4>UDP Requests Received</h4>\n"
" <table class=\"counters\">\n"
" <xsl:for-each select=\"traffic//udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:for-each select=\"traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:variable name=\"css-class7\">\n"
" <xsl:choose>\n"
" <xsl:when test=\"position() mod 2 = 0\">even</xsl:when>\n"
@@ -673,7 +630,6 @@ static char xslmsg[] =
" </xsl:choose>\n"
" </xsl:variable>\n"
" <tr class=\"{$css-class7}\">\n"
" <th><xsl:value-of select=\"local-name(../../..)\"/></th>\n"
" <th>\n"
" <xsl:value-of select=\"@name\"/>\n"
" </th>\n"
@@ -685,10 +641,10 @@ static char xslmsg[] =
" </table>\n"
" <br/>\n"
" </xsl:if>\n"
" <xsl:if test=\"traffic//udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:if test=\"traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]\">\n"
" <h4>UDP Responses Sent</h4>\n"
" <table class=\"counters\">\n"
" <xsl:for-each select=\"traffic//udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:for-each select=\"traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:variable name=\"css-class7\">\n"
" <xsl:choose>\n"
" <xsl:when test=\"position() mod 2 = 0\">even</xsl:when>\n"
@@ -696,7 +652,6 @@ static char xslmsg[] =
" </xsl:choose>\n"
" </xsl:variable>\n"
" <tr class=\"{$css-class7}\">\n"
" <th><xsl:value-of select=\"local-name(../../..)\"/></th>\n"
" <th>\n"
" <xsl:value-of select=\"@name\"/>\n"
" </th>\n"
@@ -708,10 +663,10 @@ static char xslmsg[] =
" </table>\n"
" <br/>\n"
" </xsl:if>\n"
" <xsl:if test=\"traffic//tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:if test=\"traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]\">\n"
" <h4>TCP Requests Received</h4>\n"
" <table class=\"counters\">\n"
" <xsl:for-each select=\"traffic//tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:for-each select=\"traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:variable name=\"css-class7\">\n"
" <xsl:choose>\n"
" <xsl:when test=\"position() mod 2 = 0\">even</xsl:when>\n"
@@ -719,7 +674,6 @@ static char xslmsg[] =
" </xsl:choose>\n"
" </xsl:variable>\n"
" <tr class=\"{$css-class7}\">\n"
" <th><xsl:value-of select=\"local-name(../../..)\"/></th>\n"
" <th>\n"
" <xsl:value-of select=\"@name\"/>\n"
" </th>\n"
@@ -731,10 +685,10 @@ static char xslmsg[] =
" </table>\n"
" <br/>\n"
" </xsl:if>\n"
" <xsl:if test=\"traffic//tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:if test=\"traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]\">\n"
" <h4>TCP Responses Sent</h4>\n"
" <table class=\"counters\">\n"
" <xsl:for-each select=\"traffic//tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:for-each select=\"traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]\">\n"
" <xsl:variable name=\"css-class7\">\n"
" <xsl:choose>\n"
" <xsl:when test=\"position() mod 2 = 0\">even</xsl:when>\n"
@@ -742,7 +696,6 @@ static char xslmsg[] =
" </xsl:choose>\n"
" </xsl:variable>\n"
" <tr class=\"{$css-class7}\">\n"
" <th><xsl:value-of select=\"local-name(../../..)\"/></th>\n"
" <th>\n"
" <xsl:value-of select=\"@name\"/>\n"
" </th>\n"
@@ -776,29 +729,35 @@ static char xslmsg[] =
" </table>\n"
" <br/>\n"
" </xsl:if>\n"
" <xsl:if test=\"views/view/zones/zone\">\n"
" <xsl:for-each select=\"views/view\">\n"
" <xsl:if test=\"zones/zone\">\n"
" <h3>Zones for View <xsl:value-of select=\"@name\"/></h3>\n"
" <table class=\"zones\">\n"
" <thead><tr><th>Name</th><th>Class</th><th>Type</th><th>Serial</th></tr></thead>\n"
" <tbody>\n"
" <tr>\n"
" <th>Name</th>\n"
" <th>Class</th>\n"
" <th>Type</th>\n"
" <th>Serial</th>\n"
" </tr>\n"
" <xsl:for-each select=\"zones/zone\">\n"
" <xsl:variable name=\"css-class15\">\n"
" <xsl:choose>\n"
" <xsl:when test=\"position() mod 2 = 0\">even</xsl:when>\n"
" <xsl:otherwise>odd</xsl:otherwise>\n"
" </xsl:choose>\n"
" </xsl:variable>\n"
" <tr class=\"{$css-class15}\">\n"
" <td><xsl:value-of select=\"@name\"/></td>\n"
" <td><xsl:value-of select=\"@rdataclass\"/></td>\n"
" <td><xsl:value-of select=\"type\"/></td>\n"
" <td><xsl:value-of select=\"serial\"/></td></tr>\n"
" <tr>\n"
" <td>\n"
" <xsl:value-of select=\"@name\"/>\n"
" </td>\n"
" <td>\n"
" <xsl:value-of select=\"@rdataclass\"/>\n"
" </td>\n"
" <td>\n"
" <xsl:value-of select=\"type\"/>\n"
" </td>\n"
" <td>\n"
" <xsl:value-of select=\"serial\"/>\n"
" </td>\n"
" </tr>\n"
" </xsl:for-each>\n"
" </tbody>\n"
" </table>\n"
" </xsl:for-each>\n"
" </xsl:if>\n"
" </xsl:for-each>\n"
" <xsl:if test=\"views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]\">\n"
" <h2>Received QTYPES per view/zone</h2>\n"
" <xsl:for-each select=\"views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]\">\n"
+34 -10
View File
@@ -50,7 +50,7 @@ options {\n\
automatic-interface-scan yes;\n\
bindkeys-file \"" NAMED_SYSCONFDIR "/bind.keys\";\n\
# blackhole {none;};\n"
" cookie-algorithm siphash24;\n"
" cookie-algorithm aes;\n"
#ifndef WIN32
" coresize default;\n\
datasize default;\n"
@@ -64,11 +64,6 @@ options {\n\
#ifndef WIN32
" files unlimited;\n"
#endif
#if defined(HAVE_GEOIP2) && !defined(WIN32)
" geoip-directory \"" MAXMINDDB_PREFIX "/share/GeoIP2\";\n"
#elif defined(HAVE_GEOIP2)
" geoip-directory \".\";\n"
#endif
"\
# has-old-clients <obsolete>;\n\
heartbeat-interval 60;\n\
@@ -145,6 +140,7 @@ options {\n\
check-names response ignore;\n\
check-names slave warn;\n\
check-spf warn;\n\
cleaning-interval 0; /* now meaningless */\n\
clients-per-query 10;\n\
dnssec-accept-expired no;\n\
dnssec-validation " VALIDATION_DEFAULT "; \n"
@@ -155,8 +151,11 @@ options {\n\
# fetch-glue <obsolete>;\n\
fetch-quota-params 100 0.1 0.3 0.7;\n\
fetches-per-server 0;\n\
fetches-per-zone 0;\n\
glue-cache yes;\n\
fetches-per-zone 0;\n"
#ifdef HAVE_GEOIP
" geoip-use-ecs yes;\n"
#endif
" glue-cache yes;\n\
lame-ttl 600;\n"
#ifdef HAVE_LMDB
" lmdb-mapsize 32M;\n"
@@ -292,10 +291,10 @@ view \"_bind\" chaos {\n\
# \"dnssec-validation auto;\" is set and\n\
# sysconfdir/bind.keys doesn't exist).\n\
#\n\
# BEGIN DNSSEC KEYS\n"
# BEGIN MANAGED KEYS\n"
/* Imported from bind.keys.h: */
DNSSEC_KEYS
MANAGED_KEYS
"# END MANAGED KEYS\n\
\n\
@@ -512,9 +511,16 @@ named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
}
dscps = isc_mem_get(mctx, count * sizeof(isc_dscp_t));
if (dscps == NULL)
return (ISC_R_NOMEMORY);
}
addrs = isc_mem_get(mctx, count * sizeof(isc_sockaddr_t));
if (addrs == NULL) {
if (dscps != NULL)
isc_mem_put(mctx, dscps, count * sizeof(isc_dscp_t));
return (ISC_R_NOMEMORY);
}
for (element = cfg_list_first(addrlist);
element != NULL;
@@ -690,6 +696,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
newsize = newlen * sizeof(*lists);
oldsize = listcount * sizeof(*lists);
tmp = isc_mem_get(mctx, newsize);
if (tmp == NULL)
goto cleanup;
if (listcount != 0) {
memmove(tmp, lists, oldsize);
isc_mem_put(mctx, lists, oldsize);
@@ -724,6 +732,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
newsize = newlen * sizeof(*stack);
oldsize = stackcount * sizeof(*stack);
tmp = isc_mem_get(mctx, newsize);
if (tmp == NULL)
goto cleanup;
if (stackcount != 0) {
memmove(tmp, stack, oldsize);
isc_mem_put(mctx, stack, oldsize);
@@ -750,6 +760,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
newsize = newlen * sizeof(isc_sockaddr_t);
oldsize = addrcount * sizeof(isc_sockaddr_t);
tmp = isc_mem_get(mctx, newsize);
if (tmp == NULL)
goto cleanup;
if (addrcount != 0) {
memmove(tmp, addrs, oldsize);
isc_mem_put(mctx, addrs, oldsize);
@@ -760,6 +772,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
newsize = newlen * sizeof(isc_dscp_t);
oldsize = dscpcount * sizeof(isc_dscp_t);
tmp = isc_mem_get(mctx, newsize);
if (tmp == NULL)
goto cleanup;
if (dscpcount != 0) {
memmove(tmp, dscps, oldsize);
isc_mem_put(mctx, dscps, oldsize);
@@ -770,6 +784,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
newsize = newlen * sizeof(dns_name_t *);
oldsize = keycount * sizeof(dns_name_t *);
tmp = isc_mem_get(mctx, newsize);
if (tmp == NULL)
goto cleanup;
if (keycount != 0) {
memmove(tmp, keys, oldsize);
isc_mem_put(mctx, keys, oldsize);
@@ -789,6 +805,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
if (!cfg_obj_isstring(key))
continue;
keys[i - 1] = isc_mem_get(mctx, sizeof(dns_name_t));
if (keys[i - 1] == NULL)
goto cleanup;
dns_name_init(keys[i - 1], NULL);
keystr = cfg_obj_asstring(key);
@@ -819,6 +837,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
oldsize = addrcount * sizeof(isc_sockaddr_t);
if (i != 0) {
tmp = isc_mem_get(mctx, newsize);
if (tmp == NULL)
goto cleanup;
memmove(tmp, addrs, newsize);
} else
tmp = NULL;
@@ -830,6 +850,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
oldsize = dscpcount * sizeof(isc_dscp_t);
if (i != 0) {
tmp = isc_mem_get(mctx, newsize);
if (tmp == NULL)
goto cleanup;
memmove(tmp, dscps, newsize);
} else
tmp = NULL;
@@ -841,6 +863,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
oldsize = keycount * sizeof(dns_name_t *);
if (i != 0) {
tmp = isc_mem_get(mctx, newsize);
if (tmp == NULL)
goto cleanup;
memmove(tmp, keys, newsize);
} else
tmp = NULL;
+53 -14
View File
@@ -369,8 +369,9 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
ccregion.rstart = isc_buffer_base(&conn->ccmsg.buffer);
ccregion.rend = isc_buffer_used(&conn->ccmsg.buffer);
secret.rstart = isc_mem_get(listener->mctx,
key->secret.length);
secret.rstart = isc_mem_get(listener->mctx, key->secret.length);
if (secret.rstart == NULL)
goto cleanup;
memmove(secret.rstart, key->secret.base, key->secret.length);
secret.rend = secret.rstart + key->secret.length;
algorithm = key->algorithm;
@@ -560,6 +561,8 @@ newconnection(controllistener_t *listener, isc_socket_t *sock) {
isc_result_t result;
conn = isc_mem_get(listener->mctx, sizeof(*conn));
if (conn == NULL)
return (ISC_R_NOMEMORY);
conn->sock = sock;
isccc_ccmsg_init(listener->mctx, sock, &conn->ccmsg);
@@ -706,7 +709,7 @@ cfgkeylist_find(const cfg_obj_t *keylist, const char *keyname,
return (ISC_R_SUCCESS);
}
static void
static isc_result_t
controlkeylist_fromcfg(const cfg_obj_t *keylist, isc_mem_t *mctx,
controlkeylist_t *keyids)
{
@@ -723,7 +726,11 @@ controlkeylist_fromcfg(const cfg_obj_t *keylist, isc_mem_t *mctx,
obj = cfg_listelt_value(element);
str = cfg_obj_asstring(obj);
newstr = isc_mem_strdup(mctx, str);
if (newstr == NULL)
goto cleanup;
key = isc_mem_get(mctx, sizeof(*key));
if (key == NULL)
goto cleanup;
key->keyname = newstr;
key->algorithm = DST_ALG_UNKNOWN;
key->secret.base = NULL;
@@ -732,6 +739,13 @@ controlkeylist_fromcfg(const cfg_obj_t *keylist, isc_mem_t *mctx,
ISC_LIST_APPEND(*keyids, key, link);
newstr = NULL;
}
return (ISC_R_SUCCESS);
cleanup:
if (newstr != NULL)
isc_mem_free(mctx, newstr);
free_controlkeylist(keyids, mctx);
return (ISC_R_NOMEMORY);
}
static void
@@ -805,6 +819,15 @@ register_keys(const cfg_obj_t *control, const cfg_obj_t *keylist,
keyid->secret.length = isc_buffer_usedlength(&b);
keyid->secret.base = isc_mem_get(mctx,
keyid->secret.length);
if (keyid->secret.base == NULL) {
cfg_obj_log(keydef, named_g_lctx,
ISC_LOG_WARNING,
"couldn't register key '%s': "
"out of memory", keyid->keyname);
ISC_LIST_UNLINK(*keyids, keyid, link);
free_controlkey(keyid, mctx);
break;
}
memmove(keyid->secret.base, isc_buffer_base(&b),
keyid->secret.length);
}
@@ -845,6 +868,8 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
CHECK(cfg_map_get(config, "key", &key));
keyid = isc_mem_get(mctx, sizeof(*keyid));
if (keyid == NULL)
CHECK(ISC_R_NOMEMORY);
keyid->keyname = isc_mem_strdup(mctx,
cfg_obj_asstring(cfg_map_getname(key)));
keyid->secret.base = NULL;
@@ -886,7 +911,14 @@ get_rndckey(isc_mem_t *mctx, controlkeylist_t *keyids) {
}
keyid->secret.length = isc_buffer_usedlength(&b);
keyid->secret.base = isc_mem_get(mctx, keyid->secret.length);
keyid->secret.base = isc_mem_get(mctx,
keyid->secret.length);
if (keyid->secret.base == NULL) {
cfg_obj_log(key, named_g_lctx, ISC_LOG_WARNING,
"couldn't register key '%s': "
"out of memory", keyid->keyname);
CHECK(ISC_R_NOMEMORY);
}
memmove(keyid->secret.base, isc_buffer_base(&b),
keyid->secret.length);
ISC_LIST_APPEND(*keyids, keyid, link);
@@ -985,11 +1017,14 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
INSIST(global_keylist != NULL);
ISC_LIST_INIT(keys);
controlkeylist_fromcfg(control_keylist, listener->mctx, &keys);
free_controlkeylist(&listener->keys, listener->mctx);
listener->keys = keys;
register_keys(control, global_keylist, &listener->keys,
listener->mctx, socktext);
result = controlkeylist_fromcfg(control_keylist,
listener->mctx, &keys);
if (result == ISC_R_SUCCESS) {
free_controlkeylist(&listener->keys, listener->mctx);
listener->keys = keys;
register_keys(control, global_keylist, &listener->keys,
listener->mctx, socktext);
}
} else {
free_controlkeylist(&listener->keys, listener->mctx);
result = get_rndckey(listener->mctx, &listener->keys);
@@ -1090,6 +1125,8 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
isc_result_t result = ISC_R_SUCCESS;
listener = isc_mem_get(mctx, sizeof(*listener));
if (listener == NULL)
result = ISC_R_NOMEMORY;
if (result == ISC_R_SUCCESS) {
listener->mctx = NULL;
@@ -1140,13 +1177,15 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
&control_keylist);
if (control_keylist != NULL) {
controlkeylist_fromcfg(control_keylist, listener->mctx,
result = controlkeylist_fromcfg(control_keylist,
listener->mctx,
&listener->keys);
register_keys(control, global_keylist, &listener->keys,
listener->mctx, socktext);
} else {
if (result == ISC_R_SUCCESS)
register_keys(control, global_keylist,
&listener->keys,
listener->mctx, socktext);
} else
result = get_rndckey(mctx, &listener->keys);
}
if (result != ISC_R_SUCCESS && control != NULL)
cfg_obj_log(control, named_g_lctx, ISC_LOG_WARNING,
+1 -1
View File
@@ -17,7 +17,7 @@
#ifdef ENABLE_AFL
#include <named/globals.h>
#include <named/server.h>
#include <errno.h>
#include <sys/errno.h>
#include <isc/app.h>
#include <isc/condition.h>
+96 -95
View File
@@ -11,132 +11,133 @@
/*! \file */
#if defined(HAVE_GEOIP2)
#include <maxminddb.h>
#endif
#include <isc/print.h>
#include <isc/string.h>
#include <isc/util.h>
#include <dns/geoip.h>
#include <named/log.h>
#include <named/geoip.h>
static dns_geoip_databases_t geoip_table;
#include <dns/geoip.h>
#if defined(HAVE_GEOIP2)
static MMDB_s geoip_country, geoip_city, geoip_as, geoip_isp, geoip_domain;
#ifdef HAVE_GEOIP
static dns_geoip_databases_t geoip_table = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
static MMDB_s *
open_geoip2(const char *dir, const char *dbfile, MMDB_s *mmdb) {
char pathbuf[PATH_MAX];
unsigned int n;
int ret;
static void
init_geoip_db(GeoIP **dbp, GeoIPDBTypes edition, GeoIPDBTypes fallback,
GeoIPOptions method, const char *name)
{
char *info;
GeoIP *db;
n = snprintf(pathbuf, sizeof(pathbuf), "%s/%s", dir, dbfile);
if (n >= sizeof(pathbuf)) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"GeoIP2 database '%s/%s': path too long",
dir, dbfile);
return (NULL);
REQUIRE(dbp != NULL);
db = *dbp;
if (db != NULL) {
GeoIP_delete(db);
db = *dbp = NULL;
}
ret = MMDB_open(pathbuf, MMDB_MODE_MMAP, mmdb);
if (ret == MMDB_SUCCESS) {
if (! GeoIP_db_avail(edition)) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"opened GeoIP2 database '%s'", pathbuf);
return (mmdb);
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"GeoIP %s (type %d) DB not available", name, edition);
goto fail;
}
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_DEBUG(1),
"unable to open GeoIP2 database '%s' (status %d)",
pathbuf, ret);
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"initializing GeoIP %s (type %d) DB", name, edition);
db = GeoIP_open_type(edition, method);
if (db == NULL) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"failed to initialize GeoIP %s (type %d) DB%s",
name, edition, fallback == 0
? "geoip matches using this database will fail" : "");
goto fail;
}
info = GeoIP_database_info(db);
if (info != NULL) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"%s", info);
free(info);
}
*dbp = db;
return;
fail:
if (fallback != 0)
init_geoip_db(dbp, fallback, 0, method, name);
return (NULL);
}
#endif /* HAVE_GEOIP2 */
#endif /* HAVE_GEOIP */
void
named_geoip_init(void) {
#if defined(HAVE_GEOIP2)
if (named_g_geoip == NULL) {
named_g_geoip = &geoip_table;
}
#else
#ifndef HAVE_GEOIP
return;
#else
GeoIP_cleanup();
if (named_g_geoip == NULL)
named_g_geoip = &geoip_table;
#endif
}
void
named_geoip_load(char *dir) {
#if defined(HAVE_GEOIP2)
REQUIRE(dir != NULL);
#ifndef HAVE_GEOIP
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"looking for GeoIP2 databases in '%s'", dir);
named_g_geoip->country = open_geoip2(dir, "GeoIP2-Country.mmdb",
&geoip_country);
if (named_g_geoip->country == NULL) {
named_g_geoip->country = open_geoip2(dir,
"GeoLite2-Country.mmdb",
&geoip_country);
}
named_g_geoip->city = open_geoip2(dir, "GeoIP2-City.mmdb",
&geoip_city);
if (named_g_geoip->city == NULL) {
named_g_geoip->city = open_geoip2(dir, "GeoLite2-City.mmdb",
&geoip_city);
}
named_g_geoip->as = open_geoip2(dir, "GeoIP2-ASN.mmdb", &geoip_as);
if (named_g_geoip->as == NULL) {
named_g_geoip->as = open_geoip2(dir, "GeoLite2-ASN.mmdb",
&geoip_as);
}
named_g_geoip->isp = open_geoip2(dir, "GeoIP2-ISP.mmdb", &geoip_isp);
named_g_geoip->domain = open_geoip2(dir, "GeoIP2-Domain.mmdb",
&geoip_domain);
#else
UNUSED(dir);
return;
#else
GeoIPOptions method;
#ifdef _WIN32
method = GEOIP_STANDARD;
#else
method = GEOIP_MMAP_CACHE;
#endif
}
void
named_geoip_shutdown(void) {
#ifdef HAVE_GEOIP2
if (named_g_geoip->country != NULL) {
MMDB_close(named_g_geoip->country);
named_g_geoip->country = NULL;
named_geoip_init();
if (dir != NULL) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"using \"%s\" as GeoIP directory", dir);
GeoIP_setup_custom_directory(dir);
}
if (named_g_geoip->city != NULL) {
MMDB_close(named_g_geoip->city);
named_g_geoip->city = NULL;
}
if (named_g_geoip->as != NULL) {
MMDB_close(named_g_geoip->as);
named_g_geoip->as = NULL;
}
if (named_g_geoip->isp != NULL) {
MMDB_close(named_g_geoip->isp);
named_g_geoip->isp = NULL;
}
if (named_g_geoip->domain != NULL) {
MMDB_close(named_g_geoip->domain);
named_g_geoip->domain = NULL;
}
#endif /* HAVE_GEOIP2 */
dns_geoip_shutdown();
init_geoip_db(&named_g_geoip->country_v4, GEOIP_COUNTRY_EDITION, 0,
method, "Country (IPv4)");
#ifdef HAVE_GEOIP_V6
init_geoip_db(&named_g_geoip->country_v6, GEOIP_COUNTRY_EDITION_V6, 0,
method, "Country (IPv6)");
#endif
init_geoip_db(&named_g_geoip->city_v4, GEOIP_CITY_EDITION_REV1,
GEOIP_CITY_EDITION_REV0, method, "City (IPv4)");
#if defined(HAVE_GEOIP_V6) && defined(HAVE_GEOIP_CITY_V6)
init_geoip_db(&named_g_geoip->city_v6, GEOIP_CITY_EDITION_REV1_V6,
GEOIP_CITY_EDITION_REV0_V6, method, "City (IPv6)");
#endif
init_geoip_db(&named_g_geoip->region, GEOIP_REGION_EDITION_REV1,
GEOIP_REGION_EDITION_REV0, method, "Region");
init_geoip_db(&named_g_geoip->isp, GEOIP_ISP_EDITION, 0,
method, "ISP");
init_geoip_db(&named_g_geoip->org, GEOIP_ORG_EDITION, 0,
method, "Org");
init_geoip_db(&named_g_geoip->as, GEOIP_ASNUM_EDITION, 0,
method, "AS");
init_geoip_db(&named_g_geoip->domain, GEOIP_DOMAIN_EDITION, 0,
method, "Domain");
init_geoip_db(&named_g_geoip->netspeed, GEOIP_NETSPEED_EDITION, 0,
method, "NetSpeed");
#endif /* HAVE_GEOIP */
}
+13 -10
View File
@@ -9,15 +9,18 @@
* information regarding copyright ownership.
*/
#pragma once
#ifndef _GEOIP_H
#define _GEOIP_H
#ifdef HAVE_GEOIP
#include <GeoIP.h>
#include <GeoIPCity.h>
#endif /* HAVE_GEOIP */
void named_geoip_init(void);
void named_geoip_load(char *dir);
#ifdef HAVE_GEOIP
extern dns_geoip_databases_t *named_g_geoip;
void
named_geoip_init(void);
void
named_geoip_load(char *dir);
void
named_geoip_shutdown(void);
#endif /* HAVE_GEOIP */
#endif
+1 -1
View File
@@ -154,7 +154,7 @@ EXTERN bool named_g_keepstderr INIT(false);
EXTERN unsigned int named_g_tat_interval INIT(24*3600);
#if defined(HAVE_GEOIP2)
#ifdef HAVE_GEOIP
EXTERN dns_geoip_databases_t *named_g_geoip INIT(NULL);
#endif
+6 -5
View File
@@ -22,6 +22,7 @@
#include <isc/quota.h>
#include <isc/sockaddr.h>
#include <isc/types.h>
#include <isc/xml.h>
#include <dns/acl.h>
#include <dns/dnstap.h>
@@ -55,9 +56,9 @@ struct named_server {
char * secrootsfile; /*%< Secroots file name */
char * bindkeysfile; /*%< bind.keys file name */
char * recfile; /*%< Recursive file name */
bool version_set; /*%< User has set version */
bool version_set; /*%< User has set version */
char * version; /*%< User-specified version */
bool hostname_set; /*%< User has set hostname */
bool hostname_set; /*%< User has set hostname */
char * hostname; /*%< User-specified hostname */
/* Server data structures. */
@@ -77,9 +78,9 @@ struct named_server {
isc_mutex_t reload_event_lock;
isc_event_t * reload_event;
named_reload_t reload_status;
bool reload_in_progress;
bool flushonshutdown;
bool flushonshutdown;
named_cachelist_t cachelist; /*%< Possibly shared caches */
isc_stats_t * zonestats; /*% Zone management stats */
@@ -97,7 +98,7 @@ struct named_server {
dns_name_t *session_keyname;
unsigned int session_keyalg;
uint16_t session_keybits;
bool interface_auto;
bool interface_auto;
unsigned char secret[32]; /*%< Server Cookie Secret */
ns_cookiealg_t cookiealg;
-9
View File
@@ -27,13 +27,4 @@ typedef ISC_LIST(named_dispatch_t) named_dispatchlist_t;
typedef struct named_statschannel named_statschannel_t;
typedef ISC_LIST(named_statschannel_t) named_statschannellist_t;
/*%
* Used for server->reload_status as printed by `rndc status`
*/
typedef enum {
NAMED_RELOAD_DONE,
NAMED_RELOAD_IN_PROGRESS,
NAMED_RELOAD_FAILED,
} named_reload_t;
#endif /* NAMED_TYPES_H */
+7 -11
View File
@@ -54,9 +54,6 @@
#include <gperftools/profiler.h>
#endif
#ifdef HAVE_JSON_C
#include <json_c_version.h>
#endif /* HAVE_JSON_C */
/*
* Defining NAMED_MAIN provides storage declarations (rather than extern)
@@ -82,7 +79,6 @@
#include <openssl/crypto.h>
#ifdef HAVE_LIBXML2
#include <libxml/xmlversion.h>
#include <libxml/parser.h>
#endif
#ifdef HAVE_ZLIB
#include <zlib.h>
@@ -342,7 +338,7 @@ save_command_line(int argc, char *argv[]) {
int i;
char *dst = saved_command_line;
char *eob = saved_command_line + sizeof(saved_command_line) - 1;
char *rollback = dst;
char *rollback;
for (i = 1; i < argc && dst < eob; i++) {
char *src = argv[i];
@@ -530,10 +526,10 @@ OPENSSL_VERSION_NUMBER >= 0x10100000L /* 1.1.0 or higher */
printf("linked to libxml2 version: %s\n",
xmlParserVersion);
#endif
#if defined(HAVE_JSON_C)
printf("compiled with json-c version: %s\n",
#if defined(HAVE_JSON) && defined(JSON_C_VERSION)
printf("compiled with libjson-c version: %s\n",
JSON_C_VERSION);
printf("linked to json-c version: %s\n",
printf("linked to libjson-c version: %s\n",
json_c_version());
#endif
#if defined(HAVE_ZLIB) && defined(ZLIB_VERSION)
@@ -1096,13 +1092,13 @@ setup(void) {
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"linked to libxml2 version: %s", xmlParserVersion);
#endif
#if defined(HAVE_JSON_C)
#if defined(HAVE_JSON) && defined(JSON_C_VERSION)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"compiled with json-c version: %s", JSON_C_VERSION);
"compiled with libjson-c version: %s", JSON_C_VERSION);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"linked to json-c version: %s", json_c_version());
"linked to libjson-c version: %s", json_c_version());
#endif
#if defined(HAVE_ZLIB) && defined(ZLIB_VERSION)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
+33 -51
View File
@@ -10,12 +10,12 @@
.\" Title: named.conf
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 2019-08-07
.\" Date: 2018-12-07
.\" Manual: BIND9
.\" Source: ISC
.\" Language: English
.\"
.TH "NAMED\&.CONF" "5" "2019\-08\-07" "ISC" "BIND9"
.TH "NAMED\&.CONF" "5" "2018\-12\-07" "ISC" "BIND9"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -97,19 +97,6 @@ dlz \fIstring\fR {
.if n \{\
.RE
.\}
.SH "DNSSEC-KEYS"
.sp
.if n \{\
.RS 4
.\}
.nf
dnssec\-keys { \fIstring\fR ( static\-key |
initial\-key ) \fIinteger\fR \fIinteger\fR \fIinteger\fR
\fIquoted_string\fR; \&.\&.\&. };
.fi
.if n \{\
.RE
.\}
.SH "DYNDB"
.sp
.if n \{\
@@ -162,17 +149,13 @@ logging {
.RE
.\}
.SH "MANAGED-KEYS"
.PP
Deprecated \- see DNSSEC\-KEYS\&.
.sp
.if n \{\
.RS 4
.\}
.nf
managed\-keys { \fIstring\fR ( static\-key
| initial\-key ) \fIinteger\fR
\fIinteger\fR \fIinteger\fR
\fIquoted_string\fR; \&.\&.\&. }; deprecated
managed\-keys { \fIstring\fR \fIstring\fR \fIinteger\fR
\fIinteger\fR \fIinteger\fR \fIquoted_string\fR; \&.\&.\&. };
.fi
.if n \{\
.RE
@@ -242,8 +225,9 @@ options {
check\-spf ( warn | ignore );
check\-srv\-cname ( fail | warn | ignore );
check\-wildcard \fIboolean\fR;
cleaning\-interval \fIinteger\fR;
clients\-per\-query \fIinteger\fR;
cookie\-algorithm ( aes | siphash24 );
cookie\-algorithm ( aes | sha1 | sha256 );
cookie\-secret \fIstring\fR;
coresize ( default | unlimited | \fIsizeval\fR );
datasize ( default | unlimited | \fIsizeval\fR );
@@ -273,7 +257,10 @@ options {
dnsrps\-options { \fIunspecified\-text\fR };
dnssec\-accept\-expired \fIboolean\fR;
dnssec\-dnskey\-kskonly \fIboolean\fR;
dnssec\-enable \fIboolean\fR;
dnssec\-loadkeys\-interval \fIinteger\fR;
dnssec\-lookaside ( \fIstring\fR trust\-anchor
\fIstring\fR | auto | no );
dnssec\-must\-be\-secure \fIstring\fR \fIboolean\fR;
dnssec\-secure\-to\-insecure \fIboolean\fR;
dnssec\-update\-mode ( maintain | no\-resign );
@@ -422,12 +409,11 @@ options {
resolver\-retry\-interval \fIinteger\fR;
response\-padding { \fIaddress_match_element\fR; \&.\&.\&. } block\-size
\fIinteger\fR;
response\-policy { zone \fIstring\fR [ add\-soa \fIboolean\fR ] [ log
\fIboolean\fR ] [ max\-policy\-ttl \fIttlval\fR ] [ min\-update\-interval
\fIttlval\fR ] [ policy ( cname | disabled | drop | given | no\-op |
nodata | nxdomain | passthru | tcp\-only \fIquoted_string\fR ) ] [
recursive\-only \fIboolean\fR ] [ nsip\-enable \fIboolean\fR ] [
nsdname\-enable \fIboolean\fR ]; \&.\&.\&. } [ add\-soa \fIboolean\fR ] [
response\-policy { zone \fIstring\fR [ log \fIboolean\fR ] [ max\-policy\-ttl
\fIttlval\fR ] [ min\-update\-interval \fIttlval\fR ] [ policy ( cname |
disabled | drop | given | no\-op | nodata | nxdomain | passthru
| tcp\-only \fIquoted_string\fR ) ] [ recursive\-only \fIboolean\fR ] [
nsip\-enable \fIboolean\fR ] [ nsdname\-enable \fIboolean\fR ]; \&.\&.\&. } [
break\-dnssec \fIboolean\fR ] [ max\-policy\-ttl \fIttlval\fR ] [
min\-update\-interval \fIttlval\fR ] [ min\-ns\-dots \fIinteger\fR ] [
nsip\-wait\-recurse \fIboolean\fR ] [ qname\-wait\-recurse \fIboolean\fR ]
@@ -565,16 +551,13 @@ statistics\-channels {
.RE
.\}
.SH "TRUSTED-KEYS"
.PP
Deprecated \- see DNSSEC\-KEYS\&.
.sp
.if n \{\
.RS 4
.\}
.nf
trusted\-keys { \fIstring\fR \fIinteger\fR
\fIinteger\fR \fIinteger\fR
\fIquoted_string\fR; \&.\&.\&. }; deprecated
trusted\-keys { \fIstring\fR \fIinteger\fR \fIinteger\fR
\fIinteger\fR \fIquoted_string\fR; \&.\&.\&. };
.fi
.if n \{\
.RE
@@ -624,6 +607,7 @@ view \fIstring\fR [ \fIclass\fR ] {
check\-spf ( warn | ignore );
check\-srv\-cname ( fail | warn | ignore );
check\-wildcard \fIboolean\fR;
cleaning\-interval \fIinteger\fR;
clients\-per\-query \fIinteger\fR;
deny\-answer\-addresses { \fIaddress_match_element\fR; \&.\&.\&. } [
except\-from { \fIstring\fR; \&.\&.\&. } ];
@@ -654,10 +638,10 @@ view \fIstring\fR [ \fIclass\fR ] {
dnsrps\-options { \fIunspecified\-text\fR };
dnssec\-accept\-expired \fIboolean\fR;
dnssec\-dnskey\-kskonly \fIboolean\fR;
dnssec\-keys { \fIstring\fR ( static\-key |
initial\-key ) \fIinteger\fR \fIinteger\fR
\fIinteger\fR \fIquoted_string\fR; \&.\&.\&. };
dnssec\-enable \fIboolean\fR;
dnssec\-loadkeys\-interval \fIinteger\fR;
dnssec\-lookaside ( \fIstring\fR trust\-anchor
\fIstring\fR | auto | no );
dnssec\-must\-be\-secure \fIstring\fR \fIboolean\fR;
dnssec\-secure\-to\-insecure \fIboolean\fR;
dnssec\-update\-mode ( maintain | no\-resign );
@@ -692,11 +676,9 @@ view \fIstring\fR [ \fIclass\fR ] {
key\-directory \fIquoted_string\fR;
lame\-ttl \fIttlval\fR;
lmdb\-mapsize \fIsizeval\fR;
managed\-keys { \fIstring\fR (
static\-key | initial\-key
) \fIinteger\fR \fIinteger\fR
\fIinteger\fR
\fIquoted_string\fR; \&.\&.\&. }; deprecated
managed\-keys { \fIstring\fR \fIstring\fR
\fIinteger\fR \fIinteger\fR \fIinteger\fR
\fIquoted_string\fR; \&.\&.\&. };
masterfile\-format ( map | raw | text );
masterfile\-style ( full | relative );
match\-clients { \fIaddress_match_element\fR; \&.\&.\&. };
@@ -779,12 +761,11 @@ view \fIstring\fR [ \fIclass\fR ] {
resolver\-retry\-interval \fIinteger\fR;
response\-padding { \fIaddress_match_element\fR; \&.\&.\&. } block\-size
\fIinteger\fR;
response\-policy { zone \fIstring\fR [ add\-soa \fIboolean\fR ] [ log
\fIboolean\fR ] [ max\-policy\-ttl \fIttlval\fR ] [ min\-update\-interval
\fIttlval\fR ] [ policy ( cname | disabled | drop | given | no\-op |
nodata | nxdomain | passthru | tcp\-only \fIquoted_string\fR ) ] [
recursive\-only \fIboolean\fR ] [ nsip\-enable \fIboolean\fR ] [
nsdname\-enable \fIboolean\fR ]; \&.\&.\&. } [ add\-soa \fIboolean\fR ] [
response\-policy { zone \fIstring\fR [ log \fIboolean\fR ] [ max\-policy\-ttl
\fIttlval\fR ] [ min\-update\-interval \fIttlval\fR ] [ policy ( cname |
disabled | drop | given | no\-op | nodata | nxdomain | passthru
| tcp\-only \fIquoted_string\fR ) ] [ recursive\-only \fIboolean\fR ] [
nsip\-enable \fIboolean\fR ] [ nsdname\-enable \fIboolean\fR ]; \&.\&.\&. } [
break\-dnssec \fIboolean\fR ] [ max\-policy\-ttl \fIttlval\fR ] [
min\-update\-interval \fIttlval\fR ] [ min\-ns\-dots \fIinteger\fR ] [
nsip\-wait\-recurse \fIboolean\fR ] [ qname\-wait\-recurse \fIboolean\fR ]
@@ -846,10 +827,9 @@ view \fIstring\fR [ \fIclass\fR ] {
transfer\-source\-v6 ( \fIipv6_address\fR | * ) [ port ( \fIinteger\fR | * )
] [ dscp \fIinteger\fR ];
trust\-anchor\-telemetry \fIboolean\fR; // experimental
trusted\-keys { \fIstring\fR
\fIinteger\fR \fIinteger\fR
\fIinteger\fR
\fIquoted_string\fR; \&.\&.\&. }; deprecated
trusted\-keys { \fIstring\fR \fIinteger\fR
\fIinteger\fR \fIinteger\fR \fIquoted_string\fR;
\&.\&.\&. };
try\-tcp\-refresh \fIboolean\fR;
update\-check\-ksk \fIboolean\fR;
use\-alt\-transfer\-source \fIboolean\fR;
@@ -907,6 +887,7 @@ view \fIstring\fR [ \fIclass\fR ] {
masters [ port \fIinteger\fR ] [ dscp \fIinteger\fR ] { ( \fImasters\fR
| \fIipv4_address\fR [ port \fIinteger\fR ] | \fIipv6_address\fR [
port \fIinteger\fR ] ) [ key \fIstring\fR ]; \&.\&.\&. };
max\-ixfr\-log\-size ( default | unlimited |
max\-journal\-size ( default | unlimited | \fIsizeval\fR );
max\-records \fIinteger\fR;
max\-refresh\-time \fIinteger\fR;
@@ -926,6 +907,7 @@ view \fIstring\fR [ \fIclass\fR ] {
notify\-source\-v6 ( \fIipv6_address\fR | * ) [ port ( \fIinteger\fR
| * ) ] [ dscp \fIinteger\fR ];
notify\-to\-soa \fIboolean\fR;
pubkey \fIinteger\fR \fIinteger\fR \fIinteger\fR
request\-expire \fIboolean\fR;
request\-ixfr \fIboolean\fR;
serial\-update\-method ( date | increment | unixtime );
+48 -43
View File
@@ -13,7 +13,7 @@
<refentry xmlns:db="http://docbook.org/ns/docbook" version="5.0" xml:id="man.named.conf">
<info>
<date>2019-08-07</date>
<date>2018-12-07</date>
</info>
<refentryinfo>
<corpname>ISC</corpname>
@@ -80,12 +80,14 @@
</refsection>
<refsection><info><title>ACL</title></info>
<literallayout class="normal">
acl <replaceable>string</replaceable> { <replaceable>address_match_element</replaceable>; ... };
</literallayout>
</refsection>
<refsection><info><title>CONTROLS</title></info>
<literallayout class="normal">
controls {
inet ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> |
@@ -102,6 +104,7 @@ controls {
</refsection>
<refsection><info><title>DLZ</title></info>
<literallayout class="normal">
dlz <replaceable>string</replaceable> {
database <replaceable>string</replaceable>;
@@ -110,15 +113,8 @@ dlz <replaceable>string</replaceable> {
</literallayout>
</refsection>
<refsection><info><title>DNSSEC-KEYS</title></info>
<literallayout class="normal">
dnssec-keys { <replaceable>string</replaceable> ( static-key |
initial-key ) <replaceable>integer</replaceable> <replaceable>integer</replaceable> <replaceable>integer</replaceable>
<replaceable>quoted_string</replaceable>; ... };
</literallayout>
</refsection>
<refsection><info><title>DYNDB</title></info>
<literallayout class="normal">
dyndb <replaceable>string</replaceable> <replaceable>quoted_string</replaceable> {
<replaceable>unspecified-text</replaceable> };
@@ -126,6 +122,7 @@ dyndb <replaceable>string</replaceable> <replaceable>quoted_string</replaceable>
</refsection>
<refsection><info><title>KEY</title></info>
<literallayout class="normal">
key <replaceable>string</replaceable> {
algorithm <replaceable>string</replaceable>;
@@ -135,6 +132,7 @@ key <replaceable>string</replaceable> {
</refsection>
<refsection><info><title>LOGGING</title></info>
<literallayout class="normal">
logging {
category <replaceable>string</replaceable> { <replaceable>string</replaceable>; ... };
@@ -154,17 +152,17 @@ logging {
</literallayout>
</refsection>
<refsection><info><title>MANAGED-KEYS</title></info>
<para>Deprecated - see DNSSEC-KEYS.</para>
<literallayout class="normal">
managed-keys { <replaceable>string</replaceable> ( static-key
| initial-key ) <replaceable>integer</replaceable>
<replaceable>integer</replaceable> <replaceable>integer</replaceable>
<replaceable>quoted_string</replaceable>; ... }; deprecated
managed-keys { <replaceable>string</replaceable> <replaceable>string</replaceable> <replaceable>integer</replaceable>
<replaceable>integer</replaceable> <replaceable>integer</replaceable> <replaceable>quoted_string</replaceable>; ... };
</literallayout>
</refsection>
<refsection><info><title>MASTERS</title></info>
<literallayout class="normal">
masters <replaceable>string</replaceable> [ port <replaceable>integer</replaceable> ] [ dscp
<replaceable>integer</replaceable> ] { ( <replaceable>masters</replaceable> | <replaceable>ipv4_address</replaceable> [
@@ -174,6 +172,7 @@ masters <replaceable>string</replaceable> [ port <replaceable>integer</replaceab
</refsection>
<refsection><info><title>OPTIONS</title></info>
<literallayout class="normal">
options {
allow-new-zones <replaceable>boolean</replaceable>;
@@ -220,8 +219,9 @@ options {
check-spf ( warn | ignore );
check-srv-cname ( fail | warn | ignore );
check-wildcard <replaceable>boolean</replaceable>;
cleaning-interval <replaceable>integer</replaceable>;
clients-per-query <replaceable>integer</replaceable>;
cookie-algorithm ( aes | siphash24 );
cookie-algorithm ( aes | sha1 | sha256 );
cookie-secret <replaceable>string</replaceable>;
coresize ( default | unlimited | <replaceable>sizeval</replaceable> );
datasize ( default | unlimited | <replaceable>sizeval</replaceable> );
@@ -251,7 +251,10 @@ options {
dnsrps-options { <replaceable>unspecified-text</replaceable> };
dnssec-accept-expired <replaceable>boolean</replaceable>;
dnssec-dnskey-kskonly <replaceable>boolean</replaceable>;
dnssec-enable <replaceable>boolean</replaceable>;
dnssec-loadkeys-interval <replaceable>integer</replaceable>;
dnssec-lookaside ( <replaceable>string</replaceable> trust-anchor
<replaceable>string</replaceable> | auto | no );
dnssec-must-be-secure <replaceable>string</replaceable> <replaceable>boolean</replaceable>;
dnssec-secure-to-insecure <replaceable>boolean</replaceable>;
dnssec-update-mode ( maintain | no-resign );
@@ -400,12 +403,11 @@ options {
resolver-retry-interval <replaceable>integer</replaceable>;
response-padding { <replaceable>address_match_element</replaceable>; ... } block-size
<replaceable>integer</replaceable>;
response-policy { zone <replaceable>string</replaceable> [ add-soa <replaceable>boolean</replaceable> ] [ log
<replaceable>boolean</replaceable> ] [ max-policy-ttl <replaceable>ttlval</replaceable> ] [ min-update-interval
<replaceable>ttlval</replaceable> ] [ policy ( cname | disabled | drop | given | no-op |
nodata | nxdomain | passthru | tcp-only <replaceable>quoted_string</replaceable> ) ] [
recursive-only <replaceable>boolean</replaceable> ] [ nsip-enable <replaceable>boolean</replaceable> ] [
nsdname-enable <replaceable>boolean</replaceable> ]; ... } [ add-soa <replaceable>boolean</replaceable> ] [
response-policy { zone <replaceable>string</replaceable> [ log <replaceable>boolean</replaceable> ] [ max-policy-ttl
<replaceable>ttlval</replaceable> ] [ min-update-interval <replaceable>ttlval</replaceable> ] [ policy ( cname |
disabled | drop | given | no-op | nodata | nxdomain | passthru
| tcp-only <replaceable>quoted_string</replaceable> ) ] [ recursive-only <replaceable>boolean</replaceable> ] [
nsip-enable <replaceable>boolean</replaceable> ] [ nsdname-enable <replaceable>boolean</replaceable> ]; ... } [
break-dnssec <replaceable>boolean</replaceable> ] [ max-policy-ttl <replaceable>ttlval</replaceable> ] [
min-update-interval <replaceable>ttlval</replaceable> ] [ min-ns-dots <replaceable>integer</replaceable> ] [
nsip-wait-recurse <replaceable>boolean</replaceable> ] [ qname-wait-recurse <replaceable>boolean</replaceable> ]
@@ -472,6 +474,7 @@ options {
</refsection>
<refsection><info><title>PLUGIN</title></info>
<literallayout class="normal">
plugin ( query ) <replaceable>string</replaceable> [ { <replaceable>unspecified-text</replaceable>
} ];
@@ -479,6 +482,7 @@ plugin ( query ) <replaceable>string</replaceable> [ { <replaceable>unspecified-
</refsection>
<refsection><info><title>SERVER</title></info>
<literallayout class="normal">
server <replaceable>netprefix</replaceable> {
bogus <replaceable>boolean</replaceable>;
@@ -516,6 +520,7 @@ server <replaceable>netprefix</replaceable> {
</refsection>
<refsection><info><title>STATISTICS-CHANNELS</title></info>
<literallayout class="normal">
statistics-channels {
inet ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> |
@@ -527,15 +532,15 @@ statistics-channels {
</refsection>
<refsection><info><title>TRUSTED-KEYS</title></info>
<para>Deprecated - see DNSSEC-KEYS.</para>
<literallayout class="normal">
trusted-keys { <replaceable>string</replaceable> <replaceable>integer</replaceable>
<replaceable>integer</replaceable> <replaceable>integer</replaceable>
<replaceable>quoted_string</replaceable>; ... }; deprecated
trusted-keys { <replaceable>string</replaceable> <replaceable>integer</replaceable> <replaceable>integer</replaceable>
<replaceable>integer</replaceable> <replaceable>quoted_string</replaceable>; ... };
</literallayout>
</refsection>
<refsection><info><title>VIEW</title></info>
<literallayout class="normal">
view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
allow-new-zones <replaceable>boolean</replaceable>;
@@ -576,6 +581,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
check-spf ( warn | ignore );
check-srv-cname ( fail | warn | ignore );
check-wildcard <replaceable>boolean</replaceable>;
cleaning-interval <replaceable>integer</replaceable>;
clients-per-query <replaceable>integer</replaceable>;
deny-answer-addresses { <replaceable>address_match_element</replaceable>; ... } [
except-from { <replaceable>string</replaceable>; ... } ];
@@ -606,10 +612,10 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
dnsrps-options { <replaceable>unspecified-text</replaceable> };
dnssec-accept-expired <replaceable>boolean</replaceable>;
dnssec-dnskey-kskonly <replaceable>boolean</replaceable>;
dnssec-keys { <replaceable>string</replaceable> ( static-key |
initial-key ) <replaceable>integer</replaceable> <replaceable>integer</replaceable>
<replaceable>integer</replaceable> <replaceable>quoted_string</replaceable>; ... };
dnssec-enable <replaceable>boolean</replaceable>;
dnssec-loadkeys-interval <replaceable>integer</replaceable>;
dnssec-lookaside ( <replaceable>string</replaceable> trust-anchor
<replaceable>string</replaceable> | auto | no );
dnssec-must-be-secure <replaceable>string</replaceable> <replaceable>boolean</replaceable>;
dnssec-secure-to-insecure <replaceable>boolean</replaceable>;
dnssec-update-mode ( maintain | no-resign );
@@ -644,11 +650,9 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
key-directory <replaceable>quoted_string</replaceable>;
lame-ttl <replaceable>ttlval</replaceable>;
lmdb-mapsize <replaceable>sizeval</replaceable>;
managed-keys { <replaceable>string</replaceable> (
static-key | initial-key
) <replaceable>integer</replaceable> <replaceable>integer</replaceable>
<replaceable>integer</replaceable>
<replaceable>quoted_string</replaceable>; ... }; deprecated
managed-keys { <replaceable>string</replaceable> <replaceable>string</replaceable>
<replaceable>integer</replaceable> <replaceable>integer</replaceable> <replaceable>integer</replaceable>
<replaceable>quoted_string</replaceable>; ... };
masterfile-format ( map | raw | text );
masterfile-style ( full | relative );
match-clients { <replaceable>address_match_element</replaceable>; ... };
@@ -731,12 +735,11 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
resolver-retry-interval <replaceable>integer</replaceable>;
response-padding { <replaceable>address_match_element</replaceable>; ... } block-size
<replaceable>integer</replaceable>;
response-policy { zone <replaceable>string</replaceable> [ add-soa <replaceable>boolean</replaceable> ] [ log
<replaceable>boolean</replaceable> ] [ max-policy-ttl <replaceable>ttlval</replaceable> ] [ min-update-interval
<replaceable>ttlval</replaceable> ] [ policy ( cname | disabled | drop | given | no-op |
nodata | nxdomain | passthru | tcp-only <replaceable>quoted_string</replaceable> ) ] [
recursive-only <replaceable>boolean</replaceable> ] [ nsip-enable <replaceable>boolean</replaceable> ] [
nsdname-enable <replaceable>boolean</replaceable> ]; ... } [ add-soa <replaceable>boolean</replaceable> ] [
response-policy { zone <replaceable>string</replaceable> [ log <replaceable>boolean</replaceable> ] [ max-policy-ttl
<replaceable>ttlval</replaceable> ] [ min-update-interval <replaceable>ttlval</replaceable> ] [ policy ( cname |
disabled | drop | given | no-op | nodata | nxdomain | passthru
| tcp-only <replaceable>quoted_string</replaceable> ) ] [ recursive-only <replaceable>boolean</replaceable> ] [
nsip-enable <replaceable>boolean</replaceable> ] [ nsdname-enable <replaceable>boolean</replaceable> ]; ... } [
break-dnssec <replaceable>boolean</replaceable> ] [ max-policy-ttl <replaceable>ttlval</replaceable> ] [
min-update-interval <replaceable>ttlval</replaceable> ] [ min-ns-dots <replaceable>integer</replaceable> ] [
nsip-wait-recurse <replaceable>boolean</replaceable> ] [ qname-wait-recurse <replaceable>boolean</replaceable> ]
@@ -798,10 +801,9 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
transfer-source-v6 ( <replaceable>ipv6_address</replaceable> | * ) [ port ( <replaceable>integer</replaceable> | * )
] [ dscp <replaceable>integer</replaceable> ];
trust-anchor-telemetry <replaceable>boolean</replaceable>; // experimental
trusted-keys { <replaceable>string</replaceable>
<replaceable>integer</replaceable> <replaceable>integer</replaceable>
<replaceable>integer</replaceable>
<replaceable>quoted_string</replaceable>; ... }; deprecated
trusted-keys { <replaceable>string</replaceable> <replaceable>integer</replaceable>
<replaceable>integer</replaceable> <replaceable>integer</replaceable> <replaceable>quoted_string</replaceable>;
... };
try-tcp-refresh <replaceable>boolean</replaceable>;
update-check-ksk <replaceable>boolean</replaceable>;
use-alt-transfer-source <replaceable>boolean</replaceable>;
@@ -859,6 +861,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
masters [ port <replaceable>integer</replaceable> ] [ dscp <replaceable>integer</replaceable> ] { ( <replaceable>masters</replaceable>
| <replaceable>ipv4_address</replaceable> [ port <replaceable>integer</replaceable> ] | <replaceable>ipv6_address</replaceable> [
port <replaceable>integer</replaceable> ] ) [ key <replaceable>string</replaceable> ]; ... };
max-ixfr-log-size ( default | unlimited |
max-journal-size ( default | unlimited | <replaceable>sizeval</replaceable> );
max-records <replaceable>integer</replaceable>;
max-refresh-time <replaceable>integer</replaceable>;
@@ -878,6 +881,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
notify-source-v6 ( <replaceable>ipv6_address</replaceable> | * ) [ port ( <replaceable>integer</replaceable>
| * ) ] [ dscp <replaceable>integer</replaceable> ];
notify-to-soa <replaceable>boolean</replaceable>;
pubkey <replaceable>integer</replaceable> <replaceable>integer</replaceable> <replaceable>integer</replaceable>
request-expire <replaceable>boolean</replaceable>;
request-ixfr <replaceable>boolean</replaceable>;
serial-update-method ( date | increment | unixtime );
@@ -911,6 +915,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
</refsection>
<refsection><info><title>ZONE</title></info>
<literallayout class="normal">
zone <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
allow-notify { <replaceable>address_match_element</replaceable>; ... };
+60 -56
View File
@@ -59,6 +59,7 @@
<div class="refsection">
<a name="id-1.8"></a><h2>ACL</h2>
<div class="literallayout"><p><br>
acl <em class="replaceable"><code>string</code></em> { <em class="replaceable"><code>address_match_element</code></em>; ... };<br>
</p></div>
@@ -66,6 +67,7 @@ acl
<div class="refsection">
<a name="id-1.9"></a><h2>CONTROLS</h2>
<div class="literallayout"><p><br>
controls {<br>
inet ( <em class="replaceable"><code>ipv4_address</code></em> | <em class="replaceable"><code>ipv6_address</code></em> |<br>
@@ -83,6 +85,7 @@ controls
<div class="refsection">
<a name="id-1.10"></a><h2>DLZ</h2>
<div class="literallayout"><p><br>
dlz <em class="replaceable"><code>string</code></em> {<br>
database <em class="replaceable"><code>string</code></em>;<br>
@@ -92,16 +95,8 @@ dlz
</div>
<div class="refsection">
<a name="id-1.11"></a><h2>DNSSEC-KEYS</h2>
<div class="literallayout"><p><br>
dnssec-keys { <em class="replaceable"><code>string</code></em> ( static-key |<br>
    initial-key ) <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
</p></div>
</div>
<a name="id-1.11"></a><h2>DYNDB</h2>
<div class="refsection">
<a name="id-1.12"></a><h2>DYNDB</h2>
<div class="literallayout"><p><br>
dyndb <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>quoted_string</code></em> {<br>
    <em class="replaceable"><code>unspecified-text</code></em> };<br>
@@ -109,7 +104,8 @@ dyndb
</div>
<div class="refsection">
<a name="id-1.13"></a><h2>KEY</h2>
<a name="id-1.12"></a><h2>KEY</h2>
<div class="literallayout"><p><br>
key <em class="replaceable"><code>string</code></em> {<br>
algorithm <em class="replaceable"><code>string</code></em>;<br>
@@ -119,7 +115,8 @@ key
</div>
<div class="refsection">
<a name="id-1.14"></a><h2>LOGGING</h2>
<a name="id-1.13"></a><h2>LOGGING</h2>
<div class="literallayout"><p><br>
logging {<br>
category <em class="replaceable"><code>string</code></em> { <em class="replaceable"><code>string</code></em>; ... };<br>
@@ -139,19 +136,19 @@ logging
</p></div>
</div>
<div class="refsection">
<a name="id-1.15"></a><h2>MANAGED-KEYS</h2>
<p>Deprecated - see DNSSEC-KEYS.</p>
<a name="id-1.14"></a><h2>MANAGED-KEYS</h2>
<div class="literallayout"><p><br>
managed-keys { <em class="replaceable"><code>string</code></em> ( static-key<br>
    | initial-key ) <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>quoted_string</code></em>; ... }; deprecated<br>
managed-keys { <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
</p></div>
</div>
<div class="refsection">
<a name="id-1.16"></a><h2>MASTERS</h2>
<a name="id-1.15"></a><h2>MASTERS</h2>
<div class="literallayout"><p><br>
masters <em class="replaceable"><code>string</code></em> [ port <em class="replaceable"><code>integer</code></em> ] [ dscp<br>
    <em class="replaceable"><code>integer</code></em> ] { ( <em class="replaceable"><code>masters</code></em> | <em class="replaceable"><code>ipv4_address</code></em> [<br>
@@ -161,7 +158,8 @@ masters
</div>
<div class="refsection">
<a name="id-1.17"></a><h2>OPTIONS</h2>
<a name="id-1.16"></a><h2>OPTIONS</h2>
<div class="literallayout"><p><br>
options {<br>
allow-new-zones <em class="replaceable"><code>boolean</code></em>;<br>
@@ -208,8 +206,9 @@ options
check-spf ( warn | ignore );<br>
check-srv-cname ( fail | warn | ignore );<br>
check-wildcard <em class="replaceable"><code>boolean</code></em>;<br>
cleaning-interval <em class="replaceable"><code>integer</code></em>;<br>
clients-per-query <em class="replaceable"><code>integer</code></em>;<br>
cookie-algorithm ( aes | siphash24 );<br>
cookie-algorithm ( aes | sha1 | sha256 );<br>
cookie-secret <em class="replaceable"><code>string</code></em>;<br>
coresize ( default | unlimited | <em class="replaceable"><code>sizeval</code></em> );<br>
datasize ( default | unlimited | <em class="replaceable"><code>sizeval</code></em> );<br>
@@ -239,7 +238,10 @@ options
dnsrps-options { <em class="replaceable"><code>unspecified-text</code></em> };<br>
dnssec-accept-expired <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-dnskey-kskonly <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-enable <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-loadkeys-interval <em class="replaceable"><code>integer</code></em>;<br>
dnssec-lookaside ( <em class="replaceable"><code>string</code></em> trust-anchor<br>
    <em class="replaceable"><code>string</code></em> | auto | no );<br>
dnssec-must-be-secure <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-secure-to-insecure <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-update-mode ( maintain | no-resign );<br>
@@ -388,12 +390,11 @@ options
resolver-retry-interval <em class="replaceable"><code>integer</code></em>;<br>
response-padding { <em class="replaceable"><code>address_match_element</code></em>; ... } block-size<br>
    <em class="replaceable"><code>integer</code></em>;<br>
response-policy { zone <em class="replaceable"><code>string</code></em> [ add-soa <em class="replaceable"><code>boolean</code></em> ] [ log<br>
    <em class="replaceable"><code>boolean</code></em> ] [ max-policy-ttl <em class="replaceable"><code>ttlval</code></em> ] [ min-update-interval<br>
    <em class="replaceable"><code>ttlval</code></em> ] [ policy ( cname | disabled | drop | given | no-op |<br>
    nodata | nxdomain | passthru | tcp-only <em class="replaceable"><code>quoted_string</code></em> ) ] [<br>
    recursive-only <em class="replaceable"><code>boolean</code></em> ] [ nsip-enable <em class="replaceable"><code>boolean</code></em> ] [<br>
    nsdname-enable <em class="replaceable"><code>boolean</code></em> ]; ... } [ add-soa <em class="replaceable"><code>boolean</code></em> ] [<br>
response-policy { zone <em class="replaceable"><code>string</code></em> [ log <em class="replaceable"><code>boolean</code></em> ] [ max-policy-ttl<br>
    <em class="replaceable"><code>ttlval</code></em> ] [ min-update-interval <em class="replaceable"><code>ttlval</code></em> ] [ policy ( cname |<br>
    disabled | drop | given | no-op | nodata | nxdomain | passthru<br>
    | tcp-only <em class="replaceable"><code>quoted_string</code></em> ) ] [ recursive-only <em class="replaceable"><code>boolean</code></em> ] [<br>
    nsip-enable <em class="replaceable"><code>boolean</code></em> ] [ nsdname-enable <em class="replaceable"><code>boolean</code></em> ]; ... } [<br>
    break-dnssec <em class="replaceable"><code>boolean</code></em> ] [ max-policy-ttl <em class="replaceable"><code>ttlval</code></em> ] [<br>
    min-update-interval <em class="replaceable"><code>ttlval</code></em> ] [ min-ns-dots <em class="replaceable"><code>integer</code></em> ] [<br>
    nsip-wait-recurse <em class="replaceable"><code>boolean</code></em> ] [ qname-wait-recurse <em class="replaceable"><code>boolean</code></em> ]<br>
@@ -460,7 +461,8 @@ options
</div>
<div class="refsection">
<a name="id-1.18"></a><h2>PLUGIN</h2>
<a name="id-1.17"></a><h2>PLUGIN</h2>
<div class="literallayout"><p><br>
plugin ( query ) <em class="replaceable"><code>string</code></em> [ { <em class="replaceable"><code>unspecified-text</code></em><br>
    } ];<br>
@@ -468,7 +470,8 @@ plugin
</div>
<div class="refsection">
<a name="id-1.19"></a><h2>SERVER</h2>
<a name="id-1.18"></a><h2>SERVER</h2>
<div class="literallayout"><p><br>
server <em class="replaceable"><code>netprefix</code></em> {<br>
bogus <em class="replaceable"><code>boolean</code></em>;<br>
@@ -506,7 +509,8 @@ server
</div>
<div class="refsection">
<a name="id-1.20"></a><h2>STATISTICS-CHANNELS</h2>
<a name="id-1.19"></a><h2>STATISTICS-CHANNELS</h2>
<div class="literallayout"><p><br>
statistics-channels {<br>
inet ( <em class="replaceable"><code>ipv4_address</code></em> | <em class="replaceable"><code>ipv6_address</code></em> |<br>
@@ -518,17 +522,17 @@ statistics-channels
</div>
<div class="refsection">
<a name="id-1.21"></a><h2>TRUSTED-KEYS</h2>
<p>Deprecated - see DNSSEC-KEYS.</p>
<a name="id-1.20"></a><h2>TRUSTED-KEYS</h2>
<div class="literallayout"><p><br>
trusted-keys { <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>quoted_string</code></em>; ... }; deprecated<br>
trusted-keys { <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
</p></div>
</div>
<div class="refsection">
<a name="id-1.22"></a><h2>VIEW</h2>
<a name="id-1.21"></a><h2>VIEW</h2>
<div class="literallayout"><p><br>
view <em class="replaceable"><code>string</code></em> [ <em class="replaceable"><code>class</code></em> ] {<br>
allow-new-zones <em class="replaceable"><code>boolean</code></em>;<br>
@@ -569,6 +573,7 @@ view
check-spf ( warn | ignore );<br>
check-srv-cname ( fail | warn | ignore );<br>
check-wildcard <em class="replaceable"><code>boolean</code></em>;<br>
cleaning-interval <em class="replaceable"><code>integer</code></em>;<br>
clients-per-query <em class="replaceable"><code>integer</code></em>;<br>
deny-answer-addresses { <em class="replaceable"><code>address_match_element</code></em>; ... } [<br>
    except-from { <em class="replaceable"><code>string</code></em>; ... } ];<br>
@@ -599,10 +604,10 @@ view
dnsrps-options { <em class="replaceable"><code>unspecified-text</code></em> };<br>
dnssec-accept-expired <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-dnskey-kskonly <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-keys { <em class="replaceable"><code>string</code></em> ( static-key |<br>
    initial-key ) <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
dnssec-enable <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-loadkeys-interval <em class="replaceable"><code>integer</code></em>;<br>
dnssec-lookaside ( <em class="replaceable"><code>string</code></em> trust-anchor<br>
    <em class="replaceable"><code>string</code></em> | auto | no );<br>
dnssec-must-be-secure <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-secure-to-insecure <em class="replaceable"><code>boolean</code></em>;<br>
dnssec-update-mode ( maintain | no-resign );<br>
@@ -637,11 +642,9 @@ view
key-directory <em class="replaceable"><code>quoted_string</code></em>;<br>
lame-ttl <em class="replaceable"><code>ttlval</code></em>;<br>
lmdb-mapsize <em class="replaceable"><code>sizeval</code></em>;<br>
managed-keys { <em class="replaceable"><code>string</code></em> (<br>
    static-key | initial-key<br>
    ) <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>quoted_string</code></em>; ... }; deprecated<br>
managed-keys { <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>string</code></em><br>
    <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
masterfile-format ( map | raw | text );<br>
masterfile-style ( full | relative );<br>
match-clients { <em class="replaceable"><code>address_match_element</code></em>; ... };<br>
@@ -724,12 +727,11 @@ view
resolver-retry-interval <em class="replaceable"><code>integer</code></em>;<br>
response-padding { <em class="replaceable"><code>address_match_element</code></em>; ... } block-size<br>
    <em class="replaceable"><code>integer</code></em>;<br>
response-policy { zone <em class="replaceable"><code>string</code></em> [ add-soa <em class="replaceable"><code>boolean</code></em> ] [ log<br>
    <em class="replaceable"><code>boolean</code></em> ] [ max-policy-ttl <em class="replaceable"><code>ttlval</code></em> ] [ min-update-interval<br>
    <em class="replaceable"><code>ttlval</code></em> ] [ policy ( cname | disabled | drop | given | no-op |<br>
    nodata | nxdomain | passthru | tcp-only <em class="replaceable"><code>quoted_string</code></em> ) ] [<br>
    recursive-only <em class="replaceable"><code>boolean</code></em> ] [ nsip-enable <em class="replaceable"><code>boolean</code></em> ] [<br>
    nsdname-enable <em class="replaceable"><code>boolean</code></em> ]; ... } [ add-soa <em class="replaceable"><code>boolean</code></em> ] [<br>
response-policy { zone <em class="replaceable"><code>string</code></em> [ log <em class="replaceable"><code>boolean</code></em> ] [ max-policy-ttl<br>
    <em class="replaceable"><code>ttlval</code></em> ] [ min-update-interval <em class="replaceable"><code>ttlval</code></em> ] [ policy ( cname |<br>
    disabled | drop | given | no-op | nodata | nxdomain | passthru<br>
    | tcp-only <em class="replaceable"><code>quoted_string</code></em> ) ] [ recursive-only <em class="replaceable"><code>boolean</code></em> ] [<br>
    nsip-enable <em class="replaceable"><code>boolean</code></em> ] [ nsdname-enable <em class="replaceable"><code>boolean</code></em> ]; ... } [<br>
    break-dnssec <em class="replaceable"><code>boolean</code></em> ] [ max-policy-ttl <em class="replaceable"><code>ttlval</code></em> ] [<br>
    min-update-interval <em class="replaceable"><code>ttlval</code></em> ] [ min-ns-dots <em class="replaceable"><code>integer</code></em> ] [<br>
    nsip-wait-recurse <em class="replaceable"><code>boolean</code></em> ] [ qname-wait-recurse <em class="replaceable"><code>boolean</code></em> ]<br>
@@ -791,10 +793,9 @@ view
transfer-source-v6 ( <em class="replaceable"><code>ipv6_address</code></em> | * ) [ port ( <em class="replaceable"><code>integer</code></em> | * )<br>
    ] [ dscp <em class="replaceable"><code>integer</code></em> ];<br>
trust-anchor-telemetry <em class="replaceable"><code>boolean</code></em>; // experimental<br>
trusted-keys { <em class="replaceable"><code>string</code></em><br>
    <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>quoted_string</code></em>; ... }; deprecated<br>
trusted-keys { <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>integer</code></em><br>
    <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>quoted_string</code></em>;<br>
    ... };<br>
try-tcp-refresh <em class="replaceable"><code>boolean</code></em>;<br>
update-check-ksk <em class="replaceable"><code>boolean</code></em>;<br>
use-alt-transfer-source <em class="replaceable"><code>boolean</code></em>;<br>
@@ -852,6 +853,7 @@ view
masters [ port <em class="replaceable"><code>integer</code></em> ] [ dscp <em class="replaceable"><code>integer</code></em> ] { ( <em class="replaceable"><code>masters</code></em><br>
    | <em class="replaceable"><code>ipv4_address</code></em> [ port <em class="replaceable"><code>integer</code></em> ] | <em class="replaceable"><code>ipv6_address</code></em> [<br>
    port <em class="replaceable"><code>integer</code></em> ] ) [ key <em class="replaceable"><code>string</code></em> ]; ... };<br>
max-ixfr-log-size ( default | unlimited |<br>
max-journal-size ( default | unlimited | <em class="replaceable"><code>sizeval</code></em> );<br>
max-records <em class="replaceable"><code>integer</code></em>;<br>
max-refresh-time <em class="replaceable"><code>integer</code></em>;<br>
@@ -871,6 +873,7 @@ view
notify-source-v6 ( <em class="replaceable"><code>ipv6_address</code></em> | * ) [ port ( <em class="replaceable"><code>integer</code></em><br>
    | * ) ] [ dscp <em class="replaceable"><code>integer</code></em> ];<br>
notify-to-soa <em class="replaceable"><code>boolean</code></em>;<br>
pubkey <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em> <em class="replaceable"><code>integer</code></em><br>
request-expire <em class="replaceable"><code>boolean</code></em>;<br>
request-ixfr <em class="replaceable"><code>boolean</code></em>;<br>
serial-update-method ( date | increment | unixtime );<br>
@@ -904,7 +907,8 @@ view
</div>
<div class="refsection">
<a name="id-1.23"></a><h2>ZONE</h2>
<a name="id-1.22"></a><h2>ZONE</h2>
<div class="literallayout"><p><br>
zone <em class="replaceable"><code>string</code></em> [ <em class="replaceable"><code>class</code></em> ] {<br>
allow-notify { <em class="replaceable"><code>address_match_element</code></em>; ... };<br>
@@ -1003,14 +1007,14 @@ zone
</div>
<div class="refsection">
<a name="id-1.24"></a><h2>FILES</h2>
<a name="id-1.23"></a><h2>FILES</h2>
<p><code class="filename">/etc/named.conf</code>
</p>
</div>
<div class="refsection">
<a name="id-1.25"></a><h2>SEE ALSO</h2>
<a name="id-1.24"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry">
<span class="refentrytitle">ddns-confgen</span>(8)
+249 -131
View File
@@ -39,7 +39,6 @@
#include <isc/print.h>
#include <isc/refcount.h>
#include <isc/resource.h>
#include <isc/siphash.h>
#include <isc/socket.h>
#include <isc/stat.h>
#include <isc/stats.h>
@@ -48,6 +47,7 @@
#include <isc/task.h>
#include <isc/timer.h>
#include <isc/util.h>
#include <isc/xml.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
@@ -106,9 +106,9 @@
#include <named/config.h>
#include <named/control.h>
#if defined(HAVE_GEOIP2)
#ifdef HAVE_GEOIP
#include <named/geoip.h>
#endif /* HAVE_GEOIP2 */
#endif /* HAVE_GEOIP */
#include <named/log.h>
#include <named/logconf.h>
#include <named/main.h>
@@ -700,9 +700,11 @@ configure_view_nametable(const cfg_obj_t *vconfig, const cfg_obj_t *config,
}
static isc_result_t
dstkey_fromconfig(const cfg_obj_t *key, bool *initialp, dst_key_t **target,
const char **keynamestrp, isc_mem_t *mctx)
dstkey_fromconfig(const cfg_obj_t *vconfig, const cfg_obj_t *key,
bool managed, dst_key_t **target, const char **keynamestrp,
isc_mem_t *mctx)
{
dns_rdataclass_t viewclass;
dns_rdata_dnskey_t keystruct;
uint32_t flags, proto, alg;
const char *keystr, *keynamestr;
@@ -727,15 +729,13 @@ dstkey_fromconfig(const cfg_obj_t *key, bool *initialp, dst_key_t **target,
keynamestr = cfg_obj_asstring(cfg_tuple_get(key, "name"));
*keynamestrp = keynamestr;
if (*initialp) {
if (managed) {
const char *initmethod;
initmethod = cfg_obj_asstring(cfg_tuple_get(key, "init"));
if (strcasecmp(initmethod, "static-key") == 0) {
*initialp = false;
} else if (strcasecmp(initmethod, "initial-key") != 0) {
if (strcasecmp(initmethod, "initial-key") != 0) {
cfg_obj_log(key, named_g_lctx, ISC_LOG_ERROR,
"key '%s': "
"managed key '%s': "
"invalid initialization method '%s'",
keynamestr, initmethod);
result = ISC_R_FAILURE;
@@ -743,12 +743,15 @@ dstkey_fromconfig(const cfg_obj_t *key, bool *initialp, dst_key_t **target,
}
}
/*
* This function should never be reached for non-IN classes.
*/
keystruct.common.rdclass = dns_rdataclass_in;
if (vconfig == NULL)
viewclass = dns_rdataclass_in;
else {
const cfg_obj_t *classobj = cfg_tuple_get(vconfig, "class");
CHECK(named_config_getclass(classobj, dns_rdataclass_in,
&viewclass));
}
keystruct.common.rdclass = viewclass;
keystruct.common.rdtype = dns_rdatatype_dnskey;
/*
* The key data in keystruct is not dynamically allocated.
*/
@@ -779,12 +782,10 @@ dstkey_fromconfig(const cfg_obj_t *key, bool *initialp, dst_key_t **target,
if ((keystruct.algorithm == DST_ALG_RSASHA1) &&
r.length > 1 && r.base[0] == 1 && r.base[1] == 3)
{
cfg_obj_log(key, named_g_lctx, ISC_LOG_WARNING,
"%s '%s' has a weak exponent",
*initialp ? "initial-key" : "static-key",
"%s key '%s' has a weak exponent",
managed ? "managed" : "trusted",
keynamestr);
}
CHECK(dns_rdata_fromstruct(NULL,
keystruct.common.rdclass,
@@ -794,7 +795,7 @@ dstkey_fromconfig(const cfg_obj_t *key, bool *initialp, dst_key_t **target,
isc_buffer_constinit(&namebuf, keynamestr, strlen(keynamestr));
isc_buffer_add(&namebuf, strlen(keynamestr));
CHECK(dns_name_fromtext(keyname, &namebuf, dns_rootname, 0, NULL));
CHECK(dst_key_fromdns(keyname, dns_rdataclass_in, &rrdatabuf,
CHECK(dst_key_fromdns(keyname, viewclass, &rrdatabuf,
mctx, &dstkey));
*target = dstkey;
@@ -820,19 +821,18 @@ dstkey_fromconfig(const cfg_obj_t *key, bool *initialp, dst_key_t **target,
* the memory context to use for allocating memory.
*/
static isc_result_t
process_key(const cfg_obj_t *key, dns_keytable_t *secroots,
const dns_name_t *keyname_match, dns_resolver_t *resolver,
bool managed, isc_mem_t *mctx)
process_key(const cfg_obj_t *key, const cfg_obj_t *vconfig,
dns_keytable_t *secroots, const dns_name_t *keyname_match,
dns_resolver_t *resolver, bool managed, isc_mem_t *mctx)
{
const dns_name_t *keyname = NULL;
const char *keynamestr = NULL;
dst_key_t *dstkey = NULL;
unsigned int keyalg;
isc_result_t result;
bool initializing = managed;
result = dstkey_fromconfig(key, &initializing,
&dstkey, &keynamestr, mctx);
result = dstkey_fromconfig(vconfig, key, managed, &dstkey, &keynamestr,
mctx);
switch (result) {
case ISC_R_SUCCESS:
@@ -851,8 +851,8 @@ process_key(const cfg_obj_t *key, dns_keytable_t *secroots,
* but do not prevent any further ones from being processed.
*/
cfg_obj_log(key, named_g_lctx, ISC_LOG_WARNING,
"ignoring %s for '%s': %s",
initializing ? "initial-key" : "static-key",
"ignoring %s key for '%s': %s",
managed ? "managed" : "trusted",
keynamestr, isc_result_totext(result));
return (ISC_R_SUCCESS);
case DST_R_NOCRYPTO:
@@ -860,8 +860,8 @@ process_key(const cfg_obj_t *key, dns_keytable_t *secroots,
* Crypto support is not available.
*/
cfg_obj_log(key, named_g_lctx, ISC_LOG_ERROR,
"ignoring %s for '%s': no crypto support",
initializing ? "initial-key" : "static-key",
"ignoring %s key for '%s': no crypto support",
managed ? "managed" : "trusted",
keynamestr);
return (result);
default:
@@ -871,8 +871,8 @@ process_key(const cfg_obj_t *key, dns_keytable_t *secroots,
* is interrupted.
*/
cfg_obj_log(key, named_g_lctx, ISC_LOG_ERROR,
"configuring %s for '%s': %s",
initializing ? "initial-key" : "static-key",
"configuring %s key for '%s': %s",
managed ? "managed" : "trusted",
keynamestr, isc_result_totext(result));
return (ISC_R_FAILURE);
}
@@ -893,21 +893,17 @@ process_key(const cfg_obj_t *key, dns_keytable_t *secroots,
*/
if (!dns_resolver_algorithm_supported(resolver, keyname, keyalg)) {
cfg_obj_log(key, named_g_lctx, ISC_LOG_WARNING,
"ignoring %s for '%s': algorithm is disabled",
initializing ? "initial-key" : "static-key",
keynamestr);
"ignoring %s key for '%s': algorithm is disabled",
managed ? "managed" : "trusted", keynamestr);
goto done;
}
/*
* Add the key to 'secroots'. Keys from a "dnssec-keys" or
* "managed-keys" statement may be either static or initializing
* keys. If it's not initializing, we don't want to treat it as
* managed, so we use 'initializing' twice here, for both the
* 'managed' and 'initializing' arguments to dns_keytable_add().
* Add the key to 'secroots'. This key is taken from the
* configuration, so if it's a managed key then it's an initializing
* key; that's why 'managed' is duplicated below.
*/
result = dns_keytable_add(secroots, initializing,
initializing, &dstkey);
result = dns_keytable_add(secroots, managed, managed, &dstkey);
done:
/*
@@ -928,7 +924,8 @@ process_key(const cfg_obj_t *key, dns_keytable_t *secroots,
* an initializing key.
*/
static isc_result_t
load_view_keys(const cfg_obj_t *keys, dns_view_t *view, bool managed,
load_view_keys(const cfg_obj_t *keys, const cfg_obj_t *vconfig,
dns_view_t *view, bool managed,
const dns_name_t *keyname, isc_mem_t *mctx)
{
const cfg_listelt_t *elt, *elt2;
@@ -948,7 +945,7 @@ load_view_keys(const cfg_obj_t *keys, dns_view_t *view, bool managed,
elt2 != NULL;
elt2 = cfg_list_next(elt2))
{
CHECK(process_key(cfg_listelt_value(elt2),
CHECK(process_key(cfg_listelt_value(elt2), vconfig,
secroots, keyname, view->resolver,
managed, mctx));
}
@@ -1002,9 +999,7 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
const cfg_obj_t *view_keys = NULL;
const cfg_obj_t *global_keys = NULL;
const cfg_obj_t *view_managed_keys = NULL;
const cfg_obj_t *view_dnssec_keys = NULL;
const cfg_obj_t *global_managed_keys = NULL;
const cfg_obj_t *global_dnssec_keys = NULL;
const cfg_obj_t *maps[4];
const cfg_obj_t *voptions = NULL;
const cfg_obj_t *options = NULL;
@@ -1024,24 +1019,15 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
if (voptions != NULL) {
(void) cfg_map_get(voptions, "trusted-keys",
&view_keys);
/* managed-keys and dnssec-keys are synonyms. */
(void) cfg_map_get(voptions, "managed-keys",
&view_managed_keys);
(void) cfg_map_get(voptions, "dnssec-keys",
&view_dnssec_keys);
maps[i++] = voptions;
}
}
if (config != NULL) {
(void)cfg_map_get(config, "trusted-keys", &global_keys);
/* managed-keys and dnssec-keys are synonyms. */
(void)cfg_map_get(config, "managed-keys", &global_managed_keys);
(void)cfg_map_get(config, "dnssec-keys", &global_dnssec_keys);
(void)cfg_map_get(config, "options", &options);
if (options != NULL) {
maps[i++] = options;
@@ -1069,10 +1055,11 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
if (auto_root && view->rdclass == dns_rdataclass_in) {
const cfg_obj_t *builtin_keys = NULL;
const cfg_obj_t *builtin_managed_keys = NULL;
/*
* If bind.keys exists and is populated, it overrides
* the dnssec-keys clause hard-coded in named_g_config.
* the managed-keys clause hard-coded in named_g_config.
*/
if (bindkeys != NULL) {
isc_log_write(named_g_lctx, DNS_LOGCATEGORY_SECURITY,
@@ -1081,10 +1068,13 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
"from '%s'",
view->name, named_g_server->bindkeysfile);
(void)cfg_map_get(bindkeys, "dnssec-keys",
(void)cfg_map_get(bindkeys, "trusted-keys",
&builtin_keys);
(void)cfg_map_get(bindkeys, "managed-keys",
&builtin_managed_keys);
if (builtin_keys == NULL) {
if ((builtin_keys == NULL) &&
(builtin_managed_keys == NULL))
isc_log_write(named_g_lctx,
DNS_LOGCATEGORY_SECURITY,
NAMED_LOGMODULE_SERVER,
@@ -1092,23 +1082,29 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
"dnssec-validation auto: "
"WARNING: root zone key "
"not found");
}
}
if (builtin_keys == NULL) {
if ((builtin_keys == NULL) &&
(builtin_managed_keys == NULL))
{
isc_log_write(named_g_lctx, DNS_LOGCATEGORY_SECURITY,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"using built-in root key for view %s",
view->name);
(void)cfg_map_get(named_g_config, "dnssec-keys",
(void)cfg_map_get(named_g_config, "trusted-keys",
&builtin_keys);
(void)cfg_map_get(named_g_config, "managed-keys",
&builtin_managed_keys);
}
if (builtin_keys != NULL) {
CHECK(load_view_keys(builtin_keys, view, true,
dns_rootname, mctx));
}
if (builtin_keys != NULL)
CHECK(load_view_keys(builtin_keys, vconfig, view,
false, dns_rootname, mctx));
if (builtin_managed_keys != NULL)
CHECK(load_view_keys(builtin_managed_keys, vconfig,
view, true, dns_rootname,
mctx));
if (!keyloaded(view, dns_rootname)) {
isc_log_write(named_g_lctx, DNS_LOGCATEGORY_SECURITY,
@@ -1119,16 +1115,16 @@ configure_view_dnsseckeys(dns_view_t *view, const cfg_obj_t *vconfig,
}
}
CHECK(load_view_keys(view_keys, view, false, NULL, mctx));
CHECK(load_view_keys(view_managed_keys, view, true, NULL, mctx));
CHECK(load_view_keys(view_dnssec_keys, view, true, NULL, mctx));
CHECK(load_view_keys(view_keys, vconfig, view, false,
NULL, mctx));
CHECK(load_view_keys(view_managed_keys, vconfig, view, true,
NULL, mctx));
if (view->rdclass == dns_rdataclass_in) {
CHECK(load_view_keys(global_keys, view, false, NULL, mctx));
CHECK(load_view_keys(global_managed_keys, view, true,
NULL, mctx));
CHECK(load_view_keys(global_dnssec_keys, view, true,
CHECK(load_view_keys(global_keys, vconfig, view, false,
NULL, mctx));
CHECK(load_view_keys(global_managed_keys, vconfig, view,
true, NULL, mctx));
}
/*
@@ -1808,6 +1804,7 @@ cache_reusable(dns_view_t *originview, dns_view_t *view,
static bool
cache_sharable(dns_view_t *originview, dns_view_t *view,
bool new_zero_no_soattl,
unsigned int new_cleaning_interval,
uint64_t new_max_cache_size,
uint32_t new_stale_ttl)
{
@@ -1822,7 +1819,9 @@ cache_sharable(dns_view_t *originview, dns_view_t *view,
* Check other cache related parameters that must be consistent among
* the sharing views.
*/
if (dns_cache_getservestalettl(originview->cache) != new_stale_ttl ||
if (dns_cache_getcleaninginterval(originview->cache) !=
new_cleaning_interval ||
dns_cache_getservestalettl(originview->cache) != new_stale_ttl ||
dns_cache_getcachesize(originview->cache) != new_max_cache_size) {
return (false);
}
@@ -1904,7 +1903,7 @@ dns64_reverse(dns_view_t *view, isc_mem_t *mctx, isc_netaddr_t *na,
dns_zone_setclass(zone, view->rdclass);
dns_zone_settype(zone, dns_zone_master);
dns_zone_setstats(zone, named_g_server->zonestats);
dns_zone_setdbtype(zone, dns64_dbtypec, dns64_dbtype);
CHECK(dns_zone_setdbtype(zone, dns64_dbtypec, dns64_dbtype));
if (view->queryacl != NULL)
dns_zone_setqueryacl(zone, view->queryacl);
if (view->queryonacl != NULL)
@@ -1945,6 +1944,10 @@ conf_dnsrps_sadd(conf_dnsrps_ctx_t *ctx, const char *p, ...) {
if (ctx->cstr == NULL) {
ctx->cstr = isc_mem_get(ctx->mctx, 256);
if (ctx->cstr == NULL) {
ctx->result = ISC_R_NOMEMORY;
return (false);
}
ctx->cstr[0] = '\0';
ctx->cstr_size = 256;
}
@@ -1960,6 +1963,10 @@ conf_dnsrps_sadd(conf_dnsrps_ctx_t *ctx, const char *p, ...) {
new_cstr_size = ((cur_len + new_len)/256 + 1) * 256;
new_cstr = isc_mem_get(ctx->mctx, new_cstr_size);
if (new_cstr == NULL) {
ctx->result = ISC_R_NOMEMORY;
return (false);
}
memmove(new_cstr, ctx->cstr, cur_len);
isc_mem_put(ctx->mctx, ctx->cstr, ctx->cstr_size);
@@ -3410,9 +3417,9 @@ create_empty_zone(dns_zone_t *zone, dns_name_t *name, dns_view_t *view,
zone = myzone;
CHECK(dns_zone_setorigin(zone, name));
CHECK(dns_zonemgr_managezone(named_g_server->zonemgr, zone));
if (db == NULL) {
dns_zone_setdbtype(zone, empty_dbtypec, empty_dbtype);
}
if (db == NULL)
CHECK(dns_zone_setdbtype(zone, empty_dbtypec,
empty_dbtype));
dns_zone_setclass(zone, view->rdclass);
dns_zone_settype(zone, dns_zone_master);
dns_zone_setstats(zone, named_g_server->zonestats);
@@ -3783,6 +3790,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
const cfg_obj_t *zonelist;
const cfg_obj_t *dlzlist;
const cfg_obj_t *dlz;
const cfg_obj_t *dlvobj = NULL;
unsigned int dlzargc;
char **dlzargv;
const cfg_obj_t *dyndb_list, *plugin_list;
@@ -3792,6 +3800,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
in_port_t port;
dns_cache_t *cache = NULL;
isc_result_t result;
unsigned int cleaning_interval;
size_t max_cache_size;
uint32_t max_cache_size_percent = 0;
size_t max_adb_size;
@@ -4005,6 +4014,11 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
* Obtain configuration parameters that affect the decision of whether
* we can reuse/share an existing cache.
*/
obj = NULL;
result = named_config_get(maps, "cleaning-interval", &obj);
INSIST(result == ISC_R_SUCCESS);
cleaning_interval = cfg_obj_asuint32(obj) * 60;
obj = NULL;
result = named_config_get(maps, "max-cache-size", &obj);
INSIST(result == ISC_R_SUCCESS);
@@ -4292,7 +4306,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
nsc = cachelist_find(cachelist, cachename, view->rdclass);
if (nsc != NULL) {
if (!cache_sharable(nsc->primaryview, view, zero_no_soattl,
max_cache_size, max_stale_ttl))
cleaning_interval, max_cache_size,
max_stale_ttl))
{
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
@@ -4363,6 +4378,10 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
isc_mem_detach(&hmctx);
}
nsc = isc_mem_get(mctx, sizeof(*nsc));
if (nsc == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup;
}
nsc->cache = NULL;
dns_cache_attach(cache, &nsc->cache);
nsc->primaryview = view;
@@ -4386,6 +4405,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
CHECK(dns_cache_load(cache));
}
dns_cache_setcleaninginterval(cache, cleaning_interval);
dns_cache_setcachesize(cache, max_cache_size);
dns_cache_setservestalettl(cache, max_stale_ttl);
@@ -4613,7 +4633,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
}
/*
* Set supported DS digest types.
* Set supported DS/DLV digest types.
*/
dns_resolver_reset_ds_digests(view->resolver);
disabled = NULL;
@@ -5203,6 +5223,57 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
view->prefetch_eligible = view->prefetch_trigger + 6;
}
obj = NULL;
result = named_config_get(optionmaps, "dnssec-lookaside", &obj);
if (result == ISC_R_SUCCESS) {
/* "auto" is deprecated, log a warning if seen */
const char *dom;
dlvobj = cfg_listelt_value(cfg_list_first(obj));
dom = cfg_obj_asstring(cfg_tuple_get(dlvobj, "domain"));
if (cfg_obj_isvoid(cfg_tuple_get(dlvobj, "trust-anchor"))) {
/* If "no", skip; if "auto", log warning */
if (!strcasecmp(dom, "no")) {
result = ISC_R_NOTFOUND;
} else if (!strcasecmp(dom, "auto")) {
/*
* Warning logged by libbind9.
*/
result = ISC_R_NOTFOUND;
}
}
}
if (result == ISC_R_SUCCESS) {
dns_name_t *dlv, *iscdlv;
dns_fixedname_t f;
/* Also log a warning if manually configured to dlv.isc.org */
iscdlv = dns_fixedname_initname(&f);
CHECK(dns_name_fromstring(iscdlv, "dlv.isc.org", 0, NULL));
for (element = cfg_list_first(obj);
element != NULL;
element = cfg_list_next(element))
{
obj = cfg_listelt_value(element);
obj = cfg_tuple_get(obj, "trust-anchor");
dlv = dns_fixedname_name(&view->dlv_fixed);
CHECK(dns_name_fromstring(dlv, cfg_obj_asstring(obj),
DNS_NAME_DOWNCASE, NULL));
if (dns_name_equal(dlv, iscdlv)) {
/*
* Warning logged by libbind9.
*/
view->dlv = NULL;
} else {
view->dlv = dlv;
}
}
} else {
view->dlv = NULL;
}
/*
* For now, there is only one kind of trusted keys, the
* "security roots".
@@ -5732,6 +5803,10 @@ configure_forward(const cfg_obj_t *config, dns_view_t *view,
{
const cfg_obj_t *forwarder = cfg_listelt_value(element);
fwd = isc_mem_get(view->mctx, sizeof(dns_forwarder_t));
if (fwd == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup;
}
fwd->addr = *cfg_obj_assockaddr(forwarder);
if (isc_sockaddr_getport(&fwd->addr) == 0)
isc_sockaddr_setport(&fwd->addr, port);
@@ -6789,6 +6864,9 @@ dotat(dns_keytable_t *keytable, dns_keynode_t *keynode, void *arg) {
view->name, namebuf);
tat = isc_mem_get(dotat_arg->view->mctx, sizeof(*tat));
if (tat == NULL) {
return;
}
tat->mctx = NULL;
tat->task = NULL;
@@ -6917,6 +6995,8 @@ setstring(named_server_t *server, char **field, const char *value) {
if (value != NULL) {
copy = isc_mem_strdup(server->mctx, value);
if (copy == NULL)
return (ISC_R_NOMEMORY);
} else {
copy = NULL;
}
@@ -7253,12 +7333,15 @@ configure_session_key(const cfg_obj_t **maps, named_server_t *server,
INSIST(server->session_keyalg == DST_ALG_UNKNOWN);
INSIST(server->session_keybits == 0);
server->session_keyname = isc_mem_get(mctx,
sizeof(dns_name_t));
server->session_keyname = isc_mem_get(mctx, sizeof(dns_name_t));
if (server->session_keyname == NULL)
goto cleanup;
dns_name_init(server->session_keyname, NULL);
CHECK(dns_name_dup(keyname, mctx, server->session_keyname));
server->session_keyfile = isc_mem_strdup(mctx, keyfile);
if (server->session_keyfile == NULL)
goto cleanup;
server->session_keyalg = algtype;
server->session_keybits = bits;
@@ -7461,6 +7544,10 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
}
nzcfg = isc_mem_get(view->mctx, sizeof(*nzcfg));
if (nzcfg == NULL) {
dns_view_setnewzones(view, false, NULL, NULL, 0ULL);
return (ISC_R_NOMEMORY);
}
/*
* We attach the parser that was used for config as well
@@ -7949,7 +8036,7 @@ check_lockfile(named_server_t *server, const cfg_obj_t *config,
"'lock-file' has no effect "
"because the server was run with -X");
server->lockfile = isc_mem_strdup(server->mctx,
named_g_defaultlockfile);
named_g_defaultlockfile);
} else {
filename = cfg_obj_asstring(obj);
server->lockfile = isc_mem_strdup(server->mctx,
@@ -8182,7 +8269,7 @@ load_configuration(const char *filename, named_server_t *server,
}
isc_socketmgr_setreserved(named_g_socketmgr, reserved);
#if defined(HAVE_GEOIP2)
#ifdef HAVE_GEOIP
/*
* Initialize GeoIP databases from the configured location.
* This should happen before configuring any ACLs, so that we
@@ -8191,14 +8278,15 @@ load_configuration(const char *filename, named_server_t *server,
*/
obj = NULL;
result = named_config_get(maps, "geoip-directory", &obj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_isstring(obj)) {
if (result == ISC_R_SUCCESS && cfg_obj_isstring(obj)) {
char *dir;
DE_CONST(cfg_obj_asstring(obj), dir);
named_geoip_load(dir);
} else {
named_geoip_load(NULL);
}
named_g_aclconfctx->geoip = named_g_geoip;
#endif /* HAVE_GEOIP2 */
#endif /* HAVE_GEOIP */
/*
* Configure various server options.
@@ -9050,10 +9138,12 @@ load_configuration(const char *filename, named_server_t *server,
obj = NULL;
result = named_config_get(maps, "cookie-algorithm", &obj);
INSIST(result == ISC_R_SUCCESS);
if (strcasecmp(cfg_obj_asstring(obj), "siphash24") == 0) {
server->sctx->cookiealg = ns_cookiealg_siphash24;
} else if (strcasecmp(cfg_obj_asstring(obj), "aes") == 0) {
if (strcasecmp(cfg_obj_asstring(obj), "aes") == 0) {
server->sctx->cookiealg = ns_cookiealg_aes;
} else if (strcasecmp(cfg_obj_asstring(obj), "sha1") == 0) {
server->sctx->cookiealg = ns_cookiealg_sha1;
} else if (strcasecmp(cfg_obj_asstring(obj), "sha256") == 0) {
server->sctx->cookiealg = ns_cookiealg_sha256;
} else {
INSIST(0);
ISC_UNREACHABLE();
@@ -9090,6 +9180,10 @@ load_configuration(const char *filename, named_server_t *server,
} else {
altsecret = isc_mem_get(server->sctx->mctx,
sizeof(*altsecret));
if (altsecret == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup;
}
isc_buffer_init(&b, altsecret->secret,
sizeof(altsecret->secret));
result = isc_hex_decodestring(str, &b);
@@ -9107,18 +9201,30 @@ load_configuration(const char *filename, named_server_t *server,
usedlength = isc_buffer_usedlength(&b);
switch (server->sctx->cookiealg) {
case ns_cookiealg_siphash24:
expectedlength = ISC_SIPHASH24_KEY_LENGTH;
if (usedlength != expectedlength) {
CHECKM(ISC_R_RANGE,
"SipHash-2-4 cookie-secret must be 128 bits");
}
break;
case ns_cookiealg_aes:
expectedlength = ISC_AES128_KEYLENGTH;
if (usedlength != expectedlength) {
CHECKM(ISC_R_RANGE,
"AES cookie-secret must be 128 bits");
"AES cookie-secret must be "
"128 bits");
}
break;
case ns_cookiealg_sha1:
expectedlength =
isc_md_type_get_size(ISC_MD_SHA1);
if (usedlength != expectedlength) {
CHECKM(ISC_R_RANGE,
"SHA1 cookie-secret must be "
"160 bits");
}
break;
case ns_cookiealg_sha256:
expectedlength =
isc_md_type_get_size(ISC_MD_SHA256);
if (usedlength != expectedlength) {
CHECKM(ISC_R_RANGE,
"SHA256 cookie-secret must be "
"256 bits");
}
break;
}
@@ -9298,7 +9404,7 @@ view_loaded(void *arg) {
"FIPS mode is %s",
FIPS_mode() ? "enabled" : "disabled");
#endif
server->reload_status = NAMED_RELOAD_DONE;
server->reload_in_progress = false;
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_NOTICE,
@@ -9314,7 +9420,9 @@ load_zones(named_server_t *server, bool init, bool reconfig) {
dns_view_t *view;
ns_zoneload_t *zl;
zl = isc_mem_get(server->mctx, sizeof(*zl));
zl = isc_mem_get(server->mctx, sizeof (*zl));
if (zl == NULL)
return (ISC_R_NOMEMORY);
zl->server = server;
zl->reconfig = reconfig;
@@ -9381,7 +9489,6 @@ static void
run_server(isc_task_t *task, isc_event_t *event) {
isc_result_t result;
named_server_t *server = (named_server_t *)event->ev_arg;
dns_geoip_databases_t *geoip;
INSIST(task == server->task);
@@ -9392,19 +9499,25 @@ run_server(isc_task_t *task, isc_event_t *event) {
dns_dispatchmgr_setstats(named_g_dispatchmgr, server->resolverstats);
#if defined(HAVE_GEOIP2)
geoip = named_g_geoip;
#else
geoip = NULL;
#endif
#ifdef HAVE_GEOIP
CHECKFATAL(ns_interfacemgr_create(named_g_mctx, server->sctx,
named_g_taskmgr, named_g_timermgr,
named_g_socketmgr,
named_g_dispatchmgr,
server->task, named_g_udpdisp, geoip,
server->task, named_g_udpdisp,
named_g_geoip,
&server->interfacemgr),
"creating interface manager");
#else
CHECKFATAL(ns_interfacemgr_create(named_g_mctx, server->sctx,
named_g_taskmgr, named_g_timermgr,
named_g_socketmgr,
named_g_dispatchmgr,
server->task, named_g_udpdisp,
NULL,
&server->interfacemgr),
"creating interface manager");
#endif
CHECKFATAL(isc_timer_create(named_g_timermgr, isc_timertype_inactive,
NULL, NULL, server->task,
@@ -9526,9 +9639,9 @@ shutdown_server(isc_task_t *task, isc_event_t *event) {
#ifdef HAVE_DNSTAP
dns_dt_shutdown();
#endif
#if defined(HAVE_GEOIP2)
named_geoip_shutdown();
#endif /* HAVE_GEOIP2 */
#ifdef HAVE_GEOIP
dns_geoip_shutdown();
#endif
dns_db_detach(&server->in_roothints);
@@ -9627,7 +9740,7 @@ named_server_create(isc_mem_t *mctx, named_server_t **serverp) {
CHECKFATAL(server->reload_event == NULL ?
ISC_R_NOMEMORY : ISC_R_SUCCESS,
"allocating reload event");
server->reload_status = NAMED_RELOAD_IN_PROGRESS;
server->reload_in_progress = true;
/*
* Setup the server task, which is responsible for coordinating
@@ -9644,14 +9757,14 @@ named_server_create(isc_mem_t *mctx, named_server_t **serverp) {
&server->sctx),
"creating server context");
#if defined(HAVE_GEOIP2)
#ifdef HAVE_GEOIP
/*
* GeoIP must be initialized before the interface
* manager (which includes the ACL environment)
* is created
*/
named_geoip_init();
#endif /* HAVE_GEOIP2 */
#endif
#ifdef ENABLE_AFL
server->sctx->fuzztype = named_g_fuzz_type;
@@ -9866,6 +9979,10 @@ named_add_reserved_dispatch(named_server_t *server,
}
dispatch = isc_mem_get(server->mctx, sizeof(*dispatch));
if (dispatch == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup;
}
dispatch->addr = *addr;
dispatch->dispatchgen = server->dispatchgen;
@@ -9927,7 +10044,6 @@ loadconfig(named_server_t *server) {
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"reloading configuration failed: %s",
isc_result_totext(result));
server->reload_status = NAMED_RELOAD_FAILED;
}
return (result);
@@ -9936,21 +10052,20 @@ loadconfig(named_server_t *server) {
static isc_result_t
reload(named_server_t *server) {
isc_result_t result;
server->reload_status = NAMED_RELOAD_IN_PROGRESS;
server->reload_in_progress = true;
CHECK(loadconfig(server));
result = load_zones(server, false, false);
if (result == ISC_R_SUCCESS) {
if (result == ISC_R_SUCCESS)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"reloading zones succeeded");
} else {
else
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"reloading zones failed: %s",
isc_result_totext(result));
server->reload_status = NAMED_RELOAD_FAILED;
}
cleanup:
return (result);
}
@@ -10284,22 +10399,20 @@ named_server_reloadcommand(named_server_t *server, isc_lex_t *lex,
isc_result_t
named_server_reconfigcommand(named_server_t *server) {
isc_result_t result;
server->reload_status = NAMED_RELOAD_IN_PROGRESS;
server->reload_in_progress = true;
CHECK(loadconfig(server));
result = load_zones(server, false, true);
if (result == ISC_R_SUCCESS) {
if (result == ISC_R_SUCCESS)
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
"scheduled loading new zones");
} else {
else
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"loading new zones failed: %s",
isc_result_totext(result));
server->reload_status = NAMED_RELOAD_FAILED;
}
cleanup:
return (result);
}
@@ -10539,6 +10652,8 @@ add_zone_tolist(dns_zone_t *zone, void *uap) {
struct zonelistentry *zle;
zle = isc_mem_get(dctx->mctx, sizeof *zle);
if (zle == NULL)
return (ISC_R_NOMEMORY);
zle->zone = NULL;
dns_zone_attach(zone, &zle->zone);
ISC_LINK_INIT(zle, link);
@@ -10561,6 +10676,8 @@ add_view_tolist(struct dumpcontext *dctx, dns_view_t *view) {
return (ISC_R_SUCCESS);
vle = isc_mem_get(dctx->mctx, sizeof *vle);
if (vle == NULL)
return (ISC_R_NOMEMORY);
vle->view = NULL;
dns_view_attach(view, &vle->view);
ISC_LINK_INIT(vle, link);
@@ -10753,6 +10870,8 @@ named_server_dumpdb(named_server_t *server, isc_lex_t *lex,
return (ISC_R_UNEXPECTEDEND);
dctx = isc_mem_get(server->mctx, sizeof(*dctx));
if (dctx == NULL)
return (ISC_R_NOMEMORY);
dctx->mctx = server->mctx;
dctx->dumpcache = true;
@@ -11427,11 +11546,8 @@ named_server_status(named_server_t *server, isc_buffer_t **text) {
isc_quota_getmax(&server->sctx->tcpquota));
CHECK(putstr(text, line));
if (server->reload_status != NAMED_RELOAD_DONE) {
snprintf(line, sizeof(line), "reload/reconfig %s\n",
server->reload_status == NAMED_RELOAD_FAILED
? "failed" : "in progress");
CHECK(putstr(text, line));
if (server->reload_in_progress) {
CHECK(putstr(text, "reload/reconfig in progress"));
}
CHECK(putstr(text, "server is up and running"));
@@ -11488,7 +11604,7 @@ delete_keynames(dns_tsig_keyring_t *ring, char *target,
origin = dns_fixedname_initname(&fixedorigin);
again:
dns_rbtnodechain_init(&chain);
dns_rbtnodechain_init(&chain, ring->mctx);
result = dns_rbtnodechain_first(&chain, ring->keys, &foundname,
origin);
if (result == ISC_R_NOTFOUND) {
@@ -11604,7 +11720,7 @@ list_keynames(dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t **text,
dns_name_init(&foundname, NULL);
origin = dns_fixedname_initname(&fixedorigin);
dns_rbtnodechain_init(&chain);
dns_rbtnodechain_init(&chain, ring->mctx);
result = dns_rbtnodechain_first(&chain, ring->keys, &foundname,
origin);
if (result == ISC_R_NOTFOUND) {
@@ -13559,6 +13675,8 @@ named_server_delzone(named_server_t *server, isc_lex_t *lex,
/* Send cleanup event */
dz = isc_mem_get(named_g_mctx, sizeof(*dz));
if (dz == NULL)
CHECK(ISC_R_NOMEMORY);
dz->cleanup = cleanup;
dz->zone = NULL;
+39 -203
View File
@@ -16,6 +16,7 @@
#include <isc/buffer.h>
#include <isc/httpd.h>
#include <isc/json.h>
#include <isc/mem.h>
#include <isc/once.h>
#include <isc/print.h>
@@ -42,16 +43,6 @@
#include <named/server.h>
#include <named/statschannel.h>
#if HAVE_JSON_C
#include <json_object.h>
#include <linkhash.h>
#endif /* HAVE_JSON_C */
#if HAVE_LIBXML2
#include <libxml/xmlwriter.h>
#define ISC_XMLCHAR (const xmlChar *)
#endif /* HAVE_LIBXML2 */
#include "bind9.xsl.h"
struct named_statschannel {
@@ -83,7 +74,7 @@ stats_dumparg {
static isc_once_t once = ISC_ONCE_INIT;
#if defined(HAVE_LIBXML2) || defined(HAVE_JSON_C)
#if defined(HAVE_LIBXML2) || defined(HAVE_JSON)
#define EXTENDED_STATS
#else
#undef EXTENDED_STATS
@@ -1076,10 +1067,10 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
stats_dumparg_t dumparg;
FILE *fp;
#ifdef HAVE_LIBXML2
void *writer;
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
json_object *job, *cat, *counter;
#endif
@@ -1095,7 +1086,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
memset(values, 0, sizeof(values[0]) * ncounters);
isc_stats_dump(stats, generalstat_dump, &dumparg, options);
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
cat = job = (json_object *) arg;
if (ncounters > 0 && type == isc_statsformat_json) {
if (category != NULL) {
@@ -1122,7 +1113,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
break;
case isc_statsformat_xml:
#ifdef HAVE_LIBXML2
writer = arg;
writer = (xmlTextWriterPtr) arg;
if (category != NULL) {
/* <NameOfCategory> */
@@ -1170,7 +1161,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
counter = json_object_new_int64(value);
if (counter == NULL)
return (ISC_R_NOMEMORY);
@@ -1196,10 +1187,10 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
stats_dumparg_t *dumparg = arg;
FILE *fp;
#ifdef HAVE_LIBXML2
void *writer;
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
json_object *zoneobj, *obj;
#endif
@@ -1233,7 +1224,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
zoneobj = (json_object *) dumparg->arg;
obj = json_object_new_int64(val);
if (obj == NULL)
@@ -1253,12 +1244,6 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
#endif
}
static bool
rdatastatstype_attr(dns_rdatastatstype_t type, unsigned int attr)
{
return ((DNS_RDATASTATSTYPE_ATTR(type) & attr) != 0);
}
static void
rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
stats_dumparg_t *dumparg = arg;
@@ -1267,12 +1252,11 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
const char *typestr;
bool nxrrset = false;
bool stale = false;
bool ancient = false;
#ifdef HAVE_LIBXML2
void *writer;
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
json_object *zoneobj, *obj;
char buf[1024];
#endif
@@ -1289,16 +1273,19 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
typestr = typebuf;
}
nxrrset = rdatastatstype_attr(type, DNS_RDATASTATSTYPE_ATTR_NXRRSET);
stale = rdatastatstype_attr(type, DNS_RDATASTATSTYPE_ATTR_STALE);
ancient = rdatastatstype_attr(type, DNS_RDATASTATSTYPE_ATTR_ANCIENT);
if ((DNS_RDATASTATSTYPE_ATTR(type) & DNS_RDATASTATSTYPE_ATTR_NXRRSET)
!= 0)
nxrrset = true;
if ((DNS_RDATASTATSTYPE_ATTR(type) & DNS_RDATASTATSTYPE_ATTR_STALE)
!= 0)
stale = true;
switch (dumparg->type) {
case isc_statsformat_file:
fp = dumparg->arg;
fprintf(fp, "%20" PRIu64 " %s%s%s%s\n", val,
ancient ? "~" : "", stale ? "#" : "",
nxrrset ? "!" : "", typestr);
fprintf(fp, "%20" PRIu64 " %s%s%s\n", val,
stale ? "#" : "", nxrrset ? "!" : "", typestr);
break;
case isc_statsformat_xml:
#ifdef HAVE_LIBXML2
@@ -1306,8 +1293,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "rrset"));
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "name"));
TRY0(xmlTextWriterWriteFormatString(writer, "%s%s%s%s",
ancient ? "~" : "",
TRY0(xmlTextWriterWriteFormatString(writer, "%s%s%s",
stale ? "#" : "",
nxrrset ? "!" : "", typestr));
TRY0(xmlTextWriterEndElement(writer)); /* name */
@@ -1322,9 +1308,9 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
zoneobj = (json_object *) dumparg->arg;
snprintf(buf, sizeof(buf), "%s%s%s%s", ancient ? "~" : "",
snprintf(buf, sizeof(buf), "%s%s%s",
stale ? "#" : "", nxrrset ? "!" : "", typestr);
obj = json_object_new_int64(val);
if (obj == NULL)
@@ -1351,10 +1337,10 @@ opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
char codebuf[64];
stats_dumparg_t *dumparg = arg;
#ifdef HAVE_LIBXML2
void *writer;
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
json_object *zoneobj, *obj;
#endif
@@ -1380,7 +1366,7 @@ opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
zoneobj = (json_object *) dumparg->arg;
obj = json_object_new_int64(val);
if (obj == NULL)
@@ -1408,10 +1394,10 @@ rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
char codebuf[64];
stats_dumparg_t *dumparg = arg;
#ifdef HAVE_LIBXML2
void *writer;
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
json_object *zoneobj, *obj;
#endif
@@ -1437,7 +1423,7 @@ rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
zoneobj = (json_object *) dumparg->arg;
obj = json_object_new_int64(val);
if (obj == NULL)
@@ -1458,62 +1444,6 @@ rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
#endif
}
#if defined(EXTENDED_STATS)
static void
dnssecsignstat_dump(dns_keytag_t tag, uint64_t val, void *arg) {
FILE *fp;
char tagbuf[64];
stats_dumparg_t *dumparg = arg;
#ifdef HAVE_LIBXML2
xmlTextWriterPtr writer;
int xmlrc;
#endif
#ifdef HAVE_JSON_C
json_object *zoneobj, *obj;
#endif
snprintf(tagbuf, sizeof(tagbuf), "%u", tag);
switch (dumparg->type) {
case isc_statsformat_file:
fp = dumparg->arg;
fprintf(fp, "%20" PRIu64 " %s\n", val, tagbuf);
break;
case isc_statsformat_xml:
#ifdef HAVE_LIBXML2
writer = dumparg->arg;
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counter"));
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
ISC_XMLCHAR tagbuf ));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" PRIu64,
val));
TRY0(xmlTextWriterEndElement(writer)); /* counter */
#endif
break;
case isc_statsformat_json:
#ifdef HAVE_JSON_C
zoneobj = (json_object *) dumparg->arg;
obj = json_object_new_int64(val);
if (obj == NULL) {
return;
}
json_object_object_add(zoneobj, tagbuf, obj);
#endif
break;
}
return;
#ifdef HAVE_LIBXML2
error:
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"failed at dnssecsignstat_dump()");
dumparg->result = ISC_R_FAILURE;
return;
#endif
}
#endif /* defined(EXTENDED_STATS) */
#ifdef HAVE_LIBXML2
/*
* Which statistics to include when rendering to XML
@@ -1576,8 +1506,6 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
isc_stats_t *zonestats;
isc_stats_t *gluecachestats;
dns_stats_t *rcvquerystats;
dns_stats_t *dnssecsignstats;
dns_stats_t *dnssecrefreshstats;
uint64_t nsstat_values[ns_statscounter_max];
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
@@ -1605,8 +1533,8 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
TRY0(xmlTextWriterStartElement(writer,
ISC_XMLCHAR "counters"));
TRY0(xmlTextWriterWriteAttribute(writer,
ISC_XMLCHAR "type",
ISC_XMLCHAR "gluecache"));
ISC_XMLCHAR "type",
ISC_XMLCHAR "gluecache"));
result = dump_counters(gluecachestats,
isc_statsformat_xml,
@@ -1639,46 +1567,6 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
/* counters type="qtype"*/
TRY0(xmlTextWriterEndElement(writer));
}
dnssecsignstats = dns_zone_getdnssecsignstats(zone);
if (dnssecsignstats != NULL) {
TRY0(xmlTextWriterStartElement(writer,
ISC_XMLCHAR "counters"));
TRY0(xmlTextWriterWriteAttribute(writer,
ISC_XMLCHAR "type",
ISC_XMLCHAR "dnssec-sign"));
dumparg.result = ISC_R_SUCCESS;
dns_dnssecsignstats_dump(dnssecsignstats,
dnssecsignstat_dump,
&dumparg, 0);
if(dumparg.result != ISC_R_SUCCESS) {
goto error;
}
/* counters type="dnssec-sign"*/
TRY0(xmlTextWriterEndElement(writer));
}
dnssecrefreshstats = dns_zone_getdnssecrefreshstats(zone);
if (dnssecrefreshstats != NULL) {
TRY0(xmlTextWriterStartElement(writer,
ISC_XMLCHAR "counters"));
TRY0(xmlTextWriterWriteAttribute(writer,
ISC_XMLCHAR "type",
ISC_XMLCHAR "dnssec-refresh"));
dumparg.result = ISC_R_SUCCESS;
dns_dnssecsignstats_dump(dnssecrefreshstats,
dnssecsignstat_dump,
&dumparg, 0);
if(dumparg.result != ISC_R_SUCCESS) {
goto error;
}
/* counters type="dnssec-refresh"*/
TRY0(xmlTextWriterEndElement(writer));
}
}
TRY0(xmlTextWriterEndElement(writer)); /* zone */
@@ -2307,7 +2195,7 @@ render_xml_traffic(const char *url, isc_httpdurl_t *urlinfo,
#endif /* HAVE_LIBXML2 */
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
/*
* Which statistics to include when rendering to JSON
*/
@@ -2399,8 +2287,6 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
isc_stats_t *zonestats;
isc_stats_t *gluecachestats;
dns_stats_t *rcvquerystats;
dns_stats_t *dnssecsignstats;
dns_stats_t *dnssecrefreshstats;
uint64_t nsstat_values[ns_statscounter_max];
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
@@ -2478,58 +2364,6 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
else
json_object_put(counters);
}
dnssecsignstats = dns_zone_getdnssecsignstats(zone);
if (dnssecsignstats != NULL) {
stats_dumparg_t dumparg;
json_object *counters = json_object_new_object();
CHECKMEM(counters);
dumparg.type = isc_statsformat_json;
dumparg.arg = counters;
dumparg.result = ISC_R_SUCCESS;
dns_dnssecsignstats_dump(dnssecsignstats,
dnssecsignstat_dump,
&dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
}
if (json_object_get_object(counters)->count != 0) {
json_object_object_add(zoneobj,
"dnssec-sign",
counters);
} else {
json_object_put(counters);
}
}
dnssecrefreshstats = dns_zone_getdnssecrefreshstats(zone);
if (dnssecrefreshstats != NULL) {
stats_dumparg_t dumparg;
json_object *counters = json_object_new_object();
CHECKMEM(counters);
dumparg.type = isc_statsformat_json;
dumparg.arg = counters;
dumparg.result = ISC_R_SUCCESS;
dns_dnssecsignstats_dump(dnssecrefreshstats,
dnssecsignstat_dump,
&dumparg, 0);
if (dumparg.result != ISC_R_SUCCESS) {
json_object_put(counters);
goto error;
}
if (json_object_get_object(counters)->count != 0) {
json_object_object_add(zoneobj,
"dnssec-refresh",
counters);
} else {
json_object_put(counters);
}
}
}
json_object_array_add(zonearray, zoneobj);
@@ -3264,7 +3098,7 @@ render_json_traffic(const char *url, isc_httpdurl_t *urlinfo,
freecb, freecb_args));
}
#endif /* HAVE_JSON_C */
#endif /* HAVE_JSON */
static isc_result_t
render_xsl(const char *url, isc_httpdurl_t *urlinfo,
@@ -3408,6 +3242,8 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
dns_acl_t *new_acl = NULL;
listener = isc_mem_get(server->mctx, sizeof(*listener));
if (listener == NULL)
return (ISC_R_NOMEMORY);
listener->httpdmgr = NULL;
listener->address = *addr;
@@ -3478,7 +3314,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/traffic",
render_xml_traffic, server);
#endif
#ifdef HAVE_JSON_C
#ifdef HAVE_JSON
isc_httpdmgr_addurl(listener->httpdmgr, "/json",
render_json_all, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1",
@@ -3613,12 +3449,12 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
"statistics-channels: XML library missing, "
"only JSON stats will be available");
#endif /* !HAVE_LIBXML2 */
#ifndef HAVE_JSON_C
#ifndef HAVE_JSON
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"statistics-channels: JSON library missing, "
"only XML stats will be available");
#endif /* !HAVE_JSON_C */
#endif /* !HAVE_JSON */
#endif /* EXTENDED_STATS */
for (element = cfg_list_first(statschannellist);
+8
View File
@@ -84,6 +84,10 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
name = dns_fixedname_initname(&fname);
RETERR(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
tctx->domain = isc_mem_get(mctx, sizeof(dns_name_t));
if (tctx->domain == NULL) {
result = ISC_R_NOMEMORY;
goto failure;
}
dns_name_init(tctx->domain, NULL);
RETERR(dns_name_dup(name, mctx, tctx->domain));
}
@@ -105,6 +109,10 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
if (result == ISC_R_SUCCESS) {
s = cfg_obj_asstring(obj);
tctx->gssapi_keytab = isc_mem_strdup(mctx, s);
if (tctx->gssapi_keytab == NULL) {
result = ISC_R_NOMEMORY;
goto failure;
}
}
*tctxp = tctx;
+4
View File
@@ -97,6 +97,10 @@ add_initial_keys(const cfg_obj_t *list, dns_tsig_keyring_t *ring,
secretstr = cfg_obj_asstring(secretobj);
secretalloc = secretlen = strlen(secretstr) * 3 / 4;
secret = isc_mem_get(mctx, secretlen);
if (secret == NULL) {
ret = ISC_R_NOMEMORY;
goto failure;
}
isc_buffer_init(&secretbuf, secret, secretlen);
ret = isc_base64_decodestring(secretstr, &secretbuf);
if (ret != ISC_R_SUCCESS)
+1 -2
View File
@@ -15,8 +15,7 @@ top_srcdir = @top_srcdir@
CINCLUDES = -I${srcdir}/include -I${srcdir}/../include \
${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \
${DNS_INCLUDES} ${ISC_INCLUDES} \
${OPENSSL_CFLAGS}
${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@
CDEFINES =
CWARNINGS =
+12
View File
@@ -230,13 +230,25 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
return (result);
cd = isc_mem_get(mctx, sizeof(*cd));
if (cd == NULL) {
isc_mem_destroy(&mctx);
return (ISC_R_NOMEMORY);
}
memset(cd, 0, sizeof(*cd));
cd->mctx = mctx;
cd->dl_path = isc_mem_strdup(cd->mctx, argv[1]);
if (cd->dl_path == NULL) {
result = ISC_R_NOMEMORY;
goto failed;
}
cd->dlzname = isc_mem_strdup(cd->mctx, dlzname);
if (cd->dlzname == NULL) {
result = ISC_R_NOMEMORY;
goto failed;
}
/* Initialize the lock */
isc_mutex_init(&cd->lock);
+12
View File
@@ -227,13 +227,25 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
isc_mem_create(0, 0, &mctx);
cd = isc_mem_get(mctx, sizeof(*cd));
if (cd == NULL) {
isc_mem_destroy(&mctx);
return (ISC_R_NOMEMORY);
}
memset(cd, 0, sizeof(*cd));
cd->mctx = mctx;
cd->dl_path = isc_mem_strdup(cd->mctx, argv[1]);
if (cd->dl_path == NULL) {
result = ISC_R_NOMEMORY;
goto failed;
}
cd->dlzname = isc_mem_strdup(cd->mctx, dlzname);
if (cd->dlzname == NULL) {
result = ISC_R_NOMEMORY;
goto failed;
}
triedload = true;
+27 -20
View File
@@ -287,6 +287,10 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
types = NULL;
else {
types = isc_mem_get(mctx, n * sizeof(dns_rdatatype_t));
if (types == NULL) {
result = ISC_R_NOMEMORY;
goto cleanup;
}
}
i = 0;
@@ -429,6 +433,8 @@ configure_staticstub_serveraddrs(const cfg_obj_t *zconfig, dns_zone_t *zone,
}
rdata = isc_mem_get(mctx, sizeof(*rdata) + region.length);
if (rdata == NULL)
return (ISC_R_NOMEMORY);
region.base = (unsigned char *)(rdata + 1);
memmove(region.base, &na.type, region.length);
dns_rdata_init(rdata);
@@ -449,6 +455,13 @@ configure_staticstub_serveraddrs(const cfg_obj_t *zconfig, dns_zone_t *zone,
/* Add to the list an apex NS with the ns name being the origin name */
dns_name_toregion(dns_zone_getorigin(zone), &sregion);
rdata = isc_mem_get(mctx, sizeof(*rdata) + sregion.length);
if (rdata == NULL) {
/*
* Already allocated data will be freed in the caller, so
* we can simply return here.
*/
return (ISC_R_NOMEMORY);
}
region.length = sregion.length;
region.base = (unsigned char *)(rdata + 1);
memmove(region.base, sregion.base, region.length);
@@ -510,6 +523,8 @@ configure_staticstub_servernames(const cfg_obj_t *zconfig, dns_zone_t *zone,
dns_name_toregion(nsname, &sregion);
rdata = isc_mem_get(mctx, sizeof(*rdata) + sregion.length);
if (rdata == NULL)
return (ISC_R_NOMEMORY);
region.length = sregion.length;
region.base = (unsigned char *)(rdata + 1);
memmove(region.base, sregion.base, region.length);
@@ -703,6 +718,8 @@ strtoargvsub(isc_mem_t *mctx, char *s, unsigned int *argcp,
/* We have reached the end of the string. */
*argcp = n;
*argvp = isc_mem_get(mctx, n * sizeof(char *));
if (*argvp == NULL)
return (ISC_R_NOMEMORY);
} else {
char *p = s;
while (*p != ' ' && *p != '\t' && *p != '\0')
@@ -887,8 +904,6 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
const dns_master_style_t *masterstyle = &dns_master_style_default;
isc_stats_t *zoneqrystats;
dns_stats_t *rcvquerystats;
dns_stats_t *dnssecsignstats;
dns_stats_t *dnssecrefreshstats;
dns_zonestat_level_t statlevel = dns_zonestat_none;
int seconds;
dns_zone_t *mayberaw = (raw != NULL) ? raw : zone;
@@ -963,6 +978,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
len = strlen(dlzname) + 5;
cpval = isc_mem_allocate(mctx, len);
if (cpval == NULL)
return (ISC_R_NOMEMORY);
snprintf(cpval, len, "dlz %s", dlzname);
}
@@ -977,11 +994,12 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
* cannot be promoted automatically to (const char * const *) by the
* compiler w/o generating a warning.
*/
dns_zone_setdbtype(zone, dbargc, (const char * const *)dbargv);
result = dns_zone_setdbtype(zone, dbargc, (const char * const *)dbargv);
isc_mem_put(mctx, dbargv, dbargc * sizeof(*dbargv));
if (cpval != default_dbtype && cpval != dlz_dbtype) {
if (cpval != default_dbtype && cpval != dlz_dbtype)
isc_mem_free(mctx, cpval);
}
if (result != ISC_R_SUCCESS)
return (result);
obj = NULL;
result = cfg_map_get(zoptions, "file", &obj);
@@ -1078,6 +1096,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
RETERR(dns_zone_setfile(raw, filename,
masterformat, masterstyle));
signedname = isc_mem_get(mctx, signedlen);
if (signedname == NULL)
return (ISC_R_NOMEMORY);
(void)snprintf(signedname, signedlen, "%s" SIGNED, filename);
result = dns_zone_setfile(zone, signedname,
@@ -1168,19 +1188,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
zoneqrystats = NULL;
rcvquerystats = NULL;
dnssecsignstats = NULL;
dnssecrefreshstats = NULL;
if (statlevel == dns_zonestat_full) {
RETERR(isc_stats_create(mctx, &zoneqrystats,
ns_statscounter_max));
RETERR(dns_rdatatypestats_create(mctx, &rcvquerystats));
RETERR(dns_dnssecsignstats_create(mctx, &dnssecsignstats));
RETERR(dns_dnssecsignstats_create(mctx, &dnssecrefreshstats));
RETERR(dns_rdatatypestats_create(mctx,
&rcvquerystats));
}
dns_zone_setrequeststats(zone, zoneqrystats);
dns_zone_setrcvquerystats(zone, rcvquerystats);
dns_zone_setdnssecsignstats(zone, dnssecsignstats);
dns_zone_setdnssecrefreshstats(zone, dnssecrefreshstats);
if (zoneqrystats != NULL)
isc_stats_detach(&zoneqrystats);
@@ -1188,14 +1203,6 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
if(rcvquerystats != NULL)
dns_stats_detach(&rcvquerystats);
if(dnssecsignstats != NULL) {
dns_stats_detach(&dnssecsignstats);
}
if(dnssecrefreshstats != NULL) {
dns_stats_detach(&dnssecrefreshstats);
}
/*
* Configure master functionality. This applies
* to primary masters (type "master") and slaves
+4 -4
View File
@@ -21,15 +21,15 @@ DST_GSSAPI_INC = @DST_GSSAPI_INC@
CINCLUDES = ${DNS_INCLUDES} ${BIND9_INCLUDES} ${ISC_INCLUDES} \
${ISCCFG_INCLUDES} ${IRS_INCLUDES} ${DST_GSSAPI_INC} \
${OPENSSL_CFLAGS}
@OPENSSL_INCLUDES@
CDEFINES = -DVERSION=\"${VERSION}\" @USE_GSSAPI@
CWARNINGS =
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
IRSLIBS = ../../lib/irs/libirs.@A@
+32 -8
View File
@@ -514,6 +514,8 @@ setup_keystr(void) {
secretlen = strlen(secretstr) * 3 / 4;
secret = isc_mem_allocate(gmctx, secretlen);
if (secret == NULL)
fatal("out of memory");
isc_buffer_init(&secretbuf, secret, secretlen);
result = isc_base64_decodestring(secretstr, &secretbuf);
@@ -582,6 +584,8 @@ read_sessionkey(isc_mem_t *mctx, isc_log_t *lctx) {
len = strlen(algorithm) + strlen(mykeyname) + strlen(secretstr) + 3;
keystr = isc_mem_allocate(mctx, len);
if (keystr == NULL)
fatal("out of memory");
snprintf(keystr, len, "%s:%s:%s", algorithm, mykeyname, secretstr);
setup_keystr();
@@ -820,8 +824,9 @@ setup_system(void) {
default_servers = !local_only;
ns_total = ns_alloc = (have_ipv4 ? 1 : 0) + (have_ipv6 ? 1 : 0);
servers = isc_mem_get(gmctx,
ns_alloc * sizeof(isc_sockaddr_t));
servers = isc_mem_get(gmctx, ns_alloc * sizeof(isc_sockaddr_t));
if (servers == NULL)
fatal("out of memory");
if (have_ipv6) {
memset(&in6, 0, sizeof(in6));
@@ -864,8 +869,9 @@ setup_system(void) {
}
ns_alloc = ns_total;
servers = isc_mem_get(gmctx,
ns_alloc * sizeof(isc_sockaddr_t));
servers = isc_mem_get(gmctx, ns_alloc * sizeof(isc_sockaddr_t));
if (servers == NULL)
fatal("out of memory");
i = 0;
for (sa = ISC_LIST_HEAD(*nslist);
@@ -1491,6 +1497,8 @@ evaluate_server(char *cmdline) {
ns_alloc = MAX_SERVERADDRS;
ns_inuse = 0;
servers = isc_mem_get(gmctx, ns_alloc * sizeof(isc_sockaddr_t));
if (servers == NULL)
fatal("out of memory");
memset(servers, 0, ns_alloc * sizeof(isc_sockaddr_t));
ns_total = get_addresses(server, (in_port_t)port, servers, ns_alloc);
@@ -1533,13 +1541,15 @@ evaluate_local(char *cmdline) {
if (have_ipv6 && inet_pton(AF_INET6, local, &in6) == 1) {
if (localaddr6 == NULL)
localaddr6 = isc_mem_get(gmctx,
sizeof(isc_sockaddr_t));
localaddr6 = isc_mem_get(gmctx, sizeof(isc_sockaddr_t));
if (localaddr6 == NULL)
fatal("out of memory");
isc_sockaddr_fromin6(localaddr6, &in6, (in_port_t)port);
} else if (have_ipv4 && inet_pton(AF_INET, local, &in4) == 1) {
if (localaddr4 == NULL)
localaddr4 = isc_mem_get(gmctx,
sizeof(isc_sockaddr_t));
localaddr4 = isc_mem_get(gmctx, sizeof(isc_sockaddr_t));
if (localaddr4 == NULL)
fatal("out of memory");
isc_sockaddr_fromin(localaddr4, &in4, (in_port_t)port);
} else {
fprintf(stderr, "invalid address %s", local);
@@ -1598,6 +1608,8 @@ evaluate_key(char *cmdline) {
}
secretlen = strlen(secretstr) * 3 / 4;
secret = isc_mem_allocate(gmctx, secretlen);
if (secret == NULL)
fatal("out of memory");
isc_buffer_init(&secretbuf, secret, secretlen);
result = isc_base64_decodestring(secretstr, &secretbuf);
@@ -1671,6 +1683,8 @@ evaluate_realm(char *cmdline) {
return (STATUS_SYNTAX);
}
realm = isc_mem_strdup(gmctx, buf);
if (realm == NULL)
fatal("out of memory");
return (STATUS_MORE);
#else
UNUSED(cmdline);
@@ -2506,6 +2520,8 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
ddebug("Destroying request [%p]", request);
dns_request_destroy(&request);
reqinfo = isc_mem_get(gmctx, sizeof(nsu_requestinfo_t));
if (reqinfo == NULL)
fatal("out of memory");
reqinfo->msg = soaquery;
reqinfo->addr = addr;
dns_message_renderreset(soaquery);
@@ -2643,6 +2659,8 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
master_alloc = MAX_SERVERADDRS;
size = master_alloc * sizeof(isc_sockaddr_t);
master_servers = isc_mem_get(gmctx, size);
if (master_servers == NULL)
fatal("out of memory");
memset(master_servers, 0, size);
master_total = get_addresses(serverstr, dnsport,
@@ -2706,6 +2724,8 @@ sendrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
isc_sockaddr_t *srcaddr;
reqinfo = isc_mem_get(gmctx, sizeof(nsu_requestinfo_t));
if (reqinfo == NULL)
fatal("out of memory");
reqinfo->msg = msg;
reqinfo->addr = destaddr;
@@ -2815,6 +2835,8 @@ start_gssrequest(dns_name_t *master) {
dns_name_format(master, namestr, sizeof(namestr));
if (kserver == NULL) {
kserver = isc_mem_get(gmctx, sizeof(isc_sockaddr_t));
if (kserver == NULL)
fatal("out of memory");
}
memmove(kserver, &master_servers[master_inuse],
@@ -2898,6 +2920,8 @@ send_gssrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
debug("send_gssrequest");
reqinfo = isc_mem_get(gmctx, sizeof(nsu_gssinfo_t));
if (reqinfo == NULL)
fatal("out of memory");
reqinfo->msg = msg;
reqinfo->addr = destaddr;
reqinfo->context = context;
+1 -1
View File
@@ -17,7 +17,7 @@ CINCLUDES = ${ISC_INCLUDES}
CDEFINES =
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCDEPLIBS = ../../lib/isc/libisc.@A@
+2 -2
View File
@@ -17,9 +17,9 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \
${NS_INCLUDES} ${DNS_INCLUDES} \
${ISCCFG_INCLUDES} ${ISC_INCLUDES}
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
NSLIBS = ../../lib/ns/libns.@A@
LIBS =
+7 -2
View File
@@ -43,12 +43,12 @@ dnssec-checkds \- DNSSEC delegation consistency checking tool
.SH "DESCRIPTION"
.PP
\fBdnssec\-checkds\fR
verifies the correctness of Delegation Signer (DS) resource records for keys in a specified zone\&.
verifies the correctness of Delegation Signer (DS) or DNSSEC Lookaside Validation (DLV) resource records for keys in a specified zone\&.
.SH "OPTIONS"
.PP
\-a \fIalgorithm\fR
.RS 4
Specify a digest algorithm to use when converting the zone\*(Aqs DNSKEY records to expected DS records\&. This option can be repeated, so that multiple records are checked for each DNSKEY record\&.
Specify a digest algorithm to use when converting the zone\*(Aqs DNSKEY records to expected DS or DLV records\&. This option can be repeated, so that multiple records are checked for each DNSKEY record\&.
.sp
The
\fIalgorithm\fR
@@ -62,6 +62,11 @@ If a
is specified, then the zone is read from that file to find the DNSKEY records\&. If not, then the DNSKEY records for the zone are looked up in the DNS\&.
.RE
.PP
\-l \fIdomain\fR
.RS 4
Check for a DLV record in the specified lookaside domain, instead of checking for a DS record in the zone\*(Aqs parent\&.
.RE
.PP
\-s \fIfile\fR
.RS 4
Specifies a prepared dsset file, such as would be generated by
+14 -3
View File
@@ -59,8 +59,9 @@
<refsection><info><title>DESCRIPTION</title></info>
<para><command>dnssec-checkds</command>
verifies the correctness of Delegation Signer (DS)
resource records for keys in a specified zone.
verifies the correctness of Delegation Signer (DS) or DNSSEC
Lookaside Validation (DLV) resource records for keys in a specified
zone.
</para>
</refsection>
@@ -73,7 +74,7 @@
<listitem>
<para>
Specify a digest algorithm to use when converting the
zone's DNSKEY records to expected DS records. This
zone's DNSKEY records to expected DS or DLV records. This
option can be repeated, so that multiple records are
checked for each DNSKEY record.
</para>
@@ -97,6 +98,16 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-l <replaceable class="parameter">domain</replaceable></term>
<listitem>
<para>
Check for a DLV record in the specified lookaside domain,
instead of checking for a DS record in the zone's parent.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-s <replaceable class="parameter">file</replaceable></term>
<listitem>
+11 -3
View File
@@ -46,8 +46,9 @@
<a name="id-1.7"></a><h2>DESCRIPTION</h2>
<p><span class="command"><strong>dnssec-checkds</strong></span>
verifies the correctness of Delegation Signer (DS)
resource records for keys in a specified zone.
verifies the correctness of Delegation Signer (DS) or DNSSEC
Lookaside Validation (DLV) resource records for keys in a specified
zone.
</p>
</div>
@@ -59,7 +60,7 @@
<dd>
<p>
Specify a digest algorithm to use when converting the
zone's DNSKEY records to expected DS records. This
zone's DNSKEY records to expected DS or DLV records. This
option can be repeated, so that multiple records are
checked for each DNSKEY record.
</p>
@@ -78,6 +79,13 @@
then the DNSKEY records for the zone are looked up in the DNS.
</p>
</dd>
<dt><span class="term">-l <em class="replaceable"><code>domain</code></em></span></dt>
<dd>
<p>
Check for a DLV record in the specified lookaside domain,
instead of checking for a DS record in the zone's parent.
</p>
</dd>
<dt><span class="term">-s <em class="replaceable"><code>file</code></em></span></dt>
<dd>
<p>
+33 -9
View File
@@ -21,7 +21,7 @@ prog = 'dnssec-checkds'
############################################################################
# SECRR class:
# Class for DS resource record
# Class for DS/DLV resource record
############################################################################
class SECRR:
hashalgs = {1: 'SHA-1', 2: 'SHA-256', 3: 'GOST', 4: 'SHA-384'}
@@ -33,7 +33,7 @@ class SECRR:
digest = ''
ttl = 0
def __init__(self, rrtext):
def __init__(self, rrtext, dlvname = None):
if not rrtext:
raise Exception
@@ -45,8 +45,24 @@ class SECRR:
if len(fields) < 7:
raise Exception
self.rrtype = "DS"
self.rrname = fields[0].lower()
if dlvname:
self.rrtype = "DLV"
self.dlvname = dlvname.lower()
parent = fields[0].lower().strip('.').split('.')
parent.reverse()
dlv = dlvname.split('.')
dlv.reverse()
while len(dlv) != 0 and len(parent) != 0 and parent[0] == dlv[0]:
parent = parent[1:]
dlv = dlv[1:]
if dlv:
raise Exception
parent.reverse()
self.parent = '.'.join(parent)
self.rrname = self.parent + '.' + self.dlvname + '.'
else:
self.rrtype = "DS"
self.rrname = fields[0].lower()
fields = fields[1:]
if fields[0].upper() in ['IN', 'CH', 'HS']:
@@ -75,9 +91,9 @@ class SECRR:
############################################################################
# check:
# Fetch DS RRset for the given zone from the DNS; fetch DNSKEY
# Fetch DS/DLV RRset for the given zone from the DNS; fetch DNSKEY
# RRset from the masterfile if specified, or from DNS if not.
# Generate a set of expected DS records from the DNSKEY RRset,
# Generate a set of expected DS/DLV records from the DNSKEY RRset,
# and report on congruency.
############################################################################
def check(zone, args):
@@ -85,13 +101,15 @@ def check(zone, args):
if args.dssetfile:
fp = open(args.dssetfile).read()
else:
cmd = [args.dig, "+noall", "+answer", "-t", "ds", "-q", zone]
cmd = [args.dig, "+noall", "+answer", "-t",
"dlv" if args.lookaside else "ds", "-q",
zone + "." + args.lookaside if args.lookaside else zone]
fp, _ = Popen(cmd, stdout=PIPE).communicate()
for line in fp.splitlines():
if type(line) is not str:
line = line.decode('ascii')
rrlist.append(SECRR(line))
rrlist.append(SECRR(line, args.lookaside))
rrlist = sorted(rrlist, key=lambda rr: (rr.keyid, rr.keyalg, rr.hashalg))
klist = []
@@ -99,6 +117,8 @@ def check(zone, args):
cmd = [args.dsfromkey]
for algo in args.algo:
cmd += ['-a', algo]
if args.lookaside:
cmd += ["-l", args.lookaside]
if args.masterfile:
cmd += ["-f", args.masterfile, zone]
@@ -112,7 +132,7 @@ def check(zone, args):
for line in fp.splitlines():
if type(line) is not str:
line = line.decode('ascii')
klist.append(SECRR(line))
klist.append(SECRR(line, args.lookaside))
if len(klist) < 1:
print("No DNSKEY records found in zone apex")
@@ -162,6 +182,8 @@ def parse_args():
type=str, help='path to \'dnssec-dsfromkey\'')
parser.add_argument('-f', '--file', dest='masterfile', type=str,
help='zone master file')
parser.add_argument('-l', '--lookaside', dest='lookaside', type=str,
help='DLV lookaside zone')
parser.add_argument('-s', '--dsset', dest='dssetfile', type=str,
help='prepared DSset file')
parser.add_argument('-v', '--version', action='version',
@@ -169,6 +191,8 @@ def parse_args():
args = parser.parse_args()
args.zone = args.zone.strip('.')
if args.lookaside:
args.lookaside = args.lookaside.strip('.')
return args
+3 -3
View File
@@ -23,9 +23,9 @@ CWARNINGS =
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
ISCCCLIBS = ../../lib/isccc/libisccc.@A@
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
+8 -8
View File
@@ -284,7 +284,7 @@ maintain, and also requires the zone to be configured to allow dynamic DNS\&. (S
.PP
\fBmanaged\-keys \fR\fB\fI(status | refresh | sync | destroy)\fR\fR\fB \fR\fB[\fIclass\fR [\fIview\fR]]\fR
.RS 4
Inspect and control the "managed keys" database which handles RFC 5011 DNSSEC trust anchor maintenance\&. If a view is specified, these commands are applied to that view; otherwise they are applied to all views\&.
Inspect and control the "managed\-keys" database which handles RFC 5011 DNSSEC trust anchor maintenance\&. If a view is specified, these commands are applied to that view; otherwise they are applied to all views\&.
.sp
.RS 4
.ie n \{\
@@ -296,7 +296,7 @@ Inspect and control the "managed keys" database which handles RFC 5011 DNSSEC tr
.\}
When run with the
status
keyword, prints the current status of the managed keys database\&.
keyword, prints the current status of the managed\-keys database\&.
.RE
.sp
.RS 4
@@ -309,7 +309,7 @@ keyword, prints the current status of the managed keys database\&.
.\}
When run with the
refresh
keyword, forces an immediate refresh query to be sent for all the managed keys, updating the managed keys database if any new keys are found, without waiting the normal refresh interval\&.
keyword, forces an immediate refresh query to be sent for all the managed keys, updating the managed\-keys database if any new keys are found, without waiting the normal refresh interval\&.
.RE
.sp
.RS 4
@@ -322,7 +322,7 @@ keyword, forces an immediate refresh query to be sent for all the managed keys,
.\}
When run with the
sync
keyword, forces an immediate dump of the managed keys database to disk (in the file
keyword, forces an immediate dump of the managed\-keys database to disk (in the file
managed\-keys\&.bind
or (\fIviewname\fR\&.mkeys)\&. This synchronizes the database with its journal file, so that the database\*(Aqs current contents can be inspected visually\&.
.RE
@@ -337,7 +337,7 @@ or (\fIviewname\fR\&.mkeys)\&. This synchronizes the database with its journal f
.\}
When run with the
destroy
keyword, the managed keys database is shut down and deleted, and all key maintenance is terminated\&. This command should be used only with extreme caution\&.
keyword, the managed\-keys database is shut down and deleted, and all key maintenance is terminated\&. This command should be used only with extreme caution\&.
.sp
Existing keys that are already trusted are not deleted from memory; DNSSEC validation can continue after this command is used\&. However, key maintenance operations will cease until
\fBnamed\fR
@@ -515,8 +515,8 @@ timer\&.
\fBsecroots \fR\fB[\-]\fR\fB \fR\fB[\fIview \&.\&.\&.\fR]\fR
.RS 4
Dump the security roots (i\&.e\&., trust anchors configured via
\fBdnssec\-keys\fR
statements, or the managed\-keys or trusted\-keys statements (both deprecated), or via
\fBtrusted\-keys\fR,
\fBmanaged\-keys\fR, or
\fBdnssec\-validation auto\fR) and negative trust anchors for the specified views\&. If no view is specified, all views are dumped\&. Security roots will indicate whether they are configured as trusted keys, managed keys, or initializing managed keys (managed keys that have not yet been updated by a successful key refresh query)\&.
.sp
If the first argument is "\-", then the output is returned via the
@@ -697,7 +697,7 @@ Delete a given TKEY\-negotiated key from the server\&. (This does not apply to s
.RS 4
List the names of all TSIG keys currently configured for use by
\fBnamed\fR
in each view\&. The list includes both statically configured keys and dynamic TKEY\-negotiated keys\&.
in each view\&. The list both statically configured keys and dynamic TKEY\-negotiated keys\&.
.RE
.PP
\fBvalidation ( on | off | status ) \fR\fB[\fIview \&.\&.\&.\fR]\fR\fB \fR
+4 -2
View File
@@ -278,7 +278,7 @@ rndc_senddone(isc_task_t *task, isc_event_t *event) {
if (sends == 0 && recvs == 0) {
isc_socket_detach(&sock);
isc_task_shutdown(task);
isc_app_shutdown();
RUNTIME_CHECK(isc_app_shutdown() == ISC_R_SUCCESS);
}
}
@@ -347,7 +347,7 @@ rndc_recvdone(isc_task_t *task, isc_event_t *event) {
if (sends == 0 && recvs == 0) {
isc_socket_detach(&sock);
isc_task_shutdown(task);
isc_app_shutdown();
RUNTIME_CHECK(isc_app_shutdown() == ISC_R_SUCCESS);
}
}
@@ -968,6 +968,8 @@ main(int argc, char **argv) {
argslen += strlen(argv[i]) + 1;
args = isc_mem_get(rndc_mctx, argslen);
if (args == NULL)
DO("isc_mem_get", ISC_R_NOMEMORY);
p = args;
for (i = 0; i < argc; i++) {
+9 -9
View File
@@ -458,7 +458,7 @@
<term><userinput>managed-keys <replaceable>(status | refresh | sync | destroy)</replaceable> <optional><replaceable>class</replaceable> <optional><replaceable>view</replaceable></optional></optional></userinput></term>
<listitem>
<para>
Inspect and control the "managed keys" database which
Inspect and control the "managed-keys" database which
handles RFC 5011 DNSSEC trust anchor maintenance. If a view
is specified, these commands are applied to that view;
otherwise they are applied to all views.
@@ -467,14 +467,14 @@
<listitem>
<para>
When run with the <literal>status</literal> keyword, prints
the current status of the managed keys database.
the current status of the managed-keys database.
</para>
</listitem>
<listitem>
<para>
When run with the <literal>refresh</literal> keyword,
forces an immediate refresh query to be sent for all
the managed keys, updating the managed keys database
the managed keys, updating the managed-keys database
if any new keys are found, without waiting the normal
refresh interval.
</para>
@@ -482,7 +482,7 @@
<listitem>
<para>
When run with the <literal>sync</literal> keyword, forces an
immediate dump of the managed keys database to disk
immediate dump of the managed-keys database to disk
(in the file <filename>managed-keys.bind</filename> or
(<filename><replaceable>viewname</replaceable>.mkeys</filename>).
This synchronizes the database with its journal file, so
@@ -493,7 +493,7 @@
<listitem>
<para>
When run with the <literal>destroy</literal> keyword, the
managed keys database is shut down and deleted, and all key
managed-keys database is shut down and deleted, and all key
maintenance is terminated. This command should be used only
with extreme caution.
</para>
@@ -772,9 +772,9 @@
<listitem>
<para>
Dump the security roots (i.e., trust anchors
configured via <command>dnssec-keys</command> statements, or the
managed-keys or trusted-keys statements (both deprecated), or
via <command>dnssec-validation auto</command>) and negative trust
configured via <command>trusted-keys</command>,
<command>managed-keys</command>, or
<command>dnssec-validation auto</command>) and negative trust
anchors for the specified views. If no view is specified, all
views are dumped. Security roots will indicate whether
they are configured as trusted keys, managed keys, or
@@ -1066,7 +1066,7 @@
<para>
List the names of all TSIG keys currently configured
for use by <command>named</command> in each view. The
list includes both statically configured keys and dynamic
list both statically configured keys and dynamic
TKEY-negotiated keys.
</para>
</listitem>
+9 -9
View File
@@ -378,7 +378,7 @@
<dt><span class="term"><strong class="userinput"><code>managed-keys <em class="replaceable"><code>(status | refresh | sync | destroy)</code></em> [<span class="optional"><em class="replaceable"><code>class</code></em> [<span class="optional"><em class="replaceable"><code>view</code></em></span>]</span>]</code></strong></span></dt>
<dd>
<p>
Inspect and control the "managed keys" database which
Inspect and control the "managed-keys" database which
handles RFC 5011 DNSSEC trust anchor maintenance. If a view
is specified, these commands are applied to that view;
otherwise they are applied to all views.
@@ -387,14 +387,14 @@
<li class="listitem">
<p>
When run with the <code class="literal">status</code> keyword, prints
the current status of the managed keys database.
the current status of the managed-keys database.
</p>
</li>
<li class="listitem">
<p>
When run with the <code class="literal">refresh</code> keyword,
forces an immediate refresh query to be sent for all
the managed keys, updating the managed keys database
the managed keys, updating the managed-keys database
if any new keys are found, without waiting the normal
refresh interval.
</p>
@@ -402,7 +402,7 @@
<li class="listitem">
<p>
When run with the <code class="literal">sync</code> keyword, forces an
immediate dump of the managed keys database to disk
immediate dump of the managed-keys database to disk
(in the file <code class="filename">managed-keys.bind</code> or
(<code class="filename"><em class="replaceable"><code>viewname</code></em>.mkeys</code>).
This synchronizes the database with its journal file, so
@@ -413,7 +413,7 @@
<li class="listitem">
<p>
When run with the <code class="literal">destroy</code> keyword, the
managed keys database is shut down and deleted, and all key
managed-keys database is shut down and deleted, and all key
maintenance is terminated. This command should be used only
with extreme caution.
</p>
@@ -653,9 +653,9 @@
<dd>
<p>
Dump the security roots (i.e., trust anchors
configured via <span class="command"><strong>dnssec-keys</strong></span> statements, or the
managed-keys or trusted-keys statements (both deprecated), or
via <span class="command"><strong>dnssec-validation auto</strong></span>) and negative trust
configured via <span class="command"><strong>trusted-keys</strong></span>,
<span class="command"><strong>managed-keys</strong></span>, or
<span class="command"><strong>dnssec-validation auto</strong></span>) and negative trust
anchors for the specified views. If no view is specified, all
views are dumped. Security roots will indicate whether
they are configured as trusted keys, managed keys, or
@@ -905,7 +905,7 @@
<p>
List the names of all TSIG keys currently configured
for use by <span class="command"><strong>named</strong></span> in each view. The
list includes both statically configured keys and dynamic
list both statically configured keys and dynamic
TKEY-negotiated keys.
</p>
</dd>
+4 -4
View File
@@ -14,15 +14,15 @@ top_srcdir = @top_srcdir@
@BIND9_MAKE_INCLUDES@
CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES} \
${OPENSSL_CFLAGS}
@OPENSSL_INCLUDES@
CDEFINES =
CWARNINGS =
BACKTRACECFLAGS = @BACKTRACECFLAGS@
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS}
DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
DNSDEPLIBS = ../../lib/dns/libdns.@A@
+5 -10
View File
@@ -49,8 +49,7 @@ output(void *closure, const char *text, int textlen) {
static void
usage(void) {
fprintf(stderr, "usage: cfg_test --rndc|--named "
"[--grammar] [--zonegrammar] [--active] "
"[--memstats] conffile\n");
"[--grammar] [--memstats] conffile\n");
exit(1);
}
@@ -68,7 +67,6 @@ main(int argc, char **argv) {
bool memstats = false;
char *filename = NULL;
unsigned int zonetype = 0;
unsigned int pflags = 0;
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
@@ -100,9 +98,7 @@ main(int argc, char **argv) {
usage();
while (argc > 1) {
if (strcmp(argv[1], "--active") == 0) {
pflags |= CFG_PRINTER_ACTIVEONLY;
} else if (strcmp(argv[1], "--grammar") == 0) {
if (strcmp(argv[1], "--grammar") == 0) {
grammar = true;
} else if (strcmp(argv[1], "--zonegrammar") == 0) {
argv++, argc--;
@@ -153,14 +149,13 @@ main(int argc, char **argv) {
if (grammar) {
if (type == NULL)
usage();
cfg_print_grammar(type, pflags, output, NULL);
cfg_print_grammar(type, output, NULL);
} else if (zonetype != 0) {
cfg_print_zonegrammar(zonetype, pflags, output, NULL);
cfg_print_zonegrammar(zonetype, output, NULL);
} else {
if (type == NULL || filename == NULL)
usage();
RUNTIME_CHECK(cfg_parser_create(mctx, lctx, &pctx) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(cfg_parser_create(mctx, lctx, &pctx) == ISC_R_SUCCESS);
result = cfg_parse_file(pctx, filename, type, &cfg);
+6 -4
View File
@@ -174,6 +174,7 @@ options {
files 230;
max-cache-size 1m;
stacksize 231;
cleaning-interval 1000;
heartbeat-interval 1001;
interface-interval 1002;
statistics-interval 1003;
@@ -259,8 +260,8 @@ key "non-viewkey" { secret "YWFh" ; algorithm "zzz" ; };
view "test-view" in {
key "viewkey" { algorithm "xxx" ; secret "eXl5" ; };
also-notify { 10.2.2.3; };
managed-keys {
foo.com. static 4 3 2 "abdefghijklmnopqrstuvwxyz";
trusted-keys {
foo.com. 4 3 2 "abdefghijklmnopqrstuvwxyz";
};
sig-validity-interval 45;
max-cache-size 100000;
@@ -284,6 +285,7 @@ view "test-view" in {
query-source-v6 address 6:6:6:6:6:6:6:6 port *;
max-transfer-time-out 45;
max-transfer-idle-out 55;
cleaning-interval 100;
min-roots 3;
lame-ttl 477;
max-ncache-ttl 333;
@@ -342,8 +344,8 @@ zone "." {
// pubkey 257 255 1 "AQP2fHpZ4VMpKo/jc9Fod821uyfY5p8j5h/Am0V/KpBTMZjdXmp9QJe6yFRoIIzkaNCgTIftASdpXGgCwFB2j2KXP/rick6gvEer5VcDEkLR5Q==";
};
managed-keys {
"." static 257 255 1 "AQP2fHpZ4VMpKo/jc9Fod821uyfY5p8j5h/Am0V/KpBTMZjdXmp9QJe6yFRoIIzkaNCgTIftASdpXGgCwFB2j2KXP/rick6gvEer5VcDEkLR5Q==";
trusted-keys {
"." 257 255 1 "AQP2fHpZ4VMpKo/jc9Fod821uyfY5p8j5h/Am0V/KpBTMZjdXmp9QJe6yFRoIIzkaNCgTIftASdpXGgCwFB2j2KXP/rick6gvEer5VcDEkLR5Q==";
};

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