Compare commits

..
Author SHA1 Message Date
Evan Hunt 8914b8391d Merge branch 'complete-dname-fix' into security-v9_12_2_patch 2018-07-24 10:22:12 -07:00
Evan Hunt e78e55f435 caclulate nlabels and set *chainingp correctly 2018-07-24 10:21:52 -07:00
Tinderbox User 957ea4ad58 Merge branch 'prep-release' into security-v9_12_2_patch 2018-07-13 21:27:25 +00:00
Tinderbox User 61bb71e272 prep 9.12.2-P1 2018-07-13 21:27:05 +00:00
Evan Hunt 283cecb0c2 Merge branch '387-security-dname' into 'v9_12_2_patch' 2018-07-13 13:38:00 -07:00
Evan Hunt ecb90158b6 CHANGES, release note
(cherry picked from commit 9c492aba65c178f30baafeb5502013f95a9d5b9a)
2018-07-13 13:21:14 -07:00
Evan Hunt 584a1cff8b test case
(cherry picked from commit 73486c13f743407a50d5bbadde90c949a696506f)
2018-07-13 13:16:07 -07:00
Evan Hunt 6e187b8656 explicit DNAME query could trigger a crash if deny-answer-aliases was set
(cherry picked from commit a21c3810d3453548cc05ae19995125dabea9ca9c)
2018-07-13 13:15:35 -07:00
1579 changed files with 158483 additions and 40928 deletions
+29
View File
@@ -24,6 +24,35 @@ gen.dSYM/
.libs/
.deps/
.dirstamp
unit/atf-src/atf-c++/atf-c++.pc
unit/atf-src/atf-c/atf-c.pc
unit/atf-src/atf-c/defs.h
unit/atf-src/atf-c/detail/process_helpers
unit/atf-src/atf-config/atf-config
unit/atf-src/atf-report/atf-report
unit/atf-src/atf-report/fail_helper
unit/atf-src/atf-report/misc_helpers
unit/atf-src/atf-report/pass_helper
unit/atf-src/atf-run/atf-run
unit/atf-src/atf-run/bad_metadata_helper
unit/atf-src/atf-run/expect_helpers
unit/atf-src/atf-run/misc_helpers
unit/atf-src/atf-run/pass_helper
unit/atf-src/atf-run/several_tcs_helper
unit/atf-src/atf-run/zero_tcs_helper
unit/atf-src/atf-sh/atf-check
unit/atf-src/atf-sh/atf-sh
unit/atf-src/atf-sh/misc_helpers
unit/atf-src/atf-version/atf-version
unit/atf-src/atf-version/revision.h
unit/atf-src/atf-version/revision.h.stamp
unit/atf-src/bconfig.h
unit/atf-src/bootstrap/atconfig
unit/atf-src/doc/atf.7
unit/atf-src/stamp-h1
unit/atf-src/test-programs/c_helpers
unit/atf-src/test-programs/cpp_helpers
unit/atf-src/test-programs/sh_helpers
# ccc-analyzer store its results in .plist directories
*.plist/
*~
+116 -407
View File
@@ -1,498 +1,207 @@
variables:
# Not normally needed, but may be if some script uses `apt-get install`.
DEBIAN_FRONTEND: noninteractive
# Locale settings do not affect the build, but might affect tests.
LC_ALL: C
CI_REGISTRY_IMAGE: registry.gitlab.isc.org/isc-projects/images/bind9
DOCKER_DRIVER: overlay2
CI_REGISTRY_IMAGE: oerdnj/bind9
CCACHE_DIR: "/ccache"
SOFTHSM2_CONF: "/var/tmp/softhsm2/softhsm2.conf"
stages:
- precheck
- build
- test
- push
### Runner Tag Templates
.linux-amd64: &linux_amd64
tags:
- linux
- amd64
.linux-i386: &linux_i386
tags:
- linux
- i386
### Docker Image Templates
# CentOS
.centos-centos6-amd64: &centos_centos6_amd64_image
image: "$CI_REGISTRY_IMAGE:centos-centos6-amd64"
<<: *linux_amd64
.centos-centos7-amd64: &centos_centos7_amd64_image
image: "$CI_REGISTRY_IMAGE:centos-centos7-amd64"
<<: *linux_amd64
# Debian
.debian-jessie-amd64: &debian_jessie_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-jessie-amd64"
<<: *linux_amd64
tags:
- linux
- docker
- amd64
.debian-jessie-i386: &debian_jessie_i386_image
image: "$CI_REGISTRY_IMAGE:debian-jessie-i386"
<<: *linux_i386
tags:
- linux
- docker
- i386
.debian-stretch-amd64: &debian_stretch_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-stretch-amd64"
<<: *linux_amd64
tags:
- linux
- docker
- amd64
.debian-stretch-i386: &debian_stretch_i386_image
.debian-stretch-i386:: &debian_stretch_i386_image
image: "$CI_REGISTRY_IMAGE:debian-stretch-i386"
<<: *linux_i386
tags:
- linux
- docker
- i386
.debian-buster-amd64: &debian_buster_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-buster-amd64"
tags:
- linux
- docker
- amd64
.debian-buster-i386:: &debian_buster_i386_image
image: "$CI_REGISTRY_IMAGE:debian-buster-i386"
tags:
- linux
- docker
- i386
.debian-sid-amd64: &debian_sid_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-sid-amd64"
<<: *linux_amd64
tags:
- linux
- docker
- amd64
.debian-sid-i386: &debian_sid_i386_image
image: "$CI_REGISTRY_IMAGE:debian-sid-i386"
<<: *linux_i386
tags:
- linux
- docker
- i386
# Fedora
.ubuntu-trusty-amd64: &ubuntu_trusty_amd64_image
image: "$CI_REGISTRY_IMAGE:ubuntu-trusty-amd64"
tags:
- linux
- docker
- amd64
.fedora-29-amd64: &fedora_29_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-29-amd64"
<<: *linux_amd64
# Ubuntu
.ubuntu-trusty-i386: &ubuntu_trusty_i386_image
image: "$CI_REGISTRY_IMAGE:ubuntu-trusty-i386"
tags:
- linux
- docker
- i386
.ubuntu-xenial-amd64: &ubuntu_xenial_amd64_image
image: "$CI_REGISTRY_IMAGE:ubuntu-xenial-amd64"
<<: *linux_amd64
tags:
- linux
- docker
- amd64
.ubuntu-xenial-i386: &ubuntu_xenial_i386_image
image: "$CI_REGISTRY_IMAGE:ubuntu-xenial-i386"
<<: *linux_i386
.ubuntu-bionic-amd64: &ubuntu_bionic_amd64_image
image: "$CI_REGISTRY_IMAGE:ubuntu-bionic-amd64"
<<: *linux_amd64
.ubuntu-bionic-i386: &ubuntu_bionic_i386_image
image: "$CI_REGISTRY_IMAGE:ubuntu-bionic-i386"
<<: *linux_i386
### Job Templates
.default-triggering-rules: &default_triggering_rules
only:
- merge_requests
- tags
- web
.precheck: &precheck_job
<<: *default_triggering_rules
<<: *debian_sid_amd64_image
stage: precheck
tags:
- linux
- docker
- i386
.build: &build_job
<<: *default_triggering_rules
stage: build
before_script:
- test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
- autoreconf -fi
script:
- ./configure --enable-developer --with-randomdev=/dev/urandom --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
- ./configure --enable-developer --with-libtool --disable-static --with-atf=/usr/local --with-libidn2
- make -j${PARALLEL_JOBS_BUILD:-1} -k all V=1
artifacts:
expire_in: '1 hour'
untracked: true
expire_in: "1 hour"
.system_test: &system_test_job
<<: *default_triggering_rules
stage: test
before_script:
- rm -rf .ccache
- 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
artifacts:
untracked: true
expire_in: "1 week"
expire_in: '1 week'
when: on_failure
.unit_test: &unit_test_job
<<: *default_triggering_rules
stage: test
before_script:
- export KYUA_RESULT="$CI_PROJECT_DIR/kyua.results"
- bash -x util/prepare-softhsm2.sh
script:
- make unit
after_script:
- kyua report-html --force --results-file kyua.results --results-filter "" --output kyua_html
artifacts:
paths:
- kyua.log
- kyua.results
- kyua_html/
expire_in: "1 week"
- atf.out
- kyua.log
- kyua.results
- kyua_html/
expire_in: '1 week'
when: on_failure
### Job Definitions
# Jobs in the precheck stage
misc:sid:amd64:
<<: *precheck_job
precheck:debian:sid:amd64:
<<: *debian_sid_amd64_image
stage: precheck
script:
- sh util/check-ans-prereq.sh
- sh util/checklibs.sh > checklibs.out
- sh util/tabify-changes < CHANGES > CHANGES.tmp
- diff -urNap CHANGES CHANGES.tmp
- rm CHANGES.tmp
- perl util/check-changes CHANGES
- perl -w util/merge_copyrights
- diff -urNap util/copyrights util/newcopyrights
- rm util/newcopyrights
- perl -w util/update_copyrights < util/copyrights
- if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
- xmllint --noout --nonet `git ls-files '*.xml' '*.docbook'`
- xmllint --noout --nonet --html `git ls-files '*.html'`
artifacts:
paths:
- util/newcopyrights
- checklibs.out
expire_in: "1 week"
- util/newcopyrights
expire_in: '1 week'
when: on_failure
🐞:sid:amd64:
<<: *precheck_job
script: util/check-cocci
#build:debian:jessie:amd64:
# <<: *debian_jessie_amd64_image
# <<: *build_job
#
#build:debian:jessie:i386:
# <<: *debian_jessie_i386_image
# <<: *build_job
#
#build:debian:stretch:amd64:
# <<: *debian_stretch_amd64_image
# <<: *build_job
#
#build:debian:buster:i386:
# <<: *debian_buster_i386_image
# <<: *build_job
#
#build:ubuntu:trusty:amd64:
# <<: *ubuntu_trusty_amd64_image
# <<: *build_job
#
#build:ubuntu:xenial:i386:
# <<: *ubuntu_xenial_i386_image
# <<: *build_job
# Jobs for doc builds on Debian Sid (amd64)
docs:sid:amd64:
<<: *debian_sid_amd64_image
stage: build
script:
- ./configure || cat config.log
- make -C doc/misc docbook
- make -C doc/arm Bv9ARM.html
artifacts:
paths:
- doc/arm/
expire_in: "1 month"
only:
- merge_requests
- tags
- web
- master@isc-projects/bind9
- /^v9_[1-9][0-9]$/@isc-projects/bind9
push:docs:sid:amd64:
<<: *debian_sid_amd64_image
stage: push
dependencies: []
script:
- curl -X POST -F token=$GITLAB_PAGES_DOCS_TRIGGER_TOKEN -F ref=master $GITLAB_PAGES_DOCS_TRIGGER_URL
only:
- master@isc-projects/bind9
- /^v9_[1-9][0-9]$/@isc-projects/bind9
# Jobs for regular GCC builds on CentOS 6 (amd64)
gcc:centos6:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--with-libidn2 --disable-warn-error"
<<: *centos_centos6_amd64_image
<<: *build_job
system:gcc:centos6:amd64:
<<: *centos_centos6_amd64_image
<<: *system_test_job
dependencies:
- gcc:centos6:amd64
unit:gcc:centos6:amd64:
<<: *centos_centos6_amd64_image
<<: *unit_test_job
dependencies:
- gcc:centos6:amd64
# Jobs for regular GCC builds on CentOS 7 (amd64)
gcc:centos7:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *centos_centos7_amd64_image
<<: *build_job
system:gcc:centos7:amd64:
<<: *centos_centos7_amd64_image
<<: *system_test_job
dependencies:
- gcc:centos7:amd64
unit:gcc:centos7:amd64:
<<: *centos_centos7_amd64_image
<<: *unit_test_job
dependencies:
- gcc:centos7:amd64
# Jobs for regular GCC builds on Debian 8 Jessie (amd64)
gcc:jessie:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--without-cmocka --with-python"
<<: *debian_jessie_amd64_image
<<: *build_job
system:gcc:jessie:amd64:
<<: *debian_jessie_amd64_image
<<: *system_test_job
dependencies:
- gcc:jessie:amd64
unit:gcc:jessie:amd64:
<<: *debian_jessie_amd64_image
<<: *unit_test_job
dependencies:
- gcc:jessie:amd64
# Jobs for regular GCC builds on Debian 9 Stretch (amd64)
gcc:stretch:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
<<: *debian_stretch_amd64_image
<<: *build_job
system:gcc:stretch:amd64:
<<: *debian_stretch_amd64_image
<<: *system_test_job
dependencies:
- gcc:stretch:amd64
unit:gcc:stretch:amd64:
<<: *debian_stretch_amd64_image
<<: *unit_test_job
dependencies:
- gcc:stretch:amd64
# Jobs for regular GCC builds on Debian Sid (amd64)
gcc:sid:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--with-libidn2"
RUN_MAKE_INSTALL: 1
build:debian:sid:amd64:
<<: *debian_sid_amd64_image
<<: *build_job
system:gcc:sid:amd64:
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
- gcc:sid:amd64
unit:gcc:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- gcc:sid:amd64
# Jobs for regular GCC builds on Debian Sid (i386)
gcc:sid:i386:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--with-libidn2 --without-python"
build:debian:sid:i386:
<<: *debian_sid_i386_image
<<: *build_job
system:gcc:sid:i386:
<<: *debian_sid_i386_image
<<: *system_test_job
unittest:debian:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- gcc:sid:i386
unit:gcc:sid:i386:
- build:debian:sid:amd64
unittest:debian:sid:i386:
<<: *debian_sid_i386_image
<<: *unit_test_job
dependencies:
- gcc:sid:i386
- build:debian:sid:i386
# Jobs for regular GCC builds on Fedora 29 (amd64)
gcc:fedora29:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *fedora_29_amd64_image
<<: *build_job
system:gcc:fedora29:amd64:
<<: *fedora_29_amd64_image
<<: *system_test_job
dependencies:
- gcc:fedora29:amd64
unit:gcc:fedora29:amd64:
<<: *fedora_29_amd64_image
<<: *unit_test_job
dependencies:
- gcc:fedora29:amd64
# Jobs for regular GCC builds on Ubuntu 16.04 Xenial Xerus (amd64)
gcc:xenial:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
<<: *ubuntu_xenial_amd64_image
<<: *build_job
system:gcc:xenial:amd64:
<<: *ubuntu_xenial_amd64_image
<<: *system_test_job
dependencies:
- gcc:xenial:amd64
unit:gcc:xenial:amd64:
<<: *ubuntu_xenial_amd64_image
<<: *unit_test_job
dependencies:
- gcc:xenial:amd64
# Jobs for regular GCC builds on Ubuntu 18.04 Bionic Beaver (amd64)
gcc:bionic:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *ubuntu_bionic_amd64_image
<<: *build_job
system:gcc:bionic:amd64:
<<: *ubuntu_bionic_amd64_image
<<: *system_test_job
dependencies:
- gcc:bionic:amd64
unit:gcc:bionic:amd64:
<<: *ubuntu_bionic_amd64_image
<<: *unit_test_job
dependencies:
- gcc:bionic:amd64
# Jobs for GCC builds with ASAN enabled on Debian Sid (amd64)
asan:sid:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g -fsanitize=address,undefined -DISC_MEM_USE_INTERNAL_MALLOC=0"
LDFLAGS: "-fsanitize=address,undefined"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_sid_amd64_image
<<: *build_job
system:asan:sid:amd64:
systemtest:debian:sid:amd64:
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
- asan:sid:amd64
unit:asan:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- asan:sid:amd64
# Jobs for Clang builds on Debian Stretch (amd64)
clang:stretch:amd64:
variables:
CC: clang
CFLAGS: "-Wall -Wextra -Wenum-conversion -O2 -g"
EXTRA_CONFIGURE: "--with-python=python3"
<<: *debian_stretch_amd64_image
<<: *build_job
unit:clang:stretch:amd64:
<<: *debian_stretch_amd64_image
<<: *unit_test_job
dependencies:
- clang:stretch:amd64
# Jobs for Clang builds on Debian Stretch (i386)
clang:stretch:i386:
variables:
CC: clang
CFLAGS: "-Wall -Wextra -Wenum-conversion -O2 -g"
EXTRA_CONFIGURE: "--with-python=python2"
<<: *debian_stretch_i386_image
<<: *build_job
# Jobs for PKCS#11-enabled GCC builds on Debian Sid (amd64)
pkcs11:sid:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
EXTRA_CONFIGURE: "--enable-native-pkcs11 --with-pkcs11=/usr/lib/softhsm/libsofthsm2.so"
<<: *debian_sid_amd64_image
<<: *build_job
system:pkcs11:sid:amd64:
<<: *debian_sid_amd64_image
- build:debian:sid:amd64
systemtest:debian:sid:i386:
<<: *debian_sid_i386_image
<<: *system_test_job
dependencies:
- pkcs11:sid:amd64
unit:pkcs11:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- pkcs11:sid:amd64
# Jobs for GCC builds with assertions compiled away on Debian Sid (amd64)
noassert:sid:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g -DISC_CHECK_NONE=1"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_sid_amd64_image
<<: *build_job
system:noassert:sid:amd64:
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
- noassert:sid:amd64
unit:noassert:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- noassert:sid:amd64
- build:debian:sid:i386
+5
View File
@@ -0,0 +1,5 @@
Content-Type: application/X-atf-atffile; version="1"
prop: test-suite = bind9
tp: lib
+5 -344
View File
@@ -1,342 +1,3 @@
5164. [bug] Correct errno to result translation in dlz filesystem
modules. [GL #884]
5163. [cleanup] Out-of-tree builds failed --enable-dnstap. [GL #836]
5162. [cleanup] Improve dnssec-keymgr manual. Thanks to Tony Finch.
[GL !1518]
5160. [contrib] Added DNAME support to the DLZ LDAP schema. Also
fixed a compilation bug affecting several DLZ
modules. [GL #872]
5159. [bug] dnssec-coverage was incorrectly ignoring
names specified on the command line without
trailing dots. [GL !1478]
5158. [protocol] Add support for AMTRELAY and ZONEMD. [GL #867]
5157. [bug] Nslookup now errors out if there are extra command
line arguments. [GL #207]
5154. [bug] dig: process_opt could be called twice on the same
message leading to a assertion failure. [GL #860]
5149. [func] "rndc dumpdb" now prints a line above a stale RRset
indicating how long the data will be retained in the
cache for emergency use. [GL #101]
5148. [bug] named did not sign the TKEY response. [GL #821]
5147. [bug] dnssec-keymgr: Add a five-minute margin to better
handle key events close to 'now'. [GL #848]
5146. [bug] Removed an unnecessary assert that could be
triggered from PKCS#11 modules during
deconstruction. [GL #841]
5143. [bug] dnssec-keymgr and dnssec-coverage failed to find
key files for zone names ending in ".". [GL #560]
5140. [bug] Don't immediately mark existing keys as inactive and
deleted when running dnssec-keymgr for the first
time. [GL #117]
5139. [bug] If possible, don't use forwarders when priming.
This ensures we can get root server IP addresses
from priming query response glue, which may not
be present if the forwarding server is returning
minimal responses. [GL #752]
5134. [bug] win32: WSAStartup was not called before getservbyname
was called. [GL #590]
5133. [bug] 'rndc managed-keys' didn't handle class and view
correctly and failed to add new lines between each
view. [GL !1327]
5132. [bug] Fix race condition in cleanup part of dns_dt_create().
[GL !1323]
5128. [bug] Refreshkeytime was not being updated for managed
keys zones. [GL #784]
5127. [bug] rcode.c:maybe_numeric failed to handle NUL in text
regions. [GL #807]
5126. [bug] Named incorrectly accepted empty base64 and hex encoded
fields when reading master files. [GL #807]
5125. [bug] Allow for up to 100 records or 64k of data when caching
a negative response. [GL #804]
5124. [bug] Named could incorrectly return FORMERR rather than
SERVFAIL. [GL #804]
5123. [bug] dig could hang indefinitely after encountering an error
before creating a TCP socket. [GL #692]
5122. [bug] In a "forward first;" configuration, a forwarder
timeout did not prevent that forwarder from being
queried again after falling back to full recursive
resolution. [GL #315]
5121. [contrib] dlz_stub_driver.c fails to return ISC_R_NOTFOUND on none
matching zone names. [GL !1299]
5115. [bug] Allow unsupported algorithms in zone when not used for
signing with dnssec-signzone. [GL #783]
5112. [bug] Named/named-checkconf could dump core if there was
a missing masters clause and a bad notify clause.
[GL #779]
5111. [bug] Occluded DNSKEY records could make it into the
delegating NSEC/NSEC3 bitmap. [GL #742]
5108. [bug] Named could fail to determine bottom of zone when
removing out of date keys leading to invalid NSEC
and NSEC3 records being added to the zone. [GL #771]
5107. [bug] 'host -U' did not work. [GL #769]
5104. [cleanup] Log clearer informational message when a catz zone
is overridden by a zone in named.conf.
Thanks to Tony Finch. [GL !1157]
5103. [bug] Add missing design by contract tests to dns_catz*.
[GL #748]
5102. [bug] dnssec-coverage failed to use the default TTL when
checking KSK deletion times leading to a exception.
[GL #585]
5101. [bug] Fix default installation path for Python modules.
[GL #730]
5098. [func] Failed memory allocations are now fatal. [GL #674]
5097. [cleanup] Remove embedded ATF unit testing framework
from BIND source distribution. [GL !875]
5095. [test] Converted all unit tests from ATF to CMocka;
removed the source code for the ATF libraries.
Build with "configure --with-cmocka" to enable
unit testing. [GL #620]
5094. [func] Add 'dig -r' to disable reading of .digrc. [GL !970]
5092. [bug] Address memory leak on SIGTERM in nsupdate when using
GSS-TSIG. [GL #558]
5090. [bug] dig and mdig failed to properly preparse dash value
pairs when value was a seperate argument and started
with a dash. [GL #584]
5089. [bug] Restore localhost fallback in dig and host which is
used when no nameserver addresses present in
/etc/resolv.conf are usable due to the requested
address family restrictions. [GL #433]
5088. [bug] dig/host/nslookup could crash when interrupted close to
a query timeout. [GL #599]
5087. [test] Check that result tables are complete. [GL #676]
5086. [func] Log of RPZ now includes the QTYPE and QCLASS. [GL #623]
5085. [bug] win32: Restore looking up nameservers, search list,
etc. [GL #186]
5084. [func] Add configure time detection of Utimaco HSM
and disable runtime md5/sha1 detection when it
compiled with it. [GL #656]
5079. [func] Disable IDN processing in dig and nslookup
when not on a tty. [GL #653]
5078. [cleanup] Require python components to be explicitly disabled if
python is not available on unix platforms. [GL #601]
5076. [bug] "require-server-cookie" was not effective if
"rate-limit" was configured. [GL #617]
5072. [bug] Add unit tests for isc_buffer_copyregion() and fix its
behavior for auto-reallocated buffers. [GL #644]
5071. [bug] Comparision of NXT records was broken. [GL #631]
5070. [bug] Record types which support a empty rdata field were
not handling the empty rdata field case. [GL #638]
5069. [bug] Fix a hang on in RPZ when named is shutdown during RPZ
zone update. [GL !907]
5068. [bug] Fix a race in RPZ with min-update-interval set to 0.
[GL #643]
5066. [cleanup] Allow unquoted strings to be used as a zone names
in response-policy statements. [GL #641]
5065. [bug] Only set IPV6_USE_MIN_MTU on IPv6. [GL #553]
5064. [test] Initalize TZ environment variable before calling
dns_test_begin in dnstap_test. [GL #624]
5061. [protocol] Add support for EID and NIMLOC. [GL #626]
5060. [bug] GID, UID and UINFO could not be loaded using unknown
record format. [GL #627]
5059. [bug] Display a per-view list of zones in the web interface.
[GL #427]
5057. [protocol] Add support for ATMA. [GL #619]
5051. [doc] Documentation incorrectly stated that the
"server-addresses" static-stub zone option accepts
custom port numbers. [GL #582]
5050. [bug] The libirs version of getaddrinfo() was unable to parse
scoped IPv6 addresses present in /etc/resolv.conf.
[GL #187]
5048. [func] Add configure option to enabled and enforce FIPS mode
in BIND 9. [GL #506]
5047. [bug] Messages logged for certain query processing failures
now include a more specific error description if it is
available. [GL #572]
5046. [bug] named could crash during shutdown if an RPZ
reload was in progress. [RT #46210]
5042. [test] Make the chained delegations in reclimit behave
like they would in a regular name server. [GL #578]
5041. [test] The chain test contains a incomplete delegation.
[GL #568]
5039. [bug] Named could fail to preserve owner name case of new
RRset. [GL #420]
--- 9.12.3 released ---
--- 9.12.3rc1 released ---
5038. [bug] Chaosnet addresses were compared incorrectly.
[GL #562]
5035. [test] Fixed errors that prevented the DNSRPS subtests
from running in the rpz and rpzrecurse system
tests. [GL #503]
5034. [bug] A race between threads could prevent zone maintenance
scheduled immediately after zone load from being
performed. [GL #542]
5033. [bug] When adding NTAs to multiple views using "rndc nta",
the text returned via rndc was incorrectly terminated
after the first line, making it look as if only one
NTA had been added. Also, it was not possible to
differentiate between views with the same name but
different classes; this has been corrected with the
addition of a "-class" option. [GL #105]
5032. [func] Add krb5-selfsub and ms-selfsub update policy rules.
[GL #511]
5030. [bug] Align CMSG buffers to a 64-bit boundary, fixes crash
on architectures with strict alignment. [GL #521]
5028. [bug] Spread the initial RRSIG expiration times over the
entire working sig-validity-interval when signing a
zone in named to even out re-signing and transfer
loads. [GL #418]
5026. [bug] rndc reconfig should not touch already loaded zones.
[GL #276]
5022. [doc] Update ms-self, ms-subdomain, krb5-self, and
krb5-subdomain documentation. [GL !708]
5021. [bug] dig returned a non-zero exit code when it received a
reply over TCP after a retry. [GL #487]
5019. [cleanup] A message is now logged when ixfr-from-differences is
set at zone level for an inline-signed zone. [GL #470]
5018. [bug] Fix incorrect sizeof arguments in lib/isc/pk11.c.
[GL !588]
5017. [bug] lib/isc/pk11.c failed to unlink the session before
releasing the lock which is unsafe. [GL !589]
5016. [bug] Named could assert with overlapping filter-aaaa and
dns64 acls. [GL #445]
5015. [bug] Reloading all zones caused zone maintenance to cease
for inline-signed zones. [GL #435]
5014. [bug] Signatures loaded from the journal for the signed
version of an inline-signed zone were not scheduled for
refresh. [GL #482]
5013. [bug] A referral response with a non-empty ANSWER section was
inadvertently being treated as an error. [GL #390]
5012. [bug] Fix lock order reversal in pk11_initialize. [GL !590]
5009. [bug] Upon an OpenSSL failure, the first error in the OpenSSL
error queue was not logged. [GL #476]
5008. [bug] "rndc signing -nsec3param ..." requests were silently
ignored for zones which were not yet loaded or
transferred. [GL #468]
5007. [cleanup] Replace custom ISC boolean and integer data types
with C99 stdint.h and stdbool.h types. [GL #9]
5006. [cleanup] Code preparing a delegation response was extracted from
query_delegation() and query_zone_delegation() into a
separate function in order to decrease code
duplication. [GL #431]
5005. [bug] dnssec-verify, and dnssec-signzone at the verification
step, failed on some validly signed zones. [GL #442]
5004. [bug] 'rndc reconfig' could cause inline zones to stop
re-signing. [GL #439]
5003. [bug] dns_acl_isinsecure did not handle geoip elements.
[GL #406]
5002. [bug] mdig: Handle malformed +ednsopt option, support 100
+ednsopt options per query rather than 100 total and
address memory leaks if +ednsopt was specified.
[GL #410]
5001. [bug] Fix refcount errors on error paths. [GL !563]
5000. [bug] named_server_servestale() could leave the server in
exclusive mode if an error occured. [GL #441]
4996. [bug] dig: Handle malformed +ednsopt option. [GL #403]
4995. [test] Add tests for "tcp-self" update policy. [GL !282]
4994. [bug] Trust anchor telemetry queries were not being sent
upstream for locally served zones. [GL #392]
4992. [bug] The wrong address was being logged for trust anchor
telemetry queries. [GL #379]
4990. [bug] Prevent a possible NULL reference in pkcs11-keygen.
[GL #401]
4988. [bug] Don't synthesize NXDOMAIN from NSEC for records under
a DNAME. [GL #386]
--- 9.12.2-P1 released ---
4997. [security] named could crash during recursive processing
@@ -351,7 +12,7 @@
zone transfers to prevent journal corruption. [GL #339]
4983. [cleanup] Remove the deprecated flag from "answer-cookie";
it will be allowed to persist into 9.13. [GL #275].
it will be allowed to persist into 9.13. [GL #275].
4982. [cleanup] Return FORMERR if the question section is empty
and no COOKIE option is present; this restores
@@ -1013,8 +674,8 @@
4760. [func] Add glue cache statistics counters. [RT #46028]
4759. [func] Add logging channel "trust-anchor-telemetry" to
record trust-anchor-telemetry in incoming requests.
4759. [func] Add logging channel "trust-anchor-telementry" to
record trust-anchor-telementry in incoming requests.
Both _ta-XXXX.<anchor>/NULL and EDNS KEY-TAG options
are logged. [RT #46124]
@@ -1083,10 +744,10 @@
tests when running on terminals that support them.
[RT #45977]
4744. [bug] Suppress trust-anchor-telemetry queries if
4744. [bug] Suppress trust-anchor-telementry queries if
validation is disabled. [RT #46131]
4743. [func] Exclude trust-anchor-telemetry queries from
4743. [func] Exclude trust-anchor-telementry queries from
synth-from-dnssec processing. [RT #46123]
4742. [func] Synthesis of responses from DNSSEC-verified records.
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (C) 1996-2019 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 1996-2018 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
+1 -1
View File
@@ -14,7 +14,7 @@ top_builddir = @top_builddir@
VERSION=@BIND9_VERSION@
SUBDIRS = make lib bin doc
SUBDIRS = make unit lib bin doc
TARGETS =
PREREQS = bind.keys.h
+20 -38
View File
@@ -8,12 +8,11 @@ Contents
4. BIND 9.12 features
5. Building BIND
6. macOS
7. Dependencies
8. Compile-time options
9. Automated testing
10. Documentation
11. Change log
12. Acknowledgments
7. Compile-time options
8. Automated testing
9. Documentation
10. Change log
11. Acknowledgments
Introduction
@@ -142,15 +141,6 @@ BIND 9.12.2 is a maintenance release, and addresses security
vulnerabilities disclosed in CVE-2018-5736, CVE-2018-5737 and
CVE-2018-5738.
BIND 9.12.3
BIND 9.12.3 is a maintenance release, and also addresses CVE-2018-5741 by
correcting faulty documentation and introducing the following new feature:
* New krb5-selfsub and ms-selfsub rule types for update-policy
statements allow updating of subdomains based on a Kerberos or Active
Directory machine principal.
Building BIND
BIND requires a UNIX or Linux system with an ANSI C compiler, basic POSIX
@@ -201,14 +191,6 @@ if you have Xcode already installed you can run "xcode-select --install".
This will add /usr/include to the system and install the compiler and
other tools so that they can be easily found.
Dependencies
Portions of BIND that are written in Python, including dnssec-keymgr,
dnssec-coverage, dnssec-checkds, and some of the system tests, require the
'argparse' and 'ply' modules to be available. 'argparse' is a standard
module as of Python 2.7 and Python 3.2. 'ply' is available from https://
pypi.python.org/pypi/ply.
Compile-time options
To see a full list of configuration options, run configure --help.
@@ -226,6 +208,13 @@ may be necessary to specify a user with the -u option when running named.)
To build shared libraries, specify --with-libtool on the configure command
line.
Certain compiled-in constants and default settings can be increased to
values better suited to large servers with abundant memory resources (e.g,
64-bit servers with 12G or more of memory) by specifying --with-tuning=
large on the configure command line. This can improve performance on big
servers, but will consume more memory and may degrade performance on
smaller systems.
For the server to support DNSSEC, you need to build it with crypto
support. To use OpenSSL, you should have OpenSSL 1.0.2e or newer
installed. If the OpenSSL library is installed in a nonstandard location,
@@ -256,14 +245,13 @@ 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://
developers.google.com/protocol-buffers, and BIND must be configured with
--enable-dnstap.
"--enable-dnstap".
Certain compiled-in constants and default settings can be increased to
values better suited to large servers with abundant memory resources (e.g,
64-bit servers with 12G or more of memory) by specifying --with-tuning=
large on the configure command line. This can improve performance on big
servers, but will consume more memory and may degrade performance on
smaller systems.
Portions of BIND that are written in Python, including dnssec-keymgr,
dnssec-coverage, dnssec-checkds, and some of the system tests, require the
'argparse' and 'ply' modules to be available. 'argparse' is a standard
module as of Python 2.7 and Python 3.2. 'ply' is available from https://
pypi.python.org/pypi/ply.
On some platforms it is necessary to explicitly request large file support
to handle files bigger than 2GB. This can be done by using
@@ -278,10 +266,6 @@ If your operating system has integrated support for IPv6, it will be used
automatically. If you have installed KAME IPv6 separately, use --with-kame
[=PATH] to specify its location.
The --enable-querytrace option causes named to log every step of
processing every query. This should only be enabled when debugging,
because it has a significant negative impact on query performance.
make install will install named and the various BIND 9 libraries. By
default, installation is into /usr/local, but this can be changed with the
--prefix option when running configure.
@@ -307,10 +291,8 @@ and will be skipped if these are not available. Some tests require Python
and the 'dnspython' module and will be skipped if these are not available.
See bin/tests/system/README for further details.
Unit tests are implemented using the CMocka unit testing framework. To
build them, use configure --with-cmocka. Execution of tests is done by the
Kyua test execution engine; if the kyua command is available, then unit
tests can be run via make test or make unit.
Unit tests are implemented using Automated Testing Framework (ATF). To run
them, use configure --with-atf, then run make test or make unit.
Documentation
+16 -33
View File
@@ -18,7 +18,6 @@
1. [BIND 9.12 features](#features)
1. [Building BIND](#build)
1. [macOS](#macos)
1. [Dependencies](#dependencies)
1. [Compile-time options](#opts)
1. [Automated testing](#testing)
1. [Documentation](#doc)
@@ -159,16 +158,6 @@ BIND 9.12.2 is a maintenance release, and addresses security
vulnerabilities disclosed in CVE-2018-5736, CVE-2018-5737 and
CVE-2018-5738.
#### BIND 9.12.3
BIND 9.12.3 is a maintenance release, and also addresses CVE-2018-5741
by correcting faulty documentation and introducing the following new
feature:
* New `krb5-selfsub` and `ms-selfsub` rule types for `update-policy`
statements allow updating of subdomains based on a Kerberos or
Active Directory machine principal.
### <a name="build"/> Building BIND
BIND requires a UNIX or Linux system with an ANSI C compiler, basic POSIX
@@ -213,13 +202,6 @@ or if you have Xcode already installed you can run "xcode-select --install".
This will add /usr/include to the system and install the compiler and other
tools so that they can be easily found.
### <a name="dependencies"/> Dependencies
Portions of BIND that are written in Python, including
`dnssec-keymgr`, `dnssec-coverage`, `dnssec-checkds`, and some of the
system tests, require the 'argparse' and 'ply' modules to be available.
'argparse' is a standard module as of Python 2.7 and Python 3.2.
'ply' is available from [https://pypi.python.org/pypi/ply](https://pypi.python.org/pypi/ply).
#### <a name="opts"/> Compile-time options
@@ -238,6 +220,13 @@ specify a user with the -u option when running `named`.)
To build shared libraries, specify `--with-libtool` on the `configure`
command line.
Certain compiled-in constants and default settings can be increased to
values better suited to large servers with abundant memory resources (e.g,
64-bit servers with 12G or more of memory) by specifying
`--with-tuning=large` on the `configure` command line. This can improve
performance on big servers, but will consume more memory and may degrade
performance on smaller systems.
For the server to support DNSSEC, you need to build it with crypto support.
To use OpenSSL, you should have OpenSSL 1.0.2e or newer installed. If the
OpenSSL library is installed in a nonstandard location, specify the prefix
@@ -270,14 +259,13 @@ For DNSTAP packet logging, you must have installed libfstrm
[https://github.com/farsightsec/fstrm](https://github.com/farsightsec/fstrm)
and libprotobuf-c
[https://developers.google.com/protocol-buffers](https://developers.google.com/protocol-buffers),
and BIND must be configured with `--enable-dnstap`.
and BIND must be configured with "--enable-dnstap".
Certain compiled-in constants and default settings can be increased to
values better suited to large servers with abundant memory resources (e.g,
64-bit servers with 12G or more of memory) by specifying
`--with-tuning=large` on the `configure` command line. This can improve
performance on big servers, but will consume more memory and may degrade
performance on smaller systems.
Portions of BIND that are written in Python, including
`dnssec-keymgr`, `dnssec-coverage`, `dnssec-checkds`, and some of the
system tests, require the 'argparse' and 'ply' modules to be available.
'argparse' is a standard module as of Python 2.7 and Python 3.2.
'ply' is available from [https://pypi.python.org/pypi/ply](https://pypi.python.org/pypi/ply).
On some platforms it is necessary to explicitly request large file support
to handle files bigger than 2GB. This can be done by using
@@ -292,10 +280,6 @@ If your operating system has integrated support for IPv6, it will be used
automatically. If you have installed KAME IPv6 separately, use
`--with-kame[=PATH]` to specify its location.
The `--enable-querytrace` option causes `named` to log every step of
processing every query. This should only be enabled when debugging, because
it has a significant negative impact on query performance.
`make install` will install `named` and the various BIND 9 libraries. By
default, installation is into /usr/local, but this can be changed with the
`--prefix` option when running `configure`.
@@ -321,10 +305,9 @@ and will be skipped if these are not available. Some tests require Python
and the 'dnspython' module and will be skipped if these are not available.
See bin/tests/system/README for further details.
Unit tests are implemented using the CMocka unit testing framework.
To build them, use `configure --with-cmocka`. Execution of tests is done
by the Kyua test execution engine; if the `kyua` command is available,
then unit tests can be run via `make test` or `make unit`.
Unit tests are implemented using Automated Testing Framework (ATF).
To run them, use `configure --with-atf`, then run `make test` or
`make unit`.
### <a name="doc"/> Documentation
Vendored
+15 -293
View File
@@ -1,295 +1,17 @@
# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
sinclude(libtool.m4/libtool.m4)dnl
sinclude(libtool.m4/ltoptions.m4)dnl
sinclude(libtool.m4/ltsugar.m4)dnl
sinclude(libtool.m4/ltversion.m4)dnl
sinclude(libtool.m4/lt~obsolete.m4)dnl
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
m4_divert_text(HELP_CANON, [[
NOTE: If PREFIX is not set, then the default values for --sysconfdir
and --localstatedir are /etc and /var, respectively.]])
m4_divert_text(HELP_END, [[
Professional support for BIND is provided by Internet Systems Consortium,
Inc. Information about paid support and training options is available at
https://www.isc.org/support.
# 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.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])dnl PKG_PROG_PKG_CONFIG
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])dnl _PKG_CONFIG
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_INSTALLDIR
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
m4_include([libtool.m4/libtool.m4])
m4_include([libtool.m4/ltoptions.m4])
m4_include([libtool.m4/ltsugar.m4])
m4_include([libtool.m4/ltversion.m4])
m4_include([libtool.m4/lt~obsolete.m4])
Help can also often be found on the BIND Users mailing list
(https://lists.isc.org/mailman/listinfo/bind-users) or in the #bind
channel of the Freenode IRC service.]])
+1 -1
View File
@@ -10,4 +10,4 @@
# information regarding copyright ownership.
# Run this script after modifying configure.in to generate configure
autoreconf -f -i
autoreconf -i
+2 -2
View File
@@ -88,12 +88,12 @@ install:: named-checkconf@EXEEXT@ named-checkzone@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkconf@EXEEXT@ ${DESTDIR}${sbindir}
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkzone@EXEEXT@ ${DESTDIR}${sbindir}
(cd ${DESTDIR}${sbindir}; rm -f named-compilezone@EXEEXT@; ${LINK_PROGRAM} named-checkzone@EXEEXT@ named-compilezone@EXEEXT@)
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8 || exit 1; done
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8; done
(cd ${DESTDIR}${mandir}/man8; rm -f named-compilezone.8; ${LINK_PROGRAM} named-checkzone.8 named-compilezone.8)
uninstall::
rm -f ${DESTDIR}${mandir}/man8/named-compilezone.8
for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m || exit 1; done
for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m ; done
rm -f ${DESTDIR}${sbindir}/named-compilezone@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-checkconf@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-checkzone@EXEEXT@
+47 -48
View File
@@ -14,9 +14,7 @@
#include <config.h>
#include <stdbool.h>
#include <stdio.h>
#include <inttypes.h>
#ifdef _WIN32
#include <Winsock2.h>
@@ -90,15 +88,15 @@ static const char *dbtype[] = { "rbt" };
int debug = 0;
const char *journal = NULL;
bool nomerge = true;
isc_boolean_t nomerge = ISC_TRUE;
#if CHECK_LOCAL
bool docheckmx = true;
bool dochecksrv = true;
bool docheckns = true;
isc_boolean_t docheckmx = ISC_TRUE;
isc_boolean_t dochecksrv = ISC_TRUE;
isc_boolean_t docheckns = ISC_TRUE;
#else
bool docheckmx = false;
bool dochecksrv = false;
bool docheckns = false;
isc_boolean_t docheckmx = ISC_FALSE;
isc_boolean_t dochecksrv = ISC_FALSE;
isc_boolean_t docheckns = ISC_FALSE;
#endif
unsigned int zone_options = DNS_ZONEOPT_CHECKNS |
DNS_ZONEOPT_CHECKMX |
@@ -145,7 +143,7 @@ add(char *key, int value) {
if (symtab == NULL) {
result = isc_symtab_create(sym_mctx, 100, freekey, sym_mctx,
false, &symtab);
ISC_FALSE, &symtab);
if (result != ISC_R_SUCCESS)
return;
}
@@ -161,20 +159,20 @@ add(char *key, int value) {
isc_mem_free(sym_mctx, key);
}
static bool
static isc_boolean_t
logged(char *key, int value) {
isc_result_t result;
if (symtab == NULL)
return (false);
return (ISC_FALSE);
result = isc_symtab_lookup(symtab, key, value, NULL);
if (result == ISC_R_SUCCESS)
return (true);
return (false);
return (ISC_TRUE);
return (ISC_FALSE);
}
static bool
static isc_boolean_t
checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
dns_rdataset_t *a, dns_rdataset_t *aaaa)
{
@@ -185,8 +183,8 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
char namebuf[DNS_NAME_FORMATSIZE + 1];
char ownerbuf[DNS_NAME_FORMATSIZE];
char addrbuf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:123.123.123.123")];
bool answer = true;
bool match;
isc_boolean_t answer = ISC_TRUE;
isc_boolean_t match;
const char *type;
void *ptr = NULL;
int result;
@@ -235,7 +233,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
ownerbuf, namebuf,
cur->ai_canonname);
/* XXX950 make fatal for 9.5.0 */
/* answer = false; */
/* answer = ISC_FALSE; */
add(namebuf, ERR_IS_CNAME);
}
break;
@@ -251,7 +249,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
add(namebuf, ERR_NO_ADDRESSES);
}
/* XXX950 make fatal for 9.5.0 */
return (true);
return (ISC_TRUE);
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
@@ -260,7 +258,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
namebuf, gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return (true);
return (ISC_TRUE);
}
/*
@@ -271,13 +269,13 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
result = dns_rdataset_first(a);
while (result == ISC_R_SUCCESS) {
dns_rdataset_current(a, &rdata);
match = false;
match = ISC_FALSE;
for (cur = ai; cur != NULL; cur = cur->ai_next) {
if (cur->ai_family != AF_INET)
continue;
ptr = &((struct sockaddr_in *)(cur->ai_addr))->sin_addr;
if (memcmp(ptr, rdata.data, rdata.length) == 0) {
match = true;
match = ISC_TRUE;
break;
}
}
@@ -289,7 +287,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
addrbuf, sizeof(addrbuf)));
add(namebuf, ERR_EXTRA_A);
/* XXX950 make fatal for 9.5.0 */
/* answer = false; */
/* answer = ISC_FALSE; */
}
dns_rdata_reset(&rdata);
result = dns_rdataset_next(a);
@@ -301,13 +299,13 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
result = dns_rdataset_first(aaaa);
while (result == ISC_R_SUCCESS) {
dns_rdataset_current(aaaa, &rdata);
match = false;
match = ISC_FALSE;
for (cur = ai; cur != NULL; cur = cur->ai_next) {
if (cur->ai_family != AF_INET6)
continue;
ptr = &((struct sockaddr_in6 *)(cur->ai_addr))->sin6_addr;
if (memcmp(ptr, rdata.data, rdata.length) == 0) {
match = true;
match = ISC_TRUE;
break;
}
}
@@ -319,7 +317,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
addrbuf, sizeof(addrbuf)));
add(namebuf, ERR_EXTRA_AAAA);
/* XXX950 make fatal for 9.5.0. */
/* answer = false; */
/* answer = ISC_FALSE; */
}
dns_rdata_reset(&rdata);
result = dns_rdataset_next(aaaa);
@@ -330,7 +328,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
* Check that all addresses appear in the glue.
*/
if (!logged(namebuf, ERR_MISSING_GLUE)) {
bool missing_glue = false;
isc_boolean_t missing_glue = ISC_FALSE;
for (cur = ai; cur != NULL; cur = cur->ai_next) {
switch (cur->ai_family) {
case AF_INET:
@@ -346,7 +344,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
default:
continue;
}
match = false;
match = ISC_FALSE;
if (dns_rdataset_isassociated(rdataset))
result = dns_rdataset_first(rdataset);
else
@@ -354,7 +352,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
while (result == ISC_R_SUCCESS && !match) {
dns_rdataset_current(rdataset, &rdata);
if (memcmp(ptr, rdata.data, rdata.length) == 0)
match = true;
match = ISC_TRUE;
dns_rdata_reset(&rdata);
result = dns_rdataset_next(rdataset);
}
@@ -365,8 +363,8 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
inet_ntop(cur->ai_family, ptr,
addrbuf, sizeof(addrbuf)));
/* XXX950 make fatal for 9.5.0. */
/* answer = false; */
missing_glue = true;
/* answer = ISC_FALSE; */
missing_glue = ISC_TRUE;
}
}
if (missing_glue)
@@ -375,11 +373,11 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
freeaddrinfo(ai);
return (answer);
#else
return (true);
return (ISC_TRUE);
#endif
}
static bool
static isc_boolean_t
checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
#ifdef USE_GETADDRINFO
struct addrinfo hints, *ai, *cur;
@@ -387,7 +385,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
char ownerbuf[DNS_NAME_FORMATSIZE];
int result;
int level = ISC_LOG_ERROR;
bool answer = true;
isc_boolean_t answer = ISC_TRUE;
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME;
@@ -431,7 +429,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
add(namebuf, ERR_IS_MXCNAME);
}
if (level == ISC_LOG_ERROR)
answer = false;
answer = ISC_FALSE;
}
}
freeaddrinfo(ai);
@@ -449,7 +447,7 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
add(namebuf, ERR_NO_ADDRESSES);
}
/* XXX950 make fatal for 9.5.0. */
return (true);
return (ISC_TRUE);
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
@@ -458,14 +456,14 @@ checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
namebuf, gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return (true);
return (ISC_TRUE);
}
#else
return (true);
return (ISC_TRUE);
#endif
}
static bool
static isc_boolean_t
checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
#ifdef USE_GETADDRINFO
struct addrinfo hints, *ai, *cur;
@@ -473,7 +471,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
char ownerbuf[DNS_NAME_FORMATSIZE];
int result;
int level = ISC_LOG_ERROR;
bool answer = true;
isc_boolean_t answer = ISC_TRUE;
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME;
@@ -516,7 +514,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
add(namebuf, ERR_IS_SRVCNAME);
}
if (level == ISC_LOG_ERROR)
answer = false;
answer = ISC_FALSE;
}
}
freeaddrinfo(ai);
@@ -534,7 +532,7 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
add(namebuf, ERR_NO_ADDRESSES);
}
/* XXX950 make fatal for 9.5.0. */
return (true);
return (ISC_TRUE);
default:
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
@@ -543,10 +541,10 @@ checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
namebuf, gai_strerror(result));
add(namebuf, ERR_LOOKUP_FAILURE);
}
return (true);
return (ISC_TRUE);
}
#else
return (true);
return (ISC_TRUE);
#endif
}
@@ -653,7 +651,7 @@ check_ttls(dns_zone_t *zone, dns_ttl_t maxttl) {
if (dbiter != NULL)
dns_dbiterator_destroy(&dbiter);
if (version != NULL)
dns_db_closeversion(db, &version, false);
dns_db_closeversion(db, &version, ISC_FALSE);
if (db != NULL)
dns_db_detach(&db);
@@ -699,8 +697,8 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
CHECK(dns_rdataclass_fromtext(&rdclass, &region));
dns_zone_setclass(zone, rdclass);
dns_zone_setoption(zone, zone_options, true);
dns_zone_setoption2(zone, zone_options2, true);
dns_zone_setoption(zone, zone_options, ISC_TRUE);
dns_zone_setoption2(zone, zone_options2, ISC_TRUE);
dns_zone_setoption(zone, DNS_ZONEOPT_NOMERGE, nomerge);
dns_zone_setmaxttl(zone, maxttl);
@@ -737,7 +735,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
isc_result_t
dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
dns_masterformat_t fileformat, const dns_master_style_t *style,
const uint32_t rawversion)
const isc_uint32_t rawversion)
{
isc_result_t result;
FILE *output = stdout;
@@ -792,3 +790,4 @@ DestroySockets(void) {
WSACleanup();
}
#endif
+5 -8
View File
@@ -15,9 +15,6 @@
/*! \file */
#include <inttypes.h>
#include <stdbool.h>
#include <isc/lang.h>
#include <isc/stdio.h>
#include <isc/types.h>
@@ -38,7 +35,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
isc_result_t
dump_zone(const char *zonename, dns_zone_t *zone, const char *filename,
dns_masterformat_t fileformat, const dns_master_style_t *style,
const uint32_t rawversion);
const isc_uint32_t rawversion);
#ifdef _WIN32
void InitSockets(void);
@@ -47,10 +44,10 @@ void DestroySockets(void);
extern int debug;
extern const char *journal;
extern bool nomerge;
extern bool docheckmx;
extern bool docheckns;
extern bool dochecksrv;
extern isc_boolean_t nomerge;
extern isc_boolean_t docheckmx;
extern isc_boolean_t docheckns;
extern isc_boolean_t dochecksrv;
extern unsigned int zone_options;
extern unsigned int zone_options2;
+32 -47
View File
@@ -15,7 +15,6 @@
#include <config.h>
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
@@ -93,18 +92,18 @@ directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
return (ISC_R_SUCCESS);
}
static bool
static isc_boolean_t
get_maps(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
int i;
for (i = 0;; i++) {
if (maps[i] == NULL)
return (false);
return (ISC_FALSE);
if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS)
return (true);
return (ISC_TRUE);
}
}
static bool
static isc_boolean_t
get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
const cfg_listelt_t *element;
const cfg_obj_t *checknames;
@@ -115,14 +114,14 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
for (i = 0;; i++) {
if (maps[i] == NULL)
return (false);
return (ISC_FALSE);
checknames = NULL;
result = cfg_map_get(maps[i], "check-names", &checknames);
if (result != ISC_R_SUCCESS)
continue;
if (checknames != NULL && !cfg_obj_islist(checknames)) {
*obj = checknames;
return (true);
return (ISC_TRUE);
}
for (element = cfg_list_first(checknames);
element != NULL;
@@ -132,7 +131,7 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
if (strcasecmp(cfg_obj_asstring(type), "master") != 0)
continue;
*obj = cfg_tuple_get(value, "mode");
return (true);
return (ISC_TRUE);
}
}
}
@@ -165,7 +164,7 @@ configure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
static isc_result_t
configure_zone(const char *vclass, const char *view,
const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
const cfg_obj_t *config, isc_mem_t *mctx, bool list)
const cfg_obj_t *config, isc_mem_t *mctx, isc_boolean_t list)
{
int i = 0;
isc_result_t result;
@@ -275,10 +274,8 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKDUPRR;
zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL;
} else {
} else
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKDUPRR;
zone_options &= ~DNS_ZONEOPT_CHECKDUPRRFAIL;
@@ -295,10 +292,8 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKMX;
zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL;
} else {
} else
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKMX;
zone_options &= ~DNS_ZONEOPT_CHECKMXFAIL;
@@ -324,10 +319,8 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options |= DNS_ZONEOPT_WARNMXCNAME;
zone_options |= DNS_ZONEOPT_IGNOREMXCNAME;
} else {
} else
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_WARNMXCNAME;
zone_options &= ~DNS_ZONEOPT_IGNOREMXCNAME;
@@ -344,10 +337,8 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
zone_options |= DNS_ZONEOPT_IGNORESRVCNAME;
} else {
} else
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_WARNSRVCNAME;
zone_options &= ~DNS_ZONEOPT_IGNORESRVCNAME;
@@ -367,10 +358,8 @@ configure_zone(const char *vclass, const char *view,
zone_options |= DNS_ZONEOPT_CHECKSPF;
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKSPF;
} else {
} else
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKSPF;
}
@@ -386,10 +375,8 @@ configure_zone(const char *vclass, const char *view,
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
zone_options &= ~DNS_ZONEOPT_CHECKNAMES;
zone_options &= ~DNS_ZONEOPT_CHECKNAMESFAIL;
} else {
} else
INSIST(0);
ISC_UNREACHABLE();
}
} else {
zone_options |= DNS_ZONEOPT_CHECKNAMES;
zone_options |= DNS_ZONEOPT_CHECKNAMESFAIL;
@@ -399,16 +386,14 @@ configure_zone(const char *vclass, const char *view,
fmtobj = NULL;
if (get_maps(maps, "masterfile-format", &fmtobj)) {
const char *masterformatstr = cfg_obj_asstring(fmtobj);
if (strcasecmp(masterformatstr, "text") == 0) {
if (strcasecmp(masterformatstr, "text") == 0)
masterformat = dns_masterformat_text;
} else if (strcasecmp(masterformatstr, "raw") == 0) {
else if (strcasecmp(masterformatstr, "raw") == 0)
masterformat = dns_masterformat_raw;
} else if (strcasecmp(masterformatstr, "map") == 0) {
else if (strcasecmp(masterformatstr, "map") == 0)
masterformat = dns_masterformat_map;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
}
obj = NULL;
@@ -428,7 +413,7 @@ configure_zone(const char *vclass, const char *view,
/*% configure a view */
static isc_result_t
configure_view(const char *vclass, const char *view, const cfg_obj_t *config,
const cfg_obj_t *vconfig, isc_mem_t *mctx, bool list)
const cfg_obj_t *vconfig, isc_mem_t *mctx, isc_boolean_t list)
{
const cfg_listelt_t *element;
const cfg_obj_t *voptions;
@@ -477,7 +462,7 @@ config_getclass(const cfg_obj_t *classobj, dns_rdataclass_t defclass,
/*% load zones from the configuration */
static isc_result_t
load_zones_fromconfig(const cfg_obj_t *config, isc_mem_t *mctx,
bool list_zones)
isc_boolean_t list_zones)
{
const cfg_listelt_t *element;
const cfg_obj_t *views;
@@ -546,12 +531,12 @@ main(int argc, char **argv) {
isc_result_t result;
int exit_status = 0;
isc_entropy_t *ectx = NULL;
bool load_zones = false;
bool list_zones = false;
bool print = false;
isc_boolean_t load_zones = ISC_FALSE;
isc_boolean_t list_zones = ISC_FALSE;
isc_boolean_t print = ISC_FALSE;
unsigned int flags = 0;
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
/*
* Process memory debugging argument first.
@@ -575,7 +560,7 @@ main(int argc, char **argv) {
break;
}
}
isc_commandline_reset = true;
isc_commandline_reset = ISC_TRUE;
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
@@ -586,11 +571,11 @@ main(int argc, char **argv) {
break;
case 'j':
nomerge = false;
nomerge = ISC_FALSE;
break;
case 'l':
list_zones = true;
list_zones = ISC_TRUE;
break;
case 'm':
@@ -606,7 +591,7 @@ main(int argc, char **argv) {
break;
case 'p':
print = true;
print = ISC_TRUE;
break;
case 'v':
@@ -618,10 +603,10 @@ main(int argc, char **argv) {
break;
case 'z':
load_zones = true;
docheckmx = false;
docheckns = false;
dochecksrv = false;
load_zones = ISC_TRUE;
docheckmx = ISC_FALSE;
docheckns = ISC_FALSE;
dochecksrv = ISC_FALSE;
break;
case '?':
-1
View File
@@ -40,7 +40,6 @@
<year>2015</year>
<year>2016</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+26 -30
View File
@@ -14,9 +14,7 @@
#include <config.h>
#include <stdbool.h>
#include <stdlib.h>
#include <inttypes.h>
#include <isc/app.h>
#include <isc/commandline.h>
@@ -110,10 +108,10 @@ main(int argc, char **argv) {
dns_masterformat_t inputformat = dns_masterformat_text;
dns_masterformat_t outputformat = dns_masterformat_text;
dns_masterrawheader_t header;
uint32_t rawversion = 1, serialnum = 0;
isc_uint32_t rawversion = 1, serialnum = 0;
dns_ttl_t maxttl = 0;
bool snset = false;
bool logdump = false;
isc_boolean_t snset = ISC_FALSE;
isc_boolean_t logdump = ISC_FALSE;
FILE *errout = stdout;
char *endp;
@@ -141,14 +139,12 @@ main(int argc, char **argv) {
#define PROGCMP(X) \
(strcasecmp(prog_name, X) == 0 || strcasecmp(prog_name, X ".exe") == 0)
if (PROGCMP("named-checkzone")) {
if (PROGCMP("named-checkzone"))
progmode = progmode_check;
} else if (PROGCMP("named-compilezone")) {
else if (PROGCMP("named-compilezone"))
progmode = progmode_compile;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
/* Compilation specific defaults */
if (progmode == progmode_compile) {
@@ -165,7 +161,7 @@ main(int argc, char **argv) {
#define ARGCMP(X) (strcmp(isc_commandline_argument, X) == 0)
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
while ((c = isc_commandline_parse(argc, argv,
"c:df:hi:jJ:k:L:l:m:n:qr:s:t:o:vw:DF:M:S:T:W:"))
@@ -183,33 +179,33 @@ main(int argc, char **argv) {
if (ARGCMP("full")) {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY |
DNS_ZONEOPT_CHECKSIBLING;
docheckmx = true;
docheckns = true;
dochecksrv = true;
docheckmx = ISC_TRUE;
docheckns = ISC_TRUE;
dochecksrv = ISC_TRUE;
} else if (ARGCMP("full-sibling")) {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
docheckmx = true;
docheckns = true;
dochecksrv = true;
docheckmx = ISC_TRUE;
docheckns = ISC_TRUE;
dochecksrv = ISC_TRUE;
} else if (ARGCMP("local")) {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
zone_options |= DNS_ZONEOPT_CHECKSIBLING;
docheckmx = false;
docheckns = false;
dochecksrv = false;
docheckmx = ISC_FALSE;
docheckns = ISC_FALSE;
dochecksrv = ISC_FALSE;
} else if (ARGCMP("local-sibling")) {
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
docheckmx = false;
docheckns = false;
dochecksrv = false;
docheckmx = ISC_FALSE;
docheckns = ISC_FALSE;
dochecksrv = ISC_FALSE;
} else if (ARGCMP("none")) {
zone_options &= ~DNS_ZONEOPT_CHECKINTEGRITY;
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
docheckmx = false;
docheckns = false;
dochecksrv = false;
docheckmx = ISC_FALSE;
docheckns = ISC_FALSE;
dochecksrv = ISC_FALSE;
} else {
fprintf(stderr, "invalid argument to -i: %s\n",
isc_commandline_argument);
@@ -226,12 +222,12 @@ main(int argc, char **argv) {
break;
case 'j':
nomerge = false;
nomerge = ISC_FALSE;
break;
case 'J':
journal = isc_commandline_argument;
nomerge = false;
nomerge = ISC_FALSE;
break;
case 'k':
@@ -252,7 +248,7 @@ main(int argc, char **argv) {
break;
case 'L':
snset = true;
snset = ISC_TRUE;
endp = NULL;
serialnum = strtol(isc_commandline_argument, &endp, 0);
if (*endp != '\0') {
@@ -511,7 +507,7 @@ main(int argc, char **argv) {
strcmp(output_filename, "/dev/fd/1") == 0 ||
strcmp(output_filename, "/dev/stdout") == 0)) {
errout = stderr;
logdump = false;
logdump = ISC_FALSE;
}
if (isc_commandline_index + 2 != argc)
-1
View File
@@ -43,7 +43,6 @@
<year>2015</year>
<year>2016</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+9 -12
View File
@@ -19,7 +19,6 @@
#include <config.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -58,7 +57,7 @@
static char program[256];
const char *progname;
static enum { progmode_keygen, progmode_confgen} progmode;
bool verbose = false; /* needed by util.c but not used here */
isc_boolean_t verbose = ISC_FALSE; /* needed by util.c but not used here */
ISC_PLATFORM_NORETURN_PRE static void
usage(int status) ISC_PLATFORM_NORETURN_POST;
@@ -91,8 +90,8 @@ Usage:\n\
int
main(int argc, char **argv) {
isc_result_t result = ISC_R_SUCCESS;
bool show_final_mem = false;
bool quiet = false;
isc_boolean_t show_final_mem = ISC_FALSE;
isc_boolean_t quiet = ISC_FALSE;
isc_buffer_t key_txtbuffer;
char key_txtsecret[256];
isc_mem_t *mctx = NULL;
@@ -129,15 +128,13 @@ main(int argc, char **argv) {
if (PROGCMP("tsig-keygen")) {
progmode = progmode_keygen;
quiet = true;
} else if (PROGCMP("ddns-confgen")) {
quiet = ISC_TRUE;
} else if (PROGCMP("ddns-confgen"))
progmode = progmode_confgen;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv,
"a:hk:Mmr:qs:y:z:")) != -1) {
@@ -162,11 +159,11 @@ main(int argc, char **argv) {
isc_mem_debugging = ISC_MEM_DEBUGTRACE;
break;
case 'm':
show_final_mem = true;
show_final_mem = ISC_TRUE;
break;
case 'q':
if (progmode == progmode_confgen)
quiet = true;
quiet = ISC_TRUE;
else
usage(1);
break;
-1
View File
@@ -37,7 +37,6 @@
<year>2015</year>
<year>2016</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+1 -1
View File
@@ -155,7 +155,7 @@ generate_key(isc_mem_t *mctx, const char *randomfile, dns_secalg_t alg,
#ifdef ISC_PLATFORM_CRYPTORANDOM
if (randomfile == NULL) {
isc_entropy_usehook(ectx, true);
isc_entropy_usehook(ectx, ISC_TRUE);
}
#endif
if (randomfile != NULL && strcmp(randomfile, "keyboard") == 0) {
+7 -8
View File
@@ -22,7 +22,6 @@
#include <config.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -59,7 +58,7 @@
static char program[256];
const char *progname;
bool verbose = false;
isc_boolean_t verbose = ISC_FALSE;
const char *keyfile, *keydef;
@@ -90,7 +89,7 @@ Usage:\n\
int
main(int argc, char **argv) {
bool show_final_mem = false;
isc_boolean_t show_final_mem = ISC_FALSE;
isc_buffer_t key_txtbuffer;
char key_txtsecret[256];
isc_mem_t *mctx = NULL;
@@ -108,7 +107,7 @@ main(int argc, char **argv) {
struct in6_addr addr6_dummy;
char *chrootdir = NULL;
char *user = NULL;
bool keyonly = false;
isc_boolean_t keyonly = ISC_FALSE;
int len;
keydef = keyfile = RNDC_KEYFILE;
@@ -123,14 +122,14 @@ main(int argc, char **argv) {
serveraddr = DEFAULT_SERVER;
port = DEFAULT_PORT;
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv,
"aA:b:c:hk:Mmp:r:s:t:u:Vy")) != -1)
{
switch (ch) {
case 'a':
keyonly = true;
keyonly = ISC_TRUE;
break;
case 'A':
algname = isc_commandline_argument;
@@ -157,7 +156,7 @@ main(int argc, char **argv) {
break;
case 'm':
show_final_mem = true;
show_final_mem = ISC_TRUE;
break;
case 'p':
port = strtol(isc_commandline_argument, &p, 10);
@@ -181,7 +180,7 @@ main(int argc, char **argv) {
user = isc_commandline_argument;
break;
case 'V':
verbose = true;
verbose = ISC_TRUE;
break;
case '?':
if (isc_commandline_option != '?') {
-1
View File
@@ -44,7 +44,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+2 -2
View File
@@ -15,15 +15,15 @@
#include <config.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <isc/boolean.h>
#include <isc/print.h>
#include "util.h"
extern bool verbose;
extern isc_boolean_t verbose;
extern const char *progname;
void
+75 -110
View File
@@ -24,9 +24,7 @@
#include <netdb.h>
#endif
#include <stdbool.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -96,40 +94,40 @@ static const char *port = "53";
static isc_sockaddr_t *srcaddr4 = NULL, *srcaddr6 = NULL;
static isc_sockaddr_t a4, a6;
static char *curqname = NULL, *qname = NULL;
static bool classset = false;
static isc_boolean_t classset = ISC_FALSE;
static dns_rdatatype_t qtype = dns_rdatatype_none;
static bool typeset = false;
static isc_boolean_t typeset = ISC_FALSE;
static unsigned int styleflags = 0;
static uint32_t splitwidth = 0xffffffff;
static bool
showcomments = true,
showdnssec = true,
showtrust = true,
rrcomments = true,
noclass = false,
nocrypto = false,
nottl = false,
multiline = false,
short_form = false,
print_unknown_format = false;
static isc_uint32_t splitwidth = 0xffffffff;
static isc_boolean_t
showcomments = ISC_TRUE,
showdnssec = ISC_TRUE,
showtrust = ISC_TRUE,
rrcomments = ISC_TRUE,
noclass = ISC_FALSE,
nocrypto = ISC_FALSE,
nottl = ISC_FALSE,
multiline = ISC_FALSE,
short_form = ISC_FALSE,
print_unknown_format = ISC_FALSE;
static bool
resolve_trace = false,
validator_trace = false,
message_trace = false;
static isc_boolean_t
resolve_trace = ISC_FALSE,
validator_trace = ISC_FALSE,
message_trace = ISC_FALSE;
static bool
use_ipv4 = true,
use_ipv6 = true;
static isc_boolean_t
use_ipv4 = ISC_TRUE,
use_ipv6 = ISC_TRUE;
static bool
cdflag = false,
no_sigs = false,
root_validation = true,
dlv_validation = true;
static isc_boolean_t
cdflag = ISC_FALSE,
no_sigs = ISC_FALSE,
root_validation = ISC_TRUE,
dlv_validation = ISC_TRUE;
static bool use_tcp = false;
static isc_boolean_t use_tcp = ISC_FALSE;
static char *anchorfile = NULL;
static char *trust_anchor = NULL;
@@ -146,10 +144,10 @@ static char anchortext[] = MANAGED_KEYS;
* Static function prototypes
*/
static isc_result_t
get_reverse(char *reverse, size_t len, char *value, bool strict);
get_reverse(char *reverse, size_t len, char *value, isc_boolean_t strict);
static isc_result_t
parse_uint(uint32_t *uip, const char *value, uint32_t max,
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
const char *desc);
static void
@@ -410,7 +408,7 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
{
isc_result_t result = ISC_R_SUCCESS;
static dns_trust_t trust;
static bool first = true;
static isc_boolean_t first = ISC_TRUE;
isc_buffer_t target;
isc_region_t r;
char *t = NULL;
@@ -432,7 +430,7 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
putchar('\n');
print_status(rdataset);
trust = rdataset->trust;
first = false;
first = ISC_FALSE;
}
do {
@@ -568,7 +566,7 @@ convert_name(dns_fixedname_t *fn, dns_name_t **name, const char *text) {
static isc_result_t
key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
dns_rdata_dnskey_t keystruct;
uint32_t flags, proto, alg;
isc_uint32_t flags, proto, alg;
const char *keystr, *keynamestr;
unsigned char keydata[4096];
isc_buffer_t keydatabuf;
@@ -578,7 +576,7 @@ 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, match_dlv = false;
isc_boolean_t match_root = ISC_FALSE, match_dlv = ISC_FALSE;
keynamestr = cfg_obj_asstring(cfg_tuple_get(key, "name"));
CHECK(convert_name(&fkeyname, &keyname, keynamestr));
@@ -623,9 +621,9 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
if (alg > 0xff)
CHECK(ISC_R_RANGE);
keystruct.flags = (uint16_t)flags;
keystruct.protocol = (uint8_t)proto;
keystruct.algorithm = (uint8_t)alg;
keystruct.flags = (isc_uint16_t)flags;
keystruct.protocol = (isc_uint8_t)proto;
keystruct.algorithm = (isc_uint8_t)alg;
isc_buffer_init(&keydatabuf, keydata, sizeof(keydata));
isc_buffer_init(&rrdatabuf, rrdata, sizeof(rrdata));
@@ -765,14 +763,7 @@ setup_dnsseckeys(dns_client_t *client) {
if (dlv_validation)
dns_client_setdlv(client, dns_rdataclass_in, dlv_anchor);
cleanup:
if (bindkeys != NULL) {
cfg_obj_destroy(parser, &bindkeys);
}
if (parser != NULL) {
cfg_parser_destroy(&parser);
}
if (result != ISC_R_SUCCESS)
delv_log(ISC_LOG_ERROR, "setup_dnsseckeys: %s",
isc_result_totext(result));
@@ -787,7 +778,7 @@ addserver(dns_client_t *client) {
struct in6_addr in6;
isc_sockaddr_t *sa;
isc_sockaddrlist_t servers;
uint32_t destport;
isc_uint32_t destport;
isc_result_t result;
dns_name_t *name = NULL;
@@ -878,7 +869,7 @@ findserver(dns_client_t *client) {
irs_resconf_t *resconf = NULL;
isc_sockaddrlist_t *nameservers;
isc_sockaddr_t *sa, *next;
uint32_t destport;
isc_uint32_t destport;
result = parse_uint(&destport, port, 0xffff, "port");
if (result != ISC_R_SUCCESS)
@@ -965,9 +956,9 @@ next_token(char **stringp, const char *delim) {
}
static isc_result_t
parse_uint(uint32_t *uip, const char *value, uint32_t max,
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
const char *desc) {
uint32_t n;
isc_uint32_t n;
isc_result_t result = isc_parse_uint32(&n, value, 10);
if (result == ISC_R_SUCCESS && n > max)
result = ISC_R_RANGE;
@@ -985,7 +976,7 @@ plus_option(char *option) {
isc_result_t result;
char option_store[256];
char *cmd, *value, *ptr;
bool state = true;
isc_boolean_t state = ISC_TRUE;
strlcpy(option_store, option, sizeof(option_store));
ptr = option_store;
@@ -997,7 +988,7 @@ plus_option(char *option) {
value = ptr;
if (strncasecmp(cmd, "no", 2)==0) {
cmd += 2;
state = false;
state = ISC_FALSE;
}
#define FULLCHECK(A) \
@@ -1022,7 +1013,7 @@ plus_option(char *option) {
break;
case 'l': /* class */
FULLCHECK("class");
noclass = !state;
noclass = ISC_TF(!state);
break;
case 'o': /* comments */
FULLCHECK("comments");
@@ -1030,7 +1021,7 @@ plus_option(char *option) {
break;
case 'r': /* crypto */
FULLCHECK("crypto");
nocrypto = !state;
nocrypto = ISC_TF(!state);
break;
default:
goto invalid_option;
@@ -1103,10 +1094,10 @@ plus_option(char *option) {
FULLCHECK("short");
short_form = state;
if (short_form) {
multiline = false;
showcomments = false;
showtrust = false;
showdnssec = false;
multiline = ISC_FALSE;
showcomments = ISC_FALSE;
showtrust = ISC_FALSE;
showdnssec = ISC_FALSE;
}
break;
case 'p': /* split */
@@ -1158,7 +1149,7 @@ plus_option(char *option) {
break;
case 't': /* ttl */
FULLCHECK("ttl");
nottl = !state;
nottl = ISC_TF(!state);
break;
default:
goto invalid_option;
@@ -1186,13 +1177,11 @@ plus_option(char *option) {
* options: "46a:b:c:d:himp:q:t:vx:";
*/
static const char *single_dash_opts = "46himv";
static const char *dash_opts = "46abcdhimpqtvx";
static bool
dash_option(char *option, char *next, bool *open_type_class) {
static isc_boolean_t
dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
char opt, *value;
isc_result_t result;
bool value_from_next;
isc_boolean_t value_from_next;
isc_textregion_t tr;
dns_rdatatype_t rdtype;
dns_rdataclass_t rdclass;
@@ -1200,7 +1189,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
struct in_addr in4;
struct in6_addr in6;
in_port_t srcport;
uint32_t num;
isc_uint32_t num;
char *hash;
while (strpbrk(option, single_dash_opts) == &option[0]) {
@@ -1216,7 +1205,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
fatal("IPv4 networking not available");
if (use_ipv6) {
isc_net_disableipv6();
use_ipv6 = false;
use_ipv6 = ISC_FALSE;
}
break;
case '6':
@@ -1224,7 +1213,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
fatal("IPv6 networking not available");
if (use_ipv4) {
isc_net_disableipv4();
use_ipv4 = false;
use_ipv4 = ISC_FALSE;
}
break;
case 'h':
@@ -1232,9 +1221,9 @@ dash_option(char *option, char *next, bool *open_type_class) {
exit(0);
/* NOTREACHED */
case 'i':
no_sigs = true;
dlv_validation = false;
root_validation = false;
no_sigs = ISC_TRUE;
dlv_validation = ISC_FALSE;
root_validation = ISC_FALSE;
break;
case 'm':
/* handled in preparse_args() */
@@ -1245,19 +1234,18 @@ dash_option(char *option, char *next, bool *open_type_class) {
/* NOTREACHED */
default:
INSIST(0);
ISC_UNREACHABLE();
}
if (strlen(option) > 1U)
option = &option[1];
else
return (false);
return (ISC_FALSE);
}
opt = option[0];
if (strlen(option) > 1U) {
value_from_next = false;
value_from_next = ISC_FALSE;
value = &option[1];
} else {
value_from_next = true;
value_from_next = ISC_TRUE;
value = next;
}
if (value == NULL)
@@ -1303,13 +1291,13 @@ dash_option(char *option, char *next, bool *open_type_class) {
if (classset)
warn("extra query class");
*open_type_class = false;
*open_type_class = ISC_FALSE;
tr.base = value;
tr.length = strlen(value);
result = dns_rdataclass_fromtext(&rdclass,
(isc_textregion_t *)&tr);
if (result == ISC_R_SUCCESS)
classset = true;
classset = ISC_TRUE;
else if (rdclass != dns_rdataclass_in)
warn("ignoring non-IN query class");
else
@@ -1334,7 +1322,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
fatal("out of memory");
return (value_from_next);
case 't':
*open_type_class = false;
*open_type_class = ISC_FALSE;
tr.base = value;
tr.length = strlen(value);
result = dns_rdatatype_fromtext(&rdtype,
@@ -1346,13 +1334,13 @@ dash_option(char *option, char *next, bool *open_type_class) {
rdtype == dns_rdatatype_axfr)
fatal("Transfer not supported");
qtype = rdtype;
typeset = true;
typeset = ISC_TRUE;
} else
warn("ignoring invalid type");
return (value_from_next);
case 'x':
result = get_reverse(textname, sizeof(textname), value,
false);
ISC_FALSE);
if (result == ISC_R_SUCCESS) {
if (curqname != NULL) {
isc_mem_free(mctx, curqname);
@@ -1364,7 +1352,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
if (typeset)
warn("extra query type");
qtype = dns_rdatatype_ptr;
typeset = true;
typeset = ISC_TRUE;
} else {
fprintf(stderr, "Invalid IP address %s\n", value);
exit(1);
@@ -1376,7 +1364,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
usage();
}
/* NOTREACHED */
return (false);
return (ISC_FALSE);
}
/*
@@ -1385,14 +1373,12 @@ dash_option(char *option, char *next, bool *open_type_class) {
*/
static void
preparse_args(int argc, char **argv) {
bool ipv4only = false, ipv6only = false;
isc_boolean_t ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
char *option;
for (argc--, argv++; argc > 0; argc--, argv++) {
if (argv[0][0] != '-') {
if (argv[0][0] != '-')
continue;
}
option = &argv[0][1];
while (strpbrk(option, single_dash_opts) == &option[0]) {
switch (option[0]) {
@@ -1404,38 +1390,17 @@ preparse_args(int argc, char **argv) {
if (ipv6only) {
fatal("only one of -4 and -6 allowed");
}
ipv4only = true;
ipv4only = ISC_TRUE;
break;
case '6':
if (ipv4only) {
fatal("only one of -4 and -6 allowed");
}
ipv6only = true;
ipv6only = ISC_TRUE;
break;
}
option = &option[1];
}
if (strlen(option) == 0U) {
continue;
}
/* Look for dash value option. */
if (strpbrk(option, dash_opts) != &option[0] ||
strlen(option) > 1U)
{
/* Error or value in option. */
continue;
}
/* Dash value is next argument so we need to skip it. */
argc--;
argv++;
/* Handle missing argument */
if (argc == 0) {
break;
}
}
}
@@ -1451,7 +1416,7 @@ parse_args(int argc, char **argv) {
isc_textregion_t tr;
dns_rdatatype_t rdtype;
dns_rdataclass_t rdclass;
bool open_type_class = true;
isc_boolean_t open_type_class = ISC_TRUE;
for (; argc > 0; argc--, argv++) {
if (argv[0][0] == '@') {
@@ -1490,7 +1455,7 @@ parse_args(int argc, char **argv) {
rdtype == dns_rdatatype_axfr)
fatal("Transfer not supported");
qtype = rdtype;
typeset = true;
typeset = ISC_TRUE;
continue;
}
result = dns_rdataclass_fromtext(&rdclass,
@@ -1559,7 +1524,7 @@ reverse_octets(const char *in, char **p, char *end) {
}
static isc_result_t
get_reverse(char *reverse, size_t len, char *value, bool strict) {
get_reverse(char *reverse, size_t len, char *value, isc_boolean_t strict) {
int r;
isc_result_t result;
isc_netaddr_t addr;
-1
View File
@@ -39,7 +39,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+3 -3
View File
@@ -99,12 +99,12 @@ install:: dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@ installdirs
${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \
nslookup@EXEEXT@ ${DESTDIR}${bindir}
for m in ${MANPAGES}; do \
${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man1 || exit 1; \
done
${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man1; \
done
uninstall::
for m in ${MANPAGES}; do \
rm -f ${DESTDIR}${mandir}/man1/$$m || exit 1; \
rm -f ${DESTDIR}${mandir}/man1/$$m ; \
done
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/nslookup@EXEEXT@
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/host@EXEEXT@
+147 -190
View File
@@ -12,9 +12,6 @@
/*! \file */
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
@@ -64,10 +61,10 @@ static int addresscount = 0;
static char domainopt[DNS_NAME_MAXTEXT];
static char hexcookie[81];
static bool short_form = false, printcmd = true,
ip6_int = false, plusquest = false, pluscomm = false,
ipv4only = false, ipv6only = false, digrc = true;
static uint32_t splitwidth = 0xffffffff;
static isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
ip6_int = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE,
ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
static isc_uint32_t splitwidth = 0xffffffff;
/*% opcode text */
static const char * const opcodetext[] = {
@@ -158,7 +155,6 @@ help(void) {
" -m (enable memory usage debugging)\n"
" -p port (specify port number)\n"
" -q name (specify query name)\n"
" -r (do not read ~/.digrc)\n"
" -t type (specify query type)\n"
" -u (display times in usec instead of msec)\n"
" -x dot-notation (shortcut for reverse lookups)\n"
@@ -194,10 +190,8 @@ help(void) {
" +[no]fail (Don't try next server on SERVFAIL)\n"
" +[no]header-only (Send query without a question section)\n"
" +[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"
#endif
" +[no]idnin (Parse IDN names)\n"
" +[no]idnout (Convert IDN response)\n"
" +[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"
@@ -244,7 +238,7 @@ help(void) {
*/
static void
received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
uint64_t diff;
isc_uint64_t diff;
time_t tnow;
struct tm tmnow;
#ifdef WIN32
@@ -285,7 +279,7 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
#endif
if (query->lookup->doing_xfr) {
printf(";; XFR size: %u records (messages %u, "
"bytes %" PRIu64 ")\n",
"bytes %" ISC_PRINT_QUADFORMAT "u)\n",
query->rr_count, query->msg_count,
query->byte_count);
} else {
@@ -303,18 +297,18 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
} else if (query->lookup->identify && !short_form) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
if (query->lookup->use_usec)
printf(";; Received %" PRIu64 " bytes "
printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes "
"from %s(%s) in %ld us\n\n",
query->lookup->doing_xfr
? query->byte_count
: (uint64_t)bytes,
: (isc_uint64_t)bytes,
fromtext, query->userarg, (long) diff);
else
printf(";; Received %" PRIu64 " bytes "
printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes "
"from %s(%s) in %ld ms\n\n",
query->lookup->doing_xfr
? query->byte_count
: (uint64_t)bytes,
: (isc_uint64_t)bytes,
fromtext, query->userarg, (long) diff / 1000);
}
}
@@ -336,7 +330,7 @@ trying(char *frm, dig_lookup_t *lookup) {
static isc_result_t
say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
isc_result_t result;
uint64_t diff;
isc_uint64_t diff;
char store[sizeof(" in 18446744073709551616 us.")];
unsigned int styleflags = 0;
@@ -364,11 +358,10 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
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);
} else {
snprintf(store, sizeof(store), " in %" PRIu64 " ms.", diff / 1000);
}
if (query->lookup->use_usec)
snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u us.", diff);
else
snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u ms.", diff / 1000);
ADD_STRING(buf, store);
}
ADD_STRING(buf, "\n");
@@ -426,7 +419,7 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags,
return (ISC_R_SUCCESS);
}
static bool
static isc_boolean_t
isdotlocal(dns_message_t *msg) {
isc_result_t result;
static unsigned char local_ndata[] = { "\005local\0" };
@@ -441,16 +434,16 @@ isdotlocal(dns_message_t *msg) {
dns_name_t *name = NULL;
dns_message_currentname(msg, DNS_SECTION_QUESTION, &name);
if (dns_name_issubdomain(name, &local))
return (true);
return (ISC_TRUE);
}
return (false);
return (ISC_FALSE);
}
/*
* Callback from dighost.c to print the reply from a server
*/
static isc_result_t
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
isc_result_t result;
dns_messagetextflag_t flags;
isc_buffer_t *buf = NULL;
@@ -694,7 +687,7 @@ cleanup:
static void
printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
int i;
static bool first = true;
static isc_boolean_t first = ISC_TRUE;
char append[MXNAME];
if (printcmd) {
@@ -721,7 +714,7 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
";; global options:%s%s\n",
short_form ? " +short" : "",
printcmd ? " +cmd" : "");
first = false;
first = ISC_FALSE;
strlcat(lookup->cmdline, append,
sizeof(lookup->cmdline));
}
@@ -736,14 +729,14 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
*/
static void
plus_option(const char *option, bool is_batchfile,
plus_option(const char *option, isc_boolean_t is_batchfile,
dig_lookup_t *lookup)
{
isc_result_t result;
char option_store[256];
char *cmd, *value, *ptr, *code;
uint32_t num;
bool state = true;
isc_uint32_t num;
isc_boolean_t state = ISC_TRUE;
size_t n;
strlcpy(option_store, option, sizeof(option_store));
@@ -756,7 +749,7 @@ plus_option(const char *option, bool is_batchfile,
value = ptr;
if (strncasecmp(cmd, "no", 2)==0) {
cmd += 2;
state = false;
state = ISC_FALSE;
}
#define FULLCHECK(A) \
@@ -861,7 +854,7 @@ plus_option(const char *option, bool is_batchfile,
case 'l': /* class */
/* keep +cl for backwards compatibility */
FULLCHECK2("cl", "class");
lookup->noclass = !state;
lookup->noclass = ISC_TF(!state);
break;
case 'm': /* cmd */
FULLCHECK("cmd");
@@ -897,7 +890,7 @@ plus_option(const char *option, bool is_batchfile,
break;
case 'r':
FULLCHECK("crypto");
lookup->nocrypto = !state;
lookup->nocrypto = ISC_TF(!state);
break;
default:
goto invalid_option;
@@ -1007,18 +1000,13 @@ plus_option(const char *option, bool is_batchfile,
lookup->ednsoptscnt = 0;
break;
}
code = NULL;
if (value != NULL) {
code = strtok(value,
":");
}
if (code == NULL) {
if (value == NULL) {
warn("ednsopt no "
"code point "
"specified");
goto exit_or_usage;
}
value = strtok(NULL, "\0");
code = next_token(&value, ":");
save_opt(lookup, code, value);
break;
default:
@@ -1166,17 +1154,17 @@ plus_option(const char *option, bool is_batchfile,
FULLCHECK("nssearch");
lookup->ns_search_only = state;
if (state) {
lookup->trace_root = true;
lookup->recurse = true;
lookup->identify = true;
lookup->stats = false;
lookup->comments = false;
lookup->section_additional = false;
lookup->section_authority = false;
lookup->section_question = false;
lookup->trace_root = ISC_TRUE;
lookup->recurse = ISC_TRUE;
lookup->identify = ISC_TRUE;
lookup->stats = ISC_FALSE;
lookup->comments = ISC_FALSE;
lookup->section_additional = ISC_FALSE;
lookup->section_authority = ISC_FALSE;
lookup->section_question = ISC_FALSE;
lookup->rdtype = dns_rdatatype_ns;
lookup->rdtypeset = true;
short_form = true;
lookup->rdtypeset = ISC_TRUE;
short_form = ISC_TRUE;
lookup->rrcomments = 0;
}
break;
@@ -1234,7 +1222,7 @@ plus_option(const char *option, bool is_batchfile,
warn("Couldn't parse padding");
goto exit_or_usage;
}
lookup->padding = (uint16_t)num;
lookup->padding = (isc_uint16_t)num;
break;
case 'q':
switch (cmd[1]) {
@@ -1306,13 +1294,13 @@ plus_option(const char *option, bool is_batchfile,
FULLCHECK("short");
short_form = state;
if (state) {
printcmd = false;
lookup->section_additional = false;
lookup->section_answer = true;
lookup->section_authority = false;
lookup->section_question = false;
lookup->comments = false;
lookup->stats = false;
printcmd = ISC_FALSE;
lookup->section_additional = ISC_FALSE;
lookup->section_answer = ISC_TRUE;
lookup->section_authority = ISC_FALSE;
lookup->section_question = ISC_FALSE;
lookup->comments = ISC_FALSE;
lookup->stats = ISC_FALSE;
lookup->rrcomments = -1;
}
break;
@@ -1400,7 +1388,7 @@ plus_option(const char *option, bool is_batchfile,
FULLCHECK("tcp");
if (!is_batchfile) {
lookup->tcp_mode = state;
lookup->tcp_mode_set = true;
lookup->tcp_mode_set = ISC_TRUE;
}
break;
case 'i': /* timeout */
@@ -1429,17 +1417,17 @@ plus_option(const char *option, bool is_batchfile,
lookup->trace = state;
lookup->trace_root = state;
if (state) {
lookup->recurse = false;
lookup->identify = true;
lookup->comments = false;
lookup->recurse = ISC_FALSE;
lookup->identify = ISC_TRUE;
lookup->comments = ISC_FALSE;
lookup->rrcomments = 0;
lookup->stats = false;
lookup->section_additional = false;
lookup->section_authority = true;
lookup->section_question = false;
lookup->dnssec = true;
lookup->sendcookie = true;
usesearch = false;
lookup->stats = ISC_FALSE;
lookup->section_additional = ISC_FALSE;
lookup->section_authority = ISC_TRUE;
lookup->section_question = ISC_FALSE;
lookup->dnssec = ISC_TRUE;
lookup->sendcookie = ISC_TRUE;
usesearch = ISC_FALSE;
}
break;
case 'i': /* tries */
@@ -1473,12 +1461,12 @@ plus_option(const char *option, bool is_batchfile,
case 0:
case 'i': /* ttlid */
FULLCHECK2("ttl", "ttlid");
lookup->nottl = !state;
lookup->nottl = ISC_TF(!state);
break;
case 'u': /* ttlunits */
FULLCHECK("ttlunits");
lookup->nottl = false;
lookup->ttlunits = state;
lookup->nottl = ISC_FALSE;
lookup->ttlunits = ISC_TF(state);
break;
default:
goto invalid_option;
@@ -1500,7 +1488,7 @@ plus_option(const char *option, bool is_batchfile,
FULLCHECK("vc");
if (!is_batchfile) {
lookup->tcp_mode = state;
lookup->tcp_mode_set = true;
lookup->tcp_mode_set = ISC_TRUE;
}
break;
case 'z': /* zflag */
@@ -1526,19 +1514,19 @@ plus_option(const char *option, bool is_batchfile,
}
/*%
* #true returned if value was used
* #ISC_TRUE returned if value was used
*/
static const char *single_dash_opts = "46dhimnruv";
static const char *dash_opts = "46bcdfhikmnpqrtvyx";
static bool
static const char *single_dash_opts = "46dhimnuv";
static const char *dash_opts = "46bcdfhikmnptvyx";
static isc_boolean_t
dash_option(char *option, char *next, dig_lookup_t **lookup,
bool *open_type_class, bool *need_clone,
bool config_only, int argc, char **argv,
bool *firstarg)
isc_boolean_t *open_type_class, isc_boolean_t *need_clone,
isc_boolean_t config_only, int argc, char **argv,
isc_boolean_t *firstarg)
{
char opt, *value, *ptr, *ptr2, *ptr3;
isc_result_t result;
bool value_from_next;
isc_boolean_t value_from_next;
isc_textregion_t tr;
dns_rdatatype_t rdtype;
dns_rdataclass_t rdclass;
@@ -1547,7 +1535,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
struct in6_addr in6;
in_port_t srcport;
char *hash, *cmd;
uint32_t num;
isc_uint32_t num;
while (strpbrk(option, single_dash_opts) == &option[0]) {
/*
@@ -1560,21 +1548,21 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
case '4':
if (have_ipv4) {
isc_net_disableipv6();
have_ipv6 = false;
have_ipv6 = ISC_FALSE;
} else {
fatal("can't find IPv4 networking");
/* NOTREACHED */
return (false);
return (ISC_FALSE);
}
break;
case '6':
if (have_ipv6) {
isc_net_disableipv4();
have_ipv4 = false;
have_ipv4 = ISC_FALSE;
} else {
fatal("can't find IPv6 networking");
/* NOTREACHED */
return (false);
return (ISC_FALSE);
}
break;
case 'd':
@@ -1582,17 +1570,17 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
if (ptr != &option[1]) {
cmd = option;
FULLCHECK("debug");
debugging = true;
return (false);
debugging = ISC_TRUE;
return (ISC_FALSE);
} else
debugging = true;
debugging = ISC_TRUE;
break;
case 'h':
help();
exit(0);
break;
case 'i':
ip6_int = true;
ip6_int = ISC_TRUE;
break;
case 'm': /* memdebug */
/* memdebug is handled in preparse_args() */
@@ -1600,12 +1588,8 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
case 'n':
/* deprecated */
break;
case 'r':
debug("digrc (late)");
digrc = false;
break;
case 'u':
(*lookup)->use_usec = true;
(*lookup)->use_usec = ISC_TRUE;
break;
case 'v':
version();
@@ -1615,14 +1599,14 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
if (strlen(option) > 1U)
option = &option[1];
else
return (false);
return (ISC_FALSE);
}
opt = option[0];
if (strlen(option) > 1U) {
value_from_next = false;
value_from_next = ISC_FALSE;
value = &option[1];
} else {
value_from_next = true;
value_from_next = ISC_TRUE;
value = next;
}
if (value == NULL)
@@ -1652,20 +1636,20 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
}
if (hash != NULL)
*hash = '#';
specified_source = true;
specified_source = ISC_TRUE;
return (value_from_next);
case 'c':
if ((*lookup)->rdclassset) {
fprintf(stderr, ";; Warning, extra class option\n");
}
*open_type_class = false;
*open_type_class = ISC_FALSE;
tr.base = value;
tr.length = (unsigned int) strlen(value);
result = dns_rdataclass_fromtext(&rdclass,
(isc_textregion_t *)&tr);
if (result == ISC_R_SUCCESS) {
(*lookup)->rdclass = rdclass;
(*lookup)->rdclassset = true;
(*lookup)->rdclassset = ISC_TRUE;
} else
fprintf(stderr, ";; Warning, ignoring "
"invalid class %s\n",
@@ -1687,23 +1671,23 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
if (!config_only) {
if (*need_clone)
(*lookup) = clone_lookup(default_lookup,
true);
*need_clone = true;
ISC_TRUE);
*need_clone = ISC_TRUE;
strlcpy((*lookup)->textname, value,
sizeof((*lookup)->textname));
(*lookup)->trace_root = ((*lookup)->trace ||
(*lookup)->ns_search_only);
(*lookup)->new_search = true;
(*lookup)->trace_root = ISC_TF((*lookup)->trace ||
(*lookup)->ns_search_only);
(*lookup)->new_search = ISC_TRUE;
if (*firstarg) {
printgreeting(argc, argv, *lookup);
*firstarg = false;
*firstarg = ISC_FALSE;
}
ISC_LIST_APPEND(lookup_list, (*lookup), link);
debug("looking up %s", (*lookup)->textname);
}
return (value_from_next);
case 't':
*open_type_class = false;
*open_type_class = ISC_FALSE;
if (strncasecmp(value, "ixfr=", 5) == 0) {
rdtype = dns_rdatatype_ixfr;
result = ISC_R_SUCCESS;
@@ -1723,9 +1707,9 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
"extra type option\n");
}
if (rdtype == dns_rdatatype_ixfr) {
uint32_t serial;
isc_uint32_t serial;
(*lookup)->rdtype = dns_rdatatype_ixfr;
(*lookup)->rdtypeset = true;
(*lookup)->rdtypeset = ISC_TRUE;
result = parse_uint(&serial, &value[5],
MAXSERIAL, "serial number");
if (result != ISC_R_SUCCESS)
@@ -1734,19 +1718,19 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
(*lookup)->section_question = plusquest;
(*lookup)->comments = pluscomm;
if (!(*lookup)->tcp_mode_set)
(*lookup)->tcp_mode = true;
(*lookup)->tcp_mode = ISC_TRUE;
} else {
(*lookup)->rdtype = rdtype;
if (!config_only)
(*lookup)->rdtypeset = true;
(*lookup)->rdtypeset = ISC_TRUE;
if (rdtype == dns_rdatatype_axfr) {
(*lookup)->section_question = plusquest;
(*lookup)->comments = pluscomm;
} else if (rdtype == dns_rdatatype_any) {
if (!(*lookup)->tcp_mode_set)
(*lookup)->tcp_mode = true;
(*lookup)->tcp_mode = ISC_TRUE;
}
(*lookup)->ixfr_serial = false;
(*lookup)->ixfr_serial = ISC_FALSE;
}
} else
fprintf(stderr, ";; Warning, ignoring "
@@ -1779,24 +1763,24 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
return (value_from_next);
case 'x':
if (*need_clone)
*lookup = clone_lookup(default_lookup, true);
*need_clone = true;
*lookup = clone_lookup(default_lookup, ISC_TRUE);
*need_clone = ISC_TRUE;
if (get_reverse(textname, sizeof(textname), value,
ip6_int, false) == ISC_R_SUCCESS) {
ip6_int, ISC_FALSE) == ISC_R_SUCCESS) {
strlcpy((*lookup)->textname, textname,
sizeof((*lookup)->textname));
debug("looking up %s", (*lookup)->textname);
(*lookup)->trace_root = ((*lookup)->trace ||
(*lookup)->ns_search_only);
(*lookup)->trace_root = ISC_TF((*lookup)->trace ||
(*lookup)->ns_search_only);
(*lookup)->ip6_int = ip6_int;
if (!(*lookup)->rdtypeset)
(*lookup)->rdtype = dns_rdatatype_ptr;
if (!(*lookup)->rdclassset)
(*lookup)->rdclass = dns_rdataclass_in;
(*lookup)->new_search = true;
(*lookup)->new_search = ISC_TRUE;
if (*firstarg) {
printgreeting(argc, argv, *lookup);
*firstarg = false;
*firstarg = ISC_FALSE;
}
ISC_LIST_APPEND(lookup_list, *lookup, link);
} else {
@@ -1810,7 +1794,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
usage();
}
/* NOTREACHED */
return (false);
return (ISC_FALSE);
}
/*%
@@ -1836,64 +1820,38 @@ preparse_args(int argc, char **argv) {
option = &rv[0][1];
while (strpbrk(option, single_dash_opts) == &option[0]) {
switch (option[0]) {
case 'd':
/* For debugging early startup */
debugging = true;
break;
case 'm':
memdebugging = true;
memdebugging = ISC_TRUE;
isc_mem_debugging = ISC_MEM_DEBUGTRACE |
ISC_MEM_DEBUGRECORD;
break;
case 'r':
/*
* Must be done early, because ~/.digrc
* is read before command line parsing
*/
debug("digrc (early)");
digrc = false;
break;
case '4':
if (ipv6only)
fatal("only one of -4 and -6 allowed");
ipv4only = true;
ipv4only = ISC_TRUE;
break;
case '6':
if (ipv4only)
fatal("only one of -4 and -6 allowed");
ipv6only = true;
ipv6only = ISC_TRUE;
break;
}
option = &option[1];
}
if (strlen(option) == 0U) {
continue;
}
/* Look for dash value option. */
if (strpbrk(option, dash_opts) != &option[0] ||
strlen(option) > 1U) {
/* Error or value in option. */
continue;
}
/* Dash value is next argument so we need to skip it. */
rc--, rv++;
/* Handle missing argument */
if (rc == 0)
break;
}
}
static void
parse_args(bool is_batchfile, bool config_only,
parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
int argc, char **argv)
{
isc_result_t result;
isc_textregion_t tr;
bool firstarg = true;
isc_boolean_t firstarg = ISC_TRUE;
dig_lookup_t *lookup = NULL;
dns_rdatatype_t rdtype;
dns_rdataclass_t rdclass;
bool open_type_class = true;
isc_boolean_t open_type_class = ISC_TRUE;
char batchline[MXNAME];
int bargc;
char *bargv[64];
@@ -1905,7 +1863,7 @@ parse_args(bool is_batchfile, bool config_only,
#endif
char *input;
int i;
bool need_clone = true;
isc_boolean_t need_clone = ISC_TRUE;
/*
* The semantics for parsing the args is a bit complex; if
@@ -1922,9 +1880,9 @@ parse_args(bool is_batchfile, bool config_only,
if (!is_batchfile) {
debug("making new lookup");
default_lookup = make_empty_lookup();
default_lookup->adflag = true;
default_lookup->adflag = ISC_TRUE;
default_lookup->edns = 0;
default_lookup->sendcookie = true;
default_lookup->sendcookie = ISC_TRUE;
#ifndef NOPOSIX
/*
@@ -1932,9 +1890,8 @@ parse_args(bool is_batchfile, bool config_only,
*/
INSIST(batchfp == NULL);
homedir = getenv("HOME");
if (homedir != NULL && digrc) {
if (homedir != NULL) {
unsigned int n;
debug("digrc (open)");
n = snprintf(rcfile, sizeof(rcfile), "%s/.digrc",
homedir);
if (n < sizeof(rcfile))
@@ -1959,7 +1916,7 @@ parse_args(bool is_batchfile, bool config_only,
for(i = 0; i < bargc; i++)
debug(".digrc argv %d: %s",
i, bargv[i]);
parse_args(true, true, bargc,
parse_args(ISC_TRUE, ISC_TRUE, bargc,
(char **)bargv);
}
fclose(batchfp);
@@ -1969,8 +1926,8 @@ parse_args(bool is_batchfile, bool config_only,
if (is_batchfile && !config_only) {
/* Processing '-f batchfile'. */
lookup = clone_lookup(default_lookup, true);
need_clone = false;
lookup = clone_lookup(default_lookup, ISC_TRUE);
need_clone = ISC_FALSE;
} else
lookup = default_lookup;
@@ -2052,10 +2009,10 @@ parse_args(bool is_batchfile, bool config_only,
"extra type option\n");
}
if (rdtype == dns_rdatatype_ixfr) {
uint32_t serial;
isc_uint32_t serial;
lookup->rdtype =
dns_rdatatype_ixfr;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
result = parse_uint(&serial,
&rv[0][5],
MAXSERIAL,
@@ -2068,10 +2025,10 @@ parse_args(bool is_batchfile, bool config_only,
plusquest;
lookup->comments = pluscomm;
if (!lookup->tcp_mode_set)
lookup->tcp_mode = true;
lookup->tcp_mode = ISC_TRUE;
} else {
lookup->rdtype = rdtype;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
if (rdtype ==
dns_rdatatype_axfr) {
lookup->section_question =
@@ -2081,8 +2038,8 @@ parse_args(bool is_batchfile, bool config_only,
if (rdtype ==
dns_rdatatype_any &&
!lookup->tcp_mode_set)
lookup->tcp_mode = true;
lookup->ixfr_serial = false;
lookup->tcp_mode = ISC_TRUE;
lookup->ixfr_serial = ISC_FALSE;
}
continue;
}
@@ -2094,7 +2051,7 @@ parse_args(bool is_batchfile, bool config_only,
"extra class option\n");
}
lookup->rdclass = rdclass;
lookup->rdclassset = true;
lookup->rdclassset = ISC_TRUE;
continue;
}
}
@@ -2102,16 +2059,16 @@ parse_args(bool is_batchfile, bool config_only,
if (!config_only) {
if (need_clone)
lookup = clone_lookup(default_lookup,
true);
need_clone = true;
ISC_TRUE);
need_clone = ISC_TRUE;
strlcpy(lookup->textname, rv[0],
sizeof(lookup->textname));
lookup->trace_root = (lookup->trace ||
lookup->ns_search_only);
lookup->new_search = true;
lookup->trace_root = ISC_TF(lookup->trace ||
lookup->ns_search_only);
lookup->new_search = ISC_TRUE;
if (firstarg) {
printgreeting(argc, argv, lookup);
firstarg = false;
firstarg = ISC_FALSE;
}
ISC_LIST_APPEND(lookup_list, lookup, link);
debug("looking up %s", lookup->textname);
@@ -2156,7 +2113,7 @@ parse_args(bool is_batchfile, bool config_only,
for(i = 0; i < bargc; i++)
debug("batch argv %d: %s", i, bargv[i]);
parse_args(true, false, bargc, (char **)bargv);
parse_args(ISC_TRUE, ISC_FALSE, bargc, (char **)bargv);
return;
}
return;
@@ -2166,17 +2123,17 @@ parse_args(bool is_batchfile, bool config_only,
*/
if ((lookup_list.head == NULL) && !config_only) {
if (need_clone)
lookup = clone_lookup(default_lookup, true);
need_clone = true;
lookup->trace_root = (lookup->trace ||
lookup->ns_search_only);
lookup->new_search = true;
lookup = clone_lookup(default_lookup, ISC_TRUE);
need_clone = ISC_TRUE;
lookup->trace_root = ISC_TF(lookup->trace ||
lookup->ns_search_only);
lookup->new_search = ISC_TRUE;
strlcpy(lookup->textname, ".", sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_ns;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
if (firstarg) {
printgreeting(argc, argv, lookup);
firstarg = false;
firstarg = ISC_FALSE;
}
ISC_LIST_APPEND(lookup_list, lookup, link);
}
@@ -2225,7 +2182,7 @@ query_finished(void) {
for(i = 0; i < bargc; i++)
debug("batch argv %d: %s", i, bargv[i]);
parse_args(true, false, bargc, (char **)bargv);
parse_args(ISC_TRUE, ISC_FALSE, bargc, (char **)bargv);
start_lookup();
} else {
batchname = NULL;
@@ -2262,7 +2219,7 @@ void dig_setup(int argc, char **argv)
setup_system(ipv4only, ipv6only);
}
void dig_query_setup(bool is_batchfile, bool config_only,
void dig_query_setup(isc_boolean_t is_batchfile, isc_boolean_t config_only,
int argc, char **argv)
{
debug("dig_query_setup");
@@ -2274,7 +2231,7 @@ void dig_query_setup(bool is_batchfile, bool config_only,
setup_text_key();
if (domainopt[0] != '\0') {
set_search_domain(domainopt);
usesearch = true;
usesearch = ISC_TRUE;
}
}
@@ -2311,7 +2268,7 @@ int
main(int argc, char **argv) {
dig_setup(argc, argv);
dig_query_setup(false, false, argc, argv);
dig_query_setup(ISC_FALSE, ISC_FALSE, argc, argv);
dig_startup();
dig_shutdown();
+5 -29
View File
@@ -52,7 +52,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
@@ -132,10 +131,9 @@
<para>
It is possible to set per-user defaults for <command>dig</command> via
<filename>${HOME}/.digrc</filename>. This file is read and any
options in it are applied before the command line arguments.
The <option>-r</option> option disables this feature, for
scripts that need predictable behaviour.
<filename>${HOME}/.digrc</filename>. This file is read and
any options in it
are applied before the command line arguments.
</para>
<para>
@@ -336,16 +334,6 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-r</term>
<listitem>
<para>
Do not read options from <filename>${HOME}/.digrc</filename>.
This is useful for scripts that need predictable behaviour.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-t <replaceable class="parameter">type</replaceable></term>
<listitem>
@@ -801,13 +789,7 @@
<para>
Process [do not process] IDN domain names on input.
This requires IDN SUPPORT to have been enabled at
compile time.
</para>
<para>
The default is to process IDN input when standard output
is a tty. The IDN processing on input is disabled when
dig output is redirected to files, pipes, and other
non-tty file descriptors.
compile time. The default is to process IDN input.
</para>
</listitem>
</varlistentry>
@@ -818,13 +800,7 @@
<para>
Convert [do not convert] puny code on output.
This requires IDN SUPPORT to have been enabled at
compile time.
</para>
<para>
The default is to process puny code on output when
standard output is a tty. The puny code processing on
output is disabled when dig output is redirected to
files, pipes, and other non-tty file descriptors.
compile time. The default is to convert output.
</para>
</listitem>
</varlistentry>
+301 -389
View File
File diff suppressed because it is too large Load Diff
+91 -96
View File
@@ -12,9 +12,6 @@
/*! \file */
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <limits.h>
@@ -50,14 +47,14 @@
#include <dig/dig.h>
static bool short_form = true, listed_server = false;
static bool default_lookups = true;
static isc_boolean_t short_form = ISC_TRUE, listed_server = ISC_FALSE;
static isc_boolean_t default_lookups = ISC_TRUE;
static int seen_error = -1;
static bool list_addresses = true;
static bool list_almost_all = false;
static isc_boolean_t list_addresses = ISC_TRUE;
static isc_boolean_t list_almost_all = ISC_FALSE;
static dns_rdatatype_t list_type = dns_rdatatype_a;
static bool printed_server = false;
static bool ipv4only = false, ipv6only = false;
static isc_boolean_t printed_server = ISC_FALSE;
static isc_boolean_t ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
static const char *opcodetext[] = {
"QUERY",
@@ -160,7 +157,6 @@ show_usage(void) {
" -s a SERVFAIL response should stop query\n"
" -t specifies the query type\n"
" -T enables TCP/IP mode\n"
" -U enables UDP mode\n"
" -v enables verbose output\n"
" -V print version number and exit\n"
" -w specifies to wait forever for a reply\n"
@@ -235,7 +231,7 @@ say_message(dns_name_t *name, const char *msg, dns_rdata_t *rdata,
static isc_result_t
printsection(dns_message_t *msg, dns_section_t sectionid,
const char *section_name, bool headers,
const char *section_name, isc_boolean_t headers,
dig_query_t *query)
{
dns_name_t *name, *print_name;
@@ -246,13 +242,13 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
isc_region_t r;
dns_name_t empty_name;
char tbuf[4096];
bool first;
bool no_rdata;
isc_boolean_t first;
isc_boolean_t no_rdata;
if (sectionid == DNS_SECTION_QUESTION)
no_rdata = true;
no_rdata = ISC_TRUE;
else
no_rdata = false;
no_rdata = ISC_FALSE;
if (headers)
printf(";; %s SECTION:\n", section_name);
@@ -270,7 +266,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
dns_message_currentname(msg, sectionid, &name);
isc_buffer_init(&target, tbuf, sizeof(tbuf));
first = true;
first = ISC_TRUE;
print_name = name;
for (rdataset = ISC_LIST_HEAD(name->list);
@@ -294,7 +290,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
if (!short_form) {
result = dns_rdataset_totext(rdataset,
print_name,
false,
ISC_FALSE,
no_rdata,
&target);
if (result != ISC_R_SUCCESS)
@@ -302,7 +298,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
#ifdef USEINITALWS
if (first) {
print_name = &empty_name;
first = false;
first = ISC_FALSE;
}
#else
UNUSED(first); /* Shut up compiler. */
@@ -361,7 +357,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
static isc_result_t
printrdata(dns_message_t *msg, dns_rdataset_t *rdataset,
const dns_name_t *owner, const char *set_name,
bool headers)
isc_boolean_t headers)
{
isc_buffer_t target;
isc_result_t result;
@@ -374,7 +370,7 @@ printrdata(dns_message_t *msg, dns_rdataset_t *rdataset,
isc_buffer_init(&target, tbuf, sizeof(tbuf));
result = dns_rdataset_totext(rdataset, owner, false, false,
result = dns_rdataset_totext(rdataset, owner, ISC_FALSE, ISC_FALSE,
&target);
if (result != ISC_R_SUCCESS)
return (result);
@@ -411,8 +407,8 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
}
static isc_result_t
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
bool did_flag = false;
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
isc_boolean_t did_flag = ISC_FALSE;
dns_rdataset_t *opt, *tsig = NULL;
const dns_name_t *tsigname;
isc_result_t result = ISC_R_SUCCESS;
@@ -435,7 +431,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
sizeof(sockstr));
printf("Address: %s\n", sockstr);
printf("Aliases: \n\n");
printed_server = true;
printed_server = ISC_TRUE;
}
if (msg->rcode != 0) {
@@ -467,22 +463,22 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
dns_name_copy(query->lookup->name, name, NULL);
chase_cnamechain(msg, name);
dns_name_format(name, namestr, sizeof(namestr));
lookup = clone_lookup(query->lookup, false);
lookup = clone_lookup(query->lookup, ISC_FALSE);
if (lookup != NULL) {
strlcpy(lookup->textname, namestr,
sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_aaaa;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
lookup->origin = NULL;
lookup->retries = tries;
ISC_LIST_APPEND(lookup_list, lookup, link);
}
lookup = clone_lookup(query->lookup, false);
lookup = clone_lookup(query->lookup, ISC_FALSE);
if (lookup != NULL) {
strlcpy(lookup->textname, namestr,
sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_mx;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
lookup->origin = NULL;
lookup->retries = tries;
ISC_LIST_APPEND(lookup_list, lookup, link);
@@ -496,31 +492,31 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
printf(";; flags: ");
if ((msg->flags & DNS_MESSAGEFLAG_QR) != 0) {
printf("qr");
did_flag = true;
did_flag = ISC_TRUE;
}
if ((msg->flags & DNS_MESSAGEFLAG_AA) != 0) {
printf("%saa", did_flag ? " " : "");
did_flag = true;
did_flag = ISC_TRUE;
}
if ((msg->flags & DNS_MESSAGEFLAG_TC) != 0) {
printf("%stc", did_flag ? " " : "");
did_flag = true;
did_flag = ISC_TRUE;
}
if ((msg->flags & DNS_MESSAGEFLAG_RD) != 0) {
printf("%srd", did_flag ? " " : "");
did_flag = true;
did_flag = ISC_TRUE;
}
if ((msg->flags & DNS_MESSAGEFLAG_RA) != 0) {
printf("%sra", did_flag ? " " : "");
did_flag = true;
did_flag = ISC_TRUE;
}
if ((msg->flags & DNS_MESSAGEFLAG_AD) != 0) {
printf("%sad", did_flag ? " " : "");
did_flag = true;
did_flag = ISC_TRUE;
}
if ((msg->flags & DNS_MESSAGEFLAG_CD) != 0) {
printf("%scd", did_flag ? " " : "");
did_flag = true;
did_flag = ISC_TRUE;
POST(did_flag);
}
printf("; QUERY: %u, ANSWER: %u, "
@@ -543,7 +539,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
!short_form) {
printf("\n");
result = printsection(msg, DNS_SECTION_QUESTION, "QUESTION",
true, query);
ISC_TRUE, query);
if (result != ISC_R_SUCCESS)
return (result);
}
@@ -551,7 +547,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
if (!short_form)
printf("\n");
result = printsection(msg, DNS_SECTION_ANSWER, "ANSWER",
!short_form, query);
ISC_TF(!short_form), query);
if (result != ISC_R_SUCCESS)
return (result);
}
@@ -560,7 +556,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
!short_form) {
printf("\n");
result = printsection(msg, DNS_SECTION_AUTHORITY, "AUTHORITY",
true, query);
ISC_TRUE, query);
if (result != ISC_R_SUCCESS)
return (result);
}
@@ -568,14 +564,14 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
!short_form) {
printf("\n");
result = printsection(msg, DNS_SECTION_ADDITIONAL,
"ADDITIONAL", true, query);
"ADDITIONAL", ISC_TRUE, query);
if (result != ISC_R_SUCCESS)
return (result);
}
if ((tsig != NULL) && !short_form) {
printf("\n");
result = printrdata(msg, tsig, tsigname,
"PSEUDOSECTION TSIG", true);
"PSEUDOSECTION TSIG", ISC_TRUE);
if (result != ISC_R_SUCCESS)
return (result);
}
@@ -610,7 +606,7 @@ pre_parse_args(int argc, char **argv) {
while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
switch (c) {
case 'm':
memdebugging = true;
memdebugging = ISC_TRUE;
if (strcasecmp("trace", isc_commandline_argument) == 0)
isc_mem_debugging |= ISC_MEM_DEBUGTRACE;
else if (strcasecmp("record",
@@ -624,50 +620,49 @@ pre_parse_args(int argc, char **argv) {
case '4':
if (ipv6only)
fatal("only one of -4 and -6 allowed");
ipv4only = true;
ipv4only = ISC_TRUE;
break;
case '6':
if (ipv4only)
fatal("only one of -4 and -6 allowed");
ipv6only = true;
ipv6only = ISC_TRUE;
break;
case 'a': break;
case 'A': break;
case 'c': break;
case 'C': break;
case 'd': break;
case 'D':
if (debugging)
debugtiming = true;
debugging = true;
break;
case 'i': break;
case 'l': break;
case 'n': break;
case 'N': break;
case 'r': break;
case 'R': break;
case 's': break;
case 't': break;
case 'T': break;
case 'U': break;
case 'v': break;
case 'V':
version();
exit(0);
break;
case 'w': break;
case 'C': break;
case 'D':
if (debugging)
debugtiming = ISC_TRUE;
debugging = ISC_TRUE;
break;
case 'N': break;
case 'R': break;
case 'T': break;
case 'W': break;
default:
show_usage();
}
}
isc_commandline_reset = true;
isc_commandline_reset = ISC_TRUE;
isc_commandline_index = 1;
}
static void
parse_args(bool is_batchfile, int argc, char **argv) {
parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
char hostname[MXNAME];
dig_lookup_t *lookup;
int c;
@@ -676,30 +671,30 @@ parse_args(bool is_batchfile, int argc, char **argv) {
isc_result_t result = ISC_R_SUCCESS;
dns_rdatatype_t rdtype;
dns_rdataclass_t rdclass;
uint32_t serial = 0;
isc_uint32_t serial = 0;
UNUSED(is_batchfile);
lookup = make_empty_lookup();
lookup->servfail_stops = false;
lookup->comments = false;
lookup->servfail_stops = ISC_FALSE;
lookup->comments = ISC_FALSE;
short_form = !verbose;
while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
switch (c) {
case 'l':
lookup->tcp_mode = true;
lookup->tcp_mode = ISC_TRUE;
lookup->rdtype = dns_rdatatype_axfr;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
fatalexit = 3;
break;
case 'v':
case 'd':
short_form = false;
short_form = ISC_FALSE;
break;
case 'r':
lookup->recurse = false;
lookup->recurse = ISC_FALSE;
break;
case 't':
if (strncasecmp(isc_commandline_argument,
@@ -724,22 +719,22 @@ parse_args(bool is_batchfile, int argc, char **argv) {
if (!lookup->rdtypeset ||
lookup->rdtype != dns_rdatatype_axfr)
lookup->rdtype = rdtype;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
#ifdef WITH_IDNKIT
idnoptions = 0;
#endif
if (rdtype == dns_rdatatype_axfr) {
/* -l -t any -v */
list_type = dns_rdatatype_any;
short_form = false;
lookup->tcp_mode = true;
short_form = ISC_FALSE;
lookup->tcp_mode = ISC_TRUE;
} else if (rdtype == dns_rdatatype_ixfr) {
lookup->ixfr_serial = serial;
lookup->tcp_mode = true;
lookup->tcp_mode = ISC_TRUE;
list_type = rdtype;
} else if (rdtype == dns_rdatatype_any) {
if (!lookup->tcp_mode_set)
lookup->tcp_mode = true;
lookup->tcp_mode = ISC_TRUE;
#ifdef WITH_IDNKIT
} else if (rdtype == dns_rdatatype_a ||
rdtype == dns_rdatatype_aaaa ||
@@ -749,8 +744,8 @@ parse_args(bool is_batchfile, int argc, char **argv) {
#endif
} else
list_type = rdtype;
list_addresses = false;
default_lookups = false;
list_addresses = ISC_FALSE;
default_lookups = ISC_FALSE;
break;
case 'c':
tr.base = isc_commandline_argument;
@@ -764,12 +759,12 @@ parse_args(bool is_batchfile, int argc, char **argv) {
isc_commandline_argument);
} else {
lookup->rdclass = rdclass;
lookup->rdclassset = true;
lookup->rdclassset = ISC_TRUE;
}
default_lookups = false;
default_lookups = ISC_FALSE;
break;
case 'A':
list_almost_all = true;
list_almost_all = ISC_TRUE;
/* FALL THROUGH */
case 'a':
if (!lookup->rdtypeset ||
@@ -779,13 +774,13 @@ parse_args(bool is_batchfile, int argc, char **argv) {
idnoptions = 0;
#endif
list_type = dns_rdatatype_any;
list_addresses = false;
lookup->rdtypeset = true;
short_form = false;
default_lookups = false;
list_addresses = ISC_FALSE;
lookup->rdtypeset = ISC_TRUE;
short_form = ISC_FALSE;
default_lookups = ISC_FALSE;
break;
case 'i':
lookup->ip6_int = true;
lookup->ip6_int = ISC_TRUE;
break;
case 'n':
/* deprecated */
@@ -811,23 +806,23 @@ parse_args(bool is_batchfile, int argc, char **argv) {
tries = 2;
break;
case 'T':
lookup->tcp_mode = true;
lookup->tcp_mode_set = true;
lookup->tcp_mode = ISC_TRUE;
lookup->tcp_mode_set = ISC_TRUE;
break;
case 'U':
lookup->tcp_mode = false;
lookup->tcp_mode_set = true;
lookup->tcp_mode = ISC_FALSE;
lookup->tcp_mode_set = ISC_TRUE;
break;
case 'C':
debug("showing all SOAs");
lookup->rdtype = dns_rdatatype_ns;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
lookup->rdclass = dns_rdataclass_in;
lookup->rdclassset = true;
lookup->ns_search_only = true;
lookup->trace_root = true;
lookup->identify_previous_line = true;
default_lookups = false;
lookup->rdclassset = ISC_TRUE;
lookup->ns_search_only = ISC_TRUE;
lookup->trace_root = ISC_TRUE;
lookup->identify_previous_line = ISC_TRUE;
default_lookups = ISC_FALSE;
break;
case 'N':
debug("setting NDOTS to %s",
@@ -844,7 +839,7 @@ parse_args(bool is_batchfile, int argc, char **argv) {
/* Handled by pre_parse_args(). */
break;
case 's':
lookup->servfail_stops = true;
lookup->servfail_stops = ISC_TRUE;
break;
}
}
@@ -859,22 +854,22 @@ parse_args(bool is_batchfile, int argc, char **argv) {
if (argc > isc_commandline_index + 1) {
set_nameserver(argv[isc_commandline_index+1]);
debug("server is %s", argv[isc_commandline_index+1]);
listed_server = true;
listed_server = ISC_TRUE;
} else
check_ra = true;
check_ra = ISC_TRUE;
lookup->pending = false;
lookup->pending = ISC_FALSE;
if (get_reverse(store, sizeof(store), hostname,
lookup->ip6_int, true) == ISC_R_SUCCESS) {
lookup->ip6_int, ISC_TRUE) == ISC_R_SUCCESS) {
strlcpy(lookup->textname, store, sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_ptr;
lookup->rdtypeset = true;
default_lookups = false;
lookup->rdtypeset = ISC_TRUE;
default_lookups = ISC_FALSE;
} else {
strlcpy(lookup->textname, hostname, sizeof(lookup->textname));
usesearch = true;
usesearch = ISC_TRUE;
}
lookup->new_search = true;
lookup->new_search = ISC_TRUE;
ISC_LIST_APPEND(lookup_list, lookup, link);
}
@@ -906,7 +901,7 @@ main(int argc, char **argv) {
check_result(result, "isc_app_start");
setup_libs();
setup_system(ipv4only, ipv6only);
parse_args(false, argc, argv);
parse_args(ISC_FALSE, argc, argv);
if (keyfile[0] != 0)
setup_file_key();
else if (keysecret[0] != 0)
-1
View File
@@ -47,7 +47,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+33 -35
View File
@@ -14,13 +14,11 @@
/*! \file */
#include <inttypes.h>
#include <stdbool.h>
#include <dns/rdatalist.h>
#include <dst/dst.h>
#include <isc/boolean.h>
#include <isc/buffer.h>
#include <isc/bufferlist.h>
#include <isc/formatcheck.h>
@@ -83,7 +81,7 @@ typedef struct dig_searchlist dig_searchlist_t;
/*% The dig_lookup structure */
struct dig_lookup {
bool
isc_boolean_t
pending, /*%< Pending a successful answer */
waiting_connect,
doing_xfr,
@@ -139,8 +137,8 @@ struct dig_lookup {
dns_rdatatype_t rdtype;
dns_rdatatype_t qrdtype;
dns_rdataclass_t rdclass;
bool rdtypeset;
bool rdclassset;
isc_boolean_t rdtypeset;
isc_boolean_t rdclassset;
char name_space[BUFSIZE];
char oname_space[BUFSIZE];
isc_buffer_t namebuf;
@@ -158,17 +156,17 @@ struct dig_lookup {
dig_serverlist_t my_server_list;
dig_searchlist_t *origin;
dig_query_t *xfr_q;
uint32_t retries;
isc_uint32_t retries;
int nsfound;
uint16_t udpsize;
int16_t edns;
int16_t padding;
uint32_t ixfr_serial;
isc_uint16_t udpsize;
isc_int16_t edns;
isc_int16_t padding;
isc_uint32_t ixfr_serial;
isc_buffer_t rdatabuf;
char rdatastore[MXNAME];
dst_context_t *tsigctx;
isc_buffer_t *querysig;
uint32_t msgcounter;
isc_uint32_t msgcounter;
dns_fixedname_t fdomain;
isc_sockaddr_t *ecs_addr;
char *cookie;
@@ -184,7 +182,7 @@ struct dig_lookup {
/*% The dig_query structure */
struct dig_query {
dig_lookup_t *lookup;
bool waiting_connect,
isc_boolean_t waiting_connect,
pending_free,
waiting_senddone,
first_pass,
@@ -194,11 +192,11 @@ struct dig_query {
recv_made,
warn_id,
timedout;
uint32_t first_rr_serial;
uint32_t second_rr_serial;
uint32_t msg_count;
uint32_t rr_count;
bool ixfr_axfr;
isc_uint32_t first_rr_serial;
isc_uint32_t second_rr_serial;
isc_uint32_t msg_count;
isc_uint32_t rr_count;
isc_boolean_t ixfr_axfr;
char *servname;
char *userarg;
isc_bufferlist_t sendlist,
@@ -216,7 +214,7 @@ struct dig_query {
isc_sockaddr_t sockaddr;
isc_time_t time_sent;
isc_time_t time_recv;
uint64_t byte_count;
isc_uint64_t byte_count;
isc_buffer_t sendbuf;
isc_timer_t *timer;
};
@@ -244,7 +242,7 @@ extern dig_serverlist_t server_list;
extern dig_searchlistlist_t search_list;
extern unsigned int extrabytes;
extern bool check_ra, have_ipv4, have_ipv6, specified_source,
extern isc_boolean_t check_ra, have_ipv4, have_ipv6, specified_source,
usesearch, showsearch;
extern in_port_t port;
extern unsigned int timeout;
@@ -260,17 +258,17 @@ extern char keysecret[MXNAME];
extern const dns_name_t *hmacname;
extern unsigned int digestbits;
extern dns_tsigkey_t *tsigkey;
extern bool validated;
extern isc_boolean_t validated;
extern isc_taskmgr_t *taskmgr;
extern isc_task_t *global_task;
extern bool free_now;
extern bool debugging, debugtiming, memdebugging;
extern bool keep_open;
extern isc_boolean_t free_now;
extern isc_boolean_t debugging, debugtiming, memdebugging;
extern isc_boolean_t keep_open;
extern char *progname;
extern int tries;
extern int fatalexit;
extern bool verbose;
extern isc_boolean_t verbose;
#ifdef WITH_IDNKIT
extern int idnoptions;
#endif
@@ -285,8 +283,8 @@ int
getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp);
isc_result_t
get_reverse(char *reverse, size_t len, char *value, bool ip6_int,
bool strict);
get_reverse(char *reverse, size_t len, char *value, isc_boolean_t ip6_int,
isc_boolean_t strict);
ISC_PLATFORM_NORETURN_PRE void
fatal(const char *format, ...)
@@ -305,7 +303,7 @@ debug(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
void
check_result(isc_result_t result, const char *msg);
bool
isc_boolean_t
setup_lookup(dig_lookup_t *lookup);
void
@@ -327,14 +325,14 @@ void
setup_libs(void);
void
setup_system(bool ipv4only, bool ipv6only);
setup_system(isc_boolean_t ipv4only, isc_boolean_t ipv6only);
isc_result_t
parse_uint(uint32_t *uip, const char *value, uint32_t max,
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
const char *desc);
isc_result_t
parse_xint(uint32_t *uip, const char *value, uint32_t max,
parse_xint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
const char *desc);
isc_result_t
@@ -344,13 +342,13 @@ void
parse_hmac(const char *hmacstr);
dig_lookup_t *
requeue_lookup(dig_lookup_t *lookold, bool servers);
requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
dig_lookup_t *
make_empty_lookup(void);
dig_lookup_t *
clone_lookup(dig_lookup_t *lookold, bool servers);
clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
dig_server_t *
make_server(const char *servname, const char *userarg);
@@ -382,7 +380,7 @@ next_token(char **stringp, const char *delim);
* then assigned to the appropriate function pointer
*/
extern isc_result_t
(*dighost_printmessage)(dig_query_t *query, dns_message_t *msg, bool headers);
(*dighost_printmessage)(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers);
/*%<
* Print the final result of the lookup.
*/
@@ -424,7 +422,7 @@ dig_setup(int argc, char **argv);
* Call to supply new parameters for the next lookup
*/
void
dig_query_setup(bool, bool, int argc, char **argv);
dig_query_setup(isc_boolean_t, isc_boolean_t, int argc, char **argv);
/*%<
* set the main application event cycle running
+87 -109
View File
@@ -11,8 +11,6 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
@@ -55,18 +53,18 @@
#endif
#endif
static bool short_form = true,
tcpmode = false, tcpmode_set = false,
identify = false, stats = true,
comments = true, section_question = true,
section_answer = true, section_authority = true,
section_additional = true, recurse = true,
aaonly = false, nofail = true,
default_lookups = true, a_noanswer = false;
static isc_boolean_t short_form = ISC_TRUE,
tcpmode = ISC_FALSE, tcpmode_set = ISC_FALSE,
identify = ISC_FALSE, stats = ISC_TRUE,
comments = ISC_TRUE, section_question = ISC_TRUE,
section_answer = ISC_TRUE, section_authority = ISC_TRUE,
section_additional = ISC_TRUE, recurse = ISC_TRUE,
aaonly = ISC_FALSE, nofail = ISC_TRUE,
default_lookups = ISC_TRUE, a_noanswer = ISC_FALSE;
static bool interactive;
static isc_boolean_t interactive;
static bool in_use = false;
static isc_boolean_t in_use = ISC_FALSE;
static char defclass[MXRD] = "IN";
static char deftype[MXRD] = "A";
static isc_event_t *global_event = NULL;
@@ -215,7 +213,7 @@ printrdata(dns_rdata_t *rdata) {
isc_result_t result;
isc_buffer_t *b = NULL;
unsigned int size = 1024;
bool done = false;
isc_boolean_t done = ISC_FALSE;
if (rdata->type < N_KNOWN_RRTYPES)
printf("%s", rtypetext[rdata->type]);
@@ -230,7 +228,7 @@ printrdata(dns_rdata_t *rdata) {
if (result == ISC_R_SUCCESS) {
printf("%.*s\n", (int)isc_buffer_usedlength(b),
(char *)isc_buffer_base(b));
done = true;
done = ISC_TRUE;
} else if (result != ISC_R_NOSPACE)
check_result(result, "dns_rdata_totext");
isc_buffer_free(&b);
@@ -239,7 +237,7 @@ printrdata(dns_rdata_t *rdata) {
}
static isc_result_t
printsection(dig_query_t *query, dns_message_t *msg, bool headers,
printsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers,
dns_section_t section) {
isc_result_t result, loopresult;
dns_name_t *name;
@@ -306,7 +304,7 @@ printsection(dig_query_t *query, dns_message_t *msg, bool headers,
}
static isc_result_t
detailsection(dig_query_t *query, dns_message_t *msg, bool headers,
detailsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers,
dns_section_t section) {
isc_result_t result, loopresult;
dns_name_t *name;
@@ -431,7 +429,7 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
}
static isc_result_t
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
char servtext[ISC_SOCKADDR_FORMATSIZE];
/* I've we've gotten this far, we've reached a server. */
@@ -450,10 +448,10 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
if (!short_form) {
puts("------------");
/* detailheader(query, msg);*/
detailsection(query, msg, true, DNS_SECTION_QUESTION);
detailsection(query, msg, true, DNS_SECTION_ANSWER);
detailsection(query, msg, true, DNS_SECTION_AUTHORITY);
detailsection(query, msg, true, DNS_SECTION_ADDITIONAL);
detailsection(query, msg, ISC_TRUE, DNS_SECTION_QUESTION);
detailsection(query, msg, ISC_TRUE, DNS_SECTION_ANSWER);
detailsection(query, msg, ISC_TRUE, DNS_SECTION_AUTHORITY);
detailsection(query, msg, ISC_TRUE, DNS_SECTION_ADDITIONAL);
puts("------------");
}
@@ -481,12 +479,12 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
dns_name_copy(query->lookup->name, name, NULL);
chase_cnamechain(msg, name);
dns_name_format(name, namestr, sizeof(namestr));
lookup = clone_lookup(query->lookup, false);
lookup = clone_lookup(query->lookup, ISC_FALSE);
if (lookup != NULL) {
strlcpy(lookup->textname, namestr,
sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_aaaa;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
lookup->origin = NULL;
lookup->retries = tries;
ISC_LIST_APPEND(lookup_list, lookup, link);
@@ -500,7 +498,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
printsection(query, msg, headers, DNS_SECTION_ANSWER);
else {
if (default_lookups && query->lookup->rdtype == dns_rdatatype_a)
a_noanswer = true;
a_noanswer = ISC_TRUE;
else if (!default_lookups ||
(query->lookup->rdtype == dns_rdatatype_aaaa &&
@@ -522,7 +520,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
}
static void
show_settings(bool full, bool serv_only) {
show_settings(isc_boolean_t full, isc_boolean_t serv_only) {
dig_server_t *srv;
isc_sockaddr_t sockaddr;
dig_searchlist_t *listent;
@@ -567,7 +565,7 @@ show_settings(bool full, bool serv_only) {
printf("\n");
}
static bool
static isc_boolean_t
testtype(char *typetext) {
isc_result_t result;
isc_textregion_t tr;
@@ -577,14 +575,14 @@ testtype(char *typetext) {
tr.length = strlen(typetext);
result = dns_rdatatype_fromtext(&rdtype, &tr);
if (result == ISC_R_SUCCESS)
return (true);
return (ISC_TRUE);
else {
printf("unknown query type: %s\n", typetext);
return (false);
return (ISC_FALSE);
}
}
static bool
static isc_boolean_t
testclass(char *typetext) {
isc_result_t result;
isc_textregion_t tr;
@@ -594,24 +592,24 @@ testclass(char *typetext) {
tr.length = strlen(typetext);
result = dns_rdataclass_fromtext(&rdclass, &tr);
if (result == ISC_R_SUCCESS)
return (true);
return (ISC_TRUE);
else {
printf("unknown query class: %s\n", typetext);
return (false);
return (ISC_FALSE);
}
}
static void
set_port(const char *value) {
uint32_t n;
isc_uint32_t n;
isc_result_t result = parse_uint(&n, value, 65535, "port");
if (result == ISC_R_SUCCESS)
port = (uint16_t) n;
port = (isc_uint16_t) n;
}
static void
set_timeout(const char *value) {
uint32_t n;
isc_uint32_t n;
isc_result_t result = parse_uint(&n, value, UINT_MAX, "timeout");
if (result == ISC_R_SUCCESS)
timeout = n;
@@ -619,7 +617,7 @@ set_timeout(const char *value) {
static void
set_tries(const char *value) {
uint32_t n;
isc_uint32_t n;
isc_result_t result = parse_uint(&n, value, INT_MAX, "tries");
if (result == ISC_R_SUCCESS)
tries = n;
@@ -627,7 +625,7 @@ set_tries(const char *value) {
static void
set_ndots(const char *value) {
uint32_t n;
isc_uint32_t n;
isc_result_t result = parse_uint(&n, value, 128, "ndots");
if (result == ISC_R_SUCCESS)
ndots = n;
@@ -646,7 +644,7 @@ setoption(char *opt) {
((l >= N) && (l < sizeof(A)) && (strncasecmp(opt, A, l) == 0))
if (CHECKOPT("all", 3)) {
show_settings(true, false);
show_settings(ISC_TRUE, ISC_FALSE);
} else if (strncasecmp(opt, "class=", 6) == 0) {
if (testclass(&opt[6]))
strlcpy(defclass, &opt[6], sizeof(defclass));
@@ -656,41 +654,41 @@ setoption(char *opt) {
} else if (strncasecmp(opt, "type=", 5) == 0) {
if (testtype(&opt[5])) {
strlcpy(deftype, &opt[5], sizeof(deftype));
default_lookups = false;
default_lookups = ISC_FALSE;
}
} else if (strncasecmp(opt, "ty=", 3) == 0) {
if (testtype(&opt[3])) {
strlcpy(deftype, &opt[3], sizeof(deftype));
default_lookups = false;
default_lookups = ISC_FALSE;
}
} else if (strncasecmp(opt, "querytype=", 10) == 0) {
if (testtype(&opt[10])) {
strlcpy(deftype, &opt[10], sizeof(deftype));
default_lookups = false;
default_lookups = ISC_FALSE;
}
} else if (strncasecmp(opt, "query=", 6) == 0) {
if (testtype(&opt[6])) {
strlcpy(deftype, &opt[6], sizeof(deftype));
default_lookups = false;
default_lookups = ISC_FALSE;
}
} else if (strncasecmp(opt, "qu=", 3) == 0) {
if (testtype(&opt[3])) {
strlcpy(deftype, &opt[3], sizeof(deftype));
default_lookups = false;
default_lookups = ISC_FALSE;
}
} else if (strncasecmp(opt, "q=", 2) == 0) {
if (testtype(&opt[2])) {
strlcpy(deftype, &opt[2], sizeof(deftype));
default_lookups = false;
default_lookups = ISC_FALSE;
}
} else if (strncasecmp(opt, "domain=", 7) == 0) {
strlcpy(domainopt, &opt[7], sizeof(domainopt));
set_search_domain(domainopt);
usesearch = true;
usesearch = ISC_TRUE;
} else if (strncasecmp(opt, "do=", 3) == 0) {
strlcpy(domainopt, &opt[3], sizeof(domainopt));
set_search_domain(domainopt);
usesearch = true;
usesearch = ISC_TRUE;
} else if (strncasecmp(opt, "port=", 5) == 0) {
set_port(&opt[5]);
} else if (strncasecmp(opt, "po=", 3) == 0) {
@@ -700,43 +698,43 @@ setoption(char *opt) {
} else if (strncasecmp(opt, "t=", 2) == 0) {
set_timeout(&opt[2]);
} else if (CHECKOPT("recurse", 3)) {
recurse = true;
recurse = ISC_TRUE;
} else if (CHECKOPT("norecurse", 5)) {
recurse = false;
recurse = ISC_FALSE;
} else if (strncasecmp(opt, "retry=", 6) == 0) {
set_tries(&opt[6]);
} else if (strncasecmp(opt, "ret=", 4) == 0) {
set_tries(&opt[4]);
} else if (CHECKOPT("defname", 3)) {
usesearch = true;
usesearch = ISC_TRUE;
} else if (CHECKOPT("nodefname", 5)) {
usesearch = false;
usesearch = ISC_FALSE;
} else if (CHECKOPT("vc", 2)) {
tcpmode = true;
tcpmode_set = true;
tcpmode = ISC_TRUE;
tcpmode_set = ISC_TRUE;
} else if (CHECKOPT("novc", 4)) {
tcpmode = false;
tcpmode_set = true;
tcpmode = ISC_FALSE;
tcpmode_set = ISC_TRUE;
} else if (CHECKOPT("debug", 3)) {
short_form = false;
showsearch = true;
short_form = ISC_FALSE;
showsearch = ISC_TRUE;
} else if (CHECKOPT("nodebug", 5)) {
short_form = true;
showsearch = false;
short_form = ISC_TRUE;
showsearch = ISC_FALSE;
} else if (CHECKOPT("d2", 2)) {
debugging = true;
debugging = ISC_TRUE;
} else if (CHECKOPT("nod2", 4)) {
debugging = false;
debugging = ISC_FALSE;
} else if (CHECKOPT("search", 3)) {
usesearch = true;
usesearch = ISC_TRUE;
} else if (CHECKOPT("nosearch", 5)) {
usesearch = false;
usesearch = ISC_FALSE;
} else if (CHECKOPT("sil", 3)) {
/* deprecation_msg = false; */
/* deprecation_msg = ISC_FALSE; */
} else if (CHECKOPT("fail", 3)) {
nofail=false;
nofail=ISC_FALSE;
} else if (CHECKOPT("nofail", 5)) {
nofail=true;
nofail=ISC_TRUE;
} else if (strncasecmp(opt, "ndots=", 6) == 0) {
set_ndots(&opt[6]);
} else {
@@ -755,7 +753,7 @@ addlookup(char *opt) {
debug("addlookup()");
a_noanswer = false;
a_noanswer = ISC_FALSE;
tr.base = deftype;
tr.length = strlen(deftype);
@@ -772,21 +770,21 @@ addlookup(char *opt) {
rdclass = dns_rdataclass_in;
}
lookup = make_empty_lookup();
if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, true)
if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, ISC_TRUE)
== ISC_R_SUCCESS) {
strlcpy(lookup->textname, store, sizeof(lookup->textname));
lookup->rdtype = dns_rdatatype_ptr;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
} else {
strlcpy(lookup->textname, opt, sizeof(lookup->textname));
lookup->rdtype = rdtype;
lookup->rdtypeset = true;
lookup->rdtypeset = ISC_TRUE;
}
lookup->rdclass = rdclass;
lookup->rdclassset = true;
lookup->trace = false;
lookup->rdclassset = ISC_TRUE;
lookup->trace = ISC_FALSE;
lookup->trace_root = lookup->trace;
lookup->ns_search_only = false;
lookup->ns_search_only = ISC_FALSE;
lookup->identify = identify;
lookup->recurse = recurse;
lookup->aaonly = aaonly;
@@ -794,7 +792,7 @@ addlookup(char *opt) {
lookup->udpsize = 0;
lookup->comments = comments;
if (lookup->rdtype == dns_rdatatype_any && !tcpmode_set)
lookup->tcp_mode = true;
lookup->tcp_mode = ISC_TRUE;
else
lookup->tcp_mode = tcpmode;
lookup->stats = stats;
@@ -802,9 +800,9 @@ addlookup(char *opt) {
lookup->section_answer = section_answer;
lookup->section_authority = section_authority;
lookup->section_additional = section_additional;
lookup->new_search = true;
lookup->new_search = ISC_TRUE;
if (nofail)
lookup->servfail_stops = false;
lookup->servfail_stops = ISC_FALSE;
ISC_LIST_INIT(lookup->q);
ISC_LINK_INIT(lookup, link);
ISC_LIST_APPEND(lookup_list, lookup, link);
@@ -828,11 +826,11 @@ do_next_command(char *input) {
(strcasecmp(ptr, "lserver") == 0)) {
isc_app_block();
set_nameserver(arg);
check_ra = false;
check_ra = ISC_FALSE;
isc_app_unblock();
show_settings(true, true);
show_settings(ISC_TRUE, ISC_TRUE);
} else if (strcasecmp(ptr, "exit") == 0) {
in_use = false;
in_use = ISC_FALSE;
} else if (strcasecmp(ptr, "help") == 0 ||
strcasecmp(ptr, "?") == 0) {
printf("The '%s' command is not yet implemented.\n", ptr);
@@ -869,7 +867,7 @@ get_next_command(void) {
ptr = fgets(buf, COMMSIZE, stdin);
isc_app_unblock();
if (ptr == NULL) {
in_use = false;
in_use = ISC_FALSE;
} else
do_next_command(ptr);
#ifdef HAVE_READLINE
@@ -879,29 +877,12 @@ get_next_command(void) {
isc_mem_free(mctx, buf);
}
ISC_PLATFORM_NORETURN_PRE static void
usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
fprintf(stderr, "Usage:\n");
fprintf(stderr,
" nslookup [-opt ...] # interactive mode using default server\n");
fprintf(stderr,
" nslookup [-opt ...] - server # interactive mode using 'server'\n");
fprintf(stderr,
" nslookup [-opt ...] host # just look up 'host' using default server\n");
fprintf(stderr,
" nslookup [-opt ...] host server # just look up 'host' using 'server'\n");
exit(1);
}
static void
parse_args(int argc, char **argv) {
bool have_lookup = false;
isc_boolean_t have_lookup = ISC_FALSE;
usesearch = true;
for (argc--, argv++; argc > 0 && argv[0] != NULL; argc--, argv++) {
usesearch = ISC_TRUE;
for (argc--, argv++; argc > 0; argc--, argv++) {
debug("main parsing %s", argv[0]);
if (argv[0][0] == '-') {
if (strncasecmp(argv[0], "-ver", 4) == 0) {
@@ -910,18 +891,15 @@ parse_args(int argc, char **argv) {
} else if (argv[0][1] != 0) {
setoption(&argv[0][1]);
} else
have_lookup = true;
have_lookup = ISC_TRUE;
} else {
if (!have_lookup) {
have_lookup = true;
in_use = true;
have_lookup = ISC_TRUE;
in_use = ISC_TRUE;
addlookup(argv[0]);
} else {
if (argv[1] != NULL) {
usage();
}
set_nameserver(argv[0]);
check_ra = false;
check_ra = ISC_FALSE;
}
}
}
@@ -992,13 +970,13 @@ int
main(int argc, char **argv) {
isc_result_t result;
interactive = isatty(0);
interactive = ISC_TF(isatty(0));
ISC_LIST_INIT(lookup_list);
ISC_LIST_INIT(server_list);
ISC_LIST_INIT(search_list);
check_ra = true;
check_ra = ISC_TRUE;
/* setup dighost callbacks */
dighost_printmessage = printmessage;
@@ -1012,7 +990,7 @@ main(int argc, char **argv) {
setup_libs();
progname = argv[0];
setup_system(false, false);
setup_system(ISC_FALSE, ISC_FALSE);
parse_args(argc, argv);
if (keyfile[0] != 0)
setup_file_key();
@@ -1026,7 +1004,7 @@ main(int argc, char **argv) {
else
result = isc_app_onrun(mctx, global_task, getinput, NULL);
check_result(result, "isc_app_onrun");
in_use = !in_use;
in_use = ISC_TF(!in_use);
(void)isc_app_run();
-17
View File
@@ -71,7 +71,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
@@ -479,22 +478,6 @@ nslookup -query=hinfo -timeout=10
</para>
</refsection>
<refsection><info><title>IDN SUPPORT</title></info>
<para>
If <command>nslookup</command> has been built with IDN (internationalized
domain name) support, it can accept and display non-ASCII domain names.
<command>nslookup</command> appropriately converts character encoding of
domain name before sending a request to DNS server or displaying a
reply from the server.
If you'd like to turn off the IDN support for some reason, define
the <envar>IDN_DISABLE</envar> environment variable.
The IDN support is disabled if the variable is set when
<command>nslookup</command> runs or when the standard output is not
a tty.
</para>
</refsection>
<refsection><info><title>FILES</title></info>
<para><filename>/etc/resolv.conf</filename>
+4 -4
View File
@@ -116,12 +116,12 @@ installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
install:: ${TARGETS} installdirs
for t in ${TARGETS}; do ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} $$t ${DESTDIR}${sbindir} || exit 1; done
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8 || exit 1; done
for t in ${TARGETS}; do ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} $$t ${DESTDIR}${sbindir}; done
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8; done
uninstall::
for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m || exit 1; done
for t in ${TARGETS}; do ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/$$t || exit 1; done
for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m ; done
for t in ${TARGETS}; do ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/$$t ; done
clean distclean::
rm -f ${TARGETS}
+52 -48
View File
@@ -19,8 +19,6 @@
#include <config.h>
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -88,7 +86,7 @@ static dns_rdataclass_t rdclass = dns_rdataclass_in;
* List of digest types used by ds_from_cdnskey(), filled in by add_dtype()
* from -a arguments. The size of the array is an arbitrary limit.
*/
static uint8_t dtype[8];
static isc_uint8_t dtype[8];
static const char *startstr = NULL; /* from which we derive notbefore */
static isc_stdtime_t notbefore = 0; /* restrict sig inception times */
@@ -131,7 +129,7 @@ static int nkey; /* number of child zone DNSKEY records */
typedef struct keyinfo {
dns_rdata_t rdata;
dst_key_t *dst;
uint8_t algo;
isc_uint8_t algo;
dns_keytag_t tag;
} keyinfo_t;
@@ -165,8 +163,8 @@ verbose_time(int level, const char *msg, isc_stdtime_t time) {
if (verbose < 3) {
vbprintf(level, "%s %s\n", msg, timestr);
} else {
vbprintf(level, "%s %s (%" PRIu32 ")\n",
msg, timestr, time);
vbprintf(level, "%s %s (%lld)\n",
msg, timestr, (long long)time);
}
}
@@ -262,7 +260,7 @@ load_db(const char *filename, dns_db_t **dbp, dns_dbnode_t **nodep) {
isc_result_totext(result));
}
result = dns_db_findnode(*dbp, name, false, nodep);
result = dns_db_findnode(*dbp, name, ISC_FALSE, nodep);
if (result != ISC_R_SUCCESS) {
fatal("can't find %s node in %s", namestr, filename);
}
@@ -316,7 +314,7 @@ get_dsset_name(char *filename, size_t size,
}
isc_buffer_putstr(&buf, prefix);
result = dns_name_tofilenametext(name, false, &buf);
result = dns_name_tofilenametext(name, ISC_FALSE, &buf);
check_result(result, "dns_name_tofilenametext()");
if (isc_buffer_availablelength(&buf) == 0) {
fatal("%s: pathname too long", path);
@@ -404,7 +402,7 @@ formatset(dns_rdataset_t *rdataset) {
static void
write_parent_set(const char *path, const char *inplace,
bool nsupdate, dns_rdataset_t *rdataset)
isc_boolean_t nsupdate, dns_rdataset_t *rdataset)
{
isc_result_t result;
isc_buffer_t *buf = NULL;
@@ -471,7 +469,7 @@ typedef enum { LOOSE, TIGHT } strictness_t;
/*
* Find out if any (C)DS record matches a particular (C)DNSKEY.
*/
static bool
static isc_boolean_t
match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
{
isc_result_t result;
@@ -484,7 +482,8 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
dns_rdata_ds_t ds;
dns_rdata_t dsrdata = DNS_RDATA_INIT;
dns_rdata_t newdsrdata = DNS_RDATA_INIT;
bool c;
dns_rdatatype_t keytype;
isc_boolean_t c;
dns_rdataset_current(dsset, &dsrdata);
result = dns_rdata_tostruct(&dsrdata, &ds, NULL);
@@ -494,8 +493,12 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
continue;
}
/* allow for both DNSKEY and CDNSKEY */
keytype = ki->rdata.type;
ki->rdata.type = dns_rdatatype_dnskey;
result = dns_ds_buildrdata(name, &ki->rdata, ds.digest_type,
dsbuf, &newdsrdata);
ki->rdata.type = keytype;
if (result != ISC_R_SUCCESS) {
vbprintf(3, "dns_ds_buildrdata("
"keytag=%d, algo=%d, digest=%d): %s\n",
@@ -510,13 +513,13 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
vbprintf(1, "found matching %s %d %d %d\n",
c ? "CDS" : "DS",
ds.key_tag, ds.algorithm, ds.digest_type);
return (true);
return (ISC_TRUE);
} else if (strictness == TIGHT) {
vbprintf(0, "key does not match %s %d %d %d "
"when it looks like it should\n",
c ? "CDS" : "DS",
ds.key_tag, ds.algorithm, ds.digest_type);
return (false);
return (ISC_FALSE);
}
}
@@ -527,7 +530,7 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
? "CDNSKEY" : "DNSKEY",
ki->tag, ki->algo);
return (false);
return (ISC_FALSE);
}
/*
@@ -616,12 +619,12 @@ free_keytable(keyinfo_t **keytable_p) {
* otherwise the key algorithm. This is used by the signature coverage
* check functions below.
*/
static uint8_t *
static isc_uint8_t *
matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
dns_rdataset_t *sigset)
{
isc_result_t result;
uint8_t *algo;
isc_uint8_t *algo;
int i;
algo = isc_mem_get(mctx, nkey);
@@ -667,7 +670,7 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
}
result = dns_dnssec_verify(name, rdataset, ki->dst,
false, mctx, &sigrdata);
ISC_FALSE, mctx, &sigrdata);
if (result != ISC_R_SUCCESS) {
vbprintf(1, "skip RRSIG by key %d:"
" verification failed: %s\n",
@@ -700,13 +703,13 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
* Consume the result of matching_sigs(). When checking records
* fetched from the child zone, any working signature is enough.
*/
static bool
signed_loose(uint8_t *algo) {
bool ok = false;
static isc_boolean_t
signed_loose(isc_uint8_t *algo) {
isc_boolean_t ok = ISC_FALSE;
int i;
for (i = 0; i < nkey; i++) {
if (algo[i] != 0) {
ok = true;
ok = ISC_TRUE;
}
}
isc_mem_put(mctx, algo, nkey);
@@ -719,10 +722,10 @@ signed_loose(uint8_t *algo) {
* key algorithm in the DS RRset must have a signature in the DNSKEY
* RRset.
*/
static bool
signed_strict(dns_rdataset_t *dsset, uint8_t *algo) {
static isc_boolean_t
signed_strict(dns_rdataset_t *dsset, isc_uint8_t *algo) {
isc_result_t result;
bool all_ok = true;
isc_boolean_t all_ok = ISC_TRUE;
for (result = dns_rdataset_first(dsset);
result == ISC_R_SUCCESS;
@@ -730,23 +733,23 @@ signed_strict(dns_rdataset_t *dsset, uint8_t *algo) {
{
dns_rdata_t dsrdata = DNS_RDATA_INIT;
dns_rdata_ds_t ds;
bool ds_ok;
isc_boolean_t ds_ok;
int i;
dns_rdataset_current(dsset, &dsrdata);
result = dns_rdata_tostruct(&dsrdata, &ds, NULL);
check_result(result, "dns_rdata_tostruct(DS)");
ds_ok = false;
ds_ok = ISC_FALSE;
for (i = 0; i < nkey; i++) {
if (algo[i] == ds.algorithm) {
ds_ok = true;
ds_ok = ISC_TRUE;
}
}
if (!ds_ok) {
vbprintf(0, "missing signature for algorithm %d "
"(key %d)\n", ds.algorithm, ds.key_tag);
all_ok = false;
all_ok = ISC_FALSE;
}
}
@@ -820,6 +823,7 @@ ds_from_cdnskey(dns_rdatalist_t *dslist, isc_buffer_t *buf,
return (ISC_R_NOSPACE);
}
cdnskey->type = dns_rdatatype_dnskey;
rdata = rdata_get();
result = dns_ds_buildrdata(name, cdnskey, dtype[i],
r.base, rdata);
@@ -843,14 +847,14 @@ ds_from_cdnskey(dns_rdatalist_t *dslist, isc_buffer_t *buf,
*/
static int
cmp_dtype(const void *ap, const void *bp) {
int a = *(const uint8_t *)ap;
int b = *(const uint8_t *)bp;
int a = *(const isc_uint8_t *)ap;
int b = *(const isc_uint8_t *)bp;
return (a - b);
}
static void
add_dtype(const char *dn) {
uint8_t dt;
isc_uint8_t dt;
unsigned i, n;
dt = strtodsdigest(dn);
@@ -867,7 +871,7 @@ add_dtype(const char *dn) {
static void
make_new_ds_set(ds_maker_func_t *ds_from_rdata,
uint32_t ttl, dns_rdataset_t *rdset)
isc_uint32_t ttl, dns_rdataset_t *rdset)
{
unsigned int size = 16;
for (;;) {
@@ -929,14 +933,14 @@ rdata_cmp(const void *rdata1, const void *rdata2) {
* Ensure that every key identified by the DS RRset has the same set of
* digest types.
*/
static bool
static isc_boolean_t
consistent_digests(dns_rdataset_t *dsset) {
isc_result_t result;
dns_rdata_t *arrdata;
dns_rdata_ds_t *ds;
dns_keytag_t key_tag;
uint8_t algorithm;
bool match;
isc_uint8_t algorithm;
isc_boolean_t match;
int i, j, n, d;
/*
@@ -990,7 +994,7 @@ consistent_digests(dns_rdataset_t *dsset) {
/*
* Check subsequent keys match the first one
*/
match = true;
match = ISC_TRUE;
while (i < n) {
key_tag = ds[i].key_tag;
algorithm = ds[i].algorithm;
@@ -999,7 +1003,7 @@ consistent_digests(dns_rdataset_t *dsset) {
ds[i+j].algorithm != algorithm ||
ds[i+j].digest_type != ds[j].digest_type)
{
match = false;
match = ISC_FALSE;
}
}
i += d;
@@ -1034,7 +1038,7 @@ print_diff(const char *cmd, dns_rdataset_t *rdataset) {
}
static void
update_diff(const char *cmd, uint32_t ttl,
update_diff(const char *cmd, isc_uint32_t ttl,
dns_rdataset_t *addset, dns_rdataset_t *delset)
{
isc_result_t result;
@@ -1042,7 +1046,7 @@ update_diff(const char *cmd, uint32_t ttl,
dns_dbnode_t *node;
dns_dbversion_t *ver;
dns_rdataset_t diffset;
uint32_t save;
isc_uint32_t save;
db = NULL;
result = dns_db_create(mctx, "rbt", name, dns_dbtype_zone,
@@ -1054,7 +1058,7 @@ update_diff(const char *cmd, uint32_t ttl,
check_result(result, "dns_db_newversion()");
node = NULL;
result = dns_db_findnode(db, name, true, &node);
result = dns_db_findnode(db, name, ISC_TRUE, &node);
check_result(result, "dns_db_findnode()");
dns_rdataset_init(&diffset);
@@ -1078,12 +1082,12 @@ update_diff(const char *cmd, uint32_t ttl,
}
dns_db_detachnode(db, &node);
dns_db_closeversion(db, &ver, false);
dns_db_closeversion(db, &ver, ISC_FALSE);
dns_db_detach(&db);
}
static void
nsdiff(uint32_t ttl, dns_rdataset_t *oldset, dns_rdataset_t *newset) {
nsdiff(isc_uint32_t ttl, dns_rdataset_t *oldset, dns_rdataset_t *newset) {
if (ttl == 0) {
vbprintf(1, "warning: no TTL in nsupdate script\n");
}
@@ -1131,9 +1135,9 @@ main(int argc, char *argv[]) {
const char *ds_path = NULL;
const char *inplace = NULL;
isc_result_t result;
bool prefer_cdnskey = false;
bool nsupdate = false;
uint32_t ttl = 0;
isc_boolean_t prefer_cdnskey = ISC_FALSE;
isc_boolean_t nsupdate = ISC_FALSE;
isc_uint32_t ttl = 0;
int ch;
char *endp;
@@ -1147,7 +1151,7 @@ main(int argc, char *argv[]) {
#endif
dns_result_register();
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
#define OPTIONS "a:c:Dd:f:i:ms:T:uv:V"
while ((ch = isc_commandline_parse(argc, argv, OPTIONS)) != -1) {
@@ -1159,7 +1163,7 @@ main(int argc, char *argv[]) {
rdclass = strtoclass(isc_commandline_argument);
break;
case 'D':
prefer_cdnskey = true;
prefer_cdnskey = ISC_TRUE;
break;
case 'd':
ds_path = isc_commandline_argument;
@@ -1192,7 +1196,7 @@ main(int argc, char *argv[]) {
ttl = strtottl(isc_commandline_argument);
break;
case 'u':
nsupdate = true;
nsupdate = ISC_TRUE;
break;
case 'V':
/* Does not return. */
+3 -4
View File
@@ -40,7 +40,6 @@
<copyright>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
@@ -144,9 +143,9 @@
record. This option has no effect when using CDS records.
</para>
<para>
The <replaceable>algorithm</replaceable> must be one of SHA-1,
SHA-256, SHA-384, or GOST. These values are case insensitive,
and hyphens may be omitted. If no algorithm is specified,
The <replaceable>algorithm</replaceable> must be one of SHA-1
(SHA1), SHA-256 (SHA256), GOST, or SHA-384 (SHA384). These
values are case insensitive. If no algorithm is specified,
the default is SHA-256.
</para>
</listitem>
+43 -42
View File
@@ -13,8 +13,6 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -61,8 +59,8 @@ static dns_rdataclass_t rdclass;
static dns_fixedname_t fixed;
static dns_name_t *name = NULL;
static isc_mem_t *mctx = NULL;
static uint32_t ttl;
static bool emitttl = false;
static isc_uint32_t ttl;
static isc_boolean_t emitttl = ISC_FALSE;
static isc_result_t
initname(char *setname) {
@@ -121,7 +119,7 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
isc_result_totext(result));
}
result = dns_db_findnode(db, name, false, &node);
result = dns_db_findnode(db, name, ISC_FALSE, &node);
if (result != ISC_R_SUCCESS)
fatal("can't find %s node in %s", setname, filename);
@@ -162,7 +160,7 @@ loadkeyset(char *dirname, dns_rdataset_t *rdataset) {
return (ISC_R_NOSPACE);
isc_buffer_putstr(&buf, "keyset-");
result = dns_name_tofilenametext(name, false, &buf);
result = dns_name_tofilenametext(name, ISC_FALSE, &buf);
check_result(result, "dns_name_tofilenametext()");
if (isc_buffer_availablelength(&buf) == 0)
return (ISC_R_NOSPACE);
@@ -236,8 +234,8 @@ logkey(dns_rdata_t *rdata)
}
static void
emit(unsigned int dtype, bool showall, char *lookaside,
bool cds, dns_rdata_t *rdata)
emit(unsigned int dtype, isc_boolean_t showall, char *lookaside,
isc_boolean_t cds, dns_rdata_t *rdata)
{
isc_result_t result;
unsigned char buf[DNS_DS_BUFFERSIZE];
@@ -266,7 +264,7 @@ emit(unsigned int dtype, bool showall, char *lookaside,
if (result != ISC_R_SUCCESS)
fatal("can't build record");
result = dns_name_totext(name, false, &nameb);
result = dns_name_totext(name, ISC_FALSE, &nameb);
if (result != ISC_R_SUCCESS)
fatal("can't print name");
@@ -319,27 +317,30 @@ usage(void) ISC_PLATFORM_NORETURN_POST;
static void
usage(void) {
fprintf(stderr, "Usage:\n");
fprintf(stderr, " %s [options] keyfile\n\n", program);
fprintf(stderr, " %s [options] -f zonefile [zonename]\n\n", program);
fprintf(stderr, " %s [options] -s dnsname\n\n", program);
fprintf(stderr, " %s [-h|-V]\n\n", program);
fprintf(stderr, " %s options [-K dir] keyfile\n\n", program);
fprintf(stderr, " %s options [-K dir] [-c class] -s dnsname\n\n",
program);
fprintf(stderr, " %s options -f zonefile (as zone name)\n\n", program);
fprintf(stderr, " %s options -f zonefile zonename\n\n", program);
fprintf(stderr, "Version: %s\n", VERSION);
fprintf(stderr, "Options:\n"
" -1: digest algorithm SHA-1\n"
" -2: digest algorithm SHA-256\n"
" -a algorithm: digest algorithm (SHA-1, SHA-256, SHA-384 or GOST)\n"
" -A: include all keys in DS set, not just KSKs (-f only)\n"
" -c class: rdata class for DS set (default IN) (-f or -s only)\n"
" -C: print CDS records\n"
" -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, DLV, or CDS RRs\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -v <verbose level>\n");
fprintf(stderr, " -V: print version information\n");
fprintf(stderr, " -K <directory>: directory in which to find "
"key file or keyset file\n");
fprintf(stderr, " -a algorithm: digest algorithm "
"(SHA-1, SHA-256, GOST or SHA-384)\n");
fprintf(stderr, " -1: use SHA-1\n");
fprintf(stderr, " -2: use SHA-256\n");
fprintf(stderr, " -C: print CDS record\n");
fprintf(stderr, " -l: add lookaside zone and print DLV records\n");
fprintf(stderr, " -s: read keyset from keyset-<dnsname> file\n");
fprintf(stderr, " -c class: rdata class for DS set (default: IN)\n");
fprintf(stderr, " -T TTL\n");
fprintf(stderr, " -f file: read keyset from zone file\n");
fprintf(stderr, " -A: when used with -f, "
"include all keys in DS set, not just KSKs\n");
fprintf(stderr, "Output: DS or DLV RRs\n");
exit (-1);
}
@@ -352,10 +353,10 @@ main(int argc, char **argv) {
char *endp;
int ch;
unsigned int dtype = DNS_DSDIGEST_SHA1;
bool cds = false;
bool both = true;
bool usekeyset = false;
bool showall = false;
isc_boolean_t cds = ISC_FALSE;
isc_boolean_t both = ISC_TRUE;
isc_boolean_t usekeyset = ISC_FALSE;
isc_boolean_t showall = ISC_FALSE;
isc_result_t result;
isc_log_t *log = NULL;
isc_entropy_t *ectx = NULL;
@@ -376,31 +377,31 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
#define OPTIONS "12Aa:Cc:d:Ff:K:l:sT:v:hV"
while ((ch = isc_commandline_parse(argc, argv, OPTIONS)) != -1) {
switch (ch) {
case '1':
dtype = DNS_DSDIGEST_SHA1;
both = false;
both = ISC_FALSE;
break;
case '2':
dtype = DNS_DSDIGEST_SHA256;
both = false;
both = ISC_FALSE;
break;
case 'A':
showall = true;
showall = ISC_TRUE;
break;
case 'a':
dtype = strtodsdigest(isc_commandline_argument);
both = false;
both = ISC_FALSE;
break;
case 'C':
if (lookaside != NULL)
fatal("lookaside and CDS are mutually"
" exclusive");
cds = true;
cds = ISC_TRUE;
break;
case 'c':
classname = isc_commandline_argument;
@@ -426,10 +427,10 @@ main(int argc, char **argv) {
fatal("lookaside must be a non-empty string");
break;
case 's':
usekeyset = true;
usekeyset = ISC_TRUE;
break;
case 'T':
emitttl = true;
emitttl = ISC_TRUE;
ttl = strtottl(isc_commandline_argument);
break;
case 'v':
@@ -467,7 +468,7 @@ main(int argc, char **argv) {
/* When not using -f, -A is implicit */
if (filename == NULL)
showall = true;
showall = ISC_TRUE;
if (argc < isc_commandline_index + 1 && filename == NULL)
fatal("the key file name was not specified");
+90 -154
View File
@@ -41,7 +41,6 @@
<year>2015</year>
<year>2016</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
@@ -49,108 +48,56 @@
<refsynopsisdiv>
<cmdsynopsis sepchar=" ">
<command>dnssec-dsfromkey</command>
<group choice="opt">
<arg choice="plain"><option>-1</option></arg>
<arg choice="plain"><option>-2</option></arg>
<arg choice="plain"><option>-a <replaceable class="parameter">alg</replaceable></option></arg>
</group>
<group>
<arg choice="plain" rep="norepeat"><option>-C</option></arg>
<arg choice="plain" rep="norepeat"><option>-l <replaceable class="parameter">domain</replaceable></option></arg>
</group>
<arg choice="opt" rep="norepeat"><option>-T <replaceable class="parameter">TTL</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-v <replaceable class="parameter">level</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-K <replaceable class="parameter">directory</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-1</option></arg>
<arg choice="opt" rep="norepeat"><option>-2</option></arg>
<arg choice="opt" rep="norepeat"><option>-a <replaceable class="parameter">alg</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-C</option></arg>
<arg choice="opt" rep="norepeat"><option>-l <replaceable class="parameter">domain</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-T <replaceable class="parameter">TTL</replaceable></option></arg>
<arg choice="req" rep="norepeat">keyfile</arg>
</cmdsynopsis>
<cmdsynopsis sepchar=" ">
<command>dnssec-dsfromkey</command>
<group choice="opt">
<arg choice="plain"><option>-1</option></arg>
<arg choice="plain"><option>-2</option></arg>
<arg choice="plain"><option>-a <replaceable class="parameter">alg</replaceable></option></arg>
</group>
<group>
<arg choice="plain" rep="norepeat"><option>-C</option></arg>
<arg choice="plain" rep="norepeat"><option>-l <replaceable class="parameter">domain</replaceable></option></arg>
</group>
<arg choice="opt" rep="norepeat"><option>-T <replaceable class="parameter">TTL</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-v <replaceable class="parameter">level</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">class</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-A</option></arg>
<arg choice="req" rep="norepeat"><option>-f <replaceable class="parameter">file</replaceable></option></arg>
<arg choice="opt" rep="norepeat">dnsname</arg>
</cmdsynopsis>
<cmdsynopsis sepchar=" ">
<command>dnssec-dsfromkey</command>
<group choice="opt">
<arg choice="plain"><option>-1</option></arg>
<arg choice="plain"><option>-2</option></arg>
<arg choice="plain"><option>-a <replaceable class="parameter">alg</replaceable></option></arg>
</group>
<group>
<arg choice="plain" rep="norepeat"><option>-C</option></arg>
<arg choice="plain" rep="norepeat"><option>-l <replaceable class="parameter">domain</replaceable></option></arg>
</group>
<arg choice="opt" rep="norepeat"><option>-T <replaceable class="parameter">TTL</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-v <replaceable class="parameter">level</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">class</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-K <replaceable class="parameter">directory</replaceable></option></arg>
<arg choice="req" rep="norepeat">-s</arg>
<arg choice="opt" rep="norepeat"><option>-1</option></arg>
<arg choice="opt" rep="norepeat"><option>-2</option></arg>
<arg choice="opt" rep="norepeat"><option>-a <replaceable class="parameter">alg</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-K <replaceable class="parameter">directory</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-l <replaceable class="parameter">domain</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-s</option></arg>
<arg choice="opt" rep="norepeat"><option>-c <replaceable class="parameter">class</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-T <replaceable class="parameter">TTL</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-f <replaceable class="parameter">file</replaceable></option></arg>
<arg choice="opt" rep="norepeat"><option>-A</option></arg>
<arg choice="opt" rep="norepeat"><option>-v <replaceable class="parameter">level</replaceable></option></arg>
<arg choice="req" rep="norepeat">dnsname</arg>
</cmdsynopsis>
</cmdsynopsis>
<cmdsynopsis sepchar=" ">
<command>dnssec-dsfromkey</command>
<group choice="opt">
<arg choice="plain" rep="norepeat"><option>-h</option></arg>
<arg choice="plain" rep="norepeat"><option>-V</option></arg>
</group>
</cmdsynopsis>
<arg choice="opt" rep="norepeat"><option>-h</option></arg>
<arg choice="opt" rep="norepeat"><option>-V</option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsection><info><title>DESCRIPTION</title></info>
<para>
The <command>dnssec-dsfromkey</command> command outputs DS (Delegation
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><command>dnssec-dsfromkey</command>
outputs the Delegation Signer (DS) resource record (RR), as defined in
RFC 3658 and RFC 4509, for the given key(s).
</para>
<para>
The input keys can be specified in a number of ways:
</para>
<para>
By default, <command>dnssec-dsfromkey</command> reads a key file
named like <filename>Knnnn.+aaa+iiiii.key</filename>, as generated
by <command>dnssec-keygen</command>.
</para>
<para>
With the <option>-f <replaceable>file</replaceable></option>
option, <command>dnssec-dsfromkey</command> reads keys from a zone file
or partial zone file (which can contain just the DNSKEY records).
</para>
<para>
With the <option>-s</option>
option, <command>dnssec-dsfromkey</command> reads
a <filename>keyset-</filename> file, as generated
by <command>dnssec-keygen</command> <option>-C</option>.
</para>
</refsection>
<refsection><info><title>OPTIONS</title></info>
<variablelist>
<varlistentry>
<term>-1</term>
<listitem>
<para>
An abbreviation for <option>-a SHA1</option>
Use SHA-1 as the digest algorithm (the default is to use
both SHA-1 and SHA-256).
</para>
</listitem>
</varlistentry>
@@ -159,7 +106,7 @@
<term>-2</term>
<listitem>
<para>
An abbreviation for <option>-a SHA-256</option>
Use SHA-256 as the digest algorithm.
</para>
</listitem>
</varlistentry>
@@ -168,49 +115,40 @@
<term>-a <replaceable class="parameter">algorithm</replaceable></term>
<listitem>
<para>
Specify a digest algorithm to use when converting DNSKEY
records to DS records. This option can be repeated, so
that multiple DS records are created for each DNSKEY
record.
</para>
<para>
The <replaceable>algorithm</replaceable> must be one of
SHA-1, SHA-256, or SHA-384. These values are case insensitive,
and the hyphen may be omitted. If no algorithm is specified,
the default is SHA-256.
Select the digest algorithm. The value of
<option>algorithm</option> must be one of SHA-1 (SHA1),
SHA-256 (SHA256), GOST or SHA-384 (SHA384).
These values are case insensitive.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-A</term>
<listitem>
<para>
Include ZSKs when generating DS records. Without this option, only
keys which have the KSK flag set will be converted to DS records
and printed. Useful only in <option>-f</option> zone file mode.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-c <replaceable class="parameter">class</replaceable></term>
<listitem>
<para>
Specifies the DNS class (default is IN). Useful only
in <option>-s</option> keyset or <option>-f</option>
zone file mode.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-C</term>
<listitem>
<para>
Generate CDS records rather than DS records. This is mutually
exclusive with the <option>-l</option> option for generating DLV
records.
Generate CDS records rather than DS records. This is mutually
exclusive with generating lookaside records.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-T <replaceable class="parameter">TTL</replaceable></term>
<listitem>
<para>
Specifies the TTL of the DS records.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-K <replaceable class="parameter">directory</replaceable></term>
<listitem>
<para>
Look for key files (or, in keyset mode,
<filename>keyset-</filename> files) in
<option>directory</option>.
</para>
</listitem>
</varlistentry>
@@ -219,14 +157,13 @@
<term>-f <replaceable class="parameter">file</replaceable></term>
<listitem>
<para>
Zone file mode: <command>dnssec-dsfromkey</command>'s
final <replaceable>dnsname</replaceable> argument is
the DNS domain name of a zone whose master file can be read
Zone file mode: in place of the keyfile name, the argument is
the DNS domain name of a zone master file, which can be read
from <option>file</option>. If the zone name is the same as
<option>file</option>, then it may be omitted.
</para>
<para>
If <replaceable>file</replaceable> is <literal>"-"</literal>, then
If <option>file</option> is set to <literal>"-"</literal>, then
the zone data is read from the standard input. This makes it
possible to use the output of the <command>dig</command>
command as input, as in:
@@ -238,33 +175,26 @@
</varlistentry>
<varlistentry>
<term>-h</term>
<listitem>
<para>
Prints usage information.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-K <replaceable class="parameter">directory</replaceable></term>
<listitem>
<para>
Look for key files or <filename>keyset-</filename> files in
<option>directory</option>.
</para>
</listitem>
<term>-A</term>
<listitem>
<para>
Include ZSKs when generating DS records. Without this option,
only keys which have the KSK flag set will be converted to DS
records and printed. Useful only in zone file mode.
</para>
</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
Generate a DLV set instead of a DS set. The specified
<option>domain</option> 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.
The DNSSEC Lookaside Validation (DLV) RR is described
in RFC 4431. This is mutually exclusive with generating
CDS records.
</para>
</listitem>
</varlistentry>
@@ -273,18 +203,18 @@
<term>-s</term>
<listitem>
<para>
Keyset mode: <command>dnssec-dsfromkey</command>'s
final <replaceable>dnsname</replaceable> argument is the DNS
domain name used to locate a <filename>keyset-</filename> file.
Keyset mode: in place of the keyfile name, the argument is
the DNS domain name of a keyset file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-T <replaceable class="parameter">TTL</replaceable></term>
<term>-c <replaceable class="parameter">class</replaceable></term>
<listitem>
<para>
Specifies the TTL of the DS records. By default the TTL is omitted.
Specifies the DNS class (default is IN). Useful only
in keyset or zone file mode.
</para>
</listitem>
</varlistentry>
@@ -298,6 +228,15 @@
</listitem>
</varlistentry>
<varlistentry>
<term>-h</term>
<listitem>
<para>
Prints usage information.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-V</term>
<listitem>
@@ -314,22 +253,21 @@
<para>
To build the SHA-256 DS RR from the
<userinput>Kexample.com.+003+26160</userinput>
keyfile name, you can issue the following command:
keyfile name, the following command would be issued:
</para>
<para><userinput>dnssec-dsfromkey -2 Kexample.com.+003+26160</userinput>
</para>
<para>
The command would print something like:
</para>
<para><userinput>example.com. IN DS 26160 5 2 3A1EADA7A74B8D0BA86726B0C227AA85AB8BBD2B2004F41A868A54F0C5EA0B94</userinput>
<para><userinput>example.com. IN DS 26160 5 2 3A1EADA7A74B8D0BA86726B0C227AA85AB8BBD2B2004F41A868A54F0 C5EA0B94</userinput>
</para>
</refsection>
<refsection><info><title>FILES</title></info>
<para>
The keyfile can be designated by the key identification
The keyfile can be designed by the key identification
<filename>Knnnn.+aaa+iiiii</filename> or the full file name
<filename>Knnnn.+aaa+iiiii.key</filename> as generated by
<refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>.
@@ -357,11 +295,9 @@
<refentrytitle>dnssec-signzone</refentrytitle><manvolnum>8</manvolnum>
</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).
<citetitle>RFC 3658</citetitle>,
<citetitle>RFC 4431</citetitle>.
<citetitle>RFC 4509</citetitle>.
</para>
</refsection>
+8 -9
View File
@@ -13,7 +13,6 @@
#include <config.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -60,13 +59,13 @@ static dns_rdataclass_t rdclass;
static dns_fixedname_t fixed;
static dns_name_t *name = NULL;
static isc_mem_t *mctx = NULL;
static bool setpub = false, setdel = false;
static bool setttl = false;
static isc_boolean_t setpub = ISC_FALSE, setdel = ISC_FALSE;
static isc_boolean_t setttl = ISC_FALSE;
static isc_stdtime_t pub = 0, del = 0;
static dns_ttl_t ttl = 0;
static isc_stdtime_t syncadd = 0, syncdel = 0;
static bool setsyncadd = false;
static bool setsyncdel = false;
static isc_boolean_t setsyncadd = ISC_FALSE;
static isc_boolean_t setsyncdel = ISC_FALSE;
static isc_result_t
initname(char *setname) {
@@ -126,7 +125,7 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
isc_result_totext(result));
}
result = dns_db_findnode(db, name, false, &node);
result = dns_db_findnode(db, name, ISC_FALSE, &node);
if (result != ISC_R_SUCCESS)
fatal("can't find %s node in %s", setname, filename);
@@ -228,7 +227,7 @@ emit(const char *dir, dns_rdata_t *rdata) {
dst_key_free(&tmp);
}
dst_key_setexternal(key, true);
dst_key_setexternal(key, ISC_TRUE);
if (setpub)
dst_key_settime(key, DST_TIME_PUBLISH, pub);
if (setdel)
@@ -318,7 +317,7 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
#define CMDLINE_FLAGS "D:f:hK:L:P:v:V"
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
@@ -349,7 +348,7 @@ main(int argc, char **argv) {
break;
case 'L':
ttl = strtottl(isc_commandline_argument);
setttl = true;
setttl = ISC_TRUE;
break;
case 'P':
/* -Psync ? */
-1
View File
@@ -38,7 +38,6 @@
<year>2015</year>
<year>2016</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+28 -30
View File
@@ -14,8 +14,6 @@
#include <config.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -137,9 +135,9 @@ main(int argc, char **argv) {
dst_key_t *key = NULL;
dns_fixedname_t fname;
dns_name_t *name;
uint16_t flags = 0, kskflag = 0, revflag = 0;
isc_uint16_t flags = 0, kskflag = 0, revflag = 0;
dns_secalg_t alg;
bool oldstyle = false;
isc_boolean_t oldstyle = ISC_FALSE;
isc_mem_t *mctx = NULL;
int ch;
int protocol = -1, signatory = 0;
@@ -157,20 +155,20 @@ main(int argc, char **argv) {
isc_stdtime_t inactive = 0, deltime = 0;
isc_stdtime_t now;
int prepub = -1;
bool setpub = false, setact = false;
bool setrev = false, setinact = false;
bool setdel = false, setttl = false;
bool unsetpub = false, unsetact = false;
bool unsetrev = false, unsetinact = false;
bool unsetdel = false;
bool genonly = false;
bool use_nsec3 = false;
bool avoid_collisions = true;
bool exact;
isc_boolean_t setpub = ISC_FALSE, setact = ISC_FALSE;
isc_boolean_t setrev = ISC_FALSE, setinact = ISC_FALSE;
isc_boolean_t setdel = ISC_FALSE, setttl = ISC_FALSE;
isc_boolean_t unsetpub = ISC_FALSE, unsetact = ISC_FALSE;
isc_boolean_t unsetrev = ISC_FALSE, unsetinact = ISC_FALSE;
isc_boolean_t unsetdel = ISC_FALSE;
isc_boolean_t genonly = ISC_FALSE;
isc_boolean_t use_nsec3 = ISC_FALSE;
isc_boolean_t avoid_collisions = ISC_TRUE;
isc_boolean_t exact;
unsigned char c;
isc_stdtime_t syncadd = 0, syncdel = 0;
bool unsetsyncadd = false, setsyncadd = false;
bool unsetsyncdel = false, setsyncdel = false;
isc_boolean_t unsetsyncadd = ISC_FALSE, setsyncadd = ISC_FALSE;
isc_boolean_t unsetsyncdel = ISC_FALSE, setsyncdel = ISC_FALSE;
if (argc == 1)
usage();
@@ -182,7 +180,7 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
isc_stdtime_get(&now);
@@ -190,13 +188,13 @@ main(int argc, char **argv) {
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (ch) {
case '3':
use_nsec3 = true;
use_nsec3 = ISC_TRUE;
break;
case 'a':
algname = isc_commandline_argument;
break;
case 'C':
oldstyle = true;
oldstyle = ISC_TRUE;
break;
case 'c':
classname = isc_commandline_argument;
@@ -226,7 +224,7 @@ main(int argc, char **argv) {
break;
case 'L':
ttl = strtottl(isc_commandline_argument);
setttl = true;
setttl = ISC_TRUE;
break;
case 'l':
label = isc_mem_strdup(mctx, isc_commandline_argument);
@@ -249,10 +247,10 @@ main(int argc, char **argv) {
fatal("-v must be followed by a number");
break;
case 'y':
avoid_collisions = false;
avoid_collisions = ISC_FALSE;
break;
case 'G':
genonly = true;
genonly = ISC_TRUE;
break;
case 'P':
/* -Psync ? */
@@ -467,14 +465,14 @@ main(int argc, char **argv) {
"prepublication interval.");
if (!setpub && !setact) {
setpub = setact = true;
setpub = setact = ISC_TRUE;
publish = now;
activate = now + prepub;
} else if (setpub && !setact) {
setact = true;
setact = ISC_TRUE;
activate = publish + prepub;
} else if (setact && !setpub) {
setpub = true;
setpub = ISC_TRUE;
publish = activate - prepub;
}
@@ -562,7 +560,7 @@ main(int argc, char **argv) {
"You can use dnssec-settime -D to "
"change this.\n", program, keystr);
setpub = setact = true;
setpub = setact = ISC_TRUE;
}
if (nametype == NULL) {
@@ -672,10 +670,10 @@ main(int argc, char **argv) {
if (setdel)
dst_key_settime(key, DST_TIME_DELETE, deltime);
if (setsyncadd)
dst_key_settime(key, DST_TIME_SYNCPUBLISH, syncadd);
if (setsyncdel)
dst_key_settime(key, DST_TIME_SYNCDELETE, syncdel);
if (setsyncadd)
dst_key_settime(key, DST_TIME_SYNCPUBLISH, syncadd);
if (setsyncdel)
dst_key_settime(key, DST_TIME_SYNCDELETE, syncdel);
} else {
if (setpub || setact || setrev || setinact ||
-1
View File
@@ -43,7 +43,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+36 -38
View File
@@ -28,8 +28,6 @@
#include <config.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
@@ -175,9 +173,9 @@ usage(void) {
exit (-1);
}
static bool
static isc_boolean_t
dsa_size_ok(int size) {
return (size >= 512 && size <= 1024 && size % 64 == 0);
return (ISC_TF(size >= 512 && size <= 1024 && size % 64 == 0));
}
static void
@@ -214,10 +212,10 @@ main(int argc, char **argv) {
dst_key_t *key = NULL;
dns_fixedname_t fname;
dns_name_t *name;
uint16_t flags = 0, kskflag = 0, revflag = 0;
isc_uint16_t flags = 0, kskflag = 0, revflag = 0;
dns_secalg_t alg;
bool conflict = false, null_key = false;
bool oldstyle = false;
isc_boolean_t conflict = ISC_FALSE, null_key = ISC_FALSE;
isc_boolean_t oldstyle = ISC_FALSE;
isc_mem_t *mctx = NULL;
int ch, generator = 0, param = 0;
int protocol = -1, size = -1, signatory = 0;
@@ -239,24 +237,24 @@ main(int argc, char **argv) {
int options = DST_TYPE_PRIVATE | DST_TYPE_PUBLIC;
int dbits = 0;
dns_ttl_t ttl = 0;
bool use_nsec3 = false;
isc_boolean_t use_nsec3 = ISC_FALSE;
isc_stdtime_t publish = 0, activate = 0, revokekey = 0;
isc_stdtime_t inactive = 0, deltime = 0;
isc_stdtime_t now;
int prepub = -1;
bool setpub = false, setact = false;
bool setrev = false, setinact = false;
bool setdel = false, setttl = false;
bool unsetpub = false, unsetact = false;
bool unsetrev = false, unsetinact = false;
bool unsetdel = false;
bool genonly = false;
bool quiet = false;
bool show_progress = false;
isc_boolean_t setpub = ISC_FALSE, setact = ISC_FALSE;
isc_boolean_t setrev = ISC_FALSE, setinact = ISC_FALSE;
isc_boolean_t setdel = ISC_FALSE, setttl = ISC_FALSE;
isc_boolean_t unsetpub = ISC_FALSE, unsetact = ISC_FALSE;
isc_boolean_t unsetrev = ISC_FALSE, unsetinact = ISC_FALSE;
isc_boolean_t unsetdel = ISC_FALSE;
isc_boolean_t genonly = ISC_FALSE;
isc_boolean_t quiet = ISC_FALSE;
isc_boolean_t show_progress = ISC_FALSE;
unsigned char c;
isc_stdtime_t syncadd = 0, syncdel = 0;
bool setsyncadd = false;
bool setsyncdel = false;
isc_boolean_t setsyncadd = ISC_FALSE;
isc_boolean_t setsyncdel = ISC_FALSE;
if (argc == 1)
usage();
@@ -266,7 +264,7 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
/*
* Process memory debugging argument first.
@@ -291,7 +289,7 @@ main(int argc, char **argv) {
break;
}
}
isc_commandline_reset = true;
isc_commandline_reset = ISC_TRUE;
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
@@ -300,7 +298,7 @@ main(int argc, char **argv) {
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (ch) {
case '3':
use_nsec3 = true;
use_nsec3 = ISC_TRUE;
break;
case 'a':
algname = isc_commandline_argument;
@@ -311,7 +309,7 @@ main(int argc, char **argv) {
fatal("-b requires a non-negative number");
break;
case 'C':
oldstyle = true;
oldstyle = ISC_TRUE;
break;
case 'c':
classname = isc_commandline_argument;
@@ -327,7 +325,7 @@ main(int argc, char **argv) {
case 'e':
fprintf(stderr,
"phased-out option -e "
"(was 'use (RSA) large exponent')\n");
"(was 'use (RSA) large exponent)\n");
break;
case 'f':
c = (unsigned char)(isc_commandline_argument[0]);
@@ -359,7 +357,7 @@ main(int argc, char **argv) {
break;
case 'L':
ttl = strtottl(isc_commandline_argument);
setttl = true;
setttl = ISC_TRUE;
break;
case 'n':
nametype = isc_commandline_argument;
@@ -373,7 +371,7 @@ main(int argc, char **argv) {
"[0..255]");
break;
case 'q':
quiet = true;
quiet = ISC_TRUE;
break;
case 'r':
setup_entropy(mctx, isc_commandline_argument, &ectx);
@@ -409,7 +407,7 @@ main(int argc, char **argv) {
/* already the default */
break;
case 'G':
genonly = true;
genonly = ISC_TRUE;
break;
case 'P':
/* -Psync ? */
@@ -503,7 +501,7 @@ main(int argc, char **argv) {
}
if (!isatty(0))
quiet = true;
quiet = ISC_TRUE;
if (ectx == NULL)
setup_entropy(mctx, NULL, &ectx);
@@ -675,14 +673,14 @@ main(int argc, char **argv) {
"prepublication interval.");
if (!setpub && !setact) {
setpub = setact = true;
setpub = setact = ISC_TRUE;
publish = now;
activate = now + prepub;
} else if (setpub && !setact) {
setact = true;
setact = ISC_TRUE;
activate = publish + prepub;
} else if (setact && !setpub) {
setpub = true;
setpub = ISC_TRUE;
publish = activate - prepub;
}
@@ -768,7 +766,7 @@ main(int argc, char **argv) {
"You can use dnssec-settime -D to "
"change this.\n", program, keystr);
setpub = setact = true;
setpub = setact = ISC_TRUE;
}
switch (alg) {
@@ -928,7 +926,7 @@ main(int argc, char **argv) {
case DNS_KEYALG_NSEC3RSASHA1:
case DNS_KEYALG_RSASHA256:
case DNS_KEYALG_RSASHA512:
show_progress = true;
show_progress = ISC_TRUE;
break;
case DNS_KEYALG_DH:
@@ -942,7 +940,7 @@ main(int argc, char **argv) {
case DST_ALG_ECDSA384:
case DST_ALG_ED25519:
case DST_ALG_ED448:
show_progress = true;
show_progress = ISC_TRUE;
/* fall through */
case DST_ALG_HMACMD5:
@@ -956,12 +954,12 @@ main(int argc, char **argv) {
}
if ((flags & DNS_KEYFLAG_TYPEMASK) == DNS_KEYTYPE_NOKEY)
null_key = true;
null_key = ISC_TRUE;
isc_buffer_init(&buf, filename, sizeof(filename) - 1);
do {
conflict = false;
conflict = ISC_FALSE;
if (!quiet && show_progress) {
fprintf(stderr, "Generating key pair.");
@@ -1084,7 +1082,7 @@ main(int argc, char **argv) {
* or another key being revoked.
*/
if (key_collision(key, name, directory, mctx, NULL)) {
conflict = true;
conflict = ISC_TRUE;
if (null_key) {
dst_key_free(&key);
break;
@@ -1105,7 +1103,7 @@ main(int argc, char **argv) {
dst_key_free(&key);
}
} while (conflict == true);
} while (conflict == ISC_TRUE);
if (conflict)
fatal("cannot generate a null key due to possible key ID "
-1
View File
@@ -50,7 +50,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+13 -15
View File
@@ -13,8 +13,6 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
@@ -61,13 +59,13 @@ usage(void) {
#else
fprintf(stderr, " -E engine: specify OpenSSL engine\n");
#endif
fprintf(stderr, " -f: force overwrite\n");
fprintf(stderr, " -h: help\n");
fprintf(stderr, " -f: force overwrite\n");
fprintf(stderr, " -K directory: use directory for key files\n");
fprintf(stderr, " -r: remove old keyfiles after "
fprintf(stderr, " -h: help\n");
fprintf(stderr, " -r: remove old keyfiles after "
"creating revoked version\n");
fprintf(stderr, " -v level: set level of verbosity\n");
fprintf(stderr, " -V: print version information\n");
fprintf(stderr, " -v level: set level of verbosity\n");
fprintf(stderr, " -V: print version information\n");
fprintf(stderr, "Output:\n");
fprintf(stderr, " K<name>+<alg>+<new id>.key, "
"K<name>+<alg>+<new id>.private\n");
@@ -91,11 +89,11 @@ main(int argc, char **argv) {
int ch;
isc_entropy_t *ectx = NULL;
dst_key_t *key = NULL;
uint32_t flags;
isc_uint32_t flags;
isc_buffer_t buf;
bool force = false;
bool removefile = false;
bool id = false;
isc_boolean_t force = ISC_FALSE;
isc_boolean_t removefile = ISC_FALSE;
isc_boolean_t id = ISC_FALSE;
if (argc == 1)
usage();
@@ -109,7 +107,7 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv, "E:fK:rRhv:V")) != -1) {
switch (ch) {
@@ -117,7 +115,7 @@ main(int argc, char **argv) {
engine = isc_commandline_argument;
break;
case 'f':
force = true;
force = ISC_TRUE;
break;
case 'K':
/*
@@ -131,10 +129,10 @@ main(int argc, char **argv) {
}
break;
case 'r':
removefile = true;
removefile = ISC_TRUE;
break;
case 'R':
id = true;
id = ISC_TRUE;
break;
case 'v':
verbose = strtol(isc_commandline_argument, &endp, 0);
-1
View File
@@ -38,7 +38,6 @@
<year>2015</year>
<year>2016</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+49 -51
View File
@@ -13,8 +13,6 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
@@ -105,7 +103,7 @@ usage(void) {
}
static void
printtime(dst_key_t *key, int type, const char *tag, bool epoch,
printtime(dst_key_t *key, int type, const char *tag, isc_boolean_t epoch,
FILE *stream)
{
isc_result_t result;
@@ -149,29 +147,29 @@ main(int argc, char **argv) {
dns_name_t *name = NULL;
dns_secalg_t alg = 0;
unsigned int size = 0;
uint16_t flags = 0;
isc_uint16_t flags = 0;
int prepub = -1;
dns_ttl_t ttl = 0;
isc_stdtime_t now;
isc_stdtime_t pub = 0, act = 0, rev = 0, inact = 0, del = 0;
isc_stdtime_t prevact = 0, previnact = 0, prevdel = 0;
bool setpub = false, setact = false;
bool setrev = false, setinact = false;
bool setdel = false, setttl = false;
bool unsetpub = false, unsetact = false;
bool unsetrev = false, unsetinact = false;
bool unsetdel = false;
bool printcreate = false, printpub = false;
bool printact = false, printrev = false;
bool printinact = false, printdel = false;
bool force = false;
bool epoch = false;
bool changed = false;
isc_boolean_t setpub = ISC_FALSE, setact = ISC_FALSE;
isc_boolean_t setrev = ISC_FALSE, setinact = ISC_FALSE;
isc_boolean_t setdel = ISC_FALSE, setttl = ISC_FALSE;
isc_boolean_t unsetpub = ISC_FALSE, unsetact = ISC_FALSE;
isc_boolean_t unsetrev = ISC_FALSE, unsetinact = ISC_FALSE;
isc_boolean_t unsetdel = ISC_FALSE;
isc_boolean_t printcreate = ISC_FALSE, printpub = ISC_FALSE;
isc_boolean_t printact = ISC_FALSE, printrev = ISC_FALSE;
isc_boolean_t printinact = ISC_FALSE, printdel = ISC_FALSE;
isc_boolean_t force = ISC_FALSE;
isc_boolean_t epoch = ISC_FALSE;
isc_boolean_t changed = ISC_FALSE;
isc_log_t *log = NULL;
isc_stdtime_t syncadd = 0, syncdel = 0;
bool unsetsyncadd = false, setsyncadd = false;
bool unsetsyncdel = false, setsyncdel = false;
bool printsyncadd = false, printsyncdel = false;
isc_boolean_t unsetsyncadd = ISC_FALSE, setsyncadd = ISC_FALSE;
isc_boolean_t unsetsyncdel = ISC_FALSE, setsyncdel = ISC_FALSE;
isc_boolean_t printsyncadd = ISC_FALSE, printsyncdel = ISC_FALSE;
if (argc == 1)
usage();
@@ -187,7 +185,7 @@ main(int argc, char **argv) {
#endif
dns_result_register();
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
isc_stdtime_get(&now);
@@ -198,51 +196,51 @@ main(int argc, char **argv) {
engine = isc_commandline_argument;
break;
case 'f':
force = true;
force = ISC_TRUE;
break;
case 'p':
p = isc_commandline_argument;
if (!strcasecmp(p, "all")) {
printcreate = true;
printpub = true;
printact = true;
printrev = true;
printinact = true;
printdel = true;
printsyncadd = true;
printsyncdel = true;
printcreate = ISC_TRUE;
printpub = ISC_TRUE;
printact = ISC_TRUE;
printrev = ISC_TRUE;
printinact = ISC_TRUE;
printdel = ISC_TRUE;
printsyncadd = ISC_TRUE;
printsyncdel = ISC_TRUE;
break;
}
do {
switch (*p++) {
case 'C':
printcreate = true;
printcreate = ISC_TRUE;
break;
case 'P':
if (!strncmp(p, "sync", 4)) {
p += 4;
printsyncadd = true;
printsyncadd = ISC_TRUE;
break;
}
printpub = true;
printpub = ISC_TRUE;
break;
case 'A':
printact = true;
printact = ISC_TRUE;
break;
case 'R':
printrev = true;
printrev = ISC_TRUE;
break;
case 'I':
printinact = true;
printinact = ISC_TRUE;
break;
case 'D':
if (!strncmp(p, "sync", 4)) {
p += 4;
printsyncdel = true;
printsyncdel = ISC_TRUE;
break;
}
printdel = true;
printdel = ISC_TRUE;
break;
case ' ':
break;
@@ -253,7 +251,7 @@ main(int argc, char **argv) {
} while (*p != '\0');
break;
case 'u':
epoch = true;
epoch = ISC_TRUE;
break;
case 'K':
/*
@@ -269,7 +267,7 @@ main(int argc, char **argv) {
break;
case 'L':
ttl = strtottl(isc_commandline_argument);
setttl = true;
setttl = ISC_TRUE;
break;
case 'v':
verbose = strtol(isc_commandline_argument, &endp, 0);
@@ -283,7 +281,7 @@ main(int argc, char **argv) {
fatal("-P sync specified more than "
"once");
changed = true;
changed = ISC_TRUE;
syncadd = strtotime(isc_commandline_argument,
now, now, &setsyncadd);
unsetsyncadd = !setsyncadd;
@@ -293,7 +291,7 @@ main(int argc, char **argv) {
if (setpub || unsetpub)
fatal("-P specified more than once");
changed = true;
changed = ISC_TRUE;
pub = strtotime(isc_commandline_argument,
now, now, &setpub);
unsetpub = !setpub;
@@ -302,7 +300,7 @@ main(int argc, char **argv) {
if (setact || unsetact)
fatal("-A specified more than once");
changed = true;
changed = ISC_TRUE;
act = strtotime(isc_commandline_argument,
now, now, &setact);
unsetact = !setact;
@@ -311,7 +309,7 @@ main(int argc, char **argv) {
if (setrev || unsetrev)
fatal("-R specified more than once");
changed = true;
changed = ISC_TRUE;
rev = strtotime(isc_commandline_argument,
now, now, &setrev);
unsetrev = !setrev;
@@ -320,7 +318,7 @@ main(int argc, char **argv) {
if (setinact || unsetinact)
fatal("-I specified more than once");
changed = true;
changed = ISC_TRUE;
inact = strtotime(isc_commandline_argument,
now, now, &setinact);
unsetinact = !setinact;
@@ -332,7 +330,7 @@ main(int argc, char **argv) {
fatal("-D sync specified more than "
"once");
changed = true;
changed = ISC_TRUE;
syncdel = strtotime(isc_commandline_argument,
now, now, &setsyncdel);
unsetsyncdel = !setsyncdel;
@@ -343,7 +341,7 @@ main(int argc, char **argv) {
if (setdel || unsetdel)
fatal("-D specified more than once");
changed = true;
changed = ISC_TRUE;
del = strtotime(isc_commandline_argument,
now, now, &setdel);
unsetdel = !setdel;
@@ -461,7 +459,7 @@ main(int argc, char **argv) {
"before it is scheduled to be "
"inactive.\n", program);
changed = setpub = setact = true;
changed = setpub = setact = ISC_TRUE;
} else {
if (prepub < 0)
prepub = 0;
@@ -473,10 +471,10 @@ main(int argc, char **argv) {
"prepublication interval.");
if (setpub && !setact) {
setact = true;
setact = ISC_TRUE;
act = pub + prepub;
} else if (setact && !setpub) {
setpub = true;
setpub = ISC_TRUE;
pub = act - prepub;
}
@@ -607,11 +605,11 @@ main(int argc, char **argv) {
if (force && !changed) {
dst_key_settime(key, DST_TIME_PUBLISH, now);
dst_key_settime(key, DST_TIME_ACTIVATE, now);
changed = true;
changed = ISC_TRUE;
}
if (!changed && setttl)
changed = true;
changed = ISC_TRUE;
/*
* Print out time values, if -p was used.
-1
View File
@@ -40,7 +40,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
File diff suppressed because it is too large Load Diff
-1
View File
@@ -50,7 +50,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+7 -8
View File
@@ -13,7 +13,6 @@
#include <config.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
@@ -80,8 +79,8 @@ static dns_db_t *gdb; /* The database */
static dns_dbversion_t *gversion; /* The database version */
static dns_rdataclass_t gclass; /* The class */
static dns_name_t *gorigin; /* The database origin */
static bool ignore_kskflag = false;
static bool keyset_kskonly = false;
static isc_boolean_t ignore_kskflag = ISC_FALSE;
static isc_boolean_t keyset_kskonly = ISC_FALSE;
/*%
* Load the zone file from disk
@@ -207,7 +206,7 @@ main(int argc, char *argv[]) {
break;
}
}
isc_commandline_reset = true;
isc_commandline_reset = ISC_TRUE;
check_result(isc_app_start(), "isc_app_start");
result = isc_mem_create(0, 0, &mctx);
@@ -219,7 +218,7 @@ main(int argc, char *argv[]) {
#endif
dns_result_register();
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (ch) {
@@ -250,11 +249,11 @@ main(int argc, char *argv[]) {
break;
case 'x':
keyset_kskonly = true;
keyset_kskonly = ISC_TRUE;
break;
case 'z':
ignore_kskflag = true;
ignore_kskflag = ISC_TRUE;
break;
case '?':
@@ -335,7 +334,7 @@ main(int argc, char *argv[]) {
verifyzone(gdb, gversion, gorigin, mctx,
ignore_kskflag, keyset_kskonly);
dns_db_closeversion(gdb, &gversion, false);
dns_db_closeversion(gdb, &gversion, ISC_FALSE);
dns_db_detach(&gdb);
cleanup_logging(&log);
-1
View File
@@ -37,7 +37,6 @@
<year>2015</year>
<year>2016</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+100 -117
View File
@@ -17,8 +17,6 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#ifdef _WIN32
@@ -63,10 +61,10 @@
static isc_heap_t *expected_chains, *found_chains;
struct nsec3_chain_fixed {
uint8_t hash;
uint8_t salt_length;
uint8_t next_length;
uint16_t iterations;
isc_uint8_t hash;
isc_uint8_t salt_length;
isc_uint8_t next_length;
isc_uint16_t iterations;
/* unsigned char salt[0]; */
/* unsigned char owner[0]; */
/* unsigned char next[0]; */
@@ -243,7 +241,7 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
#ifdef ISC_PLATFORM_CRYPTORANDOM
if (randomfile == NULL) {
isc_entropy_usehook(*ectx, true);
isc_entropy_usehook(*ectx, ISC_TRUE);
}
#endif
if (randomfile != NULL && strcmp(randomfile, "keyboard") == 0) {
@@ -315,10 +313,10 @@ time_units(isc_stdtime_t offset, char *suffix, const char *str) {
return(0); /* silence compiler warning */
}
static inline bool
static inline isc_boolean_t
isnone(const char *str) {
return ((strcasecmp(str, "none") == 0) ||
(strcasecmp(str, "never") == 0));
return (ISC_TF((strcasecmp(str, "none") == 0) ||
(strcasecmp(str, "never") == 0)));
}
dns_ttl_t
@@ -338,10 +336,10 @@ strtottl(const char *str) {
}
isc_stdtime_t
strtotime(const char *str, int64_t now, int64_t base,
bool *setp)
strtotime(const char *str, isc_int64_t now, isc_int64_t base,
isc_boolean_t *setp)
{
int64_t val, offset;
isc_int64_t val, offset;
isc_result_t result;
const char *orig = str;
char *endp;
@@ -349,12 +347,12 @@ strtotime(const char *str, int64_t now, int64_t base,
if (isnone(str)) {
if (setp != NULL)
*setp = false;
*setp = ISC_FALSE;
return ((isc_stdtime_t) 0);
}
if (setp != NULL)
*setp = true;
*setp = ISC_TRUE;
if ((str[0] == '0' || str[0] == '-') && str[1] == '\0')
return ((isc_stdtime_t) 0);
@@ -495,22 +493,22 @@ set_keyversion(dst_key_t *key) {
}
}
bool
isc_boolean_t
key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
isc_mem_t *mctx, bool *exact)
isc_mem_t *mctx, isc_boolean_t *exact)
{
isc_result_t result;
bool conflict = false;
isc_boolean_t conflict = ISC_FALSE;
dns_dnsseckeylist_t matchkeys;
dns_dnsseckey_t *key = NULL;
uint16_t id, oldid;
uint32_t rid, roldid;
isc_uint16_t id, oldid;
isc_uint32_t rid, roldid;
dns_secalg_t alg;
char filename[ISC_DIR_NAMEMAX];
isc_buffer_t fileb;
if (exact != NULL)
*exact = false;
*exact = ISC_FALSE;
id = dst_key_id(dstkey);
rid = dst_key_rid(dstkey);
@@ -534,14 +532,14 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
result = dst_key_buildfilename(dstkey, DST_TYPE_PRIVATE,
dir, &fileb);
if (result != ISC_R_SUCCESS)
return (true);
return (ISC_TRUE);
return (isc_file_exists(filename));
}
ISC_LIST_INIT(matchkeys);
result = dns_dnssec_findmatchingkeys(name, dir, mctx, &matchkeys);
if (result == ISC_R_NOTFOUND)
return (false);
return (ISC_FALSE);
while (!ISC_LIST_EMPTY(matchkeys) && !conflict) {
key = ISC_LIST_HEAD(matchkeys);
@@ -552,7 +550,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
roldid = dst_key_rid(key->key);
if (oldid == rid || roldid == id || id == oldid) {
conflict = true;
conflict = ISC_TRUE;
if (id != oldid) {
if (verbose > 1)
fprintf(stderr, "Key ID %d could "
@@ -560,7 +558,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
id, oldid);
} else {
if (exact != NULL)
*exact = true;
*exact = ISC_TRUE;
if (verbose > 1)
fprintf(stderr, "Key ID %d exists\n",
id);
@@ -582,15 +580,15 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
return (conflict);
}
bool
isc_boolean_t
is_delegation(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
dns_name_t *name, dns_dbnode_t *node, uint32_t *ttlp)
dns_name_t *name, dns_dbnode_t *node, isc_uint32_t *ttlp)
{
dns_rdataset_t nsset;
isc_result_t result;
if (dns_name_equal(name, origin))
return (false);
return (ISC_FALSE);
dns_rdataset_init(&nsset);
result = dns_db_findrdataset(db, node, ver, dns_rdatatype_ns,
@@ -601,10 +599,10 @@ is_delegation(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
dns_rdataset_disassociate(&nsset);
}
return (result == ISC_R_SUCCESS);
return (ISC_TF(result == ISC_R_SUCCESS));
}
bool
isc_boolean_t
has_dname(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node) {
dns_rdataset_t dnameset;
isc_result_t result;
@@ -616,10 +614,10 @@ has_dname(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node) {
dns_rdataset_disassociate(&dnameset);
}
return (result == ISC_R_SUCCESS);
return (ISC_TF(result == ISC_R_SUCCESS));
}
static bool
static isc_boolean_t
goodsig(dns_name_t *origin, dns_rdata_t *sigrdata, dns_name_t *name,
dns_rdataset_t *keyrdataset, dns_rdataset_t *rdataset, isc_mem_t *mctx)
{
@@ -641,35 +639,20 @@ goodsig(dns_name_t *origin, dns_rdata_t *sigrdata, dns_name_t *name,
result = dns_dnssec_keyfromrdata(origin, &rdata, mctx,
&dstkey);
if (result != ISC_R_SUCCESS)
return (false);
return (ISC_FALSE);
if (sig.algorithm != key.algorithm ||
sig.keyid != dst_key_id(dstkey) ||
!dns_name_equal(&sig.signer, origin)) {
dst_key_free(&dstkey);
continue;
}
result = dns_dnssec_verify(name, rdataset, dstkey, false,
result = dns_dnssec_verify(name, rdataset, dstkey, ISC_FALSE,
mctx, sigrdata);
dst_key_free(&dstkey);
if (result == ISC_R_SUCCESS)
return(true);
return(ISC_TRUE);
}
return (false);
}
static bool
nsec_bitmap_equal(dns_rdata_nsec_t *nsec, dns_rdata_t *rdata) {
isc_result_t result;
dns_rdata_nsec_t tmpnsec;
result = dns_rdata_tostruct(rdata, &tmpnsec, NULL);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
if (nsec->len != tmpnsec.len ||
memcmp(nsec->typebits, tmpnsec.typebits, nsec->len) != 0) {
return (false);
}
return (true);
return (ISC_FALSE);
}
static isc_result_t
@@ -715,7 +698,7 @@ verifynsec(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name,
result = dns_nsec_buildrdata(db, ver, node, nextname, buffer,
&tmprdata);
check_result(result, "dns_nsec_buildrdata()");
if (!nsec_bitmap_equal(&nsec, &tmprdata)) {
if (dns_rdata_compare(&rdata, &tmprdata) != 0) {
dns_name_format(name, namebuf, sizeof(namebuf));
fprintf(stderr, "Bad NSEC record for %s, bit map "
"mismatch\n", namebuf);
@@ -769,7 +752,7 @@ check_no_rrsig(dns_db_t *db, dns_dbversion_t *ver, dns_rdataset_t *rdataset,
dns_rdatasetiter_destroy(&rdsiter);
}
static bool
static isc_boolean_t
chain_compare(void *arg1, void *arg2) {
struct nsec3_chain_fixed *e1 = arg1, *e2 = arg2;
size_t len;
@@ -778,43 +761,43 @@ chain_compare(void *arg1, void *arg2) {
* Do each element in turn to get a stable sort.
*/
if (e1->hash < e2->hash)
return (true);
return (ISC_TRUE);
if (e1->hash > e2->hash)
return (false);
return (ISC_FALSE);
if (e1->iterations < e2->iterations)
return (true);
return (ISC_TRUE);
if (e1->iterations > e2->iterations)
return (false);
return (ISC_FALSE);
if (e1->salt_length < e2->salt_length)
return (true);
return (ISC_TRUE);
if (e1->salt_length > e2->salt_length)
return (false);
return (ISC_FALSE);
if (e1->next_length < e2->next_length)
return (true);
return (ISC_TRUE);
if (e1->next_length > e2->next_length)
return (false);
return (ISC_FALSE);
len = e1->salt_length + 2 * e1->next_length;
if (memcmp(e1 + 1, e2 + 1, len) < 0)
return (true);
return (false);
return (ISC_TRUE);
return (ISC_FALSE);
}
static bool
static isc_boolean_t
chain_equal(struct nsec3_chain_fixed *e1, struct nsec3_chain_fixed *e2) {
size_t len;
if (e1->hash != e2->hash)
return (false);
return (ISC_FALSE);
if (e1->iterations != e2->iterations)
return (false);
return (ISC_FALSE);
if (e1->salt_length != e2->salt_length)
return (false);
return (ISC_FALSE);
if (e1->next_length != e2->next_length)
return (false);
return (ISC_FALSE);
len = e1->salt_length + 2 * e1->next_length;
if (memcmp(e1 + 1, e2 + 1, len) != 0)
return (false);
return (true);
return (ISC_FALSE);
return (ISC_TRUE);
}
static isc_result_t
@@ -934,7 +917,7 @@ match_nsec3(dns_name_t *name, isc_mem_t *mctx,
return (result);
}
static bool
static isc_boolean_t
innsec3params(dns_rdata_nsec3_t *nsec3, dns_rdataset_t *nsec3paramset) {
dns_rdata_nsec3param_t nsec3param;
isc_result_t result;
@@ -953,9 +936,9 @@ innsec3params(dns_rdata_nsec3_t *nsec3, dns_rdataset_t *nsec3paramset) {
nsec3param.salt_length == nsec3->salt_length &&
memcmp(nsec3param.salt, nsec3->salt,
nsec3->salt_length) == 0)
return (true);
return (ISC_TRUE);
}
return (false);
return (ISC_FALSE);
}
static isc_result_t
@@ -1014,7 +997,7 @@ record_found(dns_db_t *db, dns_dbversion_t *ver, isc_mem_t *mctx,
return (ISC_R_SUCCESS);
}
static bool
static isc_boolean_t
isoptout(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
dns_rdata_t *nsec3rdata)
{
@@ -1028,7 +1011,7 @@ isoptout(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
dns_dbnode_t *node = NULL;
unsigned char rawhash[NSEC3_MAX_HASH_LENGTH];
size_t rhsize = sizeof(rawhash);
bool ret;
isc_boolean_t ret;
result = dns_rdata_tostruct(nsec3rdata, &nsec3param, NULL);
check_result(result, "dns_rdata_tostruct()");
@@ -1041,12 +1024,12 @@ isoptout(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
dns_rdataset_init(&rdataset);
hashname = dns_fixedname_name(&fixed);
result = dns_db_findnsec3node(db, hashname, false, &node);
result = dns_db_findnsec3node(db, hashname, ISC_FALSE, &node);
if (result == ISC_R_SUCCESS)
result = dns_db_findrdataset(db, node, ver, dns_rdatatype_nsec3,
0, 0, &rdataset, NULL);
if (result != ISC_R_SUCCESS)
return (false);
return (ISC_FALSE);
result = dns_rdataset_first(&rdataset);
check_result(result, "dns_rdataset_first()");
@@ -1055,9 +1038,9 @@ isoptout(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
result = dns_rdata_tostruct(&rdata, &nsec3, NULL);
if (result != ISC_R_SUCCESS)
ret = false;
ret = ISC_FALSE;
else
ret = (nsec3.flags & DNS_NSEC3FLAG_OPTOUT);
ret = ISC_TF((nsec3.flags & DNS_NSEC3FLAG_OPTOUT) != 0);
if (dns_rdataset_isassociated(&rdataset))
dns_rdataset_disassociate(&rdataset);
@@ -1070,7 +1053,7 @@ isoptout(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
static isc_result_t
verifynsec3(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
isc_mem_t *mctx, dns_name_t *name, dns_rdata_t *rdata,
bool delegation, bool empty,
isc_boolean_t delegation, isc_boolean_t empty,
unsigned char types[8192], unsigned int maxtype)
{
char namebuf[DNS_NAME_FORMATSIZE];
@@ -1083,7 +1066,7 @@ verifynsec3(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
dns_dbnode_t *node = NULL;
unsigned char rawhash[NSEC3_MAX_HASH_LENGTH];
size_t rhsize = sizeof(rawhash);
bool optout;
isc_boolean_t optout;
result = dns_rdata_tostruct(rdata, &nsec3param, NULL);
check_result(result, "dns_rdata_tostruct()");
@@ -1110,7 +1093,7 @@ verifynsec3(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
*/
dns_rdataset_init(&rdataset);
hashname = dns_fixedname_name(&fixed);
result = dns_db_findnsec3node(db, hashname, false, &node);
result = dns_db_findnsec3node(db, hashname, ISC_FALSE, &node);
if (result == ISC_R_SUCCESS)
result = dns_db_findrdataset(db, node, ver, dns_rdatatype_nsec3,
0, 0, &rdataset, NULL);
@@ -1142,7 +1125,7 @@ verifynsec3(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
static isc_result_t
verifynsec3s(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
isc_mem_t *mctx, dns_name_t *name, dns_rdataset_t *nsec3paramset,
bool delegation, bool empty,
isc_boolean_t delegation, isc_boolean_t empty,
unsigned char types[8192], unsigned int maxtype)
{
isc_result_t result;
@@ -1243,7 +1226,7 @@ verifyset(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
static isc_result_t
verifynode(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
isc_mem_t *mctx, dns_name_t *name, dns_dbnode_t *node,
bool delegation, dns_rdataset_t *keyrdataset,
isc_boolean_t delegation, dns_rdataset_t *keyrdataset,
unsigned char *act_algorithms, unsigned char *bad_algorithms,
dns_rdataset_t *nsecset, dns_rdataset_t *nsec3paramset,
dns_name_t *nextname)
@@ -1299,7 +1282,7 @@ verifynode(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
if (nsec3paramset != NULL && dns_rdataset_isassociated(nsec3paramset)) {
tresult = verifynsec3s(db, ver, origin, mctx, name,
nsec3paramset, delegation, false,
nsec3paramset, delegation, ISC_FALSE,
types, maxtype);
if (result == ISC_R_SUCCESS && tresult != ISC_R_SUCCESS)
result = tresult;
@@ -1307,7 +1290,7 @@ verifynode(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
return (result);
}
static bool
static isc_boolean_t
is_empty(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node) {
dns_rdatasetiter_t *rdsiter = NULL;
isc_result_t result;
@@ -1317,8 +1300,8 @@ is_empty(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node) {
result = dns_rdatasetiter_first(rdsiter);
dns_rdatasetiter_destroy(&rdsiter);
if (result == ISC_R_NOMORE)
return (true);
return (false);
return (ISC_TRUE);
return (ISC_FALSE);
}
static void
@@ -1341,7 +1324,7 @@ check_no_nsec(dns_name_t *name, dns_dbnode_t *node, dns_db_t *db,
dns_rdataset_disassociate(&rdataset);
}
static bool
static isc_boolean_t
newchain(const struct nsec3_chain_fixed *first,
const struct nsec3_chain_fixed *e)
{
@@ -1350,8 +1333,8 @@ newchain(const struct nsec3_chain_fixed *first,
first->salt_length != e->salt_length ||
first->next_length != e->next_length ||
memcmp(first + 1, e + 1, first->salt_length) != 0)
return (true);
return (false);
return (ISC_TRUE);
return (ISC_FALSE);
}
static void
@@ -1362,7 +1345,7 @@ free_element(isc_mem_t *mctx, struct nsec3_chain_fixed *e) {
isc_mem_put(mctx, e, len);
}
static bool
static isc_boolean_t
checknext(const struct nsec3_chain_fixed *first,
const struct nsec3_chain_fixed *e)
{
@@ -1376,7 +1359,7 @@ checknext(const struct nsec3_chain_fixed *first,
d2 += e->salt_length;
if (memcmp(d1, d2, first->next_length) == 0)
return (true);
return (ISC_TRUE);
DE_CONST(d1 - first->next_length, sr.base);
sr.length = first->next_length;
@@ -1398,7 +1381,7 @@ checknext(const struct nsec3_chain_fixed *first,
isc_base32hex_totext(&sr, 1, "", &b);
fprintf(stderr, "Found: %.*s\n", (int) isc_buffer_usedlength(&b), buf);
return (false);
return (ISC_FALSE);
}
#define EXPECTEDANDFOUND "Expected and found NSEC3 chains not equal\n"
@@ -1490,7 +1473,7 @@ verify_nsec3_chains(isc_mem_t *mctx) {
static isc_result_t
verifyemptynodes(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
isc_mem_t *mctx, dns_name_t *name, dns_name_t *prevname,
bool isdelegation, dns_rdataset_t *nsec3paramset)
isc_boolean_t isdelegation, dns_rdataset_t *nsec3paramset)
{
dns_namereln_t reln;
int order;
@@ -1514,7 +1497,7 @@ verifyemptynodes(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
dns_rdataset_isassociated(nsec3paramset)) {
tresult = verifynsec3s(db, ver, origin, mctx,
&suffix, nsec3paramset,
isdelegation, true,
isdelegation, ISC_TRUE,
NULL, 0);
if (result == ISC_R_SUCCESS &&
tresult != ISC_R_SUCCESS)
@@ -1540,7 +1523,7 @@ verifyemptynodes(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
void
verifyzone(dns_db_t *db, dns_dbversion_t *ver,
dns_name_t *origin, isc_mem_t *mctx,
bool ignore_kskflag, bool keyset_kskonly)
isc_boolean_t ignore_kskflag, isc_boolean_t keyset_kskonly)
{
char algbuf[80];
dns_dbiterator_t *dbiter = NULL;
@@ -1554,10 +1537,10 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
dns_rdataset_t nsecset, nsecsigs;
dns_rdataset_t nsec3paramset, nsec3paramsigs;
int i;
bool done = false;
bool first = true;
bool goodksk = false;
bool goodzsk = false;
isc_boolean_t done = ISC_FALSE;
isc_boolean_t first = ISC_TRUE;
isc_boolean_t goodksk = ISC_FALSE;
isc_boolean_t goodzsk = ISC_FALSE;
isc_result_t result, vresult = ISC_R_UNSET;
unsigned char revoked_ksk[256];
unsigned char revoked_zsk[256];
@@ -1575,7 +1558,7 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
&found_chains);
check_result(result, "isc_heap_create()");
result = dns_db_findnode(db, origin, false, &node);
result = dns_db_findnode(db, origin, ISC_FALSE, &node);
if (result != ISC_R_SUCCESS)
fatal("failed to find the zone's origin: %s",
isc_result_totext(result));
@@ -1654,7 +1637,7 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
else if ((dnskey.flags & DNS_KEYFLAG_REVOKE) != 0) {
if ((dnskey.flags & DNS_KEYFLAG_KSK) != 0 &&
!dns_dnssec_selfsigns(&rdata, origin, &keyset,
&keysigs, false,
&keysigs, ISC_FALSE,
mctx)) {
char namebuf[DNS_NAME_FORMATSIZE];
char buffer[1024];
@@ -1677,21 +1660,21 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
revoked_zsk[dnskey.algorithm]++;
} else if ((dnskey.flags & DNS_KEYFLAG_KSK) != 0) {
if (dns_dnssec_selfsigns(&rdata, origin, &keyset,
&keysigs, false, mctx)) {
&keysigs, ISC_FALSE, mctx)) {
if (ksk_algorithms[dnskey.algorithm] != 255)
ksk_algorithms[dnskey.algorithm]++;
goodksk = true;
goodksk = ISC_TRUE;
} else {
if (standby_ksk[dnskey.algorithm] != 255)
standby_ksk[dnskey.algorithm]++;
}
} else if (dns_dnssec_selfsigns(&rdata, origin, &keyset,
&keysigs, false, mctx)) {
&keysigs, ISC_FALSE, mctx)) {
if (zsk_algorithms[dnskey.algorithm] != 255)
zsk_algorithms[dnskey.algorithm]++;
goodzsk = true;
goodzsk = ISC_TRUE;
} else if (dns_dnssec_signs(&rdata, origin, &soaset,
&soasigs, false, mctx)) {
&soasigs, ISC_FALSE, mctx)) {
if (zsk_algorithms[dnskey.algorithm] != 255)
zsk_algorithms[dnskey.algorithm]++;
} else {
@@ -1768,7 +1751,7 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
check_result(result, "dns_dbiterator_first()");
while (!done) {
bool isdelegation = false;
isc_boolean_t isdelegation = ISC_FALSE;
result = dns_dbiterator_current(dbiter, &node, name);
check_dns_dbiterator_current(result);
@@ -1777,7 +1760,7 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
dns_db_detachnode(db, &node);
result = dns_dbiterator_next(dbiter);
if (result == ISC_R_NOMORE)
done = true;
done = ISC_TRUE;
else
check_result(result, "dns_dbiterator_next()");
continue;
@@ -1785,7 +1768,7 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
if (is_delegation(db, ver, origin, name, node, NULL)) {
zonecut = dns_fixedname_name(&fzonecut);
dns_name_copy(name, zonecut, NULL);
isdelegation = true;
isdelegation = ISC_TRUE;
} else if (has_dname(db, ver, node)) {
zonecut = dns_fixedname_name(&fzonecut);
dns_name_copy(name, zonecut, NULL);
@@ -1814,7 +1797,7 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
break;
}
if (result == ISC_R_NOMORE) {
done = true;
done = ISC_TRUE;
nextname = origin;
} else if (result != ISC_R_SUCCESS)
fatal("iterating through the database failed: %s",
@@ -1850,7 +1833,7 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
result = dns_dbiterator_current(dbiter, &node, name);
check_dns_dbiterator_current(result);
result = verifynode(db, ver, origin, mctx, name, node,
false, &keyset, act_algorithms,
ISC_FALSE, &keyset, act_algorithms,
bad_algorithms, NULL, NULL, NULL);
check_result(result, "verifynode");
record_found(db, ver, mctx, name, node, &nsec3paramset);
@@ -1883,7 +1866,7 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
"for the following algorithms:");
dns_secalg_format(i, algbuf, sizeof(algbuf));
fprintf(stderr, " %s", algbuf);
first = false;
first = ISC_FALSE;
}
}
if (!first) {
@@ -1924,7 +1907,7 @@ verifyzone(dns_db_t *db, dns_dbversion_t *ver,
}
}
bool
isc_boolean_t
isoptarg(const char *arg, char **argv, void(*usage)(void)) {
if (!strcasecmp(isc_commandline_argument, arg)) {
if (argv[isc_commandline_index] == NULL) {
@@ -1936,9 +1919,9 @@ isoptarg(const char *arg, char **argv, void(*usage)(void)) {
isc_commandline_argument = argv[isc_commandline_index];
/* skip to next arguement */
isc_commandline_index++;
return (true);
return (ISC_TRUE);
}
return (false);
return (ISC_FALSE);
}
#ifdef _WIN32
+11 -14
View File
@@ -13,9 +13,6 @@
#ifndef DNSSECTOOL_H
#define DNSSECTOOL_H 1
#include <inttypes.h>
#include <stdbool.h>
#include <isc/log.h>
#include <isc/stdtime.h>
#include <dns/rdatastruct.h>
@@ -67,8 +64,8 @@ cleanup_entropy(isc_entropy_t **ectx);
dns_ttl_t strtottl(const char *str);
isc_stdtime_t
strtotime(const char *str, int64_t now, int64_t base,
bool *setp);
strtotime(const char *str, isc_int64_t now, isc_int64_t base,
isc_boolean_t *setp);
unsigned int
strtodsdigest(const char *str);
@@ -85,27 +82,27 @@ check_keyversion(dst_key_t *key, char *keystr);
void
set_keyversion(dst_key_t *key);
bool
isc_boolean_t
key_collision(dst_key_t *key, dns_name_t *name, const char *dir,
isc_mem_t *mctx, bool *exact);
isc_mem_t *mctx, isc_boolean_t *exact);
bool
isc_boolean_t
is_delegation(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
dns_name_t *name, dns_dbnode_t *node, uint32_t *ttlp);
dns_name_t *name, dns_dbnode_t *node, isc_uint32_t *ttlp);
/*%
* Return true if version 'ver' of database 'db' contains a DNAME RRset at
* 'node'; return false otherwise.
* Return ISC_TRUE if version 'ver' of database 'db' contains a DNAME RRset at
* 'node'; return ISC_FALSE otherwise.
*/
bool
isc_boolean_t
has_dname(dns_db_t *db, dns_dbversion_t *ver, dns_dbnode_t *node);
void
verifyzone(dns_db_t *db, dns_dbversion_t *ver,
dns_name_t *origin, isc_mem_t *mctx,
bool ignore_kskflag, bool keyset_kskonly);
isc_boolean_t ignore_kskflag, isc_boolean_t keyset_kskonly);
bool
isc_boolean_t
isoptarg(const char *arg, char **argv, void (*usage)(void));
#ifdef _WIN32
-18
View File
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\dnssec-cds.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
-112
View File
@@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|@PLATFORM@">
<Configuration>Debug</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|@PLATFORM@">
<Configuration>Release</Configuration>
<Platform>@PLATFORM@</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0EB1727E-2BBD-47A6-AD12-418F9DEB0531}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>cds</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>dnssec-$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\Build\$(Configuration)\</OutDir>
<IntDir>.\$(Configuration)\</IntDir>
<TargetName>dnssec-$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@PLATFORM@'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>@INTRINSIC@</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<WholeProgramOptimization>false</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<PrecompiledHeaderOutputFile>.\$(Configuration)\$(ProjectName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\$(Configuration)\</AssemblerListingLocation>
<ObjectFileName>.\$(Configuration)\</ObjectFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<AdditionalIncludeDirectories>.\;..\..\..\;@LIBXML2_INC@@OPENSSL_INC@..\..\..\lib\isc\win32;..\..\..\lib\isc\win32\include;..\..\..\lib\isc\include;..\..\..\lib\dns\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\dnssec-cds.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
-3
View File
@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
-48
View File
@@ -198,25 +198,6 @@
background-color: #99ddff;
}
table.zones {
border: 1px solid grey;
width: 500px;
}
table.zones th {
text-align: center;
border: 1px solid grey;
}
table.zones td {
text-align: center;
font-family: monospace;
}
table.zones td:nth-child(1) {
text-align: right;
}
table.zones td:nth-child(4) {
text-align: right;
}
.totals {
background-color: rgb(1,169,206);
color: #ffffff;
@@ -724,35 +705,6 @@
</table>
<br/>
</xsl:if>
<xsl:for-each select="views/view">
<xsl:if test="zones/zone">
<h3>Zones for View <xsl:value-of select="@name"/></h3>
<table class="zones">
<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: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]">
-48
View File
@@ -203,25 +203,6 @@ static char xslmsg[] =
" background-color: #99ddff;\n"
" }\n"
"\n"
" table.zones {\n"
" border: 1px solid grey;\n"
" width: 500px;\n"
" }\n"
" table.zones th {\n"
" text-align: center;\n"
" border: 1px solid grey;\n"
" }\n"
" table.zones td {\n"
" text-align: center;\n"
" font-family: monospace;\n"
" }\n"
" table.zones td:nth-child(1) {\n"
" text-align: right;\n"
" }\n"
" table.zones td:nth-child(4) {\n"
" text-align: right;\n"
" }\n"
"\n"
" .totals {\n"
" background-color: rgb(1,169,206);\n"
" color: #ffffff;\n"
@@ -729,35 +710,6 @@ static char xslmsg[] =
" </table>\n"
" <br/>\n"
" </xsl:if>\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"
" <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"
" <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"
" </table>\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"
+23 -27
View File
@@ -13,7 +13,6 @@
#include <config.h>
#include <inttypes.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -431,20 +430,18 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
const char *str;
str = cfg_obj_asstring(zonetypeobj);
if (strcasecmp(str, "master") == 0) {
if (strcasecmp(str, "master") == 0)
ztype = dns_zone_master;
} else if (strcasecmp(str, "slave") == 0) {
else if (strcasecmp(str, "slave") == 0)
ztype = dns_zone_slave;
} else if (strcasecmp(str, "stub") == 0) {
else if (strcasecmp(str, "stub") == 0)
ztype = dns_zone_stub;
} else if (strcasecmp(str, "static-stub") == 0) {
else if (strcasecmp(str, "static-stub") == 0)
ztype = dns_zone_staticstub;
} else if (strcasecmp(str, "redirect") == 0) {
else if (strcasecmp(str, "redirect") == 0)
ztype = dns_zone_redirect;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
return (ztype);
}
@@ -452,7 +449,7 @@ isc_result_t
named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
in_port_t defport, isc_mem_t *mctx,
isc_sockaddr_t **addrsp, isc_dscp_t **dscpsp,
uint32_t *countp)
isc_uint32_t *countp)
{
int count, i = 0;
const cfg_obj_t *addrlist;
@@ -472,8 +469,8 @@ named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
portobj = cfg_tuple_get(list, "port");
if (cfg_obj_isuint32(portobj)) {
uint32_t val = cfg_obj_asuint32(portobj);
if (val > UINT16_MAX) {
isc_uint32_t val = cfg_obj_asuint32(portobj);
if (val > ISC_UINT16_MAX) {
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
"port '%u' out of range", val);
return (ISC_R_RANGE);
@@ -543,7 +540,7 @@ named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
void
named_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
isc_dscp_t **dscpsp, uint32_t count)
isc_dscp_t **dscpsp, isc_uint32_t count)
{
INSIST(addrsp != NULL && *addrsp != NULL);
INSIST(dscpsp == NULL || *dscpsp != NULL);
@@ -589,9 +586,9 @@ isc_result_t
named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
isc_mem_t *mctx, dns_ipkeylist_t *ipkl)
{
uint32_t addrcount = 0, dscpcount = 0, keycount = 0, i = 0;
uint32_t listcount = 0, l = 0, j;
uint32_t stackcount = 0, pushed = 0;
isc_uint32_t addrcount = 0, dscpcount = 0, keycount = 0, i = 0;
isc_uint32_t listcount = 0, l = 0, j;
isc_uint32_t stackcount = 0, pushed = 0;
isc_result_t result;
const cfg_listelt_t *element;
const cfg_obj_t *addrlist;
@@ -635,8 +632,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
dscpobj = cfg_tuple_get(list, "dscp");
if (cfg_obj_isuint32(portobj)) {
uint32_t val = cfg_obj_asuint32(portobj);
if (val > UINT16_MAX) {
isc_uint32_t val = cfg_obj_asuint32(portobj);
if (val > ISC_UINT16_MAX) {
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
"port '%u' out of range", val);
result = ISC_R_RANGE;
@@ -680,7 +677,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
/* Grow lists? */
if (listcount == l) {
void * tmp;
uint32_t newlen = listcount + 16;
isc_uint32_t newlen = listcount + 16;
size_t newsize, oldsize;
newsize = newlen * sizeof(*lists);
@@ -715,7 +712,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
/* Grow stack? */
if (stackcount == pushed) {
void * tmp;
uint32_t newlen = stackcount + 16;
isc_uint32_t newlen = stackcount + 16;
size_t newsize, oldsize;
newsize = newlen * sizeof(*stack);
@@ -743,7 +740,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
if (i == addrcount) {
void * tmp;
uint32_t newlen = addrcount + 16;
isc_uint32_t newlen = addrcount + 16;
size_t newsize, oldsize;
newsize = newlen * sizeof(isc_sockaddr_t);
@@ -916,7 +913,7 @@ named_config_getport(const cfg_obj_t *config, in_port_t *portp) {
result = named_config_get(maps, "port", &portobj);
INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_asuint32(portobj) >= UINT16_MAX) {
if (cfg_obj_asuint32(portobj) >= ISC_UINT16_MAX) {
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
"port '%u' out of range",
cfg_obj_asuint32(portobj));
@@ -956,7 +953,7 @@ struct keyalgorithms {
enum { hmacnone, hmacmd5, hmacsha1, hmacsha224,
hmacsha256, hmacsha384, hmacsha512 } hmac;
unsigned int type;
uint16_t size;
isc_uint16_t size;
} algorithms[] = {
#ifndef PK11_MD5_DISABLE
{ "hmac-md5", hmacmd5, DST_ALG_HMACMD5, 128 },
@@ -973,18 +970,18 @@ struct keyalgorithms {
isc_result_t
named_config_getkeyalgorithm(const char *str, const dns_name_t **name,
uint16_t *digestbits)
isc_uint16_t *digestbits)
{
return (named_config_getkeyalgorithm2(str, name, NULL, digestbits));
}
isc_result_t
named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
unsigned int *typep, uint16_t *digestbits)
unsigned int *typep, isc_uint16_t *digestbits)
{
int i;
size_t len = 0;
uint16_t bits;
isc_uint16_t bits;
isc_result_t result;
for (i = 0; algorithms[i].str != NULL; i++) {
@@ -1019,7 +1016,6 @@ named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
case hmacsha512: *name = dns_tsig_hmacsha512_name; break;
default:
INSIST(0);
ISC_UNREACHABLE();
}
}
if (typep != NULL)
+82 -84
View File
@@ -14,7 +14,7 @@
#include <config.h>
#include <stdbool.h>
#include <isc/app.h>
#include <isc/event.h>
#include <isc/lex.h>
@@ -59,9 +59,9 @@ getcommand(isc_lex_t *lex, char **cmdp) {
return (ISC_R_SUCCESS);
}
static inline bool
static inline isc_boolean_t
command_compare(const char *str, const char *command) {
return (strcasecmp(str, command) == 0);
return ISC_TF(strcasecmp(str, command) == 0);
}
/*%
@@ -69,7 +69,7 @@ command_compare(const char *str, const char *command) {
* when a control channel message is received.
*/
isc_result_t
named_control_docommand(isccc_sexpr_t *message, bool readonly,
named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
isc_buffer_t **text)
{
isccc_sexpr_t *data;
@@ -151,11 +151,16 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
"received control channel command '%s'",
cmdline);
/*
* After the lengthy "halt" and "stop", the commands are
* handled in alphabetical order of the NAMED_COMMAND_ macros.
*/
if (command_compare(command, NAMED_COMMAND_HALT)) {
if (command_compare(command, NAMED_COMMAND_RELOAD)) {
result = named_server_reloadcommand(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_RECONFIG)) {
result = named_server_reconfigcommand(named_g_server);
} else if (command_compare(command, NAMED_COMMAND_REFRESH)) {
result = named_server_refreshcommand(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_RETRANSFER)) {
result = named_server_retransfercommand(named_g_server,
lex, text);
} else if (command_compare(command, NAMED_COMMAND_HALT)) {
#ifdef HAVE_LIBSCF
/*
* If we are managed by smf(5), AND in chroot, then
@@ -179,7 +184,7 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
*/
#endif
/* Do not flush master files */
named_server_flushonshutdown(named_g_server, false);
named_server_flushonshutdown(named_g_server, ISC_FALSE);
named_os_shutdownmsg(cmdline, *text);
isc_app_shutdown();
result = ISC_R_SUCCESS;
@@ -196,94 +201,87 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
if (named_smf_got_instance == 1 && named_smf_chroot == 0)
named_smf_want_disable = 1;
#endif
named_server_flushonshutdown(named_g_server, true);
named_server_flushonshutdown(named_g_server, ISC_TRUE);
named_os_shutdownmsg(cmdline, *text);
isc_app_shutdown();
result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_DUMPSTATS)) {
result = named_server_dumpstats(named_g_server);
} else if (command_compare(command, NAMED_COMMAND_QUERYLOG)) {
result = named_server_togglequerylog(named_g_server, lex);
} else if (command_compare(command, NAMED_COMMAND_DUMPDB)) {
named_server_dumpdb(named_g_server, lex, text);
result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_SECROOTS)) {
result = named_server_dumpsecroots(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_TRACE)) {
result = named_server_setdebuglevel(named_g_server, lex);
} else if (command_compare(command, NAMED_COMMAND_NOTRACE)) {
named_g_debuglevel = 0;
isc_log_setdebuglevel(named_g_lctx, named_g_debuglevel);
result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_FLUSH)) {
result = named_server_flushcache(named_g_server, lex);
} else if (command_compare(command, NAMED_COMMAND_FLUSHNAME)) {
result = named_server_flushnode(named_g_server, lex, ISC_FALSE);
} else if (command_compare(command, NAMED_COMMAND_FLUSHTREE)) {
result = named_server_flushnode(named_g_server, lex, ISC_TRUE);
} else if (command_compare(command, NAMED_COMMAND_STATUS)) {
result = named_server_status(named_g_server, text);
} else if (command_compare(command, NAMED_COMMAND_TSIGLIST)) {
result = named_server_tsiglist(named_g_server, text);
} else if (command_compare(command, NAMED_COMMAND_TSIGDELETE)) {
result = named_server_tsigdelete(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_FREEZE)) {
result = named_server_freeze(named_g_server, ISC_TRUE, lex,
text);
} else if (command_compare(command, NAMED_COMMAND_UNFREEZE) ||
command_compare(command, NAMED_COMMAND_THAW)) {
result = named_server_freeze(named_g_server, ISC_FALSE, lex,
text);
} else if (command_compare(command, NAMED_COMMAND_SCAN)) {
result = ISC_R_SUCCESS;
named_server_scan_interfaces(named_g_server);
} else if (command_compare(command, NAMED_COMMAND_SYNC)) {
result = named_server_sync(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_RECURSING)) {
result = named_server_dumprecursing(named_g_server);
} else if (command_compare(command, NAMED_COMMAND_TIMERPOKE)) {
result = ISC_R_SUCCESS;
isc_timermgr_poke(named_g_timermgr);
} else if (command_compare(command, NAMED_COMMAND_NULL)) {
result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_NOTIFY)) {
result = named_server_notifycommand(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_VALIDATION)) {
result = named_server_validation(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_SIGN) ||
command_compare(command, NAMED_COMMAND_LOADKEYS)) {
result = named_server_rekey(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_ADDZONE) ||
command_compare(command, NAMED_COMMAND_MODZONE)) {
result = named_server_changezone(named_g_server, cmdline, text);
} else if (command_compare(command, NAMED_COMMAND_DELZONE)) {
result = named_server_delzone(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_DNSTAP) ||
command_compare(command, NAMED_COMMAND_DNSTAPREOPEN)) {
result = named_server_dnstap(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_DUMPDB)) {
named_server_dumpdb(named_g_server, lex, text);
result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_DUMPSTATS)) {
result = named_server_dumpstats(named_g_server);
} else if (command_compare(command, NAMED_COMMAND_FLUSH)) {
result = named_server_flushcache(named_g_server, lex);
} else if (command_compare(command, NAMED_COMMAND_FLUSHNAME)) {
result = named_server_flushnode(named_g_server, lex, false);
} else if (command_compare(command, NAMED_COMMAND_FLUSHTREE)) {
result = named_server_flushnode(named_g_server, lex, true);
} else if (command_compare(command, NAMED_COMMAND_FREEZE)) {
result = named_server_freeze(named_g_server, true, lex, text);
} else if (command_compare(command, NAMED_COMMAND_LOADKEYS) ||
command_compare(command, NAMED_COMMAND_SIGN)) {
result = named_server_rekey(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_MKEYS)) {
result = named_server_mkeys(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_NOTIFY)) {
result = named_server_notifycommand(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_NOTRACE)) {
named_g_debuglevel = 0;
isc_log_setdebuglevel(named_g_lctx, named_g_debuglevel);
result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_NTA)) {
result = named_server_nta(named_g_server, lex, readonly, text);
} else if (command_compare(command, NAMED_COMMAND_NULL)) {
result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_QUERYLOG)) {
result = named_server_togglequerylog(named_g_server, lex);
} else if (command_compare(command, NAMED_COMMAND_RECONFIG)) {
result = named_server_reconfigcommand(named_g_server);
} else if (command_compare(command, NAMED_COMMAND_RECURSING)) {
result = named_server_dumprecursing(named_g_server);
} else if (command_compare(command, NAMED_COMMAND_REFRESH)) {
result = named_server_refreshcommand(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_RELOAD)) {
result = named_server_reloadcommand(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_RETRANSFER)) {
result = named_server_retransfercommand(named_g_server,
lex, text);
} else if (command_compare(command, NAMED_COMMAND_SCAN)) {
named_server_scan_interfaces(named_g_server);
result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_SECROOTS)) {
result = named_server_dumpsecroots(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_SERVESTALE)) {
result = named_server_servestale(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_SHOWZONE)) {
result = named_server_showzone(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_SIGNING)) {
result = named_server_signing(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_STATUS)) {
result = named_server_status(named_g_server, text);
} else if (command_compare(command, NAMED_COMMAND_SYNC)) {
result = named_server_sync(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_TCPTIMEOUTS)) {
result = named_server_tcptimeouts(lex, text);
} else if (command_compare(command, NAMED_COMMAND_TESTGEN)) {
result = named_server_testgen(lex, text);
} else if (command_compare(command, NAMED_COMMAND_THAW) ||
command_compare(command, NAMED_COMMAND_UNFREEZE)) {
result = named_server_freeze(named_g_server, false, lex, text);
} else if (command_compare(command, NAMED_COMMAND_TIMERPOKE)) {
isc_timermgr_poke(named_g_timermgr);
result = ISC_R_SUCCESS;
} else if (command_compare(command, NAMED_COMMAND_TRACE)) {
result = named_server_setdebuglevel(named_g_server, lex);
} else if (command_compare(command, NAMED_COMMAND_TSIGDELETE)) {
result = named_server_tsigdelete(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_TSIGLIST)) {
result = named_server_tsiglist(named_g_server, text);
} else if (command_compare(command, NAMED_COMMAND_VALIDATION)) {
result = named_server_validation(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_ZONESTATUS)) {
result = named_server_zonestatus(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_NTA)) {
result = named_server_nta(named_g_server, lex, readonly, text);
} else if (command_compare(command, NAMED_COMMAND_TESTGEN)) {
result = named_server_testgen(lex, text);
} else if (command_compare(command, NAMED_COMMAND_MKEYS)) {
result = named_server_mkeys(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_DNSTAP) ||
command_compare(command, NAMED_COMMAND_DNSTAPREOPEN)) {
result = named_server_dnstap(named_g_server, lex, text);
} else if (command_compare(command, NAMED_COMMAND_TCPTIMEOUTS)) {
result = named_server_tcptimeouts(lex, text);
} else if (command_compare(command, NAMED_COMMAND_SERVESTALE)) {
result = named_server_servestale(named_g_server, lex, text);
} else {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_CONTROL, ISC_LOG_WARNING,
+34 -37
View File
@@ -13,9 +13,6 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/event.h>
@@ -67,7 +64,7 @@ typedef ISC_LIST(controllistener_t) controllistenerlist_t;
struct controlkey {
char * keyname;
uint32_t algorithm;
isc_uint32_t algorithm;
isc_region_t secret;
ISC_LINK(controlkey_t) link;
};
@@ -75,12 +72,12 @@ struct controlkey {
struct controlconnection {
isc_socket_t * sock;
isccc_ccmsg_t ccmsg;
bool ccmsg_valid;
bool sending;
isc_boolean_t ccmsg_valid;
isc_boolean_t sending;
isc_timer_t * timer;
isc_buffer_t * buffer;
controllistener_t * listener;
uint32_t nonce;
isc_uint32_t nonce;
ISC_LINK(controlconnection_t) link;
};
@@ -91,22 +88,22 @@ struct controllistener {
isc_sockaddr_t address;
isc_socket_t * sock;
dns_acl_t * acl;
bool listening;
bool exiting;
isc_boolean_t listening;
isc_boolean_t exiting;
controlkeylist_t keys;
controlconnectionlist_t connections;
isc_sockettype_t type;
uint32_t perm;
uint32_t owner;
uint32_t group;
bool readonly;
isc_uint32_t perm;
isc_uint32_t owner;
isc_uint32_t group;
isc_boolean_t readonly;
ISC_LINK(controllistener_t) link;
};
struct named_controls {
named_server_t *server;
controllistenerlist_t listeners;
bool shuttingdown;
isc_boolean_t shuttingdown;
isccc_symtab_t *symtab;
};
@@ -204,8 +201,8 @@ shutdown_listener(controllistener_t *listener) {
NAMED_LOGMODULE_CONTROL, ISC_LOG_NOTICE,
"stopping command channel on %s", socktext);
if (listener->type == isc_sockettype_unix)
isc_socket_cleanunix(&listener->address, true);
listener->exiting = true;
isc_socket_cleanunix(&listener->address, ISC_TRUE);
listener->exiting = ISC_TRUE;
}
for (conn = ISC_LIST_HEAD(listener->connections);
@@ -223,7 +220,7 @@ shutdown_listener(controllistener_t *listener) {
maybe_free_listener(listener);
}
static bool
static isc_boolean_t
address_ok(isc_sockaddr_t *sockaddr, dns_acl_t *acl) {
dns_aclenv_t *env =
ns_interfacemgr_getaclenv(named_g_server->interfacemgr);
@@ -236,9 +233,9 @@ address_ok(isc_sockaddr_t *sockaddr, dns_acl_t *acl) {
result = dns_acl_match(&netaddr, NULL, acl, env, &match, NULL);
if (result != ISC_R_SUCCESS || match <= 0)
return (false);
return (ISC_FALSE);
else
return (true);
return (ISC_TRUE);
}
static isc_result_t
@@ -252,7 +249,7 @@ control_accept(controllistener_t *listener) {
"isc_socket_accept() failed: %s",
isc_result_totext(result));
else
listener->listening = true;
listener->listening = ISC_TRUE;
return (result);
}
@@ -285,7 +282,7 @@ control_senddone(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
conn->sending = false;
conn->sending = ISC_FALSE;
if (sevent->result != ISC_R_SUCCESS &&
sevent->result != ISC_R_CANCELED)
@@ -332,7 +329,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
controlkey_t *key = NULL;
isccc_sexpr_t *request = NULL;
isccc_sexpr_t *response = NULL;
uint32_t algorithm;
isc_uint32_t algorithm;
isccc_region_t secret;
isc_stdtime_t now;
isc_buffer_t b;
@@ -343,7 +340,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
isccc_sexpr_t *_ctrl = NULL;
isccc_time_t sent;
isccc_time_t exp;
uint32_t nonce;
isc_uint32_t nonce;
isccc_sexpr_t *data = NULL;
REQUIRE(event->ev_type == ISCCC_EVENT_CCMSG);
@@ -525,7 +522,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
result = isc_socket_send(conn->sock, &r, task, control_senddone, conn);
if (result != ISC_R_SUCCESS)
goto cleanup_response;
conn->sending = true;
conn->sending = ISC_TRUE;
isc_mem_put(listener->mctx, secret.rstart, REGION_SIZE(secret));
isccc_sexpr_free(&request);
@@ -545,7 +542,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
cleanup:
isc_socket_detach(&conn->sock);
isccc_ccmsg_invalidate(&conn->ccmsg);
conn->ccmsg_valid = false;
conn->ccmsg_valid = ISC_FALSE;
maybe_free_connection(conn);
maybe_free_listener(listener);
}
@@ -578,8 +575,8 @@ newconnection(controllistener_t *listener, isc_socket_t *sock) {
/* Set a 32 KiB upper limit on incoming message. */
isccc_ccmsg_setmaxsize(&conn->ccmsg, 32768);
conn->ccmsg_valid = true;
conn->sending = false;
conn->ccmsg_valid = ISC_TRUE;
conn->sending = ISC_FALSE;
conn->buffer = NULL;
conn->timer = NULL;
isc_interval_set(&interval, 60, 0);
@@ -626,7 +623,7 @@ control_newconn(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
listener->listening = false;
listener->listening = ISC_FALSE;
if (nevent->result != ISC_R_SUCCESS) {
if (nevent->result == ISC_R_CANCELED) {
@@ -690,7 +687,7 @@ controls_shutdown(named_controls_t *controls) {
void
named_controls_shutdown(named_controls_t *controls) {
controls_shutdown(controls);
controls->shuttingdown = true;
controls->shuttingdown = ISC_TRUE;
}
static isc_result_t
@@ -1096,7 +1093,7 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
socktext, isc_result_totext(result));
if (result == ISC_R_SUCCESS && type == isc_sockettype_unix) {
uint32_t perm, owner, group;
isc_uint32_t perm, owner, group;
perm = cfg_obj_asuint32(cfg_tuple_get(control, "perm"));
owner = cfg_obj_asuint32(cfg_tuple_get(control, "owner"));
group = cfg_obj_asuint32(cfg_tuple_get(control, "group"));
@@ -1143,14 +1140,14 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
listener->task = cp->server->task;
listener->address = *addr;
listener->sock = NULL;
listener->listening = false;
listener->exiting = false;
listener->listening = ISC_FALSE;
listener->exiting = ISC_FALSE;
listener->acl = NULL;
listener->type = type;
listener->perm = 0;
listener->owner = 0;
listener->group = 0;
listener->readonly = false;
listener->readonly = ISC_FALSE;
ISC_LINK_INIT(listener, link);
ISC_LIST_INIT(listener->keys);
ISC_LIST_INIT(listener->connections);
@@ -1213,7 +1210,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
}
if (result == ISC_R_SUCCESS && type == isc_sockettype_unix)
isc_socket_cleanunix(&listener->address, false);
isc_socket_cleanunix(&listener->address, ISC_FALSE);
if (result == ISC_R_SUCCESS)
result = isc_socket_create(named_g_socketmgr,
@@ -1224,7 +1221,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
#ifndef ISC_ALLOW_MAPPED
if (result == ISC_R_SUCCESS)
isc_socket_ipv6only(listener->sock, true);
isc_socket_ipv6only(listener->sock, ISC_TRUE);
#endif
if (result == ISC_R_SUCCESS)
@@ -1255,7 +1252,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
} else {
if (listener != NULL) {
listener->exiting = true;
listener->exiting = ISC_TRUE;
free_listener(listener);
}
@@ -1515,7 +1512,7 @@ named_controls_create(named_server_t *server, named_controls_t **ctrlsp) {
return (ISC_R_NOMEMORY);
controls->server = server;
ISC_LIST_INIT(controls->listeners);
controls->shuttingdown = false;
controls->shuttingdown = ISC_FALSE;
controls->symtab = NULL;
result = isccc_cc_createsymtab(&controls->symtab);
if (result != ISC_R_SUCCESS) {
+16 -20
View File
@@ -11,9 +11,6 @@
#include "config.h"
#include <inttypes.h>
#include <stdbool.h>
#include <named/fuzz.h>
#ifdef ENABLE_AFL
@@ -47,7 +44,7 @@
*/
static pthread_cond_t cond;
static pthread_mutex_t mutex;
static bool ready;
static isc_boolean_t ready;
/*
* In "client:" mode, this thread reads fuzzed query messages from AFL
@@ -125,7 +122,7 @@ fuzz_thread_client(void *arg) {
free(buf);
close(sockfd);
named_server_flushonshutdown(named_g_server,
false);
ISC_FALSE);
isc_app_shutdown();
return (NULL);
}
@@ -135,7 +132,7 @@ fuzz_thread_client(void *arg) {
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
ready = false;
ready = ISC_FALSE;
sent = sendto(sockfd, buf, length, 0,
(struct sockaddr *) &servaddr, sizeof(servaddr));
@@ -156,7 +153,7 @@ fuzz_thread_client(void *arg) {
free(buf);
close(sockfd);
named_server_flushonshutdown(named_g_server, false);
named_server_flushonshutdown(named_g_server, ISC_FALSE);
isc_app_shutdown();
return (NULL);
@@ -203,7 +200,7 @@ fuzz_thread_resolver(void *arg) {
* have to be updated. 0x8d, 0xf6 at the start is the ID field
* which will be made to match the query.
*/
const uint8_t dnskey_wf[] = {
const isc_uint8_t dnskey_wf[] = {
0x8d, 0xf6, 0x84, 0x00, 0x00, 0x01, 0x00, 0x02,
0x00, 0x00, 0x00, 0x01, 0x07, 0x65, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x00, 0x00, 0x30, 0x00,
@@ -285,12 +282,12 @@ fuzz_thread_resolver(void *arg) {
int sockfd;
int listenfd;
int loop;
uint16_t qtype;
isc_uint16_t qtype;
char *buf, *rbuf;
char *nameptr;
unsigned int i;
uint8_t llen;
uint64_t seed;
isc_uint8_t llen;
isc_uint64_t seed;
UNUSED(arg);
@@ -388,7 +385,7 @@ fuzz_thread_resolver(void *arg) {
close(sockfd);
close(listenfd);
named_server_flushonshutdown(named_g_server,
false);
ISC_FALSE);
isc_app_shutdown();
return (NULL);
}
@@ -402,7 +399,7 @@ fuzz_thread_resolver(void *arg) {
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
ready = false;
ready = ISC_FALSE;
/* Use a unique query ID. */
seed = 1664525 * seed + 1013904223;
@@ -552,7 +549,7 @@ fuzz_thread_resolver(void *arg) {
* "example."
*/
if ((nameptr - buf) < (length - 2)) {
uint8_t hb, lb;
isc_uint8_t hb, lb;
hb = *nameptr++;
lb = *nameptr++;
qtype = (hb << 8) | lb;
@@ -580,10 +577,9 @@ fuzz_thread_resolver(void *arg) {
}
free(buf);
free(rbuf);
close(sockfd);
close(listenfd);
named_server_flushonshutdown(named_g_server, false);
named_server_flushonshutdown(named_g_server, ISC_FALSE);
isc_app_shutdown();
/*
@@ -690,7 +686,7 @@ fuzz_thread_tcp(void *arg) {
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
ready = false;
ready = ISC_FALSE;
yes = 1;
sockfd = socket(AF_INET, SOCK_STREAM, 0);
@@ -721,7 +717,7 @@ fuzz_thread_tcp(void *arg) {
free(buf);
close(sockfd);
named_server_flushonshutdown(named_g_server, false);
named_server_flushonshutdown(named_g_server, ISC_FALSE);
isc_app_shutdown();
return (NULL);
@@ -738,7 +734,7 @@ void
named_fuzz_notify(void) {
#ifdef ENABLE_AFL
if (getenv("AFL_CMIN")) {
named_server_flushonshutdown(named_g_server, false);
named_server_flushonshutdown(named_g_server, ISC_FALSE);
isc_app_shutdown();
return;
}
@@ -747,7 +743,7 @@ named_fuzz_notify(void) {
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
ready = true;
ready = ISC_TRUE;
RUNTIME_CHECK(pthread_cond_signal(&cond) == 0);
RUNTIME_CHECK(pthread_mutex_unlock(&mutex) == 0);
+4 -6
View File
@@ -15,8 +15,6 @@
/*! \file */
#include <inttypes.h>
#include <isccfg/cfg.h>
#include <dns/types.h>
@@ -51,11 +49,11 @@ isc_result_t
named_config_getiplist(const cfg_obj_t *config, const cfg_obj_t *list,
in_port_t defport, isc_mem_t *mctx,
isc_sockaddr_t **addrsp, isc_dscp_t **dscpsp,
uint32_t *countp);
isc_uint32_t *countp);
void
named_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
isc_dscp_t **dscpsp, uint32_t count);
isc_dscp_t **dscpsp, isc_uint32_t count);
isc_result_t
named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
@@ -66,10 +64,10 @@ named_config_getport(const cfg_obj_t *config, in_port_t *portp);
isc_result_t
named_config_getkeyalgorithm(const char *str, const dns_name_t **name,
uint16_t *digestbits);
isc_uint16_t *digestbits);
isc_result_t
named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
unsigned int *typep, uint16_t *digestbits);
unsigned int *typep, isc_uint16_t *digestbits);
isc_result_t
named_config_getdscp(const cfg_obj_t *config, isc_dscp_t *dscpp);
+1 -2
View File
@@ -17,7 +17,6 @@
* The name server command channel.
*/
#include <stdbool.h>
#include <isccc/types.h>
#include <isccfg/aclconf.h>
@@ -102,7 +101,7 @@ named_controls_shutdown(named_controls_t *controls);
*/
isc_result_t
named_control_docommand(isccc_sexpr_t *message, bool readonly,
named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
isc_buffer_t **text);
#endif /* NAMED_CONTROL_H */
+9 -10
View File
@@ -14,7 +14,6 @@
/*! \file */
#include <stdbool.h>
#include <isc/rwlock.h>
#include <isc/log.h>
#include <isc/net.h>
@@ -54,7 +53,7 @@ EXTERN isc_entropy_t * named_g_fallbackentropy INIT(NULL);
EXTERN unsigned int named_g_cpus_detected INIT(1);
#ifdef ENABLE_AFL
EXTERN bool named_g_run_done INIT(false);
EXTERN isc_boolean_t named_g_run_done INIT(ISC_FALSE);
#endif
/*
* XXXRTH We're going to want multiple timer managers eventually. One
@@ -97,7 +96,7 @@ EXTERN const char * named_g_keyfile INIT(NAMED_SYSCONFDIR
EXTERN dns_tsigkey_t * named_g_sessionkey INIT(NULL);
EXTERN dns_name_t named_g_sessionkeyname;
EXTERN bool named_g_conffileset INIT(false);
EXTERN isc_boolean_t named_g_conffileset INIT(ISC_FALSE);
EXTERN cfg_aclconfctx_t * named_g_aclconfctx INIT(NULL);
/*
@@ -111,11 +110,11 @@ EXTERN isc_resourcevalue_t named_g_initopenfiles INIT(0);
/*
* Misc.
*/
EXTERN bool named_g_coreok INIT(true);
EXTERN isc_boolean_t named_g_coreok INIT(ISC_TRUE);
EXTERN const char * named_g_chrootdir INIT(NULL);
EXTERN bool named_g_foreground INIT(false);
EXTERN bool named_g_logstderr INIT(false);
EXTERN bool named_g_nosyslog INIT(false);
EXTERN isc_boolean_t named_g_foreground INIT(ISC_FALSE);
EXTERN isc_boolean_t named_g_logstderr INIT(ISC_FALSE);
EXTERN isc_boolean_t named_g_nosyslog INIT(ISC_FALSE);
EXTERN const char * named_g_logfile INIT(NULL);
EXTERN const char * named_g_defaultsessionkeyfile
@@ -124,7 +123,7 @@ EXTERN const char * named_g_defaultsessionkeyfile
EXTERN const char * named_g_defaultlockfile INIT(NAMED_LOCALSTATEDIR
"/run/named/"
"named.lock");
EXTERN bool named_g_forcelock INIT(false);
EXTERN isc_boolean_t named_g_forcelock INIT(ISC_FALSE);
#if NAMED_RUN_PID_DIR
EXTERN const char * named_g_defaultpidfile INIT(NAMED_LOCALSTATEDIR
@@ -153,8 +152,8 @@ EXTERN const char * named_g_engine INIT(NULL);
EXTERN isc_time_t named_g_boottime;
EXTERN isc_time_t named_g_configtime;
EXTERN bool named_g_memstatistics INIT(false);
EXTERN bool named_g_keepstderr INIT(false);
EXTERN isc_boolean_t named_g_memstatistics INIT(ISC_FALSE);
EXTERN isc_boolean_t named_g_keepstderr INIT(ISC_FALSE);
EXTERN unsigned int named_g_tat_interval INIT(24*3600);
+1 -1
View File
@@ -34,7 +34,7 @@
#define NAMED_LOGMODULE_CONTROL (&named_g_modules[2])
isc_result_t
named_log_init(bool safe);
named_log_init(isc_boolean_t safe);
/*%
* Initialize the logging system and set up an initial default
* logging default configuration that will be used until the
+11 -14
View File
@@ -14,9 +14,6 @@
/*! \file */
#include <inttypes.h>
#include <stdbool.h>
#include <isc/log.h>
#include <isc/magic.h>
#include <isc/quota.h>
@@ -56,9 +53,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 */
isc_boolean_t version_set; /*%< User has set version */
char * version; /*%< User-specified version */
bool hostname_set; /*%< User has set hostname */
isc_boolean_t hostname_set; /*%< User has set hostname */
char * hostname; /*%< User-specified hostname */
/* Server data structures. */
@@ -73,13 +70,13 @@ struct named_server {
isc_timer_t * pps_timer;
isc_timer_t * tat_timer;
uint32_t interface_interval;
uint32_t heartbeat_interval;
isc_uint32_t interface_interval;
isc_uint32_t heartbeat_interval;
isc_mutex_t reload_event_lock;
isc_event_t * reload_event;
bool flushonshutdown;
isc_boolean_t flushonshutdown;
named_cachelist_t cachelist; /*%< Possibly shared caches */
isc_stats_t * zonestats; /*% Zone management stats */
@@ -96,8 +93,8 @@ struct named_server {
char *session_keyfile;
dns_name_t *session_keyname;
unsigned int session_keyalg;
uint16_t session_keybits;
bool interface_auto;
isc_uint16_t session_keybits;
isc_boolean_t interface_auto;
unsigned char secret[32]; /*%< Server Cookie Secret */
ns_cookiealg_t cookiealg;
@@ -140,7 +137,7 @@ named_server_scan_interfaces(named_server_t *server);
*/
void
named_server_flushonshutdown(named_server_t *server, bool flush);
named_server_flushonshutdown(named_server_t *server, isc_boolean_t flush);
/*%<
* Inform the server that the zones should be flushed to disk on shutdown.
*/
@@ -237,7 +234,7 @@ named_server_flushcache(named_server_t *server, isc_lex_t *lex);
*/
isc_result_t
named_server_flushnode(named_server_t *server, isc_lex_t *lex,
bool tree);
isc_boolean_t tree);
/*%
* Report the server's status.
@@ -262,7 +259,7 @@ named_server_tsigdelete(named_server_t *server, isc_lex_t *lex,
* Enable or disable updates for a zone.
*/
isc_result_t
named_server_freeze(named_server_t *server, bool freeze,
named_server_freeze(named_server_t *server, isc_boolean_t freeze,
isc_lex_t *lex, isc_buffer_t **text);
/*%
@@ -342,7 +339,7 @@ named_server_zonestatus(named_server_t *server, isc_lex_t *lex,
*/
isc_result_t
named_server_nta(named_server_t *server, isc_lex_t *lex,
bool readonly, isc_buffer_t **text);
isc_boolean_t readonly, isc_buffer_t **text);
/*%
* Generates a test sequence that is only for use in system tests. The
+3 -4
View File
@@ -14,7 +14,6 @@
/*! \file */
#include <stdbool.h>
#include <isc/lang.h>
#include <isc/types.h>
@@ -42,13 +41,13 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
* \li 'zone' to be initialized.
*/
bool
isc_boolean_t
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig);
/*%<
* If 'zone' can be safely reconfigured according to the configuration
* data in 'zconfig', return true. If the configuration data is so
* data in 'zconfig', return ISC_TRUE. If the configuration data is so
* different from the current zone state that the zone needs to be destroyed
* and recreated, return false.
* and recreated, return ISC_FALSE.
*/
isc_result_t
+1 -1
View File
@@ -50,7 +50,7 @@ static isc_logmodule_t modules[] = {
};
isc_result_t
named_log_init(bool safe) {
named_log_init(isc_boolean_t safe) {
isc_result_t result;
isc_logconfig_t *lcfg = NULL;
+6 -10
View File
@@ -13,9 +13,6 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <isc/file.h>
#include <isc/offset.h>
#include <isc/print.h>
@@ -139,10 +136,10 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
cfg_tuple_get(fileobj, "versions");
const cfg_obj_t *suffixobj =
cfg_tuple_get(fileobj, "suffix");
int32_t versions = ISC_LOG_ROLLNEVER;
isc_int32_t versions = ISC_LOG_ROLLNEVER;
isc_log_rollsuffix_t suffix = isc_log_rollsuffix_increment;
isc_offset_t size = 0;
uint64_t maxoffset;
isc_uint64_t maxoffset;
/*
* isc_offset_t is a signed integer type, so the maximum
@@ -157,7 +154,6 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
break;
default:
INSIST(0);
ISC_UNREACHABLE();
}
type = ISC_LOG_TOFILE;
@@ -306,8 +302,8 @@ named_logconfig(isc_logconfig_t *logconfig, const cfg_obj_t *logstmt) {
const cfg_obj_t *channels = NULL;
const cfg_obj_t *categories = NULL;
const cfg_listelt_t *element;
bool default_set = false;
bool unmatched_set = false;
isc_boolean_t default_set = ISC_FALSE;
isc_boolean_t unmatched_set = ISC_FALSE;
const cfg_obj_t *catname;
if (logconfig != NULL)
@@ -332,12 +328,12 @@ named_logconfig(isc_logconfig_t *logconfig, const cfg_obj_t *logstmt) {
if (!default_set) {
catname = cfg_tuple_get(category, "name");
if (strcmp(cfg_obj_asstring(catname), "default") == 0)
default_set = true;
default_set = ISC_TRUE;
}
if (!unmatched_set) {
catname = cfg_tuple_get(category, "name");
if (strcmp(cfg_obj_asstring(catname), "unmatched") == 0)
unmatched_set = true;
unmatched_set = ISC_TRUE;
}
}
+76 -82
View File
@@ -14,8 +14,6 @@
#include <config.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
@@ -113,7 +111,7 @@ LIBDNS_EXTERNAL_DATA extern unsigned int dns_zone_mkey_hour;
LIBDNS_EXTERNAL_DATA extern unsigned int dns_zone_mkey_day;
LIBDNS_EXTERNAL_DATA extern unsigned int dns_zone_mkey_month;
static bool want_stats = false;
static isc_boolean_t want_stats = ISC_FALSE;
static char program_name[ISC_DIR_NAMEMAX] = "named";
static char absolute_conffile[ISC_DIR_PATHMAX];
static char saved_command_line[512];
@@ -124,22 +122,22 @@ static int maxudp = 0;
/*
* -T options:
*/
static bool clienttest = false;
static bool dropedns = false;
static bool noedns = false;
static bool nosoa = false;
static bool noaa = false;
static isc_boolean_t clienttest = ISC_FALSE;
static isc_boolean_t dropedns = ISC_FALSE;
static isc_boolean_t noedns = ISC_FALSE;
static isc_boolean_t nosoa = ISC_FALSE;
static isc_boolean_t noaa = ISC_FALSE;
static unsigned int delay = 0;
static bool nonearest = false;
static bool notcp = false;
static bool fixedlocal = false;
static bool sigvalinsecs = false;
static isc_boolean_t nonearest = ISC_FALSE;
static isc_boolean_t notcp = ISC_FALSE;
static isc_boolean_t fixedlocal = ISC_FALSE;
static isc_boolean_t sigvalinsecs = ISC_FALSE;
/*
* -4 and -6
*/
static bool disable6 = false;
static bool disable4 = false;
static isc_boolean_t disable6 = ISC_FALSE;
static isc_boolean_t disable4 = ISC_FALSE;
void
named_main_earlywarning(const char *format, ...) {
@@ -342,7 +340,7 @@ save_command_line(int argc, char *argv[]) {
char *dst;
char *eob;
const char truncated[] = "...";
bool quoted = false;
isc_boolean_t quoted = ISC_FALSE;
dst = saved_command_line;
eob = saved_command_line + sizeof(saved_command_line);
@@ -362,10 +360,10 @@ save_command_line(int argc, char *argv[]) {
*src == '-' || *src == '_' ||
*src == '.' || *src == '/') {
*dst++ = *src++;
quoted = false;
quoted = ISC_FALSE;
} else {
*dst++ = '\\';
quoted = true;
quoted = ISC_TRUE;
}
}
}
@@ -396,25 +394,25 @@ parse_int(char *arg, const char *desc) {
static struct flag_def {
const char *name;
unsigned int value;
bool negate;
isc_boolean_t negate;
} mem_debug_flags[] = {
{ "none", 0, false },
{ "trace", ISC_MEM_DEBUGTRACE, false },
{ "record", ISC_MEM_DEBUGRECORD, false },
{ "usage", ISC_MEM_DEBUGUSAGE, false },
{ "size", ISC_MEM_DEBUGSIZE, false },
{ "mctx", ISC_MEM_DEBUGCTX, false },
{ NULL, 0, false }
{ "none", 0, ISC_FALSE },
{ "trace", ISC_MEM_DEBUGTRACE, ISC_FALSE },
{ "record", ISC_MEM_DEBUGRECORD, ISC_FALSE },
{ "usage", ISC_MEM_DEBUGUSAGE, ISC_FALSE },
{ "size", ISC_MEM_DEBUGSIZE, ISC_FALSE },
{ "mctx", ISC_MEM_DEBUGCTX, ISC_FALSE },
{ NULL, 0, ISC_FALSE }
}, mem_context_flags[] = {
{ "external", ISC_MEMFLAG_INTERNAL, true },
{ "fill", ISC_MEMFLAG_FILL, false },
{ "nofill", ISC_MEMFLAG_FILL, true },
{ NULL, 0, false }
{ "external", ISC_MEMFLAG_INTERNAL, ISC_TRUE },
{ "fill", ISC_MEMFLAG_FILL, ISC_FALSE },
{ "nofill", ISC_MEMFLAG_FILL, ISC_TRUE },
{ NULL, 0, ISC_FALSE }
};
static void
set_flags(const char *arg, struct flag_def *defs, unsigned int *ret) {
bool clear = false;
isc_boolean_t clear = ISC_FALSE;
for (;;) {
const struct flag_def *def;
@@ -427,7 +425,7 @@ set_flags(const char *arg, struct flag_def *defs, unsigned int *ret) {
if (arglen == (int)strlen(def->name) &&
memcmp(arg, def->name, arglen) == 0) {
if (def->value == 0)
clear = true;
clear = ISC_TRUE;
if (def->negate)
*ret &= ~(def->value);
else
@@ -484,29 +482,29 @@ parse_T_opt(char *option) {
* expected and assert otherwise.
*/
if (!strcmp(option, "clienttest")) {
clienttest = true;
clienttest = ISC_TRUE;
} else if (!strncmp(option, "delay=", 6)) {
delay = atoi(option + 6);
} else if (!strcmp(option, "dropedns")) {
dropedns = true;
dropedns = ISC_TRUE;
} else if (!strncmp(option, "dscp=", 5)) {
isc_dscp_check_value = atoi(option + 5);
} else if (!strcmp(option, "fixedlocal")) {
fixedlocal = true;
fixedlocal = ISC_TRUE;
} else if (!strcmp(option, "keepstderr")) {
named_g_keepstderr = true;
named_g_keepstderr = ISC_TRUE;
} else if (!strcmp(option, "noaa")) {
noaa = true;
noaa = ISC_TRUE;
} else if (!strcmp(option, "noedns")) {
noedns = true;
noedns = ISC_TRUE;
} else if (!strcmp(option, "nonearest")) {
nonearest = true;
nonearest = ISC_TRUE;
} else if (!strcmp(option, "nosoa")) {
nosoa = true;
nosoa = ISC_TRUE;
} else if (!strcmp(option, "nosyslog")) {
named_g_nosyslog = true;
named_g_nosyslog = ISC_TRUE;
} else if (!strcmp(option, "notcp")) {
notcp = true;
notcp = ISC_TRUE;
} else if (!strcmp(option, "maxudp512")) {
maxudp = 512;
} else if (!strcmp(option, "maxudp1460")) {
@@ -546,7 +544,7 @@ parse_T_opt(char *option) {
named_main_earlyfatal("bad mkeytimer");
}
} else if (!strcmp(option, "sigvalinsecs")) {
sigvalinsecs = true;
sigvalinsecs = ISC_TRUE;
} else if (!strncmp(option, "tat=", 4)) {
named_g_tat_interval = atoi(option + 4);
} else {
@@ -566,7 +564,7 @@ parse_command_line(int argc, char *argv[]) {
* NAMED_MAIN_ARGS is defined in main.h, so that it can be used
* both by named and by ntservice hooks.
*/
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv,
NAMED_MAIN_ARGS)) != -1)
{
@@ -579,7 +577,7 @@ parse_command_line(int argc, char *argv[]) {
named_main_earlyfatal("IPv4 not supported "
"by OS");
isc_net_disableipv6();
disable6 = true;
disable6 = ISC_TRUE;
break;
case '6':
if (disable6)
@@ -589,14 +587,14 @@ parse_command_line(int argc, char *argv[]) {
named_main_earlyfatal("IPv6 not supported "
"by OS");
isc_net_disableipv4();
disable4 = true;
disable4 = ISC_TRUE;
break;
case 'A':
parse_fuzz_arg();
break;
case 'c':
named_g_conffile = isc_commandline_argument;
named_g_conffileset = true;
named_g_conffileset = ISC_TRUE;
break;
case 'd':
named_g_debuglevel = parse_int(isc_commandline_argument,
@@ -609,11 +607,11 @@ parse_command_line(int argc, char *argv[]) {
named_g_engine = isc_commandline_argument;
break;
case 'f':
named_g_foreground = true;
named_g_foreground = ISC_TRUE;
break;
case 'g':
named_g_foreground = true;
named_g_logstderr = true;
named_g_foreground = ISC_TRUE;
named_g_logstderr = ISC_TRUE;
break;
case 'L':
named_g_logfile = isc_commandline_argument;
@@ -642,7 +640,7 @@ parse_command_line(int argc, char *argv[]) {
break;
case 's':
/* XXXRTH temporary syntax */
want_stats = true;
want_stats = ISC_TRUE;
break;
case 'S':
maxsocks = parse_int(isc_commandline_argument,
@@ -735,7 +733,7 @@ parse_command_line(int argc, char *argv[]) {
/* Obsolete. No longer in use. Ignore. */
break;
case 'X':
named_g_forcelock = true;
named_g_forcelock = ISC_TRUE;
if (strcasecmp(isc_commandline_argument, "none") != 0)
named_g_defaultlockfile =
isc_commandline_argument;
@@ -1043,7 +1041,7 @@ setup(void) {
*/
named_os_minprivs();
result = named_log_init((named_g_username != NULL));
result = named_log_init(ISC_TF(named_g_username != NULL));
if (result != ISC_R_SUCCESS)
named_main_earlyfatal("named_log_init() failed: %s",
isc_result_totext(result));
@@ -1190,20 +1188,14 @@ setup(void) {
/*
* Get the initial resource limits.
*/
#ifndef WIN32
RUNTIME_CHECK(isc_resource_getlimit(isc_resource_stacksize,
&named_g_initstacksize)
== ISC_R_SUCCESS);
RUNTIME_CHECK(isc_resource_getlimit(isc_resource_datasize,
&named_g_initdatasize)
== ISC_R_SUCCESS);
RUNTIME_CHECK(isc_resource_getlimit(isc_resource_coresize,
&named_g_initcoresize)
== ISC_R_SUCCESS);
#endif
RUNTIME_CHECK(isc_resource_getlimit(isc_resource_openfiles,
&named_g_initopenfiles)
== ISC_R_SUCCESS);
(void)isc_resource_getlimit(isc_resource_stacksize,
&named_g_initstacksize);
(void)isc_resource_getlimit(isc_resource_datasize,
&named_g_initdatasize);
(void)isc_resource_getlimit(isc_resource_coresize,
&named_g_initcoresize);
(void)isc_resource_getlimit(isc_resource_openfiles,
&named_g_initopenfiles);
/*
* System resources cannot effectively be tuned on some systems.
@@ -1211,15 +1203,14 @@ setup(void) {
*/
old_openfiles = named_g_initopenfiles;
named_os_adjustnofile();
RUNTIME_CHECK(isc_resource_getlimit(isc_resource_openfiles,
&named_g_initopenfiles)
== ISC_R_SUCCESS);
(void)isc_resource_getlimit(isc_resource_openfiles,
&named_g_initopenfiles);
if (old_openfiles != named_g_initopenfiles) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"adjusted limit on open files from "
"%" PRIu64 " to "
"%" PRIu64,
"%" ISC_PRINT_QUADFORMAT "u to "
"%" ISC_PRINT_QUADFORMAT "u",
old_openfiles, named_g_initopenfiles);
}
@@ -1286,27 +1277,27 @@ setup(void) {
* Modify server context according to command line options
*/
if (clienttest)
ns_server_setoption(sctx, NS_SERVER_CLIENTTEST, true);
ns_server_setoption(sctx, NS_SERVER_CLIENTTEST, ISC_TRUE);
if (dropedns)
ns_server_setoption(sctx, NS_SERVER_DROPEDNS, true);
ns_server_setoption(sctx, NS_SERVER_DROPEDNS, ISC_TRUE);
if (noedns)
ns_server_setoption(sctx, NS_SERVER_NOEDNS, true);
ns_server_setoption(sctx, NS_SERVER_NOEDNS, ISC_TRUE);
if (nosoa)
ns_server_setoption(sctx, NS_SERVER_NOSOA, true);
ns_server_setoption(sctx, NS_SERVER_NOSOA, ISC_TRUE);
if (noaa)
ns_server_setoption(sctx, NS_SERVER_NOAA, true);
ns_server_setoption(sctx, NS_SERVER_NOAA, ISC_TRUE);
if (nonearest)
ns_server_setoption(sctx, NS_SERVER_NONEAREST, true);
ns_server_setoption(sctx, NS_SERVER_NONEAREST, ISC_TRUE);
if (notcp)
ns_server_setoption(sctx, NS_SERVER_NOTCP, true);
ns_server_setoption(sctx, NS_SERVER_NOTCP, ISC_TRUE);
if (fixedlocal)
ns_server_setoption(sctx, NS_SERVER_FIXEDLOCAL, true);
ns_server_setoption(sctx, NS_SERVER_FIXEDLOCAL, ISC_TRUE);
if (disable4)
ns_server_setoption(sctx, NS_SERVER_DISABLE4, true);
ns_server_setoption(sctx, NS_SERVER_DISABLE4, ISC_TRUE);
if (disable6)
ns_server_setoption(sctx, NS_SERVER_DISABLE6, true);
ns_server_setoption(sctx, NS_SERVER_DISABLE6, ISC_TRUE);
if (sigvalinsecs)
ns_server_setoption(sctx, NS_SERVER_SIGVALINSECS, true);
ns_server_setoption(sctx, NS_SERVER_SIGVALINSECS, ISC_TRUE);
named_g_server->sctx->delay = delay;
@@ -1466,6 +1457,9 @@ main(int argc, char *argv[]) {
if (result != ISC_R_SUCCESS)
named_main_earlyfatal("program name too long");
if (result != ISC_R_SUCCESS)
named_main_earlyfatal("failed to build internal symbol table");
isc_assertion_setcallback(assertion_failed);
isc_error_setfatal(library_fatal_error);
isc_error_setunexpected(library_unexpected_error);
+11 -10
View File
@@ -891,7 +891,8 @@ view \fIstring\fR [ \fIclass\fR ] {
request\-expire \fIboolean\fR;
request\-ixfr \fIboolean\fR;
serial\-update\-method ( date | increment | unixtime );
server\-addresses { ( \fIipv4_address\fR | \fIipv6_address\fR ); \&.\&.\&. };
server\-addresses { ( \fIipv4_address\fR | \fIipv6_address\fR ) [
port \fIinteger\fR ]; \&.\&.\&. };
server\-names { \fIquoted_string\fR; \&.\&.\&. };
sig\-signing\-nodes \fIinteger\fR;
sig\-signing\-signatures \fIinteger\fR;
@@ -906,10 +907,10 @@ view \fIstring\fR [ \fIclass\fR ] {
| slave | static\-stub | stub );
update\-check\-ksk \fIboolean\fR;
update\-policy ( local | { ( deny | grant ) \fIstring\fR (
6to4\-self | external | krb5\-self | krb5\-selfsub |
krb5\-subdomain | ms\-self | ms\-selfsub | ms\-subdomain |
name | self | selfsub | selfwild | subdomain | tcp\-self
| wildcard | zonesub ) [ \fIstring\fR ] \fIrrtypelist\fR; \&.\&.\&. };
6to4\-self | external | krb5\-self | krb5\-subdomain |
ms\-self | ms\-subdomain | name | self | selfsub |
selfwild | subdomain | tcp\-self | wildcard | zonesub )
[ \fIstring\fR ] \fIrrtypelist\fR; \&.\&.\&. };
use\-alt\-transfer\-source \fIboolean\fR;
zero\-no\-soa\-ttl \fIboolean\fR;
zone\-statistics ( full | terse | none | \fIboolean\fR );
@@ -995,7 +996,8 @@ zone \fIstring\fR [ \fIclass\fR ] {
request\-expire \fIboolean\fR;
request\-ixfr \fIboolean\fR;
serial\-update\-method ( date | increment | unixtime );
server\-addresses { ( \fIipv4_address\fR | \fIipv6_address\fR ); \&.\&.\&. };
server\-addresses { ( \fIipv4_address\fR | \fIipv6_address\fR ) [ port
\fIinteger\fR ]; \&.\&.\&. };
server\-names { \fIquoted_string\fR; \&.\&.\&. };
sig\-signing\-nodes \fIinteger\fR;
sig\-signing\-signatures \fIinteger\fR;
@@ -1010,10 +1012,9 @@ zone \fIstring\fR [ \fIclass\fR ] {
| static\-stub | stub );
update\-check\-ksk \fIboolean\fR;
update\-policy ( local | { ( deny | grant ) \fIstring\fR ( 6to4\-self |
external | krb5\-self | krb5\-selfsub | krb5\-subdomain | ms\-self
| ms\-selfsub | ms\-subdomain | name | self | selfsub | selfwild
| subdomain | tcp\-self | wildcard | zonesub ) [ \fIstring\fR ]
\fIrrtypelist\fR; \&.\&.\&. };
external | krb5\-self | krb5\-subdomain | ms\-self | ms\-subdomain
| name | self | selfsub | selfwild | subdomain | tcp\-self |
wildcard | zonesub ) [ \fIstring\fR ] \fIrrtypelist\fR; \&.\&.\&. };
use\-alt\-transfer\-source \fIboolean\fR;
zero\-no\-soa\-ttl \fIboolean\fR;
zone\-statistics ( full | terse | none | \fIboolean\fR );
+11 -11
View File
@@ -48,7 +48,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
@@ -869,7 +868,8 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
request-expire <replaceable>boolean</replaceable>;
request-ixfr <replaceable>boolean</replaceable>;
serial-update-method ( date | increment | unixtime );
server-addresses { ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> ); ... };
server-addresses { ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> ) [
port <replaceable>integer</replaceable> ]; ... };
server-names { <replaceable>quoted_string</replaceable>; ... };
sig-signing-nodes <replaceable>integer</replaceable>;
sig-signing-signatures <replaceable>integer</replaceable>;
@@ -884,10 +884,10 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
| slave | static-stub | stub );
update-check-ksk <replaceable>boolean</replaceable>;
update-policy ( local | { ( deny | grant ) <replaceable>string</replaceable> (
6to4-self | external | krb5-self | krb5-selfsub |
krb5-subdomain | ms-self | ms-selfsub | ms-subdomain |
name | self | selfsub | selfwild | subdomain | tcp-self
| wildcard | zonesub ) [ <replaceable>string</replaceable> ] <replaceable>rrtypelist</replaceable>; ... };
6to4-self | external | krb5-self | krb5-subdomain |
ms-self | ms-subdomain | name | self | selfsub |
selfwild | subdomain | tcp-self | wildcard | zonesub )
[ <replaceable>string</replaceable> ] <replaceable>rrtypelist</replaceable>; ... };
use-alt-transfer-source <replaceable>boolean</replaceable>;
zero-no-soa-ttl <replaceable>boolean</replaceable>;
zone-statistics ( full | terse | none | <replaceable>boolean</replaceable> );
@@ -969,7 +969,8 @@ zone <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
request-expire <replaceable>boolean</replaceable>;
request-ixfr <replaceable>boolean</replaceable>;
serial-update-method ( date | increment | unixtime );
server-addresses { ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> ); ... };
server-addresses { ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> ) [ port
<replaceable>integer</replaceable> ]; ... };
server-names { <replaceable>quoted_string</replaceable>; ... };
sig-signing-nodes <replaceable>integer</replaceable>;
sig-signing-signatures <replaceable>integer</replaceable>;
@@ -984,10 +985,9 @@ zone <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
| static-stub | stub );
update-check-ksk <replaceable>boolean</replaceable>;
update-policy ( local | { ( deny | grant ) <replaceable>string</replaceable> ( 6to4-self |
external | krb5-self | krb5-selfsub | krb5-subdomain | ms-self
| ms-selfsub | ms-subdomain | name | self | selfsub | selfwild
| subdomain | tcp-self | wildcard | zonesub ) [ <replaceable>string</replaceable> ]
<replaceable>rrtypelist</replaceable>; ... };
external | krb5-self | krb5-subdomain | ms-self | ms-subdomain
| name | self | selfsub | selfwild | subdomain | tcp-self |
wildcard | zonesub ) [ <replaceable>string</replaceable> ] <replaceable>rrtypelist</replaceable>; ... };
use-alt-transfer-source <replaceable>boolean</replaceable>;
zero-no-soa-ttl <replaceable>boolean</replaceable>;
zone-statistics ( full | terse | none | <replaceable>boolean</replaceable> );
+11 -10
View File
@@ -860,7 +860,8 @@ view
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>
server-addresses { ( <em class="replaceable"><code>ipv4_address</code></em> | <em class="replaceable"><code>ipv6_address</code></em> ); ... };<br>
server-addresses { ( <em class="replaceable"><code>ipv4_address</code></em> | <em class="replaceable"><code>ipv6_address</code></em> ) [<br>
    port <em class="replaceable"><code>integer</code></em> ]; ... };<br>
server-names { <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
sig-signing-nodes <em class="replaceable"><code>integer</code></em>;<br>
sig-signing-signatures <em class="replaceable"><code>integer</code></em>;<br>
@@ -875,10 +876,10 @@ view
    | slave | static-stub | stub );<br>
update-check-ksk <em class="replaceable"><code>boolean</code></em>;<br>
update-policy ( local | { ( deny | grant ) <em class="replaceable"><code>string</code></em> (<br>
    6to4-self | external | krb5-self | krb5-selfsub |<br>
    krb5-subdomain | ms-self | ms-selfsub | ms-subdomain |<br>
    name | self | selfsub | selfwild | subdomain | tcp-self<br>
    | wildcard | zonesub ) [ <em class="replaceable"><code>string</code></em> ] <em class="replaceable"><code>rrtypelist</code></em>; ... };<br>
    6to4-self | external | krb5-self | krb5-subdomain |<br>
    ms-self | ms-subdomain | name | self | selfsub |<br>
    selfwild | subdomain | tcp-self | wildcard | zonesub )<br>
    [ <em class="replaceable"><code>string</code></em> ] <em class="replaceable"><code>rrtypelist</code></em>; ... };<br>
use-alt-transfer-source <em class="replaceable"><code>boolean</code></em>;<br>
zero-no-soa-ttl <em class="replaceable"><code>boolean</code></em>;<br>
zone-statistics ( full | terse | none | <em class="replaceable"><code>boolean</code></em> );<br>
@@ -961,7 +962,8 @@ zone
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>
server-addresses { ( <em class="replaceable"><code>ipv4_address</code></em> | <em class="replaceable"><code>ipv6_address</code></em> ); ... };<br>
server-addresses { ( <em class="replaceable"><code>ipv4_address</code></em> | <em class="replaceable"><code>ipv6_address</code></em> ) [ port<br>
    <em class="replaceable"><code>integer</code></em> ]; ... };<br>
server-names { <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
sig-signing-nodes <em class="replaceable"><code>integer</code></em>;<br>
sig-signing-signatures <em class="replaceable"><code>integer</code></em>;<br>
@@ -976,10 +978,9 @@ zone
    | static-stub | stub );<br>
update-check-ksk <em class="replaceable"><code>boolean</code></em>;<br>
update-policy ( local | { ( deny | grant ) <em class="replaceable"><code>string</code></em> ( 6to4-self |<br>
    external | krb5-self | krb5-selfsub | krb5-subdomain | ms-self<br>
    | ms-selfsub | ms-subdomain | name | self | selfsub | selfwild<br>
    | subdomain | tcp-self | wildcard | zonesub ) [ <em class="replaceable"><code>string</code></em> ]<br>
    <em class="replaceable"><code>rrtypelist</code></em>; ... };<br>
    external | krb5-self | krb5-subdomain | ms-self | ms-subdomain<br>
    | name | self | selfsub | selfwild | subdomain | tcp-self |<br>
    wildcard | zonesub ) [ <em class="replaceable"><code>string</code></em> ] <em class="replaceable"><code>rrtypelist</code></em>; ... };<br>
use-alt-transfer-source <em class="replaceable"><code>boolean</code></em>;<br>
zero-no-soa-ttl <em class="replaceable"><code>boolean</code></em>;<br>
zone-statistics ( full | terse | none | <em class="replaceable"><code>boolean</code></em> );<br>
-1
View File
@@ -48,7 +48,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+622 -844
View File
File diff suppressed because it is too large Load Diff
+69 -72
View File
@@ -13,9 +13,6 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <isc/buffer.h>
#include <isc/httpd.h>
#include <isc/json.h>
@@ -70,7 +67,7 @@ stats_dumparg {
void *arg; /* type dependent argument */
int ncounters; /* for general statistics */
int *counterindices; /* for general statistics */
uint64_t *countervalues; /* for general statistics */
isc_uint64_t *countervalues; /* for general statistics */
isc_result_t result;
} stats_dumparg_t;
@@ -1051,7 +1048,7 @@ init_desc(void) {
* Dump callback functions.
*/
static void
generalstat_dump(isc_statscounter_t counter, uint64_t val, void *arg) {
generalstat_dump(isc_statscounter_t counter, isc_uint64_t val, void *arg) {
stats_dumparg_t *dumparg = arg;
REQUIRE(counter < dumparg->ncounters);
@@ -1061,10 +1058,10 @@ generalstat_dump(isc_statscounter_t counter, uint64_t val, void *arg) {
static isc_result_t
dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
const char *category, const char **desc, int ncounters,
int *indices, uint64_t *values, int options)
int *indices, isc_uint64_t *values, int options)
{
int i, idx;
uint64_t value;
isc_uint64_t value;
stats_dumparg_t dumparg;
FILE *fp;
#ifdef HAVE_LIBXML2
@@ -1109,7 +1106,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
switch (dumparg.type) {
case isc_statsformat_file:
fp = arg;
fprintf(fp, "%20" PRIu64 " %s\n",
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
value, desc[idx]);
break;
case isc_statsformat_xml:
@@ -1137,7 +1134,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
ISC_XMLCHAR
"counter"));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" PRIu64, value));
"%" ISC_PRINT_QUADFORMAT "u", value));
TRY0(xmlTextWriterEndElement(writer));
/* </counter> */
@@ -1154,7 +1151,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
ISC_XMLCHAR
desc[idx]));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" PRIu64, value));
"%" ISC_PRINT_QUADFORMAT "u", value));
TRY0(xmlTextWriterEndElement(writer));
/* counter */
}
@@ -1182,7 +1179,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
}
static void
rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
char typebuf[64];
const char *typestr;
stats_dumparg_t *dumparg = arg;
@@ -1206,7 +1203,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
switch (dumparg->type) {
case isc_statsformat_file:
fp = dumparg->arg;
fprintf(fp, "%20" PRIu64 " %s\n", val, typestr);
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, typestr);
break;
case isc_statsformat_xml:
#ifdef HAVE_LIBXML2
@@ -1218,7 +1215,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
ISC_XMLCHAR typestr));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" PRIu64,
"%" ISC_PRINT_QUADFORMAT "u",
val));
TRY0(xmlTextWriterEndElement(writer)); /* type */
@@ -1246,13 +1243,13 @@ rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
}
static void
rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
stats_dumparg_t *dumparg = arg;
FILE *fp;
char typebuf[64];
const char *typestr;
bool nxrrset = false;
bool stale = false;
isc_boolean_t nxrrset = ISC_FALSE;
isc_boolean_t stale = ISC_FALSE;
#ifdef HAVE_LIBXML2
xmlTextWriterPtr writer;
int xmlrc;
@@ -1276,16 +1273,16 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
if ((DNS_RDATASTATSTYPE_ATTR(type) & DNS_RDATASTATSTYPE_ATTR_NXRRSET)
!= 0)
nxrrset = true;
nxrrset = ISC_TRUE;
if ((DNS_RDATASTATSTYPE_ATTR(type) & DNS_RDATASTATSTYPE_ATTR_STALE)
!= 0)
stale = true;
stale = ISC_TRUE;
switch (dumparg->type) {
case isc_statsformat_file:
fp = dumparg->arg;
fprintf(fp, "%20" PRIu64 " %s%s%s\n", val,
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s%s%s\n", val,
stale ? "#" : "", nxrrset ? "!" : "", typestr);
break;
case isc_statsformat_xml:
@@ -1301,7 +1298,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counter"));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" PRIu64,
"%" ISC_PRINT_QUADFORMAT "u",
val));
TRY0(xmlTextWriterEndElement(writer)); /* counter */
@@ -1332,7 +1329,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
}
static void
opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
FILE *fp;
isc_buffer_t b;
char codebuf[64];
@@ -1352,7 +1349,7 @@ opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
switch (dumparg->type) {
case isc_statsformat_file:
fp = dumparg->arg;
fprintf(fp, "%20" PRIu64 " %s\n", val, codebuf);
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, codebuf);
break;
case isc_statsformat_xml:
#ifdef HAVE_LIBXML2
@@ -1361,7 +1358,7 @@ opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
ISC_XMLCHAR codebuf ));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" PRIu64,
"%" ISC_PRINT_QUADFORMAT "u",
val));
TRY0(xmlTextWriterEndElement(writer)); /* counter */
#endif
@@ -1389,7 +1386,7 @@ opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
}
static void
rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
FILE *fp;
isc_buffer_t b;
char codebuf[64];
@@ -1409,7 +1406,7 @@ rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
switch (dumparg->type) {
case isc_statsformat_file:
fp = dumparg->arg;
fprintf(fp, "%20" PRIu64 " %s\n", val, codebuf);
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, codebuf);
break;
case isc_statsformat_xml:
#ifdef HAVE_LIBXML2
@@ -1418,7 +1415,7 @@ rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
ISC_XMLCHAR codebuf ));
TRY0(xmlTextWriterWriteFormatString(writer,
"%" PRIu64,
"%" ISC_PRINT_QUADFORMAT "u",
val));
TRY0(xmlTextWriterEndElement(writer)); /* counter */
#endif
@@ -1463,7 +1460,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
isc_result_t result;
char buf[1024 + 32]; /* sufficiently large for zone name and class */
dns_rdataclass_t rdclass;
uint32_t serial;
isc_uint32_t serial;
xmlTextWriterPtr writer = arg;
dns_zonestat_level_t statlevel;
int xmlrc;
@@ -1507,8 +1504,8 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
isc_stats_t *zonestats;
isc_stats_t *gluecachestats;
dns_stats_t *rcvquerystats;
uint64_t nsstat_values[ns_statscounter_max];
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
isc_uint64_t nsstat_values[ns_statscounter_max];
isc_uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
zonestats = dns_zone_getrequeststats(zone);
if (zonestats != NULL) {
@@ -1581,7 +1578,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
}
static isc_result_t
generatexml(named_server_t *server, uint32_t flags,
generatexml(named_server_t *server, isc_uint32_t flags,
int *buflen, xmlChar **buf)
{
char boottime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
@@ -1594,17 +1591,17 @@ generatexml(named_server_t *server, uint32_t flags,
dns_view_t *view;
stats_dumparg_t dumparg;
dns_stats_t *cacherrstats;
uint64_t nsstat_values[ns_statscounter_max];
uint64_t resstat_values[dns_resstatscounter_max];
uint64_t adbstat_values[dns_adbstats_max];
uint64_t zonestat_values[dns_zonestatscounter_max];
uint64_t sockstat_values[isc_sockstatscounter_max];
uint64_t udpinsizestat_values[dns_sizecounter_in_max];
uint64_t udpoutsizestat_values[dns_sizecounter_out_max];
uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
isc_uint64_t nsstat_values[ns_statscounter_max];
isc_uint64_t resstat_values[dns_resstatscounter_max];
isc_uint64_t adbstat_values[dns_adbstats_max];
isc_uint64_t zonestat_values[dns_zonestatscounter_max];
isc_uint64_t sockstat_values[isc_sockstatscounter_max];
isc_uint64_t udpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t udpoutsizestat_values[dns_sizecounter_out_max];
isc_uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
#ifdef HAVE_DNSTAP
uint64_t dnstapstat_values[dns_dnstapcounter_max];
isc_uint64_t dnstapstat_values[dns_dnstapcounter_max];
#endif
isc_result_t result;
@@ -1918,7 +1915,7 @@ generatexml(named_server_t *server, uint32_t flags,
if ((flags & STATS_XML_ZONES) != 0) {
TRY0(xmlTextWriterStartElement(writer,
ISC_XMLCHAR "zones"));
result = dns_zt_apply(view->zonetable, true,
result = dns_zt_apply(view->zonetable, ISC_TRUE,
zone_xmlrender, writer);
if (result != ISC_R_SUCCESS)
goto error;
@@ -2056,7 +2053,7 @@ wrap_xmlfree(isc_buffer_t *buffer, void *arg) {
}
static isc_result_t
render_xml(uint32_t flags, const char *url, isc_httpdurl_t *urlinfo,
render_xml(isc_uint32_t flags, const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
@@ -2231,7 +2228,7 @@ wrap_jsonfree(isc_buffer_t *buffer, void *arg) {
static json_object *
addzone(char *name, char *classname, const char *ztype,
uint32_t serial, bool add_serial)
isc_uint32_t serial, isc_boolean_t add_serial)
{
json_object *node = json_object_new_object();
@@ -2258,7 +2255,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
char *zone_name_only = NULL;
char *class_only = NULL;
dns_rdataclass_t rdclass;
uint32_t serial;
isc_uint32_t serial;
json_object *zonearray = (json_object *) arg;
json_object *zoneobj = NULL;
dns_zonestat_level_t statlevel;
@@ -2276,10 +2273,10 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
if (dns_zone_getserial2(zone, &serial) != ISC_R_SUCCESS)
zoneobj = addzone(zone_name_only, class_only,
user_zonetype(zone), 0, false);
user_zonetype(zone), 0, ISC_FALSE);
else
zoneobj = addzone(zone_name_only, class_only,
user_zonetype(zone), serial, true);
user_zonetype(zone), serial, ISC_TRUE);
if (zoneobj == NULL)
return (ISC_R_NOMEMORY);
@@ -2288,8 +2285,8 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
isc_stats_t *zonestats;
isc_stats_t *gluecachestats;
dns_stats_t *rcvquerystats;
uint64_t nsstat_values[ns_statscounter_max];
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
isc_uint64_t nsstat_values[ns_statscounter_max];
isc_uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
zonestats = dns_zone_getrequeststats(zone);
if (zonestats != NULL) {
@@ -2379,7 +2376,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
static isc_result_t
generatejson(named_server_t *server, size_t *msglen,
const char **msg, json_object **rootp, uint32_t flags)
const char **msg, json_object **rootp, isc_uint32_t flags)
{
dns_view_t *view;
isc_result_t result = ISC_R_SUCCESS;
@@ -2389,17 +2386,17 @@ generatejson(named_server_t *server, size_t *msglen,
json_object *tcpreq4 = NULL, *tcpresp4 = NULL;
json_object *udpreq6 = NULL, *udpresp6 = NULL;
json_object *tcpreq6 = NULL, *tcpresp6 = NULL;
uint64_t nsstat_values[ns_statscounter_max];
uint64_t resstat_values[dns_resstatscounter_max];
uint64_t adbstat_values[dns_adbstats_max];
uint64_t zonestat_values[dns_zonestatscounter_max];
uint64_t sockstat_values[isc_sockstatscounter_max];
uint64_t udpinsizestat_values[dns_sizecounter_in_max];
uint64_t udpoutsizestat_values[dns_sizecounter_out_max];
uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
isc_uint64_t nsstat_values[ns_statscounter_max];
isc_uint64_t resstat_values[dns_resstatscounter_max];
isc_uint64_t adbstat_values[dns_adbstats_max];
isc_uint64_t zonestat_values[dns_zonestatscounter_max];
isc_uint64_t sockstat_values[isc_sockstatscounter_max];
isc_uint64_t udpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t udpoutsizestat_values[dns_sizecounter_out_max];
isc_uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
#ifdef HAVE_DNSTAP
uint64_t dnstapstat_values[dns_dnstapcounter_max];
isc_uint64_t dnstapstat_values[dns_dnstapcounter_max];
#endif
stats_dumparg_t dumparg;
char boottime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
@@ -2612,7 +2609,7 @@ generatejson(named_server_t *server, size_t *msglen,
CHECKMEM(za);
if ((flags & STATS_JSON_ZONES) != 0) {
result = dns_zt_apply(view->zonetable, true,
result = dns_zt_apply(view->zonetable, ISC_TRUE,
zone_jsonrender, za);
if (result != ISC_R_SUCCESS) {
goto error;
@@ -2956,7 +2953,7 @@ generatejson(named_server_t *server, size_t *msglen,
}
static isc_result_t
render_json(uint32_t flags,
render_json(isc_uint32_t flags,
const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers,
void *arg, unsigned int *retcode, const char **retmsg,
@@ -3166,7 +3163,7 @@ shutdown_listener(named_statschannel_t *listener) {
isc_httpdmgr_shutdown(&listener->httpdmgr);
}
static bool
static isc_boolean_t
client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
named_statschannel_t *listener = arg;
dns_aclenv_t *env =
@@ -3184,7 +3181,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
&match, NULL) == ISC_R_SUCCESS && match > 0)
{
UNLOCK(&listener->lock);
return (true);
return (ISC_TRUE);
}
UNLOCK(&listener->lock);
@@ -3193,7 +3190,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"rejected statistics connection from %s", socktext);
return (false);
return (ISC_FALSE);
}
static void
@@ -3265,7 +3262,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
isc_socket_setname(sock, "statchannel", NULL);
#ifndef ISC_ALLOW_MAPPED
isc_socket_ipv6only(sock, true);
isc_socket_ipv6only(sock, ISC_TRUE);
#endif
result = isc_socket_bind(sock, addr, ISC_SOCKET_REUSEADDRESS);
@@ -3320,7 +3317,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/traffic",
render_json_traffic, server);
#endif
isc_httpdmgr_addurl2(listener->httpdmgr, "/bind9.xsl", true,
isc_httpdmgr_addurl2(listener->httpdmgr, "/bind9.xsl", ISC_TRUE,
render_xsl, server);
*listenerp = listener;
@@ -3550,12 +3547,12 @@ named_stats_dump(named_server_t *server, FILE *fp) {
dns_view_t *view;
dns_zone_t *zone, *next;
stats_dumparg_t dumparg;
uint64_t nsstat_values[ns_statscounter_max];
uint64_t resstat_values[dns_resstatscounter_max];
uint64_t adbstat_values[dns_adbstats_max];
uint64_t zonestat_values[dns_zonestatscounter_max];
uint64_t sockstat_values[isc_sockstatscounter_max];
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
isc_uint64_t nsstat_values[ns_statscounter_max];
isc_uint64_t resstat_values[dns_resstatscounter_max];
isc_uint64_t adbstat_values[dns_adbstats_max];
isc_uint64_t zonestat_values[dns_zonestatscounter_max];
isc_uint64_t sockstat_values[isc_sockstatscounter_max];
isc_uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
RUNTIME_CHECK(isc_once_do(&once, init_desc) == ISC_R_SUCCESS);
+2 -4
View File
@@ -14,8 +14,6 @@
#include <config.h>
#include <inttypes.h>
#include <isc/buffer.h>
#include <isc/string.h> /* Required for HP/UX (and others?) */
#include <isc/mem.h>
@@ -52,7 +50,7 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
isc_result_t result;
dns_tkeyctx_t *tctx = NULL;
const char *s;
uint32_t n;
isc_uint32_t n;
dns_fixedname_t fname;
dns_name_t *name;
isc_buffer_t b;
@@ -103,7 +101,7 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
isc_buffer_add(&b, strlen(s));
name = dns_fixedname_initname(&fname);
RETERR(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
RETERR(dst_gssapi_acquirecred(name, false, &tctx->gsscred));
RETERR(dst_gssapi_acquirecred(name, ISC_FALSE, &tctx->gsscred));
}
obj = NULL;
+2 -4
View File
@@ -14,8 +14,6 @@
#include <config.h>
#include <inttypes.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/mem.h>
@@ -45,7 +43,7 @@ add_initial_keys(const cfg_obj_t *list, dns_tsig_keyring_t *ring,
int secretlen = 0;
isc_result_t ret;
isc_stdtime_t now;
uint16_t bits;
isc_uint16_t bits;
for (element = cfg_list_first(list);
element != NULL;
@@ -111,7 +109,7 @@ add_initial_keys(const cfg_obj_t *list, dns_tsig_keyring_t *ring,
isc_stdtime_get(&now);
ret = dns_tsigkey_create(&keyname, alg, secret, secretlen,
false, NULL, now, now,
ISC_FALSE, NULL, now, now,
mctx, ring, &tsigkey);
isc_mem_put(mctx, secret, secretalloc);
secret = NULL;
+28 -30
View File
@@ -13,10 +13,8 @@
#include <config.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <dns/log.h>
@@ -45,7 +43,7 @@ typedef struct dlopen_data {
unsigned int flags;
isc_mutex_t lock;
int version;
bool in_configure;
isc_boolean_t in_configure;
dlz_dlopen_version_t *dlz_version;
dlz_dlopen_create_t *dlz_create;
@@ -68,14 +66,14 @@ typedef struct dlopen_data {
#define MAYBE_LOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
cd->in_configure == false) \
cd->in_configure == ISC_FALSE) \
LOCK(&cd->lock); \
} while (0)
#define MAYBE_UNLOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
cd->in_configure == false) \
cd->in_configure == ISC_FALSE) \
UNLOCK(&cd->lock); \
} while (0)
@@ -195,7 +193,7 @@ dlopen_dlz_lookup(const char *zone, const char *name, void *driverarg,
* Load a symbol from the library
*/
static void *
dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
dl_load_symbol(dlopen_data_t *cd, const char *symbol, isc_boolean_t mandatory) {
void *ptr = dlsym(cd->dl_handle, symbol);
if (ptr == NULL && mandatory) {
dlopen_log(ISC_LOG_ERROR,
@@ -259,7 +257,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
/* Open the library */
dlopen_flags = RTLD_NOW|RTLD_GLOBAL;
#if defined(RTLD_DEEPBIND) && !__SANITIZE_ADDRESS__
#ifdef RTLD_DEEPBIND
/*
* If RTLD_DEEPBIND is available then use it. This can avoid
* issues with a module using a different version of a system
@@ -283,13 +281,13 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
/* Find the symbols */
cd->dlz_version = (dlz_dlopen_version_t *)
dl_load_symbol(cd, "dlz_version", true);
dl_load_symbol(cd, "dlz_version", ISC_TRUE);
cd->dlz_create = (dlz_dlopen_create_t *)
dl_load_symbol(cd, "dlz_create", true);
dl_load_symbol(cd, "dlz_create", ISC_TRUE);
cd->dlz_lookup = (dlz_dlopen_lookup_t *)
dl_load_symbol(cd, "dlz_lookup", true);
dl_load_symbol(cd, "dlz_lookup", ISC_TRUE);
cd->dlz_findzonedb = (dlz_dlopen_findzonedb_t *)
dl_load_symbol(cd, "dlz_findzonedb", true);
dl_load_symbol(cd, "dlz_findzonedb", ISC_TRUE);
if (cd->dlz_create == NULL ||
cd->dlz_version == NULL ||
@@ -302,29 +300,29 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
}
cd->dlz_allowzonexfr = (dlz_dlopen_allowzonexfr_t *)
dl_load_symbol(cd, "dlz_allowzonexfr", false);
dl_load_symbol(cd, "dlz_allowzonexfr", ISC_FALSE);
cd->dlz_allnodes = (dlz_dlopen_allnodes_t *)
dl_load_symbol(cd, "dlz_allnodes",
(cd->dlz_allowzonexfr != NULL));
ISC_TF(cd->dlz_allowzonexfr != NULL));
cd->dlz_authority = (dlz_dlopen_authority_t *)
dl_load_symbol(cd, "dlz_authority", false);
dl_load_symbol(cd, "dlz_authority", ISC_FALSE);
cd->dlz_newversion = (dlz_dlopen_newversion_t *)
dl_load_symbol(cd, "dlz_newversion", false);
dl_load_symbol(cd, "dlz_newversion", ISC_FALSE);
cd->dlz_closeversion = (dlz_dlopen_closeversion_t *)
dl_load_symbol(cd, "dlz_closeversion",
(cd->dlz_newversion != NULL));
ISC_TF(cd->dlz_newversion != NULL));
cd->dlz_configure = (dlz_dlopen_configure_t *)
dl_load_symbol(cd, "dlz_configure", false);
dl_load_symbol(cd, "dlz_configure", ISC_FALSE);
cd->dlz_ssumatch = (dlz_dlopen_ssumatch_t *)
dl_load_symbol(cd, "dlz_ssumatch", false);
dl_load_symbol(cd, "dlz_ssumatch", ISC_FALSE);
cd->dlz_addrdataset = (dlz_dlopen_addrdataset_t *)
dl_load_symbol(cd, "dlz_addrdataset", false);
dl_load_symbol(cd, "dlz_addrdataset", ISC_FALSE);
cd->dlz_subrdataset = (dlz_dlopen_subrdataset_t *)
dl_load_symbol(cd, "dlz_subrdataset", false);
dl_load_symbol(cd, "dlz_subrdataset", ISC_FALSE);
cd->dlz_delrdataset = (dlz_dlopen_delrdataset_t *)
dl_load_symbol(cd, "dlz_delrdataset", false);
dl_load_symbol(cd, "dlz_delrdataset", ISC_FALSE);
cd->dlz_destroy = (dlz_dlopen_destroy_t *)
dl_load_symbol(cd, "dlz_destroy", false);
dl_load_symbol(cd, "dlz_destroy", ISC_FALSE);
/* Check the version of the API is the same */
cd->version = cd->dlz_version(&cd->flags);
@@ -437,7 +435,7 @@ dlopen_dlz_newversion(const char *zone, void *driverarg, void *dbdata,
* Called to end a transaction
*/
static void
dlopen_dlz_closeversion(const char *zone, bool commit,
dlopen_dlz_closeversion(const char *zone, isc_boolean_t commit,
void *driverarg, void *dbdata, void **versionp)
{
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
@@ -470,9 +468,9 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
return (ISC_R_SUCCESS);
MAYBE_LOCK(cd);
cd->in_configure = true;
cd->in_configure = ISC_TRUE;
result = cd->dlz_configure(view, dlzdb, cd->dbdata);
cd->in_configure = false;
cd->in_configure = ISC_FALSE;
MAYBE_UNLOCK(cd);
return (result);
@@ -482,18 +480,18 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
/*
* Check for authority to change a name.
*/
static bool
static isc_boolean_t
dlopen_dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
const char *type, const char *key, uint32_t keydatalen,
const char *type, const char *key, isc_uint32_t keydatalen,
unsigned char *keydata, void *driverarg, void *dbdata)
{
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
bool ret;
isc_boolean_t ret;
UNUSED(driverarg);
if (cd->dlz_ssumatch == NULL)
return (false);
return (ISC_FALSE);
MAYBE_LOCK(cd);
ret = cd->dlz_ssumatch(signer, name, tcpaddr, type, key, keydatalen,
+3 -4
View File
@@ -15,7 +15,6 @@
/*! \file */
#include <pwd.h>
#include <stdbool.h>
#include <isc/types.h>
@@ -50,12 +49,12 @@ void
named_os_minprivs(void);
FILE *
named_os_openfile(const char *filename, mode_t mode, bool switch_user);
named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user);
void
named_os_writepidfile(const char *filename, bool first_time);
named_os_writepidfile(const char *filename, isc_boolean_t first_time);
bool
isc_boolean_t
named_os_issingleton(const char *filename);
void
+23 -24
View File
@@ -13,7 +13,6 @@
#include <config.h>
#include <stdarg.h>
#include <stdbool.h>
#include <sys/types.h> /* dev_t FreeBSD 2.1 */
#include <sys/stat.h>
@@ -108,13 +107,13 @@ static pid_t mainpid = 0;
#endif
static struct passwd *runas_pw = NULL;
static bool done_setuid = false;
static isc_boolean_t done_setuid = ISC_FALSE;
static int dfd[2] = { -1, -1 };
#ifdef HAVE_LINUX_CAPABILITY_H
static bool non_root = false;
static bool non_root_caps = false;
static isc_boolean_t non_root = ISC_FALSE;
static isc_boolean_t non_root_caps = ISC_FALSE;
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
@@ -389,9 +388,9 @@ linux_keepcaps(void) {
named_main_earlyfatal("prctl() failed: %s", strbuf);
}
} else {
non_root_caps = true;
non_root_caps = ISC_TRUE;
if (getuid() != 0)
non_root = true;
non_root = ISC_TRUE;
}
}
#endif
@@ -528,16 +527,16 @@ named_os_closedevnull(void) {
}
}
static bool
static isc_boolean_t
all_digits(const char *s) {
if (*s == '\0')
return (false);
return (ISC_FALSE);
while (*s != '\0') {
if (!isdigit((*s)&0xff))
return (false);
return (ISC_FALSE);
s++;
}
return (true);
return (ISC_TRUE);
}
void
@@ -596,7 +595,7 @@ named_os_changeuser(void) {
if (runas_pw == NULL || done_setuid)
return;
done_setuid = true;
done_setuid = ISC_TRUE;
#ifdef HAVE_LINUXTHREADS
#ifdef HAVE_LINUX_CAPABILITY_H
@@ -678,7 +677,7 @@ named_os_minprivs(void) {
}
static int
safe_open(const char *filename, mode_t mode, bool append) {
safe_open(const char *filename, mode_t mode, isc_boolean_t append) {
int fd;
struct stat sb;
@@ -835,7 +834,7 @@ setperms(uid_t uid, gid_t gid) {
}
FILE *
named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user) {
char strbuf[ISC_STRERRORSIZE], *f;
FILE *fp;
int fd;
@@ -863,7 +862,7 @@ named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
/* Set UID/GID to the one we'll be running with eventually */
setperms(runas_pw->pw_uid, runas_pw->pw_gid);
fd = safe_open(filename, mode, false);
fd = safe_open(filename, mode, ISC_FALSE);
#ifndef HAVE_LINUXTHREADS
/* Restore UID/GID to root */
@@ -872,7 +871,7 @@ named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
if (fd == -1) {
#ifndef HAVE_LINUXTHREADS
fd = safe_open(filename, mode, false);
fd = safe_open(filename, mode, ISC_FALSE);
if (fd != -1) {
named_main_earlywarning("Required root "
"permissions to open "
@@ -893,7 +892,7 @@ named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
#endif /* HAVE_LINUXTHREADS */
}
} else {
fd = safe_open(filename, mode, false);
fd = safe_open(filename, mode, ISC_FALSE);
}
if (fd < 0) {
@@ -914,7 +913,7 @@ named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
}
void
named_os_writepidfile(const char *filename, bool first_time) {
named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
FILE *fh;
pid_t pid;
char strbuf[ISC_STRERRORSIZE];
@@ -964,16 +963,16 @@ named_os_writepidfile(const char *filename, bool first_time) {
(void)fclose(fh);
}
bool
isc_boolean_t
named_os_issingleton(const char *filename) {
char strbuf[ISC_STRERRORSIZE];
struct flock lock;
if (singletonfd != -1)
return (true);
return (ISC_TRUE);
if (strcasecmp(filename, "none") == 0)
return (true);
return (ISC_TRUE);
/*
* Make the containing directory if it doesn't exist.
@@ -989,7 +988,7 @@ named_os_issingleton(const char *filename) {
named_main_earlywarning("couldn't create '%s'",
filename);
cleanup_lockfile();
return (false);
return (ISC_FALSE);
}
}
@@ -1001,7 +1000,7 @@ named_os_issingleton(const char *filename) {
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
if (singletonfd == -1) {
cleanup_lockfile();
return (false);
return (ISC_FALSE);
}
memset(&lock, 0, sizeof(lock));
@@ -1014,10 +1013,10 @@ named_os_issingleton(const char *filename) {
if (fcntl(singletonfd, F_SETLK, &lock) == -1) {
close(singletonfd);
singletonfd = -1;
return (false);
return (ISC_FALSE);
}
return (true);
return (ISC_TRUE);
}
void
+28 -30
View File
@@ -12,13 +12,11 @@
#include <config.h>
#include <stdbool.h>
#include <windows.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <dns/log.h>
#include <dns/result.h>
@@ -46,7 +44,7 @@ typedef struct dlopen_data {
unsigned int flags;
isc_mutex_t lock;
int version;
bool in_configure;
isc_boolean_t in_configure;
dlz_dlopen_version_t *dlz_version;
dlz_dlopen_create_t *dlz_create;
@@ -69,14 +67,14 @@ typedef struct dlopen_data {
#define MAYBE_LOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
cd->in_configure == false) \
cd->in_configure == ISC_FALSE) \
LOCK(&cd->lock); \
} while (0)
#define MAYBE_UNLOCK(cd) \
do { \
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
cd->in_configure == false) \
cd->in_configure == ISC_FALSE) \
UNLOCK(&cd->lock); \
} while (0)
@@ -196,7 +194,7 @@ dlopen_dlz_lookup(const char *zone, const char *name, void *driverarg,
* Load a symbol from the library
*/
static void *
dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
dl_load_symbol(dlopen_data_t *cd, const char *symbol, isc_boolean_t mandatory) {
void *ptr = GetProcAddress(cd->dl_handle, symbol);
if (ptr == NULL && mandatory) {
dlopen_log(ISC_LOG_ERROR,
@@ -216,7 +214,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
dlopen_data_t *cd;
isc_mem_t *mctx = NULL;
isc_result_t result = ISC_R_FAILURE;
bool triedload = false;
isc_boolean_t triedload = ISC_FALSE;
UNUSED(driverarg);
@@ -250,7 +248,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
goto failed;
}
triedload = true;
triedload = ISC_TRUE;
/* Initialize the lock */
result = isc_mutex_init(&cd->lock);
@@ -271,13 +269,13 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
/* Find the symbols */
cd->dlz_version = (dlz_dlopen_version_t *)
dl_load_symbol(cd, "dlz_version", true);
dl_load_symbol(cd, "dlz_version", ISC_TRUE);
cd->dlz_create = (dlz_dlopen_create_t *)
dl_load_symbol(cd, "dlz_create", true);
dl_load_symbol(cd, "dlz_create", ISC_TRUE);
cd->dlz_lookup = (dlz_dlopen_lookup_t *)
dl_load_symbol(cd, "dlz_lookup", true);
dl_load_symbol(cd, "dlz_lookup", ISC_TRUE);
cd->dlz_findzonedb = (dlz_dlopen_findzonedb_t *)
dl_load_symbol(cd, "dlz_findzonedb", true);
dl_load_symbol(cd, "dlz_findzonedb", ISC_TRUE);
if (cd->dlz_create == NULL ||
cd->dlz_version == NULL ||
@@ -290,27 +288,27 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
}
cd->dlz_allowzonexfr = (dlz_dlopen_allowzonexfr_t *)
dl_load_symbol(cd, "dlz_allowzonexfr", false);
dl_load_symbol(cd, "dlz_allowzonexfr", ISC_FALSE);
cd->dlz_allnodes = (dlz_dlopen_allnodes_t *)
dl_load_symbol(cd, "dlz_allnodes",
(cd->dlz_allowzonexfr != NULL));
ISC_TF(cd->dlz_allowzonexfr != NULL));
cd->dlz_authority = (dlz_dlopen_authority_t *)
dl_load_symbol(cd, "dlz_authority", false);
dl_load_symbol(cd, "dlz_authority", ISC_FALSE);
cd->dlz_newversion = (dlz_dlopen_newversion_t *)
dl_load_symbol(cd, "dlz_newversion", false);
dl_load_symbol(cd, "dlz_newversion", ISC_FALSE);
cd->dlz_closeversion = (dlz_dlopen_closeversion_t *)
dl_load_symbol(cd, "dlz_closeversion",
(cd->dlz_newversion != NULL));
ISC_TF(cd->dlz_newversion != NULL));
cd->dlz_configure = (dlz_dlopen_configure_t *)
dl_load_symbol(cd, "dlz_configure", false);
dl_load_symbol(cd, "dlz_configure", ISC_FALSE);
cd->dlz_ssumatch = (dlz_dlopen_ssumatch_t *)
dl_load_symbol(cd, "dlz_ssumatch", false);
dl_load_symbol(cd, "dlz_ssumatch", ISC_FALSE);
cd->dlz_addrdataset = (dlz_dlopen_addrdataset_t *)
dl_load_symbol(cd, "dlz_addrdataset", false);
dl_load_symbol(cd, "dlz_addrdataset", ISC_FALSE);
cd->dlz_subrdataset = (dlz_dlopen_subrdataset_t *)
dl_load_symbol(cd, "dlz_subrdataset", false);
dl_load_symbol(cd, "dlz_subrdataset", ISC_FALSE);
cd->dlz_delrdataset = (dlz_dlopen_delrdataset_t *)
dl_load_symbol(cd, "dlz_delrdataset", false);
dl_load_symbol(cd, "dlz_delrdataset", ISC_FALSE);
/* Check the version of the API is the same */
cd->version = cd->dlz_version(&cd->flags);
@@ -422,7 +420,7 @@ dlopen_dlz_newversion(const char *zone, void *driverarg, void *dbdata,
* Called to end a transaction
*/
static void
dlopen_dlz_closeversion(const char *zone, bool commit,
dlopen_dlz_closeversion(const char *zone, isc_boolean_t commit,
void *driverarg, void *dbdata, void **versionp)
{
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
@@ -455,9 +453,9 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
return (ISC_R_SUCCESS);
MAYBE_LOCK(cd);
cd->in_configure = true;
cd->in_configure = ISC_TRUE;
result = cd->dlz_configure(view, dlzdb, cd->dbdata);
cd->in_configure = false;
cd->in_configure = ISC_FALSE;
MAYBE_UNLOCK(cd);
return (result);
@@ -467,18 +465,18 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
/*
* Check for authority to change a name
*/
static bool
static isc_boolean_t
dlopen_dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
const char *type, const char *key, uint32_t keydatalen,
const char *type, const char *key, isc_uint32_t keydatalen,
unsigned char *keydata, void *driverarg, void *dbdata)
{
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
bool ret;
isc_boolean_t ret;
UNUSED(driverarg);
if (cd->dlz_ssumatch == NULL)
return (false);
return (ISC_FALSE);
MAYBE_LOCK(cd);
ret = cd->dlz_ssumatch(signer, name, tcpaddr, type, key, keydatalen,
+3 -5
View File
@@ -12,8 +12,6 @@
#ifndef NAMED_OS_H
#define NAMED_OS_H 1
#include <stdbool.h>
#include <isc/types.h>
void
@@ -47,12 +45,12 @@ void
named_os_minprivs(void);
FILE *
named_os_openfile(const char *filename, int mode, bool switch_user);
named_os_openfile(const char *filename, int mode, isc_boolean_t switch_user);
void
named_os_writepidfile(const char *filename, bool first_time);
named_os_writepidfile(const char *filename, isc_boolean_t first_time);
bool
isc_boolean_t
named_os_issingleton(const char *filename);
void
+3 -3
View File
@@ -80,7 +80,7 @@ ServiceControl(DWORD dwCtrlCode) {
case SERVICE_CONTROL_SHUTDOWN:
case SERVICE_CONTROL_STOP:
named_server_flushonshutdown(named_g_server, true);
named_server_flushonshutdown(named_g_server, ISC_TRUE);
isc_app_shutdown();
UpdateSCM(SERVICE_STOPPED);
break;
@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
int rc, ch;
/* Command line users should put -f in the options. */
isc_commandline_errprint = false;
isc_commandline_errprint = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv,
NAMED_MAIN_ARGS)) != -1)
{
@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
break;
}
}
isc_commandline_reset = true;
isc_commandline_reset = ISC_TRUE;
if (foreground) {
/* run in console window */
+11 -12
View File
@@ -11,7 +11,6 @@
#include <config.h>
#include <stdarg.h>
#include <stdbool.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -177,7 +176,7 @@ named_os_minprivs(void) {
}
static int
safe_open(const char *filename, int mode, bool append) {
safe_open(const char *filename, int mode, isc_boolean_t append) {
int fd;
struct stat sb;
@@ -223,13 +222,13 @@ cleanup_lockfile(void) {
}
FILE *
named_os_openfile(const char *filename, int mode, bool switch_user) {
named_os_openfile(const char *filename, int mode, isc_boolean_t switch_user) {
char strbuf[ISC_STRERRORSIZE];
FILE *fp;
int fd;
UNUSED(switch_user);
fd = safe_open(filename, mode, false);
fd = safe_open(filename, mode, ISC_FALSE);
if (fd < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
named_main_earlywarning("could not open file '%s': %s",
@@ -249,7 +248,7 @@ named_os_openfile(const char *filename, int mode, bool switch_user) {
}
void
named_os_writepidfile(const char *filename, bool first_time) {
named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
FILE *pidlockfile;
pid_t pid;
char strbuf[ISC_STRERRORSIZE];
@@ -275,7 +274,7 @@ named_os_writepidfile(const char *filename, bool first_time) {
pidlockfile = named_os_openfile(filename,
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
false);
ISC_FALSE);
if (pidlockfile == NULL) {
free(pidfile);
pidfile = NULL;
@@ -299,16 +298,16 @@ named_os_writepidfile(const char *filename, bool first_time) {
(void)fclose(pidlockfile);
}
bool
isc_boolean_t
named_os_issingleton(const char *filename) {
char strbuf[ISC_STRERRORSIZE];
OVERLAPPED o;
if (lockfilefd != -1)
return (true);
return (ISC_TRUE);
if (strcasecmp(filename, "none") == 0)
return (true);
return (ISC_TRUE);
lockfile = strdup(filename);
if (lockfile == NULL) {
@@ -325,7 +324,7 @@ named_os_issingleton(const char *filename) {
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
if (lockfilefd == -1) {
cleanup_lockfile();
return (false);
return (ISC_FALSE);
}
memset(&o, 0, sizeof(o));
@@ -334,10 +333,10 @@ named_os_issingleton(const char *filename) {
LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY,
0, 0, 1, &o)) {
cleanup_lockfile();
return (false);
return (ISC_FALSE);
}
return (true);
return (ISC_TRUE);
}
+112 -144
View File
@@ -11,9 +11,6 @@
#include <config.h>
#include <inttypes.h>
#include <stdbool.h>
#include <isc/buffer.h>
#include <isc/file.h>
#include <isc/mem.h>
@@ -125,7 +122,7 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
break;
default:
INSIST(0);
ISC_UNREACHABLE();
return (ISC_R_FAILURE);
}
/* First check to see if ACL is defined within the zone */
@@ -191,7 +188,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
const cfg_listelt_t *element, *element2;
dns_ssutable_t *table = NULL;
isc_mem_t *mctx = dns_zone_getmctx(zone);
bool autoddns = false;
isc_boolean_t autoddns = ISC_FALSE;
isc_result_t result;
(void)cfg_map_get(zconfig, "update-policy", &updatepolicy);
@@ -203,7 +200,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
if (cfg_obj_isstring(updatepolicy) &&
strcmp("local", cfg_obj_asstring(updatepolicy)) == 0) {
autoddns = true;
autoddns = ISC_TRUE;
updatepolicy = NULL;
}
@@ -222,8 +219,8 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
const cfg_obj_t *dname = cfg_tuple_get(stmt, "name");
const cfg_obj_t *typelist = cfg_tuple_get(stmt, "types");
const char *str;
bool grant = false;
bool usezone = false;
isc_boolean_t grant = ISC_FALSE;
isc_boolean_t usezone = ISC_FALSE;
unsigned int mtype = dns_ssumatchtype_name;
dns_fixedname_t fname, fident;
isc_buffer_t b;
@@ -231,19 +228,17 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
unsigned int i, n;
str = cfg_obj_asstring(mode);
if (strcasecmp(str, "grant") == 0) {
grant = true;
} else if (strcasecmp(str, "deny") == 0) {
grant = false;
} else {
if (strcasecmp(str, "grant") == 0)
grant = ISC_TRUE;
else if (strcasecmp(str, "deny") == 0)
grant = ISC_FALSE;
else
INSIST(0);
ISC_UNREACHABLE();
}
str = cfg_obj_asstring(matchtype);
CHECK(dns_ssu_mtypefromstring(str, &mtype));
if (mtype == dns_ssumatchtype_subdomain) {
usezone = true;
usezone = ISC_TRUE;
}
dns_fixedname_init(&fident);
@@ -352,7 +347,7 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
goto cleanup;
}
result = dns_ssutable_addrule(table, true,
result = dns_ssutable_addrule(table, ISC_TRUE,
named_g_server->session_keyname,
dns_ssumatchtype_local,
dns_zone_getorigin(zone),
@@ -630,7 +625,7 @@ configure_staticstub(const cfg_obj_t *zconfig, dns_zone_t *zone,
goto cleanup;
dns_name_init(&apexname, NULL);
dns_name_clone(dns_zone_getorigin(zone), &apexname);
result = dns_db_findnode(db, &apexname, false, &apexnode);
result = dns_db_findnode(db, &apexname, ISC_FALSE, &apexnode);
if (result != ISC_R_SUCCESS)
goto cleanup;
@@ -673,7 +668,7 @@ configure_staticstub(const cfg_obj_t *zconfig, dns_zone_t *zone,
if (apexnode != NULL)
dns_db_detachnode(db, &apexnode);
if (dbversion != NULL)
dns_db_closeversion(db, &dbversion, true);
dns_db_closeversion(db, &dbversion, ISC_TRUE);
if (db != NULL)
dns_db_detach(&db);
for (i = 0; rdatalists[i] != NULL; i++) {
@@ -761,7 +756,6 @@ checknames(dns_zonetype_t ztype, const cfg_obj_t **maps,
case dns_zone_master: zone = "master"; break;
default:
INSIST(0);
ISC_UNREACHABLE();
}
result = named_checknames_get(maps, zone, objp);
INSIST(result == ISC_R_SUCCESS && objp != NULL && *objp != NULL);
@@ -775,7 +769,7 @@ checknames(dns_zonetype_t ztype, const cfg_obj_t **maps,
* We run this unlocked as both the view list and the interface list
* are updated when the appropriate task has exclusivity.
*/
static bool
static isc_boolean_t
isself(dns_view_t *myview, dns_tsigkey_t *mykey,
const isc_sockaddr_t *srcaddr, const isc_sockaddr_t *dstaddr,
dns_rdataclass_t rdclass, void *arg)
@@ -789,10 +783,10 @@ isself(dns_view_t *myview, dns_tsigkey_t *mykey,
isc_netaddr_t netdst;
if (interfacemgr == NULL)
return (true);
return (ISC_TRUE);
if (!ns_interfacemgr_listeningon(interfacemgr, dstaddr))
return (false);
return (ISC_FALSE);
isc_netaddr_fromsockaddr(&netsrc, srcaddr);
isc_netaddr_fromsockaddr(&netdst, dstaddr);
@@ -808,7 +802,7 @@ isself(dns_view_t *myview, dns_tsigkey_t *mykey,
continue;
if (mykey != NULL) {
bool match;
isc_boolean_t match;
isc_result_t result;
result = dns_view_gettsig(view, &mykey->name, &key);
@@ -827,7 +821,7 @@ isself(dns_view_t *myview, dns_tsigkey_t *mykey,
view->matchdestinations, env))
break;
}
return (view == myview);
return (ISC_TF(view == myview));
}
@@ -848,7 +842,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
const char *filename = NULL;
const char *dupcheck;
dns_notifytype_t notifytype = dns_notifytype_yes;
uint32_t count;
isc_uint32_t count;
unsigned int dbargc;
char **dbargv;
static char default_dbtype[] = "rbt";
@@ -858,18 +852,18 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_dialuptype_t dialup = dns_dialuptype_no;
dns_zonetype_t ztype;
int i;
int32_t journal_size;
bool multi;
bool alt;
isc_int32_t journal_size;
isc_boolean_t multi;
isc_boolean_t alt;
dns_view_t *view;
bool check = false, fail = false;
bool warn = false, ignore = false;
bool ixfrdiff;
isc_boolean_t check = ISC_FALSE, fail = ISC_FALSE;
isc_boolean_t warn = ISC_FALSE, ignore = ISC_FALSE;
isc_boolean_t ixfrdiff;
dns_masterformat_t masterformat;
const dns_master_style_t *masterstyle = &dns_master_style_default;
isc_stats_t *zoneqrystats;
dns_stats_t *rcvquerystats;
dns_zonestat_level_t statlevel = dns_zonestat_none;
dns_zonestat_level_t statlevel;
int seconds;
dns_zone_t *mayberaw = (raw != NULL) ? raw : zone;
isc_dscp_t dscp;
@@ -993,16 +987,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
if (result == ISC_R_SUCCESS) {
const char *masterformatstr = cfg_obj_asstring(obj);
if (strcasecmp(masterformatstr, "text") == 0) {
if (strcasecmp(masterformatstr, "text") == 0)
masterformat = dns_masterformat_text;
} else if (strcasecmp(masterformatstr, "raw") == 0) {
else if (strcasecmp(masterformatstr, "raw") == 0)
masterformat = dns_masterformat_raw;
} else if (strcasecmp(masterformatstr, "map") == 0) {
else if (strcasecmp(masterformatstr, "map") == 0)
masterformat = dns_masterformat_map;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
}
obj = NULL;
@@ -1018,14 +1010,12 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
return (ISC_R_FAILURE);
}
if (strcasecmp(masterstylestr, "full") == 0) {
if (strcasecmp(masterstylestr, "full") == 0)
masterstyle = &dns_master_style_full;
} else if (strcasecmp(masterstylestr, "relative") == 0) {
else if (strcasecmp(masterstylestr, "relative") == 0)
masterstyle = &dns_master_style_default;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
}
obj = NULL;
@@ -1111,18 +1101,16 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dialup = dns_dialuptype_no;
} else {
const char *dialupstr = cfg_obj_asstring(obj);
if (strcasecmp(dialupstr, "notify") == 0) {
if (strcasecmp(dialupstr, "notify") == 0)
dialup = dns_dialuptype_notify;
} else if (strcasecmp(dialupstr, "notify-passive") == 0) {
else if (strcasecmp(dialupstr, "notify-passive") == 0)
dialup = dns_dialuptype_notifypassive;
} else if (strcasecmp(dialupstr, "refresh") == 0) {
else if (strcasecmp(dialupstr, "refresh") == 0)
dialup = dns_dialuptype_refresh;
} else if (strcasecmp(dialupstr, "passive") == 0) {
else if (strcasecmp(dialupstr, "passive") == 0)
dialup = dns_dialuptype_passive;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
}
if (raw != NULL)
dns_zone_setdialup(raw, dialup);
@@ -1138,16 +1126,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
statlevel = dns_zonestat_none;
} else {
const char *levelstr = cfg_obj_asstring(obj);
if (strcasecmp(levelstr, "full") == 0) {
if (strcasecmp(levelstr, "full") == 0)
statlevel = dns_zonestat_full;
} else if (strcasecmp(levelstr, "terse") == 0) {
else if (strcasecmp(levelstr, "terse") == 0)
statlevel = dns_zonestat_terse;
} else if (strcasecmp(levelstr, "none") == 0) {
else if (strcasecmp(levelstr, "none") == 0)
statlevel = dns_zonestat_none;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
}
dns_zone_setstatlevel(zone, statlevel);
@@ -1185,14 +1171,12 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
notifytype = dns_notifytype_no;
} else {
const char *notifystr = cfg_obj_asstring(obj);
if (strcasecmp(notifystr, "explicit") == 0) {
if (strcasecmp(notifystr, "explicit") == 0)
notifytype = dns_notifytype_explicit;
} else if (strcasecmp(notifystr, "master-only") == 0) {
else if (strcasecmp(notifystr, "master-only") == 0)
notifytype = dns_notifytype_masteronly;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
}
if (raw != NULL)
dns_zone_setnotifytype(raw, dns_notifytype_no);
@@ -1287,12 +1271,12 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
cfg_obj_log(obj, named_g_lctx,
ISC_LOG_ERROR,
"'max-journal-size "
"%" PRId64 "' "
"%" ISC_PRINT_QUADFORMAT "d' "
"is too large",
value);
RETERR(ISC_R_RANGE);
}
journal_size = (uint32_t)value;
journal_size = (isc_uint32_t)value;
}
if (raw != NULL)
dns_zone_setjournalsize(raw, journal_size);
@@ -1305,17 +1289,17 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
ixfrdiff = cfg_obj_asboolean(obj);
else if (!strcasecmp(cfg_obj_asstring(obj), "master") &&
ztype == dns_zone_master)
ixfrdiff = true;
ixfrdiff = ISC_TRUE;
else if (!strcasecmp(cfg_obj_asstring(obj), "slave") &&
ztype == dns_zone_slave)
ixfrdiff = true;
ixfrdiff = ISC_TRUE;
else
ixfrdiff = false;
ixfrdiff = ISC_FALSE;
if (raw != NULL) {
dns_zone_setoption(raw, DNS_ZONEOPT_IXFRFROMDIFFS,
true);
ISC_TRUE);
dns_zone_setoption(zone, DNS_ZONEOPT_IXFRFROMDIFFS,
false);
ISC_TRUE);
} else
dns_zone_setoption(zone, DNS_ZONEOPT_IXFRFROMDIFFS,
ixfrdiff);
@@ -1333,25 +1317,23 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
checknames(ztype, maps, &obj);
INSIST(obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
fail = false;
check = true;
fail = ISC_FALSE;
check = ISC_TRUE;
} else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
fail = check = true;
fail = check = ISC_TRUE;
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
fail = check = false;
} else {
fail = check = ISC_FALSE;
} else
INSIST(0);
ISC_UNREACHABLE();
}
if (raw != NULL) {
dns_zone_setoption(raw, DNS_ZONEOPT_CHECKNAMES,
check);
dns_zone_setoption(raw, DNS_ZONEOPT_CHECKNAMESFAIL,
fail);
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKNAMES,
false);
ISC_FALSE);
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKNAMESFAIL,
false);
ISC_FALSE);
} else {
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKNAMES,
check);
@@ -1374,13 +1356,11 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = named_config_get(maps, "check-spf", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
check = true;
check = ISC_TRUE;
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
check = false;
} else {
check = ISC_FALSE;
} else
INSIST(0);
ISC_UNREACHABLE();
}
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKSPF, check);
obj = NULL;
@@ -1415,12 +1395,12 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
cfg_obj_log(obj, named_g_lctx,
ISC_LOG_ERROR,
"'max-journal-size "
"%" PRId64 "' "
"%" ISC_PRINT_QUADFORMAT "d' "
"is too large",
value);
RETERR(ISC_R_RANGE);
}
journal_size = (uint32_t)value;
journal_size = (isc_uint32_t)value;
}
dns_zone_setjournalsize(zone, journal_size);
}
@@ -1450,8 +1430,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
if (ztype == dns_zone_master || raw != NULL) {
const cfg_obj_t *validity, *resign;
bool allow = false, maint = false;
bool sigvalinsecs;
isc_boolean_t allow = ISC_FALSE, maint = ISC_FALSE;
isc_boolean_t sigvalinsecs;
obj = NULL;
result = named_config_get(maps, "sig-validity-interval", &obj);
@@ -1525,16 +1505,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = cfg_map_get(zoptions, "auto-dnssec", &obj);
if (result == ISC_R_SUCCESS) {
const char *arg = cfg_obj_asstring(obj);
if (strcasecmp(arg, "allow") == 0) {
allow = true;
} else if (strcasecmp(arg, "maintain") == 0) {
allow = maint = true;
} else if (strcasecmp(arg, "off") == 0) {
if (strcasecmp(arg, "allow") == 0)
allow = ISC_TRUE;
else if (strcasecmp(arg, "maintain") == 0)
allow = maint = ISC_TRUE;
else if (strcasecmp(arg, "off") == 0)
;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
dns_zone_setkeyopt(zone, DNS_ZONEKEY_ALLOW, allow);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_MAINTAIN, maint);
}
@@ -1556,7 +1534,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
if (result == ISC_R_SUCCESS)
check = cfg_obj_asboolean(obj);
else
check = false;
check = ISC_FALSE;
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKWILDCARD, check);
/*
@@ -1581,16 +1559,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
if (strcasecmp(dupcheck, "warn") == 0) {
fail = false;
check = true;
fail = ISC_FALSE;
check = ISC_TRUE;
} else if (strcasecmp(dupcheck, "fail") == 0) {
fail = check = true;
fail = check = ISC_TRUE;
} else if (strcasecmp(dupcheck, "ignore") == 0) {
fail = check = false;
} else {
fail = check = ISC_FALSE;
} else
INSIST(0);
ISC_UNREACHABLE();
}
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKDUPRR, check);
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKDUPRRFAIL, fail);
@@ -1598,16 +1574,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = named_config_get(maps, "check-mx", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
fail = false;
check = true;
fail = ISC_FALSE;
check = ISC_TRUE;
} else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
fail = check = true;
fail = check = ISC_TRUE;
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
fail = check = false;
} else {
fail = check = ISC_FALSE;
} else
INSIST(0);
ISC_UNREACHABLE();
}
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKMX, check);
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKMXFAIL, fail);
@@ -1624,7 +1598,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKINTEGRITY,
cfg_obj_asboolean(obj));
} else {
check = false;
check = ISC_FALSE;
result = named_config_get(nodefault, "check-integrity",
&obj);
if (result == ISC_R_SUCCESS)
@@ -1637,16 +1611,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = named_config_get(maps, "check-mx-cname", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
warn = true;
ignore = false;
warn = ISC_TRUE;
ignore = ISC_FALSE;
} else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
warn = ignore = false;
warn = ignore = ISC_FALSE;
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
warn = ignore = true;
} else {
warn = ignore = ISC_TRUE;
} else
INSIST(0);
ISC_UNREACHABLE();
}
dns_zone_setoption(mayberaw, DNS_ZONEOPT_WARNMXCNAME, warn);
dns_zone_setoption(mayberaw, DNS_ZONEOPT_IGNOREMXCNAME, ignore);
@@ -1654,16 +1626,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = named_config_get(maps, "check-srv-cname", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
if (strcasecmp(cfg_obj_asstring(obj), "warn") == 0) {
warn = true;
ignore = false;
warn = ISC_TRUE;
ignore = ISC_FALSE;
} else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
warn = ignore = false;
warn = ignore = ISC_FALSE;
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
warn = ignore = true;
} else {
warn = ignore = ISC_TRUE;
} else
INSIST(0);
ISC_UNREACHABLE();
}
dns_zone_setoption(mayberaw, DNS_ZONEOPT_WARNSRVCNAME, warn);
dns_zone_setoption(mayberaw, DNS_ZONEOPT_IGNORESRVCNAME,
ignore);
@@ -1679,15 +1649,13 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = cfg_map_get(zoptions, "dnssec-update-mode", &obj);
if (result == ISC_R_SUCCESS) {
const char *arg = cfg_obj_asstring(obj);
if (strcasecmp(arg, "no-resign") == 0) {
if (strcasecmp(arg, "no-resign") == 0)
dns_zone_setkeyopt(zone, DNS_ZONEKEY_NORESIGN,
true);
} else if (strcasecmp(arg, "maintain") == 0) {
ISC_TRUE);
else if (strcasecmp(arg, "maintain") == 0)
;
} else {
else
INSIST(0);
ISC_UNREACHABLE();
}
}
obj = NULL;
@@ -1731,7 +1699,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = dns_zone_setmasters(mayberaw, NULL, 0);
RETERR(result);
multi = false;
multi = ISC_FALSE;
if (count > 1) {
obj = NULL;
result = named_config_get(maps, "multi-master", &obj);
@@ -1823,9 +1791,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
*/
view = dns_zone_getview(zone);
if (view != NULL && strcmp(view->name, "_default") == 0)
alt = true;
alt = ISC_TRUE;
else
alt = false;
alt = ISC_FALSE;
} else
alt = cfg_obj_asboolean(obj);
dns_zone_setoption(mayberaw, DNS_ZONEOPT_USEALTXFRSRC, alt);
@@ -1872,14 +1840,14 @@ named_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase,
return (result);
}
bool
isc_boolean_t
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *obj = NULL;
const char *cfilename;
const char *zfilename;
dns_zone_t *raw = NULL;
bool has_raw;
isc_boolean_t has_raw;
dns_zonetype_t ztype;
zoptions = cfg_tuple_get(zconfig, "options");
@@ -1891,7 +1859,7 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
if (zonetype_fromconfig(zoptions) == dns_zone_staticstub) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"not reusable: staticstub");
return (false);
return (ISC_FALSE);
}
/* If there's a raw zone, use that for filename and type comparison */
@@ -1900,11 +1868,11 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
zfilename = dns_zone_getfile(raw);
ztype = dns_zone_gettype(raw);
dns_zone_detach(&raw);
has_raw = true;
has_raw = ISC_TRUE;
} else {
zfilename = dns_zone_getfile(zone);
ztype = dns_zone_gettype(zone);
has_raw = false;
has_raw = ISC_FALSE;
}
obj = NULL;
@@ -1912,17 +1880,17 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
if ((obj == NULL || !cfg_obj_asboolean(obj)) && has_raw) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"not reusable: old zone was inline-signing");
return (false);
return (ISC_FALSE);
} else if ((obj != NULL && cfg_obj_asboolean(obj)) && !has_raw) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"not reusable: old zone was not inline-signing");
return (false);
return (ISC_FALSE);
}
if (zonetype_fromconfig(zoptions) != ztype) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"not reusable: type mismatch");
return (false);
return (ISC_FALSE);
}
obj = NULL;
@@ -1937,8 +1905,8 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
{
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"not reusable: filename mismatch");
return (false);
return (ISC_FALSE);
}
return (true);
return (ISC_TRUE);
}
+156 -168
View File
@@ -16,8 +16,6 @@
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
@@ -126,22 +124,22 @@ extern int h_errno;
/* Number of addresses to request from bind9_getaddresses() */
#define MAX_SERVERADDRS 4
static uint16_t dnsport = DNSDEFAULTPORT;
static isc_uint16_t dnsport = DNSDEFAULTPORT;
#ifndef RESOLV_CONF
#define RESOLV_CONF "/etc/resolv.conf"
#endif
static bool debugging = false, ddebugging = false;
static bool memdebugging = false;
static bool have_ipv4 = false;
static bool have_ipv6 = false;
static bool is_dst_up = false;
static bool usevc = false;
static bool usegsstsig = false;
static bool use_win2k_gsstsig = false;
static bool tried_other_gsstsig = false;
static bool local_only = false;
static isc_boolean_t debugging = ISC_FALSE, ddebugging = ISC_FALSE;
static isc_boolean_t memdebugging = ISC_FALSE;
static isc_boolean_t have_ipv4 = ISC_FALSE;
static isc_boolean_t have_ipv6 = ISC_FALSE;
static isc_boolean_t is_dst_up = ISC_FALSE;
static isc_boolean_t usevc = ISC_FALSE;
static isc_boolean_t usegsstsig = ISC_FALSE;
static isc_boolean_t use_win2k_gsstsig = ISC_FALSE;
static isc_boolean_t tried_other_gsstsig = ISC_FALSE;
static isc_boolean_t local_only = ISC_FALSE;
static isc_taskmgr_t *taskmgr = NULL;
static isc_task_t *global_task = NULL;
static isc_event_t *global_event = NULL;
@@ -158,14 +156,14 @@ static dns_fixedname_t fuserzone;
static dns_fixedname_t fzname;
static dns_name_t *userzone = NULL;
static dns_name_t *zname = NULL;
static dns_name_t tmpzonename = DNS_NAME_INITEMPTY;
static dns_name_t restart_master = DNS_NAME_INITEMPTY;
static dns_name_t tmpzonename;
static dns_name_t restart_master;
static dns_tsig_keyring_t *gssring = NULL;
static dns_tsigkey_t *tsigkey = NULL;
static dst_key_t *sig0key = NULL;
static isc_sockaddr_t *servers = NULL;
static isc_sockaddr_t *master_servers = NULL;
static bool default_servers = true;
static isc_boolean_t default_servers = ISC_TRUE;
static int ns_inuse = 0;
static int master_inuse = 0;
static int ns_total = 0;
@@ -177,10 +175,10 @@ static isc_sockaddr_t *localaddr6 = NULL;
static const char *keyfile = NULL;
static char *keystr = NULL;
static isc_entropy_t *entropy = NULL;
static bool shuttingdown = false;
static isc_boolean_t shuttingdown = ISC_FALSE;
static FILE *input;
static bool interactive = true;
static bool seenerror = false;
static isc_boolean_t interactive = ISC_TRUE;
static isc_boolean_t seenerror = ISC_FALSE;
static const dns_master_style_t *style;
static int requests = 0;
static unsigned int logdebuglevel = 0;
@@ -190,9 +188,9 @@ static unsigned int udp_retries = 3;
static dns_rdataclass_t defaultclass = dns_rdataclass_in;
static dns_rdataclass_t zoneclass = dns_rdataclass_none;
static dns_message_t *answer = NULL;
static uint32_t default_ttl = 0;
static bool default_ttl_set = false;
static bool checknames = true;
static isc_uint32_t default_ttl = 0;
static isc_boolean_t default_ttl_set = ISC_FALSE;
static isc_boolean_t checknames = ISC_TRUE;
typedef struct nsu_requestinfo {
dns_message_t *msg;
@@ -241,10 +239,10 @@ recvgss(isc_task_t *task, isc_event_t *event);
static void
error(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
#define STATUS_MORE (uint16_t)0
#define STATUS_SEND (uint16_t)1
#define STATUS_QUIT (uint16_t)2
#define STATUS_SYNTAX (uint16_t)3
#define STATUS_MORE (isc_uint16_t)0
#define STATUS_SEND (isc_uint16_t)1
#define STATUS_QUIT (isc_uint16_t)2
#define STATUS_SYNTAX (isc_uint16_t)3
typedef struct entropysource entropysource_t;
@@ -280,7 +278,7 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) {
#ifdef ISC_PLATFORM_CRYPTORANDOM
if (randomfile == NULL) {
isc_entropy_usehook(*ectx, true);
isc_entropy_usehook(*ectx, ISC_TRUE);
}
#endif
result = isc_entropy_usebestsource(*ectx, &source, randomfile,
@@ -332,14 +330,14 @@ getzoneclass(void) {
return (zoneclass);
}
static bool
static isc_boolean_t
setzoneclass(dns_rdataclass_t rdclass) {
if (zoneclass == dns_rdataclass_none ||
rdclass == dns_rdataclass_none)
zoneclass = rdclass;
if (zoneclass != rdclass)
return (false);
return (true);
return (ISC_FALSE);
return (ISC_TRUE);
}
static void
@@ -446,15 +444,15 @@ reset_system(void) {
dns_tsigkey_detach(&tsigkey);
if (gssring != NULL)
dns_tsigkeyring_detach(&gssring);
tried_other_gsstsig = false;
tried_other_gsstsig = ISC_FALSE;
}
}
static bool
static isc_boolean_t
parse_hmac(const dns_name_t **hmac, const char *hmacstr, size_t len,
uint16_t *digestbitsp)
isc_uint16_t *digestbitsp)
{
uint16_t digestbits = 0;
isc_uint16_t digestbits = 0;
isc_result_t result;
char buf[20];
@@ -463,7 +461,7 @@ parse_hmac(const dns_name_t **hmac, const char *hmacstr, size_t len,
if (len >= sizeof(buf)) {
error("unknown key type '%.*s'", (int)(len), hmacstr);
return (false);
return (ISC_FALSE);
}
/* Copy len bytes and NUL terminate. */
@@ -477,7 +475,7 @@ parse_hmac(const dns_name_t **hmac, const char *hmacstr, size_t len,
result = isc_parse_uint16(&digestbits, &buf[9], 10);
if (result != ISC_R_SUCCESS || digestbits > 128) {
error("digest-bits out of range [0..128]");
return (false);
return (ISC_FALSE);
}
*digestbitsp = (digestbits + 7) & ~0x7U;
} else
@@ -489,7 +487,7 @@ parse_hmac(const dns_name_t **hmac, const char *hmacstr, size_t len,
result = isc_parse_uint16(&digestbits, &buf[10], 10);
if (result != ISC_R_SUCCESS || digestbits > 160) {
error("digest-bits out of range [0..160]");
return (false);
return (ISC_FALSE);
}
*digestbitsp = (digestbits + 7) & ~0x7U;
} else if (strcasecmp(buf, "hmac-sha224") == 0) {
@@ -499,7 +497,7 @@ parse_hmac(const dns_name_t **hmac, const char *hmacstr, size_t len,
result = isc_parse_uint16(&digestbits, &buf[12], 10);
if (result != ISC_R_SUCCESS || digestbits > 224) {
error("digest-bits out of range [0..224]");
return (false);
return (ISC_FALSE);
}
*digestbitsp = (digestbits + 7) & ~0x7U;
} else if (strcasecmp(buf, "hmac-sha256") == 0) {
@@ -509,7 +507,7 @@ parse_hmac(const dns_name_t **hmac, const char *hmacstr, size_t len,
result = isc_parse_uint16(&digestbits, &buf[12], 10);
if (result != ISC_R_SUCCESS || digestbits > 256) {
error("digest-bits out of range [0..256]");
return (false);
return (ISC_FALSE);
}
*digestbitsp = (digestbits + 7) & ~0x7U;
} else if (strcasecmp(buf, "hmac-sha384") == 0) {
@@ -519,7 +517,7 @@ parse_hmac(const dns_name_t **hmac, const char *hmacstr, size_t len,
result = isc_parse_uint16(&digestbits, &buf[12], 10);
if (result != ISC_R_SUCCESS || digestbits > 384) {
error("digest-bits out of range [0..384]");
return (false);
return (ISC_FALSE);
}
*digestbitsp = (digestbits + 7) & ~0x7U;
} else if (strcasecmp(buf, "hmac-sha512") == 0) {
@@ -529,14 +527,14 @@ parse_hmac(const dns_name_t **hmac, const char *hmacstr, size_t len,
result = isc_parse_uint16(&digestbits, &buf[12], 10);
if (result != ISC_R_SUCCESS || digestbits > 512) {
error("digest-bits out of range [0..512]");
return (false);
return (ISC_FALSE);
}
*digestbitsp = (digestbits + 7) & ~0x7U;
} else {
error("unknown key type '%s'", buf);
return (false);
return (ISC_FALSE);
}
return (true);
return (ISC_TRUE);
}
static int
@@ -565,7 +563,7 @@ setup_keystr(void) {
dns_name_t *mykeyname;
char *name;
const dns_name_t *hmacname = NULL;
uint16_t digestbits = 0;
isc_uint16_t digestbits = 0;
mykeyname = dns_fixedname_initname(&fkeyname);
@@ -619,7 +617,7 @@ setup_keystr(void) {
debug("keycreate");
result = dns_tsigkey_create(mykeyname, hmacname, secret, secretlen,
false, NULL, 0, 0, gmctx, NULL,
ISC_FALSE, NULL, 0, 0, gmctx, NULL,
&tsigkey);
if (result != ISC_R_SUCCESS)
fprintf(stderr, "could not create key from %s: %s\n",
@@ -746,7 +744,7 @@ setup_keyfile(isc_mem_t *mctx, isc_log_t *lctx) {
}
if (hmacname != NULL) {
result = dns_tsigkey_createfromkey(dst_key_name(dstkey),
hmacname, dstkey, false,
hmacname, dstkey, ISC_FALSE,
NULL, 0, 0, mctx, NULL,
&tsigkey);
dst_key_free(&dstkey);
@@ -799,7 +797,7 @@ doshutdown(void) {
if (is_dst_up) {
ddebug("Destroy DST lib");
dst_lib_destroy();
is_dst_up = false;
is_dst_up = ISC_FALSE;
}
cleanup_entropy(&entropy);
@@ -837,7 +835,7 @@ shutdown_program(isc_task_t *task, isc_event_t *event) {
ddebug("shutdown_program()");
isc_event_free(&event);
shuttingdown = true;
shuttingdown = ISC_TRUE;
maybeshutdown();
}
@@ -995,7 +993,7 @@ setup_system(void) {
result = dst_lib_init(gmctx, entropy, 0);
check_result(result, "dst_lib_init");
is_dst_up = true;
is_dst_up = ISC_TRUE;
/* moved after dst_lib_init() */
isc_hash_init();
@@ -1071,15 +1069,15 @@ pre_parse_args(int argc, char **argv) {
dns_rdatatype_t t;
int ch;
char buf[100];
bool doexit = false;
bool ipv4only = false, ipv6only = false;
isc_boolean_t doexit = ISC_FALSE;
isc_boolean_t ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
while ((ch = isc_commandline_parse(argc, argv, PARSE_ARGS_FMT)) != -1) {
switch (ch) {
case 'M': /* was -dm */
debugging = true;
ddebugging = true;
memdebugging = true;
debugging = ISC_TRUE;
ddebugging = ISC_TRUE;
memdebugging = ISC_TRUE;
isc_mem_debugging = ISC_MEM_DEBUGTRACE |
ISC_MEM_DEBUGRECORD;
break;
@@ -1088,14 +1086,14 @@ pre_parse_args(int argc, char **argv) {
if (ipv6only) {
fatal("only one of -4 and -6 allowed");
}
ipv4only = true;
ipv4only = ISC_TRUE;
break;
case '6':
if (ipv4only) {
fatal("only one of -4 and -6 allowed");
}
ipv6only = true;
ipv6only = ISC_TRUE;
break;
case '?':
@@ -1116,7 +1114,7 @@ pre_parse_args(int argc, char **argv) {
if (strncmp(buf, "TYPE", 4) != 0)
fprintf(stdout, "%s\n", buf);
}
doexit = true;
doexit = ISC_TRUE;
break;
case 'T':
@@ -1127,12 +1125,12 @@ pre_parse_args(int argc, char **argv) {
if (strncmp(buf, "TYPE", 4) != 0)
fprintf(stdout, "%s\n", buf);
}
doexit = true;
doexit = ISC_TRUE;
break;
case 'V':
version();
doexit = true;
doexit = ISC_TRUE;
break;
default:
@@ -1141,16 +1139,16 @@ pre_parse_args(int argc, char **argv) {
}
if (doexit)
exit(0);
isc_commandline_reset = true;
isc_commandline_reset = ISC_TRUE;
isc_commandline_index = 1;
}
static void
parse_args(int argc, char **argv, isc_mem_t *mctx, isc_entropy_t **ectx) {
int ch;
uint32_t i;
isc_uint32_t i;
isc_result_t result;
bool force_interactive = false;
isc_boolean_t force_interactive = ISC_FALSE;
debug("parse_args");
while ((ch = isc_commandline_parse(argc, argv, PARSE_ARGS_FMT)) != -1) {
@@ -1158,7 +1156,7 @@ parse_args(int argc, char **argv, isc_mem_t *mctx, isc_entropy_t **ectx) {
case '4':
if (have_ipv4) {
isc_net_disableipv6();
have_ipv6 = false;
have_ipv6 = ISC_FALSE;
} else {
fatal("can't find IPv4 networking");
}
@@ -1166,26 +1164,26 @@ parse_args(int argc, char **argv, isc_mem_t *mctx, isc_entropy_t **ectx) {
case '6':
if (have_ipv6) {
isc_net_disableipv4();
have_ipv4 = false;
have_ipv4 = ISC_FALSE;
} else {
fatal("can't find IPv6 networking");
}
break;
case 'd':
debugging = true;
debugging = ISC_TRUE;
break;
case 'D': /* was -dd */
debugging = true;
ddebugging = true;
debugging = ISC_TRUE;
ddebugging = ISC_TRUE;
break;
case 'M':
break;
case 'i':
force_interactive = true;
interactive = true;
force_interactive = ISC_TRUE;
interactive = ISC_TRUE;
break;
case 'l':
local_only = true;
local_only = ISC_TRUE;
break;
case 'L':
result = isc_parse_uint32(&i, isc_commandline_argument,
@@ -1201,18 +1199,18 @@ parse_args(int argc, char **argv, isc_mem_t *mctx, isc_entropy_t **ectx) {
keystr = isc_commandline_argument;
break;
case 'v':
usevc = true;
usevc = ISC_TRUE;
break;
case 'k':
keyfile = isc_commandline_argument;
break;
case 'g':
usegsstsig = true;
use_win2k_gsstsig = false;
usegsstsig = ISC_TRUE;
use_win2k_gsstsig = ISC_FALSE;
break;
case 'o':
usegsstsig = true;
use_win2k_gsstsig = true;
usegsstsig = ISC_TRUE;
use_win2k_gsstsig = ISC_TRUE;
break;
case 'p':
result = isc_parse_uint16(&dnsport,
@@ -1297,12 +1295,12 @@ parse_args(int argc, char **argv, isc_mem_t *mctx, isc_entropy_t **ectx) {
}
}
if (!force_interactive) {
interactive = false;
interactive = ISC_FALSE;
}
}
}
static uint16_t
static isc_uint16_t
parse_name(char **cmdlinep, dns_message_t *msg, dns_name_t **namep) {
isc_result_t result;
char *word;
@@ -1335,7 +1333,7 @@ parse_name(char **cmdlinep, dns_message_t *msg, dns_name_t **namep) {
return (STATUS_MORE);
}
static uint16_t
static isc_uint16_t
parse_rdata(char **cmdlinep, dns_rdataclass_t rdataclass,
dns_rdatatype_t rdatatype, dns_message_t *msg,
dns_rdata_t *rdata)
@@ -1391,8 +1389,8 @@ parse_rdata(char **cmdlinep, dns_rdataclass_t rdataclass,
return (STATUS_MORE);
}
static uint16_t
make_prereq(char *cmdline, bool ispositive, bool isrrset) {
static isc_uint16_t
make_prereq(char *cmdline, isc_boolean_t ispositive, isc_boolean_t isrrset) {
isc_result_t result;
char *word;
dns_name_t *name = NULL;
@@ -1402,7 +1400,7 @@ make_prereq(char *cmdline, bool ispositive, bool isrrset) {
dns_rdataclass_t rdataclass;
dns_rdatatype_t rdatatype;
dns_rdata_t *rdata = NULL;
uint16_t retval;
isc_uint16_t retval;
ddebug("make_prereq()");
@@ -1496,10 +1494,10 @@ make_prereq(char *cmdline, bool ispositive, bool isrrset) {
return (STATUS_SYNTAX);
}
static uint16_t
static isc_uint16_t
evaluate_prereq(char *cmdline) {
char *word;
bool ispositive, isrrset;
isc_boolean_t ispositive, isrrset;
ddebug("evaluate_prereq()");
word = nsu_strsep(&cmdline, " \t\r\n");
@@ -1508,17 +1506,17 @@ evaluate_prereq(char *cmdline) {
return (STATUS_SYNTAX);
}
if (strcasecmp(word, "nxdomain") == 0) {
ispositive = false;
isrrset = false;
ispositive = ISC_FALSE;
isrrset = ISC_FALSE;
} else if (strcasecmp(word, "yxdomain") == 0) {
ispositive = true;
isrrset = false;
ispositive = ISC_TRUE;
isrrset = ISC_FALSE;
} else if (strcasecmp(word, "nxrrset") == 0) {
ispositive = false;
isrrset = true;
ispositive = ISC_FALSE;
isrrset = ISC_TRUE;
} else if (strcasecmp(word, "yxrrset") == 0) {
ispositive = true;
isrrset = true;
ispositive = ISC_TRUE;
isrrset = ISC_TRUE;
} else {
fprintf(stderr, "incorrect operation code: %s\n", word);
return (STATUS_SYNTAX);
@@ -1526,7 +1524,7 @@ evaluate_prereq(char *cmdline) {
return (make_prereq(cmdline, ispositive, isrrset));
}
static uint16_t
static isc_uint16_t
evaluate_server(char *cmdline) {
char *word, *server;
long port;
@@ -1565,7 +1563,7 @@ evaluate_server(char *cmdline) {
isc_mem_put(gmctx, servers, ns_alloc * sizeof(isc_sockaddr_t));
}
default_servers = false;
default_servers = ISC_FALSE;
ns_alloc = MAX_SERVERADDRS;
ns_inuse = 0;
@@ -1582,7 +1580,7 @@ evaluate_server(char *cmdline) {
return (STATUS_MORE);
}
static uint16_t
static isc_uint16_t
evaluate_local(char *cmdline) {
char *word, *local;
long port;
@@ -1632,7 +1630,7 @@ evaluate_local(char *cmdline) {
return (STATUS_MORE);
}
static uint16_t
static isc_uint16_t
evaluate_key(char *cmdline) {
char *namestr;
char *secretstr;
@@ -1644,7 +1642,7 @@ evaluate_key(char *cmdline) {
unsigned char *secret = NULL;
isc_buffer_t secretbuf;
const dns_name_t *hmacname = NULL;
uint16_t digestbits = 0;
isc_uint16_t digestbits = 0;
char *n;
namestr = nsu_strsep(&cmdline, " \t\r\n");
@@ -1700,7 +1698,7 @@ evaluate_key(char *cmdline) {
if (tsigkey != NULL)
dns_tsigkey_detach(&tsigkey);
result = dns_tsigkey_create(mykeyname, hmacname, secret, secretlen,
false, NULL, 0, 0, gmctx, NULL,
ISC_FALSE, NULL, 0, 0, gmctx, NULL,
&tsigkey);
isc_mem_free(gmctx, secret);
if (result != ISC_R_SUCCESS) {
@@ -1712,7 +1710,7 @@ evaluate_key(char *cmdline) {
return (STATUS_MORE);
}
static uint16_t
static isc_uint16_t
evaluate_zone(char *cmdline) {
char *word;
isc_buffer_t b;
@@ -1737,7 +1735,7 @@ evaluate_zone(char *cmdline) {
return (STATUS_MORE);
}
static uint16_t
static isc_uint16_t
evaluate_realm(char *cmdline) {
#ifdef GSSAPI
char *word;
@@ -1768,11 +1766,11 @@ evaluate_realm(char *cmdline) {
#endif
}
static uint16_t
static isc_uint16_t
evaluate_ttl(char *cmdline) {
char *word;
isc_result_t result;
uint32_t ttl;
isc_uint32_t ttl;
word = nsu_strsep(&cmdline, " \t\r\n");
if (word == NULL || *word == 0) {
@@ -1782,7 +1780,7 @@ evaluate_ttl(char *cmdline) {
if (!strcasecmp(word, "none")) {
default_ttl = 0;
default_ttl_set = false;
default_ttl_set = ISC_FALSE;
return (STATUS_MORE);
}
@@ -1796,12 +1794,12 @@ evaluate_ttl(char *cmdline) {
return (STATUS_SYNTAX);
}
default_ttl = ttl;
default_ttl_set = true;
default_ttl_set = ISC_TRUE;
return (STATUS_MORE);
}
static uint16_t
static isc_uint16_t
evaluate_class(char *cmdline) {
char *word;
isc_textregion_t r;
@@ -1834,11 +1832,11 @@ evaluate_class(char *cmdline) {
return (STATUS_MORE);
}
static uint16_t
update_addordelete(char *cmdline, bool isdelete) {
static isc_uint16_t
update_addordelete(char *cmdline, isc_boolean_t isdelete) {
isc_result_t result;
dns_name_t *name = NULL;
uint32_t ttl;
isc_uint32_t ttl;
char *word;
dns_rdataclass_t rdataclass;
dns_rdatatype_t rdatatype;
@@ -1846,7 +1844,7 @@ update_addordelete(char *cmdline, bool isdelete) {
dns_rdatalist_t *rdatalist = NULL;
dns_rdataset_t *rdataset = NULL;
isc_textregion_t region;
uint16_t retval;
isc_uint16_t retval;
ddebug("update_addordelete()");
@@ -1983,7 +1981,7 @@ update_addordelete(char *cmdline, bool isdelete) {
dns_name_t *bad;
if (!dns_rdata_checkowner(name, rdata->rdclass, rdata->type,
true))
ISC_TRUE))
{
char namebuf[DNS_NAME_FORMATSIZE];
@@ -2028,10 +2026,10 @@ update_addordelete(char *cmdline, bool isdelete) {
return (STATUS_SYNTAX);
}
static uint16_t
static isc_uint16_t
evaluate_update(char *cmdline) {
char *word;
bool isdelete;
isc_boolean_t isdelete;
ddebug("evaluate_update()");
word = nsu_strsep(&cmdline, " \t\r\n");
@@ -2040,11 +2038,11 @@ evaluate_update(char *cmdline) {
return (STATUS_SYNTAX);
}
if (strcasecmp(word, "delete") == 0)
isdelete = true;
isdelete = ISC_TRUE;
else if (strcasecmp(word, "del") == 0)
isdelete = true;
isdelete = ISC_TRUE;
else if (strcasecmp(word, "add") == 0)
isdelete = false;
isdelete = ISC_FALSE;
else {
fprintf(stderr, "incorrect operation code: %s\n", word);
return (STATUS_SYNTAX);
@@ -2052,7 +2050,7 @@ evaluate_update(char *cmdline) {
return (update_addordelete(cmdline, isdelete));
}
static uint16_t
static isc_uint16_t
evaluate_checknames(char *cmdline) {
char *word;
@@ -2065,11 +2063,11 @@ evaluate_checknames(char *cmdline) {
if (strcasecmp(word, "yes") == 0 ||
strcasecmp(word, "true") == 0 ||
strcasecmp(word, "on") == 0) {
checknames = true;
checknames = ISC_TRUE;
} else if (strcasecmp(word, "no") == 0 ||
strcasecmp(word, "false") == 0 ||
strcasecmp(word, "off") == 0) {
checknames = false;
checknames = ISC_FALSE;
} else {
fprintf(stderr, "incorrect check-names directive: %s\n", word);
return (STATUS_SYNTAX);
@@ -2147,7 +2145,7 @@ show_message(FILE *stream, dns_message_t *msg, const char *description) {
isc_buffer_free(&buf);
}
static uint16_t
static isc_uint16_t
do_next_command(char *cmdline) {
char *word;
@@ -2163,21 +2161,21 @@ do_next_command(char *cmdline) {
if (strcasecmp(word, "prereq") == 0)
return (evaluate_prereq(cmdline));
if (strcasecmp(word, "nxdomain") == 0)
return (make_prereq(cmdline, false, false));
return (make_prereq(cmdline, ISC_FALSE, ISC_FALSE));
if (strcasecmp(word, "yxdomain") == 0)
return (make_prereq(cmdline, true, false));
return (make_prereq(cmdline, ISC_TRUE, ISC_FALSE));
if (strcasecmp(word, "nxrrset") == 0)
return (make_prereq(cmdline, false, true));
return (make_prereq(cmdline, ISC_FALSE, ISC_TRUE));
if (strcasecmp(word, "yxrrset") == 0)
return (make_prereq(cmdline, true, true));
return (make_prereq(cmdline, ISC_TRUE, ISC_TRUE));
if (strcasecmp(word, "update") == 0)
return (evaluate_update(cmdline));
if (strcasecmp(word, "delete") == 0)
return (update_addordelete(cmdline, true));
return (update_addordelete(cmdline, ISC_TRUE));
if (strcasecmp(word, "del") == 0)
return (update_addordelete(cmdline, true));
return (update_addordelete(cmdline, ISC_TRUE));
if (strcasecmp(word, "add") == 0)
return (update_addordelete(cmdline, false));
return (update_addordelete(cmdline, ISC_FALSE));
if (strcasecmp(word, "server") == 0)
return (evaluate_server(cmdline));
if (strcasecmp(word, "local") == 0)
@@ -2190,9 +2188,9 @@ do_next_command(char *cmdline) {
return (STATUS_SEND);
if (strcasecmp(word, "debug") == 0) {
if (debugging)
ddebugging = true;
ddebugging = ISC_TRUE;
else
debugging = true;
debugging = ISC_TRUE;
return (STATUS_MORE);
}
if (strcasecmp(word, "ttl") == 0)
@@ -2207,7 +2205,7 @@ do_next_command(char *cmdline) {
return (STATUS_MORE);
}
if (strcasecmp(word, "key") == 0) {
usegsstsig = false;
usegsstsig = ISC_FALSE;
return (evaluate_key(cmdline));
}
if (strcasecmp(word, "realm") == 0)
@@ -2217,8 +2215,8 @@ do_next_command(char *cmdline) {
return (evaluate_checknames(cmdline));
if (strcasecmp(word, "gsstsig") == 0) {
#ifdef GSSAPI
usegsstsig = true;
use_win2k_gsstsig = false;
usegsstsig = ISC_TRUE;
use_win2k_gsstsig = ISC_FALSE;
#else
fprintf(stderr, "gsstsig not supported\n");
#endif
@@ -2226,8 +2224,8 @@ do_next_command(char *cmdline) {
}
if (strcasecmp(word, "oldgsstsig") == 0) {
#ifdef GSSAPI
usegsstsig = true;
use_win2k_gsstsig = true;
usegsstsig = ISC_TRUE;
use_win2k_gsstsig = ISC_TRUE;
#else
fprintf(stderr, "gsstsig not supported\n");
#endif
@@ -2265,9 +2263,9 @@ do_next_command(char *cmdline) {
return (STATUS_SYNTAX);
}
static uint16_t
static isc_uint16_t
get_next_command(void) {
uint16_t result = STATUS_QUIT;
isc_uint16_t result = STATUS_QUIT;
char cmdlinebuf[MAXCMD];
char *cmdline;
@@ -2303,9 +2301,9 @@ get_next_command(void) {
return (result);
}
static bool
static isc_boolean_t
user_interaction(void) {
uint16_t result = STATUS_MORE;
isc_uint16_t result = STATUS_MORE;
ddebug("user_interaction()");
while ((result == STATUS_MORE) || (result == STATUS_SYNTAX)) {
@@ -2314,8 +2312,8 @@ user_interaction(void) {
fatal("syntax error");
}
if (result == STATUS_SEND)
return (true);
return (false);
return (ISC_TRUE);
return (ISC_FALSE);
}
@@ -2349,7 +2347,7 @@ check_tsig_error(dns_rdataset_t *rdataset, isc_buffer_t *b) {
}
}
static bool
static isc_boolean_t
next_master(const char *caller, isc_sockaddr_t *addr, isc_result_t eresult) {
char addrbuf[ISC_SOCKADDR_FORMATSIZE];
@@ -2357,9 +2355,9 @@ next_master(const char *caller, isc_sockaddr_t *addr, isc_result_t eresult) {
fprintf(stderr, "; Communication with %s failed: %s\n",
addrbuf, isc_result_totext(eresult));
if (++master_inuse >= master_total)
return (false);
return (ISC_FALSE);
ddebug("%s: trying next server", caller);
return (true);
return (ISC_TRUE);
}
static void
@@ -2390,7 +2388,7 @@ update_completed(isc_task_t *task, isc_event_t *event) {
&master_servers[master_inuse],
reqev->result))
{
seenerror = true;
seenerror = ISC_TRUE;
goto done;
}
@@ -2428,14 +2426,14 @@ update_completed(isc_task_t *task, isc_event_t *event) {
#endif
fprintf(stderr, "; TSIG error with server: %s\n",
isc_result_totext(result));
seenerror = true;
seenerror = ISC_TRUE;
break;
default:
check_result(result, "dns_request_getresponse");
}
if (answer->rcode != dns_rcode_noerror) {
seenerror = true;
seenerror = ISC_TRUE;
if (!debugging) {
char buf[64];
isc_buffer_t b;
@@ -2459,8 +2457,6 @@ update_completed(isc_task_t *task, isc_event_t *event) {
if (usegsstsig) {
dns_name_free(&tmpzonename, gmctx);
dns_name_free(&restart_master, gmctx);
dns_name_init(&tmpzonename, 0);
dns_name_init(&restart_master, 0);
}
isc_event_free(&event);
done_update();
@@ -2541,7 +2537,7 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
dns_message_t *soaquery = NULL;
isc_sockaddr_t *addr;
isc_sockaddr_t *srcaddr;
bool seencname = false;
isc_boolean_t seencname = ISC_FALSE;
dns_name_t tname;
unsigned int nlabels;
@@ -2638,7 +2634,7 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
dns_message_destroy(&soaquery);
ddebug("Out of recvsoa");
done_update();
seenerror = true;
seenerror = ISC_TRUE;
return;
}
@@ -2669,7 +2665,7 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
&tset) == ISC_R_SUCCESS ||
dns_message_findtype(name, dns_rdatatype_dname, 0,
&tset) == ISC_R_SUCCESS ) {
seencname = true;
seencname = ISC_TRUE;
break;
}
}
@@ -2725,7 +2721,7 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
size_t size;
isc_buffer_init(&buf, serverstr, sizeof(serverstr));
result = dns_name_totext(&master, true, &buf);
result = dns_name_totext(&master, ISC_TRUE, &buf);
check_result(result, "dns_name_totext");
serverstr[isc_buffer_usedlength(&buf)] = 0;
@@ -2872,12 +2868,10 @@ get_ticket_realm(isc_mem_t *mctx) {
static void
failed_gssrequest() {
seenerror = true;
seenerror = ISC_TRUE;
dns_name_free(&tmpzonename, gmctx);
dns_name_free(&restart_master, gmctx);
dns_name_init(&tmpzonename, NULL);
dns_name_init(&restart_master, NULL);
done_update();
}
@@ -2887,7 +2881,7 @@ start_gssrequest(dns_name_t *master) {
gss_ctx_id_t context;
isc_buffer_t buf;
isc_result_t result;
uint32_t val = 0;
isc_uint32_t val = 0;
dns_message_t *rmsg = NULL;
dns_request_t *request = NULL;
dns_name_t *servname;
@@ -2897,7 +2891,7 @@ start_gssrequest(dns_name_t *master) {
char *err_message = NULL;
debug("start_gssrequest");
usevc = true;
usevc = ISC_TRUE;
if (gssring != NULL)
dns_tsigkeyring_detach(&gssring);
@@ -3094,10 +3088,10 @@ recvgss(isc_task_t *task, isc_event_t *event) {
ddebug("recvgss trying %s GSS-TSIG",
use_win2k_gsstsig ? "Standard" : "Win2k");
if (use_win2k_gsstsig)
use_win2k_gsstsig = false;
use_win2k_gsstsig = ISC_FALSE;
else
use_win2k_gsstsig = true;
tried_other_gsstsig = true;
use_win2k_gsstsig = ISC_TRUE;
tried_other_gsstsig = ISC_TRUE;
start_gssrequest(&restart_master);
goto done;
}
@@ -3286,12 +3280,6 @@ cleanup(void) {
isc_mem_free(gmctx, realm);
realm = NULL;
}
if (dns_name_dynamic(&tmpzonename)) {
dns_name_free(&tmpzonename, gmctx);
}
if (dns_name_dynamic(&restart_master)) {
dns_name_free(&restart_master, gmctx);
}
#endif
if (sig0key != NULL)
@@ -3326,7 +3314,7 @@ cleanup(void) {
static void
getinput(isc_task_t *task, isc_event_t *event) {
bool more;
isc_boolean_t more;
UNUSED(task);
@@ -3355,15 +3343,15 @@ main(int argc, char **argv) {
input = stdin;
interactive = isatty(0);
interactive = ISC_TF(isatty(0));
isc_app_start();
if (isc_net_probeipv4() == ISC_R_SUCCESS) {
have_ipv4 = true;
have_ipv4 = ISC_TRUE;
}
if (isc_net_probeipv6() == ISC_R_SUCCESS) {
have_ipv6 = true;
have_ipv6 = ISC_TRUE;
}
if (!have_ipv4 && !have_ipv6) {
fatal("could not find either IPv4 or IPv6");
-1
View File
@@ -49,7 +49,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+2 -2
View File
@@ -152,8 +152,8 @@ main(int argc, char *argv[]) {
if (pin == NULL)
pin = getpassphrase("Enter Pin: ");
result = pk11_get_session(&pctx, OP_ANY, false, true,
true, (const char *) pin, slot);
result = pk11_get_session(&pctx, OP_ANY, ISC_FALSE, ISC_TRUE,
ISC_TRUE, (const char *) pin, slot);
if (result == PK11_R_NORANDOMSERVICE ||
result == PK11_R_NODIGESTSERVICE ||
result == PK11_R_NOAESSERVICE) {
-1
View File
@@ -37,7 +37,6 @@
<year>2015</year>
<year>2016</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+13 -38
View File
@@ -43,7 +43,7 @@
* Create a key in the keystore of an HSM
*
* The calculation of key tag is left to the script
* that converts the key into a DNSKEY RR and inserts
* that converts the key into a DNSKEY RR and inserts
* it into a zone file.
*
* usage:
@@ -432,10 +432,10 @@ main(int argc, char *argv[]) {
break;
case key_ecx:
#if !defined(CKM_EDDSA_KEY_PAIR_GEN)
#ifndef CKM_EDDSA_KEY_PAIR_GEN
fprintf(stderr, "CKM_EDDSA_KEY_PAIR_GEN is not defined\n");
usage();
#else
#endif
op_type = OP_EC;
if (bits == 0)
bits = 256;
@@ -454,27 +454,16 @@ main(int argc, char *argv[]) {
id_offset = ECC_ID;
if (bits == 256) {
#if HAVE_PKCS11_ED25519
public_template[4].pValue = pk11_ecc_ed25519;
public_template[4].ulValueLen =
sizeof(pk11_ecc_ed25519);
#else
fprintf(stderr, "Ed25519 is not supported\n");
usage();
#endif
} else {
#if HAVE_PKCS11_ED448
public_template[4].pValue = pk11_ecc_ed448;
public_template[4].ulValueLen =
sizeof(pk11_ecc_ed448);
#else
fprintf(stderr, "Ed449 is not supported\n");
usage();
#endif
}
break;
#endif /* !defined(CKM_EDDSA_KEY_PAIR_GEN) */
case key_dsa:
op_type = OP_DSA;
if (bits == 0)
@@ -538,7 +527,7 @@ main(int argc, char *argv[]) {
case key_unknown:
usage();
}
search_template[0].pValue = label;
search_template[0].ulValueLen = strlen((char *)label);
public_template[0].pValue = label;
@@ -576,8 +565,8 @@ main(int argc, char *argv[]) {
if (pin == NULL)
pin = getpassphrase("Enter Pin: ");
result = pk11_get_session(&pctx, op_type, false, true,
true, (const char *) pin, slot);
result = pk11_get_session(&pctx, op_type, ISC_FALSE, ISC_TRUE,
ISC_TRUE, (const char *) pin, slot);
if (result == PK11_R_NORANDOMSERVICE ||
result == PK11_R_NODIGESTSERVICE ||
result == PK11_R_NOAESSERVICE) {
@@ -595,7 +584,7 @@ main(int argc, char *argv[]) {
hSession = pctx.session;
/* check if a key with the same id already exists */
rv = pkcs_C_FindObjectsInit(hSession, search_template, 1);
rv = pkcs_C_FindObjectsInit(hSession, search_template, 1);
if (rv != CKR_OK) {
fprintf(stderr, "C_FindObjectsInit: Error = 0x%.8lX\n", rv);
error = 1;
@@ -668,18 +657,8 @@ main(int argc, char *argv[]) {
}
/* Allocate space for parameter attributes */
for (i = 0; i < param_attrcnt; i++) {
param_template[i].pValue = NULL;
}
for (i = 0; i < param_attrcnt; i++) {
for (i = 0; i < param_attrcnt; i++)
param_template[i].pValue = malloc(param_template[i].ulValueLen);
if (param_template[i].pValue == NULL) {
fprintf(stderr, "malloc failed\n");
error = 1;
goto exit_params;
}
}
rv = pkcs_C_GetAttributeValue(hSession, domainparams,
dsa_param_template, DSA_PARAM_ATTRS);
@@ -725,22 +704,18 @@ main(int argc, char *argv[]) {
public_template, public_attrcnt,
private_template, private_attrcnt,
&publickey, &privatekey);
if (rv != CKR_OK) {
fprintf(stderr, "C_GenerateKeyPair: Error = 0x%.8lX\n", rv);
error = 1;
} else if (!quiet)
printf("Key pair generation complete.\n");
exit_params:
/* Free parameter attributes */
if (keyclass == key_dsa || keyclass == key_dh) {
for (i = 0; i < param_attrcnt; i++) {
if (param_template[i].pValue != NULL) {
free(param_template[i].pValue);
}
}
}
if (keyclass == key_dsa || keyclass == key_dh)
for (i = 0; i < param_attrcnt; i++)
free(param_template[i].pValue);
exit_domain:
/* Destroy domain parameters */
-1
View File
@@ -38,7 +38,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+4 -5
View File
@@ -40,7 +40,6 @@
#include <config.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
@@ -72,7 +71,7 @@ main(int argc, char *argv[]) {
char *lib_name = NULL;
char *label = NULL;
char *pin = NULL;
bool error = false, logon = true, all = false;
isc_boolean_t error = ISC_FALSE, logon = ISC_TRUE, all = ISC_FALSE;
unsigned int i = 0, id = 0;
int c, errflg = 0;
CK_ULONG ulObjectCount;
@@ -83,7 +82,7 @@ main(int argc, char *argv[]) {
while ((c = isc_commandline_parse(argc, argv, ":m:s:i:l:p:P")) != -1) {
switch (c) {
case 'P':
logon = false;
logon = ISC_FALSE;
break;
case 'm':
lib_name = isc_commandline_argument;
@@ -122,7 +121,7 @@ main(int argc, char *argv[]) {
}
if (!id && (label == NULL))
all = true;
all = ISC_TRUE;
if (slot)
printf("slot %lu\n", slot);
@@ -147,7 +146,7 @@ main(int argc, char *argv[]) {
if (logon && pin == NULL)
pin = getpassphrase("Enter Pin: ");
result = pk11_get_session(&pctx, OP_ANY, false, false,
result = pk11_get_session(&pctx, OP_ANY, ISC_FALSE, ISC_FALSE,
logon, pin, slot);
if (result == PK11_R_NORANDOMSERVICE ||
result == PK11_R_NODIGESTSERVICE ||
-1
View File
@@ -37,7 +37,6 @@
<year>2015</year>
<year>2016</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+3 -3
View File
@@ -46,7 +46,7 @@ main(int argc, char *argv[]) {
lib_name = isc_commandline_argument;
break;
case 'v':
pk11_verbose_init = true;
pk11_verbose_init = ISC_TRUE;
break;
case ':':
fprintf(stderr, "Option -%c requires an operand\n",
@@ -78,8 +78,8 @@ main(int argc, char *argv[]) {
if (lib_name != NULL)
pk11_set_lib_name(lib_name);
result = pk11_get_session(&pctx, OP_ANY, true, false,
false, NULL, 0);
result = pk11_get_session(&pctx, OP_ANY, ISC_TRUE, ISC_FALSE,
ISC_FALSE, NULL, 0);
if (result == PK11_R_NORANDOMSERVICE ||
result == PK11_R_NODIGESTSERVICE ||
result == PK11_R_NOAESSERVICE) {
-1
View File
@@ -36,7 +36,6 @@
<year>2015</year>
<year>2016</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
-1
View File
@@ -39,7 +39,6 @@
<year>2016</year>
<year>2017</year>
<year>2018</year>
<year>2019</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>

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