Compare commits
363
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1af0302a38 | ||
|
|
5d3fab88c8 | ||
|
|
3382335716 | ||
|
|
3e44011370 | ||
|
|
4fcdad292d | ||
|
|
0fc1b1bffa | ||
|
|
c93acb9949 | ||
|
|
b026663c62 | ||
|
|
eb6d02fbe5 | ||
|
|
b4dca44ad2 | ||
|
|
b5cfc5d032 | ||
|
|
be8713a1e8 | ||
|
|
cea9ff573c | ||
|
|
72b49ce869 | ||
|
|
2b61b83199 | ||
|
|
5752645e60 | ||
|
|
0494f86a7b | ||
|
|
e47ef88810 | ||
|
|
6a3afe2778 | ||
|
|
e116beb68e | ||
|
|
9407d9e266 | ||
|
|
9a5c21b475 | ||
|
|
ac1c3aaa27 | ||
|
|
26699ac57e | ||
|
|
b04c7bbd60 | ||
|
|
6d05ec7dc1 | ||
|
|
261b7560b0 | ||
|
|
21966423cd | ||
|
|
37e834defc | ||
|
|
feb2a41b7c | ||
|
|
56003e9f9f | ||
|
|
f6bd695a98 | ||
|
|
f2d6b1b859 | ||
|
|
e673237509 | ||
|
|
e7c99e42f3 | ||
|
|
eb74f2ee68 | ||
|
|
7effcffba2 | ||
|
|
ae2bc454e5 | ||
|
|
a1d8306e3a | ||
|
|
090a564de5 | ||
|
|
be333e93ec | ||
|
|
0eda75fec0 | ||
|
|
5cf8fc4bba | ||
|
|
bf9c60078a | ||
|
|
874a4baf62 | ||
|
|
38cf56ac38 | ||
|
|
29f699d669 | ||
|
|
2f6ba87ab9 | ||
|
|
cc0abf62a1 | ||
|
|
83dc5a704a | ||
|
|
07f29a083b | ||
|
|
a6f43574a0 | ||
|
|
d98de244c3 | ||
|
|
f924c89f97 | ||
|
|
77a0fadfce | ||
|
|
4aa6a118de | ||
|
|
d1f8e116db | ||
|
|
54c4db569b | ||
|
|
fbeefd4990 | ||
|
|
5fb75a3d75 | ||
|
|
156d86e673 | ||
|
|
d6f14f06de | ||
|
|
81b133d963 | ||
|
|
e860375d4f | ||
|
|
ad9bf4c662 | ||
|
|
5824023082 | ||
|
|
2c3b827e5d | ||
|
|
ac430136fb | ||
|
|
68e017792f | ||
|
|
8ffd9a9b71 | ||
|
|
8e4cc152f7 | ||
|
|
2ed5eb3b9e | ||
|
|
341fd22bb0 | ||
|
|
161b5dccae | ||
|
|
2750799132 | ||
|
|
7e25330b3d | ||
|
|
5a0f618d22 | ||
|
|
7716bdd400 | ||
|
|
43c468926b | ||
|
|
5d8f9bf935 | ||
|
|
fa048a9b2c | ||
|
|
c83d9b9b50 | ||
|
|
51bcdb78af | ||
|
|
7384a9f23a | ||
|
|
78bb5761a0 | ||
|
|
4a5ecad038 | ||
|
|
19ae4438ab | ||
|
|
927b65aa7f | ||
|
|
c7b1e7fd08 | ||
|
|
2f02552a93 | ||
|
|
4d46f0f95d | ||
|
|
51b0d5d55e | ||
|
|
f1d3055d7b | ||
|
|
092edb5b44 | ||
|
|
5d65392d18 | ||
|
|
68f473a25e | ||
|
|
d00ef56dfa | ||
|
|
47f18c7d50 | ||
|
|
4014bc42dd | ||
|
|
1333d4a71a | ||
|
|
0bea5c2baf | ||
|
|
53d87175df | ||
|
|
c798db0fcd | ||
|
|
f8635fd719 | ||
|
|
22e5231f99 | ||
|
|
376bea8b40 | ||
|
|
510bb376e1 | ||
|
|
3949450fbd | ||
|
|
17212cf996 | ||
|
|
a985badd34 | ||
|
|
881a868dc0 | ||
|
|
3561018919 | ||
|
|
1aa3ba2bb1 | ||
|
|
633eeabb2e | ||
|
|
ac21bbb13a | ||
|
|
ca6dda7328 | ||
|
|
f8d9bd6178 | ||
|
|
f6c08a28e8 | ||
|
|
0dc714c40d | ||
|
|
8360df5a4c | ||
|
|
02041b94d9 | ||
|
|
215e3fde22 | ||
|
|
19ed6f8f5a | ||
|
|
7157596743 | ||
|
|
0868e5700f | ||
|
|
3023f14c40 | ||
|
|
142cb0ab8f | ||
|
|
25248eb097 | ||
|
|
73b2648480 | ||
|
|
d932ec871c | ||
|
|
0716902f6f | ||
|
|
8a167a4b30 | ||
|
|
47066d3d01 | ||
|
|
75c2996df8 | ||
|
|
5c00162f54 | ||
|
|
eb9849daff | ||
|
|
05bed0ecd6 | ||
|
|
05eb9fd338 | ||
|
|
1b75d421b7 | ||
|
|
feaf381adb | ||
|
|
38f96de923 | ||
|
|
5e37190877 | ||
|
|
615ebc39e3 | ||
|
|
e7e4603f9b | ||
|
|
c81c9660f5 | ||
|
|
c0c80df254 | ||
|
|
d68499e1f7 | ||
|
|
8e5abc6cdf | ||
|
|
050fca2139 | ||
|
|
c5b4948db3 | ||
|
|
455bb23236 | ||
|
|
bbaff4d80f | ||
|
|
e6106b9940 | ||
|
|
7ee4f849b8 | ||
|
|
d9d96761cd | ||
|
|
59156c60eb | ||
|
|
d3e2f848ec | ||
|
|
6a9031b0a6 | ||
|
|
e582d085de | ||
|
|
7f508ec229 | ||
|
|
d67b07c115 | ||
|
|
7cba3cc474 | ||
|
|
c74ee5bb17 | ||
|
|
d967e107f6 | ||
|
|
aa3e33575d | ||
|
|
7d44cc2422 | ||
|
|
d60e553a64 | ||
|
|
d03b9ec544 | ||
|
|
77f71d7d4a | ||
|
|
5928d31efc | ||
|
|
ae80e61684 | ||
|
|
1656152d76 | ||
|
|
cacd21c075 | ||
|
|
b938f50ded | ||
|
|
3c18b7d3fd | ||
|
|
e2a2f08ed5 | ||
|
|
dc410ce58f | ||
|
|
416e09d715 | ||
|
|
103b60e0bc | ||
|
|
d077f5c180 | ||
|
|
cddb699690 | ||
|
|
700614a0eb | ||
|
|
cc8a647887 | ||
|
|
c4c3b98a27 | ||
|
|
79ce86090a | ||
|
|
c268c47c76 | ||
|
|
dedb104382 | ||
|
|
fecbc7923a | ||
|
|
6034664e36 | ||
|
|
ddaa853ed6 | ||
|
|
91aa405778 | ||
|
|
0f24c55d38 | ||
|
|
9d5df99a9d | ||
|
|
b5709e5531 | ||
|
|
d1d15c03e2 | ||
|
|
69b9b9ec77 | ||
|
|
bef8ac5bae | ||
|
|
7fbbf09d21 | ||
|
|
2b74478c8f | ||
|
|
93e8ba1b50 | ||
|
|
0a7535ac81 | ||
|
|
e9e55cbd03 | ||
|
|
e119de4169 | ||
|
|
facc390b54 | ||
|
|
7ab9c9dbee | ||
|
|
ecb27adf86 | ||
|
|
f4c8e42f3e | ||
|
|
7de898777f | ||
|
|
1e404fdb0e | ||
|
|
99f17b80b8 | ||
|
|
b6e64eb23b | ||
|
|
2c19877197 | ||
|
|
19a374e45d | ||
|
|
a8b868e820 | ||
|
|
f1d658764c | ||
|
|
52e1c45156 | ||
|
|
a11a271b28 | ||
|
|
1672935717 | ||
|
|
efd613e874 | ||
|
|
1e1804bb96 | ||
|
|
62fb0759e9 | ||
|
|
29c853f500 | ||
|
|
40f7680efa | ||
|
|
e6dc08b06c | ||
|
|
388d6db5a1 | ||
|
|
3ab9c99567 | ||
|
|
8c526df306 | ||
|
|
4150a86046 | ||
|
|
5083a42072 | ||
|
|
b962f47d3e | ||
|
|
243a347d60 | ||
|
|
7b21bbb7c1 | ||
|
|
00ca487fec | ||
|
|
c19713aa51 | ||
|
|
9f4528c623 | ||
|
|
02e349c051 | ||
|
|
b02de1ec30 | ||
|
|
18e3c8d232 | ||
|
|
f0f71420c8 | ||
|
|
9a8da1e25a | ||
|
|
e53a72a649 | ||
|
|
518772e4e0 | ||
|
|
a1d783bbe2 | ||
|
|
ca0ce1cb42 | ||
|
|
525fd76685 | ||
|
|
760182271e | ||
|
|
de41f0beea | ||
|
|
55361748d7 | ||
|
|
edf5c01fcb | ||
|
|
8b3878dc7d | ||
|
|
dc4086d4f2 | ||
|
|
a3c5c2c29c | ||
|
|
0370d13667 | ||
|
|
25bb33c866 | ||
|
|
59057bee5b | ||
|
|
deb3b85cb2 | ||
|
|
d3bd90f3a7 | ||
|
|
a23162ab28 | ||
|
|
8f37439ccf | ||
|
|
7ab228cf71 | ||
|
|
18ebcf2b30 | ||
|
|
8c5aeb6c4c | ||
|
|
e79b42fec0 | ||
|
|
875b29c3e3 | ||
|
|
ba350f40ff | ||
|
|
4fb5d072c2 | ||
|
|
087157d14f | ||
|
|
2359f06aa6 | ||
|
|
e36c869e85 | ||
|
|
1c82dde85c | ||
|
|
42b16771db | ||
|
|
2c1d8b2e99 | ||
|
|
751c660b9d | ||
|
|
05531d3a86 | ||
|
|
4742f4ecba | ||
|
|
e59617441e | ||
|
|
c1bc3baf7f | ||
|
|
1056376d10 | ||
|
|
0213626992 | ||
|
|
0d6f504ba3 | ||
|
|
af1df8738f | ||
|
|
ca9aaf926f | ||
|
|
591a6c94ee | ||
|
|
4016369212 | ||
|
|
31b5360943 | ||
|
|
65de91f512 | ||
|
|
db3d69263d | ||
|
|
d877d4a561 | ||
|
|
1c57b73e34 | ||
|
|
d30b90dba6 | ||
|
|
e67f81bbf1 | ||
|
|
cb28c27b30 | ||
|
|
f9931f1d22 | ||
|
|
5431583971 | ||
|
|
d2785afebe | ||
|
|
b3b1a9081b | ||
|
|
8db550c42f | ||
|
|
71793853df | ||
|
|
2923ab4945 | ||
|
|
24b9ec555a | ||
|
|
3596bad5ce | ||
|
|
083007e930 | ||
|
|
2bb4392bb3 | ||
|
|
bf98eb41bf | ||
|
|
ab9f12c7f4 | ||
|
|
28cf1a7a9c | ||
|
|
44cec639c4 | ||
|
|
c692da2182 | ||
|
|
5cdb38c2c7 | ||
|
|
8e164f784d | ||
|
|
9c950e5961 | ||
|
|
28748db0b2 | ||
|
|
1ff71c7cee | ||
|
|
e2c938d882 | ||
|
|
0bdefcb599 | ||
|
|
4eb0897c90 | ||
|
|
7ecd699e81 | ||
|
|
eaac2057c7 | ||
|
|
509d71e1aa | ||
|
|
0ce82e9d5f | ||
|
|
53690ef21f | ||
|
|
cab7c34fbd | ||
|
|
fe20f8fe25 | ||
|
|
527614c750 | ||
|
|
13fe763798 | ||
|
|
495e10ba5a | ||
|
|
24dd865b97 | ||
|
|
e0d309572f | ||
|
|
5dd1beec8e | ||
|
|
dc5b8ec97a | ||
|
|
eed6778be4 | ||
|
|
cb40c5229a | ||
|
|
f34e7ee612 | ||
|
|
ebf3083e08 | ||
|
|
9689313331 | ||
|
|
4c06eb20cc | ||
|
|
a2188e61e7 | ||
|
|
c746037622 | ||
|
|
28b0de3e86 | ||
|
|
6bc771828c | ||
|
|
2cd0a493ae | ||
|
|
bdc9860262 | ||
|
|
d6f4592f6b | ||
|
|
b865fb77de | ||
|
|
c3e4363303 | ||
|
|
c5040e5c9e | ||
|
|
86c377ccbb | ||
|
|
b14e127569 | ||
|
|
337f9dd0ec | ||
|
|
b4b4277f5a | ||
|
|
3f907b8bee | ||
|
|
9d7ad52506 | ||
|
|
cac3978af2 | ||
|
|
fa03f94102 | ||
|
|
75c2356f42 | ||
|
|
7351c505a0 | ||
|
|
994e656977 | ||
|
|
cb6a185c69 | ||
|
|
055278c936 | ||
|
|
64fe6bbaf2 | ||
|
|
9e493798c6 | ||
|
|
e5ee96fc1b | ||
|
|
b55338e447 |
+28
-18
@@ -4,6 +4,7 @@ variables:
|
||||
DOCKER_DRIVER: overlay2
|
||||
CI_REGISTRY_IMAGE: registry.gitlab.isc.org/isc-projects/images/bind9
|
||||
CCACHE_DIR: "/ccache"
|
||||
SOFTHSM2_CONF: "/var/tmp/softhsm2/softhsm2.conf"
|
||||
|
||||
stages:
|
||||
- precheck
|
||||
@@ -114,20 +115,25 @@ stages:
|
||||
- test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
|
||||
# - ./autogen.sh
|
||||
script:
|
||||
- ./configure --enable-developer --with-libtool --disable-static --with-atf=/usr $EXTRA_CONFIGURE
|
||||
- ./configure --enable-developer --with-libtool --disable-static --with-atf=/usr --prefix=$HOME/.local --without-make-clean $EXTRA_CONFIGURE || cat config.log
|
||||
- make -j${PARALLEL_JOBS_BUILD:-1} -k all V=1
|
||||
artifacts:
|
||||
expire_in: '1 hour'
|
||||
untracked: true
|
||||
|
||||
.install_test: &install_test_job
|
||||
stage: test
|
||||
before_script:
|
||||
- mkdir $HOME/.local
|
||||
script:
|
||||
- make install
|
||||
|
||||
.system_test: &system_test_job
|
||||
stage: test
|
||||
before_script:
|
||||
- rm -rf .ccache
|
||||
- bash -x bin/tests/system/ifconfig.sh up
|
||||
- export SOFTHSM_CONF="/tmp/softhsm.conf"
|
||||
- echo "0:/tmp/softhsm.db" > $SOFTHSM_CONF
|
||||
- if command -v softhsm2-util >/dev/null; then softhsm2-util --init-token --free --pin 0000 --so-pin 0000 --label "softhsm"; fi
|
||||
- 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
|
||||
@@ -140,9 +146,7 @@ stages:
|
||||
stage: test
|
||||
before_script:
|
||||
- export KYUA_RESULT="$CI_PROJECT_DIR/kyua.results"
|
||||
- export SOFTHSM_CONF="/tmp/softhsm.conf"
|
||||
- echo "0:/tmp/softhsm.db" > $SOFTHSM_CONF
|
||||
- if command -v softhsm2-util >/dev/null; then softhsm2-util --init-token --free --pin 0000 --so-pin 0000 --label "softhsm"; fi
|
||||
- bash -x util/prepare-softhsm2.sh
|
||||
script:
|
||||
- make unit
|
||||
after_script:
|
||||
@@ -165,6 +169,8 @@ precheck:debian:sid:amd64:
|
||||
- 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:
|
||||
@@ -214,12 +220,11 @@ build:centos:centos7:amd64:
|
||||
<<: *centos_centos7_amd64_image
|
||||
<<: *build_job
|
||||
|
||||
build:clang:debian:sid:amd64:
|
||||
build:clang:debian:stretch:amd64:
|
||||
variables:
|
||||
CC: clang-6.0
|
||||
CC: clang
|
||||
CFLAGS: "-Wall -Wextra -Wenum-conversion -O2 -g"
|
||||
EXTRA_CONFIGURE: "--with-libidn2"
|
||||
<<: *debian_sid_amd64_image
|
||||
<<: *debian_stretch_amd64_image
|
||||
<<: *build_job
|
||||
|
||||
build:debian:jessie:amd64:
|
||||
@@ -244,12 +249,11 @@ build:debian:sid:amd64:
|
||||
<<: *debian_sid_amd64_image
|
||||
<<: *build_job
|
||||
|
||||
build:clang:debian:sid:i386:
|
||||
build:clang:debian:stretch:i386:
|
||||
variables:
|
||||
CC: clang-6.0
|
||||
CC: clang
|
||||
CFLAGS: "-Wall -Wextra -Wenum-conversion -O2 -g"
|
||||
EXTRA_CONFIGURE: "--with-libidn2"
|
||||
<<: *debian_sid_i386_image
|
||||
<<: *debian_stretch_i386_image
|
||||
<<: *build_job
|
||||
|
||||
build:debian:sid:i386:
|
||||
@@ -290,11 +294,11 @@ unittest:debian:sid:amd64:
|
||||
dependencies:
|
||||
- build:debian:sid:amd64
|
||||
|
||||
unittest:clang:debian:sid:amd64:
|
||||
<<: *debian_sid_amd64_image
|
||||
unittest:clang:debian:stretch:amd64:
|
||||
<<: *debian_stretch_amd64_image
|
||||
<<: *unit_test_job
|
||||
dependencies:
|
||||
- build:clang:debian:sid:amd64
|
||||
- build:clang:debian:stretch:amd64
|
||||
|
||||
unittest:debian:sid:i386:
|
||||
<<: *debian_sid_i386_image
|
||||
@@ -338,6 +342,12 @@ systemtest:debian:sid:i386:
|
||||
dependencies:
|
||||
- build:debian:sid:i386
|
||||
|
||||
install:debian:sid:amd64:
|
||||
<<: *debian_sid_amd64_image
|
||||
<<: *install_test_job
|
||||
dependencies:
|
||||
- build:debian:sid:amd64
|
||||
|
||||
pkcs11:build:debian:sid:amd64:
|
||||
variables:
|
||||
CC: gcc
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
## Release Checklist
|
||||
|
||||
- [ ] Check for the presence of a milestone for the release
|
||||
- If there is a milestone, are all the issues for the milestone resolved? (other than this checklist)
|
||||
- [ ] Prepare the sources for tarball generation
|
||||
- [ ] Change software version and library versions in configure.in
|
||||
- [ ] Update CHANGES
|
||||
- [ ] Ensure the release notes are correct for this release
|
||||
- [ ] Ensure the metainformation is correct for this release
|
||||
- [ ] Make sure the tests are passing
|
||||
- [ ] Create a tag (name vX_Y_Z[-alphatag], content BIND X.Y.Z[-alphatag], signed with a developer's GPG key): git tag -u <DEVELOPER_KEYID> -a -s -m "BIND X.Y.Z" vX.Y.Z
|
||||
- [ ] Push the changes and tag
|
||||
- [ ] Create the tarball
|
||||
- [ ] Create the Windows zips
|
||||
- [ ] Ask QA to sanity check the tarball and zips
|
||||
- [ ] Request the signature on the tarballs
|
||||
- [ ] Make tarballs and signatures available to download
|
||||
- [ ] Edit the release https://gitlab.isc.org/isc-projects/bind9/tags and the NEWS snippet + links to the tarballs
|
||||
- [ ] Update DEB and RPM packages
|
||||
|
||||
## Communication
|
||||
|
||||
- [ ] Inform support to upload to the web site (nice to give them a heads-up in advance)
|
||||
- Write release e-mail to bind9-announce, bind-users in case of a major release
|
||||
- Update tickets in case of waiting support customers
|
||||
- [ ] Inform marketing to announce the release
|
||||
- Post short note to Twitter
|
||||
- Update http://en.wikipedia.org/wiki/BIND (mktg)
|
||||
- Blog post if a major release
|
||||
@@ -1,3 +1,128 @@
|
||||
5039. [bug] Named could fail to preserve owner name case of new
|
||||
RRset. [GL #420]
|
||||
|
||||
5038. [bug] Chaosnet addresses were compared incorrectly.
|
||||
[GL #562]
|
||||
|
||||
5037. [func] "allow-recursion-on" and "allow-query-cache-on"
|
||||
each now default to the other if only one of them
|
||||
is set, in order to be more consistent with the way
|
||||
"allow-recursion" and "allow-query-cache" work.
|
||||
Also we now ensure that both query-cache ACLs are
|
||||
checked when determining cache access. [GL #319]
|
||||
|
||||
5036. [cleanup] Fixed a spacing/formatting error in some RPZ-related
|
||||
error messages in the log. [GL !805]
|
||||
|
||||
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]
|
||||
|
||||
5031. [cleanup] Various defines in platform.h has been either dropped
|
||||
if always or never triggered on supported platforms
|
||||
or replaced with config.h equivalents if the defines
|
||||
didn't have any impact on public headers. Workarounds
|
||||
for LinuxThreads have been removed because NPTL is
|
||||
available since Linux kernel 2.6.0. [GL #525]
|
||||
|
||||
5030. [bug] Align CMSG buffers to a 64-bit boundary, fixes crash
|
||||
on architectures with strict alignment. [GL #521]
|
||||
|
||||
--- 9.13.3 released ---
|
||||
|
||||
5029. [func] Workarounds for servers that misbehave when queried
|
||||
with EDNS have been removed, because these broken
|
||||
servers and the workarounds for their noncompliance
|
||||
cause unnecessary delays, increase code complexity,
|
||||
and prevent deployment of new DNS features. See
|
||||
https://dnsflagday.net for further details. [GL #150]
|
||||
|
||||
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]
|
||||
|
||||
5027. [func] Set SO_SNDBUF size on sockets. [GL #74]
|
||||
|
||||
5026. [bug] rndc reconfig should not touch already loaded zones.
|
||||
[GL #276]
|
||||
|
||||
5025. [cleanup] Remove isc_keyboard family of functions. [GL #178]
|
||||
|
||||
5024. [func] Replace custom assembly for atomic operations with
|
||||
atomic support from the compiler. The code will now use
|
||||
C11 stdatomic, or __atomic, or __sync builtins with GCC
|
||||
or Clang compilers, and Interlocked functions with MSVC.
|
||||
[GL #10]
|
||||
|
||||
5023. [cleanup] Remove wrappers that try to fix broken or incomplete
|
||||
implementations of IPv6, pthreads and other core
|
||||
functionality required and used by BIND. [GL #192]
|
||||
|
||||
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]
|
||||
|
||||
5020. [func] RNG uses thread-local storage instead of locks, if
|
||||
supported by platform. [GL #496]
|
||||
|
||||
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]
|
||||
|
||||
5011. [func] Remove support for unthreaded named. [GL #478]
|
||||
|
||||
5010. [func] New "validate-except" option specifies a list of
|
||||
domains beneath which DNSSEC validation should not
|
||||
be performed. [GL #237]
|
||||
|
||||
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
|
||||
@@ -27,7 +152,9 @@
|
||||
|
||||
4998. [test] Make resolver and cacheclean tests more civilized.
|
||||
|
||||
4997. [placeholder]
|
||||
4997. [security] named could crash during recursive processing
|
||||
of DNAME records when "deny-answer-aliases" was
|
||||
in use. (CVE-2018-5740) [GL #387]
|
||||
|
||||
4996. [bug] dig: Handle malformed +ednsopt option. [GL #403]
|
||||
|
||||
|
||||
+2
-1
@@ -14,7 +14,7 @@ top_builddir = @top_builddir@
|
||||
|
||||
VERSION=@BIND9_VERSION@
|
||||
|
||||
SUBDIRS = make unit lib bin doc
|
||||
SUBDIRS = make unit lib fuzz bin doc
|
||||
TARGETS =
|
||||
PREREQS = bind.keys.h
|
||||
|
||||
@@ -90,6 +90,7 @@ force-test: test-force
|
||||
|
||||
test-force:
|
||||
status=0; \
|
||||
(cd fuzz && ${MAKE} check) || status=1; \
|
||||
(cd bin/tests && ${MAKE} ${MAKEDEFS} test) || status=1; \
|
||||
(test -f ${top_builddir}/unit/unittest.sh && \
|
||||
$(SHELL) ${top_builddir}/unit/unittest.sh) || status=1; \
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
Supported platforms
|
||||
|
||||
In general, this version of BIND will build and run on any POSIX-compliant
|
||||
system with a C99-compliant C compiler, BSD-style sockets, and the OpenSSL
|
||||
cryptography library. To build with multiprocessing support, a
|
||||
C11-compliant C compiler will be needed for standard atomics.
|
||||
system with a C99-compliant C compiler, BSD-style sockets with
|
||||
RFC-compliant IPv6 support, POSIX-compliant threads, and the OpenSSL
|
||||
cryptography library. Atomic operations support from the compiler is
|
||||
needed, either in the form of builtin operations, C11 atomics or the
|
||||
Interlocked family of functions on Windows.
|
||||
|
||||
ISC regularly tests BIND on many operating systems and architectures, but
|
||||
lacks the resources to test all of them. Consequently, ISC is only able to
|
||||
@@ -53,4 +55,7 @@ These are platforms on which BIND is known not to build or run:
|
||||
|
||||
* Platforms without at least OpenSSL 1.0.2
|
||||
* Windows 10 / x86
|
||||
* Windows Server 2012
|
||||
* Windows Server 2012 and older
|
||||
* Platforms that don't support IPv6 Advanced Socket API (RFC 3542)
|
||||
* Platforms that don't support atomic operations (via compiler or
|
||||
library)
|
||||
|
||||
+9
-4
@@ -11,9 +11,11 @@
|
||||
## Supported platforms
|
||||
|
||||
In general, this version of BIND will build and run on any POSIX-compliant
|
||||
system with a C99-compliant C compiler, BSD-style sockets, and the OpenSSL
|
||||
cryptography library. To build with multiprocessing support, a
|
||||
C11-compliant C compiler will be needed for standard atomics.
|
||||
system with a C99-compliant C compiler, BSD-style sockets with RFC-compliant
|
||||
IPv6 support, POSIX-compliant threads, and the OpenSSL cryptography library.
|
||||
Atomic operations support from the compiler is needed, either in the form of
|
||||
builtin operations, C11 atomics or the Interlocked family of functions on
|
||||
Windows.
|
||||
|
||||
ISC regularly tests BIND on many operating systems and architectures, but
|
||||
lacks the resources to test all of them. Consequently, ISC is only able to
|
||||
@@ -61,4 +63,7 @@ These are platforms on which BIND is known *not* to build or run:
|
||||
|
||||
* Platforms without at least OpenSSL 1.0.2
|
||||
* Windows 10 / x86
|
||||
* Windows Server 2012
|
||||
* Windows Server 2012 and older
|
||||
* Platforms that don't support IPv6 Advanced Socket API (RFC 3542)
|
||||
* Platforms that don't support atomic operations (via compiler or library)
|
||||
* Linux without NPTL (Native POSIX Thread Library)
|
||||
|
||||
@@ -104,8 +104,7 @@ BIND 9.13 features
|
||||
BIND 9.13 is the newest development branch of BIND 9. It includes a number
|
||||
of changes from BIND 9.12 and earlier releases. New features include:
|
||||
|
||||
* The default value of "dnssec-validation" is now "auto".
|
||||
* Support for IDNA2008 when linking with libidn2.
|
||||
* QNAME minimization, as described in RFC 7816, is now supported.
|
||||
* "Root key sentinel" support, enabling validating resolvers to indicate
|
||||
via a special query which trust anchors are configured for the root
|
||||
zone.
|
||||
@@ -114,12 +113,24 @@ of changes from BIND 9.12 and earlier releases. New features include:
|
||||
subject to DNSSEC validation and are not treated as authoritative data
|
||||
when answering. This makes it easier to configure a local copy of the
|
||||
root zone as described in RFC 7706.
|
||||
* The "validate-except" option allows configuration of domains below
|
||||
which DNSSEC validation should not be performed.
|
||||
* The default value of "dnssec-validation" is now "auto".
|
||||
* IDNA2008 is now supported when linking with libidn2.
|
||||
|
||||
In addition, cryptographic support has been modernized. BIND now uses the
|
||||
best available pseudo-random number generator for the platform on which
|
||||
it's built. Very old versions of OpenSSL are no longer supported.
|
||||
Cryptography is now mandatory; building BIND without DNSSEC is now longer
|
||||
supported.
|
||||
In addition, workarounds that were formerly in place to enable resolution
|
||||
of domains whose authoritative servers did not respond to EDNS queries
|
||||
have been removed. See https://dnsflagday.net for more details.
|
||||
|
||||
Cryptographic support has been modernized. BIND now uses the best
|
||||
available pseudo-random number generator for the platform on which it's
|
||||
built. Very old versions of OpenSSL are no longer supported. Cryptography
|
||||
is now mandatory: building BIND without DNSSEC is now longer supported.
|
||||
|
||||
Special code to support certain legacy operating systems has also been
|
||||
removed; see the file PLATFORMS.md for details of supported platforms. In
|
||||
addition to OpenSSL, BIND now requires support for IPv6, threads, and
|
||||
standard atomic operations provided by the C compiler.
|
||||
|
||||
Building BIND
|
||||
|
||||
@@ -127,7 +138,7 @@ Minimally, BIND requires a UNIX or Linux system with an ANSI C compiler,
|
||||
basic POSIX support, and a 64-bit integer type. Successful builds have
|
||||
been observed on many versions of Linux and UNIX, including RedHat,
|
||||
Fedora, Debian, Ubuntu, SuSE, Slackware, FreeBSD, NetBSD, OpenBSD, Mac OS
|
||||
X, Solaris, HP-UX, AIX, SCO OpenServer, and OpenWRT.
|
||||
X, Solaris, HP-UX, and OpenWRT.
|
||||
|
||||
BIND requires a cryptography provider library such as OpenSSL or a
|
||||
hardware service module supporting PKCS#11. On Linux, BIND requires the
|
||||
@@ -253,10 +264,6 @@ specifying --enable-fixed-rrset or --disable-fixed-rrset on the configure
|
||||
command line. By default, fixed rrset-order is disabled to reduce memory
|
||||
footprint.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
@@ -122,8 +122,7 @@ BIND 9.13 is the newest development branch of BIND 9. It includes a
|
||||
number of changes from BIND 9.12 and earlier releases. New features
|
||||
include:
|
||||
|
||||
* The default value of "dnssec-validation" is now "auto".
|
||||
* Support for IDNA2008 when linking with `libidn2`.
|
||||
* QNAME minimization, as described in RFC 7816, is now supported.
|
||||
* "Root key sentinel" support, enabling validating resolvers to indicate
|
||||
via a special query which trust anchors are configured for the root zone.
|
||||
* Secondary zones can now be configured as "mirror" zones; their contents
|
||||
@@ -131,20 +130,35 @@ include:
|
||||
DNSSEC validation and are not treated as authoritative data when
|
||||
answering. This makes it easier to configure a local copy of the root
|
||||
zone as described in RFC 7706.
|
||||
* The "validate-except" option allows configuration of domains below which
|
||||
DNSSEC validation should not be performed.
|
||||
* The default value of "dnssec-validation" is now "auto".
|
||||
* IDNA2008 is now supported when linking with `libidn2`.
|
||||
|
||||
In addition, cryptographic support has been modernized. BIND now uses the
|
||||
In addition, workarounds that were formerly in place to enable resolution
|
||||
of domains whose authoritative servers did not respond to EDNS queries
|
||||
have been removed. See [https://dnsflagday.net](https://dnsflagday.net)
|
||||
for more details.
|
||||
|
||||
Cryptographic support has been modernized. BIND now uses the
|
||||
best available pseudo-random number generator for the platform on which
|
||||
it's built. Very old versions of OpenSSL are no longer supported.
|
||||
Cryptography is now mandatory; building BIND without DNSSEC is now
|
||||
Cryptography is now mandatory: building BIND without DNSSEC is now
|
||||
longer supported.
|
||||
|
||||
Special code to support certain legacy operating systems has also
|
||||
been removed; see the file [PLATFORMS.md](PLATFORMS.md) for details
|
||||
of supported platforms. In addition to OpenSSL, BIND now requires
|
||||
support for IPv6, threads, and standard atomic operations provided
|
||||
by the C compiler.
|
||||
|
||||
### <a name="build"/> Building BIND
|
||||
|
||||
Minimally, BIND requires a UNIX or Linux system with an ANSI C compiler,
|
||||
basic POSIX support, and a 64-bit integer type. Successful builds have been
|
||||
observed on many versions of Linux and UNIX, including RedHat, Fedora,
|
||||
Debian, Ubuntu, SuSE, Slackware, FreeBSD, NetBSD, OpenBSD, Mac OS X,
|
||||
Solaris, HP-UX, AIX, SCO OpenServer, and OpenWRT.
|
||||
Solaris, HP-UX, and OpenWRT.
|
||||
|
||||
BIND requires a cryptography provider library such as OpenSSL or a
|
||||
hardware service module supporting PKCS#11. On Linux, BIND requires
|
||||
@@ -268,10 +282,6 @@ specifying `--enable-fixed-rrset` or `--disable-fixed-rrset` on the
|
||||
configure command line. By default, fixed rrset-order is disabled to
|
||||
reduce memory footprint.
|
||||
|
||||
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.
|
||||
|
||||
`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`.
|
||||
|
||||
-131
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* See the COPYRIGHT file distributed with this work for additional
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
|
||||
/***
|
||||
*** This file is not to be included by any public header files, because
|
||||
*** it does not get installed.
|
||||
***/
|
||||
@TOP@
|
||||
|
||||
/** define on DEC OSF to enable 4.4BSD style sa_len support */
|
||||
#undef _SOCKADDR_LEN
|
||||
|
||||
/** define if your system needs pthread_init() before using pthreads */
|
||||
#undef NEED_PTHREAD_INIT
|
||||
|
||||
/** define if your system has sigwait() */
|
||||
#undef HAVE_SIGWAIT
|
||||
|
||||
/** define if sigwait() is the UnixWare flavor */
|
||||
#undef HAVE_UNIXWARE_SIGWAIT
|
||||
|
||||
/** define on Solaris to get sigwait() to work using pthreads semantics */
|
||||
#undef _POSIX_PTHREAD_SEMANTICS
|
||||
|
||||
/** define if LinuxThreads is in use */
|
||||
#undef HAVE_LINUXTHREADS
|
||||
|
||||
/** define if sysconf() is available */
|
||||
#undef HAVE_SYSCONF
|
||||
|
||||
/** define if sysctlbyname() is available */
|
||||
#undef HAVE_SYSCTLBYNAME
|
||||
|
||||
/** define if catgets() is available */
|
||||
#undef HAVE_CATGETS
|
||||
|
||||
/** define if getifaddrs() exists */
|
||||
#undef HAVE_GETIFADDRS
|
||||
|
||||
/** define if you have the NET_RT_IFLIST sysctl variable and sys/sysctl.h */
|
||||
#undef HAVE_IFLIST_SYSCTL
|
||||
|
||||
/** define if tzset() is available */
|
||||
#undef HAVE_TZSET
|
||||
|
||||
/** define if struct addrinfo exists */
|
||||
#undef HAVE_ADDRINFO
|
||||
|
||||
/** define if getaddrinfo() exists */
|
||||
#undef HAVE_GETADDRINFO
|
||||
|
||||
/** define if gai_strerror() exists */
|
||||
#undef HAVE_GAISTRERROR
|
||||
|
||||
/**
|
||||
* define if pthread_setconcurrency() should be called to tell the
|
||||
* OS how many threads we might want to run.
|
||||
*/
|
||||
#undef CALL_PTHREAD_SETCONCURRENCY
|
||||
|
||||
/** define if IPv6 is not disabled */
|
||||
#undef WANT_IPV6
|
||||
|
||||
/** define if flockfile() is available */
|
||||
#undef HAVE_FLOCKFILE
|
||||
|
||||
/** define if getc_unlocked() is available */
|
||||
#undef HAVE_GETCUNLOCKED
|
||||
|
||||
/** Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
|
||||
#undef SHUTUP_SPUTAUX
|
||||
#ifdef SHUTUP_SPUTAUX
|
||||
struct __sFILE;
|
||||
extern __inline int __sputaux(int _c, struct __sFILE *_p);
|
||||
#endif
|
||||
|
||||
/** Shut up warnings about missing sigwait prototype on BSD/OS 4.0* */
|
||||
#undef SHUTUP_SIGWAIT
|
||||
#ifdef SHUTUP_SIGWAIT
|
||||
int sigwait(const unsigned int *set, int *sig);
|
||||
#endif
|
||||
|
||||
/** Shut up warnings from gcc -Wcast-qual on BSD/OS 4.1. */
|
||||
#undef SHUTUP_STDARG_CAST
|
||||
#if defined(SHUTUP_STDARG_CAST) && defined(__GNUC__)
|
||||
#include <stdarg.h> /** Grr. Must be included *every time*. */
|
||||
/**
|
||||
* The silly continuation line is to keep configure from
|
||||
* commenting out the #undef.
|
||||
*/
|
||||
|
||||
#undef \
|
||||
va_start
|
||||
#define va_start(ap, last) \
|
||||
do { \
|
||||
union { const void *konst; long *var; } _u; \
|
||||
_u.konst = &(last); \
|
||||
ap = (va_list)(_u.var + __va_words(__typeof(last))); \
|
||||
} while (0)
|
||||
#endif /** SHUTUP_STDARG_CAST && __GNUC__ */
|
||||
|
||||
/** define if the system has a random number generating device */
|
||||
#undef PATH_RANDOMDEV
|
||||
|
||||
/** define if pthread_attr_getstacksize() is available */
|
||||
#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE
|
||||
|
||||
/** define if pthread_attr_setstacksize() is available */
|
||||
#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
|
||||
|
||||
/** define if you have strerror in the C library. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define to the length type used by the socket API (socklen_t, size_t, int). */
|
||||
#undef ISC_SOCKADDR_LEN_T
|
||||
|
||||
/* Define if threads need PTHREAD_SCOPE_SYSTEM */
|
||||
#undef NEED_PTHREAD_SCOPE_SYSTEM
|
||||
|
||||
/* Define to 1 if you have the uname library function. */
|
||||
#undef HAVE_UNAME
|
||||
Vendored
+1
@@ -289,6 +289,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl
|
||||
])dnl PKG_CHECK_VAR
|
||||
|
||||
m4_include([m4/ax_check_openssl.m4])
|
||||
m4_include([m4/ax_pthread.m4])
|
||||
m4_include([m4/libtool.m4])
|
||||
m4_include([m4/ltoptions.m4])
|
||||
m4_include([m4/ltsugar.m4])
|
||||
|
||||
@@ -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; done
|
||||
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8 || exit 1; 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 ; done
|
||||
for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m || exit 1; 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@
|
||||
|
||||
+46
-67
@@ -14,7 +14,9 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Winsock2.h>
|
||||
@@ -60,14 +62,6 @@
|
||||
#define CHECK_LOCAL 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ADDRINFO
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
#ifdef HAVE_GAISTRERROR
|
||||
#define USE_GETADDRINFO
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define CHECK(r) \
|
||||
do { \
|
||||
result = (r); \
|
||||
@@ -88,15 +82,15 @@ static const char *dbtype[] = { "rbt" };
|
||||
|
||||
int debug = 0;
|
||||
const char *journal = NULL;
|
||||
isc_boolean_t nomerge = ISC_TRUE;
|
||||
bool nomerge = true;
|
||||
#if CHECK_LOCAL
|
||||
isc_boolean_t docheckmx = ISC_TRUE;
|
||||
isc_boolean_t dochecksrv = ISC_TRUE;
|
||||
isc_boolean_t docheckns = ISC_TRUE;
|
||||
bool docheckmx = true;
|
||||
bool dochecksrv = true;
|
||||
bool docheckns = true;
|
||||
#else
|
||||
isc_boolean_t docheckmx = ISC_FALSE;
|
||||
isc_boolean_t dochecksrv = ISC_FALSE;
|
||||
isc_boolean_t docheckns = ISC_FALSE;
|
||||
bool docheckmx = false;
|
||||
bool dochecksrv = false;
|
||||
bool docheckns = false;
|
||||
#endif
|
||||
dns_zoneopt_t zone_options = DNS_ZONEOPT_CHECKNS |
|
||||
DNS_ZONEOPT_CHECKMX |
|
||||
@@ -135,14 +129,12 @@ add(char *key, int value) {
|
||||
isc_symvalue_t symvalue;
|
||||
|
||||
if (sym_mctx == NULL) {
|
||||
result = isc_mem_create(0, 0, &sym_mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return;
|
||||
isc_mem_create(0, 0, &sym_mctx);
|
||||
}
|
||||
|
||||
if (symtab == NULL) {
|
||||
result = isc_symtab_create(sym_mctx, 100, freekey, sym_mctx,
|
||||
ISC_FALSE, &symtab);
|
||||
false, &symtab);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return;
|
||||
}
|
||||
@@ -158,32 +150,31 @@ add(char *key, int value) {
|
||||
isc_mem_free(sym_mctx, key);
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
logged(char *key, int value) {
|
||||
isc_result_t result;
|
||||
|
||||
if (symtab == NULL)
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
|
||||
result = isc_symtab_lookup(symtab, key, value, NULL);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
return (ISC_TRUE);
|
||||
return (ISC_FALSE);
|
||||
return (true);
|
||||
return (false);
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
||||
dns_rdataset_t *a, dns_rdataset_t *aaaa)
|
||||
{
|
||||
#ifdef USE_GETADDRINFO
|
||||
dns_rdataset_t *rdataset;
|
||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||
struct addrinfo hints, *ai, *cur;
|
||||
char namebuf[DNS_NAME_FORMATSIZE + 1];
|
||||
char ownerbuf[DNS_NAME_FORMATSIZE];
|
||||
char addrbuf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:123.123.123.123")];
|
||||
isc_boolean_t answer = ISC_TRUE;
|
||||
isc_boolean_t match;
|
||||
bool answer = true;
|
||||
bool match;
|
||||
const char *type;
|
||||
void *ptr = NULL;
|
||||
int result;
|
||||
@@ -232,7 +223,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 = ISC_FALSE; */
|
||||
/* answer = false; */
|
||||
add(namebuf, ERR_IS_CNAME);
|
||||
}
|
||||
break;
|
||||
@@ -248,7 +239,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 (ISC_TRUE);
|
||||
return (true);
|
||||
|
||||
default:
|
||||
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
|
||||
@@ -257,7 +248,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 (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -268,13 +259,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 = ISC_FALSE;
|
||||
match = 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 = ISC_TRUE;
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -286,7 +277,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 = ISC_FALSE; */
|
||||
/* answer = false; */
|
||||
}
|
||||
dns_rdata_reset(&rdata);
|
||||
result = dns_rdataset_next(a);
|
||||
@@ -298,13 +289,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 = ISC_FALSE;
|
||||
match = 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 = ISC_TRUE;
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -316,7 +307,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 = ISC_FALSE; */
|
||||
/* answer = false; */
|
||||
}
|
||||
dns_rdata_reset(&rdata);
|
||||
result = dns_rdataset_next(aaaa);
|
||||
@@ -327,7 +318,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)) {
|
||||
isc_boolean_t missing_glue = ISC_FALSE;
|
||||
bool missing_glue = false;
|
||||
for (cur = ai; cur != NULL; cur = cur->ai_next) {
|
||||
switch (cur->ai_family) {
|
||||
case AF_INET:
|
||||
@@ -343,7 +334,7 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
match = ISC_FALSE;
|
||||
match = false;
|
||||
if (dns_rdataset_isassociated(rdataset))
|
||||
result = dns_rdataset_first(rdataset);
|
||||
else
|
||||
@@ -351,7 +342,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 = ISC_TRUE;
|
||||
match = true;
|
||||
dns_rdata_reset(&rdata);
|
||||
result = dns_rdataset_next(rdataset);
|
||||
}
|
||||
@@ -362,8 +353,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 = ISC_FALSE; */
|
||||
missing_glue = ISC_TRUE;
|
||||
/* answer = false; */
|
||||
missing_glue = true;
|
||||
}
|
||||
}
|
||||
if (missing_glue)
|
||||
@@ -371,20 +362,16 @@ checkns(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner,
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
return (answer);
|
||||
#else
|
||||
return (ISC_TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
checkmx(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
#ifdef USE_GETADDRINFO
|
||||
struct addrinfo hints, *ai, *cur;
|
||||
char namebuf[DNS_NAME_FORMATSIZE + 1];
|
||||
char ownerbuf[DNS_NAME_FORMATSIZE];
|
||||
int result;
|
||||
int level = ISC_LOG_ERROR;
|
||||
isc_boolean_t answer = ISC_TRUE;
|
||||
bool answer = true;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
@@ -428,7 +415,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 = ISC_FALSE;
|
||||
answer = false;
|
||||
}
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
@@ -446,7 +433,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 (ISC_TRUE);
|
||||
return (true);
|
||||
|
||||
default:
|
||||
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
|
||||
@@ -455,22 +442,18 @@ 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 (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
#else
|
||||
return (ISC_TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
checksrv(dns_zone_t *zone, const dns_name_t *name, const dns_name_t *owner) {
|
||||
#ifdef USE_GETADDRINFO
|
||||
struct addrinfo hints, *ai, *cur;
|
||||
char namebuf[DNS_NAME_FORMATSIZE + 1];
|
||||
char ownerbuf[DNS_NAME_FORMATSIZE];
|
||||
int result;
|
||||
int level = ISC_LOG_ERROR;
|
||||
isc_boolean_t answer = ISC_TRUE;
|
||||
bool answer = true;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
@@ -513,7 +496,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 = ISC_FALSE;
|
||||
answer = false;
|
||||
}
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
@@ -531,7 +514,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 (ISC_TRUE);
|
||||
return (true);
|
||||
|
||||
default:
|
||||
if (!logged(namebuf, ERR_LOOKUP_FAILURE)) {
|
||||
@@ -540,11 +523,8 @@ 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 (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
#else
|
||||
return (ISC_TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
@@ -650,7 +630,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, ISC_FALSE);
|
||||
dns_db_closeversion(db, &version, false);
|
||||
if (db != NULL)
|
||||
dns_db_detach(&db);
|
||||
|
||||
@@ -697,7 +677,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
|
||||
CHECK(dns_rdataclass_fromtext(&rdclass, ®ion));
|
||||
|
||||
dns_zone_setclass(zone, rdclass);
|
||||
dns_zone_setoption(zone, zone_options, ISC_TRUE);
|
||||
dns_zone_setoption(zone, zone_options, true);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_NOMERGE, nomerge);
|
||||
|
||||
dns_zone_setmaxttl(zone, maxttl);
|
||||
@@ -709,7 +689,7 @@ load_zone(isc_mem_t *mctx, const char *zonename, const char *filename,
|
||||
if (dochecksrv)
|
||||
dns_zone_setchecksrv(zone, checksrv);
|
||||
|
||||
CHECK(dns_zone_load(zone));
|
||||
CHECK(dns_zone_load(zone, false));
|
||||
|
||||
/*
|
||||
* When loading map files we can't catch oversize TTLs during
|
||||
@@ -734,7 +714,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 isc_uint32_t rawversion)
|
||||
const uint32_t rawversion)
|
||||
{
|
||||
isc_result_t result;
|
||||
FILE *output = stdout;
|
||||
@@ -789,4 +769,3 @@ DestroySockets(void) {
|
||||
WSACleanup();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/lang.h>
|
||||
#include <isc/stdio.h>
|
||||
#include <isc/types.h>
|
||||
@@ -36,7 +39,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 isc_uint32_t rawversion);
|
||||
const uint32_t rawversion);
|
||||
|
||||
#ifdef _WIN32
|
||||
void InitSockets(void);
|
||||
@@ -45,10 +48,10 @@ void DestroySockets(void);
|
||||
|
||||
extern int debug;
|
||||
extern const char *journal;
|
||||
extern isc_boolean_t nomerge;
|
||||
extern isc_boolean_t docheckmx;
|
||||
extern isc_boolean_t docheckns;
|
||||
extern isc_boolean_t dochecksrv;
|
||||
extern bool nomerge;
|
||||
extern bool docheckmx;
|
||||
extern bool docheckns;
|
||||
extern bool dochecksrv;
|
||||
extern dns_zoneopt_t zone_options;
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
+24
-23
@@ -15,6 +15,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -91,18 +92,18 @@ directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
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 (ISC_FALSE);
|
||||
return (false);
|
||||
if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS)
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
|
||||
const cfg_listelt_t *element;
|
||||
const cfg_obj_t *checknames;
|
||||
@@ -113,14 +114,14 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
|
||||
|
||||
for (i = 0;; i++) {
|
||||
if (maps[i] == NULL)
|
||||
return (ISC_FALSE);
|
||||
return (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 (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
for (element = cfg_list_first(checknames);
|
||||
element != NULL;
|
||||
@@ -135,7 +136,7 @@ get_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
|
||||
continue;
|
||||
}
|
||||
*obj = cfg_tuple_get(value, "mode");
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,7 +169,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, isc_boolean_t list)
|
||||
const cfg_obj_t *config, isc_mem_t *mctx, bool list)
|
||||
{
|
||||
int i = 0;
|
||||
isc_result_t result;
|
||||
@@ -420,7 +421,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, isc_boolean_t list)
|
||||
const cfg_obj_t *vconfig, isc_mem_t *mctx, bool list)
|
||||
{
|
||||
const cfg_listelt_t *element;
|
||||
const cfg_obj_t *voptions;
|
||||
@@ -469,7 +470,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,
|
||||
isc_boolean_t list_zones)
|
||||
bool list_zones)
|
||||
{
|
||||
const cfg_listelt_t *element;
|
||||
const cfg_obj_t *views;
|
||||
@@ -537,12 +538,12 @@ main(int argc, char **argv) {
|
||||
isc_mem_t *mctx = NULL;
|
||||
isc_result_t result;
|
||||
int exit_status = 0;
|
||||
isc_boolean_t load_zones = ISC_FALSE;
|
||||
isc_boolean_t list_zones = ISC_FALSE;
|
||||
isc_boolean_t print = ISC_FALSE;
|
||||
bool load_zones = false;
|
||||
bool list_zones = false;
|
||||
bool print = false;
|
||||
unsigned int flags = 0;
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
/*
|
||||
* Process memory debugging argument first.
|
||||
@@ -566,9 +567,9 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
isc_commandline_reset = ISC_TRUE;
|
||||
isc_commandline_reset = true;
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
while ((c = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != EOF) {
|
||||
switch (c) {
|
||||
@@ -577,11 +578,11 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
|
||||
case 'j':
|
||||
nomerge = ISC_FALSE;
|
||||
nomerge = false;
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
list_zones = ISC_TRUE;
|
||||
list_zones = true;
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
@@ -597,7 +598,7 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
print = ISC_TRUE;
|
||||
print = true;
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
@@ -609,10 +610,10 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
load_zones = ISC_TRUE;
|
||||
docheckmx = ISC_FALSE;
|
||||
docheckns = ISC_FALSE;
|
||||
dochecksrv = ISC_FALSE;
|
||||
load_zones = true;
|
||||
docheckmx = false;
|
||||
docheckns = false;
|
||||
dochecksrv = false;
|
||||
break;
|
||||
|
||||
case '?':
|
||||
|
||||
+26
-24
@@ -14,7 +14,9 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <isc/app.h>
|
||||
#include <isc/commandline.h>
|
||||
@@ -106,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;
|
||||
isc_uint32_t rawversion = 1, serialnum = 0;
|
||||
uint32_t rawversion = 1, serialnum = 0;
|
||||
dns_ttl_t maxttl = 0;
|
||||
isc_boolean_t snset = ISC_FALSE;
|
||||
isc_boolean_t logdump = ISC_FALSE;
|
||||
bool snset = false;
|
||||
bool logdump = false;
|
||||
FILE *errout = stdout;
|
||||
char *endp;
|
||||
|
||||
@@ -159,7 +161,7 @@ main(int argc, char **argv) {
|
||||
|
||||
#define ARGCMP(X) (strcmp(isc_commandline_argument, X) == 0)
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = 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:"))
|
||||
@@ -177,33 +179,33 @@ main(int argc, char **argv) {
|
||||
if (ARGCMP("full")) {
|
||||
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY |
|
||||
DNS_ZONEOPT_CHECKSIBLING;
|
||||
docheckmx = ISC_TRUE;
|
||||
docheckns = ISC_TRUE;
|
||||
dochecksrv = ISC_TRUE;
|
||||
docheckmx = true;
|
||||
docheckns = true;
|
||||
dochecksrv = true;
|
||||
} else if (ARGCMP("full-sibling")) {
|
||||
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
|
||||
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
|
||||
docheckmx = ISC_TRUE;
|
||||
docheckns = ISC_TRUE;
|
||||
dochecksrv = ISC_TRUE;
|
||||
docheckmx = true;
|
||||
docheckns = true;
|
||||
dochecksrv = true;
|
||||
} else if (ARGCMP("local")) {
|
||||
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
|
||||
zone_options |= DNS_ZONEOPT_CHECKSIBLING;
|
||||
docheckmx = ISC_FALSE;
|
||||
docheckns = ISC_FALSE;
|
||||
dochecksrv = ISC_FALSE;
|
||||
docheckmx = false;
|
||||
docheckns = false;
|
||||
dochecksrv = false;
|
||||
} else if (ARGCMP("local-sibling")) {
|
||||
zone_options |= DNS_ZONEOPT_CHECKINTEGRITY;
|
||||
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
|
||||
docheckmx = ISC_FALSE;
|
||||
docheckns = ISC_FALSE;
|
||||
dochecksrv = ISC_FALSE;
|
||||
docheckmx = false;
|
||||
docheckns = false;
|
||||
dochecksrv = false;
|
||||
} else if (ARGCMP("none")) {
|
||||
zone_options &= ~DNS_ZONEOPT_CHECKINTEGRITY;
|
||||
zone_options &= ~DNS_ZONEOPT_CHECKSIBLING;
|
||||
docheckmx = ISC_FALSE;
|
||||
docheckns = ISC_FALSE;
|
||||
dochecksrv = ISC_FALSE;
|
||||
docheckmx = false;
|
||||
docheckns = false;
|
||||
dochecksrv = false;
|
||||
} else {
|
||||
fprintf(stderr, "invalid argument to -i: %s\n",
|
||||
isc_commandline_argument);
|
||||
@@ -220,12 +222,12 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
|
||||
case 'j':
|
||||
nomerge = ISC_FALSE;
|
||||
nomerge = false;
|
||||
break;
|
||||
|
||||
case 'J':
|
||||
journal = isc_commandline_argument;
|
||||
nomerge = ISC_FALSE;
|
||||
nomerge = false;
|
||||
break;
|
||||
|
||||
case 'k':
|
||||
@@ -246,7 +248,7 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
snset = ISC_TRUE;
|
||||
snset = true;
|
||||
endp = NULL;
|
||||
serialnum = strtol(isc_commandline_argument, &endp, 0);
|
||||
if (*endp != '\0') {
|
||||
@@ -505,7 +507,7 @@ main(int argc, char **argv) {
|
||||
strcmp(output_filename, "/dev/fd/1") == 0 ||
|
||||
strcmp(output_filename, "/dev/stdout") == 0)) {
|
||||
errout = stderr;
|
||||
logdump = ISC_FALSE;
|
||||
logdump = false;
|
||||
}
|
||||
|
||||
if (isc_commandline_index + 2 != argc)
|
||||
@@ -515,7 +517,7 @@ main(int argc, char **argv) {
|
||||
InitSockets();
|
||||
#endif
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
if (!quiet)
|
||||
RUNTIME_CHECK(setup_logging(mctx, errout, &lctx)
|
||||
== ISC_R_SUCCESS);
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -99,7 +99,7 @@
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>cd ..\..\..\Build\$(Configuration)
|
||||
@@ -105,7 +105,7 @@ copy /Y named-checkzone.ilk named-compilezone.ilk
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@checktool.lib;libisc.lib;libdns.lib;libisccfg.lib;libbind9.lib;libns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
|
||||
+10
-10
@@ -19,15 +19,15 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/assertions.h>
|
||||
#include <isc/base64.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/keyboard.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/net.h>
|
||||
#include <isc/print.h>
|
||||
@@ -56,7 +56,7 @@
|
||||
static char program[256];
|
||||
const char *progname;
|
||||
static enum { progmode_keygen, progmode_confgen} progmode;
|
||||
isc_boolean_t verbose = ISC_FALSE; /* needed by util.c but not used here */
|
||||
bool verbose = false; /* needed by util.c but not used here */
|
||||
|
||||
ISC_PLATFORM_NORETURN_PRE static void
|
||||
usage(int status) ISC_PLATFORM_NORETURN_POST;
|
||||
@@ -87,8 +87,8 @@ Usage:\n\
|
||||
int
|
||||
main(int argc, char **argv) {
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
isc_boolean_t show_final_mem = ISC_FALSE;
|
||||
isc_boolean_t quiet = ISC_FALSE;
|
||||
bool show_final_mem = false;
|
||||
bool quiet = false;
|
||||
isc_buffer_t key_txtbuffer;
|
||||
char key_txtsecret[256];
|
||||
isc_mem_t *mctx = NULL;
|
||||
@@ -124,13 +124,13 @@ main(int argc, char **argv) {
|
||||
|
||||
if (PROGCMP("tsig-keygen")) {
|
||||
progmode = progmode_keygen;
|
||||
quiet = ISC_TRUE;
|
||||
quiet = true;
|
||||
} else if (PROGCMP("ddns-confgen"))
|
||||
progmode = progmode_confgen;
|
||||
else
|
||||
INSIST(0);
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv,
|
||||
"a:hk:Mmr:qs:y:z:")) != -1) {
|
||||
@@ -155,11 +155,11 @@ main(int argc, char **argv) {
|
||||
isc_mem_debugging = ISC_MEM_DEBUGTRACE;
|
||||
break;
|
||||
case 'm':
|
||||
show_final_mem = ISC_TRUE;
|
||||
show_final_mem = true;
|
||||
break;
|
||||
case 'q':
|
||||
if (progmode == progmode_confgen)
|
||||
quiet = ISC_TRUE;
|
||||
quiet = true;
|
||||
else
|
||||
usage(1);
|
||||
break;
|
||||
@@ -207,7 +207,7 @@ main(int argc, char **argv) {
|
||||
/* Use canonical algorithm name */
|
||||
algname = alg_totext(alg);
|
||||
|
||||
DO("create memory context", isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
if (keyname == NULL) {
|
||||
const char *suffix = NULL;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <isc/base64.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/keyboard.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/result.h>
|
||||
@@ -192,4 +191,3 @@ write_key_file(const char *keyfile, const char *user,
|
||||
fatal("fclose(%s) failed\n", keyfile);
|
||||
fprintf(stderr, "wrote key file \"%s\"\n", keyfile);
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -22,15 +22,15 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/assertions.h>
|
||||
#include <isc/base64.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/keyboard.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/net.h>
|
||||
#include <isc/print.h>
|
||||
@@ -57,7 +57,7 @@
|
||||
static char program[256];
|
||||
const char *progname;
|
||||
|
||||
isc_boolean_t verbose = ISC_FALSE;
|
||||
bool verbose = false;
|
||||
|
||||
const char *keyfile, *keydef;
|
||||
|
||||
@@ -87,7 +87,7 @@ Usage:\n\
|
||||
|
||||
int
|
||||
main(int argc, char **argv) {
|
||||
isc_boolean_t show_final_mem = ISC_FALSE;
|
||||
bool show_final_mem = false;
|
||||
isc_buffer_t key_txtbuffer;
|
||||
char key_txtsecret[256];
|
||||
isc_mem_t *mctx = NULL;
|
||||
@@ -104,7 +104,7 @@ main(int argc, char **argv) {
|
||||
struct in6_addr addr6_dummy;
|
||||
char *chrootdir = NULL;
|
||||
char *user = NULL;
|
||||
isc_boolean_t keyonly = ISC_FALSE;
|
||||
bool keyonly = false;
|
||||
int len;
|
||||
|
||||
keydef = keyfile = RNDC_KEYFILE;
|
||||
@@ -119,14 +119,14 @@ main(int argc, char **argv) {
|
||||
serveraddr = DEFAULT_SERVER;
|
||||
port = DEFAULT_PORT;
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv,
|
||||
"aA:b:c:hk:Mmp:r:s:t:u:Vy")) != -1)
|
||||
{
|
||||
switch (ch) {
|
||||
case 'a':
|
||||
keyonly = ISC_TRUE;
|
||||
keyonly = true;
|
||||
break;
|
||||
case 'A':
|
||||
algname = isc_commandline_argument;
|
||||
@@ -153,7 +153,7 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
show_final_mem = ISC_TRUE;
|
||||
show_final_mem = true;
|
||||
break;
|
||||
case 'p':
|
||||
port = strtol(isc_commandline_argument, &p, 10);
|
||||
@@ -177,7 +177,7 @@ main(int argc, char **argv) {
|
||||
user = isc_commandline_argument;
|
||||
break;
|
||||
case 'V':
|
||||
verbose = ISC_TRUE;
|
||||
verbose = true;
|
||||
break;
|
||||
case '?':
|
||||
if (isc_commandline_option != '?') {
|
||||
@@ -211,7 +211,7 @@ main(int argc, char **argv) {
|
||||
keysize = alg_bits(alg);
|
||||
algname = alg_totext(alg);
|
||||
|
||||
DO("create memory context", isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
isc_buffer_init(&key_txtbuffer, &key_txtsecret, sizeof(key_txtsecret));
|
||||
|
||||
generate_key(mctx, alg, keysize, &key_txtbuffer);
|
||||
|
||||
+2
-2
@@ -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 isc_boolean_t verbose;
|
||||
extern bool verbose;
|
||||
extern const char *progname;
|
||||
|
||||
void
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>cd ..\..\..\Build\$(Configuration)
|
||||
@@ -106,7 +106,7 @@ copy /Y ddns-confgen.ilk tsig-keygen.ilk
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>cd ..\..\..\Build\$(Configuration)
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -100,7 +100,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@confgentool.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
+78
-78
@@ -24,7 +24,9 @@
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@@ -94,40 +96,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 isc_boolean_t classset = ISC_FALSE;
|
||||
static bool classset = false;
|
||||
static dns_rdatatype_t qtype = dns_rdatatype_none;
|
||||
static isc_boolean_t typeset = ISC_FALSE;
|
||||
static bool typeset = false;
|
||||
|
||||
static unsigned int styleflags = 0;
|
||||
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 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_boolean_t
|
||||
resolve_trace = ISC_FALSE,
|
||||
validator_trace = ISC_FALSE,
|
||||
message_trace = ISC_FALSE;
|
||||
static bool
|
||||
resolve_trace = false,
|
||||
validator_trace = false,
|
||||
message_trace = false;
|
||||
|
||||
static isc_boolean_t
|
||||
use_ipv4 = ISC_TRUE,
|
||||
use_ipv6 = ISC_TRUE;
|
||||
static bool
|
||||
use_ipv4 = true,
|
||||
use_ipv6 = true;
|
||||
|
||||
static isc_boolean_t
|
||||
cdflag = ISC_FALSE,
|
||||
no_sigs = ISC_FALSE,
|
||||
root_validation = ISC_TRUE,
|
||||
dlv_validation = ISC_TRUE;
|
||||
static bool
|
||||
cdflag = false,
|
||||
no_sigs = false,
|
||||
root_validation = true,
|
||||
dlv_validation = true;
|
||||
|
||||
static isc_boolean_t use_tcp = ISC_FALSE;
|
||||
static bool use_tcp = false;
|
||||
|
||||
static char *anchorfile = NULL;
|
||||
static char *trust_anchor = NULL;
|
||||
@@ -144,10 +146,10 @@ static char anchortext[] = MANAGED_KEYS;
|
||||
* Static function prototypes
|
||||
*/
|
||||
static isc_result_t
|
||||
get_reverse(char *reverse, size_t len, char *value, isc_boolean_t strict);
|
||||
get_reverse(char *reverse, size_t len, char *value, bool strict);
|
||||
|
||||
static isc_result_t
|
||||
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
|
||||
parse_uint(uint32_t *uip, const char *value, uint32_t max,
|
||||
const char *desc);
|
||||
|
||||
static void
|
||||
@@ -408,7 +410,7 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
|
||||
{
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
static dns_trust_t trust;
|
||||
static isc_boolean_t first = ISC_TRUE;
|
||||
static bool first = true;
|
||||
isc_buffer_t target;
|
||||
isc_region_t r;
|
||||
char *t = NULL;
|
||||
@@ -430,7 +432,7 @@ printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
|
||||
putchar('\n');
|
||||
print_status(rdataset);
|
||||
trust = rdataset->trust;
|
||||
first = ISC_FALSE;
|
||||
first = false;
|
||||
}
|
||||
|
||||
do {
|
||||
@@ -566,7 +568,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;
|
||||
isc_uint32_t flags, proto, alg;
|
||||
uint32_t flags, proto, alg;
|
||||
const char *keystr, *keynamestr;
|
||||
unsigned char keydata[4096];
|
||||
isc_buffer_t keydatabuf;
|
||||
@@ -576,7 +578,7 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
|
||||
dns_fixedname_t fkeyname;
|
||||
dns_name_t *keyname;
|
||||
isc_result_t result;
|
||||
isc_boolean_t match_root = ISC_FALSE, match_dlv = ISC_FALSE;
|
||||
bool match_root = false, match_dlv = false;
|
||||
|
||||
keynamestr = cfg_obj_asstring(cfg_tuple_get(key, "name"));
|
||||
CHECK(convert_name(&fkeyname, &keyname, keynamestr));
|
||||
@@ -621,9 +623,9 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
|
||||
if (alg > 0xff)
|
||||
CHECK(ISC_R_RANGE);
|
||||
|
||||
keystruct.flags = (isc_uint16_t)flags;
|
||||
keystruct.protocol = (isc_uint8_t)proto;
|
||||
keystruct.algorithm = (isc_uint8_t)alg;
|
||||
keystruct.flags = (uint16_t)flags;
|
||||
keystruct.protocol = (uint8_t)proto;
|
||||
keystruct.algorithm = (uint8_t)alg;
|
||||
|
||||
isc_buffer_init(&keydatabuf, keydata, sizeof(keydata));
|
||||
isc_buffer_init(&rrdatabuf, rrdata, sizeof(rrdata));
|
||||
@@ -778,7 +780,7 @@ addserver(dns_client_t *client) {
|
||||
struct in6_addr in6;
|
||||
isc_sockaddr_t *sa;
|
||||
isc_sockaddrlist_t servers;
|
||||
isc_uint32_t destport;
|
||||
uint32_t destport;
|
||||
isc_result_t result;
|
||||
dns_name_t *name = NULL;
|
||||
|
||||
@@ -869,7 +871,7 @@ findserver(dns_client_t *client) {
|
||||
irs_resconf_t *resconf = NULL;
|
||||
isc_sockaddrlist_t *nameservers;
|
||||
isc_sockaddr_t *sa, *next;
|
||||
isc_uint32_t destport;
|
||||
uint32_t destport;
|
||||
|
||||
result = parse_uint(&destport, port, 0xffff, "port");
|
||||
if (result != ISC_R_SUCCESS)
|
||||
@@ -944,9 +946,9 @@ cleanup:
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
|
||||
parse_uint(uint32_t *uip, const char *value, uint32_t max,
|
||||
const char *desc) {
|
||||
isc_uint32_t n;
|
||||
uint32_t n;
|
||||
isc_result_t result = isc_parse_uint32(&n, value, 10);
|
||||
if (result == ISC_R_SUCCESS && n > max)
|
||||
result = ISC_R_RANGE;
|
||||
@@ -963,7 +965,7 @@ static void
|
||||
plus_option(char *option) {
|
||||
isc_result_t result;
|
||||
char *cmd, *value, *last = NULL;
|
||||
isc_boolean_t state = ISC_TRUE;
|
||||
bool state = true;
|
||||
|
||||
INSIST(option != NULL);
|
||||
|
||||
@@ -974,7 +976,7 @@ plus_option(char *option) {
|
||||
}
|
||||
if (strncasecmp(cmd, "no", 2)==0) {
|
||||
cmd += 2;
|
||||
state = ISC_FALSE;
|
||||
state = false;
|
||||
}
|
||||
|
||||
value = strtok_r(NULL, "\0", &last);
|
||||
@@ -1001,7 +1003,7 @@ plus_option(char *option) {
|
||||
break;
|
||||
case 'l': /* class */
|
||||
FULLCHECK("class");
|
||||
noclass = ISC_TF(!state);
|
||||
noclass = !state;
|
||||
break;
|
||||
case 'o': /* comments */
|
||||
FULLCHECK("comments");
|
||||
@@ -1009,7 +1011,7 @@ plus_option(char *option) {
|
||||
break;
|
||||
case 'r': /* crypto */
|
||||
FULLCHECK("crypto");
|
||||
nocrypto = ISC_TF(!state);
|
||||
nocrypto = !state;
|
||||
break;
|
||||
default:
|
||||
goto invalid_option;
|
||||
@@ -1082,10 +1084,10 @@ plus_option(char *option) {
|
||||
FULLCHECK("short");
|
||||
short_form = state;
|
||||
if (short_form) {
|
||||
multiline = ISC_FALSE;
|
||||
showcomments = ISC_FALSE;
|
||||
showtrust = ISC_FALSE;
|
||||
showdnssec = ISC_FALSE;
|
||||
multiline = false;
|
||||
showcomments = false;
|
||||
showtrust = false;
|
||||
showdnssec = false;
|
||||
}
|
||||
break;
|
||||
case 'p': /* split */
|
||||
@@ -1137,7 +1139,7 @@ plus_option(char *option) {
|
||||
break;
|
||||
case 't': /* ttl */
|
||||
FULLCHECK("ttl");
|
||||
nottl = ISC_TF(!state);
|
||||
nottl = !state;
|
||||
break;
|
||||
default:
|
||||
goto invalid_option;
|
||||
@@ -1165,11 +1167,11 @@ plus_option(char *option) {
|
||||
* options: "46a:b:c:d:himp:q:t:vx:";
|
||||
*/
|
||||
static const char *single_dash_opts = "46himv";
|
||||
static isc_boolean_t
|
||||
dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
static bool
|
||||
dash_option(char *option, char *next, bool *open_type_class) {
|
||||
char opt, *value;
|
||||
isc_result_t result;
|
||||
isc_boolean_t value_from_next;
|
||||
bool value_from_next;
|
||||
isc_textregion_t tr;
|
||||
dns_rdatatype_t rdtype;
|
||||
dns_rdataclass_t rdclass;
|
||||
@@ -1177,7 +1179,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
struct in_addr in4;
|
||||
struct in6_addr in6;
|
||||
in_port_t srcport;
|
||||
isc_uint32_t num;
|
||||
uint32_t num;
|
||||
char *hash;
|
||||
|
||||
while (strpbrk(option, single_dash_opts) == &option[0]) {
|
||||
@@ -1193,7 +1195,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
fatal("IPv4 networking not available");
|
||||
if (use_ipv6) {
|
||||
isc_net_disableipv6();
|
||||
use_ipv6 = ISC_FALSE;
|
||||
use_ipv6 = false;
|
||||
}
|
||||
break;
|
||||
case '6':
|
||||
@@ -1201,7 +1203,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
fatal("IPv6 networking not available");
|
||||
if (use_ipv4) {
|
||||
isc_net_disableipv4();
|
||||
use_ipv4 = ISC_FALSE;
|
||||
use_ipv4 = false;
|
||||
}
|
||||
break;
|
||||
case 'h':
|
||||
@@ -1209,9 +1211,9 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
exit(0);
|
||||
/* NOTREACHED */
|
||||
case 'i':
|
||||
no_sigs = ISC_TRUE;
|
||||
dlv_validation = ISC_FALSE;
|
||||
root_validation = ISC_FALSE;
|
||||
no_sigs = true;
|
||||
dlv_validation = false;
|
||||
root_validation = false;
|
||||
break;
|
||||
case 'm':
|
||||
/* handled in preparse_args() */
|
||||
@@ -1226,14 +1228,14 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
if (strlen(option) > 1U)
|
||||
option = &option[1];
|
||||
else
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
opt = option[0];
|
||||
if (strlen(option) > 1U) {
|
||||
value_from_next = ISC_FALSE;
|
||||
value_from_next = false;
|
||||
value = &option[1];
|
||||
} else {
|
||||
value_from_next = ISC_TRUE;
|
||||
value_from_next = true;
|
||||
value = next;
|
||||
}
|
||||
if (value == NULL)
|
||||
@@ -1279,13 +1281,13 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
if (classset)
|
||||
warn("extra query class");
|
||||
|
||||
*open_type_class = ISC_FALSE;
|
||||
*open_type_class = false;
|
||||
tr.base = value;
|
||||
tr.length = strlen(value);
|
||||
result = dns_rdataclass_fromtext(&rdclass,
|
||||
(isc_textregion_t *)&tr);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
classset = ISC_TRUE;
|
||||
classset = true;
|
||||
else if (rdclass != dns_rdataclass_in)
|
||||
warn("ignoring non-IN query class");
|
||||
else
|
||||
@@ -1310,7 +1312,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
fatal("out of memory");
|
||||
return (value_from_next);
|
||||
case 't':
|
||||
*open_type_class = ISC_FALSE;
|
||||
*open_type_class = false;
|
||||
tr.base = value;
|
||||
tr.length = strlen(value);
|
||||
result = dns_rdatatype_fromtext(&rdtype,
|
||||
@@ -1322,13 +1324,13 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
rdtype == dns_rdatatype_axfr)
|
||||
fatal("Transfer not supported");
|
||||
qtype = rdtype;
|
||||
typeset = ISC_TRUE;
|
||||
typeset = true;
|
||||
} else
|
||||
warn("ignoring invalid type");
|
||||
return (value_from_next);
|
||||
case 'x':
|
||||
result = get_reverse(textname, sizeof(textname), value,
|
||||
ISC_FALSE);
|
||||
false);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
if (curqname != NULL) {
|
||||
isc_mem_free(mctx, curqname);
|
||||
@@ -1340,7 +1342,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
if (typeset)
|
||||
warn("extra query type");
|
||||
qtype = dns_rdatatype_ptr;
|
||||
typeset = ISC_TRUE;
|
||||
typeset = true;
|
||||
} else {
|
||||
fprintf(stderr, "Invalid IP address %s\n", value);
|
||||
exit(1);
|
||||
@@ -1352,7 +1354,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
usage();
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1361,7 +1363,7 @@ dash_option(char *option, char *next, isc_boolean_t *open_type_class) {
|
||||
*/
|
||||
static void
|
||||
preparse_args(int argc, char **argv) {
|
||||
isc_boolean_t ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
|
||||
bool ipv4only = false, ipv6only = false;
|
||||
char *option;
|
||||
|
||||
for (argc--, argv++; argc > 0; argc--, argv++) {
|
||||
@@ -1378,13 +1380,13 @@ preparse_args(int argc, char **argv) {
|
||||
if (ipv6only) {
|
||||
fatal("only one of -4 and -6 allowed");
|
||||
}
|
||||
ipv4only = ISC_TRUE;
|
||||
ipv4only = true;
|
||||
break;
|
||||
case '6':
|
||||
if (ipv4only) {
|
||||
fatal("only one of -4 and -6 allowed");
|
||||
}
|
||||
ipv6only = ISC_TRUE;
|
||||
ipv6only = true;
|
||||
break;
|
||||
}
|
||||
option = &option[1];
|
||||
@@ -1404,7 +1406,7 @@ parse_args(int argc, char **argv) {
|
||||
isc_textregion_t tr;
|
||||
dns_rdatatype_t rdtype;
|
||||
dns_rdataclass_t rdclass;
|
||||
isc_boolean_t open_type_class = ISC_TRUE;
|
||||
bool open_type_class = true;
|
||||
|
||||
for (; argc > 0; argc--, argv++) {
|
||||
if (argv[0][0] == '@') {
|
||||
@@ -1443,7 +1445,7 @@ parse_args(int argc, char **argv) {
|
||||
rdtype == dns_rdatatype_axfr)
|
||||
fatal("Transfer not supported");
|
||||
qtype = rdtype;
|
||||
typeset = ISC_TRUE;
|
||||
typeset = true;
|
||||
continue;
|
||||
}
|
||||
result = dns_rdataclass_fromtext(&rdclass,
|
||||
@@ -1512,7 +1514,7 @@ reverse_octets(const char *in, char **p, char *end) {
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
get_reverse(char *reverse, size_t len, char *value, isc_boolean_t strict) {
|
||||
get_reverse(char *reverse, size_t len, char *value, bool strict) {
|
||||
int r;
|
||||
isc_result_t result;
|
||||
isc_netaddr_t addr;
|
||||
@@ -1583,14 +1585,12 @@ main(int argc, char *argv[]) {
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("dns_lib_init failed: %d", result);
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("failed to create mctx");
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
CHECK(isc_appctx_create(mctx, &actx));
|
||||
CHECK(isc_taskmgr_createinctx(mctx, actx, 1, 0, &taskmgr));
|
||||
CHECK(isc_socketmgr_createinctx(mctx, actx, &socketmgr));
|
||||
CHECK(isc_timermgr_createinctx(mctx, actx, &timermgr));
|
||||
isc_timermgr_createinctx(mctx, actx, &timermgr);
|
||||
|
||||
parse_args(argc, argv);
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libisc.lib;libdns.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;libdns.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -98,7 +98,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libisc.lib;libdns.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;libdns.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
+3
-3
@@ -101,12 +101,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; \
|
||||
done
|
||||
${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man1 || exit 1; \
|
||||
done
|
||||
|
||||
uninstall::
|
||||
for m in ${MANPAGES}; do \
|
||||
rm -f ${DESTDIR}${mandir}/man1/$$m ; \
|
||||
rm -f ${DESTDIR}${mandir}/man1/$$m || exit 1; \
|
||||
done
|
||||
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/nslookup@EXEEXT@
|
||||
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${bindir}/host@EXEEXT@
|
||||
|
||||
+149
-149
@@ -12,6 +12,9 @@
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
@@ -61,10 +64,10 @@ static int addresscount = 0;
|
||||
static char domainopt[DNS_NAME_MAXTEXT];
|
||||
static char hexcookie[81];
|
||||
|
||||
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;
|
||||
static bool short_form = false, printcmd = true,
|
||||
ip6_int = false, plusquest = false, pluscomm = false,
|
||||
ipv4only = false, ipv6only = false;
|
||||
static uint32_t splitwidth = 0xffffffff;
|
||||
|
||||
/*% opcode text */
|
||||
static const char * const opcodetext[] = {
|
||||
@@ -240,7 +243,7 @@ help(void) {
|
||||
*/
|
||||
static void
|
||||
received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
|
||||
isc_uint64_t diff;
|
||||
uint64_t diff;
|
||||
time_t tnow;
|
||||
struct tm tmnow;
|
||||
#ifdef WIN32
|
||||
@@ -260,7 +263,7 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
|
||||
printf(";; Query time: %ld msec\n", (long) diff / 1000);
|
||||
printf(";; SERVER: %s(%s)\n", fromtext, query->servname);
|
||||
time(&tnow);
|
||||
#if defined(ISC_PLATFORM_USETHREADS) && !defined(WIN32)
|
||||
#if !defined(WIN32)
|
||||
(void)localtime_r(&tnow, &tmnow);
|
||||
#else
|
||||
tmnow = *localtime(&tnow);
|
||||
@@ -281,7 +284,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 %" ISC_PRINT_QUADFORMAT "u)\n",
|
||||
"bytes %" PRIu64 ")\n",
|
||||
query->rr_count, query->msg_count,
|
||||
query->byte_count);
|
||||
} else {
|
||||
@@ -299,18 +302,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 %" ISC_PRINT_QUADFORMAT "u bytes "
|
||||
printf(";; Received %" PRIu64 " bytes "
|
||||
"from %s(%s) in %ld us\n\n",
|
||||
query->lookup->doing_xfr
|
||||
? query->byte_count
|
||||
: (isc_uint64_t)bytes,
|
||||
: (uint64_t)bytes,
|
||||
fromtext, query->userarg, (long) diff);
|
||||
else
|
||||
printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes "
|
||||
printf(";; Received %" PRIu64 " bytes "
|
||||
"from %s(%s) in %ld ms\n\n",
|
||||
query->lookup->doing_xfr
|
||||
? query->byte_count
|
||||
: (isc_uint64_t)bytes,
|
||||
: (uint64_t)bytes,
|
||||
fromtext, query->userarg, (long) diff / 1000);
|
||||
}
|
||||
}
|
||||
@@ -332,7 +335,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;
|
||||
isc_uint64_t diff;
|
||||
uint64_t diff;
|
||||
char store[sizeof(" in 18446744073709551616 us.")];
|
||||
unsigned int styleflags = 0;
|
||||
|
||||
@@ -360,10 +363,11 @@ 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 %" ISC_PLATFORM_QUADFORMAT "u us.", diff);
|
||||
else
|
||||
snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u ms.", diff / 1000);
|
||||
if (query->lookup->use_usec) {
|
||||
snprintf(store, sizeof(store), " in %" PRIu64 " us.", diff);
|
||||
} else {
|
||||
snprintf(store, sizeof(store), " in %" PRIu64 " ms.", diff / 1000);
|
||||
}
|
||||
ADD_STRING(buf, store);
|
||||
}
|
||||
ADD_STRING(buf, "\n");
|
||||
@@ -421,7 +425,7 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags,
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
isdotlocal(dns_message_t *msg) {
|
||||
isc_result_t result;
|
||||
static unsigned char local_ndata[] = { "\005local\0" };
|
||||
@@ -436,16 +440,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 (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
return (ISC_FALSE);
|
||||
return (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, isc_boolean_t headers) {
|
||||
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
|
||||
isc_result_t result;
|
||||
dns_messagetextflag_t flags;
|
||||
isc_buffer_t *buf = NULL;
|
||||
@@ -516,8 +520,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
if (!query->lookup->comments)
|
||||
flags |= DNS_MESSAGETEXTFLAG_NOCOMMENTS;
|
||||
|
||||
result = isc_buffer_allocate(mctx, &buf, len);
|
||||
check_result(result, "isc_buffer_allocate");
|
||||
isc_buffer_allocate(mctx, &buf, len);
|
||||
|
||||
if (query->lookup->comments && !short_form) {
|
||||
if (query->lookup->cmdline[0] != 0)
|
||||
@@ -593,11 +596,8 @@ repopulate_buffer:
|
||||
buftoosmall:
|
||||
len += OUTPUTBUF;
|
||||
isc_buffer_free(&buf);
|
||||
result = isc_buffer_allocate(mctx, &buf, len);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
goto repopulate_buffer;
|
||||
else
|
||||
goto cleanup;
|
||||
isc_buffer_allocate(mctx, &buf, len);
|
||||
goto repopulate_buffer;
|
||||
}
|
||||
check_result(result,
|
||||
"dns_message_pseudosectiontotext");
|
||||
@@ -689,7 +689,7 @@ cleanup:
|
||||
static void
|
||||
printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
|
||||
int i;
|
||||
static isc_boolean_t first = ISC_TRUE;
|
||||
static bool first = true;
|
||||
char append[MXNAME];
|
||||
|
||||
if (printcmd) {
|
||||
@@ -716,7 +716,7 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
|
||||
";; global options:%s%s\n",
|
||||
short_form ? " +short" : "",
|
||||
printcmd ? " +cmd" : "");
|
||||
first = ISC_FALSE;
|
||||
first = false;
|
||||
strlcat(lookup->cmdline, append,
|
||||
sizeof(lookup->cmdline));
|
||||
}
|
||||
@@ -731,13 +731,13 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
|
||||
*/
|
||||
|
||||
static void
|
||||
plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
plus_option(char *option, bool is_batchfile,
|
||||
dig_lookup_t *lookup)
|
||||
{
|
||||
isc_result_t result;
|
||||
char *cmd, *value, *last = NULL, *code, *extra;
|
||||
isc_uint32_t num;
|
||||
isc_boolean_t state = ISC_TRUE;
|
||||
uint32_t num;
|
||||
bool state = true;
|
||||
size_t n;
|
||||
|
||||
INSIST(option != NULL);
|
||||
@@ -748,7 +748,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
}
|
||||
if (strncasecmp(cmd, "no", 2)==0) {
|
||||
cmd += 2;
|
||||
state = ISC_FALSE;
|
||||
state = false;
|
||||
}
|
||||
/* parse the rest of the string */
|
||||
value = strtok_r(NULL, "", &last);
|
||||
@@ -855,7 +855,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
case 'l': /* class */
|
||||
/* keep +cl for backwards compatibility */
|
||||
FULLCHECK2("cl", "class");
|
||||
lookup->noclass = ISC_TF(!state);
|
||||
lookup->noclass = !state;
|
||||
break;
|
||||
case 'm': /* cmd */
|
||||
FULLCHECK("cmd");
|
||||
@@ -891,7 +891,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
break;
|
||||
case 'r':
|
||||
FULLCHECK("crypto");
|
||||
lookup->nocrypto = ISC_TF(!state);
|
||||
lookup->nocrypto = !state;
|
||||
break;
|
||||
default:
|
||||
goto invalid_option;
|
||||
@@ -1004,7 +1004,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
code = NULL;
|
||||
if (value != NULL) {
|
||||
code = strtok_r(value,
|
||||
":",
|
||||
":",
|
||||
&last);
|
||||
}
|
||||
if (code == NULL) {
|
||||
@@ -1162,17 +1162,17 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
FULLCHECK("nssearch");
|
||||
lookup->ns_search_only = state;
|
||||
if (state) {
|
||||
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->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->rdtype = dns_rdatatype_ns;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
short_form = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
short_form = true;
|
||||
lookup->rrcomments = 0;
|
||||
}
|
||||
break;
|
||||
@@ -1230,7 +1230,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
warn("Couldn't parse padding");
|
||||
goto exit_or_usage;
|
||||
}
|
||||
lookup->padding = (isc_uint16_t)num;
|
||||
lookup->padding = (uint16_t)num;
|
||||
break;
|
||||
case 'q':
|
||||
switch (cmd[1]) {
|
||||
@@ -1306,13 +1306,13 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
FULLCHECK("short");
|
||||
short_form = state;
|
||||
if (state) {
|
||||
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;
|
||||
printcmd = false;
|
||||
lookup->section_additional = false;
|
||||
lookup->section_answer = true;
|
||||
lookup->section_authority = false;
|
||||
lookup->section_question = false;
|
||||
lookup->comments = false;
|
||||
lookup->stats = false;
|
||||
lookup->rrcomments = -1;
|
||||
}
|
||||
break;
|
||||
@@ -1406,7 +1406,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
FULLCHECK("tcp");
|
||||
if (!is_batchfile) {
|
||||
lookup->tcp_mode = state;
|
||||
lookup->tcp_mode_set = ISC_TRUE;
|
||||
lookup->tcp_mode_set = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -1439,17 +1439,17 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
lookup->trace = state;
|
||||
lookup->trace_root = state;
|
||||
if (state) {
|
||||
lookup->recurse = ISC_FALSE;
|
||||
lookup->identify = ISC_TRUE;
|
||||
lookup->comments = ISC_FALSE;
|
||||
lookup->recurse = false;
|
||||
lookup->identify = true;
|
||||
lookup->comments = false;
|
||||
lookup->rrcomments = 0;
|
||||
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;
|
||||
lookup->stats = false;
|
||||
lookup->section_additional = false;
|
||||
lookup->section_authority = true;
|
||||
lookup->section_question = false;
|
||||
lookup->dnssec = true;
|
||||
lookup->sendcookie = true;
|
||||
usesearch = false;
|
||||
}
|
||||
break;
|
||||
case 'i': /* tries */
|
||||
@@ -1483,12 +1483,12 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
case 0:
|
||||
case 'i': /* ttlid */
|
||||
FULLCHECK2("ttl", "ttlid");
|
||||
lookup->nottl = ISC_TF(!state);
|
||||
lookup->nottl = !state;
|
||||
break;
|
||||
case 'u': /* ttlunits */
|
||||
FULLCHECK("ttlunits");
|
||||
lookup->nottl = ISC_FALSE;
|
||||
lookup->ttlunits = ISC_TF(state);
|
||||
lookup->nottl = false;
|
||||
lookup->ttlunits = state;
|
||||
break;
|
||||
default:
|
||||
goto invalid_option;
|
||||
@@ -1510,7 +1510,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
FULLCHECK("vc");
|
||||
if (!is_batchfile) {
|
||||
lookup->tcp_mode = state;
|
||||
lookup->tcp_mode_set = ISC_TRUE;
|
||||
lookup->tcp_mode_set = true;
|
||||
}
|
||||
break;
|
||||
case 'z': /* zflag */
|
||||
@@ -1536,19 +1536,19 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
||||
}
|
||||
|
||||
/*%
|
||||
* #ISC_TRUE returned if value was used
|
||||
* #true returned if value was used
|
||||
*/
|
||||
static const char *single_dash_opts = "46dhimnuv";
|
||||
static const char *dash_opts = "46bcdfhikmnptvyx";
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
dash_option(char *option, char *next, dig_lookup_t **lookup,
|
||||
isc_boolean_t *open_type_class, isc_boolean_t *need_clone,
|
||||
isc_boolean_t config_only, int argc, char **argv,
|
||||
isc_boolean_t *firstarg)
|
||||
bool *open_type_class, bool *need_clone,
|
||||
bool config_only, int argc, char **argv,
|
||||
bool *firstarg)
|
||||
{
|
||||
char opt, *value, *ptr, *ptr2, *ptr3, *last;
|
||||
isc_result_t result;
|
||||
isc_boolean_t value_from_next;
|
||||
bool value_from_next;
|
||||
isc_textregion_t tr;
|
||||
dns_rdatatype_t rdtype;
|
||||
dns_rdataclass_t rdclass;
|
||||
@@ -1557,7 +1557,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
||||
struct in6_addr in6;
|
||||
in_port_t srcport;
|
||||
char *hash, *cmd;
|
||||
isc_uint32_t num;
|
||||
uint32_t num;
|
||||
|
||||
while (strpbrk(option, single_dash_opts) == &option[0]) {
|
||||
/*
|
||||
@@ -1570,21 +1570,21 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
||||
case '4':
|
||||
if (have_ipv4) {
|
||||
isc_net_disableipv6();
|
||||
have_ipv6 = ISC_FALSE;
|
||||
have_ipv6 = false;
|
||||
} else {
|
||||
fatal("can't find IPv4 networking");
|
||||
/* NOTREACHED */
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
break;
|
||||
case '6':
|
||||
if (have_ipv6) {
|
||||
isc_net_disableipv4();
|
||||
have_ipv4 = ISC_FALSE;
|
||||
have_ipv4 = false;
|
||||
} else {
|
||||
fatal("can't find IPv6 networking");
|
||||
/* NOTREACHED */
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
@@ -1592,17 +1592,17 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
||||
if (ptr != &option[1]) {
|
||||
cmd = option;
|
||||
FULLCHECK("debug");
|
||||
debugging = ISC_TRUE;
|
||||
return (ISC_FALSE);
|
||||
debugging = true;
|
||||
return (false);
|
||||
} else
|
||||
debugging = ISC_TRUE;
|
||||
debugging = true;
|
||||
break;
|
||||
case 'h':
|
||||
help();
|
||||
exit(0);
|
||||
break;
|
||||
case 'i':
|
||||
ip6_int = ISC_TRUE;
|
||||
ip6_int = true;
|
||||
break;
|
||||
case 'm': /* memdebug */
|
||||
/* memdebug is handled in preparse_args() */
|
||||
@@ -1611,7 +1611,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
||||
/* deprecated */
|
||||
break;
|
||||
case 'u':
|
||||
(*lookup)->use_usec = ISC_TRUE;
|
||||
(*lookup)->use_usec = true;
|
||||
break;
|
||||
case 'v':
|
||||
version();
|
||||
@@ -1621,14 +1621,14 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
||||
if (strlen(option) > 1U)
|
||||
option = &option[1];
|
||||
else
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
opt = option[0];
|
||||
if (strlen(option) > 1U) {
|
||||
value_from_next = ISC_FALSE;
|
||||
value_from_next = false;
|
||||
value = &option[1];
|
||||
} else {
|
||||
value_from_next = ISC_TRUE;
|
||||
value_from_next = true;
|
||||
value = next;
|
||||
}
|
||||
if (value == NULL)
|
||||
@@ -1658,20 +1658,20 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
||||
}
|
||||
if (hash != NULL)
|
||||
*hash = '#';
|
||||
specified_source = ISC_TRUE;
|
||||
specified_source = true;
|
||||
return (value_from_next);
|
||||
case 'c':
|
||||
if ((*lookup)->rdclassset) {
|
||||
fprintf(stderr, ";; Warning, extra class option\n");
|
||||
}
|
||||
*open_type_class = ISC_FALSE;
|
||||
*open_type_class = 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 = ISC_TRUE;
|
||||
(*lookup)->rdclassset = true;
|
||||
} else
|
||||
fprintf(stderr, ";; Warning, ignoring "
|
||||
"invalid class %s\n",
|
||||
@@ -1693,23 +1693,23 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
||||
if (!config_only) {
|
||||
if (*need_clone)
|
||||
(*lookup) = clone_lookup(default_lookup,
|
||||
ISC_TRUE);
|
||||
*need_clone = ISC_TRUE;
|
||||
true);
|
||||
*need_clone = true;
|
||||
strlcpy((*lookup)->textname, value,
|
||||
sizeof((*lookup)->textname));
|
||||
(*lookup)->trace_root = ISC_TF((*lookup)->trace ||
|
||||
(*lookup)->ns_search_only);
|
||||
(*lookup)->new_search = ISC_TRUE;
|
||||
(*lookup)->trace_root = ((*lookup)->trace ||
|
||||
(*lookup)->ns_search_only);
|
||||
(*lookup)->new_search = true;
|
||||
if (*firstarg) {
|
||||
printgreeting(argc, argv, *lookup);
|
||||
*firstarg = ISC_FALSE;
|
||||
*firstarg = false;
|
||||
}
|
||||
ISC_LIST_APPEND(lookup_list, (*lookup), link);
|
||||
debug("looking up %s", (*lookup)->textname);
|
||||
}
|
||||
return (value_from_next);
|
||||
case 't':
|
||||
*open_type_class = ISC_FALSE;
|
||||
*open_type_class = false;
|
||||
if (strncasecmp(value, "ixfr=", 5) == 0) {
|
||||
rdtype = dns_rdatatype_ixfr;
|
||||
result = ISC_R_SUCCESS;
|
||||
@@ -1729,9 +1729,9 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
||||
"extra type option\n");
|
||||
}
|
||||
if (rdtype == dns_rdatatype_ixfr) {
|
||||
isc_uint32_t serial;
|
||||
uint32_t serial;
|
||||
(*lookup)->rdtype = dns_rdatatype_ixfr;
|
||||
(*lookup)->rdtypeset = ISC_TRUE;
|
||||
(*lookup)->rdtypeset = true;
|
||||
result = parse_uint(&serial, &value[5],
|
||||
MAXSERIAL, "serial number");
|
||||
if (result != ISC_R_SUCCESS)
|
||||
@@ -1740,19 +1740,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 = ISC_TRUE;
|
||||
(*lookup)->tcp_mode = true;
|
||||
} else {
|
||||
(*lookup)->rdtype = rdtype;
|
||||
if (!config_only)
|
||||
(*lookup)->rdtypeset = ISC_TRUE;
|
||||
(*lookup)->rdtypeset = 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 = ISC_TRUE;
|
||||
(*lookup)->tcp_mode = true;
|
||||
}
|
||||
(*lookup)->ixfr_serial = ISC_FALSE;
|
||||
(*lookup)->ixfr_serial = false;
|
||||
}
|
||||
} else
|
||||
fprintf(stderr, ";; Warning, ignoring "
|
||||
@@ -1780,24 +1780,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, ISC_TRUE);
|
||||
*need_clone = ISC_TRUE;
|
||||
*lookup = clone_lookup(default_lookup, true);
|
||||
*need_clone = true;
|
||||
if (get_reverse(textname, sizeof(textname), value,
|
||||
ip6_int, ISC_FALSE) == ISC_R_SUCCESS) {
|
||||
ip6_int, false) == ISC_R_SUCCESS) {
|
||||
strlcpy((*lookup)->textname, textname,
|
||||
sizeof((*lookup)->textname));
|
||||
debug("looking up %s", (*lookup)->textname);
|
||||
(*lookup)->trace_root = ISC_TF((*lookup)->trace ||
|
||||
(*lookup)->ns_search_only);
|
||||
(*lookup)->trace_root = ((*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 = ISC_TRUE;
|
||||
(*lookup)->new_search = true;
|
||||
if (*firstarg) {
|
||||
printgreeting(argc, argv, *lookup);
|
||||
*firstarg = ISC_FALSE;
|
||||
*firstarg = false;
|
||||
}
|
||||
ISC_LIST_APPEND(lookup_list, *lookup, link);
|
||||
} else {
|
||||
@@ -1811,7 +1811,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
||||
usage();
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
/*%
|
||||
@@ -1838,19 +1838,19 @@ preparse_args(int argc, char **argv) {
|
||||
while (strpbrk(option, single_dash_opts) == &option[0]) {
|
||||
switch (option[0]) {
|
||||
case 'm':
|
||||
memdebugging = ISC_TRUE;
|
||||
memdebugging = true;
|
||||
isc_mem_debugging = ISC_MEM_DEBUGTRACE |
|
||||
ISC_MEM_DEBUGRECORD;
|
||||
break;
|
||||
case '4':
|
||||
if (ipv6only)
|
||||
fatal("only one of -4 and -6 allowed");
|
||||
ipv4only = ISC_TRUE;
|
||||
ipv4only = true;
|
||||
break;
|
||||
case '6':
|
||||
if (ipv4only)
|
||||
fatal("only one of -4 and -6 allowed");
|
||||
ipv6only = ISC_TRUE;
|
||||
ipv6only = true;
|
||||
break;
|
||||
}
|
||||
option = &option[1];
|
||||
@@ -1875,16 +1875,16 @@ split_batchline(char *batchline, char **bargv, int len, const char *msg) {
|
||||
}
|
||||
|
||||
static void
|
||||
parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
parse_args(bool is_batchfile, bool config_only,
|
||||
int argc, char **argv)
|
||||
{
|
||||
isc_result_t result;
|
||||
isc_textregion_t tr;
|
||||
isc_boolean_t firstarg = ISC_TRUE;
|
||||
bool firstarg = true;
|
||||
dig_lookup_t *lookup = NULL;
|
||||
dns_rdatatype_t rdtype;
|
||||
dns_rdataclass_t rdclass;
|
||||
isc_boolean_t open_type_class = ISC_TRUE;
|
||||
bool open_type_class = true;
|
||||
char batchline[MXNAME];
|
||||
int bargc;
|
||||
char *bargv[64];
|
||||
@@ -1894,7 +1894,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
char *homedir;
|
||||
char rcfile[PATH_MAX];
|
||||
#endif
|
||||
isc_boolean_t need_clone = ISC_TRUE;
|
||||
bool need_clone = true;
|
||||
|
||||
/*
|
||||
* The semantics for parsing the args is a bit complex; if
|
||||
@@ -1911,9 +1911,9 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
if (!is_batchfile) {
|
||||
debug("making new lookup");
|
||||
default_lookup = make_empty_lookup();
|
||||
default_lookup->adflag = ISC_TRUE;
|
||||
default_lookup->adflag = true;
|
||||
default_lookup->edns = 0;
|
||||
default_lookup->sendcookie = ISC_TRUE;
|
||||
default_lookup->sendcookie = true;
|
||||
|
||||
#ifndef NOPOSIX
|
||||
/*
|
||||
@@ -1938,7 +1938,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
".digrc argv");
|
||||
bargv[0] = argv[0];
|
||||
argv0 = argv[0];
|
||||
parse_args(ISC_TRUE, ISC_TRUE,
|
||||
parse_args(true, true,
|
||||
bargc, (char **)bargv);
|
||||
}
|
||||
fclose(batchfp);
|
||||
@@ -1948,8 +1948,8 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
|
||||
if (is_batchfile && !config_only) {
|
||||
/* Processing '-f batchfile'. */
|
||||
lookup = clone_lookup(default_lookup, ISC_TRUE);
|
||||
need_clone = ISC_FALSE;
|
||||
lookup = clone_lookup(default_lookup, true);
|
||||
need_clone = false;
|
||||
} else {
|
||||
lookup = default_lookup;
|
||||
}
|
||||
@@ -2032,10 +2032,10 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
"extra type option\n");
|
||||
}
|
||||
if (rdtype == dns_rdatatype_ixfr) {
|
||||
isc_uint32_t serial;
|
||||
uint32_t serial;
|
||||
lookup->rdtype =
|
||||
dns_rdatatype_ixfr;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
result = parse_uint(&serial,
|
||||
&rv[0][5],
|
||||
MAXSERIAL,
|
||||
@@ -2048,10 +2048,10 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
plusquest;
|
||||
lookup->comments = pluscomm;
|
||||
if (!lookup->tcp_mode_set)
|
||||
lookup->tcp_mode = ISC_TRUE;
|
||||
lookup->tcp_mode = true;
|
||||
} else {
|
||||
lookup->rdtype = rdtype;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
if (rdtype ==
|
||||
dns_rdatatype_axfr) {
|
||||
lookup->section_question =
|
||||
@@ -2061,8 +2061,8 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
if (rdtype ==
|
||||
dns_rdatatype_any &&
|
||||
!lookup->tcp_mode_set)
|
||||
lookup->tcp_mode = ISC_TRUE;
|
||||
lookup->ixfr_serial = ISC_FALSE;
|
||||
lookup->tcp_mode = true;
|
||||
lookup->ixfr_serial = false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -2074,7 +2074,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
"extra class option\n");
|
||||
}
|
||||
lookup->rdclass = rdclass;
|
||||
lookup->rdclassset = ISC_TRUE;
|
||||
lookup->rdclassset = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -2082,16 +2082,16 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
if (!config_only) {
|
||||
if (need_clone)
|
||||
lookup = clone_lookup(default_lookup,
|
||||
ISC_TRUE);
|
||||
need_clone = ISC_TRUE;
|
||||
true);
|
||||
need_clone = true;
|
||||
strlcpy(lookup->textname, rv[0],
|
||||
sizeof(lookup->textname));
|
||||
lookup->trace_root = ISC_TF(lookup->trace ||
|
||||
lookup->ns_search_only);
|
||||
lookup->new_search = ISC_TRUE;
|
||||
lookup->trace_root = (lookup->trace ||
|
||||
lookup->ns_search_only);
|
||||
lookup->new_search = true;
|
||||
if (firstarg) {
|
||||
printgreeting(argc, argv, lookup);
|
||||
firstarg = ISC_FALSE;
|
||||
firstarg = false;
|
||||
}
|
||||
ISC_LIST_APPEND(lookup_list, lookup, link);
|
||||
debug("looking up %s", lookup->textname);
|
||||
@@ -2127,7 +2127,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
"batch argv");
|
||||
bargv[0] = argv[0];
|
||||
argv0 = argv[0];
|
||||
parse_args(ISC_TRUE, ISC_FALSE, bargc, (char **)bargv);
|
||||
parse_args(true, false, bargc, (char **)bargv);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
@@ -2137,17 +2137,17 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
*/
|
||||
if ((lookup_list.head == NULL) && !config_only) {
|
||||
if (need_clone)
|
||||
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;
|
||||
lookup = clone_lookup(default_lookup, true);
|
||||
need_clone = true;
|
||||
lookup->trace_root = (lookup->trace ||
|
||||
lookup->ns_search_only);
|
||||
lookup->new_search = true;
|
||||
strlcpy(lookup->textname, ".", sizeof(lookup->textname));
|
||||
lookup->rdtype = dns_rdatatype_ns;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
if (firstarg) {
|
||||
printgreeting(argc, argv, lookup);
|
||||
firstarg = ISC_FALSE;
|
||||
firstarg = false;
|
||||
}
|
||||
ISC_LIST_APPEND(lookup_list, lookup, link);
|
||||
}
|
||||
@@ -2184,7 +2184,7 @@ query_finished(void) {
|
||||
debug("batch line %s", batchline);
|
||||
bargc = split_batchline(batchline, bargv, 14, "batch argv");
|
||||
bargv[0] = argv0;
|
||||
parse_args(ISC_TRUE, ISC_FALSE, bargc, (char **)bargv);
|
||||
parse_args(true, false, bargc, (char **)bargv);
|
||||
start_lookup();
|
||||
} else {
|
||||
batchname = NULL;
|
||||
@@ -2221,7 +2221,7 @@ void dig_setup(int argc, char **argv)
|
||||
setup_system(ipv4only, ipv6only);
|
||||
}
|
||||
|
||||
void dig_query_setup(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
void dig_query_setup(bool is_batchfile, bool config_only,
|
||||
int argc, char **argv)
|
||||
{
|
||||
debug("dig_query_setup");
|
||||
@@ -2233,7 +2233,7 @@ void dig_query_setup(isc_boolean_t is_batchfile, isc_boolean_t config_only,
|
||||
setup_text_key();
|
||||
if (domainopt[0] != '\0') {
|
||||
set_search_domain(domainopt);
|
||||
usesearch = ISC_TRUE;
|
||||
usesearch = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2270,7 +2270,7 @@ int
|
||||
main(int argc, char **argv) {
|
||||
|
||||
dig_setup(argc, argv);
|
||||
dig_query_setup(ISC_FALSE, ISC_FALSE, argc, argv);
|
||||
dig_query_setup(false, false, argc, argv);
|
||||
dig_startup();
|
||||
dig_shutdown();
|
||||
|
||||
|
||||
+258
-262
File diff suppressed because it is too large
Load Diff
+88
-87
@@ -12,6 +12,9 @@
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
|
||||
@@ -26,7 +29,6 @@
|
||||
#include <isc/string.h>
|
||||
#include <isc/util.h>
|
||||
#include <isc/task.h>
|
||||
#include <isc/stdlib.h>
|
||||
|
||||
#include <dns/byaddr.h>
|
||||
#include <dns/fixedname.h>
|
||||
@@ -40,14 +42,14 @@
|
||||
|
||||
#include <dig/dig.h>
|
||||
|
||||
static isc_boolean_t short_form = ISC_TRUE, listed_server = ISC_FALSE;
|
||||
static isc_boolean_t default_lookups = ISC_TRUE;
|
||||
static bool short_form = true, listed_server = false;
|
||||
static bool default_lookups = true;
|
||||
static int seen_error = -1;
|
||||
static isc_boolean_t list_addresses = ISC_TRUE;
|
||||
static isc_boolean_t list_almost_all = ISC_FALSE;
|
||||
static bool list_addresses = true;
|
||||
static bool list_almost_all = false;
|
||||
static dns_rdatatype_t list_type = dns_rdatatype_a;
|
||||
static isc_boolean_t printed_server = ISC_FALSE;
|
||||
static isc_boolean_t ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
|
||||
static bool printed_server = false;
|
||||
static bool ipv4only = false, ipv6only = false;
|
||||
|
||||
static const char *opcodetext[] = {
|
||||
"QUERY",
|
||||
@@ -199,8 +201,7 @@ say_message(dns_name_t *name, const char *msg, dns_rdata_t *rdata,
|
||||
|
||||
dns_name_format(name, namestr, sizeof(namestr));
|
||||
retry:
|
||||
result = isc_buffer_allocate(mctx, &b, bufsize);
|
||||
check_result(result, "isc_buffer_allocate");
|
||||
isc_buffer_allocate(mctx, &b, bufsize);
|
||||
result = dns_rdata_totext(rdata, NULL, b);
|
||||
if (result == ISC_R_NOSPACE) {
|
||||
isc_buffer_free(&b);
|
||||
@@ -224,7 +225,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, isc_boolean_t headers,
|
||||
const char *section_name, bool headers,
|
||||
dig_query_t *query)
|
||||
{
|
||||
dns_name_t *name, *print_name;
|
||||
@@ -235,13 +236,13 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
|
||||
isc_region_t r;
|
||||
dns_name_t empty_name;
|
||||
char tbuf[4096];
|
||||
isc_boolean_t first;
|
||||
isc_boolean_t no_rdata;
|
||||
bool first;
|
||||
bool no_rdata;
|
||||
|
||||
if (sectionid == DNS_SECTION_QUESTION)
|
||||
no_rdata = ISC_TRUE;
|
||||
no_rdata = true;
|
||||
else
|
||||
no_rdata = ISC_FALSE;
|
||||
no_rdata = false;
|
||||
|
||||
if (headers)
|
||||
printf(";; %s SECTION:\n", section_name);
|
||||
@@ -259,7 +260,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
|
||||
dns_message_currentname(msg, sectionid, &name);
|
||||
|
||||
isc_buffer_init(&target, tbuf, sizeof(tbuf));
|
||||
first = ISC_TRUE;
|
||||
first = true;
|
||||
print_name = name;
|
||||
|
||||
for (rdataset = ISC_LIST_HEAD(name->list);
|
||||
@@ -283,7 +284,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
|
||||
if (!short_form) {
|
||||
result = dns_rdataset_totext(rdataset,
|
||||
print_name,
|
||||
ISC_FALSE,
|
||||
false,
|
||||
no_rdata,
|
||||
&target);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
@@ -291,7 +292,7 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
|
||||
#ifdef USEINITALWS
|
||||
if (first) {
|
||||
print_name = &empty_name;
|
||||
first = ISC_FALSE;
|
||||
first = false;
|
||||
}
|
||||
#else
|
||||
UNUSED(first); /* Shut up compiler. */
|
||||
@@ -350,7 +351,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,
|
||||
isc_boolean_t headers)
|
||||
bool headers)
|
||||
{
|
||||
isc_buffer_t target;
|
||||
isc_result_t result;
|
||||
@@ -363,7 +364,7 @@ printrdata(dns_message_t *msg, dns_rdataset_t *rdataset,
|
||||
|
||||
isc_buffer_init(&target, tbuf, sizeof(tbuf));
|
||||
|
||||
result = dns_rdataset_totext(rdataset, owner, ISC_FALSE, ISC_FALSE,
|
||||
result = dns_rdataset_totext(rdataset, owner, false, false,
|
||||
&target);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
@@ -400,8 +401,8 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
isc_boolean_t did_flag = ISC_FALSE;
|
||||
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
|
||||
bool did_flag = false;
|
||||
dns_rdataset_t *opt, *tsig = NULL;
|
||||
const dns_name_t *tsigname;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
@@ -424,7 +425,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
sizeof(sockstr));
|
||||
printf("Address: %s\n", sockstr);
|
||||
printf("Aliases: \n\n");
|
||||
printed_server = ISC_TRUE;
|
||||
printed_server = true;
|
||||
}
|
||||
|
||||
if (msg->rcode != 0) {
|
||||
@@ -456,22 +457,22 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t 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, ISC_FALSE);
|
||||
lookup = clone_lookup(query->lookup, false);
|
||||
if (lookup != NULL) {
|
||||
strlcpy(lookup->textname, namestr,
|
||||
sizeof(lookup->textname));
|
||||
lookup->rdtype = dns_rdatatype_aaaa;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
lookup->origin = NULL;
|
||||
lookup->retries = tries;
|
||||
ISC_LIST_APPEND(lookup_list, lookup, link);
|
||||
}
|
||||
lookup = clone_lookup(query->lookup, ISC_FALSE);
|
||||
lookup = clone_lookup(query->lookup, false);
|
||||
if (lookup != NULL) {
|
||||
strlcpy(lookup->textname, namestr,
|
||||
sizeof(lookup->textname));
|
||||
lookup->rdtype = dns_rdatatype_mx;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
lookup->origin = NULL;
|
||||
lookup->retries = tries;
|
||||
ISC_LIST_APPEND(lookup_list, lookup, link);
|
||||
@@ -485,31 +486,31 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
printf(";; flags: ");
|
||||
if ((msg->flags & DNS_MESSAGEFLAG_QR) != 0) {
|
||||
printf("qr");
|
||||
did_flag = ISC_TRUE;
|
||||
did_flag = true;
|
||||
}
|
||||
if ((msg->flags & DNS_MESSAGEFLAG_AA) != 0) {
|
||||
printf("%saa", did_flag ? " " : "");
|
||||
did_flag = ISC_TRUE;
|
||||
did_flag = true;
|
||||
}
|
||||
if ((msg->flags & DNS_MESSAGEFLAG_TC) != 0) {
|
||||
printf("%stc", did_flag ? " " : "");
|
||||
did_flag = ISC_TRUE;
|
||||
did_flag = true;
|
||||
}
|
||||
if ((msg->flags & DNS_MESSAGEFLAG_RD) != 0) {
|
||||
printf("%srd", did_flag ? " " : "");
|
||||
did_flag = ISC_TRUE;
|
||||
did_flag = true;
|
||||
}
|
||||
if ((msg->flags & DNS_MESSAGEFLAG_RA) != 0) {
|
||||
printf("%sra", did_flag ? " " : "");
|
||||
did_flag = ISC_TRUE;
|
||||
did_flag = true;
|
||||
}
|
||||
if ((msg->flags & DNS_MESSAGEFLAG_AD) != 0) {
|
||||
printf("%sad", did_flag ? " " : "");
|
||||
did_flag = ISC_TRUE;
|
||||
did_flag = true;
|
||||
}
|
||||
if ((msg->flags & DNS_MESSAGEFLAG_CD) != 0) {
|
||||
printf("%scd", did_flag ? " " : "");
|
||||
did_flag = ISC_TRUE;
|
||||
did_flag = true;
|
||||
POST(did_flag);
|
||||
}
|
||||
printf("; QUERY: %u, ANSWER: %u, "
|
||||
@@ -532,7 +533,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
!short_form) {
|
||||
printf("\n");
|
||||
result = printsection(msg, DNS_SECTION_QUESTION, "QUESTION",
|
||||
ISC_TRUE, query);
|
||||
true, query);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
}
|
||||
@@ -540,7 +541,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
if (!short_form)
|
||||
printf("\n");
|
||||
result = printsection(msg, DNS_SECTION_ANSWER, "ANSWER",
|
||||
ISC_TF(!short_form), query);
|
||||
!short_form, query);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
}
|
||||
@@ -549,7 +550,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
!short_form) {
|
||||
printf("\n");
|
||||
result = printsection(msg, DNS_SECTION_AUTHORITY, "AUTHORITY",
|
||||
ISC_TRUE, query);
|
||||
true, query);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
}
|
||||
@@ -557,14 +558,14 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
!short_form) {
|
||||
printf("\n");
|
||||
result = printsection(msg, DNS_SECTION_ADDITIONAL,
|
||||
"ADDITIONAL", ISC_TRUE, query);
|
||||
"ADDITIONAL", true, query);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
}
|
||||
if ((tsig != NULL) && !short_form) {
|
||||
printf("\n");
|
||||
result = printrdata(msg, tsig, tsigname,
|
||||
"PSEUDOSECTION TSIG", ISC_TRUE);
|
||||
"PSEUDOSECTION TSIG", true);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
}
|
||||
@@ -599,7 +600,7 @@ pre_parse_args(int argc, char **argv) {
|
||||
while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
|
||||
switch (c) {
|
||||
case 'm':
|
||||
memdebugging = ISC_TRUE;
|
||||
memdebugging = true;
|
||||
if (strcasecmp("trace", isc_commandline_argument) == 0)
|
||||
isc_mem_debugging |= ISC_MEM_DEBUGTRACE;
|
||||
else if (strcasecmp("record",
|
||||
@@ -613,12 +614,12 @@ pre_parse_args(int argc, char **argv) {
|
||||
case '4':
|
||||
if (ipv6only)
|
||||
fatal("only one of -4 and -6 allowed");
|
||||
ipv4only = ISC_TRUE;
|
||||
ipv4only = true;
|
||||
break;
|
||||
case '6':
|
||||
if (ipv4only)
|
||||
fatal("only one of -4 and -6 allowed");
|
||||
ipv6only = ISC_TRUE;
|
||||
ipv6only = true;
|
||||
break;
|
||||
case 'a': break;
|
||||
case 'A': break;
|
||||
@@ -639,8 +640,8 @@ pre_parse_args(int argc, char **argv) {
|
||||
case 'C': break;
|
||||
case 'D':
|
||||
if (debugging)
|
||||
debugtiming = ISC_TRUE;
|
||||
debugging = ISC_TRUE;
|
||||
debugtiming = true;
|
||||
debugging = true;
|
||||
break;
|
||||
case 'N': break;
|
||||
case 'R': break;
|
||||
@@ -650,12 +651,12 @@ pre_parse_args(int argc, char **argv) {
|
||||
show_usage();
|
||||
}
|
||||
}
|
||||
isc_commandline_reset = ISC_TRUE;
|
||||
isc_commandline_reset = true;
|
||||
isc_commandline_index = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
|
||||
parse_args(bool is_batchfile, int argc, char **argv) {
|
||||
char hostname[MXNAME];
|
||||
dig_lookup_t *lookup;
|
||||
int c;
|
||||
@@ -664,30 +665,30 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
dns_rdatatype_t rdtype;
|
||||
dns_rdataclass_t rdclass;
|
||||
isc_uint32_t serial = 0;
|
||||
uint32_t serial = 0;
|
||||
|
||||
UNUSED(is_batchfile);
|
||||
|
||||
lookup = make_empty_lookup();
|
||||
|
||||
lookup->servfail_stops = ISC_FALSE;
|
||||
lookup->comments = ISC_FALSE;
|
||||
lookup->servfail_stops = false;
|
||||
lookup->comments = false;
|
||||
short_form = !verbose;
|
||||
|
||||
while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
|
||||
switch (c) {
|
||||
case 'l':
|
||||
lookup->tcp_mode = ISC_TRUE;
|
||||
lookup->tcp_mode = true;
|
||||
lookup->rdtype = dns_rdatatype_axfr;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
fatalexit = 3;
|
||||
break;
|
||||
case 'v':
|
||||
case 'd':
|
||||
short_form = ISC_FALSE;
|
||||
short_form = false;
|
||||
break;
|
||||
case 'r':
|
||||
lookup->recurse = ISC_FALSE;
|
||||
lookup->recurse = false;
|
||||
break;
|
||||
case 't':
|
||||
if (strncasecmp(isc_commandline_argument,
|
||||
@@ -712,23 +713,23 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
|
||||
if (!lookup->rdtypeset ||
|
||||
lookup->rdtype != dns_rdatatype_axfr)
|
||||
lookup->rdtype = rdtype;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
if (rdtype == dns_rdatatype_axfr) {
|
||||
/* -l -t any -v */
|
||||
list_type = dns_rdatatype_any;
|
||||
short_form = ISC_FALSE;
|
||||
lookup->tcp_mode = ISC_TRUE;
|
||||
short_form = false;
|
||||
lookup->tcp_mode = true;
|
||||
} else if (rdtype == dns_rdatatype_ixfr) {
|
||||
lookup->ixfr_serial = serial;
|
||||
lookup->tcp_mode = ISC_TRUE;
|
||||
lookup->tcp_mode = true;
|
||||
list_type = rdtype;
|
||||
} else if (rdtype == dns_rdatatype_any) {
|
||||
if (!lookup->tcp_mode_set)
|
||||
lookup->tcp_mode = ISC_TRUE;
|
||||
lookup->tcp_mode = true;
|
||||
} else
|
||||
list_type = rdtype;
|
||||
list_addresses = ISC_FALSE;
|
||||
default_lookups = ISC_FALSE;
|
||||
list_addresses = false;
|
||||
default_lookups = false;
|
||||
break;
|
||||
case 'c':
|
||||
tr.base = isc_commandline_argument;
|
||||
@@ -742,25 +743,25 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
|
||||
isc_commandline_argument);
|
||||
} else {
|
||||
lookup->rdclass = rdclass;
|
||||
lookup->rdclassset = ISC_TRUE;
|
||||
lookup->rdclassset = true;
|
||||
}
|
||||
default_lookups = ISC_FALSE;
|
||||
default_lookups = false;
|
||||
break;
|
||||
case 'A':
|
||||
list_almost_all = ISC_TRUE;
|
||||
list_almost_all = true;
|
||||
/* FALL THROUGH */
|
||||
case 'a':
|
||||
if (!lookup->rdtypeset ||
|
||||
lookup->rdtype != dns_rdatatype_axfr)
|
||||
lookup->rdtype = dns_rdatatype_any;
|
||||
list_type = dns_rdatatype_any;
|
||||
list_addresses = ISC_FALSE;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
short_form = ISC_FALSE;
|
||||
default_lookups = ISC_FALSE;
|
||||
list_addresses = false;
|
||||
lookup->rdtypeset = true;
|
||||
short_form = false;
|
||||
default_lookups = false;
|
||||
break;
|
||||
case 'i':
|
||||
lookup->ip6_int = ISC_TRUE;
|
||||
lookup->ip6_int = true;
|
||||
break;
|
||||
case 'n':
|
||||
/* deprecated */
|
||||
@@ -786,23 +787,23 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
|
||||
tries = 2;
|
||||
break;
|
||||
case 'T':
|
||||
lookup->tcp_mode = ISC_TRUE;
|
||||
lookup->tcp_mode_set = ISC_TRUE;
|
||||
lookup->tcp_mode = true;
|
||||
lookup->tcp_mode_set = true;
|
||||
break;
|
||||
case 'U':
|
||||
lookup->tcp_mode = ISC_FALSE;
|
||||
lookup->tcp_mode_set = ISC_TRUE;
|
||||
lookup->tcp_mode = false;
|
||||
lookup->tcp_mode_set = true;
|
||||
break;
|
||||
case 'C':
|
||||
debug("showing all SOAs");
|
||||
lookup->rdtype = dns_rdatatype_ns;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
lookup->rdclass = dns_rdataclass_in;
|
||||
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;
|
||||
lookup->rdclassset = true;
|
||||
lookup->ns_search_only = true;
|
||||
lookup->trace_root = true;
|
||||
lookup->identify_previous_line = true;
|
||||
default_lookups = false;
|
||||
break;
|
||||
case 'N':
|
||||
debug("setting NDOTS to %s",
|
||||
@@ -819,7 +820,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
|
||||
/* Handled by pre_parse_args(). */
|
||||
break;
|
||||
case 's':
|
||||
lookup->servfail_stops = ISC_TRUE;
|
||||
lookup->servfail_stops = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -834,22 +835,22 @@ parse_args(isc_boolean_t 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 = ISC_TRUE;
|
||||
listed_server = true;
|
||||
} else
|
||||
check_ra = ISC_TRUE;
|
||||
check_ra = true;
|
||||
|
||||
lookup->pending = ISC_FALSE;
|
||||
lookup->pending = false;
|
||||
if (get_reverse(store, sizeof(store), hostname,
|
||||
lookup->ip6_int, ISC_TRUE) == ISC_R_SUCCESS) {
|
||||
lookup->ip6_int, true) == ISC_R_SUCCESS) {
|
||||
strlcpy(lookup->textname, store, sizeof(lookup->textname));
|
||||
lookup->rdtype = dns_rdatatype_ptr;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
default_lookups = ISC_FALSE;
|
||||
lookup->rdtypeset = true;
|
||||
default_lookups = false;
|
||||
} else {
|
||||
strlcpy(lookup->textname, hostname, sizeof(lookup->textname));
|
||||
usesearch = ISC_TRUE;
|
||||
usesearch = true;
|
||||
}
|
||||
lookup->new_search = ISC_TRUE;
|
||||
lookup->new_search = true;
|
||||
ISC_LIST_APPEND(lookup_list, lookup, link);
|
||||
}
|
||||
|
||||
@@ -878,7 +879,7 @@ main(int argc, char **argv) {
|
||||
check_result(result, "isc_app_start");
|
||||
setup_libs();
|
||||
setup_system(ipv4only, ipv6only);
|
||||
parse_args(ISC_FALSE, argc, argv);
|
||||
parse_args(false, argc, argv);
|
||||
if (keyfile[0] != 0)
|
||||
setup_file_key();
|
||||
else if (keysecret[0] != 0)
|
||||
|
||||
+35
-33
@@ -14,11 +14,13 @@
|
||||
|
||||
/*! \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>
|
||||
@@ -81,7 +83,7 @@ typedef struct dig_searchlist dig_searchlist_t;
|
||||
|
||||
/*% The dig_lookup structure */
|
||||
struct dig_lookup {
|
||||
isc_boolean_t
|
||||
bool
|
||||
pending, /*%< Pending a successful answer */
|
||||
waiting_connect,
|
||||
doing_xfr,
|
||||
@@ -139,8 +141,8 @@ struct dig_lookup {
|
||||
dns_rdatatype_t rdtype;
|
||||
dns_rdatatype_t qrdtype;
|
||||
dns_rdataclass_t rdclass;
|
||||
isc_boolean_t rdtypeset;
|
||||
isc_boolean_t rdclassset;
|
||||
bool rdtypeset;
|
||||
bool rdclassset;
|
||||
char name_space[BUFSIZE];
|
||||
char oname_space[BUFSIZE];
|
||||
isc_buffer_t namebuf;
|
||||
@@ -158,17 +160,17 @@ struct dig_lookup {
|
||||
dig_serverlist_t my_server_list;
|
||||
dig_searchlist_t *origin;
|
||||
dig_query_t *xfr_q;
|
||||
isc_uint32_t retries;
|
||||
uint32_t retries;
|
||||
int nsfound;
|
||||
isc_uint16_t udpsize;
|
||||
isc_int16_t edns;
|
||||
isc_int16_t padding;
|
||||
isc_uint32_t ixfr_serial;
|
||||
uint16_t udpsize;
|
||||
int16_t edns;
|
||||
int16_t padding;
|
||||
uint32_t ixfr_serial;
|
||||
isc_buffer_t rdatabuf;
|
||||
char rdatastore[MXNAME];
|
||||
dst_context_t *tsigctx;
|
||||
isc_buffer_t *querysig;
|
||||
isc_uint32_t msgcounter;
|
||||
uint32_t msgcounter;
|
||||
dns_fixedname_t fdomain;
|
||||
isc_sockaddr_t *ecs_addr;
|
||||
char *cookie;
|
||||
@@ -184,7 +186,7 @@ struct dig_lookup {
|
||||
/*% The dig_query structure */
|
||||
struct dig_query {
|
||||
dig_lookup_t *lookup;
|
||||
isc_boolean_t waiting_connect,
|
||||
bool waiting_connect,
|
||||
pending_free,
|
||||
waiting_senddone,
|
||||
first_pass,
|
||||
@@ -194,11 +196,11 @@ struct dig_query {
|
||||
recv_made,
|
||||
warn_id,
|
||||
timedout;
|
||||
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;
|
||||
uint32_t first_rr_serial;
|
||||
uint32_t second_rr_serial;
|
||||
uint32_t msg_count;
|
||||
uint32_t rr_count;
|
||||
bool ixfr_axfr;
|
||||
char *servname;
|
||||
char *userarg;
|
||||
isc_bufferlist_t sendlist,
|
||||
@@ -216,7 +218,7 @@ struct dig_query {
|
||||
isc_sockaddr_t sockaddr;
|
||||
isc_time_t time_sent;
|
||||
isc_time_t time_recv;
|
||||
isc_uint64_t byte_count;
|
||||
uint64_t byte_count;
|
||||
isc_buffer_t sendbuf;
|
||||
isc_timer_t *timer;
|
||||
};
|
||||
@@ -244,7 +246,7 @@ extern dig_serverlist_t server_list;
|
||||
extern dig_searchlistlist_t search_list;
|
||||
extern unsigned int extrabytes;
|
||||
|
||||
extern isc_boolean_t check_ra, have_ipv4, have_ipv6, specified_source,
|
||||
extern bool check_ra, have_ipv4, have_ipv6, specified_source,
|
||||
usesearch, showsearch;
|
||||
extern in_port_t port;
|
||||
extern unsigned int timeout;
|
||||
@@ -260,17 +262,17 @@ extern char keysecret[MXNAME];
|
||||
extern const dns_name_t *hmacname;
|
||||
extern unsigned int digestbits;
|
||||
extern dns_tsigkey_t *tsigkey;
|
||||
extern isc_boolean_t validated;
|
||||
extern bool validated;
|
||||
extern isc_taskmgr_t *taskmgr;
|
||||
extern isc_task_t *global_task;
|
||||
extern isc_boolean_t free_now;
|
||||
extern isc_boolean_t debugging, debugtiming, memdebugging;
|
||||
extern isc_boolean_t keep_open;
|
||||
extern bool free_now;
|
||||
extern bool debugging, debugtiming, memdebugging;
|
||||
extern bool keep_open;
|
||||
|
||||
extern char *progname;
|
||||
extern int tries;
|
||||
extern int fatalexit;
|
||||
extern isc_boolean_t verbose;
|
||||
extern bool verbose;
|
||||
|
||||
/*
|
||||
* Routines in dighost.c.
|
||||
@@ -282,8 +284,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, isc_boolean_t ip6_int,
|
||||
isc_boolean_t strict);
|
||||
get_reverse(char *reverse, size_t len, char *value, bool ip6_int,
|
||||
bool strict);
|
||||
|
||||
ISC_PLATFORM_NORETURN_PRE void
|
||||
fatal(const char *format, ...)
|
||||
@@ -302,7 +304,7 @@ debug(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
|
||||
void
|
||||
check_result(isc_result_t result, const char *msg);
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
setup_lookup(dig_lookup_t *lookup);
|
||||
|
||||
void
|
||||
@@ -324,14 +326,14 @@ void
|
||||
setup_libs(void);
|
||||
|
||||
void
|
||||
setup_system(isc_boolean_t ipv4only, isc_boolean_t ipv6only);
|
||||
setup_system(bool ipv4only, bool ipv6only);
|
||||
|
||||
isc_result_t
|
||||
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
|
||||
parse_uint(uint32_t *uip, const char *value, uint32_t max,
|
||||
const char *desc);
|
||||
|
||||
isc_result_t
|
||||
parse_xint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
|
||||
parse_xint(uint32_t *uip, const char *value, uint32_t max,
|
||||
const char *desc);
|
||||
|
||||
isc_result_t
|
||||
@@ -341,13 +343,13 @@ void
|
||||
parse_hmac(const char *hmacstr);
|
||||
|
||||
dig_lookup_t *
|
||||
requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
|
||||
requeue_lookup(dig_lookup_t *lookold, bool servers);
|
||||
|
||||
dig_lookup_t *
|
||||
make_empty_lookup(void);
|
||||
|
||||
dig_lookup_t *
|
||||
clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers);
|
||||
clone_lookup(dig_lookup_t *lookold, bool servers);
|
||||
|
||||
dig_server_t *
|
||||
make_server(const char *servname, const char *userarg);
|
||||
@@ -376,7 +378,7 @@ set_search_domain(char *domain);
|
||||
* then assigned to the appropriate function pointer
|
||||
*/
|
||||
extern isc_result_t
|
||||
(*dighost_printmessage)(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers);
|
||||
(*dighost_printmessage)(dig_query_t *query, dns_message_t *msg, bool headers);
|
||||
/*%<
|
||||
* Print the final result of the lookup.
|
||||
*/
|
||||
@@ -418,7 +420,7 @@ dig_setup(int argc, char **argv);
|
||||
* Call to supply new parameters for the next lookup
|
||||
*/
|
||||
void
|
||||
dig_query_setup(isc_boolean_t, isc_boolean_t, int argc, char **argv);
|
||||
dig_query_setup(bool, bool, int argc, char **argv);
|
||||
|
||||
/*%<
|
||||
* set the main application event cycle running
|
||||
|
||||
+89
-89
@@ -11,6 +11,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -53,18 +55,18 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
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 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 interactive;
|
||||
static bool interactive;
|
||||
|
||||
static isc_boolean_t in_use = ISC_FALSE;
|
||||
static bool in_use = false;
|
||||
static char defclass[MXRD] = "IN";
|
||||
static char deftype[MXRD] = "A";
|
||||
static isc_event_t *global_event = NULL;
|
||||
@@ -213,7 +215,7 @@ printrdata(dns_rdata_t *rdata) {
|
||||
isc_result_t result;
|
||||
isc_buffer_t *b = NULL;
|
||||
unsigned int size = 1024;
|
||||
isc_boolean_t done = ISC_FALSE;
|
||||
bool done = false;
|
||||
|
||||
if (rdata->type < N_KNOWN_RRTYPES)
|
||||
printf("%s", rtypetext[rdata->type]);
|
||||
@@ -221,14 +223,12 @@ printrdata(dns_rdata_t *rdata) {
|
||||
printf("rdata_%d = ", rdata->type);
|
||||
|
||||
while (!done) {
|
||||
result = isc_buffer_allocate(mctx, &b, size);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
check_result(result, "isc_buffer_allocate");
|
||||
isc_buffer_allocate(mctx, &b, size);
|
||||
result = dns_rdata_totext(rdata, NULL, b);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
printf("%.*s\n", (int)isc_buffer_usedlength(b),
|
||||
(char *)isc_buffer_base(b));
|
||||
done = ISC_TRUE;
|
||||
done = true;
|
||||
} else if (result != ISC_R_NOSPACE)
|
||||
check_result(result, "dns_rdata_totext");
|
||||
isc_buffer_free(&b);
|
||||
@@ -237,7 +237,7 @@ printrdata(dns_rdata_t *rdata) {
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
printsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers,
|
||||
printsection(dig_query_t *query, dns_message_t *msg, bool headers,
|
||||
dns_section_t section) {
|
||||
isc_result_t result, loopresult;
|
||||
dns_name_t *name;
|
||||
@@ -304,7 +304,7 @@ printsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers,
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
detailsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers,
|
||||
detailsection(dig_query_t *query, dns_message_t *msg, bool headers,
|
||||
dns_section_t section) {
|
||||
isc_result_t result, loopresult;
|
||||
dns_name_t *name;
|
||||
@@ -429,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, isc_boolean_t headers) {
|
||||
printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
|
||||
char servtext[ISC_SOCKADDR_FORMATSIZE];
|
||||
|
||||
/* I've we've gotten this far, we've reached a server. */
|
||||
@@ -448,10 +448,10 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
if (!short_form) {
|
||||
puts("------------");
|
||||
/* detailheader(query, msg);*/
|
||||
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);
|
||||
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);
|
||||
puts("------------");
|
||||
}
|
||||
|
||||
@@ -479,12 +479,12 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t 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, ISC_FALSE);
|
||||
lookup = clone_lookup(query->lookup, false);
|
||||
if (lookup != NULL) {
|
||||
strlcpy(lookup->textname, namestr,
|
||||
sizeof(lookup->textname));
|
||||
lookup->rdtype = dns_rdatatype_aaaa;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
lookup->origin = NULL;
|
||||
lookup->retries = tries;
|
||||
ISC_LIST_APPEND(lookup_list, lookup, link);
|
||||
@@ -498,7 +498,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
printsection(query, msg, headers, DNS_SECTION_ANSWER);
|
||||
else {
|
||||
if (default_lookups && query->lookup->rdtype == dns_rdatatype_a)
|
||||
a_noanswer = ISC_TRUE;
|
||||
a_noanswer = true;
|
||||
|
||||
else if (!default_lookups ||
|
||||
(query->lookup->rdtype == dns_rdatatype_aaaa &&
|
||||
@@ -520,7 +520,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
||||
}
|
||||
|
||||
static void
|
||||
show_settings(isc_boolean_t full, isc_boolean_t serv_only) {
|
||||
show_settings(bool full, bool serv_only) {
|
||||
dig_server_t *srv;
|
||||
isc_sockaddr_t sockaddr;
|
||||
dig_searchlist_t *listent;
|
||||
@@ -565,7 +565,7 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) {
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
testtype(char *typetext) {
|
||||
isc_result_t result;
|
||||
isc_textregion_t tr;
|
||||
@@ -575,14 +575,14 @@ testtype(char *typetext) {
|
||||
tr.length = strlen(typetext);
|
||||
result = dns_rdatatype_fromtext(&rdtype, &tr);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
else {
|
||||
printf("unknown query type: %s\n", typetext);
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
testclass(char *typetext) {
|
||||
isc_result_t result;
|
||||
isc_textregion_t tr;
|
||||
@@ -592,24 +592,24 @@ testclass(char *typetext) {
|
||||
tr.length = strlen(typetext);
|
||||
result = dns_rdataclass_fromtext(&rdclass, &tr);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
else {
|
||||
printf("unknown query class: %s\n", typetext);
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
set_port(const char *value) {
|
||||
isc_uint32_t n;
|
||||
uint32_t n;
|
||||
isc_result_t result = parse_uint(&n, value, 65535, "port");
|
||||
if (result == ISC_R_SUCCESS)
|
||||
port = (isc_uint16_t) n;
|
||||
port = (uint16_t) n;
|
||||
}
|
||||
|
||||
static void
|
||||
set_timeout(const char *value) {
|
||||
isc_uint32_t n;
|
||||
uint32_t n;
|
||||
isc_result_t result = parse_uint(&n, value, UINT_MAX, "timeout");
|
||||
if (result == ISC_R_SUCCESS)
|
||||
timeout = n;
|
||||
@@ -617,7 +617,7 @@ set_timeout(const char *value) {
|
||||
|
||||
static void
|
||||
set_tries(const char *value) {
|
||||
isc_uint32_t n;
|
||||
uint32_t n;
|
||||
isc_result_t result = parse_uint(&n, value, INT_MAX, "tries");
|
||||
if (result == ISC_R_SUCCESS)
|
||||
tries = n;
|
||||
@@ -625,7 +625,7 @@ set_tries(const char *value) {
|
||||
|
||||
static void
|
||||
set_ndots(const char *value) {
|
||||
isc_uint32_t n;
|
||||
uint32_t n;
|
||||
isc_result_t result = parse_uint(&n, value, 128, "ndots");
|
||||
if (result == ISC_R_SUCCESS)
|
||||
ndots = n;
|
||||
@@ -644,7 +644,7 @@ setoption(char *opt) {
|
||||
((l >= N) && (l < sizeof(A)) && (strncasecmp(opt, A, l) == 0))
|
||||
|
||||
if (CHECKOPT("all", 3)) {
|
||||
show_settings(ISC_TRUE, ISC_FALSE);
|
||||
show_settings(true, false);
|
||||
} else if (strncasecmp(opt, "class=", 6) == 0) {
|
||||
if (testclass(&opt[6]))
|
||||
strlcpy(defclass, &opt[6], sizeof(defclass));
|
||||
@@ -654,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 = ISC_FALSE;
|
||||
default_lookups = false;
|
||||
}
|
||||
} else if (strncasecmp(opt, "ty=", 3) == 0) {
|
||||
if (testtype(&opt[3])) {
|
||||
strlcpy(deftype, &opt[3], sizeof(deftype));
|
||||
default_lookups = ISC_FALSE;
|
||||
default_lookups = false;
|
||||
}
|
||||
} else if (strncasecmp(opt, "querytype=", 10) == 0) {
|
||||
if (testtype(&opt[10])) {
|
||||
strlcpy(deftype, &opt[10], sizeof(deftype));
|
||||
default_lookups = ISC_FALSE;
|
||||
default_lookups = false;
|
||||
}
|
||||
} else if (strncasecmp(opt, "query=", 6) == 0) {
|
||||
if (testtype(&opt[6])) {
|
||||
strlcpy(deftype, &opt[6], sizeof(deftype));
|
||||
default_lookups = ISC_FALSE;
|
||||
default_lookups = false;
|
||||
}
|
||||
} else if (strncasecmp(opt, "qu=", 3) == 0) {
|
||||
if (testtype(&opt[3])) {
|
||||
strlcpy(deftype, &opt[3], sizeof(deftype));
|
||||
default_lookups = ISC_FALSE;
|
||||
default_lookups = false;
|
||||
}
|
||||
} else if (strncasecmp(opt, "q=", 2) == 0) {
|
||||
if (testtype(&opt[2])) {
|
||||
strlcpy(deftype, &opt[2], sizeof(deftype));
|
||||
default_lookups = ISC_FALSE;
|
||||
default_lookups = false;
|
||||
}
|
||||
} else if (strncasecmp(opt, "domain=", 7) == 0) {
|
||||
strlcpy(domainopt, &opt[7], sizeof(domainopt));
|
||||
set_search_domain(domainopt);
|
||||
usesearch = ISC_TRUE;
|
||||
usesearch = true;
|
||||
} else if (strncasecmp(opt, "do=", 3) == 0) {
|
||||
strlcpy(domainopt, &opt[3], sizeof(domainopt));
|
||||
set_search_domain(domainopt);
|
||||
usesearch = ISC_TRUE;
|
||||
usesearch = true;
|
||||
} else if (strncasecmp(opt, "port=", 5) == 0) {
|
||||
set_port(&opt[5]);
|
||||
} else if (strncasecmp(opt, "po=", 3) == 0) {
|
||||
@@ -698,43 +698,43 @@ setoption(char *opt) {
|
||||
} else if (strncasecmp(opt, "t=", 2) == 0) {
|
||||
set_timeout(&opt[2]);
|
||||
} else if (CHECKOPT("recurse", 3)) {
|
||||
recurse = ISC_TRUE;
|
||||
recurse = true;
|
||||
} else if (CHECKOPT("norecurse", 5)) {
|
||||
recurse = ISC_FALSE;
|
||||
recurse = 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 = ISC_TRUE;
|
||||
usesearch = true;
|
||||
} else if (CHECKOPT("nodefname", 5)) {
|
||||
usesearch = ISC_FALSE;
|
||||
usesearch = false;
|
||||
} else if (CHECKOPT("vc", 2)) {
|
||||
tcpmode = ISC_TRUE;
|
||||
tcpmode_set = ISC_TRUE;
|
||||
tcpmode = true;
|
||||
tcpmode_set = true;
|
||||
} else if (CHECKOPT("novc", 4)) {
|
||||
tcpmode = ISC_FALSE;
|
||||
tcpmode_set = ISC_TRUE;
|
||||
tcpmode = false;
|
||||
tcpmode_set = true;
|
||||
} else if (CHECKOPT("debug", 3)) {
|
||||
short_form = ISC_FALSE;
|
||||
showsearch = ISC_TRUE;
|
||||
short_form = false;
|
||||
showsearch = true;
|
||||
} else if (CHECKOPT("nodebug", 5)) {
|
||||
short_form = ISC_TRUE;
|
||||
showsearch = ISC_FALSE;
|
||||
short_form = true;
|
||||
showsearch = false;
|
||||
} else if (CHECKOPT("d2", 2)) {
|
||||
debugging = ISC_TRUE;
|
||||
debugging = true;
|
||||
} else if (CHECKOPT("nod2", 4)) {
|
||||
debugging = ISC_FALSE;
|
||||
debugging = false;
|
||||
} else if (CHECKOPT("search", 3)) {
|
||||
usesearch = ISC_TRUE;
|
||||
usesearch = true;
|
||||
} else if (CHECKOPT("nosearch", 5)) {
|
||||
usesearch = ISC_FALSE;
|
||||
usesearch = false;
|
||||
} else if (CHECKOPT("sil", 3)) {
|
||||
/* deprecation_msg = ISC_FALSE; */
|
||||
/* deprecation_msg = false; */
|
||||
} else if (CHECKOPT("fail", 3)) {
|
||||
nofail=ISC_FALSE;
|
||||
nofail=false;
|
||||
} else if (CHECKOPT("nofail", 5)) {
|
||||
nofail=ISC_TRUE;
|
||||
nofail=true;
|
||||
} else if (strncasecmp(opt, "ndots=", 6) == 0) {
|
||||
set_ndots(&opt[6]);
|
||||
} else {
|
||||
@@ -753,7 +753,7 @@ addlookup(char *opt) {
|
||||
|
||||
debug("addlookup()");
|
||||
|
||||
a_noanswer = ISC_FALSE;
|
||||
a_noanswer = false;
|
||||
|
||||
tr.base = deftype;
|
||||
tr.length = strlen(deftype);
|
||||
@@ -770,21 +770,21 @@ addlookup(char *opt) {
|
||||
rdclass = dns_rdataclass_in;
|
||||
}
|
||||
lookup = make_empty_lookup();
|
||||
if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, ISC_TRUE)
|
||||
if (get_reverse(store, sizeof(store), opt, lookup->ip6_int, true)
|
||||
== ISC_R_SUCCESS) {
|
||||
strlcpy(lookup->textname, store, sizeof(lookup->textname));
|
||||
lookup->rdtype = dns_rdatatype_ptr;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
} else {
|
||||
strlcpy(lookup->textname, opt, sizeof(lookup->textname));
|
||||
lookup->rdtype = rdtype;
|
||||
lookup->rdtypeset = ISC_TRUE;
|
||||
lookup->rdtypeset = true;
|
||||
}
|
||||
lookup->rdclass = rdclass;
|
||||
lookup->rdclassset = ISC_TRUE;
|
||||
lookup->trace = ISC_FALSE;
|
||||
lookup->rdclassset = true;
|
||||
lookup->trace = false;
|
||||
lookup->trace_root = lookup->trace;
|
||||
lookup->ns_search_only = ISC_FALSE;
|
||||
lookup->ns_search_only = false;
|
||||
lookup->identify = identify;
|
||||
lookup->recurse = recurse;
|
||||
lookup->aaonly = aaonly;
|
||||
@@ -792,7 +792,7 @@ addlookup(char *opt) {
|
||||
lookup->udpsize = 0;
|
||||
lookup->comments = comments;
|
||||
if (lookup->rdtype == dns_rdatatype_any && !tcpmode_set)
|
||||
lookup->tcp_mode = ISC_TRUE;
|
||||
lookup->tcp_mode = true;
|
||||
else
|
||||
lookup->tcp_mode = tcpmode;
|
||||
lookup->stats = stats;
|
||||
@@ -800,9 +800,9 @@ addlookup(char *opt) {
|
||||
lookup->section_answer = section_answer;
|
||||
lookup->section_authority = section_authority;
|
||||
lookup->section_additional = section_additional;
|
||||
lookup->new_search = ISC_TRUE;
|
||||
lookup->new_search = true;
|
||||
if (nofail)
|
||||
lookup->servfail_stops = ISC_FALSE;
|
||||
lookup->servfail_stops = false;
|
||||
ISC_LIST_INIT(lookup->q);
|
||||
ISC_LINK_INIT(lookup, link);
|
||||
ISC_LIST_APPEND(lookup_list, lookup, link);
|
||||
@@ -826,11 +826,11 @@ do_next_command(char *input) {
|
||||
(strcasecmp(ptr, "lserver") == 0)) {
|
||||
isc_app_block();
|
||||
set_nameserver(arg);
|
||||
check_ra = ISC_FALSE;
|
||||
check_ra = false;
|
||||
isc_app_unblock();
|
||||
show_settings(ISC_TRUE, ISC_TRUE);
|
||||
show_settings(true, true);
|
||||
} else if (strcasecmp(ptr, "exit") == 0) {
|
||||
in_use = ISC_FALSE;
|
||||
in_use = false;
|
||||
} else if (strcasecmp(ptr, "help") == 0 ||
|
||||
strcasecmp(ptr, "?") == 0) {
|
||||
printf("The '%s' command is not yet implemented.\n", ptr);
|
||||
@@ -867,7 +867,7 @@ get_next_command(void) {
|
||||
ptr = fgets(buf, COMMSIZE, stdin);
|
||||
isc_app_unblock();
|
||||
if (ptr == NULL) {
|
||||
in_use = ISC_FALSE;
|
||||
in_use = false;
|
||||
} else
|
||||
do_next_command(ptr);
|
||||
#ifdef HAVE_READLINE
|
||||
@@ -879,9 +879,9 @@ get_next_command(void) {
|
||||
|
||||
static void
|
||||
parse_args(int argc, char **argv) {
|
||||
isc_boolean_t have_lookup = ISC_FALSE;
|
||||
bool have_lookup = false;
|
||||
|
||||
usesearch = ISC_TRUE;
|
||||
usesearch = true;
|
||||
for (argc--, argv++; argc > 0; argc--, argv++) {
|
||||
debug("main parsing %s", argv[0]);
|
||||
if (argv[0][0] == '-') {
|
||||
@@ -891,15 +891,15 @@ parse_args(int argc, char **argv) {
|
||||
} else if (argv[0][1] != 0) {
|
||||
setoption(&argv[0][1]);
|
||||
} else
|
||||
have_lookup = ISC_TRUE;
|
||||
have_lookup = true;
|
||||
} else {
|
||||
if (!have_lookup) {
|
||||
have_lookup = ISC_TRUE;
|
||||
in_use = ISC_TRUE;
|
||||
have_lookup = true;
|
||||
in_use = true;
|
||||
addlookup(argv[0]);
|
||||
} else {
|
||||
set_nameserver(argv[0]);
|
||||
check_ra = ISC_FALSE;
|
||||
check_ra = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -970,13 +970,13 @@ int
|
||||
main(int argc, char **argv) {
|
||||
isc_result_t result;
|
||||
|
||||
interactive = ISC_TF(isatty(0));
|
||||
interactive = isatty(0);
|
||||
|
||||
ISC_LIST_INIT(lookup_list);
|
||||
ISC_LIST_INIT(server_list);
|
||||
ISC_LIST_INIT(search_list);
|
||||
|
||||
check_ra = ISC_TRUE;
|
||||
check_ra = true;
|
||||
|
||||
/* setup dighost callbacks */
|
||||
dighost_printmessage = printmessage;
|
||||
@@ -990,7 +990,7 @@ main(int argc, char **argv) {
|
||||
setup_libs();
|
||||
progname = argv[0];
|
||||
|
||||
setup_system(ISC_FALSE, ISC_FALSE);
|
||||
setup_system(false, false);
|
||||
parse_args(argc, argv);
|
||||
if (keyfile[0] != 0)
|
||||
setup_file_key();
|
||||
@@ -1004,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 = ISC_TF(!in_use);
|
||||
in_use = !in_use;
|
||||
|
||||
(void)isc_app_run();
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dighost.lib;libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;@IDN_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dighost.lib;libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;@IDN_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -98,7 +98,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dighost.lib;libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;@IDN_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dighost.lib;libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;@IDN_LIB@ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dighost.lib;@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dighost.lib;@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -98,7 +98,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dighost.lib;@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dighost.lib;@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@READLINE_LIBD@@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@@READLINE_LIBD@@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -98,7 +98,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@READLINE_LIB@@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@@READLINE_LIB@@IDN_LIB@libisc.lib;libisccfg.lib;libirs.lib;libdns.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -115,12 +115,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}; done
|
||||
for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8; done
|
||||
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
|
||||
|
||||
uninstall::
|
||||
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
|
||||
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
|
||||
|
||||
clean distclean::
|
||||
rm -f ${TARGETS}
|
||||
|
||||
+50
-53
@@ -19,6 +19,8 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
@@ -60,7 +62,7 @@
|
||||
#include "dnssectool.h"
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024 /* AIX, WIN32, and others don't define this. */
|
||||
#define PATH_MAX 1024 /* WIN32, and others don't define this. */
|
||||
#endif
|
||||
|
||||
const char *program = "dnssec-cds";
|
||||
@@ -84,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 isc_uint8_t dtype[8];
|
||||
static uint8_t dtype[8];
|
||||
|
||||
static const char *startstr = NULL; /* from which we derive notbefore */
|
||||
static isc_stdtime_t notbefore = 0; /* restrict sig inception times */
|
||||
@@ -127,7 +129,7 @@ static int nkey; /* number of child zone DNSKEY records */
|
||||
typedef struct keyinfo {
|
||||
dns_rdata_t rdata;
|
||||
dst_key_t *dst;
|
||||
isc_uint8_t algo;
|
||||
uint8_t algo;
|
||||
dns_keytag_t tag;
|
||||
} keyinfo_t;
|
||||
|
||||
@@ -258,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, ISC_FALSE, nodep);
|
||||
result = dns_db_findnode(*dbp, name, false, nodep);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("can't find %s node in %s", namestr, filename);
|
||||
}
|
||||
@@ -312,7 +314,7 @@ get_dsset_name(char *filename, size_t size,
|
||||
}
|
||||
isc_buffer_putstr(&buf, prefix);
|
||||
|
||||
result = dns_name_tofilenametext(name, ISC_FALSE, &buf);
|
||||
result = dns_name_tofilenametext(name, false, &buf);
|
||||
check_result(result, "dns_name_tofilenametext()");
|
||||
if (isc_buffer_availablelength(&buf) == 0) {
|
||||
fatal("%s: pathname too long", path);
|
||||
@@ -381,8 +383,7 @@ formatset(dns_rdataset_t *rdataset) {
|
||||
mctx);
|
||||
check_result(result, "dns_master_stylecreate2 failed");
|
||||
|
||||
result = isc_buffer_allocate(mctx, &buf, MAX_CDS_RDATA_TEXT_SIZE);
|
||||
check_result(result, "printing DS records");
|
||||
isc_buffer_allocate(mctx, &buf, MAX_CDS_RDATA_TEXT_SIZE);
|
||||
result = dns_master_rdatasettotext(name, rdataset, style, buf);
|
||||
|
||||
if ((result == ISC_R_SUCCESS) && isc_buffer_availablelength(buf) < 1) {
|
||||
@@ -400,7 +401,7 @@ formatset(dns_rdataset_t *rdataset) {
|
||||
|
||||
static void
|
||||
write_parent_set(const char *path, const char *inplace,
|
||||
isc_boolean_t nsupdate, dns_rdataset_t *rdataset)
|
||||
bool nsupdate, dns_rdataset_t *rdataset)
|
||||
{
|
||||
isc_result_t result;
|
||||
isc_buffer_t *buf = NULL;
|
||||
@@ -467,7 +468,7 @@ typedef enum { LOOSE, TIGHT } strictness_t;
|
||||
/*
|
||||
* Find out if any (C)DS record matches a particular (C)DNSKEY.
|
||||
*/
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
|
||||
{
|
||||
isc_result_t result;
|
||||
@@ -481,7 +482,7 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
|
||||
dns_rdata_t dsrdata = DNS_RDATA_INIT;
|
||||
dns_rdata_t newdsrdata = DNS_RDATA_INIT;
|
||||
dns_rdatatype_t keytype;
|
||||
isc_boolean_t c;
|
||||
bool c;
|
||||
|
||||
dns_rdataset_current(dsset, &dsrdata);
|
||||
result = dns_rdata_tostruct(&dsrdata, &ds, NULL);
|
||||
@@ -511,13 +512,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 (ISC_TRUE);
|
||||
return (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 (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,7 +529,7 @@ match_key_dsset(keyinfo_t *ki, dns_rdataset_t *dsset, strictness_t strictness)
|
||||
? "CDNSKEY" : "DNSKEY",
|
||||
ki->tag, ki->algo);
|
||||
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -617,12 +618,12 @@ free_keytable(keyinfo_t **keytable_p) {
|
||||
* otherwise the key algorithm. This is used by the signature coverage
|
||||
* check functions below.
|
||||
*/
|
||||
static isc_uint8_t *
|
||||
static uint8_t *
|
||||
matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigset)
|
||||
{
|
||||
isc_result_t result;
|
||||
isc_uint8_t *algo;
|
||||
uint8_t *algo;
|
||||
int i;
|
||||
|
||||
algo = isc_mem_get(mctx, nkey);
|
||||
@@ -668,7 +669,7 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
|
||||
}
|
||||
|
||||
result = dns_dnssec_verify(name, rdataset, ki->dst,
|
||||
ISC_FALSE, 0, mctx,
|
||||
false, 0, mctx,
|
||||
&sigrdata, NULL);
|
||||
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
@@ -704,13 +705,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 isc_boolean_t
|
||||
signed_loose(isc_uint8_t *algo) {
|
||||
isc_boolean_t ok = ISC_FALSE;
|
||||
static bool
|
||||
signed_loose(uint8_t *algo) {
|
||||
bool ok = false;
|
||||
int i;
|
||||
for (i = 0; i < nkey; i++) {
|
||||
if (algo[i] != 0) {
|
||||
ok = ISC_TRUE;
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
isc_mem_put(mctx, algo, nkey);
|
||||
@@ -723,10 +724,10 @@ signed_loose(isc_uint8_t *algo) {
|
||||
* key algorithm in the DS RRset must have a signature in the DNSKEY
|
||||
* RRset.
|
||||
*/
|
||||
static isc_boolean_t
|
||||
signed_strict(dns_rdataset_t *dsset, isc_uint8_t *algo) {
|
||||
static bool
|
||||
signed_strict(dns_rdataset_t *dsset, uint8_t *algo) {
|
||||
isc_result_t result;
|
||||
isc_boolean_t all_ok = ISC_TRUE;
|
||||
bool all_ok = true;
|
||||
|
||||
for (result = dns_rdataset_first(dsset);
|
||||
result == ISC_R_SUCCESS;
|
||||
@@ -734,23 +735,23 @@ signed_strict(dns_rdataset_t *dsset, isc_uint8_t *algo) {
|
||||
{
|
||||
dns_rdata_t dsrdata = DNS_RDATA_INIT;
|
||||
dns_rdata_ds_t ds;
|
||||
isc_boolean_t ds_ok;
|
||||
bool 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 = ISC_FALSE;
|
||||
ds_ok = false;
|
||||
for (i = 0; i < nkey; i++) {
|
||||
if (algo[i] == ds.algorithm) {
|
||||
ds_ok = ISC_TRUE;
|
||||
ds_ok = true;
|
||||
}
|
||||
}
|
||||
if (!ds_ok) {
|
||||
vbprintf(0, "missing signature for algorithm %d "
|
||||
"(key %d)\n", ds.algorithm, ds.key_tag);
|
||||
all_ok = ISC_FALSE;
|
||||
all_ok = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -848,14 +849,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 isc_uint8_t *)ap;
|
||||
int b = *(const isc_uint8_t *)bp;
|
||||
int a = *(const uint8_t *)ap;
|
||||
int b = *(const uint8_t *)bp;
|
||||
return (a - b);
|
||||
}
|
||||
|
||||
static void
|
||||
add_dtype(const char *dn) {
|
||||
isc_uint8_t dt;
|
||||
uint8_t dt;
|
||||
unsigned i, n;
|
||||
|
||||
dt = strtodsdigest(dn);
|
||||
@@ -872,7 +873,7 @@ add_dtype(const char *dn) {
|
||||
|
||||
static void
|
||||
make_new_ds_set(ds_maker_func_t *ds_from_rdata,
|
||||
isc_uint32_t ttl, dns_rdataset_t *rdset)
|
||||
uint32_t ttl, dns_rdataset_t *rdset)
|
||||
{
|
||||
unsigned int size = 16;
|
||||
for (;;) {
|
||||
@@ -894,8 +895,7 @@ make_new_ds_set(ds_maker_func_t *ds_from_rdata,
|
||||
result = dns_rdatalist_tordataset(dslist, &new_ds_set);
|
||||
check_result(result, "dns_rdatalist_tordataset(dslist)");
|
||||
|
||||
result = isc_buffer_allocate(mctx, &new_ds_buf, size);
|
||||
check_result(result, "building new DS records");
|
||||
isc_buffer_allocate(mctx, &new_ds_buf, size);
|
||||
|
||||
for (result = dns_rdataset_first(rdset);
|
||||
result == ISC_R_SUCCESS;
|
||||
@@ -934,14 +934,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 isc_boolean_t
|
||||
static bool
|
||||
consistent_digests(dns_rdataset_t *dsset) {
|
||||
isc_result_t result;
|
||||
dns_rdata_t *arrdata;
|
||||
dns_rdata_ds_t *ds;
|
||||
dns_keytag_t key_tag;
|
||||
isc_uint8_t algorithm;
|
||||
isc_boolean_t match;
|
||||
uint8_t algorithm;
|
||||
bool match;
|
||||
int i, j, n, d;
|
||||
|
||||
/*
|
||||
@@ -995,7 +995,7 @@ consistent_digests(dns_rdataset_t *dsset) {
|
||||
/*
|
||||
* Check subsequent keys match the first one
|
||||
*/
|
||||
match = ISC_TRUE;
|
||||
match = true;
|
||||
while (i < n) {
|
||||
key_tag = ds[i].key_tag;
|
||||
algorithm = ds[i].algorithm;
|
||||
@@ -1004,7 +1004,7 @@ consistent_digests(dns_rdataset_t *dsset) {
|
||||
ds[i+j].algorithm != algorithm ||
|
||||
ds[i+j].digest_type != ds[j].digest_type)
|
||||
{
|
||||
match = ISC_FALSE;
|
||||
match = false;
|
||||
}
|
||||
}
|
||||
i += d;
|
||||
@@ -1039,7 +1039,7 @@ print_diff(const char *cmd, dns_rdataset_t *rdataset) {
|
||||
}
|
||||
|
||||
static void
|
||||
update_diff(const char *cmd, isc_uint32_t ttl,
|
||||
update_diff(const char *cmd, uint32_t ttl,
|
||||
dns_rdataset_t *addset, dns_rdataset_t *delset)
|
||||
{
|
||||
isc_result_t result;
|
||||
@@ -1047,7 +1047,7 @@ update_diff(const char *cmd, isc_uint32_t ttl,
|
||||
dns_dbnode_t *node;
|
||||
dns_dbversion_t *ver;
|
||||
dns_rdataset_t diffset;
|
||||
isc_uint32_t save;
|
||||
uint32_t save;
|
||||
|
||||
db = NULL;
|
||||
result = dns_db_create(mctx, "rbt", name, dns_dbtype_zone,
|
||||
@@ -1059,7 +1059,7 @@ update_diff(const char *cmd, isc_uint32_t ttl,
|
||||
check_result(result, "dns_db_newversion()");
|
||||
|
||||
node = NULL;
|
||||
result = dns_db_findnode(db, name, ISC_TRUE, &node);
|
||||
result = dns_db_findnode(db, name, true, &node);
|
||||
check_result(result, "dns_db_findnode()");
|
||||
|
||||
dns_rdataset_init(&diffset);
|
||||
@@ -1083,12 +1083,12 @@ update_diff(const char *cmd, isc_uint32_t ttl,
|
||||
}
|
||||
|
||||
dns_db_detachnode(db, &node);
|
||||
dns_db_closeversion(db, &ver, ISC_FALSE);
|
||||
dns_db_closeversion(db, &ver, false);
|
||||
dns_db_detach(&db);
|
||||
}
|
||||
|
||||
static void
|
||||
nsdiff(isc_uint32_t ttl, dns_rdataset_t *oldset, dns_rdataset_t *newset) {
|
||||
nsdiff(uint32_t ttl, dns_rdataset_t *oldset, dns_rdataset_t *newset) {
|
||||
if (ttl == 0) {
|
||||
vbprintf(1, "warning: no TTL in nsupdate script\n");
|
||||
}
|
||||
@@ -1136,23 +1136,20 @@ main(int argc, char *argv[]) {
|
||||
const char *ds_path = NULL;
|
||||
const char *inplace = NULL;
|
||||
isc_result_t result;
|
||||
isc_boolean_t prefer_cdnskey = ISC_FALSE;
|
||||
isc_boolean_t nsupdate = ISC_FALSE;
|
||||
isc_uint32_t ttl = 0;
|
||||
bool prefer_cdnskey = false;
|
||||
bool nsupdate = false;
|
||||
uint32_t ttl = 0;
|
||||
int ch;
|
||||
char *endp;
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("out of memory");
|
||||
}
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
#if USE_PKCS11
|
||||
pk11_result_register();
|
||||
#endif
|
||||
dns_result_register();
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
#define OPTIONS "a:c:Dd:f:i:ms:T:uv:V"
|
||||
while ((ch = isc_commandline_parse(argc, argv, OPTIONS)) != -1) {
|
||||
@@ -1164,7 +1161,7 @@ main(int argc, char *argv[]) {
|
||||
rdclass = strtoclass(isc_commandline_argument);
|
||||
break;
|
||||
case 'D':
|
||||
prefer_cdnskey = ISC_TRUE;
|
||||
prefer_cdnskey = true;
|
||||
break;
|
||||
case 'd':
|
||||
ds_path = isc_commandline_argument;
|
||||
@@ -1197,7 +1194,7 @@ main(int argc, char *argv[]) {
|
||||
ttl = strtottl(isc_commandline_argument);
|
||||
break;
|
||||
case 'u':
|
||||
nsupdate = ISC_TRUE;
|
||||
nsupdate = true;
|
||||
break;
|
||||
case 'V':
|
||||
/* Does not return. */
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
@@ -48,7 +50,7 @@
|
||||
#include "dnssectool.h"
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024 /* AIX, WIN32, and others don't define this. */
|
||||
#define PATH_MAX 1024 /* WIN32, and others don't define this. */
|
||||
#endif
|
||||
|
||||
const char *program = "dnssec-dsfromkey";
|
||||
@@ -58,8 +60,8 @@ static dns_rdataclass_t rdclass;
|
||||
static dns_fixedname_t fixed;
|
||||
static dns_name_t *name = NULL;
|
||||
static isc_mem_t *mctx = NULL;
|
||||
static isc_uint32_t ttl;
|
||||
static isc_boolean_t emitttl = ISC_FALSE;
|
||||
static uint32_t ttl;
|
||||
static bool emitttl = false;
|
||||
|
||||
static isc_result_t
|
||||
initname(char *setname) {
|
||||
@@ -118,7 +120,7 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
|
||||
isc_result_totext(result));
|
||||
}
|
||||
|
||||
result = dns_db_findnode(db, name, ISC_FALSE, &node);
|
||||
result = dns_db_findnode(db, name, false, &node);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("can't find %s node in %s", setname, filename);
|
||||
|
||||
@@ -159,7 +161,7 @@ loadkeyset(char *dirname, dns_rdataset_t *rdataset) {
|
||||
return (ISC_R_NOSPACE);
|
||||
isc_buffer_putstr(&buf, "keyset-");
|
||||
|
||||
result = dns_name_tofilenametext(name, ISC_FALSE, &buf);
|
||||
result = dns_name_tofilenametext(name, false, &buf);
|
||||
check_result(result, "dns_name_tofilenametext()");
|
||||
if (isc_buffer_availablelength(&buf) == 0)
|
||||
return (ISC_R_NOSPACE);
|
||||
@@ -233,8 +235,8 @@ logkey(dns_rdata_t *rdata)
|
||||
}
|
||||
|
||||
static void
|
||||
emit(unsigned int dtype, isc_boolean_t showall, char *lookaside,
|
||||
isc_boolean_t cds, dns_rdata_t *rdata)
|
||||
emit(unsigned int dtype, bool showall, char *lookaside,
|
||||
bool cds, dns_rdata_t *rdata)
|
||||
{
|
||||
isc_result_t result;
|
||||
unsigned char buf[DNS_DS_BUFFERSIZE];
|
||||
@@ -263,7 +265,7 @@ emit(unsigned int dtype, isc_boolean_t showall, char *lookaside,
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("can't build record");
|
||||
|
||||
result = dns_name_totext(name, ISC_FALSE, &nameb);
|
||||
result = dns_name_totext(name, false, &nameb);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("can't print name");
|
||||
|
||||
@@ -352,10 +354,10 @@ main(int argc, char **argv) {
|
||||
char *endp;
|
||||
int ch;
|
||||
unsigned int dtype = DNS_DSDIGEST_SHA1;
|
||||
isc_boolean_t cds = ISC_FALSE;
|
||||
isc_boolean_t both = ISC_TRUE;
|
||||
isc_boolean_t usekeyset = ISC_FALSE;
|
||||
isc_boolean_t showall = ISC_FALSE;
|
||||
bool cds = false;
|
||||
bool both = true;
|
||||
bool usekeyset = false;
|
||||
bool showall = false;
|
||||
isc_result_t result;
|
||||
isc_log_t *log = NULL;
|
||||
dns_rdataset_t rdataset;
|
||||
@@ -366,7 +368,7 @@ main(int argc, char **argv) {
|
||||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("out of memory");
|
||||
|
||||
@@ -375,31 +377,31 @@ main(int argc, char **argv) {
|
||||
#endif
|
||||
dns_result_register();
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = 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 = ISC_FALSE;
|
||||
both = false;
|
||||
break;
|
||||
case '2':
|
||||
dtype = DNS_DSDIGEST_SHA256;
|
||||
both = ISC_FALSE;
|
||||
both = false;
|
||||
break;
|
||||
case 'A':
|
||||
showall = ISC_TRUE;
|
||||
showall = true;
|
||||
break;
|
||||
case 'a':
|
||||
dtype = strtodsdigest(isc_commandline_argument);
|
||||
both = ISC_FALSE;
|
||||
both = false;
|
||||
break;
|
||||
case 'C':
|
||||
if (lookaside != NULL)
|
||||
fatal("lookaside and CDS are mutually"
|
||||
" exclusive");
|
||||
cds = ISC_TRUE;
|
||||
cds = true;
|
||||
break;
|
||||
case 'c':
|
||||
classname = isc_commandline_argument;
|
||||
@@ -425,10 +427,10 @@ main(int argc, char **argv) {
|
||||
fatal("lookaside must be a non-empty string");
|
||||
break;
|
||||
case 's':
|
||||
usekeyset = ISC_TRUE;
|
||||
usekeyset = true;
|
||||
break;
|
||||
case 'T':
|
||||
emitttl = ISC_TRUE;
|
||||
emitttl = true;
|
||||
ttl = strtottl(isc_commandline_argument);
|
||||
break;
|
||||
case 'v':
|
||||
@@ -466,7 +468,7 @@ main(int argc, char **argv) {
|
||||
|
||||
/* When not using -f, -A is implicit */
|
||||
if (filename == NULL)
|
||||
showall = ISC_TRUE;
|
||||
showall = true;
|
||||
|
||||
if (argc < isc_commandline_index + 1 && filename == NULL)
|
||||
fatal("the key file name was not specified");
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
@@ -48,7 +49,7 @@
|
||||
#include "dnssectool.h"
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024 /* AIX, WIN32, and others don't define this. */
|
||||
#define PATH_MAX 1024 /* WIN32, and others don't define this. */
|
||||
#endif
|
||||
|
||||
const char *program = "dnssec-importkey";
|
||||
@@ -58,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 isc_boolean_t setpub = ISC_FALSE, setdel = ISC_FALSE;
|
||||
static isc_boolean_t setttl = ISC_FALSE;
|
||||
static bool setpub = false, setdel = false;
|
||||
static bool setttl = false;
|
||||
static isc_stdtime_t pub = 0, del = 0;
|
||||
static dns_ttl_t ttl = 0;
|
||||
static isc_stdtime_t syncadd = 0, syncdel = 0;
|
||||
static isc_boolean_t setsyncadd = ISC_FALSE;
|
||||
static isc_boolean_t setsyncdel = ISC_FALSE;
|
||||
static bool setsyncadd = false;
|
||||
static bool setsyncdel = false;
|
||||
|
||||
static isc_result_t
|
||||
initname(char *setname) {
|
||||
@@ -124,7 +125,7 @@ loadset(const char *filename, dns_rdataset_t *rdataset) {
|
||||
isc_result_totext(result));
|
||||
}
|
||||
|
||||
result = dns_db_findnode(db, name, ISC_FALSE, &node);
|
||||
result = dns_db_findnode(db, name, false, &node);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("can't find %s node in %s", setname, filename);
|
||||
|
||||
@@ -226,7 +227,7 @@ emit(const char *dir, dns_rdata_t *rdata) {
|
||||
dst_key_free(&tmp);
|
||||
}
|
||||
|
||||
dst_key_setexternal(key, ISC_TRUE);
|
||||
dst_key_setexternal(key, true);
|
||||
if (setpub)
|
||||
dst_key_settime(key, DST_TIME_PUBLISH, pub);
|
||||
if (setdel)
|
||||
@@ -306,16 +307,14 @@ main(int argc, char **argv) {
|
||||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("out of memory");
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
#if USE_PKCS11
|
||||
pk11_result_register();
|
||||
#endif
|
||||
dns_result_register();
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
#define CMDLINE_FLAGS "D:f:hK:L:P:v:V"
|
||||
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
|
||||
@@ -346,7 +345,7 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
case 'L':
|
||||
ttl = strtottl(isc_commandline_argument);
|
||||
setttl = ISC_TRUE;
|
||||
setttl = true;
|
||||
break;
|
||||
case 'P':
|
||||
/* -Psync ? */
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
@@ -127,9 +129,9 @@ main(int argc, char **argv) {
|
||||
dst_key_t *key = NULL;
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name;
|
||||
isc_uint16_t flags = 0, kskflag = 0, revflag = 0;
|
||||
uint16_t flags = 0, kskflag = 0, revflag = 0;
|
||||
dns_secalg_t alg;
|
||||
isc_boolean_t oldstyle = ISC_FALSE;
|
||||
bool oldstyle = false;
|
||||
isc_mem_t *mctx = NULL;
|
||||
int ch;
|
||||
int protocol = -1, signatory = 0;
|
||||
@@ -146,32 +148,32 @@ main(int argc, char **argv) {
|
||||
isc_stdtime_t inactive = 0, deltime = 0;
|
||||
isc_stdtime_t now;
|
||||
int prepub = -1;
|
||||
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;
|
||||
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;
|
||||
unsigned char c;
|
||||
isc_stdtime_t syncadd = 0, syncdel = 0;
|
||||
isc_boolean_t unsetsyncadd = ISC_FALSE, setsyncadd = ISC_FALSE;
|
||||
isc_boolean_t unsetsyncdel = ISC_FALSE, setsyncdel = ISC_FALSE;
|
||||
bool unsetsyncadd = false, setsyncadd = false;
|
||||
bool unsetsyncdel = false, setsyncdel = false;
|
||||
|
||||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
#if USE_PKCS11
|
||||
pk11_result_register();
|
||||
#endif
|
||||
dns_result_register();
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
@@ -179,13 +181,13 @@ main(int argc, char **argv) {
|
||||
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
|
||||
switch (ch) {
|
||||
case '3':
|
||||
use_nsec3 = ISC_TRUE;
|
||||
use_nsec3 = true;
|
||||
break;
|
||||
case 'a':
|
||||
algname = isc_commandline_argument;
|
||||
break;
|
||||
case 'C':
|
||||
oldstyle = ISC_TRUE;
|
||||
oldstyle = true;
|
||||
break;
|
||||
case 'c':
|
||||
classname = isc_commandline_argument;
|
||||
@@ -215,7 +217,7 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
case 'L':
|
||||
ttl = strtottl(isc_commandline_argument);
|
||||
setttl = ISC_TRUE;
|
||||
setttl = true;
|
||||
break;
|
||||
case 'l':
|
||||
label = isc_mem_strdup(mctx, isc_commandline_argument);
|
||||
@@ -238,10 +240,10 @@ main(int argc, char **argv) {
|
||||
fatal("-v must be followed by a number");
|
||||
break;
|
||||
case 'y':
|
||||
avoid_collisions = ISC_FALSE;
|
||||
avoid_collisions = false;
|
||||
break;
|
||||
case 'G':
|
||||
genonly = ISC_TRUE;
|
||||
genonly = true;
|
||||
break;
|
||||
case 'P':
|
||||
/* -Psync ? */
|
||||
@@ -442,14 +444,14 @@ main(int argc, char **argv) {
|
||||
"prepublication interval.");
|
||||
|
||||
if (!setpub && !setact) {
|
||||
setpub = setact = ISC_TRUE;
|
||||
setpub = setact = true;
|
||||
publish = now;
|
||||
activate = now + prepub;
|
||||
} else if (setpub && !setact) {
|
||||
setact = ISC_TRUE;
|
||||
setact = true;
|
||||
activate = publish + prepub;
|
||||
} else if (setact && !setpub) {
|
||||
setpub = ISC_TRUE;
|
||||
setpub = true;
|
||||
publish = activate - prepub;
|
||||
}
|
||||
|
||||
@@ -532,7 +534,7 @@ main(int argc, char **argv) {
|
||||
"You can use dnssec-settime -D to "
|
||||
"change this.\n", program, keystr);
|
||||
|
||||
setpub = setact = ISC_TRUE;
|
||||
setpub = setact = true;
|
||||
}
|
||||
|
||||
if (nametype == NULL) {
|
||||
|
||||
+39
-37
@@ -28,6 +28,8 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -159,9 +161,9 @@ usage(void) {
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
dsa_size_ok(int size) {
|
||||
return (ISC_TF(size >= 512 && size <= 1024 && size % 64 == 0));
|
||||
return (size >= 512 && size <= 1024 && size % 64 == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -198,10 +200,10 @@ main(int argc, char **argv) {
|
||||
dst_key_t *key = NULL;
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name;
|
||||
isc_uint16_t flags = 0, kskflag = 0, revflag = 0;
|
||||
uint16_t flags = 0, kskflag = 0, revflag = 0;
|
||||
dns_secalg_t alg;
|
||||
isc_boolean_t conflict = ISC_FALSE, null_key = ISC_FALSE;
|
||||
isc_boolean_t oldstyle = ISC_FALSE;
|
||||
bool conflict = false, null_key = false;
|
||||
bool oldstyle = false;
|
||||
isc_mem_t *mctx = NULL;
|
||||
int ch, generator = 0, param = 0;
|
||||
int protocol = -1, size = -1, signatory = 0;
|
||||
@@ -218,24 +220,24 @@ main(int argc, char **argv) {
|
||||
int options = DST_TYPE_PRIVATE | DST_TYPE_PUBLIC;
|
||||
int dbits = 0;
|
||||
dns_ttl_t ttl = 0;
|
||||
isc_boolean_t use_nsec3 = ISC_FALSE;
|
||||
bool use_nsec3 = false;
|
||||
isc_stdtime_t publish = 0, activate = 0, revokekey = 0;
|
||||
isc_stdtime_t inactive = 0, deltime = 0;
|
||||
isc_stdtime_t now;
|
||||
int prepub = -1;
|
||||
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;
|
||||
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;
|
||||
unsigned char c;
|
||||
isc_stdtime_t syncadd = 0, syncdel = 0;
|
||||
isc_boolean_t setsyncadd = ISC_FALSE;
|
||||
isc_boolean_t setsyncdel = ISC_FALSE;
|
||||
bool setsyncadd = false;
|
||||
bool setsyncdel = false;
|
||||
|
||||
if (argc == 1)
|
||||
usage();
|
||||
@@ -245,7 +247,7 @@ main(int argc, char **argv) {
|
||||
#endif
|
||||
dns_result_register();
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
/*
|
||||
* Process memory debugging argument first.
|
||||
@@ -270,16 +272,16 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
isc_commandline_reset = ISC_TRUE;
|
||||
isc_commandline_reset = true;
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
|
||||
switch (ch) {
|
||||
case '3':
|
||||
use_nsec3 = ISC_TRUE;
|
||||
use_nsec3 = true;
|
||||
break;
|
||||
case 'a':
|
||||
algname = isc_commandline_argument;
|
||||
@@ -290,7 +292,7 @@ main(int argc, char **argv) {
|
||||
fatal("-b requires a non-negative number");
|
||||
break;
|
||||
case 'C':
|
||||
oldstyle = ISC_TRUE;
|
||||
oldstyle = true;
|
||||
break;
|
||||
case 'c':
|
||||
classname = isc_commandline_argument;
|
||||
@@ -306,7 +308,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]);
|
||||
@@ -338,7 +340,7 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
case 'L':
|
||||
ttl = strtottl(isc_commandline_argument);
|
||||
setttl = ISC_TRUE;
|
||||
setttl = true;
|
||||
break;
|
||||
case 'n':
|
||||
nametype = isc_commandline_argument;
|
||||
@@ -352,7 +354,7 @@ main(int argc, char **argv) {
|
||||
"[0..255]");
|
||||
break;
|
||||
case 'q':
|
||||
quiet = ISC_TRUE;
|
||||
quiet = true;
|
||||
break;
|
||||
case 'r':
|
||||
fatal("The -r option has been deprecated.\n"
|
||||
@@ -389,7 +391,7 @@ main(int argc, char **argv) {
|
||||
/* already the default */
|
||||
break;
|
||||
case 'G':
|
||||
genonly = ISC_TRUE;
|
||||
genonly = true;
|
||||
break;
|
||||
case 'P':
|
||||
/* -Psync ? */
|
||||
@@ -483,7 +485,7 @@ main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (!isatty(0))
|
||||
quiet = ISC_TRUE;
|
||||
quiet = true;
|
||||
|
||||
ret = dst_lib_init(mctx, engine);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
@@ -614,14 +616,14 @@ main(int argc, char **argv) {
|
||||
"prepublication interval.");
|
||||
|
||||
if (!setpub && !setact) {
|
||||
setpub = setact = ISC_TRUE;
|
||||
setpub = setact = true;
|
||||
publish = now;
|
||||
activate = now + prepub;
|
||||
} else if (setpub && !setact) {
|
||||
setact = ISC_TRUE;
|
||||
setact = true;
|
||||
activate = publish + prepub;
|
||||
} else if (setact && !setpub) {
|
||||
setpub = ISC_TRUE;
|
||||
setpub = true;
|
||||
publish = activate - prepub;
|
||||
}
|
||||
|
||||
@@ -707,7 +709,7 @@ main(int argc, char **argv) {
|
||||
"You can use dnssec-settime -D to "
|
||||
"change this.\n", program, keystr);
|
||||
|
||||
setpub = setact = ISC_TRUE;
|
||||
setpub = setact = true;
|
||||
}
|
||||
|
||||
switch (alg) {
|
||||
@@ -806,7 +808,7 @@ main(int argc, char **argv) {
|
||||
case DNS_KEYALG_NSEC3RSASHA1:
|
||||
case DNS_KEYALG_RSASHA256:
|
||||
case DNS_KEYALG_RSASHA512:
|
||||
show_progress = ISC_TRUE;
|
||||
show_progress = true;
|
||||
break;
|
||||
|
||||
case DNS_KEYALG_DH:
|
||||
@@ -820,17 +822,17 @@ main(int argc, char **argv) {
|
||||
case DST_ALG_ECDSA384:
|
||||
case DST_ALG_ED25519:
|
||||
case DST_ALG_ED448:
|
||||
show_progress = ISC_TRUE;
|
||||
show_progress = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((flags & DNS_KEYFLAG_TYPEMASK) == DNS_KEYTYPE_NOKEY)
|
||||
null_key = ISC_TRUE;
|
||||
null_key = true;
|
||||
|
||||
isc_buffer_init(&buf, filename, sizeof(filename) - 1);
|
||||
|
||||
do {
|
||||
conflict = ISC_FALSE;
|
||||
conflict = false;
|
||||
|
||||
if (!quiet && show_progress) {
|
||||
fprintf(stderr, "Generating key pair.");
|
||||
@@ -951,7 +953,7 @@ main(int argc, char **argv) {
|
||||
* or another key being revoked.
|
||||
*/
|
||||
if (key_collision(key, name, directory, mctx, NULL)) {
|
||||
conflict = ISC_TRUE;
|
||||
conflict = true;
|
||||
if (null_key) {
|
||||
dst_key_free(&key);
|
||||
break;
|
||||
@@ -972,7 +974,7 @@ main(int argc, char **argv) {
|
||||
|
||||
dst_key_free(&key);
|
||||
}
|
||||
} while (conflict == ISC_TRUE);
|
||||
} while (conflict == true);
|
||||
|
||||
if (conflict)
|
||||
fatal("cannot generate a null key due to possible key ID "
|
||||
|
||||
+11
-11
@@ -13,6 +13,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -80,25 +82,23 @@ main(int argc, char **argv) {
|
||||
char *endp;
|
||||
int ch;
|
||||
dst_key_t *key = NULL;
|
||||
isc_uint32_t flags;
|
||||
uint32_t flags;
|
||||
isc_buffer_t buf;
|
||||
isc_boolean_t force = ISC_FALSE;
|
||||
isc_boolean_t removefile = ISC_FALSE;
|
||||
isc_boolean_t id = ISC_FALSE;
|
||||
bool force = false;
|
||||
bool removefile = false;
|
||||
bool id = false;
|
||||
|
||||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("Out of memory");
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
#if HAVE_PKCS11
|
||||
pk11_result_register();
|
||||
#endif
|
||||
dns_result_register();
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv, "E:fK:rRhv:V")) != -1) {
|
||||
switch (ch) {
|
||||
@@ -106,7 +106,7 @@ main(int argc, char **argv) {
|
||||
engine = isc_commandline_argument;
|
||||
break;
|
||||
case 'f':
|
||||
force = ISC_TRUE;
|
||||
force = true;
|
||||
break;
|
||||
case 'K':
|
||||
/*
|
||||
@@ -120,10 +120,10 @@ main(int argc, char **argv) {
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
removefile = ISC_TRUE;
|
||||
removefile = true;
|
||||
break;
|
||||
case 'R':
|
||||
id = ISC_TRUE;
|
||||
id = true;
|
||||
break;
|
||||
case 'v':
|
||||
verbose = strtol(isc_commandline_argument, &endp, 0);
|
||||
|
||||
+52
-52
@@ -13,6 +13,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
@@ -102,7 +104,7 @@ usage(void) {
|
||||
}
|
||||
|
||||
static void
|
||||
printtime(dst_key_t *key, int type, const char *tag, isc_boolean_t epoch,
|
||||
printtime(dst_key_t *key, int type, const char *tag, bool epoch,
|
||||
FILE *stream)
|
||||
{
|
||||
isc_result_t result;
|
||||
@@ -141,36 +143,34 @@ main(int argc, char **argv) {
|
||||
dns_name_t *name = NULL;
|
||||
dns_secalg_t alg = 0;
|
||||
unsigned int size = 0;
|
||||
isc_uint16_t flags = 0;
|
||||
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;
|
||||
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;
|
||||
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_log_t *log = NULL;
|
||||
isc_stdtime_t syncadd = 0, syncdel = 0;
|
||||
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;
|
||||
bool unsetsyncadd = false, setsyncadd = false;
|
||||
bool unsetsyncdel = false, setsyncdel = false;
|
||||
bool printsyncadd = false, printsyncdel = false;
|
||||
|
||||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("Out of memory");
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
setup_logging(mctx, &log);
|
||||
|
||||
@@ -179,7 +179,7 @@ main(int argc, char **argv) {
|
||||
#endif
|
||||
dns_result_register();
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
@@ -190,51 +190,51 @@ main(int argc, char **argv) {
|
||||
engine = isc_commandline_argument;
|
||||
break;
|
||||
case 'f':
|
||||
force = ISC_TRUE;
|
||||
force = true;
|
||||
break;
|
||||
case 'p':
|
||||
p = isc_commandline_argument;
|
||||
if (!strcasecmp(p, "all")) {
|
||||
printcreate = ISC_TRUE;
|
||||
printpub = ISC_TRUE;
|
||||
printact = ISC_TRUE;
|
||||
printrev = ISC_TRUE;
|
||||
printinact = ISC_TRUE;
|
||||
printdel = ISC_TRUE;
|
||||
printsyncadd = ISC_TRUE;
|
||||
printsyncdel = ISC_TRUE;
|
||||
printcreate = true;
|
||||
printpub = true;
|
||||
printact = true;
|
||||
printrev = true;
|
||||
printinact = true;
|
||||
printdel = true;
|
||||
printsyncadd = true;
|
||||
printsyncdel = true;
|
||||
break;
|
||||
}
|
||||
|
||||
do {
|
||||
switch (*p++) {
|
||||
case 'C':
|
||||
printcreate = ISC_TRUE;
|
||||
printcreate = true;
|
||||
break;
|
||||
case 'P':
|
||||
if (!strncmp(p, "sync", 4)) {
|
||||
p += 4;
|
||||
printsyncadd = ISC_TRUE;
|
||||
printsyncadd = true;
|
||||
break;
|
||||
}
|
||||
printpub = ISC_TRUE;
|
||||
printpub = true;
|
||||
break;
|
||||
case 'A':
|
||||
printact = ISC_TRUE;
|
||||
printact = true;
|
||||
break;
|
||||
case 'R':
|
||||
printrev = ISC_TRUE;
|
||||
printrev = true;
|
||||
break;
|
||||
case 'I':
|
||||
printinact = ISC_TRUE;
|
||||
printinact = true;
|
||||
break;
|
||||
case 'D':
|
||||
if (!strncmp(p, "sync", 4)) {
|
||||
p += 4;
|
||||
printsyncdel = ISC_TRUE;
|
||||
printsyncdel = true;
|
||||
break;
|
||||
}
|
||||
printdel = ISC_TRUE;
|
||||
printdel = true;
|
||||
break;
|
||||
case ' ':
|
||||
break;
|
||||
@@ -245,7 +245,7 @@ main(int argc, char **argv) {
|
||||
} while (*p != '\0');
|
||||
break;
|
||||
case 'u':
|
||||
epoch = ISC_TRUE;
|
||||
epoch = true;
|
||||
break;
|
||||
case 'K':
|
||||
/*
|
||||
@@ -261,7 +261,7 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
case 'L':
|
||||
ttl = strtottl(isc_commandline_argument);
|
||||
setttl = ISC_TRUE;
|
||||
setttl = true;
|
||||
break;
|
||||
case 'v':
|
||||
verbose = strtol(isc_commandline_argument, &endp, 0);
|
||||
@@ -275,7 +275,7 @@ main(int argc, char **argv) {
|
||||
fatal("-P sync specified more than "
|
||||
"once");
|
||||
|
||||
changed = ISC_TRUE;
|
||||
changed = true;
|
||||
syncadd = strtotime(isc_commandline_argument,
|
||||
now, now, &setsyncadd);
|
||||
unsetsyncadd = !setsyncadd;
|
||||
@@ -285,7 +285,7 @@ main(int argc, char **argv) {
|
||||
if (setpub || unsetpub)
|
||||
fatal("-P specified more than once");
|
||||
|
||||
changed = ISC_TRUE;
|
||||
changed = true;
|
||||
pub = strtotime(isc_commandline_argument,
|
||||
now, now, &setpub);
|
||||
unsetpub = !setpub;
|
||||
@@ -294,7 +294,7 @@ main(int argc, char **argv) {
|
||||
if (setact || unsetact)
|
||||
fatal("-A specified more than once");
|
||||
|
||||
changed = ISC_TRUE;
|
||||
changed = true;
|
||||
act = strtotime(isc_commandline_argument,
|
||||
now, now, &setact);
|
||||
unsetact = !setact;
|
||||
@@ -303,7 +303,7 @@ main(int argc, char **argv) {
|
||||
if (setrev || unsetrev)
|
||||
fatal("-R specified more than once");
|
||||
|
||||
changed = ISC_TRUE;
|
||||
changed = true;
|
||||
rev = strtotime(isc_commandline_argument,
|
||||
now, now, &setrev);
|
||||
unsetrev = !setrev;
|
||||
@@ -312,7 +312,7 @@ main(int argc, char **argv) {
|
||||
if (setinact || unsetinact)
|
||||
fatal("-I specified more than once");
|
||||
|
||||
changed = ISC_TRUE;
|
||||
changed = true;
|
||||
inact = strtotime(isc_commandline_argument,
|
||||
now, now, &setinact);
|
||||
unsetinact = !setinact;
|
||||
@@ -324,7 +324,7 @@ main(int argc, char **argv) {
|
||||
fatal("-D sync specified more than "
|
||||
"once");
|
||||
|
||||
changed = ISC_TRUE;
|
||||
changed = true;
|
||||
syncdel = strtotime(isc_commandline_argument,
|
||||
now, now, &setsyncdel);
|
||||
unsetsyncdel = !setsyncdel;
|
||||
@@ -335,7 +335,7 @@ main(int argc, char **argv) {
|
||||
if (setdel || unsetdel)
|
||||
fatal("-D specified more than once");
|
||||
|
||||
changed = ISC_TRUE;
|
||||
changed = true;
|
||||
del = strtotime(isc_commandline_argument,
|
||||
now, now, &setdel);
|
||||
unsetdel = !setdel;
|
||||
@@ -446,7 +446,7 @@ main(int argc, char **argv) {
|
||||
"before it is scheduled to be "
|
||||
"inactive.\n", program);
|
||||
|
||||
changed = setpub = setact = ISC_TRUE;
|
||||
changed = setpub = setact = true;
|
||||
} else {
|
||||
if (prepub < 0)
|
||||
prepub = 0;
|
||||
@@ -458,10 +458,10 @@ main(int argc, char **argv) {
|
||||
"prepublication interval.");
|
||||
|
||||
if (setpub && !setact) {
|
||||
setact = ISC_TRUE;
|
||||
setact = true;
|
||||
act = pub + prepub;
|
||||
} else if (setact && !setpub) {
|
||||
setpub = ISC_TRUE;
|
||||
setpub = true;
|
||||
pub = act - prepub;
|
||||
}
|
||||
|
||||
@@ -592,11 +592,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 = ISC_TRUE;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!changed && setttl)
|
||||
changed = ISC_TRUE;
|
||||
changed = true;
|
||||
|
||||
/*
|
||||
* Print out time values, if -p was used.
|
||||
|
||||
+217
-222
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -31,7 +32,6 @@
|
||||
#include <isc/rwlock.h>
|
||||
#include <isc/serial.h>
|
||||
#include <isc/stdio.h>
|
||||
#include <isc/stdlib.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/time.h>
|
||||
#include <isc/util.h>
|
||||
@@ -78,8 +78,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 isc_boolean_t ignore_kskflag = ISC_FALSE;
|
||||
static isc_boolean_t keyset_kskonly = ISC_FALSE;
|
||||
static bool ignore_kskflag = false;
|
||||
static bool keyset_kskonly = false;
|
||||
|
||||
/*%
|
||||
* Load the zone file from disk
|
||||
@@ -198,19 +198,17 @@ main(int argc, char *argv[]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
isc_commandline_reset = ISC_TRUE;
|
||||
isc_commandline_reset = true;
|
||||
check_result(isc_app_start(), "isc_app_start");
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("out of memory");
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
#if USE_PKCS11
|
||||
pk11_result_register();
|
||||
#endif
|
||||
dns_result_register();
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
|
||||
switch (ch) {
|
||||
@@ -241,11 +239,11 @@ main(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
keyset_kskonly = ISC_TRUE;
|
||||
keyset_kskonly = true;
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
ignore_kskflag = ISC_TRUE;
|
||||
ignore_kskflag = true;
|
||||
break;
|
||||
|
||||
case '?':
|
||||
@@ -319,7 +317,7 @@ main(int argc, char *argv[]) {
|
||||
result = dns_zoneverify_dnssec(NULL, gdb, gversion, gorigin, NULL,
|
||||
mctx, ignore_kskflag, keyset_kskonly);
|
||||
|
||||
dns_db_closeversion(gdb, &gversion, ISC_FALSE);
|
||||
dns_db_closeversion(gdb, &gversion, false);
|
||||
dns_db_detach(&gdb);
|
||||
|
||||
cleanup_logging(&log);
|
||||
|
||||
+24
-22
@@ -17,6 +17,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -221,10 +223,10 @@ time_units(isc_stdtime_t offset, char *suffix, const char *str) {
|
||||
return(0); /* silence compiler warning */
|
||||
}
|
||||
|
||||
static inline isc_boolean_t
|
||||
static inline bool
|
||||
isnone(const char *str) {
|
||||
return (ISC_TF((strcasecmp(str, "none") == 0) ||
|
||||
(strcasecmp(str, "never") == 0)));
|
||||
return ((strcasecmp(str, "none") == 0) ||
|
||||
(strcasecmp(str, "never") == 0));
|
||||
}
|
||||
|
||||
dns_ttl_t
|
||||
@@ -244,10 +246,10 @@ strtottl(const char *str) {
|
||||
}
|
||||
|
||||
isc_stdtime_t
|
||||
strtotime(const char *str, isc_int64_t now, isc_int64_t base,
|
||||
isc_boolean_t *setp)
|
||||
strtotime(const char *str, int64_t now, int64_t base,
|
||||
bool *setp)
|
||||
{
|
||||
isc_int64_t val, offset;
|
||||
int64_t val, offset;
|
||||
isc_result_t result;
|
||||
const char *orig = str;
|
||||
char *endp;
|
||||
@@ -255,12 +257,12 @@ strtotime(const char *str, isc_int64_t now, isc_int64_t base,
|
||||
|
||||
if (isnone(str)) {
|
||||
if (setp != NULL)
|
||||
*setp = ISC_FALSE;
|
||||
*setp = false;
|
||||
return ((isc_stdtime_t) 0);
|
||||
}
|
||||
|
||||
if (setp != NULL)
|
||||
*setp = ISC_TRUE;
|
||||
*setp = true;
|
||||
|
||||
if ((str[0] == '0' || str[0] == '-') && str[1] == '\0')
|
||||
return ((isc_stdtime_t) 0);
|
||||
@@ -397,23 +399,23 @@ set_keyversion(dst_key_t *key) {
|
||||
}
|
||||
}
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
||||
isc_mem_t *mctx, isc_boolean_t *exact)
|
||||
isc_mem_t *mctx, bool *exact)
|
||||
{
|
||||
isc_result_t result;
|
||||
isc_boolean_t conflict = ISC_FALSE;
|
||||
bool conflict = false;
|
||||
dns_dnsseckeylist_t matchkeys;
|
||||
dns_dnsseckey_t *key = NULL;
|
||||
isc_uint16_t id, oldid;
|
||||
isc_uint32_t rid, roldid;
|
||||
uint16_t id, oldid;
|
||||
uint32_t rid, roldid;
|
||||
dns_secalg_t alg;
|
||||
char filename[ISC_DIR_NAMEMAX];
|
||||
char filename[NAME_MAX];
|
||||
isc_buffer_t fileb;
|
||||
isc_stdtime_t now;
|
||||
|
||||
if (exact != NULL)
|
||||
*exact = ISC_FALSE;
|
||||
*exact = false;
|
||||
|
||||
id = dst_key_id(dstkey);
|
||||
rid = dst_key_rid(dstkey);
|
||||
@@ -429,7 +431,7 @@ 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 (ISC_TRUE);
|
||||
return (true);
|
||||
return (isc_file_exists(filename));
|
||||
}
|
||||
|
||||
@@ -437,7 +439,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
||||
isc_stdtime_get(&now);
|
||||
result = dns_dnssec_findmatchingkeys(name, dir, now, mctx, &matchkeys);
|
||||
if (result == ISC_R_NOTFOUND)
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
|
||||
while (!ISC_LIST_EMPTY(matchkeys) && !conflict) {
|
||||
key = ISC_LIST_HEAD(matchkeys);
|
||||
@@ -448,7 +450,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 = ISC_TRUE;
|
||||
conflict = true;
|
||||
if (id != oldid) {
|
||||
if (verbose > 1)
|
||||
fprintf(stderr, "Key ID %d could "
|
||||
@@ -456,7 +458,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
||||
id, oldid);
|
||||
} else {
|
||||
if (exact != NULL)
|
||||
*exact = ISC_TRUE;
|
||||
*exact = true;
|
||||
if (verbose > 1)
|
||||
fprintf(stderr, "Key ID %d exists\n",
|
||||
id);
|
||||
@@ -478,7 +480,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
||||
return (conflict);
|
||||
}
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
isoptarg(const char *arg, char **argv, void(*usage)(void)) {
|
||||
if (!strcasecmp(isc_commandline_argument, arg)) {
|
||||
if (argv[isc_commandline_index] == NULL) {
|
||||
@@ -490,9 +492,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 (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
#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>
|
||||
@@ -49,8 +52,8 @@ cleanup_logging(isc_log_t **logp);
|
||||
dns_ttl_t strtottl(const char *str);
|
||||
|
||||
isc_stdtime_t
|
||||
strtotime(const char *str, isc_int64_t now, isc_int64_t base,
|
||||
isc_boolean_t *setp);
|
||||
strtotime(const char *str, int64_t now, int64_t base,
|
||||
bool *setp);
|
||||
|
||||
unsigned int
|
||||
strtodsdigest(const char *str);
|
||||
@@ -67,11 +70,11 @@ check_keyversion(dst_key_t *key, char *keystr);
|
||||
void
|
||||
set_keyversion(dst_key_t *key);
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
key_collision(dst_key_t *key, dns_name_t *name, const char *dir,
|
||||
isc_mem_t *mctx, isc_boolean_t *exact);
|
||||
isc_mem_t *mctx, bool *exact);
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
isoptarg(const char *arg, char **argv, void (*usage)(void));
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
@IF PYTHON
|
||||
<PostBuildEvent>
|
||||
@@ -113,7 +113,7 @@ set PYTHONPATH=.
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
@IF PYTHON
|
||||
<PostBuildEvent>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -100,7 +100,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -100,7 +100,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@@ -99,7 +99,7 @@
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -100,7 +100,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@@ -99,7 +99,7 @@
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -100,7 +100,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@@ -99,7 +99,7 @@
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalDependencies>dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@dnssectool.lib;libisc.lib;libdns.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
+19
-20
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
@@ -447,7 +448,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,
|
||||
isc_uint32_t *countp)
|
||||
uint32_t *countp)
|
||||
{
|
||||
int count, i = 0;
|
||||
const cfg_obj_t *addrlist;
|
||||
@@ -467,8 +468,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)) {
|
||||
isc_uint32_t val = cfg_obj_asuint32(portobj);
|
||||
if (val > ISC_UINT16_MAX) {
|
||||
uint32_t val = cfg_obj_asuint32(portobj);
|
||||
if (val > UINT16_MAX) {
|
||||
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
|
||||
"port '%u' out of range", val);
|
||||
return (ISC_R_RANGE);
|
||||
@@ -538,7 +539,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, isc_uint32_t count)
|
||||
isc_dscp_t **dscpsp, uint32_t count)
|
||||
{
|
||||
INSIST(addrsp != NULL && *addrsp != NULL);
|
||||
INSIST(dscpsp == NULL || *dscpsp != NULL);
|
||||
@@ -584,9 +585,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)
|
||||
{
|
||||
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;
|
||||
uint32_t addrcount = 0, dscpcount = 0, keycount = 0, i = 0;
|
||||
uint32_t listcount = 0, l = 0, j;
|
||||
uint32_t stackcount = 0, pushed = 0;
|
||||
isc_result_t result;
|
||||
const cfg_listelt_t *element;
|
||||
const cfg_obj_t *addrlist;
|
||||
@@ -630,8 +631,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)) {
|
||||
isc_uint32_t val = cfg_obj_asuint32(portobj);
|
||||
if (val > ISC_UINT16_MAX) {
|
||||
uint32_t val = cfg_obj_asuint32(portobj);
|
||||
if (val > UINT16_MAX) {
|
||||
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
|
||||
"port '%u' out of range", val);
|
||||
result = ISC_R_RANGE;
|
||||
@@ -675,7 +676,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
|
||||
/* Grow lists? */
|
||||
if (listcount == l) {
|
||||
void * tmp;
|
||||
isc_uint32_t newlen = listcount + 16;
|
||||
uint32_t newlen = listcount + 16;
|
||||
size_t newsize, oldsize;
|
||||
|
||||
newsize = newlen * sizeof(*lists);
|
||||
@@ -710,7 +711,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
|
||||
/* Grow stack? */
|
||||
if (stackcount == pushed) {
|
||||
void * tmp;
|
||||
isc_uint32_t newlen = stackcount + 16;
|
||||
uint32_t newlen = stackcount + 16;
|
||||
size_t newsize, oldsize;
|
||||
|
||||
newsize = newlen * sizeof(*stack);
|
||||
@@ -738,7 +739,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
|
||||
|
||||
if (i == addrcount) {
|
||||
void * tmp;
|
||||
isc_uint32_t newlen = addrcount + 16;
|
||||
uint32_t newlen = addrcount + 16;
|
||||
size_t newsize, oldsize;
|
||||
|
||||
newsize = newlen * sizeof(isc_sockaddr_t);
|
||||
@@ -801,10 +802,8 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
|
||||
dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
result = dns_name_dup(dns_fixedname_name(&fname), mctx,
|
||||
dns_name_dup(dns_fixedname_name(&fname), mctx,
|
||||
keys[i - 1]);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
}
|
||||
if (pushed != 0) {
|
||||
pushed--;
|
||||
@@ -911,7 +910,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) >= ISC_UINT16_MAX) {
|
||||
if (cfg_obj_asuint32(portobj) >= UINT16_MAX) {
|
||||
cfg_obj_log(portobj, named_g_lctx, ISC_LOG_ERROR,
|
||||
"port '%u' out of range",
|
||||
cfg_obj_asuint32(portobj));
|
||||
@@ -951,7 +950,7 @@ struct keyalgorithms {
|
||||
enum { hmacnone, hmacmd5, hmacsha1, hmacsha224,
|
||||
hmacsha256, hmacsha384, hmacsha512 } hmac;
|
||||
unsigned int type;
|
||||
isc_uint16_t size;
|
||||
uint16_t size;
|
||||
} algorithms[] = {
|
||||
{ "hmac-md5", hmacmd5, DST_ALG_HMACMD5, 128 },
|
||||
{ "hmac-md5.sig-alg.reg.int", hmacmd5, DST_ALG_HMACMD5, 0 },
|
||||
@@ -966,18 +965,18 @@ struct keyalgorithms {
|
||||
|
||||
isc_result_t
|
||||
named_config_getkeyalgorithm(const char *str, const dns_name_t **name,
|
||||
isc_uint16_t *digestbits)
|
||||
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, isc_uint16_t *digestbits)
|
||||
unsigned int *typep, uint16_t *digestbits)
|
||||
{
|
||||
int i;
|
||||
size_t len = 0;
|
||||
isc_uint16_t bits;
|
||||
uint16_t bits;
|
||||
isc_result_t result;
|
||||
|
||||
for (i = 0; algorithms[i].str != NULL; i++) {
|
||||
|
||||
+12
-15
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/app.h>
|
||||
#include <isc/event.h>
|
||||
@@ -59,9 +60,9 @@ getcommand(isc_lex_t *lex, char **cmdp) {
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
static inline isc_boolean_t
|
||||
static inline bool
|
||||
command_compare(const char *str, const char *command) {
|
||||
return ISC_TF(strcasecmp(str, command) == 0);
|
||||
return (strcasecmp(str, command) == 0);
|
||||
}
|
||||
|
||||
/*%
|
||||
@@ -69,7 +70,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, isc_boolean_t readonly,
|
||||
named_control_docommand(isccc_sexpr_t *message, bool readonly,
|
||||
isc_buffer_t **text)
|
||||
{
|
||||
isccc_sexpr_t *data;
|
||||
@@ -99,15 +100,11 @@ named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
|
||||
return (result);
|
||||
}
|
||||
|
||||
result = isc_lex_create(named_g_mctx, strlen(cmdline), &lex);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
isc_lex_create(named_g_mctx, strlen(cmdline), &lex);
|
||||
|
||||
isc_buffer_init(&src, cmdline, strlen(cmdline));
|
||||
isc_buffer_add(&src, strlen(cmdline));
|
||||
result = isc_lex_openbuffer(lex, &src);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
isc_lex_openbuffer(lex, &src);
|
||||
|
||||
result = getcommand(lex, &command);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
@@ -184,7 +181,7 @@ named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
|
||||
*/
|
||||
#endif
|
||||
/* Do not flush master files */
|
||||
named_server_flushonshutdown(named_g_server, ISC_FALSE);
|
||||
named_server_flushonshutdown(named_g_server, false);
|
||||
named_os_shutdownmsg(cmdline, *text);
|
||||
isc_app_shutdown();
|
||||
result = ISC_R_SUCCESS;
|
||||
@@ -201,7 +198,7 @@ named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
|
||||
if (named_smf_got_instance == 1 && named_smf_chroot == 0)
|
||||
named_smf_want_disable = 1;
|
||||
#endif
|
||||
named_server_flushonshutdown(named_g_server, ISC_TRUE);
|
||||
named_server_flushonshutdown(named_g_server, true);
|
||||
named_os_shutdownmsg(cmdline, *text);
|
||||
isc_app_shutdown();
|
||||
result = ISC_R_SUCCESS;
|
||||
@@ -223,9 +220,9 @@ named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
|
||||
} 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);
|
||||
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, ISC_TRUE);
|
||||
result = named_server_flushnode(named_g_server, lex, 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)) {
|
||||
@@ -233,11 +230,11 @@ named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
|
||||
} 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,
|
||||
result = named_server_freeze(named_g_server, 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,
|
||||
result = named_server_freeze(named_g_server, false, lex,
|
||||
text);
|
||||
} else if (command_compare(command, NAMED_COMMAND_SCAN)) {
|
||||
result = ISC_R_SUCCESS;
|
||||
|
||||
+42
-45
@@ -13,6 +13,9 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/base64.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/event.h>
|
||||
@@ -65,7 +68,7 @@ typedef ISC_LIST(controllistener_t) controllistenerlist_t;
|
||||
|
||||
struct controlkey {
|
||||
char * keyname;
|
||||
isc_uint32_t algorithm;
|
||||
uint32_t algorithm;
|
||||
isc_region_t secret;
|
||||
ISC_LINK(controlkey_t) link;
|
||||
};
|
||||
@@ -73,12 +76,12 @@ struct controlkey {
|
||||
struct controlconnection {
|
||||
isc_socket_t * sock;
|
||||
isccc_ccmsg_t ccmsg;
|
||||
isc_boolean_t ccmsg_valid;
|
||||
isc_boolean_t sending;
|
||||
bool ccmsg_valid;
|
||||
bool sending;
|
||||
isc_timer_t * timer;
|
||||
isc_buffer_t * buffer;
|
||||
controllistener_t * listener;
|
||||
isc_uint32_t nonce;
|
||||
uint32_t nonce;
|
||||
ISC_LINK(controlconnection_t) link;
|
||||
};
|
||||
|
||||
@@ -89,22 +92,22 @@ struct controllistener {
|
||||
isc_sockaddr_t address;
|
||||
isc_socket_t * sock;
|
||||
dns_acl_t * acl;
|
||||
isc_boolean_t listening;
|
||||
isc_boolean_t exiting;
|
||||
bool listening;
|
||||
bool exiting;
|
||||
controlkeylist_t keys;
|
||||
controlconnectionlist_t connections;
|
||||
isc_sockettype_t type;
|
||||
isc_uint32_t perm;
|
||||
isc_uint32_t owner;
|
||||
isc_uint32_t group;
|
||||
isc_boolean_t readonly;
|
||||
uint32_t perm;
|
||||
uint32_t owner;
|
||||
uint32_t group;
|
||||
bool readonly;
|
||||
ISC_LINK(controllistener_t) link;
|
||||
};
|
||||
|
||||
struct named_controls {
|
||||
named_server_t *server;
|
||||
controllistenerlist_t listeners;
|
||||
isc_boolean_t shuttingdown;
|
||||
bool shuttingdown;
|
||||
isccc_symtab_t *symtab;
|
||||
};
|
||||
|
||||
@@ -202,8 +205,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, ISC_TRUE);
|
||||
listener->exiting = ISC_TRUE;
|
||||
isc_socket_cleanunix(&listener->address, true);
|
||||
listener->exiting = true;
|
||||
}
|
||||
|
||||
for (conn = ISC_LIST_HEAD(listener->connections);
|
||||
@@ -221,7 +224,7 @@ shutdown_listener(controllistener_t *listener) {
|
||||
maybe_free_listener(listener);
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
address_ok(isc_sockaddr_t *sockaddr, dns_acl_t *acl) {
|
||||
dns_aclenv_t *env =
|
||||
ns_interfacemgr_getaclenv(named_g_server->interfacemgr);
|
||||
@@ -232,11 +235,7 @@ address_ok(isc_sockaddr_t *sockaddr, dns_acl_t *acl) {
|
||||
isc_netaddr_fromsockaddr(&netaddr, sockaddr);
|
||||
|
||||
result = dns_acl_match(&netaddr, NULL, acl, env, &match, NULL);
|
||||
if (result != ISC_R_SUCCESS || match <= 0) {
|
||||
return (ISC_FALSE);
|
||||
} else {
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
return (result == ISC_R_SUCCESS && match > 0);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
@@ -250,7 +249,7 @@ control_accept(controllistener_t *listener) {
|
||||
"isc_socket_accept() failed: %s",
|
||||
isc_result_totext(result));
|
||||
else
|
||||
listener->listening = ISC_TRUE;
|
||||
listener->listening = true;
|
||||
return (result);
|
||||
}
|
||||
|
||||
@@ -283,7 +282,7 @@ control_senddone(isc_task_t *task, isc_event_t *event) {
|
||||
|
||||
UNUSED(task);
|
||||
|
||||
conn->sending = ISC_FALSE;
|
||||
conn->sending = false;
|
||||
|
||||
if (sevent->result != ISC_R_SUCCESS &&
|
||||
sevent->result != ISC_R_CANCELED)
|
||||
@@ -329,7 +328,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;
|
||||
isc_uint32_t algorithm;
|
||||
uint32_t algorithm;
|
||||
isccc_region_t secret;
|
||||
isc_stdtime_t now;
|
||||
isc_buffer_t b;
|
||||
@@ -340,7 +339,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
|
||||
isccc_sexpr_t *_ctrl = NULL;
|
||||
isccc_time_t sent;
|
||||
isccc_time_t exp;
|
||||
isc_uint32_t nonce;
|
||||
uint32_t nonce;
|
||||
isccc_sexpr_t *data = NULL;
|
||||
|
||||
REQUIRE(event->ev_type == ISCCC_EVENT_CCMSG);
|
||||
@@ -449,9 +448,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
|
||||
goto cleanup_request;
|
||||
}
|
||||
|
||||
result = isc_buffer_allocate(listener->mctx, &text, 2 * 2048);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_request;
|
||||
isc_buffer_allocate(listener->mctx, &text, 2 * 2048);
|
||||
|
||||
/*
|
||||
* Establish nonce.
|
||||
@@ -497,10 +494,8 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
|
||||
goto cleanup_response;
|
||||
|
||||
if (conn->buffer == NULL) {
|
||||
result = isc_buffer_allocate(listener->mctx,
|
||||
isc_buffer_allocate(listener->mctx,
|
||||
&conn->buffer, 2 * 2048);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_response;
|
||||
}
|
||||
|
||||
isc_buffer_clear(conn->buffer);
|
||||
@@ -520,7 +515,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 = ISC_TRUE;
|
||||
conn->sending = true;
|
||||
|
||||
isc_mem_put(listener->mctx, secret.rstart, REGION_SIZE(secret));
|
||||
isccc_sexpr_free(&request);
|
||||
@@ -540,7 +535,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 = ISC_FALSE;
|
||||
conn->ccmsg_valid = false;
|
||||
maybe_free_connection(conn);
|
||||
maybe_free_listener(listener);
|
||||
}
|
||||
@@ -573,8 +568,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 = ISC_TRUE;
|
||||
conn->sending = ISC_FALSE;
|
||||
conn->ccmsg_valid = true;
|
||||
conn->sending = false;
|
||||
conn->buffer = NULL;
|
||||
conn->timer = NULL;
|
||||
isc_interval_set(&interval, 60, 0);
|
||||
@@ -621,7 +616,7 @@ control_newconn(isc_task_t *task, isc_event_t *event) {
|
||||
|
||||
UNUSED(task);
|
||||
|
||||
listener->listening = ISC_FALSE;
|
||||
listener->listening = false;
|
||||
|
||||
if (nevent->result != ISC_R_SUCCESS) {
|
||||
if (nevent->result == ISC_R_CANCELED) {
|
||||
@@ -685,7 +680,7 @@ controls_shutdown(named_controls_t *controls) {
|
||||
void
|
||||
named_controls_shutdown(named_controls_t *controls) {
|
||||
controls_shutdown(controls);
|
||||
controls->shuttingdown = ISC_TRUE;
|
||||
controls->shuttingdown = true;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
@@ -1062,7 +1057,8 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
|
||||
aclconfctx, listener->mctx, 0,
|
||||
&new_acl);
|
||||
} else {
|
||||
result = dns_acl_any(listener->mctx, &new_acl);
|
||||
dns_acl_any(listener->mctx, &new_acl);
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
if (control != NULL) {
|
||||
@@ -1091,7 +1087,7 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
|
||||
socktext, isc_result_totext(result));
|
||||
|
||||
if (result == ISC_R_SUCCESS && type == isc_sockettype_unix) {
|
||||
isc_uint32_t perm, owner, group;
|
||||
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"));
|
||||
@@ -1138,14 +1134,14 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
|
||||
listener->task = cp->server->task;
|
||||
listener->address = *addr;
|
||||
listener->sock = NULL;
|
||||
listener->listening = ISC_FALSE;
|
||||
listener->exiting = ISC_FALSE;
|
||||
listener->listening = false;
|
||||
listener->exiting = false;
|
||||
listener->acl = NULL;
|
||||
listener->type = type;
|
||||
listener->perm = 0;
|
||||
listener->owner = 0;
|
||||
listener->group = 0;
|
||||
listener->readonly = ISC_FALSE;
|
||||
listener->readonly = false;
|
||||
ISC_LINK_INIT(listener, link);
|
||||
ISC_LIST_INIT(listener->keys);
|
||||
ISC_LIST_INIT(listener->connections);
|
||||
@@ -1159,7 +1155,8 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
|
||||
aclconfctx, mctx, 0,
|
||||
&new_acl);
|
||||
} else {
|
||||
result = dns_acl_any(mctx, &new_acl);
|
||||
dns_acl_any(mctx, &new_acl);
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1208,7 +1205,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
|
||||
}
|
||||
|
||||
if (result == ISC_R_SUCCESS && type == isc_sockettype_unix)
|
||||
isc_socket_cleanunix(&listener->address, ISC_FALSE);
|
||||
isc_socket_cleanunix(&listener->address, false);
|
||||
|
||||
if (result == ISC_R_SUCCESS)
|
||||
result = isc_socket_create(named_g_socketmgr,
|
||||
@@ -1219,7 +1216,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
|
||||
|
||||
#ifndef ISC_ALLOW_MAPPED
|
||||
if (result == ISC_R_SUCCESS)
|
||||
isc_socket_ipv6only(listener->sock, ISC_TRUE);
|
||||
isc_socket_ipv6only(listener->sock, true);
|
||||
#endif
|
||||
|
||||
if (result == ISC_R_SUCCESS)
|
||||
@@ -1250,7 +1247,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
|
||||
|
||||
} else {
|
||||
if (listener != NULL) {
|
||||
listener->exiting = ISC_TRUE;
|
||||
listener->exiting = true;
|
||||
free_listener(listener);
|
||||
}
|
||||
|
||||
@@ -1510,7 +1507,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 = ISC_FALSE;
|
||||
controls->shuttingdown = false;
|
||||
controls->symtab = NULL;
|
||||
result = isccc_cc_createsymtab(&controls->symtab);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
||||
+30
-25
@@ -9,7 +9,10 @@
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <named/fuzz.h>
|
||||
|
||||
@@ -33,10 +36,6 @@
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#ifndef __AFL_LOOP
|
||||
#error To use American Fuzzy Lop you have to set CC to afl-clang-fast!!!
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We are using pthreads directly because we might be using it with
|
||||
* unthreaded version of BIND, where all thread functions are
|
||||
@@ -44,7 +43,7 @@
|
||||
*/
|
||||
static pthread_cond_t cond;
|
||||
static pthread_mutex_t mutex;
|
||||
static isc_boolean_t ready;
|
||||
static bool ready;
|
||||
|
||||
/*
|
||||
* In "client:" mode, this thread reads fuzzed query messages from AFL
|
||||
@@ -58,7 +57,6 @@ fuzz_thread_client(void *arg) {
|
||||
char *port;
|
||||
struct sockaddr_in servaddr;
|
||||
int sockfd;
|
||||
int loop;
|
||||
void *buf;
|
||||
|
||||
UNUSED(arg);
|
||||
@@ -100,14 +98,18 @@ fuzz_thread_client(void *arg) {
|
||||
* Processing fuzzed packets 100,000 times before shutting down
|
||||
* the app.
|
||||
*/
|
||||
for (loop = 0; loop < 100000; loop++) {
|
||||
#ifdef __AFL_LOOP
|
||||
for (int loop = 0; loop < 100000; loop++) {
|
||||
#else
|
||||
{
|
||||
#endif
|
||||
ssize_t length;
|
||||
ssize_t sent;
|
||||
|
||||
length = read(0, buf, 65536);
|
||||
if (length <= 0) {
|
||||
usleep(1000000);
|
||||
continue;
|
||||
goto next;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -122,17 +124,17 @@ fuzz_thread_client(void *arg) {
|
||||
free(buf);
|
||||
close(sockfd);
|
||||
named_server_flushonshutdown(named_g_server,
|
||||
ISC_FALSE);
|
||||
false);
|
||||
isc_app_shutdown();
|
||||
return (NULL);
|
||||
}
|
||||
raise(SIGSTOP);
|
||||
continue;
|
||||
goto next;
|
||||
}
|
||||
|
||||
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
|
||||
|
||||
ready = ISC_FALSE;
|
||||
ready = false;
|
||||
|
||||
sent = sendto(sockfd, buf, length, 0,
|
||||
(struct sockaddr *) &servaddr, sizeof(servaddr));
|
||||
@@ -148,12 +150,13 @@ fuzz_thread_client(void *arg) {
|
||||
pthread_cond_wait(&cond, &mutex);
|
||||
|
||||
RUNTIME_CHECK(pthread_mutex_unlock(&mutex) == 0);
|
||||
next: ;
|
||||
}
|
||||
|
||||
free(buf);
|
||||
close(sockfd);
|
||||
|
||||
named_server_flushonshutdown(named_g_server, ISC_FALSE);
|
||||
named_server_flushonshutdown(named_g_server, false);
|
||||
isc_app_shutdown();
|
||||
|
||||
return (NULL);
|
||||
@@ -200,7 +203,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 isc_uint8_t dnskey_wf[] = {
|
||||
const 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,
|
||||
@@ -282,12 +285,12 @@ fuzz_thread_resolver(void *arg) {
|
||||
int sockfd;
|
||||
int listenfd;
|
||||
int loop;
|
||||
isc_uint16_t qtype;
|
||||
uint16_t qtype;
|
||||
char *buf, *rbuf;
|
||||
char *nameptr;
|
||||
unsigned int i;
|
||||
isc_uint8_t llen;
|
||||
isc_uint64_t seed;
|
||||
uint8_t llen;
|
||||
uint64_t seed;
|
||||
|
||||
UNUSED(arg);
|
||||
|
||||
@@ -385,7 +388,7 @@ fuzz_thread_resolver(void *arg) {
|
||||
close(sockfd);
|
||||
close(listenfd);
|
||||
named_server_flushonshutdown(named_g_server,
|
||||
ISC_FALSE);
|
||||
false);
|
||||
isc_app_shutdown();
|
||||
return (NULL);
|
||||
}
|
||||
@@ -399,7 +402,7 @@ fuzz_thread_resolver(void *arg) {
|
||||
|
||||
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
|
||||
|
||||
ready = ISC_FALSE;
|
||||
ready = false;
|
||||
|
||||
/* Use a unique query ID. */
|
||||
seed = 1664525 * seed + 1013904223;
|
||||
@@ -549,7 +552,7 @@ fuzz_thread_resolver(void *arg) {
|
||||
* "example."
|
||||
*/
|
||||
if ((nameptr - buf) < (length - 2)) {
|
||||
isc_uint8_t hb, lb;
|
||||
uint8_t hb, lb;
|
||||
hb = *nameptr++;
|
||||
lb = *nameptr++;
|
||||
qtype = (hb << 8) | lb;
|
||||
@@ -580,9 +583,10 @@ fuzz_thread_resolver(void *arg) {
|
||||
free(rbuf);
|
||||
close(sockfd);
|
||||
close(listenfd);
|
||||
named_server_flushonshutdown(named_g_server, ISC_FALSE);
|
||||
named_server_flushonshutdown(named_g_server, false);
|
||||
isc_app_shutdown();
|
||||
|
||||
#ifdef __AFL_LOOP
|
||||
/*
|
||||
* This is here just for the signature, that's how AFL detects
|
||||
* if it's a 'persistent mode' binary. It has to occur somewhere
|
||||
@@ -591,6 +595,7 @@ fuzz_thread_resolver(void *arg) {
|
||||
* in persistent mode if it's present.
|
||||
*/
|
||||
__AFL_LOOP(0);
|
||||
#endif
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@@ -687,7 +692,7 @@ fuzz_thread_tcp(void *arg) {
|
||||
|
||||
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
|
||||
|
||||
ready = ISC_FALSE;
|
||||
ready = false;
|
||||
yes = 1;
|
||||
sockfd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
||||
@@ -718,7 +723,7 @@ fuzz_thread_tcp(void *arg) {
|
||||
|
||||
free(buf);
|
||||
close(sockfd);
|
||||
named_server_flushonshutdown(named_g_server, ISC_FALSE);
|
||||
named_server_flushonshutdown(named_g_server, false);
|
||||
isc_app_shutdown();
|
||||
|
||||
return (NULL);
|
||||
@@ -735,7 +740,7 @@ void
|
||||
named_fuzz_notify(void) {
|
||||
#ifdef ENABLE_AFL
|
||||
if (getenv("AFL_CMIN")) {
|
||||
named_server_flushonshutdown(named_g_server, ISC_FALSE);
|
||||
named_server_flushonshutdown(named_g_server, false);
|
||||
isc_app_shutdown();
|
||||
return;
|
||||
}
|
||||
@@ -744,7 +749,7 @@ named_fuzz_notify(void) {
|
||||
|
||||
RUNTIME_CHECK(pthread_mutex_lock(&mutex) == 0);
|
||||
|
||||
ready = ISC_TRUE;
|
||||
ready = true;
|
||||
|
||||
RUNTIME_CHECK(pthread_cond_signal(&cond) == 0);
|
||||
RUNTIME_CHECK(pthread_mutex_unlock(&mutex) == 0);
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <isccfg/cfg.h>
|
||||
|
||||
#include <dns/types.h>
|
||||
@@ -49,11 +51,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,
|
||||
isc_uint32_t *countp);
|
||||
uint32_t *countp);
|
||||
|
||||
void
|
||||
named_config_putiplist(isc_mem_t *mctx, isc_sockaddr_t **addrsp,
|
||||
isc_dscp_t **dscpsp, isc_uint32_t count);
|
||||
isc_dscp_t **dscpsp, uint32_t count);
|
||||
|
||||
isc_result_t
|
||||
named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
|
||||
@@ -64,10 +66,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,
|
||||
isc_uint16_t *digestbits);
|
||||
uint16_t *digestbits);
|
||||
isc_result_t
|
||||
named_config_getkeyalgorithm2(const char *str, const dns_name_t **name,
|
||||
unsigned int *typep, isc_uint16_t *digestbits);
|
||||
unsigned int *typep, uint16_t *digestbits);
|
||||
|
||||
isc_result_t
|
||||
named_config_getdscp(const cfg_obj_t *config, isc_dscp_t *dscpp);
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
* The name server command channel.
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isccc/types.h>
|
||||
|
||||
#include <isccfg/aclconf.h>
|
||||
@@ -101,7 +103,7 @@ named_controls_shutdown(named_controls_t *controls);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
named_control_docommand(isccc_sexpr_t *message, isc_boolean_t readonly,
|
||||
named_control_docommand(isccc_sexpr_t *message, bool readonly,
|
||||
isc_buffer_t **text);
|
||||
|
||||
#endif /* NAMED_CONTROL_H */
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/rwlock.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/net.h>
|
||||
@@ -51,7 +53,7 @@ EXTERN dns_dispatchmgr_t * named_g_dispatchmgr INIT(NULL);
|
||||
EXTERN unsigned int named_g_cpus_detected INIT(1);
|
||||
|
||||
#ifdef ENABLE_AFL
|
||||
EXTERN isc_boolean_t named_g_run_done INIT(ISC_FALSE);
|
||||
EXTERN bool named_g_run_done INIT(false);
|
||||
#endif
|
||||
/*
|
||||
* XXXRTH We're going to want multiple timer managers eventually. One
|
||||
@@ -94,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 isc_boolean_t named_g_conffileset INIT(ISC_FALSE);
|
||||
EXTERN bool named_g_conffileset INIT(false);
|
||||
EXTERN cfg_aclconfctx_t * named_g_aclconfctx INIT(NULL);
|
||||
|
||||
/*
|
||||
@@ -108,11 +110,11 @@ EXTERN isc_resourcevalue_t named_g_initopenfiles INIT(0);
|
||||
/*
|
||||
* Misc.
|
||||
*/
|
||||
EXTERN isc_boolean_t named_g_coreok INIT(ISC_TRUE);
|
||||
EXTERN bool named_g_coreok INIT(true);
|
||||
EXTERN const char * named_g_chrootdir INIT(NULL);
|
||||
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 bool named_g_foreground INIT(false);
|
||||
EXTERN bool named_g_logstderr INIT(false);
|
||||
EXTERN bool named_g_nosyslog INIT(false);
|
||||
EXTERN const char * named_g_logfile INIT(NULL);
|
||||
|
||||
EXTERN const char * named_g_defaultsessionkeyfile
|
||||
@@ -121,7 +123,7 @@ EXTERN const char * named_g_defaultsessionkeyfile
|
||||
EXTERN const char * named_g_defaultlockfile INIT(NAMED_LOCALSTATEDIR
|
||||
"/run/named/"
|
||||
"named.lock");
|
||||
EXTERN isc_boolean_t named_g_forcelock INIT(ISC_FALSE);
|
||||
EXTERN bool named_g_forcelock INIT(false);
|
||||
|
||||
#if NAMED_RUN_PID_DIR
|
||||
EXTERN const char * named_g_defaultpidfile INIT(NAMED_LOCALSTATEDIR
|
||||
@@ -146,8 +148,8 @@ EXTERN const char * named_g_engine INIT(NULL);
|
||||
|
||||
EXTERN isc_time_t named_g_boottime;
|
||||
EXTERN isc_time_t named_g_configtime;
|
||||
EXTERN isc_boolean_t named_g_memstatistics INIT(ISC_FALSE);
|
||||
EXTERN isc_boolean_t named_g_keepstderr INIT(ISC_FALSE);
|
||||
EXTERN bool named_g_memstatistics INIT(false);
|
||||
EXTERN bool named_g_keepstderr INIT(false);
|
||||
|
||||
EXTERN unsigned int named_g_tat_interval INIT(24*3600);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#define NAMED_LOGMODULE_CONTROL (&named_g_modules[2])
|
||||
|
||||
isc_result_t
|
||||
named_log_init(isc_boolean_t safe);
|
||||
named_log_init(bool safe);
|
||||
/*%
|
||||
* Initialize the logging system and set up an initial default
|
||||
* logging default configuration that will be used until the
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/log.h>
|
||||
#include <isc/magic.h>
|
||||
#include <isc/quota.h>
|
||||
@@ -53,9 +56,9 @@ struct named_server {
|
||||
char * secrootsfile; /*%< Secroots file name */
|
||||
char * bindkeysfile; /*%< bind.keys file name */
|
||||
char * recfile; /*%< Recursive file name */
|
||||
isc_boolean_t version_set; /*%< User has set version */
|
||||
bool version_set; /*%< User has set version */
|
||||
char * version; /*%< User-specified version */
|
||||
isc_boolean_t hostname_set; /*%< User has set hostname */
|
||||
bool hostname_set; /*%< User has set hostname */
|
||||
char * hostname; /*%< User-specified hostname */
|
||||
|
||||
/* Server data structures. */
|
||||
@@ -70,13 +73,13 @@ struct named_server {
|
||||
isc_timer_t * pps_timer;
|
||||
isc_timer_t * tat_timer;
|
||||
|
||||
isc_uint32_t interface_interval;
|
||||
isc_uint32_t heartbeat_interval;
|
||||
uint32_t interface_interval;
|
||||
uint32_t heartbeat_interval;
|
||||
|
||||
isc_mutex_t reload_event_lock;
|
||||
isc_event_t * reload_event;
|
||||
|
||||
isc_boolean_t flushonshutdown;
|
||||
bool flushonshutdown;
|
||||
|
||||
named_cachelist_t cachelist; /*%< Possibly shared caches */
|
||||
isc_stats_t * zonestats; /*% Zone management stats */
|
||||
@@ -93,8 +96,8 @@ struct named_server {
|
||||
char *session_keyfile;
|
||||
dns_name_t *session_keyname;
|
||||
unsigned int session_keyalg;
|
||||
isc_uint16_t session_keybits;
|
||||
isc_boolean_t interface_auto;
|
||||
uint16_t session_keybits;
|
||||
bool interface_auto;
|
||||
unsigned char secret[32]; /*%< Server Cookie Secret */
|
||||
ns_cookiealg_t cookiealg;
|
||||
|
||||
@@ -137,7 +140,7 @@ named_server_scan_interfaces(named_server_t *server);
|
||||
*/
|
||||
|
||||
void
|
||||
named_server_flushonshutdown(named_server_t *server, isc_boolean_t flush);
|
||||
named_server_flushonshutdown(named_server_t *server, bool flush);
|
||||
/*%<
|
||||
* Inform the server that the zones should be flushed to disk on shutdown.
|
||||
*/
|
||||
@@ -234,7 +237,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,
|
||||
isc_boolean_t tree);
|
||||
bool tree);
|
||||
|
||||
/*%
|
||||
* Report the server's status.
|
||||
@@ -259,7 +262,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, isc_boolean_t freeze,
|
||||
named_server_freeze(named_server_t *server, bool freeze,
|
||||
isc_lex_t *lex, isc_buffer_t **text);
|
||||
|
||||
/*%
|
||||
@@ -339,7 +342,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,
|
||||
isc_boolean_t readonly, isc_buffer_t **text);
|
||||
bool readonly, isc_buffer_t **text);
|
||||
|
||||
/*%
|
||||
* Generates a test sequence that is only for use in system tests. The
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/lang.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
@@ -41,13 +43,13 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
* \li 'zone' to be initialized.
|
||||
*/
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
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 ISC_TRUE. If the configuration data is so
|
||||
* data in 'zconfig', return true. If the configuration data is so
|
||||
* different from the current zone state that the zone needs to be destroyed
|
||||
* and recreated, return ISC_FALSE.
|
||||
* and recreated, return false.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ static isc_logmodule_t modules[] = {
|
||||
};
|
||||
|
||||
isc_result_t
|
||||
named_log_init(isc_boolean_t safe) {
|
||||
named_log_init(bool safe) {
|
||||
isc_result_t result;
|
||||
isc_logconfig_t *lcfg = NULL;
|
||||
|
||||
|
||||
+9
-6
@@ -13,6 +13,9 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/file.h>
|
||||
#include <isc/offset.h>
|
||||
#include <isc/print.h>
|
||||
@@ -136,10 +139,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");
|
||||
isc_int32_t versions = ISC_LOG_ROLLNEVER;
|
||||
int32_t versions = ISC_LOG_ROLLNEVER;
|
||||
isc_log_rollsuffix_t suffix = isc_log_rollsuffix_increment;
|
||||
isc_offset_t size = 0;
|
||||
isc_uint64_t maxoffset;
|
||||
uint64_t maxoffset;
|
||||
|
||||
/*
|
||||
* isc_offset_t is a signed integer type, so the maximum
|
||||
@@ -302,8 +305,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;
|
||||
isc_boolean_t default_set = ISC_FALSE;
|
||||
isc_boolean_t unmatched_set = ISC_FALSE;
|
||||
bool default_set = false;
|
||||
bool unmatched_set = false;
|
||||
const cfg_obj_t *catname;
|
||||
|
||||
if (logconfig != NULL)
|
||||
@@ -328,12 +331,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 = ISC_TRUE;
|
||||
default_set = true;
|
||||
}
|
||||
if (!unmatched_set) {
|
||||
catname = cfg_tuple_get(category, "name");
|
||||
if (strcmp(cfg_obj_asstring(catname), "unmatched") == 0)
|
||||
unmatched_set = ISC_TRUE;
|
||||
unmatched_set = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+93
-110
@@ -14,6 +14,8 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -107,9 +109,9 @@ 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 isc_boolean_t want_stats = ISC_FALSE;
|
||||
static char program_name[ISC_DIR_NAMEMAX] = "named";
|
||||
static char absolute_conffile[ISC_DIR_PATHMAX];
|
||||
static bool want_stats = false;
|
||||
static char program_name[NAME_MAX] = "named";
|
||||
static char absolute_conffile[PATH_MAX];
|
||||
static char saved_command_line[512];
|
||||
static char version[512];
|
||||
static unsigned int maxsocks = 0;
|
||||
@@ -118,22 +120,25 @@ static int maxudp = 0;
|
||||
/*
|
||||
* -T options:
|
||||
*/
|
||||
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 bool clienttest = false;
|
||||
static bool dropedns = false;
|
||||
static bool ednsformerr = false;
|
||||
static bool ednsnotimp = false;
|
||||
static bool ednsrefused = false;
|
||||
static bool fixedlocal = false;
|
||||
static bool noaa = false;
|
||||
static bool noedns = false;
|
||||
static bool nonearest = false;
|
||||
static bool nosoa = false;
|
||||
static bool notcp = false;
|
||||
static bool sigvalinsecs = false;
|
||||
static unsigned int delay = 0;
|
||||
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 isc_boolean_t disable6 = ISC_FALSE;
|
||||
static isc_boolean_t disable4 = ISC_FALSE;
|
||||
static bool disable6 = false;
|
||||
static bool disable4 = false;
|
||||
|
||||
void
|
||||
named_main_earlywarning(const char *format, ...) {
|
||||
@@ -336,7 +341,7 @@ save_command_line(int argc, char *argv[]) {
|
||||
char *dst;
|
||||
char *eob;
|
||||
const char truncated[] = "...";
|
||||
isc_boolean_t quoted = ISC_FALSE;
|
||||
bool quoted = false;
|
||||
|
||||
dst = saved_command_line;
|
||||
eob = saved_command_line + sizeof(saved_command_line);
|
||||
@@ -356,10 +361,10 @@ save_command_line(int argc, char *argv[]) {
|
||||
*src == '-' || *src == '_' ||
|
||||
*src == '.' || *src == '/') {
|
||||
*dst++ = *src++;
|
||||
quoted = ISC_FALSE;
|
||||
quoted = false;
|
||||
} else {
|
||||
*dst++ = '\\';
|
||||
quoted = ISC_TRUE;
|
||||
quoted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -390,25 +395,25 @@ parse_int(char *arg, const char *desc) {
|
||||
static struct flag_def {
|
||||
const char *name;
|
||||
unsigned int value;
|
||||
isc_boolean_t negate;
|
||||
bool negate;
|
||||
} mem_debug_flags[] = {
|
||||
{ "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 }
|
||||
{ "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 }
|
||||
}, mem_context_flags[] = {
|
||||
{ "external", ISC_MEMFLAG_INTERNAL, ISC_TRUE },
|
||||
{ "fill", ISC_MEMFLAG_FILL, ISC_FALSE },
|
||||
{ "nofill", ISC_MEMFLAG_FILL, ISC_TRUE },
|
||||
{ NULL, 0, ISC_FALSE }
|
||||
{ "external", ISC_MEMFLAG_INTERNAL, true },
|
||||
{ "fill", ISC_MEMFLAG_FILL, false },
|
||||
{ "nofill", ISC_MEMFLAG_FILL, true },
|
||||
{ NULL, 0, false }
|
||||
};
|
||||
|
||||
static void
|
||||
set_flags(const char *arg, struct flag_def *defs, unsigned int *ret) {
|
||||
isc_boolean_t clear = ISC_FALSE;
|
||||
bool clear = false;
|
||||
|
||||
for (;;) {
|
||||
const struct flag_def *def;
|
||||
@@ -421,7 +426,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 = ISC_TRUE;
|
||||
clear = true;
|
||||
if (def->negate)
|
||||
*ret &= ~(def->value);
|
||||
else
|
||||
@@ -479,29 +484,35 @@ parse_T_opt(char *option) {
|
||||
* expected and assert otherwise.
|
||||
*/
|
||||
if (!strcmp(option, "clienttest")) {
|
||||
clienttest = ISC_TRUE;
|
||||
clienttest = true;
|
||||
} else if (!strncmp(option, "delay=", 6)) {
|
||||
delay = atoi(option + 6);
|
||||
} else if (!strcmp(option, "dropedns")) {
|
||||
dropedns = ISC_TRUE;
|
||||
dropedns = true;
|
||||
} else if (!strncmp(option, "dscp=", 5)) {
|
||||
isc_dscp_check_value = atoi(option + 5);
|
||||
} else if (!strcmp(option, "ednsformerr")) {
|
||||
ednsformerr = true;
|
||||
} else if (!strcmp(option, "ednsnotimp")) {
|
||||
ednsnotimp = true;
|
||||
} else if (!strcmp(option, "ednsrefused")) {
|
||||
ednsrefused = true;
|
||||
} else if (!strcmp(option, "fixedlocal")) {
|
||||
fixedlocal = ISC_TRUE;
|
||||
fixedlocal = true;
|
||||
} else if (!strcmp(option, "keepstderr")) {
|
||||
named_g_keepstderr = ISC_TRUE;
|
||||
named_g_keepstderr = true;
|
||||
} else if (!strcmp(option, "noaa")) {
|
||||
noaa = ISC_TRUE;
|
||||
noaa = true;
|
||||
} else if (!strcmp(option, "noedns")) {
|
||||
noedns = ISC_TRUE;
|
||||
noedns = true;
|
||||
} else if (!strcmp(option, "nonearest")) {
|
||||
nonearest = ISC_TRUE;
|
||||
nonearest = true;
|
||||
} else if (!strcmp(option, "nosoa")) {
|
||||
nosoa = ISC_TRUE;
|
||||
nosoa = true;
|
||||
} else if (!strcmp(option, "nosyslog")) {
|
||||
named_g_nosyslog = ISC_TRUE;
|
||||
named_g_nosyslog = true;
|
||||
} else if (!strcmp(option, "notcp")) {
|
||||
notcp = ISC_TRUE;
|
||||
notcp = true;
|
||||
} else if (!strcmp(option, "maxudp512")) {
|
||||
maxudp = 512;
|
||||
} else if (!strcmp(option, "maxudp1460")) {
|
||||
@@ -541,11 +552,11 @@ parse_T_opt(char *option) {
|
||||
named_main_earlyfatal("bad mkeytimer");
|
||||
}
|
||||
} else if (!strcmp(option, "sigvalinsecs")) {
|
||||
sigvalinsecs = ISC_TRUE;
|
||||
sigvalinsecs = true;
|
||||
} else if (!strncmp(option, "tat=", 4)) {
|
||||
named_g_tat_interval = atoi(option + 4);
|
||||
} else {
|
||||
fprintf(stderr, "unknown -T flag '%s\n", option);
|
||||
fprintf(stderr, "unknown -T flag '%s'\n", option);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -561,7 +572,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 = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
while ((ch = isc_commandline_parse(argc, argv,
|
||||
NAMED_MAIN_ARGS)) != -1)
|
||||
{
|
||||
@@ -574,7 +585,7 @@ parse_command_line(int argc, char *argv[]) {
|
||||
named_main_earlyfatal("IPv4 not supported "
|
||||
"by OS");
|
||||
isc_net_disableipv6();
|
||||
disable6 = ISC_TRUE;
|
||||
disable6 = true;
|
||||
break;
|
||||
case '6':
|
||||
if (disable6)
|
||||
@@ -584,14 +595,14 @@ parse_command_line(int argc, char *argv[]) {
|
||||
named_main_earlyfatal("IPv6 not supported "
|
||||
"by OS");
|
||||
isc_net_disableipv4();
|
||||
disable4 = ISC_TRUE;
|
||||
disable4 = true;
|
||||
break;
|
||||
case 'A':
|
||||
parse_fuzz_arg();
|
||||
break;
|
||||
case 'c':
|
||||
named_g_conffile = isc_commandline_argument;
|
||||
named_g_conffileset = ISC_TRUE;
|
||||
named_g_conffileset = true;
|
||||
break;
|
||||
case 'd':
|
||||
named_g_debuglevel = parse_int(isc_commandline_argument,
|
||||
@@ -604,11 +615,11 @@ parse_command_line(int argc, char *argv[]) {
|
||||
named_g_engine = isc_commandline_argument;
|
||||
break;
|
||||
case 'f':
|
||||
named_g_foreground = ISC_TRUE;
|
||||
named_g_foreground = true;
|
||||
break;
|
||||
case 'g':
|
||||
named_g_foreground = ISC_TRUE;
|
||||
named_g_logstderr = ISC_TRUE;
|
||||
named_g_foreground = true;
|
||||
named_g_logstderr = true;
|
||||
break;
|
||||
case 'L':
|
||||
named_g_logfile = isc_commandline_argument;
|
||||
@@ -637,7 +648,7 @@ parse_command_line(int argc, char *argv[]) {
|
||||
break;
|
||||
case 's':
|
||||
/* XXXRTH temporary syntax */
|
||||
want_stats = ISC_TRUE;
|
||||
want_stats = true;
|
||||
break;
|
||||
case 'S':
|
||||
maxsocks = parse_int(isc_commandline_argument,
|
||||
@@ -718,17 +729,13 @@ parse_command_line(int argc, char *argv[]) {
|
||||
printf("linked to zlib version: %s\n",
|
||||
zlibVersion());
|
||||
#endif
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
printf("threads support is enabled\n");
|
||||
#else
|
||||
printf("threads support is disabled\n");
|
||||
#endif
|
||||
exit(0);
|
||||
case 'x':
|
||||
/* Obsolete. No longer in use. Ignore. */
|
||||
break;
|
||||
case 'X':
|
||||
named_g_forcelock = ISC_TRUE;
|
||||
named_g_forcelock = true;
|
||||
if (strcasecmp(isc_commandline_argument, "none") != 0)
|
||||
named_g_defaultlockfile =
|
||||
isc_commandline_argument;
|
||||
@@ -774,7 +781,6 @@ create_managers(void) {
|
||||
|
||||
INSIST(named_g_cpus_detected > 0);
|
||||
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
if (named_g_cpus == 0)
|
||||
named_g_cpus = named_g_cpus_detected;
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
@@ -783,9 +789,6 @@ create_managers(void) {
|
||||
named_g_cpus_detected,
|
||||
named_g_cpus_detected == 1 ? "" : "s",
|
||||
named_g_cpus, named_g_cpus == 1 ? "" : "s");
|
||||
#else
|
||||
named_g_cpus = 1;
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
named_g_udpdisp = 1;
|
||||
#else
|
||||
@@ -798,12 +801,10 @@ create_managers(void) {
|
||||
if (named_g_udpdisp > named_g_cpus)
|
||||
named_g_udpdisp = named_g_cpus;
|
||||
#endif
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
|
||||
"using %u UDP listener%s per interface",
|
||||
named_g_udpdisp, named_g_udpdisp == 1 ? "" : "s");
|
||||
#endif
|
||||
|
||||
result = isc_taskmgr_create(named_g_mctx, named_g_cpus, 0,
|
||||
&named_g_taskmgr);
|
||||
@@ -814,14 +815,7 @@ create_managers(void) {
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
|
||||
result = isc_timermgr_create(named_g_mctx, &named_g_timermgr);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"isc_timermgr_create() failed: %s",
|
||||
isc_result_totext(result));
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
|
||||
isc_timermgr_create(named_g_mctx, &named_g_timermgr);
|
||||
result = isc_socketmgr_create2(named_g_mctx, &named_g_socketmgr,
|
||||
maxsocks);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
@@ -830,7 +824,7 @@ create_managers(void) {
|
||||
isc_result_totext(result));
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
isc__socketmgr_maxudp(named_g_socketmgr, maxudp);
|
||||
isc_socketmgr_maxudp(named_g_socketmgr, maxudp);
|
||||
result = isc_socketmgr_getmaxsockets(named_g_socketmgr, &socks);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
@@ -915,12 +909,10 @@ setup(void) {
|
||||
isc_mem_free(named_g_mctx, instance);
|
||||
#endif /* HAVE_LIBSCF */
|
||||
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
/*
|
||||
* Check for the number of cpu's before named_os_chroot().
|
||||
*/
|
||||
named_g_cpus_detected = isc_os_ncpus();
|
||||
#endif
|
||||
|
||||
named_os_chroot(named_g_chrootdir);
|
||||
|
||||
@@ -934,7 +926,7 @@ setup(void) {
|
||||
*/
|
||||
named_os_minprivs();
|
||||
|
||||
result = named_log_init(ISC_TF(named_g_username != NULL));
|
||||
result = named_log_init(named_g_username != NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
named_main_earlyfatal("named_log_init() failed: %s",
|
||||
isc_result_totext(result));
|
||||
@@ -1004,7 +996,6 @@ setup(void) {
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
|
||||
"compiled by Solaris Studio %x", __SUNPRO_C);
|
||||
#endif
|
||||
#ifdef OPENSSL
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
|
||||
"compiled with OpenSSL version: %s",
|
||||
@@ -1021,7 +1012,6 @@ setup(void) {
|
||||
"linked to OpenSSL version: %s",
|
||||
SSLeay_version(SSLEAY_VERSION));
|
||||
#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
|
||||
#endif
|
||||
#ifdef HAVE_LIBXML2
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
|
||||
@@ -1047,16 +1037,6 @@ setup(void) {
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
|
||||
"linked to zlib version: %s", zlibVersion());
|
||||
#endif
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
|
||||
"threads support is enabled");
|
||||
#else
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
|
||||
"threads support is disabled");
|
||||
#endif
|
||||
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
|
||||
"----------------------------------------------------");
|
||||
@@ -1102,8 +1082,8 @@ setup(void) {
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
|
||||
"adjusted limit on open files from "
|
||||
"%" ISC_PRINT_QUADFORMAT "u to "
|
||||
"%" ISC_PRINT_QUADFORMAT "u",
|
||||
"%" PRIu64 " to "
|
||||
"%" PRIu64,
|
||||
old_openfiles, named_g_initopenfiles);
|
||||
}
|
||||
|
||||
@@ -1170,27 +1150,33 @@ setup(void) {
|
||||
* Modify server context according to command line options
|
||||
*/
|
||||
if (clienttest)
|
||||
ns_server_setoption(sctx, NS_SERVER_CLIENTTEST, ISC_TRUE);
|
||||
if (dropedns)
|
||||
ns_server_setoption(sctx, NS_SERVER_DROPEDNS, ISC_TRUE);
|
||||
if (noedns)
|
||||
ns_server_setoption(sctx, NS_SERVER_NOEDNS, ISC_TRUE);
|
||||
if (nosoa)
|
||||
ns_server_setoption(sctx, NS_SERVER_NOSOA, ISC_TRUE);
|
||||
if (noaa)
|
||||
ns_server_setoption(sctx, NS_SERVER_NOAA, ISC_TRUE);
|
||||
if (nonearest)
|
||||
ns_server_setoption(sctx, NS_SERVER_NONEAREST, ISC_TRUE);
|
||||
if (notcp)
|
||||
ns_server_setoption(sctx, NS_SERVER_NOTCP, ISC_TRUE);
|
||||
if (fixedlocal)
|
||||
ns_server_setoption(sctx, NS_SERVER_FIXEDLOCAL, ISC_TRUE);
|
||||
ns_server_setoption(sctx, NS_SERVER_CLIENTTEST, true);
|
||||
if (disable4)
|
||||
ns_server_setoption(sctx, NS_SERVER_DISABLE4, ISC_TRUE);
|
||||
ns_server_setoption(sctx, NS_SERVER_DISABLE4, true);
|
||||
if (disable6)
|
||||
ns_server_setoption(sctx, NS_SERVER_DISABLE6, ISC_TRUE);
|
||||
ns_server_setoption(sctx, NS_SERVER_DISABLE6, true);
|
||||
if (dropedns)
|
||||
ns_server_setoption(sctx, NS_SERVER_DROPEDNS, true);
|
||||
if (ednsformerr) /* STD13 server */
|
||||
ns_server_setoption(sctx, NS_SERVER_EDNSFORMERR, true);
|
||||
if (ednsnotimp)
|
||||
ns_server_setoption(sctx, NS_SERVER_EDNSNOTIMP, true);
|
||||
if (ednsrefused)
|
||||
ns_server_setoption(sctx, NS_SERVER_EDNSREFUSED, true);
|
||||
if (fixedlocal)
|
||||
ns_server_setoption(sctx, NS_SERVER_FIXEDLOCAL, true);
|
||||
if (noaa)
|
||||
ns_server_setoption(sctx, NS_SERVER_NOAA, true);
|
||||
if (noedns)
|
||||
ns_server_setoption(sctx, NS_SERVER_NOEDNS, true);
|
||||
if (nonearest)
|
||||
ns_server_setoption(sctx, NS_SERVER_NONEAREST, true);
|
||||
if (nosoa)
|
||||
ns_server_setoption(sctx, NS_SERVER_NOSOA, true);
|
||||
if (notcp)
|
||||
ns_server_setoption(sctx, NS_SERVER_NOTCP, true);
|
||||
if (sigvalinsecs)
|
||||
ns_server_setoption(sctx, NS_SERVER_SIGVALINSECS, ISC_TRUE);
|
||||
ns_server_setoption(sctx, NS_SERVER_SIGVALINSECS, true);
|
||||
|
||||
named_g_server->sctx->delay = delay;
|
||||
}
|
||||
@@ -1394,10 +1380,7 @@ main(int argc, char *argv[]) {
|
||||
named_g_chrootdir);
|
||||
}
|
||||
|
||||
result = isc_mem_create(0, 0, &named_g_mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
named_main_earlyfatal("isc_mem_create() failed: %s",
|
||||
isc_result_totext(result));
|
||||
isc_mem_create(0, 0, &named_g_mctx);
|
||||
isc_mem_setname(named_g_mctx, "main", NULL);
|
||||
|
||||
setup();
|
||||
|
||||
+24
-24
@@ -10,12 +10,12 @@
|
||||
.\" Title: named.conf
|
||||
.\" Author:
|
||||
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
|
||||
.\" Date: 2018-05-29
|
||||
.\" Date: 2018-06-21
|
||||
.\" Manual: BIND9
|
||||
.\" Source: ISC
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "NAMED\&.CONF" "5" "2018\-05\-29" "ISC" "BIND9"
|
||||
.TH "NAMED\&.CONF" "5" "2018\-06\-21" "ISC" "BIND9"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
@@ -231,9 +231,9 @@ options {
|
||||
coresize ( default | unlimited | \fIsizeval\fR );
|
||||
datasize ( default | unlimited | \fIsizeval\fR );
|
||||
deny\-answer\-addresses { \fIaddress_match_element\fR; \&.\&.\&. } [
|
||||
except\-from { \fIquoted_string\fR; \&.\&.\&. } ];
|
||||
deny\-answer\-aliases { \fIquoted_string\fR; \&.\&.\&. } [ except\-from {
|
||||
\fIquoted_string\fR; \&.\&.\&. } ];
|
||||
except\-from { \fIstring\fR; \&.\&.\&. } ];
|
||||
deny\-answer\-aliases { \fIstring\fR; \&.\&.\&. } [ except\-from { \fIstring\fR; \&.\&.\&.
|
||||
} ];
|
||||
dialup ( notify | notify\-passive | passive | refresh | \fIboolean\fR );
|
||||
directory \fIquoted_string\fR;
|
||||
disable\-algorithms \fIstring\fR { \fIstring\fR;
|
||||
@@ -264,14 +264,12 @@ options {
|
||||
dnssec\-secure\-to\-insecure \fIboolean\fR;
|
||||
dnssec\-update\-mode ( maintain | no\-resign );
|
||||
dnssec\-validation ( yes | no | auto );
|
||||
dnstap { ( all | auth | client | forwarder |
|
||||
resolver ) [ ( query | response ) ]; \&.\&.\&. };
|
||||
dnstap\-identity ( \fIquoted_string\fR | none |
|
||||
hostname );
|
||||
dnstap\-output ( file | unix ) \fIquoted_string\fR [
|
||||
size ( unlimited | \fIsize\fR ) ] [ versions (
|
||||
unlimited | \fIinteger\fR ) ] [ suffix ( increment
|
||||
| timestamp ) ];
|
||||
dnstap { ( all | auth | client | forwarder | resolver ) [ ( query |
|
||||
response ) ]; \&.\&.\&. };
|
||||
dnstap\-identity ( \fIquoted_string\fR | none | hostname );
|
||||
dnstap\-output ( file | unix ) \fIquoted_string\fR [ size ( unlimited |
|
||||
\fIsize\fR ) ] [ versions ( unlimited | \fIinteger\fR ) ] [ suffix (
|
||||
increment | timestamp ) ];
|
||||
dnstap\-version ( \fIquoted_string\fR | none );
|
||||
dscp \fIinteger\fR;
|
||||
dual\-stack\-servers [ port \fIinteger\fR ] { ( \fIquoted_string\fR [ port
|
||||
@@ -369,7 +367,7 @@ options {
|
||||
preferred\-glue \fIstring\fR;
|
||||
prefetch \fIinteger\fR [ \fIinteger\fR ];
|
||||
provide\-ixfr \fIboolean\fR;
|
||||
qname\-minimization ( strict | relaxed | disabled );
|
||||
qname\-minimization ( strict | relaxed | disabled | off );
|
||||
query\-source ( ( [ address ] ( \fIipv4_address\fR | * ) [ port (
|
||||
\fIinteger\fR | * ) ] ) | ( [ [ address ] ( \fIipv4_address\fR | * ) ]
|
||||
port ( \fIinteger\fR | * ) ) ) [ dscp \fIinteger\fR ];
|
||||
@@ -420,7 +418,7 @@ options {
|
||||
nsip\-enable \fIboolean\fR ] [ nsdname\-enable \fIboolean\fR ] [
|
||||
dnsrps\-enable \fIboolean\fR ] [ dnsrps\-options { \fIunspecified\-text\fR
|
||||
} ];
|
||||
root\-delegation\-only [ exclude { \fIquoted_string\fR; \&.\&.\&. } ];
|
||||
root\-delegation\-only [ exclude { \fIstring\fR; \&.\&.\&. } ];
|
||||
root\-key\-sentinel \fIboolean\fR;
|
||||
rrset\-order { [ class \fIstring\fR ] [ type \fIstring\fR ] [ name
|
||||
\fIquoted_string\fR ] \fIstring\fR \fIstring\fR; \&.\&.\&. };
|
||||
@@ -470,6 +468,7 @@ options {
|
||||
use\-v4\-udp\-ports { \fIportrange\fR; \&.\&.\&. };
|
||||
use\-v6\-udp\-ports { \fIportrange\fR; \&.\&.\&. };
|
||||
v6\-bias \fIinteger\fR;
|
||||
validate\-except { \fIstring\fR; \&.\&.\&. };
|
||||
version ( \fIquoted_string\fR | none );
|
||||
zero\-no\-soa\-ttl \fIboolean\fR;
|
||||
zero\-no\-soa\-ttl\-cache \fIboolean\fR;
|
||||
@@ -597,9 +596,9 @@ view \fIstring\fR [ \fIclass\fR ] {
|
||||
cleaning\-interval \fIinteger\fR;
|
||||
clients\-per\-query \fIinteger\fR;
|
||||
deny\-answer\-addresses { \fIaddress_match_element\fR; \&.\&.\&. } [
|
||||
except\-from { \fIquoted_string\fR; \&.\&.\&. } ];
|
||||
deny\-answer\-aliases { \fIquoted_string\fR; \&.\&.\&. } [ except\-from {
|
||||
\fIquoted_string\fR; \&.\&.\&. } ];
|
||||
except\-from { \fIstring\fR; \&.\&.\&. } ];
|
||||
deny\-answer\-aliases { \fIstring\fR; \&.\&.\&. } [ except\-from { \fIstring\fR; \&.\&.\&.
|
||||
} ];
|
||||
dialup ( notify | notify\-passive | passive | refresh | \fIboolean\fR );
|
||||
disable\-algorithms \fIstring\fR { \fIstring\fR;
|
||||
\&.\&.\&. };
|
||||
@@ -633,8 +632,8 @@ view \fIstring\fR [ \fIclass\fR ] {
|
||||
dnssec\-secure\-to\-insecure \fIboolean\fR;
|
||||
dnssec\-update\-mode ( maintain | no\-resign );
|
||||
dnssec\-validation ( yes | no | auto );
|
||||
dnstap { ( all | auth | client | forwarder |
|
||||
resolver ) [ ( query | response ) ]; \&.\&.\&. };
|
||||
dnstap { ( all | auth | client | forwarder | resolver ) [ ( query |
|
||||
response ) ]; \&.\&.\&. };
|
||||
dual\-stack\-servers [ port \fIinteger\fR ] { ( \fIquoted_string\fR [ port
|
||||
\fIinteger\fR ] [ dscp \fIinteger\fR ] | \fIipv4_address\fR [ port
|
||||
\fIinteger\fR ] [ dscp \fIinteger\fR ] | \fIipv6_address\fR [ port
|
||||
@@ -712,7 +711,7 @@ view \fIstring\fR [ \fIclass\fR ] {
|
||||
preferred\-glue \fIstring\fR;
|
||||
prefetch \fIinteger\fR [ \fIinteger\fR ];
|
||||
provide\-ixfr \fIboolean\fR;
|
||||
qname\-minimization ( strict | relaxed | disabled );
|
||||
qname\-minimization ( strict | relaxed | disabled | off );
|
||||
query\-source ( ( [ address ] ( \fIipv4_address\fR | * ) [ port (
|
||||
\fIinteger\fR | * ) ] ) | ( [ [ address ] ( \fIipv4_address\fR | * ) ]
|
||||
port ( \fIinteger\fR | * ) ) ) [ dscp \fIinteger\fR ];
|
||||
@@ -758,7 +757,7 @@ view \fIstring\fR [ \fIclass\fR ] {
|
||||
nsip\-enable \fIboolean\fR ] [ nsdname\-enable \fIboolean\fR ] [
|
||||
dnsrps\-enable \fIboolean\fR ] [ dnsrps\-options { \fIunspecified\-text\fR
|
||||
} ];
|
||||
root\-delegation\-only [ exclude { \fIquoted_string\fR; \&.\&.\&. } ];
|
||||
root\-delegation\-only [ exclude { \fIstring\fR; \&.\&.\&. } ];
|
||||
root\-key\-sentinel \fIboolean\fR;
|
||||
rrset\-order { [ class \fIstring\fR ] [ type \fIstring\fR ] [ name
|
||||
\fIquoted_string\fR ] \fIstring\fR \fIstring\fR; \&.\&.\&. };
|
||||
@@ -820,6 +819,7 @@ view \fIstring\fR [ \fIclass\fR ] {
|
||||
update\-check\-ksk \fIboolean\fR;
|
||||
use\-alt\-transfer\-source \fIboolean\fR;
|
||||
v6\-bias \fIinteger\fR;
|
||||
validate\-except { \fIstring\fR; \&.\&.\&. };
|
||||
zero\-no\-soa\-ttl \fIboolean\fR;
|
||||
zero\-no\-soa\-ttl\-cache \fIboolean\fR;
|
||||
zone \fIstring\fR [ \fIclass\fR ] {
|
||||
@@ -901,7 +901,7 @@ view \fIstring\fR [ \fIclass\fR ] {
|
||||
serial\-update\-method ( date | increment | unixtime );
|
||||
server\-addresses { ( \fIipv4_address\fR | \fIipv6_address\fR ) [
|
||||
port \fIinteger\fR ]; \&.\&.\&. };
|
||||
server\-names { \fIquoted_string\fR; \&.\&.\&. };
|
||||
server\-names { \fIstring\fR; \&.\&.\&. };
|
||||
sig\-signing\-nodes \fIinteger\fR;
|
||||
sig\-signing\-signatures \fIinteger\fR;
|
||||
sig\-signing\-type \fIinteger\fR;
|
||||
@@ -1009,7 +1009,7 @@ zone \fIstring\fR [ \fIclass\fR ] {
|
||||
serial\-update\-method ( date | increment | unixtime );
|
||||
server\-addresses { ( \fIipv4_address\fR | \fIipv6_address\fR ) [ port
|
||||
\fIinteger\fR ]; \&.\&.\&. };
|
||||
server\-names { \fIquoted_string\fR; \&.\&.\&. };
|
||||
server\-names { \fIstring\fR; \&.\&.\&. };
|
||||
sig\-signing\-nodes \fIinteger\fR;
|
||||
sig\-signing\-signatures \fIinteger\fR;
|
||||
sig\-signing\-type \fIinteger\fR;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<refentry xmlns:db="http://docbook.org/ns/docbook" version="5.0" xml:id="man.named.conf">
|
||||
<info>
|
||||
<date>2018-05-29</date>
|
||||
<date>2018-06-21</date>
|
||||
</info>
|
||||
<refentryinfo>
|
||||
<corpname>ISC</corpname>
|
||||
@@ -224,9 +224,9 @@ options {
|
||||
coresize ( default | unlimited | <replaceable>sizeval</replaceable> );
|
||||
datasize ( default | unlimited | <replaceable>sizeval</replaceable> );
|
||||
deny-answer-addresses { <replaceable>address_match_element</replaceable>; ... } [
|
||||
except-from { <replaceable>quoted_string</replaceable>; ... } ];
|
||||
deny-answer-aliases { <replaceable>quoted_string</replaceable>; ... } [ except-from {
|
||||
<replaceable>quoted_string</replaceable>; ... } ];
|
||||
except-from { <replaceable>string</replaceable>; ... } ];
|
||||
deny-answer-aliases { <replaceable>string</replaceable>; ... } [ except-from { <replaceable>string</replaceable>; ...
|
||||
} ];
|
||||
dialup ( notify | notify-passive | passive | refresh | <replaceable>boolean</replaceable> );
|
||||
directory <replaceable>quoted_string</replaceable>;
|
||||
disable-algorithms <replaceable>string</replaceable> { <replaceable>string</replaceable>;
|
||||
@@ -257,14 +257,12 @@ options {
|
||||
dnssec-secure-to-insecure <replaceable>boolean</replaceable>;
|
||||
dnssec-update-mode ( maintain | no-resign );
|
||||
dnssec-validation ( yes | no | auto );
|
||||
dnstap { ( all | auth | client | forwarder |
|
||||
resolver ) [ ( query | response ) ]; ... };
|
||||
dnstap-identity ( <replaceable>quoted_string</replaceable> | none |
|
||||
hostname );
|
||||
dnstap-output ( file | unix ) <replaceable>quoted_string</replaceable> [
|
||||
size ( unlimited | <replaceable>size</replaceable> ) ] [ versions (
|
||||
unlimited | <replaceable>integer</replaceable> ) ] [ suffix ( increment
|
||||
| timestamp ) ];
|
||||
dnstap { ( all | auth | client | forwarder | resolver ) [ ( query |
|
||||
response ) ]; ... };
|
||||
dnstap-identity ( <replaceable>quoted_string</replaceable> | none | hostname );
|
||||
dnstap-output ( file | unix ) <replaceable>quoted_string</replaceable> [ size ( unlimited |
|
||||
<replaceable>size</replaceable> ) ] [ versions ( unlimited | <replaceable>integer</replaceable> ) ] [ suffix (
|
||||
increment | timestamp ) ];
|
||||
dnstap-version ( <replaceable>quoted_string</replaceable> | none );
|
||||
dscp <replaceable>integer</replaceable>;
|
||||
dual-stack-servers [ port <replaceable>integer</replaceable> ] { ( <replaceable>quoted_string</replaceable> [ port
|
||||
@@ -362,7 +360,7 @@ options {
|
||||
preferred-glue <replaceable>string</replaceable>;
|
||||
prefetch <replaceable>integer</replaceable> [ <replaceable>integer</replaceable> ];
|
||||
provide-ixfr <replaceable>boolean</replaceable>;
|
||||
qname-minimization ( strict | relaxed | disabled );
|
||||
qname-minimization ( strict | relaxed | disabled | off );
|
||||
query-source ( ( [ address ] ( <replaceable>ipv4_address</replaceable> | * ) [ port (
|
||||
<replaceable>integer</replaceable> | * ) ] ) | ( [ [ address ] ( <replaceable>ipv4_address</replaceable> | * ) ]
|
||||
port ( <replaceable>integer</replaceable> | * ) ) ) [ dscp <replaceable>integer</replaceable> ];
|
||||
@@ -413,7 +411,7 @@ options {
|
||||
nsip-enable <replaceable>boolean</replaceable> ] [ nsdname-enable <replaceable>boolean</replaceable> ] [
|
||||
dnsrps-enable <replaceable>boolean</replaceable> ] [ dnsrps-options { <replaceable>unspecified-text</replaceable>
|
||||
} ];
|
||||
root-delegation-only [ exclude { <replaceable>quoted_string</replaceable>; ... } ];
|
||||
root-delegation-only [ exclude { <replaceable>string</replaceable>; ... } ];
|
||||
root-key-sentinel <replaceable>boolean</replaceable>;
|
||||
rrset-order { [ class <replaceable>string</replaceable> ] [ type <replaceable>string</replaceable> ] [ name
|
||||
<replaceable>quoted_string</replaceable> ] <replaceable>string</replaceable> <replaceable>string</replaceable>; ... };
|
||||
@@ -463,6 +461,7 @@ options {
|
||||
use-v4-udp-ports { <replaceable>portrange</replaceable>; ... };
|
||||
use-v6-udp-ports { <replaceable>portrange</replaceable>; ... };
|
||||
v6-bias <replaceable>integer</replaceable>;
|
||||
validate-except { <replaceable>string</replaceable>; ... };
|
||||
version ( <replaceable>quoted_string</replaceable> | none );
|
||||
zero-no-soa-ttl <replaceable>boolean</replaceable>;
|
||||
zero-no-soa-ttl-cache <replaceable>boolean</replaceable>;
|
||||
@@ -574,9 +573,9 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
|
||||
cleaning-interval <replaceable>integer</replaceable>;
|
||||
clients-per-query <replaceable>integer</replaceable>;
|
||||
deny-answer-addresses { <replaceable>address_match_element</replaceable>; ... } [
|
||||
except-from { <replaceable>quoted_string</replaceable>; ... } ];
|
||||
deny-answer-aliases { <replaceable>quoted_string</replaceable>; ... } [ except-from {
|
||||
<replaceable>quoted_string</replaceable>; ... } ];
|
||||
except-from { <replaceable>string</replaceable>; ... } ];
|
||||
deny-answer-aliases { <replaceable>string</replaceable>; ... } [ except-from { <replaceable>string</replaceable>; ...
|
||||
} ];
|
||||
dialup ( notify | notify-passive | passive | refresh | <replaceable>boolean</replaceable> );
|
||||
disable-algorithms <replaceable>string</replaceable> { <replaceable>string</replaceable>;
|
||||
... };
|
||||
@@ -610,8 +609,8 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
|
||||
dnssec-secure-to-insecure <replaceable>boolean</replaceable>;
|
||||
dnssec-update-mode ( maintain | no-resign );
|
||||
dnssec-validation ( yes | no | auto );
|
||||
dnstap { ( all | auth | client | forwarder |
|
||||
resolver ) [ ( query | response ) ]; ... };
|
||||
dnstap { ( all | auth | client | forwarder | resolver ) [ ( query |
|
||||
response ) ]; ... };
|
||||
dual-stack-servers [ port <replaceable>integer</replaceable> ] { ( <replaceable>quoted_string</replaceable> [ port
|
||||
<replaceable>integer</replaceable> ] [ dscp <replaceable>integer</replaceable> ] | <replaceable>ipv4_address</replaceable> [ port
|
||||
<replaceable>integer</replaceable> ] [ dscp <replaceable>integer</replaceable> ] | <replaceable>ipv6_address</replaceable> [ port
|
||||
@@ -689,7 +688,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
|
||||
preferred-glue <replaceable>string</replaceable>;
|
||||
prefetch <replaceable>integer</replaceable> [ <replaceable>integer</replaceable> ];
|
||||
provide-ixfr <replaceable>boolean</replaceable>;
|
||||
qname-minimization ( strict | relaxed | disabled );
|
||||
qname-minimization ( strict | relaxed | disabled | off );
|
||||
query-source ( ( [ address ] ( <replaceable>ipv4_address</replaceable> | * ) [ port (
|
||||
<replaceable>integer</replaceable> | * ) ] ) | ( [ [ address ] ( <replaceable>ipv4_address</replaceable> | * ) ]
|
||||
port ( <replaceable>integer</replaceable> | * ) ) ) [ dscp <replaceable>integer</replaceable> ];
|
||||
@@ -735,7 +734,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
|
||||
nsip-enable <replaceable>boolean</replaceable> ] [ nsdname-enable <replaceable>boolean</replaceable> ] [
|
||||
dnsrps-enable <replaceable>boolean</replaceable> ] [ dnsrps-options { <replaceable>unspecified-text</replaceable>
|
||||
} ];
|
||||
root-delegation-only [ exclude { <replaceable>quoted_string</replaceable>; ... } ];
|
||||
root-delegation-only [ exclude { <replaceable>string</replaceable>; ... } ];
|
||||
root-key-sentinel <replaceable>boolean</replaceable>;
|
||||
rrset-order { [ class <replaceable>string</replaceable> ] [ type <replaceable>string</replaceable> ] [ name
|
||||
<replaceable>quoted_string</replaceable> ] <replaceable>string</replaceable> <replaceable>string</replaceable>; ... };
|
||||
@@ -797,6 +796,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
|
||||
update-check-ksk <replaceable>boolean</replaceable>;
|
||||
use-alt-transfer-source <replaceable>boolean</replaceable>;
|
||||
v6-bias <replaceable>integer</replaceable>;
|
||||
validate-except { <replaceable>string</replaceable>; ... };
|
||||
zero-no-soa-ttl <replaceable>boolean</replaceable>;
|
||||
zero-no-soa-ttl-cache <replaceable>boolean</replaceable>;
|
||||
zone <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
|
||||
@@ -878,7 +878,7 @@ view <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
|
||||
serial-update-method ( date | increment | unixtime );
|
||||
server-addresses { ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> ) [
|
||||
port <replaceable>integer</replaceable> ]; ... };
|
||||
server-names { <replaceable>quoted_string</replaceable>; ... };
|
||||
server-names { <replaceable>string</replaceable>; ... };
|
||||
sig-signing-nodes <replaceable>integer</replaceable>;
|
||||
sig-signing-signatures <replaceable>integer</replaceable>;
|
||||
sig-signing-type <replaceable>integer</replaceable>;
|
||||
@@ -982,7 +982,7 @@ zone <replaceable>string</replaceable> [ <replaceable>class</replaceable> ] {
|
||||
serial-update-method ( date | increment | unixtime );
|
||||
server-addresses { ( <replaceable>ipv4_address</replaceable> | <replaceable>ipv6_address</replaceable> ) [ port
|
||||
<replaceable>integer</replaceable> ]; ... };
|
||||
server-names { <replaceable>quoted_string</replaceable>; ... };
|
||||
server-names { <replaceable>string</replaceable>; ... };
|
||||
sig-signing-nodes <replaceable>integer</replaceable>;
|
||||
sig-signing-signatures <replaceable>integer</replaceable>;
|
||||
sig-signing-type <replaceable>integer</replaceable>;
|
||||
|
||||
+22
-22
@@ -212,9 +212,9 @@ options
|
||||
coresize ( default | unlimited | <em class="replaceable"><code>sizeval</code></em> );<br>
|
||||
datasize ( default | unlimited | <em class="replaceable"><code>sizeval</code></em> );<br>
|
||||
deny-answer-addresses { <em class="replaceable"><code>address_match_element</code></em>; ... } [<br>
|
||||
except-from { <em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
|
||||
deny-answer-aliases { <em class="replaceable"><code>quoted_string</code></em>; ... } [ except-from {<br>
|
||||
<em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
|
||||
except-from { <em class="replaceable"><code>string</code></em>; ... } ];<br>
|
||||
deny-answer-aliases { <em class="replaceable"><code>string</code></em>; ... } [ except-from { <em class="replaceable"><code>string</code></em>; ...<br>
|
||||
} ];<br>
|
||||
dialup ( notify | notify-passive | passive | refresh | <em class="replaceable"><code>boolean</code></em> );<br>
|
||||
directory <em class="replaceable"><code>quoted_string</code></em>;<br>
|
||||
disable-algorithms <em class="replaceable"><code>string</code></em> { <em class="replaceable"><code>string</code></em>;<br>
|
||||
@@ -245,14 +245,12 @@ options
|
||||
dnssec-secure-to-insecure <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
dnssec-update-mode ( maintain | no-resign );<br>
|
||||
dnssec-validation ( yes | no | auto );<br>
|
||||
dnstap { ( all | auth | client | forwarder |<br>
|
||||
resolver ) [ ( query | response ) ]; ... };<br>
|
||||
dnstap-identity ( <em class="replaceable"><code>quoted_string</code></em> | none |<br>
|
||||
hostname );<br>
|
||||
dnstap-output ( file | unix ) <em class="replaceable"><code>quoted_string</code></em> [<br>
|
||||
size ( unlimited | <em class="replaceable"><code>size</code></em> ) ] [ versions (<br>
|
||||
unlimited | <em class="replaceable"><code>integer</code></em> ) ] [ suffix ( increment<br>
|
||||
| timestamp ) ];<br>
|
||||
dnstap { ( all | auth | client | forwarder | resolver ) [ ( query |<br>
|
||||
response ) ]; ... };<br>
|
||||
dnstap-identity ( <em class="replaceable"><code>quoted_string</code></em> | none | hostname );<br>
|
||||
dnstap-output ( file | unix ) <em class="replaceable"><code>quoted_string</code></em> [ size ( unlimited |<br>
|
||||
<em class="replaceable"><code>size</code></em> ) ] [ versions ( unlimited | <em class="replaceable"><code>integer</code></em> ) ] [ suffix (<br>
|
||||
increment | timestamp ) ];<br>
|
||||
dnstap-version ( <em class="replaceable"><code>quoted_string</code></em> | none );<br>
|
||||
dscp <em class="replaceable"><code>integer</code></em>;<br>
|
||||
dual-stack-servers [ port <em class="replaceable"><code>integer</code></em> ] { ( <em class="replaceable"><code>quoted_string</code></em> [ port<br>
|
||||
@@ -350,7 +348,7 @@ options
|
||||
preferred-glue <em class="replaceable"><code>string</code></em>;<br>
|
||||
prefetch <em class="replaceable"><code>integer</code></em> [ <em class="replaceable"><code>integer</code></em> ];<br>
|
||||
provide-ixfr <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
qname-minimization ( strict | relaxed | disabled );<br>
|
||||
qname-minimization ( strict | relaxed | disabled | off );<br>
|
||||
query-source ( ( [ address ] ( <em class="replaceable"><code>ipv4_address</code></em> | * ) [ port (<br>
|
||||
<em class="replaceable"><code>integer</code></em> | * ) ] ) | ( [ [ address ] ( <em class="replaceable"><code>ipv4_address</code></em> | * ) ]<br>
|
||||
port ( <em class="replaceable"><code>integer</code></em> | * ) ) ) [ dscp <em class="replaceable"><code>integer</code></em> ];<br>
|
||||
@@ -401,7 +399,7 @@ options
|
||||
nsip-enable <em class="replaceable"><code>boolean</code></em> ] [ nsdname-enable <em class="replaceable"><code>boolean</code></em> ] [<br>
|
||||
dnsrps-enable <em class="replaceable"><code>boolean</code></em> ] [ dnsrps-options { <em class="replaceable"><code>unspecified-text</code></em><br>
|
||||
} ];<br>
|
||||
root-delegation-only [ exclude { <em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
|
||||
root-delegation-only [ exclude { <em class="replaceable"><code>string</code></em>; ... } ];<br>
|
||||
root-key-sentinel <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
rrset-order { [ class <em class="replaceable"><code>string</code></em> ] [ type <em class="replaceable"><code>string</code></em> ] [ name<br>
|
||||
<em class="replaceable"><code>quoted_string</code></em> ] <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>string</code></em>; ... };<br>
|
||||
@@ -451,6 +449,7 @@ options
|
||||
use-v4-udp-ports { <em class="replaceable"><code>portrange</code></em>; ... };<br>
|
||||
use-v6-udp-ports { <em class="replaceable"><code>portrange</code></em>; ... };<br>
|
||||
v6-bias <em class="replaceable"><code>integer</code></em>;<br>
|
||||
validate-except { <em class="replaceable"><code>string</code></em>; ... };<br>
|
||||
version ( <em class="replaceable"><code>quoted_string</code></em> | none );<br>
|
||||
zero-no-soa-ttl <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
zero-no-soa-ttl-cache <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
@@ -566,9 +565,9 @@ view
|
||||
cleaning-interval <em class="replaceable"><code>integer</code></em>;<br>
|
||||
clients-per-query <em class="replaceable"><code>integer</code></em>;<br>
|
||||
deny-answer-addresses { <em class="replaceable"><code>address_match_element</code></em>; ... } [<br>
|
||||
except-from { <em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
|
||||
deny-answer-aliases { <em class="replaceable"><code>quoted_string</code></em>; ... } [ except-from {<br>
|
||||
<em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
|
||||
except-from { <em class="replaceable"><code>string</code></em>; ... } ];<br>
|
||||
deny-answer-aliases { <em class="replaceable"><code>string</code></em>; ... } [ except-from { <em class="replaceable"><code>string</code></em>; ...<br>
|
||||
} ];<br>
|
||||
dialup ( notify | notify-passive | passive | refresh | <em class="replaceable"><code>boolean</code></em> );<br>
|
||||
disable-algorithms <em class="replaceable"><code>string</code></em> { <em class="replaceable"><code>string</code></em>;<br>
|
||||
... };<br>
|
||||
@@ -602,8 +601,8 @@ view
|
||||
dnssec-secure-to-insecure <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
dnssec-update-mode ( maintain | no-resign );<br>
|
||||
dnssec-validation ( yes | no | auto );<br>
|
||||
dnstap { ( all | auth | client | forwarder |<br>
|
||||
resolver ) [ ( query | response ) ]; ... };<br>
|
||||
dnstap { ( all | auth | client | forwarder | resolver ) [ ( query |<br>
|
||||
response ) ]; ... };<br>
|
||||
dual-stack-servers [ port <em class="replaceable"><code>integer</code></em> ] { ( <em class="replaceable"><code>quoted_string</code></em> [ port<br>
|
||||
<em class="replaceable"><code>integer</code></em> ] [ dscp <em class="replaceable"><code>integer</code></em> ] | <em class="replaceable"><code>ipv4_address</code></em> [ port<br>
|
||||
<em class="replaceable"><code>integer</code></em> ] [ dscp <em class="replaceable"><code>integer</code></em> ] | <em class="replaceable"><code>ipv6_address</code></em> [ port<br>
|
||||
@@ -681,7 +680,7 @@ view
|
||||
preferred-glue <em class="replaceable"><code>string</code></em>;<br>
|
||||
prefetch <em class="replaceable"><code>integer</code></em> [ <em class="replaceable"><code>integer</code></em> ];<br>
|
||||
provide-ixfr <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
qname-minimization ( strict | relaxed | disabled );<br>
|
||||
qname-minimization ( strict | relaxed | disabled | off );<br>
|
||||
query-source ( ( [ address ] ( <em class="replaceable"><code>ipv4_address</code></em> | * ) [ port (<br>
|
||||
<em class="replaceable"><code>integer</code></em> | * ) ] ) | ( [ [ address ] ( <em class="replaceable"><code>ipv4_address</code></em> | * ) ]<br>
|
||||
port ( <em class="replaceable"><code>integer</code></em> | * ) ) ) [ dscp <em class="replaceable"><code>integer</code></em> ];<br>
|
||||
@@ -727,7 +726,7 @@ view
|
||||
nsip-enable <em class="replaceable"><code>boolean</code></em> ] [ nsdname-enable <em class="replaceable"><code>boolean</code></em> ] [<br>
|
||||
dnsrps-enable <em class="replaceable"><code>boolean</code></em> ] [ dnsrps-options { <em class="replaceable"><code>unspecified-text</code></em><br>
|
||||
} ];<br>
|
||||
root-delegation-only [ exclude { <em class="replaceable"><code>quoted_string</code></em>; ... } ];<br>
|
||||
root-delegation-only [ exclude { <em class="replaceable"><code>string</code></em>; ... } ];<br>
|
||||
root-key-sentinel <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
rrset-order { [ class <em class="replaceable"><code>string</code></em> ] [ type <em class="replaceable"><code>string</code></em> ] [ name<br>
|
||||
<em class="replaceable"><code>quoted_string</code></em> ] <em class="replaceable"><code>string</code></em> <em class="replaceable"><code>string</code></em>; ... };<br>
|
||||
@@ -789,6 +788,7 @@ view
|
||||
update-check-ksk <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
use-alt-transfer-source <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
v6-bias <em class="replaceable"><code>integer</code></em>;<br>
|
||||
validate-except { <em class="replaceable"><code>string</code></em>; ... };<br>
|
||||
zero-no-soa-ttl <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
zero-no-soa-ttl-cache <em class="replaceable"><code>boolean</code></em>;<br>
|
||||
zone <em class="replaceable"><code>string</code></em> [ <em class="replaceable"><code>class</code></em> ] {<br>
|
||||
@@ -870,7 +870,7 @@ view
|
||||
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>
|
||||
port <em class="replaceable"><code>integer</code></em> ]; ... };<br>
|
||||
server-names { <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
|
||||
server-names { <em class="replaceable"><code>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>
|
||||
sig-signing-type <em class="replaceable"><code>integer</code></em>;<br>
|
||||
@@ -975,7 +975,7 @@ zone
|
||||
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> ) [ port<br>
|
||||
<em class="replaceable"><code>integer</code></em> ]; ... };<br>
|
||||
server-names { <em class="replaceable"><code>quoted_string</code></em>; ... };<br>
|
||||
server-names { <em class="replaceable"><code>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>
|
||||
sig-signing-type <em class="replaceable"><code>integer</code></em>;<br>
|
||||
|
||||
+753
-660
File diff suppressed because it is too large
Load Diff
+76
-79
@@ -13,6 +13,9 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/httpd.h>
|
||||
#include <isc/json.h>
|
||||
@@ -67,7 +70,7 @@ stats_dumparg {
|
||||
void *arg; /* type dependent argument */
|
||||
int ncounters; /* for general statistics */
|
||||
int *counterindices; /* for general statistics */
|
||||
isc_uint64_t *countervalues; /* for general statistics */
|
||||
uint64_t *countervalues; /* for general statistics */
|
||||
isc_result_t result;
|
||||
} stats_dumparg_t;
|
||||
|
||||
@@ -1048,7 +1051,7 @@ init_desc(void) {
|
||||
* Dump callback functions.
|
||||
*/
|
||||
static void
|
||||
generalstat_dump(isc_statscounter_t counter, isc_uint64_t val, void *arg) {
|
||||
generalstat_dump(isc_statscounter_t counter, uint64_t val, void *arg) {
|
||||
stats_dumparg_t *dumparg = arg;
|
||||
|
||||
REQUIRE(counter < dumparg->ncounters);
|
||||
@@ -1058,10 +1061,10 @@ generalstat_dump(isc_statscounter_t counter, isc_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, isc_uint64_t *values, int options)
|
||||
int *indices, uint64_t *values, int options)
|
||||
{
|
||||
int i, idx;
|
||||
isc_uint64_t value;
|
||||
uint64_t value;
|
||||
stats_dumparg_t dumparg;
|
||||
FILE *fp;
|
||||
#ifdef HAVE_LIBXML2
|
||||
@@ -1106,7 +1109,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" ISC_PRINT_QUADFORMAT "u %s\n",
|
||||
fprintf(fp, "%20" PRIu64 " %s\n",
|
||||
value, desc[idx]);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
@@ -1134,7 +1137,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
||||
ISC_XMLCHAR
|
||||
"counter"));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u", value));
|
||||
"%" PRIu64, value));
|
||||
|
||||
TRY0(xmlTextWriterEndElement(writer));
|
||||
/* </counter> */
|
||||
@@ -1151,7 +1154,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
||||
ISC_XMLCHAR
|
||||
desc[idx]));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u", value));
|
||||
"%" PRIu64, value));
|
||||
TRY0(xmlTextWriterEndElement(writer));
|
||||
/* counter */
|
||||
}
|
||||
@@ -1179,7 +1182,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
||||
}
|
||||
|
||||
static void
|
||||
rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
rdtypestat_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
|
||||
char typebuf[64];
|
||||
const char *typestr;
|
||||
stats_dumparg_t *dumparg = arg;
|
||||
@@ -1203,7 +1206,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
switch (dumparg->type) {
|
||||
case isc_statsformat_file:
|
||||
fp = dumparg->arg;
|
||||
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, typestr);
|
||||
fprintf(fp, "%20" PRIu64 " %s\n", val, typestr);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
#ifdef HAVE_LIBXML2
|
||||
@@ -1215,7 +1218,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
ISC_XMLCHAR typestr));
|
||||
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u",
|
||||
"%" PRIu64,
|
||||
val));
|
||||
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* type */
|
||||
@@ -1243,13 +1246,13 @@ rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
}
|
||||
|
||||
static void
|
||||
rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
rdatasetstats_dump(dns_rdatastatstype_t type, uint64_t val, void *arg) {
|
||||
stats_dumparg_t *dumparg = arg;
|
||||
FILE *fp;
|
||||
char typebuf[64];
|
||||
const char *typestr;
|
||||
isc_boolean_t nxrrset = ISC_FALSE;
|
||||
isc_boolean_t stale = ISC_FALSE;
|
||||
bool nxrrset = false;
|
||||
bool stale = false;
|
||||
#ifdef HAVE_LIBXML2
|
||||
xmlTextWriterPtr writer;
|
||||
int xmlrc;
|
||||
@@ -1273,16 +1276,16 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
|
||||
if ((DNS_RDATASTATSTYPE_ATTR(type) & DNS_RDATASTATSTYPE_ATTR_NXRRSET)
|
||||
!= 0)
|
||||
nxrrset = ISC_TRUE;
|
||||
nxrrset = true;
|
||||
|
||||
if ((DNS_RDATASTATSTYPE_ATTR(type) & DNS_RDATASTATSTYPE_ATTR_STALE)
|
||||
!= 0)
|
||||
stale = ISC_TRUE;
|
||||
stale = true;
|
||||
|
||||
switch (dumparg->type) {
|
||||
case isc_statsformat_file:
|
||||
fp = dumparg->arg;
|
||||
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s%s%s\n", val,
|
||||
fprintf(fp, "%20" PRIu64 " %s%s%s\n", val,
|
||||
stale ? "#" : "", nxrrset ? "!" : "", typestr);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
@@ -1298,7 +1301,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
|
||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counter"));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u",
|
||||
"%" PRIu64,
|
||||
val));
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* counter */
|
||||
|
||||
@@ -1329,7 +1332,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
}
|
||||
|
||||
static void
|
||||
opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
|
||||
opcodestat_dump(dns_opcode_t code, uint64_t val, void *arg) {
|
||||
FILE *fp;
|
||||
isc_buffer_t b;
|
||||
char codebuf[64];
|
||||
@@ -1349,7 +1352,7 @@ opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
|
||||
switch (dumparg->type) {
|
||||
case isc_statsformat_file:
|
||||
fp = dumparg->arg;
|
||||
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, codebuf);
|
||||
fprintf(fp, "%20" PRIu64 " %s\n", val, codebuf);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
#ifdef HAVE_LIBXML2
|
||||
@@ -1358,7 +1361,7 @@ opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
|
||||
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
|
||||
ISC_XMLCHAR codebuf ));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u",
|
||||
"%" PRIu64,
|
||||
val));
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* counter */
|
||||
#endif
|
||||
@@ -1386,7 +1389,7 @@ opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
|
||||
}
|
||||
|
||||
static void
|
||||
rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
|
||||
rcodestat_dump(dns_rcode_t code, uint64_t val, void *arg) {
|
||||
FILE *fp;
|
||||
isc_buffer_t b;
|
||||
char codebuf[64];
|
||||
@@ -1406,7 +1409,7 @@ rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
|
||||
switch (dumparg->type) {
|
||||
case isc_statsformat_file:
|
||||
fp = dumparg->arg;
|
||||
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, codebuf);
|
||||
fprintf(fp, "%20" PRIu64 " %s\n", val, codebuf);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
#ifdef HAVE_LIBXML2
|
||||
@@ -1415,7 +1418,7 @@ rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
|
||||
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
|
||||
ISC_XMLCHAR codebuf ));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u",
|
||||
"%" PRIu64,
|
||||
val));
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* counter */
|
||||
#endif
|
||||
@@ -1460,7 +1463,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;
|
||||
isc_uint32_t serial;
|
||||
uint32_t serial;
|
||||
xmlTextWriterPtr writer = arg;
|
||||
dns_zonestat_level_t statlevel;
|
||||
int xmlrc;
|
||||
@@ -1504,8 +1507,8 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
|
||||
isc_stats_t *zonestats;
|
||||
isc_stats_t *gluecachestats;
|
||||
dns_stats_t *rcvquerystats;
|
||||
isc_uint64_t nsstat_values[ns_statscounter_max];
|
||||
isc_uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
|
||||
uint64_t nsstat_values[ns_statscounter_max];
|
||||
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
|
||||
|
||||
zonestats = dns_zone_getrequeststats(zone);
|
||||
if (zonestats != NULL) {
|
||||
@@ -1578,7 +1581,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
generatexml(named_server_t *server, isc_uint32_t flags,
|
||||
generatexml(named_server_t *server, uint32_t flags,
|
||||
int *buflen, xmlChar **buf)
|
||||
{
|
||||
char boottime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
|
||||
@@ -1591,17 +1594,17 @@ generatexml(named_server_t *server, isc_uint32_t flags,
|
||||
dns_view_t *view;
|
||||
stats_dumparg_t dumparg;
|
||||
dns_stats_t *cacherrstats;
|
||||
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];
|
||||
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];
|
||||
#ifdef HAVE_DNSTAP
|
||||
isc_uint64_t dnstapstat_values[dns_dnstapcounter_max];
|
||||
uint64_t dnstapstat_values[dns_dnstapcounter_max];
|
||||
#endif
|
||||
isc_result_t result;
|
||||
|
||||
@@ -1915,7 +1918,7 @@ generatexml(named_server_t *server, isc_uint32_t flags,
|
||||
if ((flags & STATS_XML_ZONES) != 0) {
|
||||
TRY0(xmlTextWriterStartElement(writer,
|
||||
ISC_XMLCHAR "zones"));
|
||||
result = dns_zt_apply(view->zonetable, ISC_TRUE,
|
||||
result = dns_zt_apply(view->zonetable, true,
|
||||
NULL, zone_xmlrender, writer);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto error;
|
||||
@@ -2053,7 +2056,7 @@ wrap_xmlfree(isc_buffer_t *buffer, void *arg) {
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
render_xml(isc_uint32_t flags, const char *url, isc_httpdurl_t *urlinfo,
|
||||
render_xml(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,
|
||||
@@ -2228,7 +2231,7 @@ wrap_jsonfree(isc_buffer_t *buffer, void *arg) {
|
||||
|
||||
static json_object *
|
||||
addzone(char *name, char *classname, const char *ztype,
|
||||
isc_uint32_t serial, isc_boolean_t add_serial)
|
||||
uint32_t serial, bool add_serial)
|
||||
{
|
||||
json_object *node = json_object_new_object();
|
||||
|
||||
@@ -2255,7 +2258,7 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
char *zone_name_only = NULL;
|
||||
char *class_only = NULL;
|
||||
dns_rdataclass_t rdclass;
|
||||
isc_uint32_t serial;
|
||||
uint32_t serial;
|
||||
json_object *zonearray = (json_object *) arg;
|
||||
json_object *zoneobj = NULL;
|
||||
dns_zonestat_level_t statlevel;
|
||||
@@ -2273,10 +2276,10 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
|
||||
if (dns_zone_getserial(zone, &serial) != ISC_R_SUCCESS)
|
||||
zoneobj = addzone(zone_name_only, class_only,
|
||||
user_zonetype(zone), 0, ISC_FALSE);
|
||||
user_zonetype(zone), 0, false);
|
||||
else
|
||||
zoneobj = addzone(zone_name_only, class_only,
|
||||
user_zonetype(zone), serial, ISC_TRUE);
|
||||
user_zonetype(zone), serial, true);
|
||||
|
||||
if (zoneobj == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
@@ -2285,8 +2288,8 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
isc_stats_t *zonestats;
|
||||
isc_stats_t *gluecachestats;
|
||||
dns_stats_t *rcvquerystats;
|
||||
isc_uint64_t nsstat_values[ns_statscounter_max];
|
||||
isc_uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
|
||||
uint64_t nsstat_values[ns_statscounter_max];
|
||||
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
|
||||
|
||||
zonestats = dns_zone_getrequeststats(zone);
|
||||
if (zonestats != NULL) {
|
||||
@@ -2376,7 +2379,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, isc_uint32_t flags)
|
||||
const char **msg, json_object **rootp, uint32_t flags)
|
||||
{
|
||||
dns_view_t *view;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
@@ -2386,17 +2389,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;
|
||||
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];
|
||||
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];
|
||||
#ifdef HAVE_DNSTAP
|
||||
isc_uint64_t dnstapstat_values[dns_dnstapcounter_max];
|
||||
uint64_t dnstapstat_values[dns_dnstapcounter_max];
|
||||
#endif
|
||||
stats_dumparg_t dumparg;
|
||||
char boottime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
|
||||
@@ -2610,7 +2613,7 @@ generatejson(named_server_t *server, size_t *msglen,
|
||||
|
||||
if ((flags & STATS_JSON_ZONES) != 0) {
|
||||
result = dns_zt_apply(view->zonetable,
|
||||
ISC_TRUE,
|
||||
true,
|
||||
NULL, zone_jsonrender,
|
||||
za);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
@@ -2955,7 +2958,7 @@ generatejson(named_server_t *server, size_t *msglen,
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
render_json(isc_uint32_t flags,
|
||||
render_json(uint32_t flags,
|
||||
const char *url, isc_httpdurl_t *urlinfo,
|
||||
const char *querystring, const char *headers,
|
||||
void *arg, unsigned int *retcode, const char **retmsg,
|
||||
@@ -3182,7 +3185,7 @@ shutdown_listener(named_statschannel_t *listener) {
|
||||
isc_httpdmgr_shutdown(&listener->httpdmgr);
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
|
||||
named_statschannel_t *listener = arg;
|
||||
dns_aclenv_t *env =
|
||||
@@ -3200,7 +3203,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
|
||||
&match, NULL) == ISC_R_SUCCESS) && match > 0)
|
||||
{
|
||||
UNLOCK(&listener->lock);
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
UNLOCK(&listener->lock);
|
||||
|
||||
@@ -3209,7 +3212,7 @@ client_ok(const isc_sockaddr_t *fromaddr, void *arg) {
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
|
||||
"rejected statistics connection from %s", socktext);
|
||||
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3232,7 +3235,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
|
||||
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclconfctx,
|
||||
const char *socktext)
|
||||
{
|
||||
isc_result_t result;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
named_statschannel_t *listener;
|
||||
isc_task_t *task = NULL;
|
||||
isc_socket_t *sock = NULL;
|
||||
@@ -3240,8 +3243,6 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
|
||||
dns_acl_t *new_acl = NULL;
|
||||
|
||||
listener = isc_mem_get(server->mctx, sizeof(*listener));
|
||||
if (listener == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
|
||||
listener->httpdmgr = NULL;
|
||||
listener->address = *addr;
|
||||
@@ -3249,11 +3250,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
|
||||
listener->mctx = NULL;
|
||||
ISC_LINK_INIT(listener, link);
|
||||
|
||||
result = isc_mutex_init(&listener->lock);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_put(server->mctx, listener, sizeof(*listener));
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
isc_mutex_init(&listener->lock);
|
||||
|
||||
isc_mem_attach(server->mctx, &listener->mctx);
|
||||
|
||||
@@ -3263,7 +3260,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
|
||||
aclconfctx, listener->mctx, 0,
|
||||
&new_acl);
|
||||
} else
|
||||
result = dns_acl_any(listener->mctx, &new_acl);
|
||||
dns_acl_any(listener->mctx, &new_acl);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
dns_acl_attach(new_acl, &listener->acl);
|
||||
@@ -3281,7 +3278,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, ISC_TRUE);
|
||||
isc_socket_ipv6only(sock, true);
|
||||
#endif
|
||||
|
||||
result = isc_socket_bind(sock, addr, ISC_SOCKET_REUSEADDRESS);
|
||||
@@ -3336,7 +3333,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", ISC_TRUE,
|
||||
isc_httpdmgr_addurl2(listener->httpdmgr, "/bind9.xsl", true,
|
||||
render_xsl, server);
|
||||
|
||||
*listenerp = listener;
|
||||
@@ -3391,7 +3388,7 @@ update_listener(named_server_t *server, named_statschannel_t **listenerp,
|
||||
aclconfctx, listener->mctx, 0,
|
||||
&new_acl);
|
||||
} else
|
||||
result = dns_acl_any(listener->mctx, &new_acl);
|
||||
dns_acl_any(listener->mctx, &new_acl);
|
||||
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
LOCK(&listener->lock);
|
||||
@@ -3566,12 +3563,12 @@ named_stats_dump(named_server_t *server, FILE *fp) {
|
||||
dns_view_t *view;
|
||||
dns_zone_t *zone, *next;
|
||||
stats_dumparg_t dumparg;
|
||||
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];
|
||||
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];
|
||||
|
||||
RUNTIME_CHECK(isc_once_do(&once, init_desc) == ISC_R_SUCCESS);
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/string.h> /* Required for HP/UX (and others?) */
|
||||
#include <isc/mem.h>
|
||||
@@ -50,7 +52,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;
|
||||
isc_uint32_t n;
|
||||
uint32_t n;
|
||||
dns_fixedname_t fname;
|
||||
dns_name_t *name;
|
||||
isc_buffer_t b;
|
||||
@@ -89,7 +91,7 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
|
||||
goto failure;
|
||||
}
|
||||
dns_name_init(tctx->domain, NULL);
|
||||
RETERR(dns_name_dup(name, mctx, tctx->domain));
|
||||
dns_name_dup(name, mctx, tctx->domain);
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
@@ -101,7 +103,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, ISC_FALSE, &tctx->gsscred));
|
||||
RETERR(dst_gssapi_acquirecred(name, false, &tctx->gsscred));
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <isc/base64.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/mem.h>
|
||||
@@ -43,7 +45,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;
|
||||
isc_uint16_t bits;
|
||||
uint16_t bits;
|
||||
|
||||
for (element = cfg_list_first(list);
|
||||
element != NULL;
|
||||
@@ -109,7 +111,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,
|
||||
ISC_FALSE, NULL, now, now,
|
||||
false, NULL, now, now,
|
||||
mctx, ring, &tsigkey);
|
||||
isc_mem_put(mctx, secret, secretalloc);
|
||||
secret = NULL;
|
||||
@@ -153,9 +155,7 @@ named_tsigkeyring_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
maps[i++] = cfg_tuple_get(vconfig, "options");
|
||||
maps[i] = NULL;
|
||||
|
||||
result = dns_tsigkeyring_create(mctx, &ring);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
dns_tsigkeyring_create(mctx, &ring);
|
||||
|
||||
for (i = 0; ; i++) {
|
||||
if (maps[i] == NULL)
|
||||
|
||||
@@ -12,9 +12,11 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <dns/log.h>
|
||||
@@ -43,7 +45,7 @@ typedef struct dlopen_data {
|
||||
unsigned int flags;
|
||||
isc_mutex_t lock;
|
||||
int version;
|
||||
isc_boolean_t in_configure;
|
||||
bool in_configure;
|
||||
|
||||
dlz_dlopen_version_t *dlz_version;
|
||||
dlz_dlopen_create_t *dlz_create;
|
||||
@@ -66,14 +68,14 @@ typedef struct dlopen_data {
|
||||
#define MAYBE_LOCK(cd) \
|
||||
do { \
|
||||
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
|
||||
cd->in_configure == ISC_FALSE) \
|
||||
cd->in_configure == false) \
|
||||
LOCK(&cd->lock); \
|
||||
} while (0)
|
||||
|
||||
#define MAYBE_UNLOCK(cd) \
|
||||
do { \
|
||||
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
|
||||
cd->in_configure == ISC_FALSE) \
|
||||
cd->in_configure == false) \
|
||||
UNLOCK(&cd->lock); \
|
||||
} while (0)
|
||||
|
||||
@@ -193,7 +195,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, isc_boolean_t mandatory) {
|
||||
dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
|
||||
void *ptr = dlsym(cd->dl_handle, symbol);
|
||||
if (ptr == NULL && mandatory) {
|
||||
dlopen_log(ISC_LOG_ERROR,
|
||||
@@ -224,35 +226,20 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
cd = isc_mem_get(mctx, sizeof(*cd));
|
||||
if (cd == NULL) {
|
||||
isc_mem_destroy(&mctx);
|
||||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
|
||||
memset(cd, 0, sizeof(*cd));
|
||||
|
||||
cd->mctx = mctx;
|
||||
|
||||
cd->dl_path = isc_mem_strdup(cd->mctx, argv[1]);
|
||||
if (cd->dl_path == NULL) {
|
||||
result = ISC_R_NOMEMORY;
|
||||
goto failed;
|
||||
}
|
||||
|
||||
cd->dlzname = isc_mem_strdup(cd->mctx, dlzname);
|
||||
if (cd->dlzname == NULL) {
|
||||
result = ISC_R_NOMEMORY;
|
||||
goto failed;
|
||||
}
|
||||
|
||||
/* Initialize the lock */
|
||||
result = isc_mutex_init(&cd->lock);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto failed;
|
||||
isc_mutex_init(&cd->lock);
|
||||
|
||||
/* Open the library */
|
||||
dlopen_flags = RTLD_NOW|RTLD_GLOBAL;
|
||||
@@ -281,13 +268,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", ISC_TRUE);
|
||||
dl_load_symbol(cd, "dlz_version", true);
|
||||
cd->dlz_create = (dlz_dlopen_create_t *)
|
||||
dl_load_symbol(cd, "dlz_create", ISC_TRUE);
|
||||
dl_load_symbol(cd, "dlz_create", true);
|
||||
cd->dlz_lookup = (dlz_dlopen_lookup_t *)
|
||||
dl_load_symbol(cd, "dlz_lookup", ISC_TRUE);
|
||||
dl_load_symbol(cd, "dlz_lookup", true);
|
||||
cd->dlz_findzonedb = (dlz_dlopen_findzonedb_t *)
|
||||
dl_load_symbol(cd, "dlz_findzonedb", ISC_TRUE);
|
||||
dl_load_symbol(cd, "dlz_findzonedb", true);
|
||||
|
||||
if (cd->dlz_create == NULL ||
|
||||
cd->dlz_version == NULL ||
|
||||
@@ -300,29 +287,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", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_allowzonexfr", false);
|
||||
cd->dlz_allnodes = (dlz_dlopen_allnodes_t *)
|
||||
dl_load_symbol(cd, "dlz_allnodes",
|
||||
ISC_TF(cd->dlz_allowzonexfr != NULL));
|
||||
(cd->dlz_allowzonexfr != NULL));
|
||||
cd->dlz_authority = (dlz_dlopen_authority_t *)
|
||||
dl_load_symbol(cd, "dlz_authority", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_authority", false);
|
||||
cd->dlz_newversion = (dlz_dlopen_newversion_t *)
|
||||
dl_load_symbol(cd, "dlz_newversion", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_newversion", false);
|
||||
cd->dlz_closeversion = (dlz_dlopen_closeversion_t *)
|
||||
dl_load_symbol(cd, "dlz_closeversion",
|
||||
ISC_TF(cd->dlz_newversion != NULL));
|
||||
(cd->dlz_newversion != NULL));
|
||||
cd->dlz_configure = (dlz_dlopen_configure_t *)
|
||||
dl_load_symbol(cd, "dlz_configure", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_configure", false);
|
||||
cd->dlz_ssumatch = (dlz_dlopen_ssumatch_t *)
|
||||
dl_load_symbol(cd, "dlz_ssumatch", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_ssumatch", false);
|
||||
cd->dlz_addrdataset = (dlz_dlopen_addrdataset_t *)
|
||||
dl_load_symbol(cd, "dlz_addrdataset", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_addrdataset", false);
|
||||
cd->dlz_subrdataset = (dlz_dlopen_subrdataset_t *)
|
||||
dl_load_symbol(cd, "dlz_subrdataset", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_subrdataset", false);
|
||||
cd->dlz_delrdataset = (dlz_dlopen_delrdataset_t *)
|
||||
dl_load_symbol(cd, "dlz_delrdataset", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_delrdataset", false);
|
||||
cd->dlz_destroy = (dlz_dlopen_destroy_t *)
|
||||
dl_load_symbol(cd, "dlz_destroy", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_destroy", false);
|
||||
|
||||
/* Check the version of the API is the same */
|
||||
cd->version = cd->dlz_version(&cd->flags);
|
||||
@@ -435,7 +422,7 @@ dlopen_dlz_newversion(const char *zone, void *driverarg, void *dbdata,
|
||||
* Called to end a transaction
|
||||
*/
|
||||
static void
|
||||
dlopen_dlz_closeversion(const char *zone, isc_boolean_t commit,
|
||||
dlopen_dlz_closeversion(const char *zone, bool commit,
|
||||
void *driverarg, void *dbdata, void **versionp)
|
||||
{
|
||||
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
|
||||
@@ -468,9 +455,9 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
cd->in_configure = ISC_TRUE;
|
||||
cd->in_configure = true;
|
||||
result = cd->dlz_configure(view, dlzdb, cd->dbdata);
|
||||
cd->in_configure = ISC_FALSE;
|
||||
cd->in_configure = false;
|
||||
MAYBE_UNLOCK(cd);
|
||||
|
||||
return (result);
|
||||
@@ -480,18 +467,18 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
|
||||
/*
|
||||
* Check for authority to change a name.
|
||||
*/
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
dlopen_dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
|
||||
const char *type, const char *key, isc_uint32_t keydatalen,
|
||||
const char *type, const char *key, uint32_t keydatalen,
|
||||
unsigned char *keydata, void *driverarg, void *dbdata)
|
||||
{
|
||||
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
|
||||
isc_boolean_t ret;
|
||||
bool ret;
|
||||
|
||||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_ssumatch == NULL)
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
ret = cd->dlz_ssumatch(signer, name, tcpaddr, type, key, keydatalen,
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
/*! \file */
|
||||
|
||||
#include <pwd.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/types.h>
|
||||
|
||||
@@ -49,12 +50,12 @@ void
|
||||
named_os_minprivs(void);
|
||||
|
||||
FILE *
|
||||
named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user);
|
||||
named_os_openfile(const char *filename, mode_t mode, bool switch_user);
|
||||
|
||||
void
|
||||
named_os_writepidfile(const char *filename, isc_boolean_t first_time);
|
||||
named_os_writepidfile(const char *filename, bool first_time);
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
named_os_issingleton(const char *filename);
|
||||
|
||||
void
|
||||
|
||||
+61
-166
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <sys/types.h> /* dev_t FreeBSD 2.1 */
|
||||
#include <sys/stat.h>
|
||||
@@ -22,8 +23,8 @@
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <grp.h>
|
||||
#include <fcntl.h>
|
||||
#include <grp.h> /* Required for initgroups() on IRIX. */
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -39,7 +40,7 @@
|
||||
#include <isc/print.h>
|
||||
#include <isc/resource.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/strerror.h>
|
||||
#include <isc/strerr.h>
|
||||
#include <isc/string.h>
|
||||
|
||||
#include <named/globals.h>
|
||||
@@ -58,68 +59,17 @@ static int singletonfd = -1;
|
||||
#define ISC_FACILITY LOG_DAEMON
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If there's no <sys/capability.h>, we don't care about <sys/prctl.h>
|
||||
*/
|
||||
#ifndef HAVE_SYS_CAPABILITY_H
|
||||
#undef HAVE_SYS_PRCTL_H
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Linux defines:
|
||||
* (T) HAVE_LINUXTHREADS
|
||||
* (C) HAVE_SYS_CAPABILITY_H
|
||||
* (P) HAVE_SYS_PRCTL_H
|
||||
* The possible cases are:
|
||||
* none: setuid() normally
|
||||
* T: no setuid()
|
||||
* C: setuid() normally, drop caps (keep CAP_SETUID)
|
||||
* T+C: no setuid(), drop caps (don't keep CAP_SETUID)
|
||||
* T+C+P: setuid() early, drop caps (keep CAP_SETUID)
|
||||
* C+P: setuid() normally, drop caps (keep CAP_SETUID)
|
||||
* P: not possible
|
||||
* T+P: not possible
|
||||
*
|
||||
* if (C)
|
||||
* caps = BIND_SERVICE + CHROOT + SETGID
|
||||
* if ((T && C && P) || !T)
|
||||
* caps += SETUID
|
||||
* endif
|
||||
* capset(caps)
|
||||
* endif
|
||||
* if (T && C && P && -u)
|
||||
* setuid()
|
||||
* else if (T && -u)
|
||||
* fail
|
||||
* --> start threads
|
||||
* if (!T && -u)
|
||||
* setuid()
|
||||
* if (C && (P || !-u))
|
||||
* caps = BIND_SERVICE
|
||||
* capset(caps)
|
||||
* endif
|
||||
*
|
||||
* It will be nice when Linux threads work properly with setuid().
|
||||
*/
|
||||
|
||||
#ifdef HAVE_LINUXTHREADS
|
||||
static pid_t mainpid = 0;
|
||||
#endif
|
||||
|
||||
static struct passwd *runas_pw = NULL;
|
||||
static isc_boolean_t done_setuid = ISC_FALSE;
|
||||
static bool done_setuid = false;
|
||||
static int dfd[2] = { -1, -1 };
|
||||
|
||||
#ifdef HAVE_SYS_CAPABILITY_H
|
||||
|
||||
static isc_boolean_t non_root = ISC_FALSE;
|
||||
static isc_boolean_t non_root_caps = ISC_FALSE;
|
||||
static bool non_root = false;
|
||||
static bool non_root_caps = false;
|
||||
|
||||
#include <sys/capability.h>
|
||||
|
||||
#ifdef HAVE_SYS_PRCTL_H
|
||||
#include <sys/prctl.h> /* Required for prctl(). */
|
||||
#endif /* HAVE_SYS_PRCTL_H */
|
||||
#include <sys/prctl.h>
|
||||
|
||||
static void
|
||||
linux_setcaps(cap_t caps) {
|
||||
@@ -129,7 +79,7 @@ linux_setcaps(cap_t caps) {
|
||||
return;
|
||||
}
|
||||
if (cap_set_proc(caps) < 0) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("cap_set_proc() failed: %s:"
|
||||
" please ensure that the capset kernel"
|
||||
" module is loaded. see insmod(8)",
|
||||
@@ -145,13 +95,13 @@ linux_setcaps(cap_t caps) {
|
||||
if (err != -1 && curval) { \
|
||||
err = cap_set_flag(caps, CAP_EFFECTIVE, 1, &capval, CAP_SET); \
|
||||
if (err == -1) { \
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf)); \
|
||||
strerror_r(errno, strbuf, sizeof(strbuf)); \
|
||||
named_main_earlyfatal("cap_set_proc failed: %s", strbuf); \
|
||||
} \
|
||||
\
|
||||
err = cap_set_flag(caps, CAP_PERMITTED, 1, &capval, CAP_SET); \
|
||||
if (err == -1) { \
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf)); \
|
||||
strerror_r(errno, strbuf, sizeof(strbuf)); \
|
||||
named_main_earlyfatal("cap_set_proc failed: %s", strbuf); \
|
||||
} \
|
||||
} \
|
||||
@@ -160,12 +110,12 @@ linux_setcaps(cap_t caps) {
|
||||
do { \
|
||||
caps = cap_init(); \
|
||||
if (caps == NULL) { \
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf)); \
|
||||
strerror_r(errno, strbuf, sizeof(strbuf)); \
|
||||
named_main_earlyfatal("cap_init failed: %s", strbuf); \
|
||||
} \
|
||||
curcaps = cap_get_proc(); \
|
||||
if (curcaps == NULL) { \
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf)); \
|
||||
strerror_r(errno, strbuf, sizeof(strbuf)); \
|
||||
named_main_earlyfatal("cap_get_proc failed: %s", strbuf); \
|
||||
} \
|
||||
} while (0)
|
||||
@@ -200,15 +150,11 @@ linux_initialprivs(void) {
|
||||
*/
|
||||
SET_CAP(CAP_SYS_CHROOT);
|
||||
|
||||
#if defined(HAVE_SYS_PRCTL_H) || !defined(HAVE_LINUXTHREADS)
|
||||
/*
|
||||
* We can setuid() only if either the kernel supports keeping
|
||||
* capabilities after setuid() (which we don't know until we've
|
||||
* tried) or we're not using threads. If either of these is
|
||||
* true, we want the setuid capability.
|
||||
* We need setuid() as the kernel supports keeping capabilities after
|
||||
* setuid().
|
||||
*/
|
||||
SET_CAP(CAP_SETUID);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Since we call initgroups, we need this.
|
||||
@@ -274,7 +220,6 @@ linux_minprivs(void) {
|
||||
FREE_CAP;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SYS_PRCTL_H
|
||||
static void
|
||||
linux_keepcaps(void) {
|
||||
char strbuf[ISC_STRERRORSIZE];
|
||||
@@ -285,20 +230,18 @@ linux_keepcaps(void) {
|
||||
|
||||
if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) < 0) {
|
||||
if (errno != EINVAL) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("prctl() failed: %s", strbuf);
|
||||
}
|
||||
} else {
|
||||
non_root_caps = ISC_TRUE;
|
||||
non_root_caps = true;
|
||||
if (getuid() != 0)
|
||||
non_root = ISC_TRUE;
|
||||
non_root = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_SYS_CAPABILITY_H */
|
||||
|
||||
|
||||
static void
|
||||
setup_syslog(const char *progname) {
|
||||
int options;
|
||||
@@ -316,9 +259,6 @@ named_os_init(const char *progname) {
|
||||
#ifdef HAVE_SYS_CAPABILITY_H
|
||||
linux_initialprivs();
|
||||
#endif
|
||||
#ifdef HAVE_LINUXTHREADS
|
||||
mainpid = getpid();
|
||||
#endif
|
||||
#ifdef SIGXFSZ
|
||||
signal(SIGXFSZ, SIG_IGN);
|
||||
#endif
|
||||
@@ -330,13 +270,13 @@ named_os_daemonize(void) {
|
||||
char strbuf[ISC_STRERRORSIZE];
|
||||
|
||||
if (pipe(dfd) == -1) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("pipe(): %s", strbuf);
|
||||
}
|
||||
|
||||
pid = fork();
|
||||
if (pid == -1) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("fork(): %s", strbuf);
|
||||
}
|
||||
if (pid != 0) {
|
||||
@@ -361,12 +301,8 @@ named_os_daemonize(void) {
|
||||
* We're the child.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_LINUXTHREADS
|
||||
mainpid = getpid();
|
||||
#endif
|
||||
|
||||
if (setsid() == -1) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("setsid(): %s", strbuf);
|
||||
}
|
||||
|
||||
@@ -428,16 +364,16 @@ named_os_closedevnull(void) {
|
||||
}
|
||||
}
|
||||
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
all_digits(const char *s) {
|
||||
if (*s == '\0')
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
while (*s != '\0') {
|
||||
if (!isdigit((*s)&0xff))
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
s++;
|
||||
}
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -449,14 +385,14 @@ named_os_chroot(const char *root) {
|
||||
if (root != NULL) {
|
||||
#ifdef HAVE_CHROOT
|
||||
if (chroot(root) < 0) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("chroot(): %s", strbuf);
|
||||
}
|
||||
#else
|
||||
named_main_earlyfatal("chroot(): disabled");
|
||||
#endif
|
||||
if (chdir("/") < 0) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("chdir(/): %s", strbuf);
|
||||
}
|
||||
#ifdef HAVE_LIBSCF
|
||||
@@ -483,7 +419,7 @@ named_os_inituserinfo(const char *username) {
|
||||
|
||||
if (getuid() == 0) {
|
||||
if (initgroups(runas_pw->pw_name, runas_pw->pw_gid) < 0) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("initgroups(): %s", strbuf);
|
||||
}
|
||||
}
|
||||
@@ -496,44 +432,29 @@ named_os_changeuser(void) {
|
||||
if (runas_pw == NULL || done_setuid)
|
||||
return;
|
||||
|
||||
done_setuid = ISC_TRUE;
|
||||
|
||||
#ifdef HAVE_LINUXTHREADS
|
||||
#ifdef HAVE_SYS_CAPABILITY_H
|
||||
if (!non_root_caps) {
|
||||
named_main_earlyfatal("-u with Linux threads not supported: "
|
||||
"requires kernel support for "
|
||||
"prctl(PR_SET_KEEPCAPS)");
|
||||
}
|
||||
#else
|
||||
named_main_earlyfatal("-u with Linux threads not supported: "
|
||||
"no capabilities support or capabilities "
|
||||
"disabled at build time");
|
||||
#endif
|
||||
#endif
|
||||
done_setuid = true;
|
||||
|
||||
if (setgid(runas_pw->pw_gid) < 0) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("setgid(): %s", strbuf);
|
||||
}
|
||||
|
||||
if (setuid(runas_pw->pw_uid) < 0) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("setuid(): %s", strbuf);
|
||||
}
|
||||
|
||||
#if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_DUMPABLE)
|
||||
#if defined(HAVE_SYS_CAPABILITY_H)
|
||||
/*
|
||||
* Restore the ability of named to drop core after the setuid()
|
||||
* call has disabled it.
|
||||
*/
|
||||
if (prctl(PR_SET_DUMPABLE,1,0,0,0) < 0) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlywarning("prctl(PR_SET_DUMPABLE) failed: %s",
|
||||
strbuf);
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_SYS_CAPABILITY_H) && !defined(HAVE_LINUXTHREADS)
|
||||
|
||||
linux_minprivs();
|
||||
#endif
|
||||
}
|
||||
@@ -547,7 +468,7 @@ ns_os_uid(void) {
|
||||
|
||||
void
|
||||
named_os_adjustnofile(void) {
|
||||
#ifdef HAVE_LINUXTHREADS
|
||||
#if defined(__linux__)
|
||||
isc_result_t result;
|
||||
isc_resourcevalue_t newvalue;
|
||||
|
||||
@@ -565,21 +486,15 @@ named_os_adjustnofile(void) {
|
||||
|
||||
void
|
||||
named_os_minprivs(void) {
|
||||
#ifdef HAVE_SYS_PRCTL_H
|
||||
#if defined(HAVE_SYS_CAPABILITY_H)
|
||||
linux_keepcaps();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINUXTHREADS
|
||||
named_os_changeuser(); /* Call setuid() before threads are started */
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_CAPABILITY_H) && defined(HAVE_LINUXTHREADS)
|
||||
named_os_changeuser();
|
||||
linux_minprivs();
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
safe_open(const char *filename, mode_t mode, isc_boolean_t append) {
|
||||
safe_open(const char *filename, mode_t mode, bool append) {
|
||||
int fd;
|
||||
struct stat sb;
|
||||
|
||||
@@ -647,7 +562,7 @@ mkdirpath(char *filename, void (*report)(const char *, ...)) {
|
||||
|
||||
if (stat(filename, &sb) == -1) {
|
||||
if (errno != ENOENT) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
(*report)("couldn't stat '%s': %s", filename,
|
||||
strbuf);
|
||||
goto error;
|
||||
@@ -667,7 +582,7 @@ mkdirpath(char *filename, void (*report)(const char *, ...)) {
|
||||
mode |= S_IRGRP | S_IXGRP; /* g=rx */
|
||||
mode |= S_IROTH | S_IXOTH; /* o=rx */
|
||||
if (mkdir(filename, mode) == -1) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
(*report)("couldn't mkdir '%s': %s", filename,
|
||||
strbuf);
|
||||
goto error;
|
||||
@@ -675,7 +590,7 @@ mkdirpath(char *filename, void (*report)(const char *, ...)) {
|
||||
if (runas_pw != NULL &&
|
||||
chown(filename, runas_pw->pw_uid,
|
||||
runas_pw->pw_gid) == -1) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
(*report)("couldn't chown '%s': %s", filename,
|
||||
strbuf);
|
||||
}
|
||||
@@ -702,7 +617,7 @@ setperms(uid_t uid, gid_t gid) {
|
||||
#endif
|
||||
#if defined(HAVE_SETEGID)
|
||||
if (getegid() != gid && setegid(gid) == -1) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlywarning("unable to set effective "
|
||||
"gid to %ld: %s",
|
||||
(long)gid, strbuf);
|
||||
@@ -710,7 +625,7 @@ setperms(uid_t uid, gid_t gid) {
|
||||
#elif defined(HAVE_SETRESGID)
|
||||
if (getresgid(&tmpg, &oldgid, &tmpg) == -1 || oldgid != gid) {
|
||||
if (setresgid(-1, gid, -1) == -1) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlywarning("unable to set effective "
|
||||
"gid to %d: %s", gid, strbuf);
|
||||
}
|
||||
@@ -719,7 +634,7 @@ setperms(uid_t uid, gid_t gid) {
|
||||
|
||||
#if defined(HAVE_SETEUID)
|
||||
if (geteuid() != uid && seteuid(uid) == -1) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlywarning("unable to set effective "
|
||||
"uid to %ld: %s",
|
||||
(long)uid, strbuf);
|
||||
@@ -727,7 +642,7 @@ setperms(uid_t uid, gid_t gid) {
|
||||
#elif defined(HAVE_SETRESUID)
|
||||
if (getresuid(&tmpu, &olduid, &tmpu) == -1 || olduid != uid) {
|
||||
if (setresuid(-1, uid, -1) == -1) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlywarning("unable to set effective "
|
||||
"uid to %d: %s", uid, strbuf);
|
||||
}
|
||||
@@ -736,7 +651,7 @@ setperms(uid_t uid, gid_t gid) {
|
||||
}
|
||||
|
||||
FILE *
|
||||
named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user) {
|
||||
named_os_openfile(const char *filename, mode_t mode, bool switch_user) {
|
||||
char strbuf[ISC_STRERRORSIZE], *f;
|
||||
FILE *fp;
|
||||
int fd;
|
||||
@@ -746,7 +661,7 @@ named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user)
|
||||
*/
|
||||
f = strdup(filename);
|
||||
if (f == NULL) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlywarning("couldn't strdup() '%s': %s",
|
||||
filename, strbuf);
|
||||
return (NULL);
|
||||
@@ -758,22 +673,17 @@ named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user)
|
||||
free(f);
|
||||
|
||||
if (switch_user && runas_pw != NULL) {
|
||||
#ifndef HAVE_LINUXTHREADS
|
||||
gid_t oldgid = getgid();
|
||||
#endif
|
||||
/* 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, ISC_FALSE);
|
||||
fd = safe_open(filename, mode, false);
|
||||
|
||||
#ifndef HAVE_LINUXTHREADS
|
||||
/* Restore UID/GID to root */
|
||||
setperms(0, oldgid);
|
||||
#endif /* HAVE_LINUXTHREADS */
|
||||
|
||||
if (fd == -1) {
|
||||
#ifndef HAVE_LINUXTHREADS
|
||||
fd = safe_open(filename, mode, ISC_FALSE);
|
||||
fd = safe_open(filename, mode, false);
|
||||
if (fd != -1) {
|
||||
named_main_earlywarning("Required root "
|
||||
"permissions to open "
|
||||
@@ -785,20 +695,13 @@ named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user)
|
||||
named_main_earlywarning("Please check file and "
|
||||
"directory permissions "
|
||||
"or reconfigure the filename.");
|
||||
#else /* HAVE_LINUXTHREADS */
|
||||
named_main_earlywarning("Could not open "
|
||||
"'%s'.", filename);
|
||||
named_main_earlywarning("Please check file and "
|
||||
"directory permissions "
|
||||
"or reconfigure the filename.");
|
||||
#endif /* HAVE_LINUXTHREADS */
|
||||
}
|
||||
} else {
|
||||
fd = safe_open(filename, mode, ISC_FALSE);
|
||||
fd = safe_open(filename, mode, false);
|
||||
}
|
||||
|
||||
if (fd < 0) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlywarning("could not open file '%s': %s",
|
||||
filename, strbuf);
|
||||
return (NULL);
|
||||
@@ -806,7 +709,7 @@ named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user)
|
||||
|
||||
fp = fdopen(fd, "w");
|
||||
if (fp == NULL) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlywarning("could not fdopen() file '%s': %s",
|
||||
filename, strbuf);
|
||||
}
|
||||
@@ -815,7 +718,7 @@ named_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user)
|
||||
}
|
||||
|
||||
void
|
||||
named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
|
||||
named_os_writepidfile(const char *filename, bool first_time) {
|
||||
FILE *fh;
|
||||
pid_t pid;
|
||||
char strbuf[ISC_STRERRORSIZE];
|
||||
@@ -834,7 +737,7 @@ named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
|
||||
|
||||
pidfile = strdup(filename);
|
||||
if (pidfile == NULL) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
(*report)("couldn't strdup() '%s': %s", filename, strbuf);
|
||||
return;
|
||||
}
|
||||
@@ -845,11 +748,7 @@ named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
|
||||
cleanup_pidfile();
|
||||
return;
|
||||
}
|
||||
#ifdef HAVE_LINUXTHREADS
|
||||
pid = mainpid;
|
||||
#else
|
||||
pid = getpid();
|
||||
#endif
|
||||
if (fprintf(fh, "%ld\n", (long)pid) < 0) {
|
||||
(*report)("fprintf() to pid file '%s' failed", filename);
|
||||
(void)fclose(fh);
|
||||
@@ -865,23 +764,23 @@ named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
|
||||
(void)fclose(fh);
|
||||
}
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
named_os_issingleton(const char *filename) {
|
||||
char strbuf[ISC_STRERRORSIZE];
|
||||
struct flock lock;
|
||||
|
||||
if (singletonfd != -1)
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
|
||||
if (strcasecmp(filename, "none") == 0)
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
|
||||
/*
|
||||
* Make the containing directory if it doesn't exist.
|
||||
*/
|
||||
lockfile = strdup(filename);
|
||||
if (lockfile == NULL) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_r(errno, strbuf, sizeof(strbuf));
|
||||
named_main_earlyfatal("couldn't allocate memory for '%s': %s",
|
||||
filename, strbuf);
|
||||
} else {
|
||||
@@ -890,7 +789,7 @@ named_os_issingleton(const char *filename) {
|
||||
named_main_earlywarning("couldn't create '%s'",
|
||||
filename);
|
||||
cleanup_lockfile();
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -902,7 +801,7 @@ named_os_issingleton(const char *filename) {
|
||||
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
|
||||
if (singletonfd == -1) {
|
||||
cleanup_lockfile();
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
memset(&lock, 0, sizeof(lock));
|
||||
@@ -915,10 +814,10 @@ named_os_issingleton(const char *filename) {
|
||||
if (fcntl(singletonfd, F_SETLK, &lock) == -1) {
|
||||
close(singletonfd);
|
||||
singletonfd = -1;
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -955,11 +854,7 @@ named_os_shutdownmsg(char *command, isc_buffer_t *text) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LINUXTHREADS
|
||||
pid = mainpid;
|
||||
#else
|
||||
pid = getpid();
|
||||
#endif
|
||||
|
||||
(void)isc_buffer_printf(text, "pid: %ld", (long)pid);
|
||||
}
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <dns/log.h>
|
||||
#include <dns/result.h>
|
||||
@@ -44,7 +46,7 @@ typedef struct dlopen_data {
|
||||
unsigned int flags;
|
||||
isc_mutex_t lock;
|
||||
int version;
|
||||
isc_boolean_t in_configure;
|
||||
bool in_configure;
|
||||
|
||||
dlz_dlopen_version_t *dlz_version;
|
||||
dlz_dlopen_create_t *dlz_create;
|
||||
@@ -67,14 +69,14 @@ typedef struct dlopen_data {
|
||||
#define MAYBE_LOCK(cd) \
|
||||
do { \
|
||||
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
|
||||
cd->in_configure == ISC_FALSE) \
|
||||
cd->in_configure == false) \
|
||||
LOCK(&cd->lock); \
|
||||
} while (0)
|
||||
|
||||
#define MAYBE_UNLOCK(cd) \
|
||||
do { \
|
||||
if ((cd->flags & DNS_SDLZFLAG_THREADSAFE) == 0 && \
|
||||
cd->in_configure == ISC_FALSE) \
|
||||
cd->in_configure == false) \
|
||||
UNLOCK(&cd->lock); \
|
||||
} while (0)
|
||||
|
||||
@@ -194,7 +196,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, isc_boolean_t mandatory) {
|
||||
dl_load_symbol(dlopen_data_t *cd, const char *symbol, bool mandatory) {
|
||||
void *ptr = GetProcAddress(cd->dl_handle, symbol);
|
||||
if (ptr == NULL && mandatory) {
|
||||
dlopen_log(ISC_LOG_ERROR,
|
||||
@@ -214,7 +216,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;
|
||||
isc_boolean_t triedload = ISC_FALSE;
|
||||
bool triedload = false;
|
||||
|
||||
UNUSED(driverarg);
|
||||
|
||||
@@ -248,7 +250,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
||||
goto failed;
|
||||
}
|
||||
|
||||
triedload = ISC_TRUE;
|
||||
triedload = true;
|
||||
|
||||
/* Initialize the lock */
|
||||
result = isc_mutex_init(&cd->lock);
|
||||
@@ -269,13 +271,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", ISC_TRUE);
|
||||
dl_load_symbol(cd, "dlz_version", true);
|
||||
cd->dlz_create = (dlz_dlopen_create_t *)
|
||||
dl_load_symbol(cd, "dlz_create", ISC_TRUE);
|
||||
dl_load_symbol(cd, "dlz_create", true);
|
||||
cd->dlz_lookup = (dlz_dlopen_lookup_t *)
|
||||
dl_load_symbol(cd, "dlz_lookup", ISC_TRUE);
|
||||
dl_load_symbol(cd, "dlz_lookup", true);
|
||||
cd->dlz_findzonedb = (dlz_dlopen_findzonedb_t *)
|
||||
dl_load_symbol(cd, "dlz_findzonedb", ISC_TRUE);
|
||||
dl_load_symbol(cd, "dlz_findzonedb", true);
|
||||
|
||||
if (cd->dlz_create == NULL ||
|
||||
cd->dlz_version == NULL ||
|
||||
@@ -288,27 +290,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", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_allowzonexfr", false);
|
||||
cd->dlz_allnodes = (dlz_dlopen_allnodes_t *)
|
||||
dl_load_symbol(cd, "dlz_allnodes",
|
||||
ISC_TF(cd->dlz_allowzonexfr != NULL));
|
||||
(cd->dlz_allowzonexfr != NULL));
|
||||
cd->dlz_authority = (dlz_dlopen_authority_t *)
|
||||
dl_load_symbol(cd, "dlz_authority", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_authority", false);
|
||||
cd->dlz_newversion = (dlz_dlopen_newversion_t *)
|
||||
dl_load_symbol(cd, "dlz_newversion", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_newversion", false);
|
||||
cd->dlz_closeversion = (dlz_dlopen_closeversion_t *)
|
||||
dl_load_symbol(cd, "dlz_closeversion",
|
||||
ISC_TF(cd->dlz_newversion != NULL));
|
||||
(cd->dlz_newversion != NULL));
|
||||
cd->dlz_configure = (dlz_dlopen_configure_t *)
|
||||
dl_load_symbol(cd, "dlz_configure", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_configure", false);
|
||||
cd->dlz_ssumatch = (dlz_dlopen_ssumatch_t *)
|
||||
dl_load_symbol(cd, "dlz_ssumatch", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_ssumatch", false);
|
||||
cd->dlz_addrdataset = (dlz_dlopen_addrdataset_t *)
|
||||
dl_load_symbol(cd, "dlz_addrdataset", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_addrdataset", false);
|
||||
cd->dlz_subrdataset = (dlz_dlopen_subrdataset_t *)
|
||||
dl_load_symbol(cd, "dlz_subrdataset", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_subrdataset", false);
|
||||
cd->dlz_delrdataset = (dlz_dlopen_delrdataset_t *)
|
||||
dl_load_symbol(cd, "dlz_delrdataset", ISC_FALSE);
|
||||
dl_load_symbol(cd, "dlz_delrdataset", false);
|
||||
|
||||
/* Check the version of the API is the same */
|
||||
cd->version = cd->dlz_version(&cd->flags);
|
||||
@@ -420,7 +422,7 @@ dlopen_dlz_newversion(const char *zone, void *driverarg, void *dbdata,
|
||||
* Called to end a transaction
|
||||
*/
|
||||
static void
|
||||
dlopen_dlz_closeversion(const char *zone, isc_boolean_t commit,
|
||||
dlopen_dlz_closeversion(const char *zone, bool commit,
|
||||
void *driverarg, void *dbdata, void **versionp)
|
||||
{
|
||||
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
|
||||
@@ -453,9 +455,9 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
cd->in_configure = ISC_TRUE;
|
||||
cd->in_configure = true;
|
||||
result = cd->dlz_configure(view, dlzdb, cd->dbdata);
|
||||
cd->in_configure = ISC_FALSE;
|
||||
cd->in_configure = false;
|
||||
MAYBE_UNLOCK(cd);
|
||||
|
||||
return (result);
|
||||
@@ -465,18 +467,18 @@ dlopen_dlz_configure(dns_view_t *view, dns_dlzdb_t *dlzdb,
|
||||
/*
|
||||
* Check for authority to change a name
|
||||
*/
|
||||
static isc_boolean_t
|
||||
static bool
|
||||
dlopen_dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
|
||||
const char *type, const char *key, isc_uint32_t keydatalen,
|
||||
const char *type, const char *key, uint32_t keydatalen,
|
||||
unsigned char *keydata, void *driverarg, void *dbdata)
|
||||
{
|
||||
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
|
||||
isc_boolean_t ret;
|
||||
bool ret;
|
||||
|
||||
UNUSED(driverarg);
|
||||
|
||||
if (cd->dlz_ssumatch == NULL)
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
|
||||
MAYBE_LOCK(cd);
|
||||
ret = cd->dlz_ssumatch(signer, name, tcpaddr, type, key, keydatalen,
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#ifndef NAMED_OS_H
|
||||
#define NAMED_OS_H 1
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/types.h>
|
||||
|
||||
void
|
||||
@@ -45,12 +47,12 @@ void
|
||||
named_os_minprivs(void);
|
||||
|
||||
FILE *
|
||||
named_os_openfile(const char *filename, int mode, isc_boolean_t switch_user);
|
||||
named_os_openfile(const char *filename, int mode, bool switch_user);
|
||||
|
||||
void
|
||||
named_os_writepidfile(const char *filename, isc_boolean_t first_time);
|
||||
named_os_writepidfile(const char *filename, bool first_time);
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
named_os_issingleton(const char *filename);
|
||||
|
||||
void
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@LIBXML2_LIB@@OPENSSL_LIB@@GSSAPI_LIB@@GEOIP_LIB@libisc.lib;libdns.lib;libisccc.lib;libisccfg.lib;libbind9.lib;libns.lib;version.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@@LIBXML2_LIB@@GSSAPI_LIB@@GEOIP_LIB@libisc.lib;libdns.lib;libisccc.lib;libisccfg.lib;libbind9.lib;libns.lib;version.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -98,7 +98,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\ns\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@LIBXML2_LIB@@OPENSSL_LIB@@GSSAPI_LIB@@GEOIP_LIB@libisc.lib;libdns.lib;libisccc.lib;libisccfg.lib;libbind9.lib;libns.lib;version.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@@LIBXML2_LIB@@GSSAPI_LIB@@GEOIP_LIB@libisc.lib;libdns.lib;libisccc.lib;libisccfg.lib;libbind9.lib;libns.lib;version.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -80,7 +80,7 @@ ServiceControl(DWORD dwCtrlCode) {
|
||||
|
||||
case SERVICE_CONTROL_SHUTDOWN:
|
||||
case SERVICE_CONTROL_STOP:
|
||||
named_server_flushonshutdown(named_g_server, ISC_TRUE);
|
||||
named_server_flushonshutdown(named_g_server, 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 = ISC_FALSE;
|
||||
isc_commandline_errprint = 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 = ISC_TRUE;
|
||||
isc_commandline_reset = true;
|
||||
|
||||
if (foreground) {
|
||||
/* run in console window */
|
||||
|
||||
+16
-16
@@ -20,13 +20,13 @@
|
||||
#include <io.h>
|
||||
#include <process.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include <isc/print.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/strerror.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/ntpaths.h>
|
||||
#include <isc/util.h>
|
||||
@@ -176,7 +176,7 @@ named_os_minprivs(void) {
|
||||
}
|
||||
|
||||
static int
|
||||
safe_open(const char *filename, int mode, isc_boolean_t append) {
|
||||
safe_open(const char *filename, int mode, bool append) {
|
||||
int fd;
|
||||
struct stat sb;
|
||||
|
||||
@@ -222,15 +222,15 @@ cleanup_lockfile(void) {
|
||||
}
|
||||
|
||||
FILE *
|
||||
named_os_openfile(const char *filename, int mode, isc_boolean_t switch_user) {
|
||||
named_os_openfile(const char *filename, int mode, bool switch_user) {
|
||||
char strbuf[ISC_STRERRORSIZE];
|
||||
FILE *fp;
|
||||
int fd;
|
||||
|
||||
UNUSED(switch_user);
|
||||
fd = safe_open(filename, mode, ISC_FALSE);
|
||||
fd = safe_open(filename, mode, false);
|
||||
if (fd < 0) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_s(strbuf, sizeof(strbuf), errno);
|
||||
named_main_earlywarning("could not open file '%s': %s",
|
||||
filename, strbuf);
|
||||
return (NULL);
|
||||
@@ -238,7 +238,7 @@ named_os_openfile(const char *filename, int mode, isc_boolean_t switch_user) {
|
||||
|
||||
fp = fdopen(fd, "w");
|
||||
if (fp == NULL) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_s(strbuf, sizeof(strbuf), errno);
|
||||
named_main_earlywarning("could not fdopen() file '%s': %s",
|
||||
filename, strbuf);
|
||||
close(fd);
|
||||
@@ -248,7 +248,7 @@ named_os_openfile(const char *filename, int mode, isc_boolean_t switch_user) {
|
||||
}
|
||||
|
||||
void
|
||||
named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
|
||||
named_os_writepidfile(const char *filename, bool first_time) {
|
||||
FILE *pidlockfile;
|
||||
pid_t pid;
|
||||
char strbuf[ISC_STRERRORSIZE];
|
||||
@@ -267,14 +267,14 @@ named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
|
||||
|
||||
pidfile = strdup(filename);
|
||||
if (pidfile == NULL) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_s(strbuf, sizeof(strbuf), errno);
|
||||
(*report)("couldn't strdup() '%s': %s", filename, strbuf);
|
||||
return;
|
||||
}
|
||||
|
||||
pidlockfile = named_os_openfile(filename,
|
||||
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
|
||||
ISC_FALSE);
|
||||
false);
|
||||
if (pidlockfile == NULL) {
|
||||
free(pidfile);
|
||||
pidfile = NULL;
|
||||
@@ -298,20 +298,20 @@ named_os_writepidfile(const char *filename, isc_boolean_t first_time) {
|
||||
(void)fclose(pidlockfile);
|
||||
}
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
named_os_issingleton(const char *filename) {
|
||||
char strbuf[ISC_STRERRORSIZE];
|
||||
OVERLAPPED o;
|
||||
|
||||
if (lockfilefd != -1)
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
|
||||
if (strcasecmp(filename, "none") == 0)
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
|
||||
lockfile = strdup(filename);
|
||||
if (lockfile == NULL) {
|
||||
isc__strerror(errno, strbuf, sizeof(strbuf));
|
||||
strerror_s(strbuf, sizeof(strbuf), errno);
|
||||
named_main_earlyfatal("couldn't allocate memory for '%s': %s",
|
||||
filename, strbuf);
|
||||
}
|
||||
@@ -324,7 +324,7 @@ named_os_issingleton(const char *filename) {
|
||||
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
|
||||
if (lockfilefd == -1) {
|
||||
cleanup_lockfile();
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
memset(&o, 0, sizeof(o));
|
||||
@@ -333,10 +333,10 @@ named_os_issingleton(const char *filename) {
|
||||
LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY,
|
||||
0, 0, 1, &o)) {
|
||||
cleanup_lockfile();
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+90
-97
@@ -11,6 +11,9 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/mem.h>
|
||||
@@ -188,7 +191,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);
|
||||
isc_boolean_t autoddns = ISC_FALSE;
|
||||
bool autoddns = false;
|
||||
isc_result_t result;
|
||||
|
||||
(void)cfg_map_get(zconfig, "update-policy", &updatepolicy);
|
||||
@@ -200,13 +203,11 @@ 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 = ISC_TRUE;
|
||||
autoddns = true;
|
||||
updatepolicy = NULL;
|
||||
}
|
||||
|
||||
result = dns_ssutable_create(mctx, &table);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
dns_ssutable_create(mctx, &table);
|
||||
|
||||
for (element = cfg_list_first(updatepolicy);
|
||||
element != NULL;
|
||||
@@ -219,9 +220,9 @@ 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;
|
||||
isc_boolean_t grant = ISC_FALSE;
|
||||
isc_boolean_t usezone = ISC_FALSE;
|
||||
unsigned int mtype = dns_ssumatchtype_name;
|
||||
bool grant = false;
|
||||
bool usezone = false;
|
||||
dns_ssumatchtype_t mtype = dns_ssumatchtype_name;
|
||||
dns_fixedname_t fname, fident;
|
||||
isc_buffer_t b;
|
||||
dns_rdatatype_t *types;
|
||||
@@ -229,16 +230,16 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
||||
|
||||
str = cfg_obj_asstring(mode);
|
||||
if (strcasecmp(str, "grant") == 0)
|
||||
grant = ISC_TRUE;
|
||||
grant = true;
|
||||
else if (strcasecmp(str, "deny") == 0)
|
||||
grant = ISC_FALSE;
|
||||
grant = false;
|
||||
else
|
||||
INSIST(0);
|
||||
|
||||
str = cfg_obj_asstring(matchtype);
|
||||
CHECK(dns_ssu_mtypefromstring(str, &mtype));
|
||||
if (mtype == dns_ssumatchtype_subdomain) {
|
||||
usezone = ISC_TRUE;
|
||||
usezone = true;
|
||||
}
|
||||
|
||||
dns_fixedname_init(&fident);
|
||||
@@ -317,16 +318,13 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
||||
}
|
||||
INSIST(i == n);
|
||||
|
||||
result = dns_ssutable_addrule(table, grant,
|
||||
dns_ssutable_addrule(table, grant,
|
||||
dns_fixedname_name(&fident),
|
||||
mtype,
|
||||
dns_fixedname_name(&fname),
|
||||
n, types);
|
||||
if (types != NULL)
|
||||
isc_mem_put(mctx, types, n * sizeof(dns_rdatatype_t));
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -347,14 +345,11 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
result = dns_ssutable_addrule(table, ISC_TRUE,
|
||||
dns_ssutable_addrule(table, true,
|
||||
named_g_server->session_keyname,
|
||||
dns_ssumatchtype_local,
|
||||
dns_zone_getorigin(zone),
|
||||
1, &any);
|
||||
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
result = ISC_R_SUCCESS;
|
||||
@@ -625,7 +620,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, ISC_FALSE, &apexnode);
|
||||
result = dns_db_findnode(db, &apexname, false, &apexnode);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
@@ -668,7 +663,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, ISC_TRUE);
|
||||
dns_db_closeversion(db, &dbversion, true);
|
||||
if (db != NULL)
|
||||
dns_db_detach(&db);
|
||||
for (i = 0; rdatalists[i] != NULL; i++) {
|
||||
@@ -769,7 +764,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 isc_boolean_t
|
||||
static bool
|
||||
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)
|
||||
@@ -783,10 +778,10 @@ isself(dns_view_t *myview, dns_tsigkey_t *mykey,
|
||||
isc_netaddr_t netdst;
|
||||
|
||||
if (interfacemgr == NULL)
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
|
||||
if (!ns_interfacemgr_listeningon(interfacemgr, dstaddr))
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
|
||||
isc_netaddr_fromsockaddr(&netsrc, srcaddr);
|
||||
isc_netaddr_fromsockaddr(&netdst, dstaddr);
|
||||
@@ -802,7 +797,7 @@ isself(dns_view_t *myview, dns_tsigkey_t *mykey,
|
||||
continue;
|
||||
|
||||
if (mykey != NULL) {
|
||||
isc_boolean_t match;
|
||||
bool match;
|
||||
isc_result_t result;
|
||||
|
||||
result = dns_view_gettsig(view, &mykey->name, &key);
|
||||
@@ -822,7 +817,7 @@ isself(dns_view_t *myview, dns_tsigkey_t *mykey,
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (ISC_TF(view == myview));
|
||||
return (view == myview);
|
||||
}
|
||||
|
||||
|
||||
@@ -843,7 +838,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;
|
||||
isc_uint32_t count;
|
||||
uint32_t count;
|
||||
unsigned int dbargc;
|
||||
char **dbargv;
|
||||
static char default_dbtype[] = "rbt";
|
||||
@@ -853,13 +848,13 @@ 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;
|
||||
isc_int32_t journal_size;
|
||||
isc_boolean_t multi;
|
||||
isc_boolean_t alt;
|
||||
int32_t journal_size;
|
||||
bool multi;
|
||||
bool alt;
|
||||
dns_view_t *view;
|
||||
isc_boolean_t check = ISC_FALSE, fail = ISC_FALSE;
|
||||
isc_boolean_t warn = ISC_FALSE, ignore = ISC_FALSE;
|
||||
isc_boolean_t ixfrdiff;
|
||||
bool check = false, fail = false;
|
||||
bool warn = false, ignore = false;
|
||||
bool ixfrdiff;
|
||||
dns_masterformat_t masterformat;
|
||||
const dns_master_style_t *masterstyle = &dns_master_style_default;
|
||||
isc_stats_t *zoneqrystats;
|
||||
@@ -1141,10 +1136,10 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
zoneqrystats = NULL;
|
||||
rcvquerystats = NULL;
|
||||
if (statlevel == dns_zonestat_full) {
|
||||
RETERR(isc_stats_create(mctx, &zoneqrystats,
|
||||
ns_statscounter_max));
|
||||
RETERR(dns_rdatatypestats_create(mctx,
|
||||
&rcvquerystats));
|
||||
isc_stats_create(mctx, &zoneqrystats,
|
||||
ns_statscounter_max);
|
||||
dns_rdatatypestats_create(mctx,
|
||||
&rcvquerystats);
|
||||
}
|
||||
dns_zone_setrequeststats(zone, zoneqrystats);
|
||||
dns_zone_setrcvquerystats(zone, rcvquerystats);
|
||||
@@ -1272,12 +1267,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 "
|
||||
"%" ISC_PRINT_QUADFORMAT "d' "
|
||||
"%" PRId64 "' "
|
||||
"is too large",
|
||||
value);
|
||||
RETERR(ISC_R_RANGE);
|
||||
}
|
||||
journal_size = (isc_uint32_t)value;
|
||||
journal_size = (uint32_t)value;
|
||||
}
|
||||
if (raw != NULL)
|
||||
dns_zone_setjournalsize(raw, journal_size);
|
||||
@@ -1294,22 +1289,22 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
"master") == 0) &&
|
||||
ztype == dns_zone_master)
|
||||
{
|
||||
ixfrdiff = ISC_TRUE;
|
||||
ixfrdiff = true;
|
||||
} else if ((strcasecmp(cfg_obj_asstring(obj),
|
||||
"secondary") == 0 ||
|
||||
strcasecmp(cfg_obj_asstring(obj),
|
||||
"slave") == 0) &&
|
||||
ztype == dns_zone_slave)
|
||||
{
|
||||
ixfrdiff = ISC_TRUE;
|
||||
ixfrdiff = true;
|
||||
} else {
|
||||
ixfrdiff = ISC_FALSE;
|
||||
ixfrdiff = false;
|
||||
}
|
||||
if (raw != NULL) {
|
||||
dns_zone_setoption(raw, DNS_ZONEOPT_IXFRFROMDIFFS,
|
||||
ISC_TRUE);
|
||||
true);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_IXFRFROMDIFFS,
|
||||
ISC_FALSE);
|
||||
false);
|
||||
} else
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_IXFRFROMDIFFS,
|
||||
ixfrdiff);
|
||||
@@ -1327,12 +1322,12 @@ 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 = ISC_FALSE;
|
||||
check = ISC_TRUE;
|
||||
fail = false;
|
||||
check = true;
|
||||
} else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
|
||||
fail = check = ISC_TRUE;
|
||||
fail = check = true;
|
||||
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
|
||||
fail = check = ISC_FALSE;
|
||||
fail = check = false;
|
||||
} else
|
||||
INSIST(0);
|
||||
if (raw != NULL) {
|
||||
@@ -1341,9 +1336,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
dns_zone_setoption(raw, DNS_ZONEOPT_CHECKNAMESFAIL,
|
||||
fail);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKNAMES,
|
||||
ISC_FALSE);
|
||||
false);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKNAMESFAIL,
|
||||
ISC_FALSE);
|
||||
false);
|
||||
} else {
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKNAMES,
|
||||
check);
|
||||
@@ -1366,9 +1361,9 @@ 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 = ISC_TRUE;
|
||||
check = true;
|
||||
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
|
||||
check = ISC_FALSE;
|
||||
check = false;
|
||||
} else
|
||||
INSIST(0);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_CHECKSPF, check);
|
||||
@@ -1405,12 +1400,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 "
|
||||
"%" ISC_PRINT_QUADFORMAT "d' "
|
||||
"%" PRId64 "' "
|
||||
"is too large",
|
||||
value);
|
||||
RETERR(ISC_R_RANGE);
|
||||
}
|
||||
journal_size = (isc_uint32_t)value;
|
||||
journal_size = (uint32_t)value;
|
||||
}
|
||||
dns_zone_setjournalsize(zone, journal_size);
|
||||
}
|
||||
@@ -1440,8 +1435,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;
|
||||
isc_boolean_t allow = ISC_FALSE, maint = ISC_FALSE;
|
||||
isc_boolean_t sigvalinsecs;
|
||||
bool allow = false, maint = false;
|
||||
bool sigvalinsecs;
|
||||
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "dnskey-sig-validity", &obj);
|
||||
@@ -1522,9 +1517,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
const char *arg = cfg_obj_asstring(obj);
|
||||
if (strcasecmp(arg, "allow") == 0)
|
||||
allow = ISC_TRUE;
|
||||
allow = true;
|
||||
else if (strcasecmp(arg, "maintain") == 0)
|
||||
allow = maint = ISC_TRUE;
|
||||
allow = maint = true;
|
||||
else if (strcasecmp(arg, "off") == 0)
|
||||
;
|
||||
else
|
||||
@@ -1550,7 +1545,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 = ISC_FALSE;
|
||||
check = false;
|
||||
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKWILDCARD, check);
|
||||
|
||||
/*
|
||||
@@ -1575,12 +1570,12 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
|
||||
}
|
||||
if (strcasecmp(dupcheck, "warn") == 0) {
|
||||
fail = ISC_FALSE;
|
||||
check = ISC_TRUE;
|
||||
fail = false;
|
||||
check = true;
|
||||
} else if (strcasecmp(dupcheck, "fail") == 0) {
|
||||
fail = check = ISC_TRUE;
|
||||
fail = check = true;
|
||||
} else if (strcasecmp(dupcheck, "ignore") == 0) {
|
||||
fail = check = ISC_FALSE;
|
||||
fail = check = false;
|
||||
} else
|
||||
INSIST(0);
|
||||
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKDUPRR, check);
|
||||
@@ -1590,12 +1585,12 @@ 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 = ISC_FALSE;
|
||||
check = ISC_TRUE;
|
||||
fail = false;
|
||||
check = true;
|
||||
} else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
|
||||
fail = check = ISC_TRUE;
|
||||
fail = check = true;
|
||||
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
|
||||
fail = check = ISC_FALSE;
|
||||
fail = check = false;
|
||||
} else
|
||||
INSIST(0);
|
||||
dns_zone_setoption(mayberaw, DNS_ZONEOPT_CHECKMX, check);
|
||||
@@ -1614,7 +1609,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 = ISC_FALSE;
|
||||
check = false;
|
||||
result = named_config_get(nodefault, "check-integrity",
|
||||
&obj);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
@@ -1627,12 +1622,12 @@ 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 = ISC_TRUE;
|
||||
ignore = ISC_FALSE;
|
||||
warn = true;
|
||||
ignore = false;
|
||||
} else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
|
||||
warn = ignore = ISC_FALSE;
|
||||
warn = ignore = false;
|
||||
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
|
||||
warn = ignore = ISC_TRUE;
|
||||
warn = ignore = true;
|
||||
} else
|
||||
INSIST(0);
|
||||
dns_zone_setoption(mayberaw, DNS_ZONEOPT_WARNMXCNAME, warn);
|
||||
@@ -1642,12 +1637,12 @@ 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 = ISC_TRUE;
|
||||
ignore = ISC_FALSE;
|
||||
warn = true;
|
||||
ignore = false;
|
||||
} else if (strcasecmp(cfg_obj_asstring(obj), "fail") == 0) {
|
||||
warn = ignore = ISC_FALSE;
|
||||
warn = ignore = false;
|
||||
} else if (strcasecmp(cfg_obj_asstring(obj), "ignore") == 0) {
|
||||
warn = ignore = ISC_TRUE;
|
||||
warn = ignore = true;
|
||||
} else
|
||||
INSIST(0);
|
||||
dns_zone_setoption(mayberaw, DNS_ZONEOPT_WARNSRVCNAME, warn);
|
||||
@@ -1667,7 +1662,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
const char *arg = cfg_obj_asstring(obj);
|
||||
if (strcasecmp(arg, "no-resign") == 0)
|
||||
dns_zone_setkeyopt(zone, DNS_ZONEKEY_NORESIGN,
|
||||
ISC_TRUE);
|
||||
true);
|
||||
else if (strcasecmp(arg, "maintain") == 0)
|
||||
;
|
||||
else
|
||||
@@ -1715,7 +1710,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
result = dns_zone_setmasters(mayberaw, NULL, 0);
|
||||
RETERR(result);
|
||||
|
||||
multi = ISC_FALSE;
|
||||
multi = false;
|
||||
if (count > 1) {
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "multi-master", &obj);
|
||||
@@ -1727,7 +1722,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
obj = NULL;
|
||||
(void)cfg_map_get(zoptions, "mirror", &obj);
|
||||
if (obj != NULL) {
|
||||
isc_boolean_t mirror = cfg_obj_asboolean(obj);
|
||||
bool mirror = cfg_obj_asboolean(obj);
|
||||
dns_zone_setoption(mayberaw, DNS_ZONEOPT_MIRROR,
|
||||
mirror);
|
||||
if (mirror) {
|
||||
@@ -1741,7 +1736,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
&obj);
|
||||
if (obj == NULL) {
|
||||
dns_acl_t *none;
|
||||
RETERR(dns_acl_none(mctx, &none));
|
||||
dns_acl_none(mctx, &none);
|
||||
dns_zone_setxfracl(zone, none);
|
||||
dns_acl_detach(&none);
|
||||
}
|
||||
@@ -1836,9 +1831,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 = ISC_TRUE;
|
||||
alt = true;
|
||||
else
|
||||
alt = ISC_FALSE;
|
||||
alt = false;
|
||||
} else
|
||||
alt = cfg_obj_asboolean(obj);
|
||||
dns_zone_setoption(mayberaw, DNS_ZONEOPT_USEALTXFRSRC, alt);
|
||||
@@ -1877,22 +1872,20 @@ named_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase,
|
||||
TIME_NOW(&now);
|
||||
|
||||
dns_zone_settype(zone, dns_zone_dlz);
|
||||
result = dns_sdlz_setdb(dlzdatabase, rdclass, name, &db);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
dns_sdlz_setdb(dlzdatabase, rdclass, name, &db);
|
||||
result = dns_zone_dlzpostload(zone, db);
|
||||
dns_db_detach(&db);
|
||||
return (result);
|
||||
}
|
||||
|
||||
isc_boolean_t
|
||||
bool
|
||||
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;
|
||||
isc_boolean_t has_raw, mirror;
|
||||
bool has_raw, mirror;
|
||||
dns_zonetype_t ztype;
|
||||
|
||||
zoptions = cfg_tuple_get(zconfig, "options");
|
||||
@@ -1904,7 +1897,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 (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
/* If there's a raw zone, use that for filename and type comparison */
|
||||
@@ -1913,11 +1906,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 = ISC_TRUE;
|
||||
has_raw = true;
|
||||
} else {
|
||||
zfilename = dns_zone_getfile(zone);
|
||||
ztype = dns_zone_gettype(zone);
|
||||
has_raw = ISC_FALSE;
|
||||
has_raw = false;
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
@@ -1925,18 +1918,18 @@ 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 (ISC_FALSE);
|
||||
return (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 (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Do not reuse a zone whose "mirror" setting was changed.
|
||||
*/
|
||||
obj = NULL;
|
||||
mirror = ISC_FALSE;
|
||||
mirror = false;
|
||||
(void)cfg_map_get(zoptions, "mirror", &obj);
|
||||
if (obj != NULL) {
|
||||
mirror = cfg_obj_asboolean(obj);
|
||||
@@ -1944,13 +1937,13 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
|
||||
if (dns_zone_ismirror(zone) != mirror) {
|
||||
dns_zone_log(zone, ISC_LOG_DEBUG(1),
|
||||
"not reusable: mirror setting changed");
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
if (zonetype_fromconfig(zoptions) != ztype) {
|
||||
dns_zone_log(zone, ISC_LOG_DEBUG(1),
|
||||
"not reusable: type mismatch");
|
||||
return (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
@@ -1965,8 +1958,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 (ISC_FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
return (ISC_TRUE);
|
||||
return (true);
|
||||
}
|
||||
|
||||
+172
-206
File diff suppressed because it is too large
Load Diff
@@ -68,7 +68,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@READLINE_LIBD@@GSSAPI_LIB@@KRB5_LIB@libisc.lib;libdns.lib;libbind9.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@@READLINE_LIBD@@GSSAPI_LIB@@KRB5_LIB@libisc.lib;libdns.lib;libbind9.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -98,7 +98,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\irs\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>@READLINE_LIB@@GSSAPI_LIB@@KRB5_LIB@libisc.lib;libdns.lib;libbind9.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@@READLINE_LIB@@GSSAPI_LIB@@KRB5_LIB@libisc.lib;libdns.lib;libbind9.lib;libisccfg.lib;libirs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -149,8 +149,8 @@ main(int argc, char *argv[]) {
|
||||
pin = getpass("Enter Pin: ");
|
||||
}
|
||||
|
||||
result = pk11_get_session(&pctx, OP_ANY, ISC_FALSE, ISC_TRUE,
|
||||
ISC_TRUE, (const char *) pin, slot);
|
||||
result = pk11_get_session(&pctx, OP_ANY, false, true,
|
||||
true, (const char *) pin, slot);
|
||||
if (result == PK11_R_NORANDOMSERVICE ||
|
||||
result == PK11_R_NODIGESTSERVICE ||
|
||||
result == PK11_R_NOAESSERVICE) {
|
||||
|
||||
@@ -563,8 +563,8 @@ main(int argc, char *argv[]) {
|
||||
pin = getpass("Enter Pin: ");
|
||||
}
|
||||
|
||||
result = pk11_get_session(&pctx, op_type, ISC_FALSE, ISC_TRUE,
|
||||
ISC_TRUE, (const char *) pin, slot);
|
||||
result = pk11_get_session(&pctx, op_type, false, true,
|
||||
true, (const char *) pin, slot);
|
||||
if (result == PK11_R_NORANDOMSERVICE ||
|
||||
result == PK11_R_NODIGESTSERVICE ||
|
||||
result == PK11_R_NOAESSERVICE) {
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
@@ -67,7 +68,7 @@ main(int argc, char *argv[]) {
|
||||
char *lib_name = NULL;
|
||||
char *label = NULL;
|
||||
char *pin = NULL;
|
||||
isc_boolean_t error = ISC_FALSE, logon = ISC_TRUE, all = ISC_FALSE;
|
||||
bool error = false, logon = true, all = false;
|
||||
unsigned int i = 0, id = 0;
|
||||
int c, errflg = 0;
|
||||
CK_ULONG ulObjectCount;
|
||||
@@ -78,7 +79,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 = ISC_FALSE;
|
||||
logon = false;
|
||||
break;
|
||||
case 'm':
|
||||
lib_name = isc_commandline_argument;
|
||||
@@ -117,7 +118,7 @@ main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
if (!id && (label == NULL))
|
||||
all = ISC_TRUE;
|
||||
all = true;
|
||||
|
||||
if (slot)
|
||||
printf("slot %lu\n", slot);
|
||||
@@ -143,7 +144,7 @@ main(int argc, char *argv[]) {
|
||||
pin = getpass("Enter Pin: ");
|
||||
}
|
||||
|
||||
result = pk11_get_session(&pctx, OP_ANY, ISC_FALSE, ISC_FALSE,
|
||||
result = pk11_get_session(&pctx, OP_ANY, false, false,
|
||||
logon, pin, slot);
|
||||
if (result == PK11_R_NORANDOMSERVICE ||
|
||||
result == PK11_R_NODIGESTSERVICE ||
|
||||
|
||||
@@ -46,7 +46,7 @@ main(int argc, char *argv[]) {
|
||||
lib_name = isc_commandline_argument;
|
||||
break;
|
||||
case 'v':
|
||||
pk11_verbose_init = ISC_TRUE;
|
||||
pk11_verbose_init = 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, ISC_TRUE, ISC_FALSE,
|
||||
ISC_FALSE, NULL, 0);
|
||||
result = pk11_get_session(&pctx, OP_ANY, true, false,
|
||||
false, NULL, 0);
|
||||
if (result == PK11_R_NORANDOMSERVICE ||
|
||||
result == PK11_R_NODIGESTSERVICE ||
|
||||
result == PK11_R_NOAESSERVICE) {
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -100,7 +100,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -100,7 +100,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -100,7 +100,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -100,7 +100,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@libisc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
+34
-33
@@ -13,6 +13,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/app.h>
|
||||
@@ -53,7 +55,7 @@
|
||||
#define SERVERADDRS 10
|
||||
|
||||
const char *progname;
|
||||
isc_boolean_t verbose;
|
||||
bool verbose;
|
||||
|
||||
static const char *admin_conffile;
|
||||
static const char *admin_keyfile;
|
||||
@@ -61,26 +63,26 @@ static const char *version = VERSION;
|
||||
static const char *servername = NULL;
|
||||
static isc_sockaddr_t serveraddrs[SERVERADDRS];
|
||||
static isc_sockaddr_t local4, local6;
|
||||
static isc_boolean_t local4set = ISC_FALSE, local6set = ISC_FALSE;
|
||||
static bool local4set = false, local6set = false;
|
||||
static int nserveraddrs;
|
||||
static int currentaddr = 0;
|
||||
static unsigned int remoteport = 0;
|
||||
static isc_socketmgr_t *socketmgr = NULL;
|
||||
static isc_buffer_t *databuf;
|
||||
static isccc_ccmsg_t ccmsg;
|
||||
static isc_uint32_t algorithm;
|
||||
static uint32_t algorithm;
|
||||
static isccc_region_t secret;
|
||||
static isc_boolean_t failed = ISC_FALSE;
|
||||
static isc_boolean_t c_flag = ISC_FALSE;
|
||||
static bool failed = false;
|
||||
static bool c_flag = false;
|
||||
static isc_mem_t *rndc_mctx;
|
||||
static int sends, recvs, connects;
|
||||
static char *command;
|
||||
static char *args;
|
||||
static char program[256];
|
||||
static isc_socket_t *sock = NULL;
|
||||
static isc_uint32_t serial;
|
||||
static isc_boolean_t quiet = ISC_FALSE;
|
||||
static isc_boolean_t showresult = ISC_FALSE;
|
||||
static uint32_t serial;
|
||||
static bool quiet = false;
|
||||
static bool showresult = false;
|
||||
|
||||
static void rndc_startconnect(isc_sockaddr_t *addr, isc_task_t *task);
|
||||
|
||||
@@ -216,7 +218,7 @@ Version: %s\n",
|
||||
|
||||
static void
|
||||
preparse_args(int argc, char **argv) {
|
||||
isc_boolean_t ipv4only = ISC_FALSE, ipv6only = ISC_FALSE;
|
||||
bool ipv4only = false, ipv6only = false;
|
||||
int ch;
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
|
||||
@@ -225,20 +227,20 @@ preparse_args(int argc, char **argv) {
|
||||
if (ipv6only) {
|
||||
fatal("only one of -4 and -6 allowed");
|
||||
}
|
||||
ipv4only = ISC_TRUE;
|
||||
ipv4only = true;
|
||||
break;
|
||||
case '6':
|
||||
if (ipv4only) {
|
||||
fatal("only one of -4 and -6 allowed");
|
||||
}
|
||||
ipv6only = ISC_TRUE;
|
||||
ipv6only = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
isc_commandline_reset = ISC_TRUE;
|
||||
isc_commandline_reset = true;
|
||||
isc_commandline_index = 1;
|
||||
}
|
||||
|
||||
@@ -316,7 +318,7 @@ rndc_recvdone(isc_task_t *task, isc_event_t *event) {
|
||||
fatal("bad or missing data section in response");
|
||||
result = isccc_cc_lookupstring(data, "err", &errormsg);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
failed = ISC_TRUE;
|
||||
failed = true;
|
||||
fprintf(stderr, "%s: '%s' failed: %s\n",
|
||||
progname, command, errormsg);
|
||||
}
|
||||
@@ -357,7 +359,7 @@ rndc_recvnonce(isc_task_t *task, isc_event_t *event) {
|
||||
isccc_sexpr_t *_ctrl;
|
||||
isccc_region_t source;
|
||||
isc_result_t result;
|
||||
isc_uint32_t nonce;
|
||||
uint32_t nonce;
|
||||
isccc_sexpr_t *request = NULL;
|
||||
isccc_time_t now;
|
||||
isc_region_t r;
|
||||
@@ -565,7 +567,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
|
||||
const char *algorithmstr;
|
||||
static char secretarray[1024];
|
||||
const cfg_type_t *conftype = &cfg_type_rndcconf;
|
||||
isc_boolean_t key_only = ISC_FALSE;
|
||||
bool key_only = false;
|
||||
const cfg_listelt_t *element;
|
||||
|
||||
if (! isc_file_exists(conffile)) {
|
||||
@@ -578,7 +580,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
|
||||
if (! isc_file_exists(conffile))
|
||||
fatal("neither %s nor %s was found",
|
||||
admin_conffile, admin_keyfile);
|
||||
key_only = ISC_TRUE;
|
||||
key_only = true;
|
||||
} else if (! c_flag && isc_file_exists(admin_keyfile)) {
|
||||
fprintf(stderr, "WARNING: key file (%s) exists, but using "
|
||||
"default configuration file (%s)\n",
|
||||
@@ -730,7 +732,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
|
||||
obj = cfg_tuple_get(address, "port");
|
||||
if (cfg_obj_isuint32(obj)) {
|
||||
myport = cfg_obj_asuint32(obj);
|
||||
if (myport > ISC_UINT16_MAX ||
|
||||
if (myport > UINT16_MAX ||
|
||||
myport == 0)
|
||||
fatal("port %u out of range",
|
||||
myport);
|
||||
@@ -765,7 +767,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
|
||||
cfg_map_get(server, "source-address", &address);
|
||||
if (address != NULL) {
|
||||
local4 = *cfg_obj_assockaddr(address);
|
||||
local4set = ISC_TRUE;
|
||||
local4set = true;
|
||||
}
|
||||
}
|
||||
if (!local4set && options != NULL) {
|
||||
@@ -773,7 +775,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
|
||||
cfg_map_get(options, "default-source-address", &address);
|
||||
if (address != NULL) {
|
||||
local4 = *cfg_obj_assockaddr(address);
|
||||
local4set = ISC_TRUE;
|
||||
local4set = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -782,7 +784,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
|
||||
cfg_map_get(server, "source-address-v6", &address);
|
||||
if (address != NULL) {
|
||||
local6 = *cfg_obj_assockaddr(address);
|
||||
local6set = ISC_TRUE;
|
||||
local6set = true;
|
||||
}
|
||||
}
|
||||
if (!local6set && options != NULL) {
|
||||
@@ -790,7 +792,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
|
||||
cfg_map_get(options, "default-source-address-v6", &address);
|
||||
if (address != NULL) {
|
||||
local6 = *cfg_obj_assockaddr(address);
|
||||
local6set = ISC_TRUE;
|
||||
local6set = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -800,7 +802,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname,
|
||||
int
|
||||
main(int argc, char **argv) {
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
isc_boolean_t show_final_mem = ISC_FALSE;
|
||||
bool show_final_mem = false;
|
||||
isc_taskmgr_t *taskmgr = NULL;
|
||||
isc_task_t *task = NULL;
|
||||
isc_log_t *log = NULL;
|
||||
@@ -831,7 +833,7 @@ main(int argc, char **argv) {
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("isc_app_start() failed: %s", isc_result_totext(result));
|
||||
|
||||
isc_commandline_errprint = ISC_FALSE;
|
||||
isc_commandline_errprint = false;
|
||||
|
||||
preparse_args(argc, argv);
|
||||
|
||||
@@ -853,17 +855,17 @@ main(int argc, char **argv) {
|
||||
if (inet_pton(AF_INET, isc_commandline_argument,
|
||||
&in) == 1) {
|
||||
isc_sockaddr_fromin(&local4, &in, 0);
|
||||
local4set = ISC_TRUE;
|
||||
local4set = true;
|
||||
} else if (inet_pton(AF_INET6, isc_commandline_argument,
|
||||
&in6) == 1) {
|
||||
isc_sockaddr_fromin6(&local6, &in6, 0);
|
||||
local6set = ISC_TRUE;
|
||||
local6set = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
admin_conffile = isc_commandline_argument;
|
||||
c_flag = ISC_TRUE;
|
||||
c_flag = true;
|
||||
break;
|
||||
|
||||
case 'k':
|
||||
@@ -875,7 +877,7 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
show_final_mem = ISC_TRUE;
|
||||
show_final_mem = true;
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
@@ -886,11 +888,11 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
quiet = ISC_TRUE;
|
||||
quiet = true;
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
showresult = ISC_TRUE;
|
||||
showresult = true;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
@@ -898,7 +900,7 @@ main(int argc, char **argv) {
|
||||
break;
|
||||
|
||||
case 'V':
|
||||
verbose = ISC_TRUE;
|
||||
verbose = true;
|
||||
break;
|
||||
|
||||
case 'y':
|
||||
@@ -930,7 +932,7 @@ main(int argc, char **argv) {
|
||||
|
||||
serial = isc_random32();
|
||||
|
||||
DO("create memory context", isc_mem_create(0, 0, &rndc_mctx));
|
||||
isc_mem_create(0, 0, &rndc_mctx);
|
||||
DO("create socket manager", isc_socketmgr_create(rndc_mctx, &socketmgr));
|
||||
DO("create task manager", isc_taskmgr_create(rndc_mctx, 1, 0, &taskmgr));
|
||||
DO("create task", isc_task_create(taskmgr, 0, &task));
|
||||
@@ -955,8 +957,7 @@ main(int argc, char **argv) {
|
||||
|
||||
command = *argv;
|
||||
|
||||
DO("allocate data buffer",
|
||||
isc_buffer_allocate(rndc_mctx, &databuf, 2048));
|
||||
isc_buffer_allocate(rndc_mctx, &databuf, 2048);
|
||||
|
||||
/*
|
||||
* Convert argc/argv into a space-delimited command string
|
||||
|
||||
@@ -575,7 +575,7 @@
|
||||
|
||||
<varlistentry>
|
||||
<term><userinput>nta
|
||||
<optional>( -d | -f | -r | -l <replaceable>duration</replaceable>)</optional>
|
||||
<optional>( -class <replaceable>class</replaceable> | -dump | -force | -remove | -lifetime <replaceable>duration</replaceable>)</optional>
|
||||
<replaceable>domain</replaceable>
|
||||
<optional><replaceable>view</replaceable></optional>
|
||||
</userinput></term>
|
||||
@@ -623,7 +623,7 @@
|
||||
is equivalent to <option>-remove</option>.
|
||||
</para>
|
||||
<para>
|
||||
If <option>-dump</option> is used, any other arguments
|
||||
If the <option>-dump</option> is used, any other arguments
|
||||
are ignored, and a list of existing NTAs is printed
|
||||
(note that this may include NTAs that are expired but
|
||||
have not yet been cleaned up).
|
||||
@@ -640,10 +640,15 @@
|
||||
lifetime, regardless of whether data could be
|
||||
validated if the NTA were not present.
|
||||
</para>
|
||||
<para>
|
||||
The view class can be specified with <option>-class</option>.
|
||||
The default is class <userinput>IN</userinput>, which is
|
||||
the only class for which DNSSEC is currently supported.
|
||||
</para>
|
||||
<para>
|
||||
All of these options can be shortened, i.e., to
|
||||
<option>-l</option>, <option>-r</option>, <option>-d</option>,
|
||||
and <option>-f</option>.
|
||||
<option>-f</option>, and <option>-c</option>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
+2
-2
@@ -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 isc_boolean_t verbose;
|
||||
extern bool verbose;
|
||||
extern const char *progname;
|
||||
|
||||
void
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>util.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@util.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|@PLATFORM@'">
|
||||
@@ -98,7 +98,7 @@
|
||||
<OutputFile>..\..\..\Build\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalLibraryDirectories>$(Configuration);..\..\..\lib\isc\win32\$(Configuration);..\..\..\lib\dns\win32\$(Configuration);..\..\..\lib\isccfg\win32\$(Configuration);..\..\..\lib\isccc\win32\$(Configuration);..\..\..\lib\bind9\win32\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>util.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>@OPENSSL_LIB@util.lib;libisc.lib;libdns.lib;libisccfg.lib;libisccc.lib;libbind9.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/mem.h>
|
||||
@@ -64,12 +65,12 @@ main(int argc, char **argv) {
|
||||
cfg_parser_t *pctx = NULL;
|
||||
cfg_obj_t *cfg = NULL;
|
||||
cfg_type_t *type = NULL;
|
||||
isc_boolean_t grammar = ISC_FALSE;
|
||||
isc_boolean_t memstats = ISC_FALSE;
|
||||
bool grammar = false;
|
||||
bool memstats = false;
|
||||
char *filename = NULL;
|
||||
unsigned int zonetype = 0;
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
result = isc_log_create(mctx, &lctx, &lcfg);
|
||||
check_result(result, "isc_log_create()");
|
||||
@@ -100,7 +101,7 @@ main(int argc, char **argv) {
|
||||
|
||||
while (argc > 1) {
|
||||
if (strcmp(argv[1], "--grammar") == 0) {
|
||||
grammar = ISC_TRUE;
|
||||
grammar = true;
|
||||
} else if (strcmp(argv[1], "--zonegrammar") == 0) {
|
||||
argv++, argc--;
|
||||
if (argc <= 1) {
|
||||
@@ -132,7 +133,7 @@ main(int argc, char **argv) {
|
||||
usage();
|
||||
}
|
||||
} else if (strcmp(argv[1], "--memstats") == 0) {
|
||||
memstats = ISC_TRUE;
|
||||
memstats = true;
|
||||
} else if (strcmp(argv[1], "--named") == 0) {
|
||||
type = &cfg_type_namedconf;
|
||||
} else if (strcmp(argv[1], "--rndc") == 0) {
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
/*! \file */
|
||||
#include <config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/hash.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
@@ -38,7 +40,7 @@
|
||||
isc_mem_t *mctx = NULL;
|
||||
isc_log_t *lctx = NULL;
|
||||
|
||||
static isc_boolean_t dst_active = ISC_FALSE;
|
||||
static bool dst_active = false;
|
||||
|
||||
/*
|
||||
* Logging categories: this needs to match the list in bin/named/log.c.
|
||||
@@ -95,10 +97,10 @@ main(int argc, char **argv) {
|
||||
journal = argv[4];
|
||||
|
||||
isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
|
||||
CHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
|
||||
CHECK(dst_lib_init(mctx, NULL));
|
||||
dst_active = ISC_TRUE;
|
||||
dst_active = true;
|
||||
|
||||
CHECK(isc_log_create(mctx, &lctx, &logconfig));
|
||||
isc_log_registercategories(lctx, categories);
|
||||
@@ -144,7 +146,7 @@ main(int argc, char **argv) {
|
||||
isc_log_destroy(&lctx);
|
||||
if (dst_active) {
|
||||
dst_lib_destroy();
|
||||
dst_active = ISC_FALSE;
|
||||
dst_active = false;
|
||||
}
|
||||
if (mctx != NULL)
|
||||
isc_mem_destroy(&mctx);
|
||||
|
||||
@@ -20,6 +20,7 @@ CDEFINES = @USE_GSSAPI@
|
||||
|
||||
CWARNINGS =
|
||||
BACKTRACECFLAGS = @BACKTRACECFLAGS@
|
||||
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
|
||||
|
||||
DNSLIBS = ../../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
|
||||
ISCLIBS = ../../../lib/isc/libisc.@A@ @OPENSSL_LIBS@
|
||||
@@ -51,7 +52,6 @@ XTARGETS = adb_test@EXEEXT@ \
|
||||
hash_test@EXEEXT@ \
|
||||
fsaccess_test@EXEEXT@ \
|
||||
inter_test@EXEEXT@ \
|
||||
keyboard_test@EXEEXT@ \
|
||||
lex_test@EXEEXT@ \
|
||||
lfsr_test@EXEEXT@ \
|
||||
log_test@EXEEXT@ \
|
||||
@@ -82,7 +82,6 @@ XSRCS = adb_test.c \
|
||||
fsaccess_test.c \
|
||||
gsstest.c \
|
||||
inter_test.c \
|
||||
keyboard_test.c \
|
||||
lex_test.c \
|
||||
lfsr_test.c \
|
||||
log_test.c \
|
||||
@@ -106,7 +105,7 @@ XSRCS = adb_test.c \
|
||||
|
||||
# disable optimization for backtrace test to get the expected result
|
||||
BTTEST_CFLAGS = ${BACKTRACECFLAGS} ${EXT_CFLAGS} ${ALL_CPPFLAGS} -g \
|
||||
${ALWAYS_WARNINGS} ${STD_CWARNINGS} ${CWARNINGS}
|
||||
${ALWAYS_WARNINGS} ${STD_CWARNINGS} ${CWARNINGS} ${PTHREAD_CFLAGS}
|
||||
|
||||
all_tests: ${XTARGETS}
|
||||
|
||||
@@ -240,10 +239,6 @@ inter_test@EXEEXT@: inter_test.@O@ ${ISCDEPLIBS}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ inter_test.@O@ \
|
||||
${ISCLIBS} ${LIBS}
|
||||
|
||||
keyboard_test@EXEEXT@: keyboard_test.@O@ ${ISCDEPLIBS}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ keyboard_test.@O@ \
|
||||
${ISCLIBS} ${LIBS}
|
||||
|
||||
sig0_test@EXEEXT@: sig0_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ sig0_test.@O@ \
|
||||
${DNSLIBS} ${ISCLIBS} ${LIBS}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user